Since move.ignoreImmunity was defined as `false` for Thunder Wave, the statement !move.ignoreImmunity would always evaluate to true.
This would lead to move.ignoreImmunity being true for all status moves.
This commit fixes that problem, checking if the property was not defined as opposed to anything JavaScript deems `false`.
Related: 2e56120ad9
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.
- Griseous Orb, Plates, Drives, and Mega Stones can no longer be removed
from or given to their respective species by any means
- Mold Breaker and friends can no longer remove a Plate from an Arceus
- The Fling base power for these related items is now defined in Tools,
like Berries
- Sticky Hold works correctly with Bestow, Fling, Knock Off, Switcheroo,
and Trick
- Immunities turn into weaknesses (I don't know how I could forget that).
- Tools#getImmunity is now similar to Tools#getEffectiveness. Also add a bit of documentation, since there seems to be a lot of confusion about its usage.
- 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.
mods are now loaded the first time Tools.mod() is called, rather
than during startup.
This has two effects:
1. Significantly faster startup
2. Less RAM usage on main process, which never uses Tools.mod()
at all
Sadly, the amount of RAM saved is pretty insignificant on main,
but it could be nice for smaller servers.
I used a hack to make the multiple declaration errors go away,
so all that remained in jsHint were actual errors, which I've
now mostly fixed.
All this linting ended up uncovering one actual bug: Uproar's
message not showing. It's a very minor bug in a move no one uses,
so I'm going to fold it into this commit.
Teams are now sent using our new packTeam/unpackTeam code, rather
than JSON. This compresses teams from an average of 2000 bytes to
an average of 500 bytes.
Fixes Trick-or-Treat and Forest´s Curse stacking.
Fixes Roost overriding other type changes when it ends.
Fixes Roost not suppressing Flying type adquired afterwards in the turn.
Fixes mons not adquiring Flying type when transforming into a roosted pokemon.
Fixes nature of types (added by Trick-or-Treat or Forest´s Curse) not being passed on use of Reflect Type or Transform.