mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-15 00:40:13 -05:00
Add the possibility for abilities to run onHit events for both attackers
Just as with moves, add the same possibility to abilities so onHit is run on both sides, allowing new ability effects to be added.
This commit is contained in:
parent
056ad5194e
commit
3b5d45590a
|
|
@ -443,6 +443,8 @@ exports.BattleScripts = {
|
|||
if (moveData.onHitSide) hitResult = this.singleEvent('HitSide', moveData, {}, target.side, pokemon, move);
|
||||
} else {
|
||||
if (moveData.onHit) hitResult = this.singleEvent('Hit', moveData, {}, target, pokemon, move);
|
||||
var ability = pokemon.battle.getAbility(pokemon.ability);
|
||||
if (ability.onHit) hitResult = this.singleEvent('Hit', ability, {}, target, pokemon, move);
|
||||
if (!isSelf && !isSecondary) {
|
||||
this.runEvent('Hit', target, pokemon, move);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user