From a641866648c4b359310b7943934b2e5d45f80ea3 Mon Sep 17 00:00:00 2001 From: Cathy Fitzpatrick Date: Sat, 16 Oct 2010 20:00:55 -0600 Subject: [PATCH] Fixed bugs related to moves that cause switching. --- resources/moves.js | 6 +++--- resources/moves.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/moves.js b/resources/moves.js index 028b9f7..131e397 100644 --- a/resources/moves.js +++ b/resources/moves.js @@ -34,9 +34,9 @@ function makeSacrificeMove(move, func) { return; } user.faint(); - var slot = user.position; - user.switchOut(); field.sendMessage("informReplacePokemon", user); + var slot = user.position; + user.switchOut(); // note: sets user.position to -1. selection.sendOut(slot); if (!selection.fainted) { func(field, selection); @@ -231,9 +231,9 @@ function makeRandomSwitchMove(move) { return; } var choice = choices[field.random(0, length - 1)]; + field.sendMessage("informReplacePokemon", target); var slot = target.position; target.switchOut(); // note: sets target.position to -1. - field.sendMessage("informReplacePokemon", target); choice.sendOut(slot); }; } diff --git a/resources/moves.xml b/resources/moves.xml index 74b79c4..b4f0a33 100644 --- a/resources/moves.xml +++ b/resources/moves.xml @@ -589,9 +589,9 @@ this.effects_.forEach(function(i) { field.narration = true; } }); +field.sendMessage("informBatonPass", user); var slot = user.position; user.switchOut(); -field.sendMessage("informBatonPass", user); selection.sendOut(slot); ]]>