1#ifndef ALCHEMY_BATTLE_WORK_H
2#define ALCHEMY_BATTLE_WORK_H
The battle event queue: the events BattleEvPush queues and the playback phases that play them.
A battle's objects and sprites, each unit's command and action record, and the spoils.
BattlePlan, an action planned for its targets: the hits, criticals and multipliers rolled.
struct BattleWork * gBattleWork
struct BattleDisplayWork * gBattleDisplayWork
STATIC_ASSERT, a compile-time check that emits nothing.
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
A unit's chosen action for the turn: its command, the command's parameter, its target and range,...
The battle message's text channel, as far as its offset in the window.
s32 unk00
not named by TBS code
The battle message display: its window, its text channel and whether the next message is marked.
s32 marked
set by BATTLE_EVENT_MARK; passed to the next message
struct UiWindow * window
the message window
struct BattleDisplayOffset * offset
its text channel
The battle event queue: up to 64 events, each an opcode (enum BattleEventOpcode) and one operand,...
The battle event queue and the state of its playback: the phase, the event playing and the advance ar...
struct BattleEventQueue queue
s32 timer
frames to wait, or frames waited for the advance key
struct BattlePromptSprite displayEntry
the advance arrow
s32 actorId
the unit of the hit or defeat being played
s32 phase
enum BattlePlaybackPhase, or a message phase
s32 pendingCue
hit sound (an SE_ id), played on the next hit
s32 displaySource
the arrow's resource entry; -1 until it is shown
s32 eventIndex
the next queued event to play
s32 flags
bits: 0 Djinn bonus (EVENT_FLAG_DJINN_BONUS), for the enemies that fall during the action
A unit's place on the battlefield: its sprite object, resources and animations, its anchor spot and s...
One action, as BattleCommand_BuildPlan lays it out for BattleTargetExec to apply target by target.
One OAM entry in a sprite list: the arrow that waits for the player to advance a battle message.
u16 unk0a
cleared with the tile word each frame; not named
struct BattlePromptSprite * next
A battle's spoils so far: coins, experience, enemies defeated and up to four items.
The battle's own work: its enemies, units and their objects, the turn's actions, the spoils,...
u8 partyStatus
PARTY_STATUS_SUMMONS or PARTY_STATUS_NO_SUMMONS.
s32 promptSlot
resource entry of the advance arrow's tiles; -1 for none
u16 highlightStep
index into gBattleFx_HighlightBlendRamp
u16 firstDefeated
The enemyClasses index of the first class to fall; 6 for none.
u16 background
the battle background's id
u8 unk652[2]
not named by TBS code
u8 twoSided
1 in a link battle
s32 enemyGroup
the encounter's enemy formation
u8 ownerSlots[8]
For each party unit, its slot as a link opponent's enemy, minus FIRST_ENEMY_UNIT; 0xff for none.
u8 encounterMode
BATTLE_ENCOUNTER_: who strikes first.
u8 summonCount
classes listed in enemyClasses, at most 5
u16 enemyClasses[6]
The enemy classes met so far, for their name letters, and the first class to fall (firstDefeated).
struct BattleObj slots[14]
u8 unk2ea[2]
not named by TBS code
s8 summonChannels[6]
The letter each class in enemyClasses gave out last; -1 for none yet.
struct BattleEventState events
s16 partyUnits[7]
ends with BATTLE_UNIT_LIST_END
u8 challengeFlag
bits: 1 a party unit was challenged; nonzero, the party cannot run
u8 placement[14]
Each unit's index in slots, enemies from 8; 0xff for none.
u16 defeatState
DEFEAT_ONE, DEFEAT_SEVERAL or DEFEAT_BY_PARTY_MEMBER.
s32 brightness
the backdrop's brightness, 16.16, 0x10000 full
u8 unk053
not named by TBS code
u8 unk03a[2]
not named by TBS code
u8 escapeFailures
Failed attempts to run; each adds 2000 to the base chance of 5000.
u8 battleType
FORMATION_SHUFFLED or FORMATION_INTERLEAVED.
s32 debugValue
A value Runtime_AdjustDebugValueWithButtons edits with the d-pad while Start is held.
u32 summonMasks[6]
Name letters in use by each class in enemyClasses, a bit per letter.
struct BattleActionRecord actions[BATTLE_ACTION_CAPACITY]
The actions chosen for the turn.
u8 linkPaused
set when the link drops or the console's id changes
u8 linkSide
this console's multiplayer id
struct BattleSpoils spoils
u8 linkMisses
frames the link has been down
u8 unk047
not named by TBS code
u16 palette[128]
the backdrop's colours, before scaling
s16 enemyIds[BATTLE_ENEMY_CAPACITY+1]
ends with BATTLE_UNIT_LIST_END
u8 unk64a[4]
not named by TBS code
u8 unk42c[0x104]
not named by TBS code
u16 highlightMode
nonzero while the units are highlighted
s16 spriteSlots[6]
the unit in each enemy sprite slot, 0 when free
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
The integer types, TRUE, UNUSED and the fixed-address macros.