Fix Foresight and Miracle Eye to use ModifyBoost

Also deprecates move.ignorePositiveEvasion
This commit is contained in:
Kevin Lau 2015-03-24 23:48:24 -07:00
parent 47ea3b5f32
commit c5bc1a60d1
2 changed files with 9 additions and 5 deletions

View File

@ -4789,8 +4789,10 @@ exports.BattleMovedex = {
pokemon.negateImmunity['Fighting'] = true;
}
},
onSourceModifyMove: function (move) {
move.ignorePositiveEvasion = true;
onModifyBoost: function (boosts) {
if (boosts.evasion && boosts.evasion > 0) {
boosts.evasion = 0;
}
}
},
secondary: false,
@ -8746,8 +8748,10 @@ exports.BattleMovedex = {
onModifyPokemon: function (pokemon) {
if (pokemon.hasType('Dark')) pokemon.negateImmunity['Psychic'] = true;
},
onSourceModifyMove: function (move, source, target) {
move.ignorePositiveEvasion = true;
onModifyBoost: function (boosts) {
if (boosts.evasion && boosts.evasion > 0) {
boosts.evasion = 0;
}
}
},
secondary: false,

View File

@ -243,7 +243,7 @@ exports.BattleScripts = {
if (!move.ignoreEvasion && !pokemonAbilityIgnoreEvasion) {
boosts = this.runEvent('ModifyBoost', pokemon, null, null, Object.clone(this.boosts));
boost = this.clampIntRange(boosts['evasion'], -6, 6);
if (boost > 0 && !move.ignorePositiveEvasion) {
if (boost > 0) {
accuracy /= boostTable[boost];
} else if (boost < 0) {
accuracy *= boostTable[-boost];