diff --git a/battle-engine.js b/battle-engine.js index d5ec5d5cc9..fd303ea09a 100644 --- a/battle-engine.js +++ b/battle-engine.js @@ -3097,10 +3097,8 @@ Battle = (function () { ignorePositiveDefensive = true; } // Check for abilities to see if defenses or offenses are negated (Unaware, Mold Breaker, etc.) - var targetAbilityIgnoreOffensive = !target.ignore['Ability'] && target.getAbility().ignoreOffensive; - var pokemonAbilityIgnoreDefensive = !pokemon.ignore['Ability'] && pokemon.getAbility().ignoreDefensive; - var ignoreOffensive = !!(move.ignoreOffensive || targetAbilityIgnoreOffensive || (ignoreNegativeOffensive && atkBoosts < 0)); - var ignoreDefensive = !!(move.ignoreDefensive || pokemonAbilityIgnoreDefensive || (ignorePositiveDefensive && defBoosts > 0)); + var ignoreOffensive = !!(move.ignoreOffensive || (ignoreNegativeOffensive && atkBoosts < 0)); + var ignoreDefensive = !!(move.ignoreDefensive || (ignorePositiveDefensive && defBoosts > 0)); if (ignoreOffensive) { this.debug('Negating (sp)atk boost/penalty.'); diff --git a/data/abilities.js b/data/abilities.js index 0584702209..e29f1d3770 100644 --- a/data/abilities.js +++ b/data/abilities.js @@ -2994,10 +2994,20 @@ exports.BattleAbilities = { shortDesc: "This Pokemon ignores other Pokemon's stat stages when taking or doing damage.", id: "unaware", name: "Unaware", - ignoreEvasion: true, - ignoreDefensive: true, - ignoreAccuracy: true, - ignoreOffensive: true, + onAnyModifyBoost: function (boosts, target) { + var source = this.effectData.target; + if (source === target) return; + if (source === this.activePokemon && target === this.activeTarget) { + boosts['def'] = 0; + boosts['spd'] = 0; + boosts['evasion'] = 0; + } + if (target === this.activePokemon && source === this.activeTarget) { + boosts['atk'] = 0; + boosts['spa'] = 0; + boosts['accuracy'] = 0; + } + }, rating: 3, num: 109 }, diff --git a/data/scripts.js b/data/scripts.js index 0936221178..432c392554 100644 --- a/data/scripts.js +++ b/data/scripts.js @@ -229,8 +229,7 @@ exports.BattleScripts = { var accuracy = move.accuracy; var boosts, boost; if (accuracy !== true) { - var targetAbilityIgnoreAccuracy = !target.ignore['Ability'] && target.getAbility().ignoreAccuracy; - if (!move.ignoreAccuracy && !targetAbilityIgnoreAccuracy) { + if (!move.ignoreAccuracy) { boosts = this.runEvent('ModifyBoost', pokemon, null, null, Object.clone(this.boosts)); boost = this.clampIntRange(boosts['accuracy'], -6, 6); if (boost > 0) { @@ -239,8 +238,7 @@ exports.BattleScripts = { accuracy /= boostTable[-boost]; } } - var pokemonAbilityIgnoreEvasion = !pokemon.ignore['Ability'] && pokemon.getAbility().ignoreEvasion; - if (!move.ignoreEvasion && !pokemonAbilityIgnoreEvasion) { + if (!move.ignoreEvasion) { boosts = this.runEvent('ModifyBoost', pokemon, null, null, Object.clone(this.boosts)); boost = this.clampIntRange(boosts['evasion'], -6, 6); if (boost > 0) {