From bc0bbc5490e7eab8d23fb13f2e0c03928d029ac8 Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Mon, 15 Dec 2025 13:27:14 +0000 Subject: [PATCH] Fixes Instruct's message (#8543) --- src/battle_message.c | 2 +- src/battle_script_commands.c | 6 +++--- test/battle/move_effect/instruct.c | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/battle_message.c b/src/battle_message.c index 0ca29c0a46..1d73aed230 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -666,7 +666,7 @@ const u8 *const gBattleStringsTable[STRINGID_COUNT] = [STRINGID_SWEETVEILPROTECTED] = COMPOUND_STRING("{B_DEF_NAME_WITH_PREFIX} can't fall asleep due to a veil of sweetness!"), [STRINGID_AROMAVEILPROTECTED] = COMPOUND_STRING("{B_DEF_NAME_WITH_PREFIX} is protected by an aromatic veil!"), [STRINGID_CELEBRATEMESSAGE] = COMPOUND_STRING("Congratulations, {B_PLAYER_NAME}!"), - [STRINGID_USEDINSTRUCTEDMOVE] = COMPOUND_STRING("{B_ATK_NAME_WITH_PREFIX} followed {B_BUFF1}'s instructions!"), + [STRINGID_USEDINSTRUCTEDMOVE] = COMPOUND_STRING("{B_ATK_NAME_WITH_PREFIX} followed {B_SCR_NAME_WITH_PREFIX2}'s instructions!"), [STRINGID_THROATCHOPENDS] = COMPOUND_STRING("{B_ATK_NAME_WITH_PREFIX} can use sound-based moves again!"), [STRINGID_PKMNCANTUSEMOVETHROATCHOP] = COMPOUND_STRING("The effects of Throat Chop prevent {B_ATK_NAME_WITH_PREFIX2} from using certain moves!\p"), [STRINGID_LASERFOCUS] = COMPOUND_STRING("{B_ATK_NAME_WITH_PREFIX} concentrated intensely!"), diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 49c279c695..dda8e64c49 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -17343,18 +17343,18 @@ void BS_TryInstruct(void) if (gBattleMons[gBattlerTarget].moves[moveIndex] == gCalledMove) { gCurrMovePos = moveIndex; - moveIndex = 4; + moveIndex = MAX_MON_MOVES; break; } } - if (moveIndex != 4 || gBattleMons[gBattlerTarget].pp[gCurrMovePos] == 0) + if (moveIndex != MAX_MON_MOVES || gBattleMons[gBattlerTarget].pp[gCurrMovePos] == 0) { gBattlescriptCurrInstr = cmd->failInstr; } else { + gBattleScripting.battler = gBattlerAttacker; // for message gEffectBattler = gBattleStruct->lastMoveTarget[gBattlerTarget]; - PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gBattlerTarget, gBattlerPartyIndexes[gBattlerTarget]); gBattlescriptCurrInstr = cmd->nextInstr; } } diff --git a/test/battle/move_effect/instruct.c b/test/battle/move_effect/instruct.c index 312364a8b3..834546009f 100644 --- a/test/battle/move_effect/instruct.c +++ b/test/battle/move_effect/instruct.c @@ -6,6 +6,21 @@ ASSUMPTIONS ASSUME(GetMoveEffect(MOVE_INSTRUCT) == EFFECT_INSTRUCT); } +SINGLE_BATTLE_TEST("Instruct causes the target to use its last used move again") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Moves(MOVE_SCRATCH, MOVE_POUND, MOVE_SCRATCH, MOVE_CELEBRATE); } + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(player, MOVE_SCRATCH); MOVE(opponent, MOVE_INSTRUCT); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SCRATCH, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_INSTRUCT, opponent); + MESSAGE("Wobbuffet followed the opposing Wynaut's instructions!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SCRATCH, player); + } +} + DOUBLE_BATTLE_TEST("Instruct fails if target hasn't made a move") { GIVEN {