From c5bc1a60d12b125e9bbf4752718d4b9119a5f42c Mon Sep 17 00:00:00 2001 From: Kevin Lau Date: Tue, 24 Mar 2015 23:48:24 -0700 Subject: [PATCH] Fix Foresight and Miracle Eye to use ModifyBoost Also deprecates move.ignorePositiveEvasion --- data/moves.js | 12 ++++++++---- data/scripts.js | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/data/moves.js b/data/moves.js index 1bde66fe00..574dc8bc43 100644 --- a/data/moves.js +++ b/data/moves.js @@ -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, diff --git a/data/scripts.js b/data/scripts.js index 842905d6b8..b45fa4dcc9 100644 --- a/data/scripts.js +++ b/data/scripts.js @@ -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];