-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduced FORM_BATTLE form changes #2273
Conversation
For species such as Xerneas and Zacian.
src/battle_main.c
Outdated
SetMonData(&gPlayerParty[i], MON_DATA_SPECIES, &targetSpecies); | ||
// Opponent's side | ||
targetSpecies = GetFormChangeTargetSpecies(&gEnemyParty[i], FORM_BATTLE_BEGIN, 0); | ||
if (targetSpecies != SPECIES_NONE) | ||
SetMonData(&gEnemyParty[i], MON_DATA_SPECIES, &targetSpecies); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/battle_util.c
Outdated
if (!isSwitchingOut) | ||
{ | ||
// Apply party-wide end-of-battle form changes | ||
for (i = 0; i < PARTY_SIZE; i++) | ||
{ | ||
// Player's side | ||
targetSpecies = GetFormChangeTargetSpecies(&gPlayerParty[i], FORM_BATTLE_END, 0); | ||
if (targetSpecies != SPECIES_NONE) | ||
SetMonData(&gPlayerParty[i], MON_DATA_SPECIES, &targetSpecies); | ||
// Opponent's side | ||
targetSpecies = GetFormChangeTargetSpecies(&gEnemyParty[i], FORM_BATTLE_END, 0); | ||
if (targetSpecies != SPECIES_NONE) | ||
SetMonData(&gEnemyParty[i], MON_DATA_SPECIES, &targetSpecies); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting this inside of UndoFormChange
will force this change for all mon in both parties in all the places where it's not switching out, which is most of them. Eg: reverting Mimikyu in when a pokemon faints.
I think the correct approach is to get rid of UndoFormChange
entirely, have a new macro that handles form change and use it where necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's exactly what I wanted to do yesterday when I talked to you about a FORM_BATTLE_HIT
😅
-Removed the pointless param1 setting in sXerneasFormChangeTable -Updated the descriptions of Behemoth Blade and Behemoth Bash -Added a new parameter to the struct FormChange -Allowed FORM_BATTLE_BEGIN and FORM_BATTLE_END to replace a move through a new function called "TryToSetBattleFormChangeMoves". -Added missing calls to "CalculateMonStats". -Renamed BoxPokemon pointer in GetFormChangeTargetSpeciesBoxMon for consistency's sake -Optimized check inside UndoFormChange (even though the plan is to get rid of that func entirely.) Special thanks to Blecoutre who fixed my TryToSetBattleFormChangeMoves function. It just wasn't working correctly at all.
…ges of the same method in the same table
Thanks to blecoutre#8678, this is finally ready for re-review 👀 I also cherrypicked a commit authored by Eduardo at his request, that allows the form change arrays to have multiple form changes of a same method 👀 |
Now that we have a third param, can we fold |
That sounds like it'd make sense, I'll look into it later 👀 |
There was never a reason not to.
There was never a reason not to.
I asked this inside the Discord server yesterday, but I may as well do it here instead so a proper conversation can be had. Since I already fused |
Description
Form change mechanisms that activate at the beginning and end of a battle, for species such as Xerneas or Zacian.
Big thanks to Lunos from the Past who held the key to complete the fucking puzzle GOD DAMN IT.
Discord contact info
Lunos#4026