Fix Sheer Force properly

This commit is contained in:
Marty-D 2015-05-04 10:45:44 -04:00
parent 6ba4e24ecd
commit 1209954765
2 changed files with 2 additions and 4 deletions

View File

@ -2336,9 +2336,7 @@ exports.BattleAbilities = {
onModifyMove: function (move, pokemon) {
if (move.secondaries) {
delete move.secondaries;
move.negateSecondary = true;
// Actual negation of `AfterMoveSecondary` effects implemented in scripts.js
// negateSecondary will only happen if the Pokémon keeps having the Sheer Force ability in that step.
pokemon.addVolatile('sheerforce');
}
},

View File

@ -173,7 +173,7 @@ exports.BattleScripts = {
this.faint(pokemon, pokemon, move);
}
if (!move.negateSecondary || (move.negateSecondary && !pokemon.hasAbility('sheerforce'))) {
if (!move.negateSecondary && !(pokemon.hasAbility('sheerforce') && pokemon.volatiles['sheerforce'])) {
this.singleEvent('AfterMoveSecondarySelf', move, null, pokemon, target, move);
this.runEvent('AfterMoveSecondarySelf', pokemon, target, move);
}
@ -324,7 +324,7 @@ exports.BattleScripts = {
if (!damage && damage !== 0) return damage;
if (target && (!move.negateSecondary || (move.negateSecondary && !pokemon.hasAbility('sheerforce')))) {
if (target && !move.negateSecondary && !(pokemon.hasAbility('sheerforce') && pokemon.volatiles['sheerforce'])) {
this.singleEvent('AfterMoveSecondary', move, null, target, pokemon, move);
this.runEvent('AfterMoveSecondary', target, pokemon, move);
}