From 0aadcf024381ca406f40d134e19f92c2e0aba7fc Mon Sep 17 00:00:00 2001 From: "Cathy J. Fitzpatrick" Date: Tue, 11 Jun 2013 02:15:26 -0600 Subject: [PATCH] Correct mechanics when trying to use a 0 PP move There are two cases where a pokemon might attempt to execute a move with zero PP: - a move which had PP when selected, but whose PP was subsequently reduced to 0 by Spite; and - a case where a pokemon has multiple copies of the same move, in which case it will always be possible to select the move, but it will not be executed if it has 0 PP. Attempting to use a move with zero PP should not succeed. --- data/scripts.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/scripts.js b/data/scripts.js index 20c81682bf..984a9832a4 100644 --- a/data/scripts.js +++ b/data/scripts.js @@ -34,8 +34,10 @@ exports.BattleScripts = { pokemon.lastDamage = 0; var lockedMove = this.runEvent('LockMove', pokemon); if (lockedMove === true) lockedMove = false; - if (!lockedMove) { - pokemon.deductPP(move, null, target); + if (!lockedMove && !pokemon.deductPP(move, null, target)) { + this.add('cant', pokemon, 'nopp', move); + this.clearActiveMove(true); + return; } pokemon.moveUsed(move); this.useMove(move, pokemon, target, sourceEffect);