diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 55c62af98..8771ac73b 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -109,6 +109,8 @@ #define B_DISABLE_TURNS GEN_6 // Disable's turns. See Cmd_disablelastusedattack. #define B_INCINERATE_GEMS GEN_6 // In Gen6+, Incinerate can destroy Gems. #define B_MINIMIZE_DMG_ACC GEN_6 // In Gen6+, moves that causes double damage to minimized Pokémon will also skip accuracy checks. +#define B_PP_REDUCED_BY_SPITE GEN_6 // In Gen4+, Spite reduces the foe's last move's PP by 4, instead of 2 to 5. +#define B_SPITE_CAN_FAIL GEN_6 // In Gen4+, Spite can no longer fail if the foe's last move only has 1 remaining PP. // Ability settings #define B_ABILITY_WEATHER GEN_6 // In Gen5+, weather caused by abilities lasts the same amount of turns as induced from a move. Before, they lasted till the battle's end or weather change by a move. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 16e2989f8..4e9537e49 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -10192,9 +10192,18 @@ static void Cmd_tryspiteppreduce(void) break; } + #if B_CAN_SPITE_FAIL <= GEN_3 if (i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] > 1) + #else + if (i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] != 0) + #endif { + #if B_PP_REDUCED_BY_SPITE <= GEN_3 s32 ppToDeduct = (Random() & 3) + 2; + #else + s32 ppToDeduct = 4; + #endif + if (gBattleMons[gBattlerTarget].pp[i] < ppToDeduct) ppToDeduct = gBattleMons[gBattlerTarget].pp[i];