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.
Added a new event, ModifyWeight, to deal with weight changes from items,
abilities, and moves. Add a function getWeight to call the event and
return a Pokemon's current weight.
The 'EndAbility' event was initially introduced for the implementation of
new weathers in ORAS, like Desolate Land, but has since been depreciated
in favor of an 'End' singleEvent.
Pickup was not retrieving items consumed by allies, was picking up items
from nonadjacent foes, and had a chance of failing to retrieve an item
from a foe if the other one had not used its item that turn. Pickup now
queries all eligible Pokemon before randomly choosing one of the items to
pick up, instead of choosing the target before checking whether it had an
item that could be retrieved.
Switched Unburden's onUseItem handler to onAfterUseItem instead, and set
Natural Gift, Air Balloon and Fling to send AfterUseItem events when the
items are removed. Sending these events also has the side effect of fixing
some of the functionality with Symbiosis not giving items when these moves
consume their items.
Drifblim almost never runs it. And even in formats that allow any
ability, it isn't even used half as much as Guts. Lack of a Special
Facade is probably why.
Moved all checks for primal weather into setWeather() instead of
hard-coding the check into every effect attempting to change the weather.
Also to prevent hardcoding, the check now runs on the event system, and
the primal weathers themselves deny regular weathers from being set.
Moved Anger Point's check for critical from onCritical to onAfterDamage.
This not only allows it to avoid being suppressed by Mold Breaker, it
also results in the Anger Point message being displayed in the correct
order with respect to the other messages.
Unaware currently doesn't work because the ModifyMove event is fired on the move before each target is caculated in doubles and triples.
This means that the ModifyMove event should be fired for each target and the move not modified unless it fits the attacker-target.
It's easier and less expensive to use an ability property to check on attacker/target than to fire events.
This fixes Unaware in doubles/triples.
It takes account interaction with Mold Breaker, Gastro Acid, and other ability supressers.
Fixed ability interactions with Hidden Power, Judgment, and other moves
that change their types.
-ate Abilities don't trigger with Natural Gift.
Normalize > move's type change > -ate Ability > Ion Deluge/Electrify
For Gen 4, the order is: move's type change > Normalize
Thought this was fixed a long time ago:
2014-01-12
15:16:23: <Marty> V4, if Fur Coat halves Psyshock damage, it must be
Huge Power for Defense, yes?
15:17:13: <V4> Ya
15:17:32: <Marty> cool
2014-01-19
17:31:20: <CDXCIV> Marty did you ever try that thing with Fur Coat?
17:32:24: <Marty> the Psyshock thing? yeah I tried it before asking you
17:32:46: <Marty> it's double Defense
For shame, V4 :(
Added functionality for setAbility to send End events to abilities.
Fixed bug with Mold Breaker negating all Battle#singleEvent ability calls,
even those that don't involve damage calculation.
Fixed Skill Swap to now use End and Start events in the right order:
send the End events, then change the abilities, then send Start events.
If the same ability is swapped, don't send End events (the game simply
re-activates the abilities in question)
Moved SwitchOut/Faint events from weather to ability so the weather
can interact properly with Cloud Nine or Air Lock.
Primal weathers persist if a Pokemon with the relevant ability is
on-field, even if the originator switches out.