Megas now have their own viable moves, so that more unique megas like Heracross, Charizard and Mewtwo can have their viable options.
Potential mega evolving candidates can now be selected without their mega stone. For example, if the team has Gengar with Gengarite, Heracross without Heracronite can be added.
Make multiple mega evolution selection random
It mistakenly always picked the Y forme rather than randomly choosing either.
Reduce number of getTemplate() calls
Slayer95 pointed out that this is a better implementation.
Fix syntax error
Improve randoms mega selection
Simplifying the code by having the mega template stored in 'template'. For abilities, the original template is stored in 'baseTemplate'. Also added the improved mega selection for Random Doubles, which would be affected by giving viable moves to megas in formats-data.js.
Improve mega selection in randoms
Megas now have their own viable moves, so that more unique megas like
Heracross, Charizard and Mewtwo can have their viable options. Potential
mega evolving candidates can now be selected without their mega stone.
For example, if the team has Gengar with Gengarite, Heracross without
Heracronite can be added.
- Recoil for Parental Bond Double Edge, etc should happen after all the hits have finished.
- Also removed the event 'Secondary', currently unused in the codebase.
If a Pokemon has recovery, it plans to survive in the long-term and having a move that sacrifices itself is unwanted.
(This was found on probably the worst set ever seen in Random Battles: Memento / Rest / Sleep Talk / Poison Jab)
TI said to remove this segment previously, but evidently the problem still persists because I got 3 pokemon with both moves in the same battle, which was completely useless.
I chose 300 as a sum of Defense, Special Defense and HP that would designate a high bulk Pokemon, due to being just below Dusknoir's sum of the three and I was getting Focus Sash Dusknoir, which is rather subpar. The number could be changed if there's any better way to designate bulk.
Sigilyph's randoms moveset is built solely for use with Magic Guard, and without being able to automatically pass on status, Tinted Lens Sigilyph is pretty much just a free switch in and set-up fodder for a dark type. Wonder Skin is even worse in that it reduces the need for Psycho Shift.