Skip to content

Commit

Permalink
Fix Relic Song transforming species other than Meloetta (#4799)
Browse files Browse the repository at this point in the history
  • Loading branch information
DizzyEggg authored Jun 14, 2024
1 parent 1a4f277 commit c7224d9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -16468,7 +16468,8 @@ void BS_TryRelicSong(void)
{
NATIVE_ARGS();

if (GetBattlerAbility(gBattlerAttacker) != ABILITY_SHEER_FORCE && !(gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED))
if (GetBattlerAbility(gBattlerAttacker) != ABILITY_SHEER_FORCE && !(gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED)
&& (gBattleMons[gBattlerAttacker].species == SPECIES_MELOETTA_ARIA || gBattleMons[gBattlerAttacker].species == SPECIES_MELOETTA_PIROUETTE))
{
if (gBattleMons[gBattlerAttacker].species == SPECIES_MELOETTA_ARIA)
gBattleMons[gBattlerAttacker].species = SPECIES_MELOETTA_PIROUETTE;
Expand All @@ -16479,7 +16480,9 @@ void BS_TryRelicSong(void)
gBattlescriptCurrInstr = BattleScript_AttackerFormChangeMoveEffect;
}
else
{
gBattlescriptCurrInstr = cmd->nextInstr;
}
}

void BS_SetPledge(void)
Expand Down
19 changes: 19 additions & 0 deletions test/battle/move_effect/relic_song.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,25 @@ SINGLE_BATTLE_TEST("Relic Song transforms Meloetta if used successfully")
}
}

SINGLE_BATTLE_TEST("Relic Song does not transform Pokemon other than Meloetta")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_RELIC_SONG); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_RELIC_SONG, player);
HP_BAR(opponent);
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Wobbuffet transformed!");
}
} THEN {
EXPECT_EQ(player->species, SPECIES_WOBBUFFET);
}
}

SINGLE_BATTLE_TEST("Relic Song transforms Meloetta twice if used successfully")
{
GIVEN {
Expand Down

0 comments on commit c7224d9

Please sign in to comment.