From fc9725efadbd759e89a3c7b75b24c2e7b05ed2fa Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Wed, 19 Jun 2013 17:16:18 -0500 Subject: [PATCH] Show a fail message when force-switch moves fail --- data/scripts.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/data/scripts.js b/data/scripts.js index 0b38e22b8d..feb3ac1fdc 100644 --- a/data/scripts.js +++ b/data/scripts.js @@ -376,8 +376,6 @@ exports.BattleScripts = { return false; } didSomething = true; - } else if (damage === false && typeof hitResult === 'undefined') { - this.add('-fail', target); } if (damage === false || damage === null) { if (damage === false) { @@ -472,10 +470,11 @@ exports.BattleScripts = { } } } - if (target && target.hp > 0 && pokemon.hp > 0) { - if (moveData.forceSwitch && this.runEvent('DragOut', target, pokemon, move)) { + if (target && target.hp > 0 && pokemon.hp > 0 && moveData.forceSwitch) { + hitResult = this.runEvent('DragOut', target, pokemon, move); + if (hitResult) { target.forceSwitchFlag = true; - } else { + } else if (hitResult === false) { this.add('-fail', target); } }