From 18b87416d5f2a9b912a9ade9b932e9a25893ce68 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Wed, 3 Nov 2021 17:56:16 +1300 Subject: [PATCH] Fixes - Fix Sheer Force interaction (needed after adding | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN) - Fix "X Transformed!" target - Allow switching between both forms - Allow form change if target is KO'ed --- data/battle_scripts_1.s | 3 ++- src/battle_script_commands.c | 14 +++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 5bdada7b8..7e52d7d06 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -735,7 +735,7 @@ BattleScript_EffectAttackerDefenseDownHit: goto BattleScript_EffectHit BattleScript_EffectRelicSong: - setmoveeffect MOVE_EFFECT_RELIC_SONG | MOVE_EFFECT_CERTAIN + setmoveeffect MOVE_EFFECT_RELIC_SONG | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN attackcanceler accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring @@ -6966,6 +6966,7 @@ BattleScript_AttackerFormChangeMoveEffect:: handleformchange BS_ATTACKER, 1 playanimation BS_ATTACKER, B_ANIM_FORM_CHANGE, NULL waitanimation + copybyte sBATTLER, gBattlerAttacker printstring STRINGID_PKMNTRANSFORMED waitmessage B_WAIT_TIME_LONG handleformchange BS_ATTACKER, 2 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d88bf9944..d510a2746 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3394,10 +3394,18 @@ void SetMoveEffect(bool32 primary, u32 certain) } break; case MOVE_EFFECT_RELIC_SONG: - if (gBattleMons[gBattlerAttacker].species == SPECIES_MELOETTA) + if (GetBattlerAbility(gBattlerAttacker) != ABILITY_SHEER_FORCE) { - gBattleMons[gBattlerAttacker].species = SPECIES_MELOETTA_PIROUETTE; - BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeMoveEffect); + if (gBattleMons[gBattlerAttacker].species == SPECIES_MELOETTA) + { + gBattleMons[gBattlerAttacker].species = SPECIES_MELOETTA_PIROUETTE; + BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeMoveEffect); + } + else if (gBattleMons[gBattlerAttacker].species == SPECIES_MELOETTA_PIROUETTE) + { + gBattleMons[gBattlerAttacker].species = SPECIES_MELOETTA; + BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeMoveEffect); + } } break; }