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:
Joimer 2013-11-27 17:01:01 +01:00
parent 056ad5194e
commit 3b5d45590a

View File

@ -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);
}