diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 0973ba8ef..34a8df0c1 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -4326,10 +4326,13 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_RELIC_SONG: #if (defined SPECIES_MELOETTA && defined SPECIES_MELOETTA_PIROUETTE) - if (AI_DATA->atkSpecies == SPECIES_MELOETTA && gBattleMons[battlerDef].defense < gBattleMons[battlerDef].spDefense) - score += 3; // Change to pirouette if can do more damage - else if (AI_DATA->atkSpecies == SPECIES_MELOETTA_PIROUETTE && gBattleMons[battlerDef].spDefense < gBattleMons[battlerDef].defense) - score += 3; // Change to Aria if can do more damage + if (!(gBattleMons[battlerAtk].status2 & STATUS2_TRANSFORMED)) // Don't try to change form if it's transformed. + { + if (AI_DATA->atkSpecies == SPECIES_MELOETTA && gBattleMons[battlerDef].defense < gBattleMons[battlerDef].spDefense) + score += 3; // Change to pirouette if can do more damage unless it + else if (AI_DATA->atkSpecies == SPECIES_MELOETTA_PIROUETTE && gBattleMons[battlerDef].spDefense < gBattleMons[battlerDef].defense) + score += 3; // Change to Aria if can do more damage + } #endif break; case EFFECT_ELECTRIC_TERRAIN: diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 0f2fdfe84..87998508d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3454,7 +3454,7 @@ void SetMoveEffect(bool32 primary, u32 certain) } break; case MOVE_EFFECT_RELIC_SONG: - if (GetBattlerAbility(gBattlerAttacker) != ABILITY_SHEER_FORCE) + if (GetBattlerAbility(gBattlerAttacker) != ABILITY_SHEER_FORCE && !(gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED)) { if (gBattleMons[gBattlerAttacker].species == SPECIES_MELOETTA) { diff --git a/src/battle_util.c b/src/battle_util.c index 7e2320500..8ee319bc0 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3877,6 +3877,9 @@ static bool32 ShouldChangeFormHpBased(u32 battler) }; u32 i; + if (gBattleMons[battler].status2 & STATUS2_TRANSFORMED) + return FALSE; + for (i = 0; i < ARRAY_COUNT(forms); i++) { if (GetBattlerAbility(battler) == forms[i][0])