Alchemy
Loading...
Searching...
No Matches

FieldWork Struct Reference

Full event work allocated by Field_RunScene (heap slot 27). More...

#include <field_runtime.h>

Data Fields

struct ScenePlacement * tables [4]
 The placement tables placed so far, recorded by Event_SpawnObjectTable.
const struct SceneEvent * events
 the scene's event table
struct FieldActor * actors [66]
 The actors by id: 0 to 7 the party's characters, 8 on the placed actors.
struct MarkerSlot markers [10]
 the map's markers (MARKER_MAX)
s16 fallenCount
 the characters who fell this step
s16 survivorCount
 0 when the whole party fell
s16 fallenOwners [9]
 the characters who fell, from the active party
s16 itemArgument
 the inventory slot Field_UseItem receives
s16 blockedSteps
 Frames the leader has pushed against something, counted by the player controls; touch events and push tiles need more than 12.
s16 mode
 MODE_WORLD_MAP (3) on the world map.
u8 encounterGroups [8]
 encounter zone for each kind of ground
s32 encounterBias
 randomized distance adjustment between battles
s32 encounterThreshold
 encounter steps before a battle; 0x100000
s32 walkingDistanceScale
 scales movement for PP and status updates
s32 walkingDistance
 accumulated 16.16 distance awaiting an update
struct MapCell * currentTile
 the cell the leader last stepped onto
struct MapCell * previousTile
 the cell before it
s32 transition
 SCENE_TRANSITION(style, variant); 0x100 on entry.
u16 unk1c4
 not named by TBS code
u16 transitionActive
 set once the opening transition has started
s32 transitionFrames
 frames; 16 on entry and at each event
s32 fastForward
 debug: skip timed event waits and actor messages
u8 unk1d0 [8]
 not named by TBS code
s16 message
 the next message, advanced as each window opens
u16 unk1da
 set to 0xffff by FieldEvent_Begin; not read by name
s16 unk1dc
 set to -1 by FieldEvent_Begin; not read by name
s16 unk1de
 set to -1 by FieldEvent_Begin; not read by name
struct ObjectRuntime * camera
 the object the map view follows
u8 unk1e4 [0x10]
 not named by TBS code
s32 speaker
 the actor speaking; the leader at each event
s32 messageWindow
 the open message window, 0 for none
s32 sideWindow
 the speaker's portrait window
u8 unk200 [0xab6]
 ObjectTable_ResetForObject builds the leader's two-row placement table at its start; nothing else names it.
u16 busy
 Set while a raised or touch event runs; FieldEvent_Begin then resets the effect counter.
s16 revealActive
 nonzero while Reveal is active
s16 revealFrames
 the frames Reveal has left
s16 revealCenterX
 where Reveal was cast, in pixels
s16 revealCenterY
s16 effectTimerRunning
 Nonzero lets the Reveal countdown advance; menus and other effects pause it.
s16 nameMessage
 first message of the menu's name window (0: none)
s16 nameWidth
 width of the name window (0: the default)
s8 resolvingAction
 set while Psynergy takes effect
s8 castStarted
 set once a cast has been announced
s16 queuedSound
 a sound BattleFx_PlayQueuedSound plays; -1 for none
s16 action
 The twelve requests: each nonzero value asks the field loop for one thing; Field_ClearRequests clears them and Field_CountRequests sums them.
s16 input
 a tile code (252 to 254) for Field_RunPushTileEvent
s16 exit
 the exit taken, which ends the scene
s16 menu
 open the main menu
s16 examine
 the A button: examine what is ahead
s16 start
 the Start button: open the pause menu
u16 descriptor
 an actor's event, as actor | 0x1000
s16 tile
 a tile's collision code, for Field_SearchTile
s16 battle
 the enemy group of a random encounter
s16 command
 a field Psynergy to use, as owner << 10 | Psynergy
s16 item
 an item to use, packed as Field_UseItem reads it
s16 event
 A raised event for Scene_RunRaisedEvent, or -1 when characters fell to poison or hazard damage, -888 the world map, -889 a visibility change.

Detailed Description

Full event work allocated by Field_RunScene (heap slot 27).

The twelve requests from action to event are handled by the field loop.

Definition at line 77 of file field_runtime.h.

Field Documentation

◆ tables

struct ScenePlacement* FieldWork::tables[4]

The placement tables placed so far, recorded by Event_SpawnObjectTable.

Definition at line 79 of file field_runtime.h.

Referenced by Event_SpawnObjectTable(), ObjectTable_ResetForObject(), and Scene_FindActorPlacement().

◆ events

const struct SceneEvent* FieldWork::events

the scene's event table

Definition at line 80 of file field_runtime.h.

Referenced by BattleFx_FindMatchingEvent(), Event_SetSceneEvents(), Field_FindItemEvent(), and Scene_FindEvent().

◆ actors

◆ markers

◆ action

s16 FieldWork::action

The twelve requests: each nonzero value asks the field loop for one thing; Field_ClearRequests clears them and Field_CountRequests sums them.

a step event (1 to 239) for Scene_RunTouchOrExit

Definition at line 87 of file field_runtime.h.

Referenced by Event_EnterDoor(), Field_ClearRequests(), Field_CountRequests(), Field_ProcessStep(), Field_RunScene(), and Lunpa_WatchForFortressApproach().

◆ input

s16 FieldWork::input

a tile code (252 to 254) for Field_RunPushTileEvent

Definition at line 88 of file field_runtime.h.

Referenced by Field_ClearRequests(), Field_CountRequests(), Field_ProcessStep(), and Field_RunScene().

◆ exit

◆ menu

◆ examine

s16 FieldWork::examine

the A button: examine what is ahead

Definition at line 91 of file field_runtime.h.

Referenced by Field_CheckConfiguredKeys(), Field_ClearRequests(), Field_CountRequests(), and Field_RunScene().

◆ start

s16 FieldWork::start

the Start button: open the pause menu

Definition at line 92 of file field_runtime.h.

Referenced by Field_CheckConfiguredKeys(), Field_ClearRequests(), Field_CountRequests(), and Field_RunScene().

◆ descriptor

u16 FieldWork::descriptor

an actor's event, as actor | 0x1000

Definition at line 93 of file field_runtime.h.

Referenced by Field_ClearRequests(), Field_CountRequests(), and Field_RunScene().

◆ tile

s16 FieldWork::tile

a tile's collision code, for Field_SearchTile

Definition at line 94 of file field_runtime.h.

Referenced by Field_ClearRequests(), Field_CountRequests(), Field_RunScene(), Field_SearchTile(), and FieldFx_CheckCloakTile().

◆ battle

s16 FieldWork::battle

◆ command

◆ item

s16 FieldWork::item

an item to use, packed as Field_UseItem reads it

Definition at line 97 of file field_runtime.h.

Referenced by Field_ClearRequests(), Field_CountRequests(), Field_RequestShortcut(), Field_RunScene(), Inventory_TryAddAndReturnOwner(), and PartyInventory_GiveItem().

◆ event

s16 FieldWork::event

A raised event for Scene_RunRaisedEvent, or -1 when characters fell to poison or hazard damage, -888 the world map, -889 a visibility change.

Definition at line 100 of file field_runtime.h.

Referenced by Camera_WorldToScreen(), Event_CloakFades(), Field_ClearRequests(), Field_CountRequests(), Field_ProcessStep(), Field_RequestShortcut(), Field_RunScene(), Field_SearchTile(), FieldObject_PlaceSceneActors(), Lunpa_WatchForUncloakedParty(), ResetSceneTransitionEffect(), and UiText_OpenMessageAtObject().

◆ fallenCount

s16 FieldWork::fallenCount

the characters who fell this step

Definition at line 102 of file field_runtime.h.

Referenced by Field_ProcessStep(), and Field_RunScene().

◆ survivorCount

s16 FieldWork::survivorCount

0 when the whole party fell

Definition at line 103 of file field_runtime.h.

Referenced by Field_ProcessStep(), and Field_RunScene().

◆ fallenOwners

s16 FieldWork::fallenOwners[9]

the characters who fell, from the active party

Definition at line 104 of file field_runtime.h.

Referenced by Field_ProcessStep(), and Field_RunScene().

◆ itemArgument

s16 FieldWork::itemArgument

the inventory slot Field_UseItem receives

Definition at line 105 of file field_runtime.h.

Referenced by Field_RunScene().

◆ blockedSteps

s16 FieldWork::blockedSteps

Frames the leader has pushed against something, counted by the player controls; touch events and push tiles need more than 12.

Definition at line 108 of file field_runtime.h.

Referenced by Field_RunPushTileEvent(), and Scene_RunTouchOrExit().

◆ mode

◆ encounterGroups

u8 FieldWork::encounterGroups[8]

encounter zone for each kind of ground

Definition at line 110 of file field_runtime.h.

Referenced by Encounter_RollTerrain(), Encounter_SelectSceneZones(), and Field_ProcessStep().

◆ encounterBias

s32 FieldWork::encounterBias

randomized distance adjustment between battles

Definition at line 111 of file field_runtime.h.

Referenced by Encounter_SelectEnemyGroup(), Encounter_SelectSceneZones(), and Field_RunScene().

◆ encounterThreshold

s32 FieldWork::encounterThreshold

encounter steps before a battle; 0x100000

Definition at line 112 of file field_runtime.h.

Referenced by Encounter_SelectSceneZones().

◆ walkingDistanceScale

s32 FieldWork::walkingDistanceScale

scales movement for PP and status updates

Definition at line 113 of file field_runtime.h.

Referenced by Field_ProcessStep(), Field_TryJumpForward(), and MercuryLighthouse_HopAcrossPool().

◆ walkingDistance

s32 FieldWork::walkingDistance

accumulated 16.16 distance awaiting an update

Definition at line 114 of file field_runtime.h.

Referenced by Field_ProcessStep(), Field_TryJumpForward(), and MercuryLighthouse_HopAcrossPool().

◆ currentTile

struct MapCell* FieldWork::currentTile

the cell the leader last stepped onto

Definition at line 115 of file field_runtime.h.

Referenced by Field_ProcessStep().

◆ previousTile

struct MapCell* FieldWork::previousTile

the cell before it

Definition at line 116 of file field_runtime.h.

Referenced by Field_ProcessStep().

◆ transition

◆ unk1c4

u16 FieldWork::unk1c4

not named by TBS code

Definition at line 118 of file field_runtime.h.

◆ transitionActive

u16 FieldWork::transitionActive

set once the opening transition has started

Definition at line 119 of file field_runtime.h.

Referenced by Event_FinishScreenTransition(), Event_StartScreenTransition(), Field_RunScene(), and Field_StartEncounterTransition().

◆ transitionFrames

◆ fastForward

s32 FieldWork::fastForward

◆ unk1d0

u8 FieldWork::unk1d0[8]

not named by TBS code

Definition at line 122 of file field_runtime.h.

◆ message

◆ unk1da

u16 FieldWork::unk1da

set to 0xffff by FieldEvent_Begin; not read by name

Definition at line 124 of file field_runtime.h.

Referenced by FieldEvent_Begin().

◆ unk1dc

s16 FieldWork::unk1dc

set to -1 by FieldEvent_Begin; not read by name

Definition at line 125 of file field_runtime.h.

Referenced by FieldEvent_Begin().

◆ unk1de

s16 FieldWork::unk1de

set to -1 by FieldEvent_Begin; not read by name

Definition at line 126 of file field_runtime.h.

Referenced by FieldEvent_Begin().

◆ camera

◆ unk1e4

u8 FieldWork::unk1e4[0x10]

not named by TBS code

Definition at line 128 of file field_runtime.h.

◆ speaker

s32 FieldWork::speaker

the actor speaking; the leader at each event

Definition at line 129 of file field_runtime.h.

Referenced by Event_AskYesNoWithActorAnimation(), Event_ShowSpeakerMessage(), FieldEvent_Begin(), and UiText_OpenMessageAtObject().

◆ messageWindow

s32 FieldWork::messageWindow

the open message window, 0 for none

Definition at line 130 of file field_runtime.h.

Referenced by Event_AskYesNoWithActorAnimation(), Event_ShowSpeakerMessage(), FieldEvent_Begin(), and UiText_OpenMessageAtObject().

◆ sideWindow

s32 FieldWork::sideWindow

the speaker's portrait window

Definition at line 131 of file field_runtime.h.

Referenced by Event_AskYesNoWithActorAnimation(), and UiText_OpenMessageAtObject().

◆ unk200

u8 FieldWork::unk200[0xab6]

ObjectTable_ResetForObject builds the leader's two-row placement table at its start; nothing else names it.

Definition at line 134 of file field_runtime.h.

◆ busy

u16 FieldWork::busy

Set while a raised or touch event runs; FieldEvent_Begin then resets the effect counter.

Definition at line 137 of file field_runtime.h.

Referenced by Battle_ResetEffectCounter(), Event_SearchStatue(), Event_TalkToScholarByDoor(), Field_RunScene(), and FieldEvent_Begin().

◆ revealActive

◆ revealFrames

s16 FieldWork::revealFrames

◆ revealCenterX

s16 FieldWork::revealCenterX

where Reveal was cast, in pixels

Definition at line 140 of file field_runtime.h.

Referenced by FieldEffect_WatchLeaderDistance(), and FieldFx_RunReveal().

◆ revealCenterY

s16 FieldWork::revealCenterY

Definition at line 141 of file field_runtime.h.

Referenced by FieldEffect_WatchLeaderDistance(), and FieldFx_RunReveal().

◆ effectTimerRunning

s16 FieldWork::effectTimerRunning

Nonzero lets the Reveal countdown advance; menus and other effects pause it.

Definition at line 144 of file field_runtime.h.

Referenced by BattleEffect_CleanupSceneObjects(), BattleFx_LoadActionEffectResources(), Field_RunScene(), FieldEffect_WatchLeaderDistance(), and FieldFx_RunReveal().

◆ nameMessage

s16 FieldWork::nameMessage

first message of the menu's name window (0: none)

Definition at line 145 of file field_runtime.h.

Referenced by Event_AskYesNoWithActorAnimation(), and FieldEvent_Begin().

◆ nameWidth

s16 FieldWork::nameWidth

width of the name window (0: the default)

Definition at line 146 of file field_runtime.h.

Referenced by Event_AskYesNoWithActorAnimation(), and FieldEvent_Begin().

◆ resolvingAction

s8 FieldWork::resolvingAction

set while Psynergy takes effect

Definition at line 147 of file field_runtime.h.

Referenced by BattleEffect_CleanupSceneObjects(), BattleFx_LoadActionEffectResources(), Field_UseItem(), and Field_UsePsynergy().

◆ castStarted

s8 FieldWork::castStarted

set once a cast has been announced

Definition at line 148 of file field_runtime.h.

Referenced by BattleEffect_CleanupSceneObjects(), and EventObject_Initialize().

◆ queuedSound

s16 FieldWork::queuedSound

a sound BattleFx_PlayQueuedSound plays; -1 for none

Definition at line 149 of file field_runtime.h.

Referenced by BattleFx_PlayQueuedSound(), BattleFx_SetQueuedSoundAndPlay(), and Field_RunScene().