The intention for this event is to remove the move disabling code away
from ModifyPokemon and to an event that can be run a fewer number of
times. Since the disabledMoves index is used to gray-out moves that cannot
be used, and not for any other purpose, there is no need for the related
code to be run at the ModifyPokemon timing, instead working better as a
once per turn event.
Set up moves to track the type effectiveness of the move for purposes of
'Hit' and 'ModifyDamage' events. This fixes various glitches resulting
from Pokemon with the 'IgnoreEffectiveness' flag set for some types, and
also is a slight optimization because it removes the need to run the
'Effectiveness' event one more time to check effectiveness in the moves.
While move.affectedByImmunities was always a Boolean value to denote if
the move was affected by immunities, move.ignoreImmunity can be a Boolean
value if it ignores or is affected by all type immunities, but also can
act as an object such that !!move.ignoreImmunity[type] means it ignores
immunities of that type.
The NEXT Readme says that Shadow Tag only lasts one turn, and this is
solved by applying a volatile to the Pokemon with Shadow Tag and removing
it when it attacks for the first time after switching in.
However, if the Pokemon with Shadow Tag is flinched, frozen, put to sleep,
or paralyzed, the effect of Shadow Tag will continue to later turns!
This is solved by giving Shadow Tag's BeforeMove event a higher priority
so that it can remove the volatile before flinching, and in case that
somehow doesn't trigger, give a set duration to the volatile as well.
Bone Club is the last, forgotten Bone attack, so we give it the same
immunity ignoring property that Bonemerang and Bone Rush have.
Updated the README to have these changes.
- Pokémon affected by Imprison -or Telepathy in NEXT- will now have a special flag 'maybeDisabled' in move requests if they are the last active pokémon.
- If a Pokémon having this flag attacks, the player will not be able to cancel their decision.
- Refactor Battle#parseChoice: Move decisions will now be parsed based on all the moves a pokémon knows after LockedMove, rather than only on validMoves. Any request to use a disabled move or a move with 0 PP will now be replied with a message in the form |callback|cant|[pokemon]|[sourceEffect]|[move], unless the pokémon has no valid moves, in which case it will use Struggle. The check for lockedMove in choice parsing is now performed as the first action after checking that the pokémon is not fainted. This prevents pokémon from Shifting to the center in Triples while being locked into a move.
- Don't report moves' being disabled to the client in requests if they are disabled due to Imprison or Telepathy. Instead, their being disabled will be reported using the mechanism described above.
- Implement BattlePokemon#isLastActive to do the check for whether this is the last non-fainted active pokémon in a team.
- BattlePokemon#tryTrap now accepts an argument that, if true, will hide the fact that a pokémon is trapped.
- This should revert an small (annoying) change in the UI for locked moves introduced as a secondary effect in 8afc588e4.
- NEXT: Shadow Tag shouldn't activate the 'maybeTrapped' flag after the suspected Shadow Tagger has made a move.
- Implement BattlePokemon#runEffectiveness, accounting for battle events.
- Refactor Tools#getEffectiveness accordingly.
- Remove Inverse mod. It's now implemented using the global event 'Effectiveness', and with a few changes in the base data for hazards and Arena Trap.
- NEXT: Fix Filter and Solid Rock not accounting for the special effects of Freeze Dry and Flying Press.
Update Shadow Tag to wear off onBeforeMove, instead of simply having a duration of 1, fixing a bug where Shadow Tag would wear off the same turn Unown switched in if it was not after having a Pokemon faint.
Update Bide to use StallMove, due to it giving it's user Endure for the duration.
Update Echoed Voice, so that the first hit can be protected against, and the second cannot. Also make both hits considered Sound moves.
Update Phantom Force to be in line with other two turn charge moves.
Update GossamerWing to no longer include Lilligant in the list of Pokemon who take reduced damage from Rock, Ice, or Electric type moves, as Lilligant is not a Flying type.
Update Truant's effect to have an onBeforeMovePriority of 99, like in the base files, to fix a small number of bugs where Slaking could still flinch on it's loafing turn, and having to recharge would interupt it as well.
JSHint is now a fair bit stricter, and is now correctly checking
files in `mods/`.
The code has been fixed to match the new stricter standards.
JSHint has now caught its second actual bug: Gen 5 Pinap Berry
was Ice instead of Grass.