From 3b5d45590aaa2bd788e912cd217f682f2b1c265e Mon Sep 17 00:00:00 2001 From: Joimer Date: Wed, 27 Nov 2013 17:01:01 +0100 Subject: [PATCH] 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. --- data/scripts.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/scripts.js b/data/scripts.js index be551e71cb..da619dc81e 100644 --- a/data/scripts.js +++ b/data/scripts.js @@ -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); }