Fixes Aegislash not reverting back (#5734)

This commit is contained in:
Alex 2024-11-28 23:21:42 +01:00 committed by GitHub
parent c4fe97011e
commit 0f4b598984
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 6 deletions

View file

@ -134,4 +134,8 @@
// param1: amount of days // param1: amount of days
#define FORM_CHANGE_DAYS_PASSED 23 #define FORM_CHANGE_DAYS_PASSED 23
// Form change for Aegislash
#define FORM_CHANGE_BATTLE_ATTACK 24
#define FORM_CHANGE_BATTLE_KINGS_SHIELD 25
#endif // GUARD_CONSTANTS_FORM_CHANGE_TYPES_H #endif // GUARD_CONSTANTS_FORM_CHANGE_TYPES_H

View file

@ -1127,7 +1127,6 @@ static bool32 NoTargetPresent(u8 battler, u32 move)
return FALSE; return FALSE;
} }
// TODO: Convert this to a proper FORM_CHANGE type.
static bool32 TryAegiFormChange(void) static bool32 TryAegiFormChange(void)
{ {
// Only Aegislash with Stance Change can transform, transformed mons cannot. // Only Aegislash with Stance Change can transform, transformed mons cannot.
@ -1142,12 +1141,12 @@ static bool32 TryAegiFormChange(void)
case SPECIES_AEGISLASH_SHIELD: // Shield -> Blade case SPECIES_AEGISLASH_SHIELD: // Shield -> Blade
if (IS_MOVE_STATUS(gCurrentMove)) if (IS_MOVE_STATUS(gCurrentMove))
return FALSE; return FALSE;
gBattleMons[gBattlerAttacker].species = SPECIES_AEGISLASH_BLADE; TryBattleFormChange(gBattlerAttacker, FORM_CHANGE_BATTLE_ATTACK);
break; break;
case SPECIES_AEGISLASH_BLADE: // Blade -> Shield case SPECIES_AEGISLASH_BLADE: // Blade -> Shield
if (gCurrentMove != MOVE_KINGS_SHIELD) if (gCurrentMove != MOVE_KINGS_SHIELD)
return FALSE; return FALSE;
gBattleMons[gBattlerAttacker].species = SPECIES_AEGISLASH_SHIELD; TryBattleFormChange(gBattlerAttacker, FORM_CHANGE_BATTLE_KINGS_SHIELD);
break; break;
} }

View file

@ -10848,6 +10848,10 @@ u16 GetBattleFormChangeTargetSpecies(u32 battler, u16 method)
if (GetBattlerTeraType(battler) == formChanges[i].param1) if (GetBattlerTeraType(battler) == formChanges[i].param1)
targetSpecies = formChanges[i].targetSpecies; targetSpecies = formChanges[i].targetSpecies;
break; break;
case FORM_CHANGE_BATTLE_ATTACK:
case FORM_CHANGE_BATTLE_KINGS_SHIELD:
targetSpecies = formChanges[i].targetSpecies;
break;
} }
} }
} }

View file

@ -789,9 +789,11 @@ static const struct FormChange sFurfrouFormChangeTable[] = {
#if P_FAMILY_HONEDGE #if P_FAMILY_HONEDGE
static const struct FormChange sAegislashFormChangeTable[] = { static const struct FormChange sAegislashFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_AEGISLASH_SHIELD}, {FORM_CHANGE_BATTLE_ATTACK, SPECIES_AEGISLASH_BLADE},
{FORM_CHANGE_FAINT, SPECIES_AEGISLASH_SHIELD}, {FORM_CHANGE_BATTLE_KINGS_SHIELD, SPECIES_AEGISLASH_SHIELD},
{FORM_CHANGE_END_BATTLE, SPECIES_AEGISLASH_SHIELD}, {FORM_CHANGE_BATTLE_SWITCH, SPECIES_AEGISLASH_SHIELD},
{FORM_CHANGE_FAINT, SPECIES_AEGISLASH_SHIELD},
{FORM_CHANGE_END_BATTLE, SPECIES_AEGISLASH_SHIELD},
{FORM_CHANGE_TERMINATOR}, {FORM_CHANGE_TERMINATOR},
}; };
#endif //P_FAMILY_HONEDGE #endif //P_FAMILY_HONEDGE