Skip to Content
The Alchemy Project

include/battle/battle_state.h

The battle's own state: its units and their places, the turn's actions, the spoils, the background's palette and the playback of an action's events.

Included by battle_internal.h, battle_effect_internal.h and window_internal.h.

Structures

NameDescription
structBATTLE_PLAYBACK_STATEThe battle event queue and the state of its playback.
structBATTLE_MESSAGE_STATEThe battle message window (heap slot battleMsg): its window, its message and whether the next message is marked.
structBATTLE_STATEThe battle's own state: its enemies, units and their objects, the turn's actions, the background palette and the events.

Macros

NameDescription
#defineBATTLE_BACKGROUND_COLORS (8 * PALETTE_COLORS)The battle background's colours, BG palettes 6 to 13.
#defineBACKGROUND_LEVEL_STEP (toFIXED(1) / 60)The battle background's darkening step (btBackgroundSetPaletteLevel, btBackgroundLoad, the element glow and the battle effects' fades): each level takes a sixtieth of the full 16.16 brightness, so level 60 is black.
#defineOPPONENT_SLOT_NONE 255BATTLE_STATE.opponentSlots of a party unit with no slot as a link opponent.
#defineLINK_MAX_MISSED_TICKS 24The ticks a link battle tolerates without a connection before it gives up: a count above it pauses the battle (BATTLE_STATE.linkPaused) or fails the sync or transfer under way.

Enumerations

NameDescription
enumanonymous enum { BATTLE_ACTION_CAPACITY }The most actions a turn's queue holds.

Variables

NameDescription
STATIC_ASSERT(offsetof (BATTLE_STATE, spoils.queuedSummons)

Description

The battle's own state: its units and their places, the turn's actions, the spoils, the background's palette and the playback of an action's events.

Macros in detail

BATTLE_BACKGROUND_COLORS

#define BATTLE_BACKGROUND_COLORS (8 * PALETTE_COLORS)

The battle background's colours, BG palettes 6 to 13.

Referenced by btBackgroundLoad(), btBackgroundSetMode(), btBackgroundSetPaletteLevel(), btEffectDarkenBackgroundStep(), btEffectDimBackgroundStep(), btEffectRunAzul(), btEffectRunCatastrophe(), btEffectRunCharon(), btEffectRunDaedalus(), btEffectRunGeode(), btEffectRunIris(), btEffectRunJudgment(), btEffectRunOdyssey(), btEffectRunRisingDragonEnemy(), btEffectRunShatteringOpening(), btEffectRunUlysses(), btEffectRunZagan(), btElementGlowPlay(), btIrisChangeBackdrop(), btPaletteBrightenBattleBg(), btPaletteBrightenSavedBattleBg() and btStagingRunItem().

Definition at line 47 of file battle_state.h.

BACKGROUND_LEVEL_STEP

#define BACKGROUND_LEVEL_STEP (toFIXED(1) / 60)

The battle background's darkening step (btBackgroundSetPaletteLevel, btBackgroundLoad, the element glow and the battle effects' fades): each level takes a sixtieth of the full 16.16 brightness, so level 60 is black.

Referenced by btBackgroundLoad(), btBackgroundSetPaletteLevel(), btEffectDarkenBackgroundStep(), btEffectDimBackgroundStep(), btEffectRunAzul(), btEffectRunCharon(), btElementGlowPlay() and btStagingRunItem().

Definition at line 51 of file battle_state.h.

OPPONENT_SLOT_NONE

#define OPPONENT_SLOT_NONE 255

BATTLE_STATE.opponentSlots of a party unit with no slot as a link opponent.

Referenced by btLinkBattleSendParty().

Definition at line 72 of file battle_state.h.

#define LINK_MAX_MISSED_TICKS 24

The ticks a link battle tolerates without a connection before it gives up: a count above it pauses the battle (BATTLE_STATE.linkPaused) or fails the sync or transfer under way.

Referenced by btAppendLinkedActions(), btCameraUpdate(), btLinkBattleSyncTurn(), btLinkBattleWaitSync(), btRun() and mnBattleCollectPartyCommands().

Definition at line 77 of file battle_state.h.

Enumerations in detail

anonymous enum

enum { BATTLE_ACTION_CAPACITY }

The most actions a turn's queue holds.

EnumeratorValueDescription
BATTLE_ACTION_CAPACITY20

Definition at line 41 of file battle_state.h.

Variables in detail

offsetof

STATIC_ASSERT(offsetof(BATTLE_STATE, spoils.queuedSummons)

STATIC_ASSERT(offsetof(BATTLE_STATE, spoils.queueCount)

Definition at lines 222 and 223 of file battle_state.h.