Skip to content

Commit

Permalink
Fixed sacrifice moves.
Browse files Browse the repository at this point in the history
  • Loading branch information
cathyjf committed Oct 5, 2010
1 parent 2c954c3 commit 007366f
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions resources/moves.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,12 @@ function makeSacrificeMove(move, func) {
}
user.faint();
var slot = user.position;
while (true) {
user.switchOut();
field.sendMessage("informReplacePokemon", user);
selection.sendOut(slot);
if (!selection.fainted)
break;
user = selection;
selection = field.requestInactivePokemon(user);
if (!selection) {
// The user has lost.
return;
}
user.switchOut();
field.sendMessage("informReplacePokemon", user);
selection.sendOut(slot);
if (!selection.fainted) {
func(field, selection);
}
func(field, selection);
};
}

Expand Down

0 comments on commit 007366f

Please sign in to comment.