Skip to content

Commit

Permalink
Fixes Aegislash not reverting back (#5734)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexOn1ine authored Nov 28, 2024
1 parent c4fe970 commit 0f4b598
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 4 additions & 0 deletions include/constants/form_change_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,8 @@
// param1: amount of days
#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
5 changes: 2 additions & 3 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,6 @@ 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 All @@ -1142,12 +1141,12 @@ static bool32 TryAegiFormChange(void)
case SPECIES_AEGISLASH_SHIELD: // Shield -> Blade
if (IS_MOVE_STATUS(gCurrentMove))
return FALSE;
gBattleMons[gBattlerAttacker].species = SPECIES_AEGISLASH_BLADE;
TryBattleFormChange(gBattlerAttacker, FORM_CHANGE_BATTLE_ATTACK);
break;
case SPECIES_AEGISLASH_BLADE: // Blade -> Shield
if (gCurrentMove != MOVE_KINGS_SHIELD)
return FALSE;
gBattleMons[gBattlerAttacker].species = SPECIES_AEGISLASH_SHIELD;
TryBattleFormChange(gBattlerAttacker, FORM_CHANGE_BATTLE_KINGS_SHIELD);
break;
}

Expand Down
4 changes: 4 additions & 0 deletions src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -10848,6 +10848,10 @@ u16 GetBattleFormChangeTargetSpecies(u32 battler, u16 method)
if (GetBattlerTeraType(battler) == formChanges[i].param1)
targetSpecies = formChanges[i].targetSpecies;
break;
case FORM_CHANGE_BATTLE_ATTACK:
case FORM_CHANGE_BATTLE_KINGS_SHIELD:
targetSpecies = formChanges[i].targetSpecies;
break;
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/data/pokemon/form_change_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -789,9 +789,11 @@ static const struct FormChange sFurfrouFormChangeTable[] = {

#if P_FAMILY_HONEDGE
static const struct FormChange sAegislashFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_AEGISLASH_SHIELD},
{FORM_CHANGE_FAINT, SPECIES_AEGISLASH_SHIELD},
{FORM_CHANGE_END_BATTLE, SPECIES_AEGISLASH_SHIELD},
{FORM_CHANGE_BATTLE_ATTACK, SPECIES_AEGISLASH_BLADE},
{FORM_CHANGE_BATTLE_KINGS_SHIELD, 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},
};
#endif //P_FAMILY_HONEDGE
Expand Down

0 comments on commit 0f4b598

Please sign in to comment.