Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Tidy Up #5819

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ BattleScript_EffectTidyUp::
pause B_WAIT_TIME_MED
ppreduce
waitstate
saveattacker
savetarget
trytidyup FALSE, BattleScript_EffectTidyUpDoMoveAnimation
restoreattacker
restoretarget
goto BattleScript_EffectDragonDanceFromStatUp

BattleScript_EffectTidyUpDoMoveAnimation::
Expand All @@ -143,6 +147,8 @@ BattleScript_EffectTidyUpDoMoveAnimation::
trytidyup TRUE, NULL
printstring STRINGID_TIDYINGUPCOMPLETE
waitmessage B_WAIT_TIME_LONG
restoreattacker
restoretarget
goto BattleScript_EffectDragonDanceFromStatUp

BattleScript_EffectUpperHand::
Expand Down
4 changes: 2 additions & 2 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -8839,8 +8839,8 @@ static bool32 TryDefogClear(u32 battlerAtk, bool32 clear)

static bool32 TryTidyUpClear(u32 battlerAtk, bool32 clear)
{
s32 i;
u8 saveBattler = gBattlerAttacker;
u32 i;
u32 saveBattler = gBattlerAttacker;

for (i = 0; i < NUM_BATTLE_SIDES; i++)
{
Expand Down
21 changes: 21 additions & 0 deletions test/battle/move_effect/tidy_up.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,24 @@ AI_SINGLE_BATTLE_TEST("AI will try to remove hazards if slower then target even
TURN { EXPECT_MOVE(opponent, MOVE_TIDY_UP); }
}
}

SINGLE_BATTLE_TEST("Tidy Up raises Attack and Speed by one after clearing hazards on opposing field")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_STEALTH_ROCK); }
TURN { MOVE(player, MOVE_TIDY_UP); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_STEALTH_ROCK, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_TIDY_UP, player);
MESSAGE("Tidying up complete!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's Attack rose!");
MESSAGE("Wobbuffet's Speed rose!");
} THEN {
EXPECT_EQ(player->statStages[STAT_ATK], DEFAULT_STAT_STAGE + 1);
EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE + 1);
}
}
Loading