mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-09 04:23:45 -05:00
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.
This commit is contained in:
parent
837f6a69ac
commit
0aadcf0243
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user