From d2e8afa13acb94e7826a21f2584e8c4802df71c7 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:04:56 +0200 Subject: [PATCH] Fixes Endure lasting forever (#7838) --- src/battle_main.c | 1 + test/battle/move_effect/endure.c | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/battle_main.c b/src/battle_main.c index e787366de8..bd08f559c1 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5143,6 +5143,7 @@ static void TurnValuesCleanUp(bool8 var0) gSpecialStatuses[i].parentalBondState = PARENTAL_BOND_OFF; gBattleStruct->battlerState[i].usedEjectItem = FALSE; gProtectStructs[i].lashOutAffected = FALSE; + gDisableStructs[i].endured = FALSE; } gSideTimers[B_SIDE_PLAYER].followmeTimer = 0; diff --git a/test/battle/move_effect/endure.c b/test/battle/move_effect/endure.c index f332fc28de..2d66bc41ef 100644 --- a/test/battle/move_effect/endure.c +++ b/test/battle/move_effect/endure.c @@ -1,13 +1,17 @@ #include "global.h" #include "test/battle.h" +ASSUMPTIONS +{ + ASSUME(GetMoveEffect(MOVE_ENDURE) == EFFECT_ENDURE); +} + TO_DO_BATTLE_TEST("Endure allows the user to survive any attack with 1 HP left"); SINGLE_BATTLE_TEST("Endure does not prevent multiple hits and stat changes occur at the end of the turn") { GIVEN { ASSUME(GetMoveEffect(MOVE_SCALE_SHOT) == EFFECT_MULTI_HIT); - ASSUME(GetMoveEffect(MOVE_ENDURE) == EFFECT_ENDURE); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { HP(1); } } WHEN { @@ -54,6 +58,23 @@ DOUBLE_BATTLE_TEST("Endure is not transferred to a mon that is switched in due t } } +SINGLE_BATTLE_TEST("Endure only lasts for one turn") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { HP(1); } + } WHEN { + TURN { MOVE(opponent, MOVE_ENDURE); MOVE(player, MOVE_POUND); } + TURN { MOVE(player, MOVE_POUND); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_ENDURE, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POUND, player); + MESSAGE("The opposing Wobbuffet endured the hit!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POUND, player); + NOT MESSAGE("The opposing Wobbuffet endured the hit!"); + } +} + TO_DO_BATTLE_TEST("Endure's success rate decreases for every consecutively used turn"); TO_DO_BATTLE_TEST("Endure uses the same counter as Protect"); TO_DO_BATTLE_TEST("Endure doesn't trigger effects that require damage to be done to the Pokémon (Gen 2-4)"); // Eg. Rough Skin