diff --git a/data/abilities.js b/data/abilities.js index 4b2314988d..e0d6693c20 100644 --- a/data/abilities.js +++ b/data/abilities.js @@ -848,18 +848,10 @@ exports.BattleAbilities = { if (!source || source === target || !target.hp || !move.totalDamage) return; if (target.hp <= target.maxhp / 2 && target.hp + move.totalDamage > target.maxhp / 2) { if (!this.canSwitch(target.side) || target.forceSwitchFlag || target.switchFlag) return; - target.addVolatile('emergencyexit'); - } - }, - effect: { - onUpdatePriority: -10, - onUpdate: function (target) { - target.removeVolatile('emergencyexit'); - if (target.hp > target.maxhp / 2) return; target.switchFlag = true; - this.effectData.source.switchFlag = false; + source.switchFlag = false; this.add('-activate', target, 'ability: Emergency Exit'); - }, + } }, id: "emergencyexit", name: "Emergency Exit", diff --git a/data/scripts.js b/data/scripts.js index c5c7ef8ead..91a0be2051 100644 --- a/data/scripts.js +++ b/data/scripts.js @@ -460,6 +460,8 @@ exports.BattleScripts = { if (!damage && damage !== 0) return damage; + this.eachEvent('Update'); + if (target && !move.negateSecondary && !(pokemon.hasAbility('sheerforce') && pokemon.volatiles['sheerforce'])) { this.singleEvent('AfterMoveSecondary', move, null, target, pokemon, move); this.runEvent('AfterMoveSecondary', target, pokemon, move);