struct BATTLE_STATE
The battle's own state: its enemies, units and their objects, the turn's actions, the background palette and the events.
Declared in battle_state.h.
Fields
| Name | Description | |
|---|---|---|
Sint32 | formation | The encounter's enemy formation. |
Sint16 | spriteSlots [6] | The unit in each enemy sprite slot, 0 when free. |
Uint16 | enemyKinds [5] | The kinds of enemy in the formation, for the letters that tell two of a kind apart: five at most, where The Broken Seal keeps six. |
Uint16 | kindsEnd | Read only by the defeat search, as a sixth kind. |
Uint32 | nameLetterMasks [6] | For each kind, the name letters already given. |
Sint8 | lastNameLetter [6] | For each kind, the last name letter given. |
Uint8 | unusedAfterNameLetters [2] | No code names it. |
Uint16 | firstDefeated | The earliest kind in enemyKinds that fell, which the victory message names; ENEMY_BATTLE_SIZE until one falls. |
Uint16 | defeatState | DEFEAT_ONE, DEFEAT_SEVERAL or DEFEAT_BY_PARTY_MEMBER. |
Uint8 | enemyKindCount | Kinds of enemy listed, at most 5. |
Uint8 | partyStatus | How the party status window draws. |
Uint8 | layout | The formation's layout: 0 or 1 lists the enemies in the order they were drawn. |
Uint8 | challengeFlag | bits: 1 a party unit was challenged |
Uint8 | isLink | 1 in a link battle. |
Uint8 | firstStrike | Who strikes first: 1 the party, 2 the enemies. |
Uint8 | fleeFailures | Failed tries to flee this battle; each adds 2000 to the chance (btFleeCheckSuccess). |
Uint8 | ceaseFire | Set by Lull with MsgAllResting, "Everybody is resting!". |
Uint8 | opponentSlots [8] | For each party unit, its slot as a link opponent's enemy, minus 128; OPPONENT_SLOT_NONE for none. |
Uint8 | linkSide | This console's multiplayer id. |
Uint8 | linkMisses | Ticks the link has been down. |
Uint8 | linkPaused | Set when the link drops. |
Uint8 | paddingAfterLink | Up to the word arrowTiles starts on. |
Sint32 | arrowTiles | Resource entry of the advance arrow's tiles; -1 for none. |
Sint16 | partyUnits [7] | Ends with BATTLE_UNIT_LIST_END. |
Sint16 | enemyIds [7] | Ends with BATTLE_UNIT_LIST_END. |
Uint8 | placement [16] | Each unit's index in slots, |
BATTLE_OBJECT | slots [14] | party ids 0 to 7 then the enemies; 255 for none (BATTLE_OBJECT_NONE). |
BATTLE_ACTION_RECORD | actions [BATTLE_ACTION_CAPACITY] | The actions chosen for the turn. |
Uint8 | unusedAfterActions [292] | No code names it. |
BATTLE_SPOILS | spoils | What the battle has won so far. |
Uint16 | palette [BATTLE_BACKGROUND_COLORS] | The backdrop's colours, before scaling. |
FIXED | brightness | The backdrop's brightness, 16.16, toFIXED(1) full. |
Uint16 | bg | The battle background's id (its first halfword is the battle background passed to the palette fade). |
Uint8 | unusedAfterBg [4] | No code names it. |
Uint16 | highlightStep | Stepped each tick while the units are highlighted. |
Uint16 | highlightMode | Nonzero while the units are highlighted. |
Uint8 | paddingAfterHighlight [2] | Up to the word plan starts on. |
BATTLE_PLAN | plan | The action being carried out, as btActionRunBuild lays it out. |
Sint32 | skipPlayback | Nonzero leaves the |
BATTLE_PLAYBACK_STATE | events | action's events unplayed. |
Sint32 | debugValue | A value btAdjustDebugValue edits with the d-pad while Start is held. |
Sint32 | counterUnitId | The unit ready to |
Sint32 | counterTargetId | counterattack (ABILITY_EFFECT_COUNTER) that was just struck, and the opponent that struck it. |
Uint16 | daedalusFromEnemies | Daedalus strikes again at the end of the turns after it is summoned: each queued strike is a bit, set when an enemy summoned it, and the next turn's queue is gathered while this one's is played. |
Uint16 | nextDaedalusFromEnemies | |
Uint8 | daedalusStrikes | |
Uint8 | nextDaedalusStrikes | |
Uint8 | keepObjectPriorities | Nonzero leaves the battle objects' sprite priorities as they are, while Flora's effect plays. |
Uint8 | keepBackdropPalette | Nonzero keeps the backdrop's palette while a summon (Charon, Atalanta, Neptune, Moloch) colours the screen. |
Uint8 | forceField | Poseidon's force field: 1 when the formation's last enemy is one of ENEMY_POSEIDON to ENEMY_POSEIDON_3, outside FLAG_MONSTER_BATTLE; until the Trident lands, MsgFieldProtects turns abilities away. |
Uint8 | actingAnimation | The animation the acting unit takes as it calls up its Psynergy; 3 as its action starts. |
Uint8 | paddingAfterActingAnimation [2] | Up to the word aiStates starts on. |
BATTLE_AI_STATE | aiStates [4] | The action choice's memory for the enemies that act more than once a turn. |
Description
The battle's own state: its enemies, units and their objects, the turn's actions, the background palette and the events.
struct BATTLE_STATE
Referenced by btAbilityApplyToTarget(), btActionRunBuild(), btAdjustDebugValue(), btAIChooseAction(), btAIChooseRandomTarget(), btAIChooseTarget(), btAppendLinkedActions(), btBackgroundLoad(), btBackgroundSetMode(), btBackgroundSetPaletteLevel(), btBackgroundStepHighlightBlend(), btBuildEnemyActions(), btChangeEnemyForm(), btEffectDarkenBackgroundStep(), btEffectDimBackgroundStep(), btEffectEndCanvasLayer(), btEffectHideBg1AndRestoreBackdrop(), btEffectOpenCanvasLayer(), btEffectRunAzul(), btEffectRunBackgroundFadeIn(), btEffectRunBackstab(), btEffectRunCanvasBurst(), btEffectRunCatastrophe(), btEffectRunCharon(), btEffectRunCruelRuin(), btEffectRunDaedalus(), btEffectRunEclipse(), btEffectRunGeode(), btEffectRunHaures(), btEffectRunIris(), btEffectRunShatteringOpening(), btEffectRunUlysses(), btEffectRunZagan(), btEffectSetupBlendedDisplay(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), btEffectStartElementStreaks(), btElementGlowPlay(), btEnemyClaimNameLetter(), btEnemyHasSpriteRoom(), btEnemyRecordDefeat(), btEnemyReleaseNameLetter(), btEnemySpriteLoadIntoSlots(), btFindUnitPlace(), btFleeCheckSuccess(), btFormationBuildEnemyList(), btGatherActions(), btGetUnitAtPlace(), btHighlightSetModes(), btIntroAnnounceEncounter() and 38 more.
Definition at line 81 of file battle_state.h.
Fields in detail
formation
Sint32 formation
The encounter's enemy formation.
spriteSlots
Sint16 spriteSlots[6]
The unit in each enemy sprite slot, 0 when free.
enemyKinds
Uint16 enemyKinds[5]
The kinds of enemy in the formation, for the letters that tell two of a kind apart: five at most, where The Broken Seal keeps six.
kindsEnd
Uint16 kindsEnd
Read only by the defeat search, as a sixth kind.
nameLetterMasks
Uint32 nameLetterMasks[6]
For each kind, the name letters already given.
lastNameLetter
Sint8 lastNameLetter[6]
For each kind, the last name letter given.
unusedAfterNameLetters
Uint8 unusedAfterNameLetters[2]
No code names it.
firstDefeated
Uint16 firstDefeated
The earliest kind in enemyKinds
that fell, which the victory
message names; ENEMY_BATTLE_SIZE
until one falls.
defeatState
Uint16 defeatState
DEFEAT_ONE, DEFEAT_SEVERAL or
DEFEAT_BY_PARTY_MEMBER.
enemyKindCount
Uint8 enemyKindCount
Kinds of enemy listed, at most 5.
partyStatus
Uint8 partyStatus
How the party status window draws.
layout
Uint8 layout
The formation's layout: 0 or 1 lists the enemies in the order they were drawn.
challengeFlag
Uint8 challengeFlag
bits: 1 a party unit was challenged
isLink
Uint8 isLink
1 in a link battle.
firstStrike
Uint8 firstStrike
Who strikes first: 1 the party, 2 the enemies.
fleeFailures
Uint8 fleeFailures
Failed tries to flee this battle;
each adds 2000 to the chance
(btFleeCheckSuccess).
ceaseFire
Uint8 ceaseFire
Set by Lull with MsgAllResting,
"Everybody is resting!".
opponentSlots
Uint8 opponentSlots[8]
For each party unit, its slot as a
link opponent's enemy, minus 128;
OPPONENT_SLOT_NONE for none.
linkSide
Uint8 linkSide
This console's multiplayer id.
linkMisses
Uint8 linkMisses
Ticks the link has been down.
linkPaused
Uint8 linkPaused
Set when the link drops.
paddingAfterLink
Uint8 paddingAfterLink
Up to the word arrowTiles starts on.
arrowTiles
Sint32 arrowTiles
Resource entry of the advance arrow's tiles; -1 for none.
partyUnits
Sint16 partyUnits[7]
Ends with BATTLE_UNIT_LIST_END.
enemyIds
Sint16 enemyIds[7]
Ends with BATTLE_UNIT_LIST_END.
placement
Uint8 placement[16]
Each unit's index in slots,
slots
BATTLE_OBJECT slots[14]
party ids 0 to 7 then the
enemies; 255 for none
(BATTLE_OBJECT_NONE).
actions
BATTLE_ACTION_RECORD actions[BATTLE_ACTION_CAPACITY]
The actions chosen for the turn.
unusedAfterActions
Uint8 unusedAfterActions[292]
No code names it.
spoils
BATTLE_SPOILS spoils
What the battle has won so far.
palette
Uint16 palette[BATTLE_BACKGROUND_COLORS]
The backdrop's colours, before scaling.
brightness
FIXED brightness
The backdrop's brightness,
16.16, toFIXED(1) full.
bg
Uint16 bg
The battle background's id (its first halfword is the battle background passed to the palette fade).
unusedAfterBg
Uint8 unusedAfterBg[4]
No code names it.
highlightStep
Uint16 highlightStep
Stepped each tick while the units are highlighted.
highlightMode
Uint16 highlightMode
Nonzero while the units are highlighted.
paddingAfterHighlight
Uint8 paddingAfterHighlight[2]
Up to the word plan starts on.
plan
BATTLE_PLAN plan
The action being carried
out, as btActionRunBuild
lays it out.
skipPlayback
Sint32 skipPlayback
Nonzero leaves the
events
BATTLE_PLAYBACK_STATE events
action's events unplayed.
debugValue
Sint32 debugValue
A value btAdjustDebugValue
edits with the d-pad while
Start is held.
counterUnitId
Sint32 counterUnitId
The unit ready to
counterTargetId
Sint32 counterTargetId
counterattack
(ABILITY_EFFECT_COUNTER)
that was just struck,
and the opponent that
struck it.
daedalusFromEnemies
Uint16 daedalusFromEnemies
Daedalus strikes again at the end of the turns after it is summoned: each queued strike is a bit, set when an enemy summoned it, and the next turn's queue is gathered while this one's is played.
nextDaedalusFromEnemies
Uint16 nextDaedalusFromEnemies
daedalusStrikes
Uint8 daedalusStrikes
nextDaedalusStrikes
Uint8 nextDaedalusStrikes
keepObjectPriorities
Uint8 keepObjectPriorities
Nonzero leaves the battle objects' sprite priorities as they are, while Flora's effect plays.
keepBackdropPalette
Uint8 keepBackdropPalette
Nonzero keeps the backdrop's palette while a summon (Charon, Atalanta, Neptune, Moloch) colours the screen.
forceField
Uint8 forceField
Poseidon's force field: 1
when the formation's last
enemy is one of
ENEMY_POSEIDON to
ENEMY_POSEIDON_3, outside
FLAG_MONSTER_BATTLE;
until the Trident lands,
MsgFieldProtects turns
abilities away.
actingAnimation
Uint8 actingAnimation
The animation the acting unit takes as it calls up its Psynergy; 3 as its action starts.
paddingAfterActingAnimation
Uint8 paddingAfterActingAnimation[2]
Up to the word aiStates starts on.
aiStates
BATTLE_AI_STATE aiStates[4]
The action choice's memory for the enemies that act more than once a turn.