Skip to Content
The Alchemy Project

include/field/field_state.h

FIELD_STATE, the running scene's state, with its treasure spots and the raised cues the field engine handles itself.

Included by actor.h and scene_tables.h.

Structures

NameDescription
structTREASURE_SPOTA treasure spot placed as an actor: a chest or a Psynergy Stone.
structFIELD_STATEA field scene's state: fdEngineRun allocates it in heap slot 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 FieldStateWork.

Macros

NameDescription
#defineACTOR_ID_COUNT 66The actor ids FIELD_STATE.actors maps (ACTOR_ID): the party's eight characters, then the actors a scene places.
#defineMAP_TRANSITION_TICKS 16How long a map's screen transition takes, in ticks, unless a script or scene sets another length.
#defineREVEAL_TICKS 600The ticks Reveal lasts once cast, ten seconds (FIELD_STATE.revealFrame).
#defineFIELD_PSYNERGY (unit, abilityId) ((unit) << 10 | (abilityId))A field Psynergy for FIELD_STATE.psynergy: the unit who uses it, in bits 10 to 13, and the Psynergy, in bits 0 to 9 (fdUsePsynergy).
#defineFieldStateWork (*(FIELD_STATE **)&HeapSlots[HEAP_SLOT_FIELD])The running field scene's state, heap slot HEAP_SLOT_FIELD; fdEngineRun takes it and frees it.

Enumerations

NameDescription
enumFIELD_RAISED_CUE { FIELD_RAISED_CUE_PARTY_FELL, FIELD_RAISED_CUE_MAP_SCREEN, FI … }The values of FIELD_STATE.raisedCue that the field engine handles itself, rather than passing them to the scene (fdRunRaisedCue).

Description

FIELD_STATE, the running scene's state, with its treasure spots and the raised cues the field engine handles itself.

Macros in detail

ACTOR_ID_COUNT

#define ACTOR_ID_COUNT 66

The actor ids FIELD_STATE.actors maps (ACTOR_ID): the party's eight characters, then the actors a scene places.

Referenced by fdActorClearAll(), fdActorFindLastActiveId(), fdActorGetSpriteById(), fdActorSetOthersPaused(), fdFindNearbyPsynergyTarget(), fdFindNearbyTalkTarget(), fdScriptSpawnActorPlacements(), scBilibinOpenDoorAndLeave(), scColossoTakePlaceForMatch(), scMercuryLighthouseAerieLowerLift(), scMercuryLighthouseAerieRaiseLift() and scStuccoRoomsBEnterDoor().

Definition at line 21 of file field_state.h.

MAP_TRANSITION_TICKS

#define MAP_TRANSITION_TICKS 16

How long a map's screen transition takes, in ticks, unless a script or scene sets another length.

Referenced by fdEngineRun(), fdScriptStart(), mnInnPlaySleep(), scAltinPeakCelebrateHydrosVictory(), scColosseumEntranceShowClearedTrial(), scColosseumEntranceShowFailedTrial(), scCottageRoomsALeaveThroughDoor(), scCottageRoomsBDoraWakesIsaac(), scHammetPalaceHammetsHomecoming(), scHammetPalaceIvanReportsToLayana(), scInit(), scKolimaEnterDoor(), scKolimaWalkThroughExit(), scLaliveroEnterDoor(), scLaliveroEnterDoorway(), scLogRoomsAEnterLoft(), scLogRoomsALeaveLoft(), scMcCoyPalaceAudienceWithMcCoy(), scMcCoyPalaceMcCoyRewardsParty(), scMcCoyPalacePresentRewardChests(), scSolSanctumElementalStarRoomEnterStarRoom(), scSolSanctumLunaSolRoomsArriveAfterWiseOnesRescue(), scSolSanctumStatueExplainStatuePuzzle(), scSolSanctumStatueExplainTrapDisarmed(), scSuhallaEnterDoor(), scSuhallaEnterSanctumDoor(), scValePrologueDoraSendsIsaacToThePlaza(), scValeRequestBackdropExit(), scVaultWalkThroughExit(), scVenusLighthouseAeriePlayShebasFall(), scWorldMapPlayLighthouseTransition(), scWorldMapShowEndingScript(), scWorldMapShowIslandDrifting() and scXianWalkThroughExit().

Definition at line 53 of file field_state.h.

REVEAL_TICKS

#define REVEAL_TICKS 600

The ticks Reveal lasts once cast, ten seconds (FIELD_STATE.revealFrame).

Referenced by fdPsynergyReveal(), scLamakanDesertBatheInOasis() and scLamakanDesertMeetManticore().

Definition at line 55 of file field_state.h.

FIELD_PSYNERGY

#define FIELD_PSYNERGY(unit, abilityId) ((unit) << 10 | (abilityId))

A field Psynergy for FIELD_STATE.psynergy: the unit who uses it, in bits 10 to 13, and the Psynergy, in bits 0 to 9 (fdUsePsynergy).

Referenced by scAltinPeakRequestPsynergy().

Definition at line 59 of file field_state.h.

FieldStateWork

#define FieldStateWork (*(FIELD_STATE **)&HeapSlots[HEAP_SLOT_FIELD])

The running field scene's state, heap slot HEAP_SLOT_FIELD; fdEngineRun takes it and frees it.

Referenced by dbIncreaseItemAndLevelRequestExit(), fdActorClearAll(), fdActorClearOutOfBounds(), fdActorFindBySprite(), fdActorFindLastActiveId(), fdActorGetCueMetatileAheadOfCurrent(), fdActorGetSlotAddress(), fdActorGetSpriteById(), fdActorLookup(), fdActorMoveByKeys(), fdActorMoveOnWorldMap(), fdActorReleaseAtIndex(), fdActorReleaseById(), fdActorResetForLeader(), fdActorRespawn(), fdActorRestore(), fdActorSnapshot(), fdActorUpdatePlayerControl(), fdCameraWorldToScreen(), fdCheckConfiguredKeys(), fdCheckExitRegions(), fdClearRequests(), fdCountRequests(), fdDjinnJoinParty(), fdEffectReleaseRevealSparkles(), fdEncounterCountStepsAndSelectFormation(), fdEncounterRollMapStep(), fdEncounterSelectMapZones(), fdEndBusyAndReveal(), fdExamineMetatile(), fdFindActorPlacement(), fdFindCue(), fdFindItemCue(), fdFindPsynergyCue(), fdGetCollisionAheadOfLeader(), fdIsRevealActive(), fdItemDisplayShowItemInFront(), fdMessageShowAtActor(), fdPartyInventoryGiveItem(), fdPlaceTreasureSpots(), fdPlayQueuedMusic(), fdPsynergyCheckCloakTile(), fdPsynergyDispatch(), fdPsynergyEnd(), fdPsynergyEndReveal(), fdPsynergyFadeFromCastColor(), fdPsynergyFadeToCastColor(), fdPsynergyLoadResources(), fdPsynergyReveal(), fdPsynergyRun() and 412 more.

Definition at line 292 of file field_state.h.

Enumerations in detail

FIELD_RAISED_CUE

enum FIELD_RAISED_CUE

The values of FIELD_STATE.raisedCue that the field engine handles itself, rather than passing them to the scene (fdRunRaisedCue).

EnumeratorValueDescription
FIELD_RAISED_CUE_PARTY_FELL-1Party members fell to poison or hazardous ground this step.
FIELD_RAISED_CUE_MAP_SCREEN-888R on the world map: the map screen (fdMapScreenShow).
FIELD_RAISED_CUE_WORLD_MAP_ZOOM-889L on the world map: the view zooms out while L is held (fdWorldMapZoomOutWhileLHeld).

Definition at line 40 of file field_state.h.