struct FIELD_STATE
A field scene's state: fdEngineRun allocates it in HEAP_SLOT_FIELD, zeroes it and frees it on the way out, and the field engine, the script commands and the scene overlays all reach it through RamHeapSlots->fieldState.
Declared in field_state.h.
Fields
| Name | Description | |
|---|---|---|
const ACTOR_PLACE * | tables [4] | The actor placement tables placed so far, recorded by fdScriptSpawnActorTable. |
const CUE_VIEW * | cues | The scene's cue table. |
struct ACTOR * | actors [FIELD_ACTOR_COUNT] | The actors by actor id: 0 to 7 the party's characters, 8 on the placed actors, FIELD_TREASURE_ACTOR on the treasure spots. |
Sint16 | stepCue | A step cue (1 to 230) for fdRunStepCueOrExit. |
Sint16 | pushMetatile | A metatile's attributes for fdRunPushMetatile. |
Sint16 | exit | The exit taken, which ends the scene; EXIT_KEEP_DESTINATION for a warp. |
Sint16 | fieldMenu | Open the field menu. |
Sint16 | aButton | The A button: a talk, an examine or the field menu, by what is ahead. |
Sint16 | pauseMenu | The Start button: open the Pause menu. |
Sint16 | talk | An actor's talk, as actor id | FIELD_TALK_REQUEST. |
Sint16 | examineMetatile | A metatile's metatile behavior, for fdExamineMetatile. |
Sint16 | encounter | The enemy group of a random encounter. |
Sint16 | psynergy | A field Psynergy to use, as unit << 10 | Psynergy. |
Sint16 | item | An item to use, packed as fdUseItem reads it. |
Sint16 | raisedCue | A raised cue's number for fdRunRaisedCue, or an enum FIELD_RAISED_CUE. |
Sint16 | fallenCount | The characters who fell this step. |
Sint16 | survivorCount | 0 when the whole party fell. |
Sint16 | fallenOwners [9] | The characters who fell, from the active party. |
Sint16 | itemSlot | The inventory slot fdUseItem receives. |
Sint16 | blockedSteps | Ticks the leader has pushed against something, counted by the player controls; step cues and push metatiles need more than FIELD_PUSH_TICKS. |
Uint16 | heldKeys | The keys held: a ledge (KEY_DOWN) and a climb (KEY_UP or KEY_DOWN) read them, and they are kept when a rope or tightrope was raised. |
Uint8 | unusedAfterHeldKeys [2] | No code names it. |
Sint8 | mode | An ACTOR_SYSTEM_MODE. |
Sint8 | areaGraphicsPending | The area's graphics are to be reloaded on the World Map (fdWorldMapFreeze, fdWorldMapReloadPendingAreaGraphics). |
Uint8 | encounterZones [8] | Encounter zone for each kind of ground. |
Sint32 | encounterBias | Randomized distance adjustment between battles. |
FIXED | encounterThreshold | Encounter steps before a battle; toFIXED(16). |
FIXED | walkingDistanceScale | Scales the leader's speed into walkingDistance, in 16.16 fixed point: 409 on entry, 0 in a town. |
FIXED | walkingDistance | Distance walked toward the next toFIXED(1), at which the party regains PP, Djinn recover and poison hurts (fdUpdateWalking). |
struct MAP_METATILE * | currentMetatile | The metatile the leader last stepped onto. |
struct MAP_METATILE * | prevMetatile | The metatile before it. |
Sint32 | transition | A SCENE_TRANSITION(style, |
Uint16 | unused | variant): a TRANSITION_BACKDROP_FADE on entry. |
Uint16 | transitionActive | Set once the opening transition has started. |
Sint32 | transitionFrame | The transition's ticks: MAP_TRANSITION_TICKS on entry and at each script. |
Sint32 | fastForward | Debug: skip timed script |
Uint8 | unusedAfterFastForward [8] | waits and actor messages. |
Sint16 | msg | The next message, advanced as each window opens. |
Uint16 | unusedAfterMsg | Set to 0xffff by fdScriptStart at each script; nothing reads it. |
Sint16 | unusedBeforeCamera [2] | Both set to -1 by fdScriptStart at each script; nothing reads them. |
struct ACTOR * | camera | The actor the map view |
Uint8 | unusedAfterCamera [16] | follows. |
Sint32 | speaker | The actor speaking; the leader at each script. |
struct WINDOW * | msgWindow | The open message window, NULL for none. |
struct WINDOW * | sideWindow | The speaker's portrait window. |
ACTOR_PLACE | leaderPlacements [2] | The leader's two-row actor placement table (its row and an end row), which fdActorResetForLeader builds. |
struct WINDOW * | noticeWindow | A scene's timed notice. |
Uint16 | noticeFrame | |
Uint16 | savedFadeTarget [448 * 3] | The palette a field Psynergy's tint fades back to, as a palette fade's target (BG half, then sprite half), saved as the tint starts. |
Sint16 | busy | Set while a raised or step cue runs; fdScriptStart then ends the lasting Psynergy. |
Sint8 | revealActive | Nonzero while Reveal is active. |
Sint8 | effectTimerRunning | Lets the Reveal countdown advance. |
Sint16 | revealFrame | The ticks Reveal has left. |
Sint16 | revealCenterX | Where Reveal was cast, in |
Sint16 | revealCenterY | pixels. |
Sint8 | ringActive | FIELD_PSYNERGY_RING's ring is shown (fdPsynergyRing); A, Select, Start or a shortcut ends it. |
Sint8 | ringTimerRunning | Off while another field Psynergy is cast. |
Sint16 | ringFrame | Ticks left of the ring; 0 ends it. |
Sint16 | choiceMsg | The first of the two names the next yes/no choice shows in place of Yes and No (mnYesNoMenuRun), 0 for those. |
Sint16 | choiceWidth | The choice window's width, 0 for the default. |
Sint16 | choiceSelection | The answer the choice starts on. |
Sint8 | psynergyActing | Set while Psynergy takes effect. |
Sint8 | castStarted | Set once a cast has been announced. |
Sint16 | queuedSound | A sound fdPlayQueuedMusic plays; -1 for none. |
Uint8 | unusedAfterQueuedSound [2] | No code names it. |
struct ACTOR * | movedBlock | The block fdActorLiftTargetBlock lifted, for fdActorPlaceMovedBlock. |
Sint16 | psynergyMetatiles [56] | The metatiles a Psynergy touches, as metatile coordinates, ended by -1. |
Sint8 | psynergyHitObject | |
Sint8 | targetX | |
Sint8 | targetY | |
Sint8 | targetZ | |
Sint16 | scoopedItem | The item Scoop dug up (or its coins, SCOOPED_COINS | count), given when the leader examines it (SCOOPED_ITEM_ACTOR). |
Sint8 | sceneAttributeLow | |
Sint8 | sceneAttributeHigh | |
Sint8 | blazeLongSpray | |
Sint8 | hoverReady | A party member knows Hover and the ship flies. |
Sint8 | terrainKind | An SHIP_TERRAIN_KIND. |
Sint8 | climbing | |
Sint16 | cycloneCarryX | The centre of the Cyclone teleporter |
Sint16 | cycloneCarryZ | metatile (kind 2) beside the caster, in pixels, that the Cyclone carries the leader to; -1 for none. |
Sint16 | cycloneLiftX | The centre of the Cyclone lift metatile (kind 3) beside the caster, in pixels, that the Cyclone lifts the leader onto; -1 for none. |
Sint16 | cycloneLiftZ | |
Sint16 | glow | |
Sint16 | glowHeld | |
Sint16 | standing | |
Uint16 | sandTrailPriority | |
Uint16 | psynergyDrawFlags | |
Uint8 | padding [2] |
Description
A field scene's state: fdEngineRun allocates it in HEAP_SLOT_FIELD, zeroes it
and frees it on the way out, and the field engine, the script commands and
the scene overlays all reach it through RamHeapSlots->fieldState.
struct FIELD_STATE
Referenced by dbIncreaseItemAndLevelRequestExit(), fdActorCheckBlocked(), fdActorCrossRope(), fdActorCrossTightrope(), fdActorFindAtMetatile(), fdActorFindBySprite(), fdActorFindLastActiveId(), fdActorFlyOnWorldMap(), fdActorGetCueMetatileAheadOfCurrent(), fdActorGetSpriteById(), fdActorLiftTargetBlock(), fdActorLookup(), fdActorMoveAsSand(), fdActorMoveAsSandOnWorldMap(), fdActorMoveByKeys(), fdActorMoveOnWorldMap(), fdActorReleaseAtIndex(), fdActorReleaseById(), fdActorResetForLeader(), fdActorSailOnMap(), fdActorSailOnWorldMap(), fdActorTableClear(), fdActorUpdateHoverControl(), fdActorUpdatePlayerControl(), fdActorUpdateWalkingControl(), fdApplyEntrance(), fdBlazeUpdateSpray(), fdCameraFollow(), fdCameraFollowActor(), fdCameraGetActor(), fdCameraMoveWithinMapBounds(), fdCameraSetSpeedParams(), fdCameraWaitForArrival(), fdCameraWorldToScreen(), fdCheckConfiguredKeys(), fdCheckExitRegions(), fdClearRequests(), fdCountRequests(), fdCycloneCopyTouchedMetatiles(), fdEffectCheckCloakTile(), fdEncounterCountStepsAndSelectFormation(), fdEncounterSelectMapZones(), fdEngineRun(), fdFindCue(), fdFindItemCue(), fdFindPsynergyCue(), fdFlagBlockApplyFlags(), fdGetCollisionAheadOfLeader(), fdGetCollisionUnderLeader(), fdGetPartyActor() and 307 more.
Definition at line 119 of file field_state.h.
Fields in detail
tables
const ACTOR_PLACE *tables[4]
The actor placement tables
placed so far, recorded by
fdScriptSpawnActorTable.
cues
const CUE_VIEW *cues
The scene's cue table.
actors
struct ACTOR *actors[FIELD_ACTOR_COUNT]
The actors by actor id: 0
to 7 the party's
characters, 8 on the placed
actors,
FIELD_TREASURE_ACTOR on the
treasure spots.
stepCue
Sint16 stepCue
A step cue (1 to 230) for
fdRunStepCueOrExit.
pushMetatile
Sint16 pushMetatile
A metatile's attributes for
fdRunPushMetatile.
exit
Sint16 exit
The exit taken, which ends the
scene; EXIT_KEEP_DESTINATION
for a warp.
fieldMenu
Sint16 fieldMenu
Open the field menu.
aButton
Sint16 aButton
The A button: a talk, an examine or the field menu, by what is ahead.
pauseMenu
Sint16 pauseMenu
The Start button: open the Pause menu.
talk
Sint16 talk
An actor's talk, as actor id |
FIELD_TALK_REQUEST.
examineMetatile
Sint16 examineMetatile
A metatile's metatile
behavior, for
fdExamineMetatile.
encounter
Sint16 encounter
The enemy group of a random encounter.
psynergy
Sint16 psynergy
A field Psynergy to use, as unit << 10 | Psynergy.
item
Sint16 item
An item to use, packed as
fdUseItem reads it.
raisedCue
Sint16 raisedCue
A raised cue's number for
fdRunRaisedCue, or an enum
FIELD_RAISED_CUE.
fallenCount
Sint16 fallenCount
The characters who fell this step.
survivorCount
Sint16 survivorCount
0 when the whole party fell.
fallenOwners
Sint16 fallenOwners[9]
The characters who fell, from the active party.
itemSlot
Sint16 itemSlot
The inventory slot fdUseItem
receives.
blockedSteps
Sint16 blockedSteps
Ticks the leader has pushed
against something, counted by
the player controls; step cues
and push metatiles need more
than FIELD_PUSH_TICKS.
heldKeys
Uint16 heldKeys
The keys held: a ledge
(KEY_DOWN) and a climb (KEY_UP
or KEY_DOWN) read them, and
they are kept when a rope or
tightrope was raised.
unusedAfterHeldKeys
Uint8 unusedAfterHeldKeys[2]
No code names it.
mode
Sint8 mode
areaGraphicsPending
Sint8 areaGraphicsPending
The area's graphics are to be reloaded on
the World Map (fdWorldMapFreeze,
fdWorldMapReloadPendingAreaGraphics).
encounterZones
Uint8 encounterZones[8]
Encounter zone for each kind of ground.
encounterBias
Sint32 encounterBias
Randomized distance adjustment between battles.
encounterThreshold
FIXED encounterThreshold
Encounter steps before a battle;
toFIXED(16).
walkingDistanceScale
FIXED walkingDistanceScale
Scales the leader's speed into walkingDistance, in 16.16 fixed point: 409 on entry, 0 in a town.
walkingDistance
FIXED walkingDistance
Distance walked toward the next toFIXED(1),
at which the party regains PP, Djinn recover
and poison hurts (fdUpdateWalking).
currentMetatile
struct MAP_METATILE *currentMetatile
The metatile the leader last stepped onto.
prevMetatile
struct MAP_METATILE *prevMetatile
The metatile before it.
transition
Sint32 transition
A SCENE_TRANSITION(style,
unused
Uint16 unused
variant): a
TRANSITION_BACKDROP_FADE
on entry.
transitionActive
Uint16 transitionActive
Set once the opening transition has started.
transitionFrame
Sint32 transitionFrame
The transition's ticks:
MAP_TRANSITION_TICKS on
entry and at each script.
fastForward
Sint32 fastForward
Debug: skip timed script
unusedAfterFastForward
Uint8 unusedAfterFastForward[8]
waits and actor messages.
msg
Sint16 msg
The next message, advanced as each window opens.
unusedAfterMsg
Uint16 unusedAfterMsg
Set to 0xffff by
fdScriptStart at each
script; nothing reads it.
unusedBeforeCamera
Sint16 unusedBeforeCamera[2]
Both set to -1 by
fdScriptStart at each
script; nothing reads
them.
camera
struct ACTOR *camera
The actor the map view
unusedAfterCamera
Uint8 unusedAfterCamera[16]
follows.
speaker
Sint32 speaker
The actor speaking; the leader at each script.
msgWindow
struct WINDOW *msgWindow
The open message window,
NULL for none.
sideWindow
struct WINDOW *sideWindow
The speaker's portrait window.
leaderPlacements
ACTOR_PLACE leaderPlacements[2]
The leader's two-row
actor placement table
(its row and an end row),
which
fdActorResetForLeader
builds.
noticeWindow
struct WINDOW *noticeWindow
A scene's timed notice.
noticeFrame
Uint16 noticeFrame
savedFadeTarget
Uint16 savedFadeTarget[448 * 3]
The palette a field Psynergy's tint fades back to, as a palette fade's target (BG half, then sprite half), saved as the tint starts.
busy
Sint16 busy
Set while a raised or
step cue runs;
fdScriptStart then ends
the lasting Psynergy.
revealActive
Sint8 revealActive
Nonzero while Reveal is active.
effectTimerRunning
Sint8 effectTimerRunning
Lets the Reveal countdown advance.
revealFrame
Sint16 revealFrame
The ticks Reveal has left.
revealCenterX
Sint16 revealCenterX
Where Reveal was cast, in
revealCenterY
Sint16 revealCenterY
pixels.
ringActive
Sint8 ringActive
FIELD_PSYNERGY_RING's
ring is shown
(fdPsynergyRing); A,
Select, Start or a
shortcut ends it.
ringTimerRunning
Sint8 ringTimerRunning
Off while another field Psynergy is cast.
ringFrame
Sint16 ringFrame
Ticks left of the ring; 0 ends it.
choiceMsg
Sint16 choiceMsg
The first of the two
names the next yes/no
choice shows in place of
Yes and No
(mnYesNoMenuRun), 0 for
those.
choiceWidth
Sint16 choiceWidth
The choice window's width, 0 for the default.
choiceSelection
Sint16 choiceSelection
The answer the choice starts on.
psynergyActing
Sint8 psynergyActing
Set while Psynergy takes effect.
castStarted
Sint8 castStarted
Set once a cast has been announced.
queuedSound
Sint16 queuedSound
A sound fdPlayQueuedMusic
plays; -1 for none.
unusedAfterQueuedSound
Uint8 unusedAfterQueuedSound[2]
No code names it.
movedBlock
struct ACTOR *movedBlock
The block
fdActorLiftTargetBlock
lifted, for
fdActorPlaceMovedBlock.
psynergyMetatiles
Sint16 psynergyMetatiles[56]
The metatiles a Psynergy touches, as metatile coordinates, ended by -1.
psynergyHitObject
Sint8 psynergyHitObject
targetX
Sint8 targetX
targetY
Sint8 targetY
targetZ
Sint8 targetZ
scoopedItem
Sint16 scoopedItem
The item Scoop dug up (or its coins, SCOOPED_COINS | count), given when
the leader examines it (SCOOPED_ITEM_ACTOR).
sceneAttributeLow
Sint8 sceneAttributeLow
sceneAttributeHigh
Sint8 sceneAttributeHigh
blazeLongSpray
Sint8 blazeLongSpray
hoverReady
Sint8 hoverReady
A party member knows Hover and the ship flies.
terrainKind
Sint8 terrainKind
climbing
Sint8 climbing
cycloneCarryX
Sint16 cycloneCarryX
The centre of the Cyclone teleporter
cycloneCarryZ
Sint16 cycloneCarryZ
metatile (kind 2) beside the caster, in pixels, that the Cyclone carries the leader to; -1 for none.
cycloneLiftX
Sint16 cycloneLiftX
The centre of the Cyclone lift metatile (kind 3) beside the caster, in pixels, that the Cyclone lifts the leader onto; -1 for none.
cycloneLiftZ
Sint16 cycloneLiftZ
glow
Sint16 glow
glowHeld
Sint16 glowHeld
standing
Sint16 standing
sandTrailPriority
Uint16 sandTrailPriority
psynergyDrawFlags
Uint16 psynergyDrawFlags
padding
Uint8 padding[2]