The battle's own work: its enemies, units and their objects, the turn's actions, the spoils, the background palette, the plan and the events. More...
#include <battle_work.h>
Data Fields | |
| s32 | enemyGroup |
| the encounter's enemy formation | |
| s16 | spriteSlots [6] |
| the unit in each enemy sprite slot, 0 when free | |
| u16 | enemyClasses [6] |
| The enemy classes met so far, for their name letters, and the first class to fall (firstDefeated). | |
| u32 | summonMasks [6] |
| Name letters in use by each class in enemyClasses, a bit per letter. | |
| s8 | summonChannels [6] |
| The letter each class in enemyClasses gave out last; -1 for none yet. | |
| u8 | unk03a [2] |
| not named by TBS code | |
| u16 | firstDefeated |
| The enemyClasses index of the first class to fall; 6 for none. | |
| u16 | defeatState |
| DEFEAT_ONE, DEFEAT_SEVERAL or DEFEAT_BY_PARTY_MEMBER. | |
| u8 | summonCount |
| classes listed in enemyClasses, at most 5 | |
| u8 | partyStatus |
| PARTY_STATUS_SUMMONS or PARTY_STATUS_NO_SUMMONS. | |
| u8 | battleType |
| FORMATION_SHUFFLED or FORMATION_INTERLEAVED. | |
| u8 | challengeFlag |
| bits: 1 a party unit was challenged; nonzero, the party cannot run | |
| u8 | twoSided |
| 1 in a link battle | |
| u8 | encounterMode |
| BATTLE_ENCOUNTER_: who strikes first. | |
| u8 | escapeFailures |
| Failed attempts to run; each adds 2000 to the base chance of 5000. | |
| u8 | unk047 |
| not named by TBS code | |
| u8 | ownerSlots [8] |
| For each party unit, its slot as a link opponent's enemy, minus FIRST_ENEMY_UNIT; 0xff for none. | |
| u8 | linkSide |
| this console's multiplayer id | |
| u8 | linkMisses |
| frames the link has been down | |
| u8 | linkPaused |
| set when the link drops or the console's id changes | |
| u8 | unk053 |
| not named by TBS code | |
| s32 | promptSlot |
| resource entry of the advance arrow's tiles; -1 for none | |
| s16 | partyUnits [7] |
| ends with BATTLE_UNIT_LIST_END | |
| s16 | enemyIds [BATTLE_ENEMY_CAPACITY+1] |
| ends with BATTLE_UNIT_LIST_END | |
| struct BattleObj | slots [14] |
| u8 | placement [14] |
| Each unit's index in slots, enemies from 8; 0xff for none. | |
| u8 | unk2ea [2] |
| not named by TBS code | |
| struct BattleActionRecord | actions [BATTLE_ACTION_CAPACITY] |
| The actions chosen for the turn. | |
| u8 | unk42c [0x104] |
| not named by TBS code | |
| struct BattleSpoils | spoils |
| u16 | palette [128] |
| the backdrop's colours, before scaling | |
| s32 | brightness |
| the backdrop's brightness, 16.16, 0x10000 full | |
| u16 | background |
| the battle background's id | |
| u8 | unk64a [4] |
| not named by TBS code | |
| u16 | highlightStep |
| index into gBattleFx_HighlightBlendRamp | |
| u16 | highlightMode |
| nonzero while the units are highlighted | |
| u8 | unk652 [2] |
| not named by TBS code | |
| struct BattlePlan | plan |
| struct BattleEventState | events |
| s32 | debugValue |
| A value Runtime_AdjustDebugValueWithButtons edits with the d-pad while Start is held. | |
The battle's own work: its enemies, units and their objects, the turn's actions, the spoils, the background palette, the plan and the events.
It lives in the HEAP_SLOT_BATTLE work slot.
Definition at line 71 of file battle_work.h.
| s32 BattleWork::enemyGroup |
the encounter's enemy formation
Definition at line 72 of file battle_work.h.
Referenced by Battle_RunEncounter(), and BattleTargetExec().
| s16 BattleWork::spriteSlots[6] |
the unit in each enemy sprite slot, 0 when free
Definition at line 73 of file battle_work.h.
Referenced by BattleMotion_ReleaseObjectSlotByValue(), EnemyCheck(), and SummonSlot_RegisterActorSprites().
| u16 BattleWork::enemyClasses[6] |
The enemy classes met so far, for their name letters, and the first class to fall (firstDefeated).
Definition at line 76 of file battle_work.h.
Referenced by Battle_RunEncounter(), BattleEnemy_ClaimNameLetter(), BattleEnemy_RecordDefeat(), and BattleEnemy_ReleaseNameLetter().
| u32 BattleWork::summonMasks[6] |
Name letters in use by each class in enemyClasses, a bit per letter.
Definition at line 78 of file battle_work.h.
Referenced by BattleEnemy_ClaimNameLetter(), and BattleEnemy_ReleaseNameLetter().
| s8 BattleWork::summonChannels[6] |
The letter each class in enemyClasses gave out last; -1 for none yet.
Definition at line 80 of file battle_work.h.
Referenced by BattleEnemy_ClaimNameLetter().
| u8 BattleWork::unk03a[2] |
not named by TBS code
Definition at line 81 of file battle_work.h.
| u16 BattleWork::firstDefeated |
The enemyClasses index of the first class to fall; 6 for none.
Definition at line 83 of file battle_work.h.
Referenced by Battle_RunEncounter(), BattleEnemy_RecordDefeat(), and BattleFormation_BuildEnemyList().
| u16 BattleWork::defeatState |
DEFEAT_ONE, DEFEAT_SEVERAL or DEFEAT_BY_PARTY_MEMBER.
Definition at line 84 of file battle_work.h.
Referenced by Battle_RunEncounter(), BattleEnemy_RecordDefeat(), and BattleFormation_BuildEnemyList().
| u8 BattleWork::summonCount |
classes listed in enemyClasses, at most 5
Definition at line 85 of file battle_work.h.
Referenced by BattleEnemy_ClaimNameLetter(), BattleEnemy_ReleaseNameLetter(), and BattleFormation_BuildEnemyList().
| u8 BattleWork::partyStatus |
PARTY_STATUS_SUMMONS or PARTY_STATUS_NO_SUMMONS.
Definition at line 86 of file battle_work.h.
Referenced by Battle_RunEncounter(), BattleEv_DispatchQueued(), BattleEvent_Playback(), BattleMotion_FlashHit(), BattlePres_RunAttack(), BattlePres_RunEntryTransition(), BattlePres_RunPsynergyCast(), BattlePres_RunUnitAction(), BattlePresentation_RunUnitTransition(), BattleTargetExec(), and Ui_RunOwnerStatusScreen().
| u8 BattleWork::battleType |
FORMATION_SHUFFLED or FORMATION_INTERLEAVED.
Definition at line 87 of file battle_work.h.
Referenced by Battle_RunEncounter(), BattleFormation_BuildEnemyList(), and BattleParty_CollectUnitList().
| u8 BattleWork::challengeFlag |
bits: 1 a party unit was challenged; nonzero, the party cannot run
Definition at line 89 of file battle_work.h.
Referenced by BattleTargetExec(), and UiText_ShowLocalizedMessageAndWait().
| u8 BattleWork::twoSided |
1 in a link battle
Definition at line 90 of file battle_work.h.
Referenced by Battle_CollectPartyCommands(), Battle_ProcessRoundEnd(), Battle_RunEncounter(), BattleParty_PrepareActiveOwners(), BattlePres_SyncTurn(), BattlePres_WaitSync(), BattlePresentation_BuildActions(), and BattlePresentation_UpdateCamera().
| u8 BattleWork::encounterMode |
BATTLE_ENCOUNTER_: who strikes first.
Definition at line 91 of file battle_work.h.
Referenced by Battle_RunEncounter(), BattleEscape_CheckSuccess(), BattleIntro_AnnounceEncounter(), BattlePres_BuildOpponentEntries(), BattlePres_RunEscape(), and BattlePresentation_BuildActions().
| u8 BattleWork::escapeFailures |
Failed attempts to run; each adds 2000 to the base chance of 5000.
Definition at line 93 of file battle_work.h.
Referenced by BattleEscape_CheckSuccess().
| u8 BattleWork::unk047 |
not named by TBS code
Definition at line 94 of file battle_work.h.
| u8 BattleWork::ownerSlots[8] |
For each party unit, its slot as a link opponent's enemy, minus FIRST_ENEMY_UNIT; 0xff for none.
Definition at line 97 of file battle_work.h.
Referenced by BattleParty_AssignMemberSlots(), BattlePresentation_AppendLinkedActions(), and LinkBattle_SendParty().
| u8 BattleWork::linkSide |
this console's multiplayer id
Definition at line 98 of file battle_work.h.
Referenced by Battle_CollectPartyCommands(), Battle_ProcessRoundEnd(), Battle_RunEncounter(), BattlePres_SyncTurn(), BattlePres_WaitSync(), BattlePresentation_AppendLinkedActions(), BattlePresentation_UpdateCamera(), and UpdateLinkSessionCountdown().
| u8 BattleWork::linkMisses |
frames the link has been down
Definition at line 99 of file battle_work.h.
Referenced by BattlePresentation_UpdateCamera().
| u8 BattleWork::linkPaused |
set when the link drops or the console's id changes
Definition at line 100 of file battle_work.h.
Referenced by Battle_CollectPartyCommands(), Battle_RunEncounter(), BattlePres_SyncTurn(), BattlePres_WaitSync(), BattlePresentation_AppendLinkedActions(), BattlePresentation_UpdateCamera(), and UpdateLinkSessionCountdown().
| u8 BattleWork::unk053 |
not named by TBS code
Definition at line 101 of file battle_work.h.
| s32 BattleWork::promptSlot |
resource entry of the advance arrow's tiles; -1 for none
Definition at line 102 of file battle_work.h.
Referenced by Battle_RunEncounter(), and BattleEvent_Playback().
| s16 BattleWork::partyUnits[7] |
ends with BATTLE_UNIT_LIST_END
Definition at line 103 of file battle_work.h.
Referenced by Battle_FindTaggedSlotByValue(), Battle_GetTaggedSlotValue(), BattleActor_RemoveFromLists(), BattleCommand_BuildPlan(), BattleLayout_HighlightPartyPanels(), BattleParty_CollectUnitList(), BattleParty_ListActorIds(), BattleTarget_RunSelection(), BattleTarget_SelectForAction(), BattleTarget_SelectRandomPosition(), and PartyStatusDraw().
| s16 BattleWork::enemyIds[BATTLE_ENEMY_CAPACITY+1] |
ends with BATTLE_UNIT_LIST_END
Definition at line 104 of file battle_work.h.
Referenced by Battle_FindTaggedSlotByValue(), Battle_GetTaggedSlotValue(), BattleActor_RemoveFromLists(), BattleCommand_BuildPlan(), BattleParty_CollectUnitList(), BattleParty_ListActorIds(), BattleTarget_RunSelection(), BattleTarget_SelectForAction(), BattleTarget_SelectRandomPosition(), BattleTargetExec(), BattleUnit_RefreshPlacement(), and EnemyUpdate().
| struct BattleObj BattleWork::slots[14] |
Definition at line 105 of file battle_work.h.
Referenced by Battle_GetWorkEntryPair(), BattleFx_SetupBlendedDisplay(), and BattleObjGet().
| u8 BattleWork::placement[14] |
Each unit's index in slots, enemies from 8; 0xff for none.
Definition at line 107 of file battle_work.h.
Referenced by BattleObjGet(), and BattleUnit_RefreshPlacement().
| u8 BattleWork::unk2ea[2] |
not named by TBS code
Definition at line 108 of file battle_work.h.
| struct BattleActionRecord BattleWork::actions[BATTLE_ACTION_CAPACITY] |
The actions chosen for the turn.
Definition at line 110 of file battle_work.h.
Referenced by Battle_RunEncounter(), BattleActor_RemoveFromLists(), BattlePres_RunItem(), BattlePresentation_BuildActions(), and BattleTargetExec().
| u8 BattleWork::unk42c[0x104] |
not named by TBS code
Definition at line 111 of file battle_work.h.
| struct BattleSpoils BattleWork::spoils |
Definition at line 112 of file battle_work.h.
Referenced by Battle_AwardSpoils(), Battle_RunEncounter(), BattleEnemy_RecordDefeat(), and BattleSpoils_Clear().
| u16 BattleWork::palette[128] |
the backdrop's colours, before scaling
Definition at line 113 of file battle_work.h.
Referenced by BattleBackground_Load(), BattleFx_PlayUnitElementEffect(), BattleFx_RunShatteringOpening(), BattlePres_RunItem(), BattlePresentation_ConfigurePaletteFade(), BattlePresentation_SetPaletteLevel(), and Palette_StepFadeTransfer().
| s32 BattleWork::brightness |
the backdrop's brightness, 16.16, 0x10000 full
Definition at line 114 of file battle_work.h.
Referenced by BattleBackground_Load(), BattleFx_PlayUnitElementEffect(), BattlePres_RunItem(), BattlePresentation_DispatchAction(), and BattlePresentation_SetPaletteLevel().
| u16 BattleWork::background |
the battle background's id
Definition at line 115 of file battle_work.h.
Referenced by Battle_ProcessRoundEnd(), Battle_RunEncounter(), BattleFx_BeginCanvasLayer(), BattleFx_EndCanvasLayer(), BattleFx_HideBg1AndRestoreBackdrop(), BattleFx_OpenCanvasLayer(), BattleFx_PlayUnitElementEffect(), BattleFx_RunCondemn(), BattleFx_RunRingAndSparkScene(), BattleFx_RunShatteringOpening(), BattleFx_SetupBlendedDisplay(), BattleFx_SetupCanvasTileMap(), BattlePres_RunEntryTransition(), and BattlePresentation_DispatchAction().
| u8 BattleWork::unk64a[4] |
not named by TBS code
Definition at line 116 of file battle_work.h.
| u16 BattleWork::highlightStep |
index into gBattleFx_HighlightBlendRamp
Definition at line 117 of file battle_work.h.
Referenced by BattlePres_SetActorModes(), and Graphics_AdvancePaletteCycle().
| u16 BattleWork::highlightMode |
nonzero while the units are highlighted
Definition at line 118 of file battle_work.h.
Referenced by BattlePres_SetActorModes(), and Graphics_AdvancePaletteCycle().
| u8 BattleWork::unk652[2] |
not named by TBS code
Definition at line 119 of file battle_work.h.
| struct BattlePlan BattleWork::plan |
Definition at line 120 of file battle_work.h.
Referenced by BattleEvent_Playback(), BattleEventRuntime_SchedulePhase(), BattlePres_RunItem(), and BattlePresentation_DispatchAction().
| struct BattleEventState BattleWork::events |
Definition at line 121 of file battle_work.h.
Referenced by BattleEv_DispatchQueued(), BattleEvent_Playback(), BattleEventRuntime_BeginPhase(), BattleEventRuntime_Reset(), BattleEventRuntime_SchedulePhase(), BattleEventRuntime_WaitForReady(), BattleEvPush(), and BattleUnit_ProcessTurnEnd().
| s32 BattleWork::debugValue |
A value Runtime_AdjustDebugValueWithButtons edits with the d-pad while Start is held.
Definition at line 124 of file battle_work.h.
Referenced by Runtime_AdjustDebugValueWithButtons().