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.
#include "fixed_math.h"#include "types.h"#include "static_assert.h"#include "system.h"#include "battle/battle_action_run.h"#include "battle/playback_queue.h"#include "battle/battle_action.h"#include "window/menu_list.h"
Included by battle_internal.h, battle_effect_internal.h and window_internal.h.
Structures
| Name | Description | |
|---|---|---|
struct | BATTLE_PLAYBACK_STATE | The battle event queue and the state of its playback. |
struct | BATTLE_MESSAGE_STATE | The battle message window (heap slot battleMsg): its window, its message and whether the next message is marked. |
struct | BATTLE_STATE | The battle's own state: its enemies, units and their objects, the turn's actions, the background palette and the events. |
Macros
| Name | Description | |
|---|---|---|
#define | BATTLE_BACKGROUND_COLORS (8 * PALETTE_COLORS) | The battle background's colours, BG palettes 6 to 13. |
#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. |
#define | OPPONENT_SLOT_NONE 255 | BATTLE_STATE.opponentSlots of a party unit with no slot as a link opponent. |
#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. |
Enumerations
| Name | Description | |
|---|---|---|
enum | anonymous enum { BATTLE_ACTION_CAPACITY } | The most actions a turn's queue holds. |
Variables
| Name | Description | |
|---|---|---|
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.
LINK_MAX_MISSED_TICKS
#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.
| Enumerator | Value | Description |
|---|---|---|
BATTLE_ACTION_CAPACITY | 20 |
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)