Fix Relic Song transforming species other than Meloetta (#4799)

This commit is contained in:
DizzyEggg 2024-06-14 10:24:57 +02:00 committed by GitHub
parent 1a4f277d6f
commit c7224d9ca7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 1 deletions

View file

@ -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;
@ -16479,7 +16480,9 @@ void BS_TryRelicSong(void)
gBattlescriptCurrInstr = BattleScript_AttackerFormChangeMoveEffect;
}
else
{
gBattlescriptCurrInstr = cmd->nextInstr;
}
}
void BS_SetPledge(void)

View file

@ -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 {