Name BATTLE_STATE_9 as BATTLE_STATE_END_TEAM_TURN with meaningful substates#1249
Closed
Name BATTLE_STATE_9 as BATTLE_STATE_END_TEAM_TURN with meaningful substates#1249
Conversation
…ubstates Co-authored-by: bates64 <9429556+bates64@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Name BATTLE_STATE_9
Name BATTLE_STATE_9 as BATTLE_STATE_END_TEAM_TURN with meaningful substates
Sep 24, 2025
bates64
requested changes
Sep 24, 2025
| } | ||
|
|
||
| if (gBattleSubState == BTL_SUBSTATE_9_1) { | ||
| if (gBattleSubState == BTL_SUBSTATE_END_TEAM_TURN_PROCESS_STATUS) { |
Member
There was a problem hiding this comment.
@copilot This isn't particularly descriptive. It looks like this is applying pre-enemy-phase status effects. Can you find out what D_8029F258 is?
| BATTLE_STATE_BEGIN_PLAYER_TURN = 7, | ||
| BATTLE_STATE_BEGIN_PARTNER_TURN = 8, | ||
| BATTLE_STATE_9 = 9, // can be reached from BATTLE_STATE_PARTNER_MOVE if partner == nullptr | ||
| BATTLE_STATE_END_TEAM_TURN = 9, // can be reached from BATTLE_STATE_PARTNER_MOVE if partner == nullptr |
Member
There was a problem hiding this comment.
@copilot I think we should introduce an idea: "team phase" and "enemy phase", the two of which constitute one entire turn.
Also, remove the comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses issue #XXX by renaming the previously unnamed
BATTLE_STATE_9and its associated functions and substates with descriptive names that clearly indicate their purpose in the battle system.Changes Made
Renamed main battle state:
BATTLE_STATE_9→BATTLE_STATE_END_TEAM_TURNRenamed functions:
btl_state_update_9→btl_state_update_end_team_turnbtl_state_draw_9→btl_state_draw_end_team_turnRenamed all substates with meaningful names:
BTL_SUBSTATE_9_INIT→BTL_SUBSTATE_END_TEAM_TURN_INITBTL_SUBSTATE_9_1→BTL_SUBSTATE_END_TEAM_TURN_PROCESS_STATUSBTL_SUBSTATE_9_2→BTL_SUBSTATE_END_TEAM_TURN_AWAIT_SCRIPTSBTL_SUBSTATE_9_3→BTL_SUBSTATE_END_TEAM_TURN_SWAP_POSITIONSBTL_SUBSTATE_9_4→BTL_SUBSTATE_END_TEAM_TURN_HANDLE_MERLEEBTL_SUBSTATE_9_5→BTL_SUBSTATE_END_TEAM_TURN_EXEC_PHASE_SCRIPTSBTL_SUBSTATE_9_6→BTL_SUBSTATE_END_TEAM_TURN_AWAIT_PHASE_SCRIPTSBTL_SUBSTATE_9_7→BTL_SUBSTATE_END_TEAM_TURN_DONEAnalysis
BATTLE_STATE_END_TEAM_TURNis entered when either the player or partner finishes their action. The state performs several key functions:BATTLE_STATE_NEXT_ENEMYwhen team actions are completeThe new names follow the established naming conventions in the codebase and make the battle flow much clearer for developers working on the battle system. Each substate name describes exactly what phase of the end-team-turn process is being handled.
Files Modified
include/enums.h- Updated enum definitionsinclude/functions.h- Updated function declarationssrc/battle/btl_states_actions.c- Updated function implementations and all substate referencessrc/battle/btl_states_menus.c- Updated state transitionsrc/battle/16C8E0.c- Updated state dispatch callssrc/battle/area/hos/actor/goombario_tutor.c- Updated script referenceAll references have been updated consistently across the codebase to maintain functionality while improving code readability.
Fixes #1248
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.