Skip to content

Commit

Permalink
Fixed Disguise not ending the battle in the correct form (#4167)
Browse files Browse the repository at this point in the history
* Fixed Disguise not ending the battle in the correct form

* Added TODO comments
  • Loading branch information
AsparagusEduardo authored Feb 10, 2024
1 parent 0f312e3 commit 8b871b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,7 @@ static bool32 NoTargetPresent(u8 battler, u32 move)
return FALSE;
}

// TODO: Convert this to a proper FORM_CHANGE type.
static bool32 TryAegiFormChange(void)
{
// Only Aegislash with Stance Change can transform, transformed mons cannot.
Expand Down Expand Up @@ -2315,6 +2316,10 @@ static void Cmd_datahpupdate(void)
}
else if (DoesDisguiseBlockMove(gBattlerAttacker, battler, gCurrentMove))
{
// TODO: Convert this to a proper FORM_CHANGE type.
u32 side = GetBattlerSide(battler);
if (gBattleStruct->changedSpecies[side][gBattlerPartyIndexes[battler]] == SPECIES_NONE)
gBattleStruct->changedSpecies[side][gBattlerPartyIndexes[battler]] = gBattleMons[battler].species;
gBattleMons[battler].species = SPECIES_MIMIKYU_BUSTED;
BattleScriptPush(cmd->nextInstr);
gBattlescriptCurrInstr = BattleScript_TargetFormChange;
Expand Down Expand Up @@ -2491,6 +2496,7 @@ static void Cmd_resultmessage(void)
if (gBattleControllerExecFlags)
return;

// TODO: Convert this to a proper FORM_CHANGE type.
// Do Ice Face form change which was set up in Cmd_adjustdamage.
if (gBattleResources->flags->flags[gBattlerTarget] & RESOURCE_FLAG_ICE_FACE)
{
Expand Down Expand Up @@ -10113,6 +10119,7 @@ static void Cmd_various(void)
}
return;
}
// TODO: Convert this to a proper FORM_CHANGE type.
case VARIOUS_TRY_ACTIVATE_BATTLE_BOND:
{
VARIOUS_ARGS();
Expand Down Expand Up @@ -16231,6 +16238,7 @@ void BS_SetGlaiveRush(void)
gBattlescriptCurrInstr = cmd->nextInstr;
}

// TODO: Convert this to a proper FORM_CHANGE type.
void BS_TryRelicSong(void)
{
NATIVE_ARGS();
Expand Down
2 changes: 2 additions & 0 deletions src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -5667,6 +5667,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
&& TARGET_TURN_DAMAGED
&& IsBattlerAlive(battler))
{
// TODO: Convert this to a proper FORM_CHANGE type.
if (gBattleMons[gBattlerTarget].species == SPECIES_CRAMORANT_GORGING)
{
gBattleMons[gBattlerTarget].species = SPECIES_CRAMORANT;
Expand Down Expand Up @@ -6109,6 +6110,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
&& !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED)
&& gBattleStruct->allowedToChangeFormInWeather[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)])
{
// TODO: Convert this to a proper FORM_CHANGE type.
gBattleStruct->allowedToChangeFormInWeather[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)] = FALSE;
gBattleMons[battler].species = SPECIES_EISCUE_ICE_FACE;
BattleScriptPushCursorAndCallback(BattleScript_BattlerFormChangeWithStringEnd3);
Expand Down

0 comments on commit 8b871b7

Please sign in to comment.