Fixed Disguise not ending the battle in the correct form (#4167)

* Fixed Disguise not ending the battle in the correct form

* Added TODO comments
This commit is contained in:
Eduardo Quezada D'Ottone 2024-02-10 13:13:46 -03:00 committed by GitHub
parent 0f312e3f76
commit 8b871b7eb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -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.
@ -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;
@ -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)
{
@ -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();
@ -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();

View file

@ -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;
@ -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);