diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index d7b597c53f..eea0bccaca 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -5550,6 +5550,9 @@ BattleScript_EffectStockpile:: waitanimation printfromtable gStockpileUsedStringIds waitmessage B_WAIT_TIME_LONG + .if B_STOCKPILE_RAISES_DEFS < GEN_4 + goto BattleScript_EffectStockpileEnd + .endif jumpifmovehadnoeffect BattleScript_EffectStockpileEnd jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_DEF, MAX_STAT_STAGE, BattleScript_EffectStockpileDef jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_SPDEF, MAX_STAT_STAGE, BattleScript_EffectStockpileEnd @@ -5572,9 +5575,11 @@ BattleScript_EffectStockpileEnd: goto BattleScript_MoveEnd BattleScript_MoveEffectStockpileWoreOff:: + .if B_STOCKPILE_RAISES_DEFS >= GEN_4 dostockpilestatchangeswearoff BS_ATTACKER, BattleScript_StockpileStatChangeDown printstring STRINGID_STOCKPILEDEFFECTWOREOFF waitmessage B_WAIT_TIME_SHORT + .endif return BattleScript_StockpileStatChangeDown: diff --git a/include/config/battle.h b/include/config/battle.h index a8f4a3e8b4..8fdf596cc3 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -96,7 +96,8 @@ #define B_DARK_VOID_FAIL GEN_LATEST // In Gen7+, only Darkrai can use Dark Void. #define B_BURN_HIT_THAW GEN_LATEST // In Gen6+, damaging moves with a chance of burn will thaw the target, regardless if they're fire-type moves or not. #define B_HEALING_WISH_SWITCH GEN_LATEST // In Gen5+, the mon receiving Healing Wish is sent out at the end of the turn. - // Additionally, in gen8+ the Healing Wish's effect will be stored until the user switches into a statused or hurt mon. + // Additionally, in gen8+ the Healing Wish's effect will be stored until the user switches into a statused or hurt mon +#define B_STOCKPILE_RAISES_DEFS GEN_LATEST // In Gen4+, Stockpile also raises Defense and Sp.Defense stats. Once Spit Up / Swallow is used, these stat changes are lost. // Ability settings #define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. diff --git a/test/move_effect_stockpile.c b/test/move_effect_stockpile.c index 1e62f766d7..0530355efb 100644 --- a/test/move_effect_stockpile.c +++ b/test/move_effect_stockpile.c @@ -148,6 +148,7 @@ SINGLE_BATTLE_TEST("Stockpile temporarily raises Def and Sp.Def", s16 dmgPyhsica PARAMETRIZE {move = MOVE_STOCKPILE;} PARAMETRIZE {move = MOVE_CELEBRATE;} GIVEN { + ASSUME(B_STOCKPILE_RAISES_DEFS >= GEN_4); ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); ASSUME(gBattleMoves[MOVE_GUST].split == SPLIT_SPECIAL); PLAYER(SPECIES_WOBBUFFET) {Speed(2); } @@ -183,6 +184,7 @@ DOUBLE_BATTLE_TEST("Stockpile's Def and Sp.Def boost is lost after using Spit Up PARAMETRIZE {count = 2, move = MOVE_SWALLOW;} PARAMETRIZE {count = 3, move = MOVE_SPIT_UP;} GIVEN { + ASSUME(B_STOCKPILE_RAISES_DEFS >= GEN_4); ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); ASSUME(gBattleMoves[MOVE_GUST].split == SPLIT_SPECIAL); PLAYER(SPECIES_WOBBUFFET) {Speed(4); HP(MAX_HP_TEST - 1); MaxHP(MAX_HP_TEST); }