include/battle/battle_state.h
BATTLE_STATE, the battle's own state, and the battle message window's state.
#include "fixed_math.h"#include "static_assert.h"#include "types.h"#include "battle/battle.h"#include "battle/battle_action.h"#include "battle/battle_action_run.h"#include "battle/playback_queue.h"#include "system.h"
Included by battle_effect_internal.h, credits.c, screens_internal.h, window_internal.h and ability_staging.h.
Structures
| Name | Description | |
|---|---|---|
struct | ADVANCE_ARROW_SPR | One OAM entry in a sprite list: the arrow that waits for the player to advance a battle message. |
struct | BATTLE_MESSAGE_OFFSET | The battle message, as far as its offset in the window: the advance arrow is drawn at the window's corner plus this offset. |
struct | BATTLE_MESSAGE_STATE | The battle message window: its window, its message and whether the next message is marked. |
struct | BATTLE_PLAYBACK_STATE | The playback queue and the state of its playback: the phase, the entry playing and the advance arrow. |
struct | BATTLE_STATE | The battle's own state: its enemies, units and their battle objects, the turn's actions, the spoils, the background palette, the action under way and the playback. |
Macros
| Name | Description | |
|---|---|---|
#define | BattleMessageStateWork | The battle message window's state, in HEAP_SLOT_BATTLE_MESSAGE, which btRun takes and zeroes for the battle. |
#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 almost black. |
#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, transfer or wait for the partner's commands under way. |
#define | BATTLE_CHALLENGED_PARTY 2 | BATTLE_STATE.challengeFlag's bit: the challenge effect landed on a party member ("This is no time to be running away!"). |
#define | ENEMY_SPRITE_SLOTS 6 | The battle has six enemy sprite slots; a large enemy takes two side by side, a small one (btSpriteIsSmall) one. |
#define | BattleStateWork (*(BATTLE_STATE **)&HeapSlots[HEAP_SLOT_BATTLE]) | The battle's state: HeapSlots[HEAP_SLOT_BATTLE] under its own name. |
Enumerations
| Name | Description | |
|---|---|---|
enum | anonymous enum { BATTLE_ACTION_CAPACITY } | The most actions a turn's queue holds. |
Description
BATTLE_STATE, the battle's own state, and the battle message window's state.
Macros in detail
BattleMessageStateWork
#define BattleMessageStateWork
The battle message window's state, in HEAP_SLOT_BATTLE_MESSAGE, which btRun
takes and zeroes for the battle.
Referenced by btMessageWaitForAdvance(), btPlaybackMarkMessage(), btPlaybackRun(), btPlaybackRunAll(), mnBattleMessageClose() and mnGlyphDraw().
Definition at line 68 of file battle_state.h.
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(), btEffectRunJudgment(), btEffectRunShatteringOpening(), btElementGlowPlay(), btStagingRunItem(), mnCreditsClearBuffer() and mnCreditsLoadBackground().
Definition at line 99 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 almost black.
Referenced by btBackgroundLoad(), btBackgroundSetPaletteLevel(), btEffectDarkenBackgroundStep() and btElementGlowPlay().
Definition at line 103 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,
transfer or wait for the partner's commands under way.
Referenced by btAppendLinkedActions(), btCameraUpdate(), btLinkBattleSyncTurn(), btLinkBattleWaitSync(), btRun() and mnBattleCollectPartyCommands().
Definition at line 108 of file battle_state.h.
BATTLE_CHALLENGED_PARTY
#define BATTLE_CHALLENGED_PARTY 2
BATTLE_STATE.challengeFlag's bit: the challenge effect landed on a party
member ("This is no time to be running away!").
Referenced by btAbilityApplyToTarget().
Definition at line 112 of file battle_state.h.
ENEMY_SPRITE_SLOTS
#define ENEMY_SPRITE_SLOTS 6
The battle has six enemy sprite slots; a large enemy takes two side by side,
a small one (btSpriteIsSmall) one.
Referenced by btEnemyHasSpriteRoom(), btEnemySpriteLoadIntoSlots(), btFormationBuildEnemyList() and btObjectReleaseSpriteSlots().
Definition at line 116 of file battle_state.h.
BattleStateWork
#define BattleStateWork (*(BATTLE_STATE **)&HeapSlots[HEAP_SLOT_BATTLE])
The battle's state: HeapSlots[HEAP_SLOT_BATTLE] under its own name.
Referenced by btAbilityApplyToTarget(), btActionRunBuild(), btAdjustDebugValue(), btAIChooseRandomTarget(), btAIChooseTarget(), btAppendLinkedActions(), btAutoBattleRunAttackOrItem(), btAwardSpoils(), btBackgroundSetMode(), btBackgroundSetPaletteLevel(), btBackgroundStepHighlightBlend(), btBuildEnemyActions(), btEffectRunCondemn(), btEffectRunCriticalHit(), btEffectSetupCanvasTileMap(), btEnemyClaimNameLetter(), btEnemyHasSpriteRoom(), btEnemyRecordDefeat(), btEnemyReleaseNameLetter(), btEnemySpriteLoadIntoSlots(), btFindUnitPlace(), btFleeCheckSuccess(), btFormationBuildEnemyList(), btGatherActions(), btGetUnitAtPlace(), btHighlightSetModes(), btIntroAnnounceEncounter(), btLinkBattleSendParty(), btLinkBattleSyncTurn(), btLinkBattleWaitSync(), btMotionFlashHit(), btObjectGet(), btObjectGetAnchor(), btObjectReleaseSpriteSlots(), btObjectRemoveFromLists(), btPartyAssignOpponentSlots(), btPartyPrepareMembers(), btPlacementRelayoutEnemies(), btPlaybackPush(), btPlaybackReset(), btPlaybackRun(), btPlaybackRunAll(), btPlaybackSchedulePhase(), btPlaybackStart(), btPlaybackWaitForReady(), btProcessTurnEnd(), btSpoilsClear(), btStagingDispatchAction(), btStagingRunAttack(), btStagingRunFullScreen() and 14 more.
Definition at line 258 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 93 of file battle_state.h.