Skip to Content
The Alchemy Project

include/field/actor.h

Actors, the actor snapshot, and the screen transition styles.

Included by actor_update_arm.h, field.h, scene_tables.h, script.h and pushed_actor.h.

Structures

NameDescription
structACTORAn actor: one of the ACTOR_COUNT people and things on the field (ActorsWork, HEAP_SLOT_ACTORS), with its actor script, position, motion toward a target, sprites and update function.
structACTOR_SNAPSHOTActors kept across a battle or a saved scene, with parallel sprite state.

Macros

NameDescription
#defineSCENE_TRANSITION (style, variant) ((style) << 8 | (variant))A scene transition as FIELD_STATE.transition holds it.
#defineSCENE_TRANSITION_STYLE (transition) (((transition) >> 8) & 0xff)The two bytes of a SCENE_TRANSITION: its SCREEN_TRANSITION_STYLE, and the variant that style reads.
#defineSCENE_TRANSITION_VARIANT (transition) ((transition) & 0xff)
#defineACTOR_COUNT 64The actors of ActorsWork (HEAP_SLOT_ACTORS).
#defineSET_ACTOR_POSITION (p, fixedX, fixedY, fixedZ)Sets an actor's position in one statement, as SET_POSITION does for a particle.

Enumerations

NameDescription
enumSCREEN_TRANSITION_STYLE { TRANSITION_FADE, TRANSITION_BACKDROP_FADE, TRANSITION_WINDOW … }How a scene fades in and out: SCENE_TRANSITION's high byte, which fdScreenTransitionStart and fdScreenTransitionFinish read.
enumCENTER_LINE_TRANSITION { CENTER_LINE_STEADY, CENTER_LINE_FLICKER }TRANSITION_CENTER_LINE's variants.
enumACTOR_TARGET { ACTOR_NO_TARGET }The values of ACTOR.targetX, targetY and targetZ (and ACTOR_ARM_VIEW's) that are not coordinates.
enumACTOR_MOTION_FLAG { ACTOR_FOLLOWS_TERRAIN, ACTOR_FALLS, ACTOR_FLOATS, ACTOR_FLOA … }ACTOR.motionFlags bits.
enumACTOR_STEERING_FLAG { ACTOR_FACES_MOTION }ACTOR.steeringFlags bits.
enumARRIVAL_AXIS { ARRIVAL_AXIS_NONE, ARRIVAL_AXIS_X, ARRIVAL_AXIS_Y, ARRIVAL_A … }The axis a moving actor watches to know it has arrived at its target: the one along which it has the furthest to go.
enumACTOR_WATCH_FLAG { ACTOR_WATCH_KEEP_MOTION }Preserves the current action and motion when assigning a watched actor.
enumACTOR_PRIORITY_FLAG { ACTOR_PRIORITY_AUTOMATIC, ACTOR_PRIORITY_UNDERFOOT, ACTOR_PR … }ACTOR.priorityFlags bits.
enumACTOR_COLLISION_FLAG { ACTOR_SOLID, ACTOR_PUSHABLE, ACTOR_NEAR_TALK, ACTOR_NOT_TARG … }ACTOR.collisionFlags bits.
enumanonymous enum { ACTOR_SNAPSHOT_CAPACITY, ACTOR_SNAPSHOT_EMPTY }

Functions

NameDescription
static inline voidfdActorFlagsSet (Uint8 *flags, Uint8 bits)Sets bits in one of an actor's flag bytes.

Variables

NameDescription
extern ACTOR_SNAPSHOTActorSnapshotWorkThe one snapshot, in EWRAM outside the heap so that it outlives the scene change into and out of a battle.

Description

Actors, the actor snapshot, and the screen transition styles.

Macros in detail

SCENE_TRANSITION

#define SCENE_TRANSITION(style, variant) ((style) << 8 | (variant))

A scene transition as FIELD_STATE.transition holds it.

Referenced by dbIncreaseItemAndLevelRequestExit(), fdEngineRun(), fdStartEncounterTransition(), mnInnPlaySleep(), scAlpineCrossingLiftBoulder(), scAltinEnterDoor(), scAltinPeakAwardFrostJewelAndDrain(), scAltinPeakCelebrateHydrosVictory(), scAltinPeakDrainAfterSecondBeast(), scAltinPeakDrainAfterThirdBeast(), scAltmillerCaveInitDarkness(), scBabiPalaceWakeAfterFinals(), scBilibinCaveRestoreIceRoom(), scBilibinCaveRestoreRapierRoom(), scBilibinOpenDoorAndLeave(), scBilibinSetUpTreasury(), scColosseumEntranceExplainPartySupport(), scColosseumEntranceExplainTrial(), scColosseumEntranceShowClearedTrial(), scColosseumEntranceShowFailedTrial(), scColosseumEntranceTalkToTrialAttendant(), scColosseumNavampaMatchPlayPostBattleReunion(), scColosseumNavampaMatchUnusedAskToControlCharacter(), scColossoAskDoneCheering(), scColossoTakePlaceForMatch(), scCottageRoomsALeaveThroughDoor(), scCottageRoomsBCloseScreenAndExit(), scCottageRoomsBDoraWakesIsaac(), scCottageRoomsBHurryToThePlaza(), scCottageRoomsBShowMythrilBag(), scFuchinTempleEnterTemple(), scFuchinTempleNyunpaTeachesKi(), scHammetPalaceHammetsHomecoming(), scHammetPalaceIvanReportsToLayana(), scImilFuchinFallsPrepareRoom(), scImilMeetMiaAtOldCouplesHouse(), scImilMiaSaysFarewellToApprentices(), scImilOpenDoorAndExit(), scInit(), scKalayHammetReturnsToPalace(), scKalayIvanMeetsPalaceGuards(), scKalayPrepareTunnelPassage(), scKalayPrepareTunnelTreasureRoom(), scKalayTolbiDocksPrepareRoom(), scLamaTempleEnterHamasRoom(), scLamaTempleRunHamasFarewell(), scLemurianShipSetSail(), scLogRoomsADefeatThieves(), scLogRoomsADiscussMindReading(), scLogRoomsAFightThievesAgain() and 91 more.

Definition at line 34 of file actor.h.

SCENE_TRANSITION_STYLE

#define SCENE_TRANSITION_STYLE(transition) (((transition) >> 8) & 0xff)

The two bytes of a SCENE_TRANSITION: its SCREEN_TRANSITION_STYLE, and the variant that style reads.

Referenced by fdScreenTransitionFinish() and fdScreenTransitionStart().

Definition at line 37 of file actor.h.

SCENE_TRANSITION_VARIANT

#define SCENE_TRANSITION_VARIANT(transition) ((transition) & 0xff)

Referenced by fdScreenTransitionFinish() and fdScreenTransitionStart().

Definition at line 38 of file actor.h.

ACTOR_COUNT

#define ACTOR_COUNT 64

The actors of ActorsWork (HEAP_SLOT_ACTORS).

Referenced by fdActorFindFree(), fdActorFindNearestFacingTarget(), fdActorScriptCheckOverlap(), fdActorScriptFindOverlappingActor(), fdActorSetRevealSpriteColor(), fdActorSystemInit(), fdActorSystemPlaceSprites(), fdActorSystemProjectSprites(), fdActorUpdateAllOnField(), fdActorUpdatePlayerControl(), fdEffectReleaseRevealSparkles(), fdItemDisplayShowItemInFront() and fdPsynergyEnd().

Definition at line 92 of file actor.h.

SET_ACTOR_POSITION

#define SET_ACTOR_POSITION(p, fixedX, fixedY, fixedZ)

Sets an actor's position in one statement, as SET_POSITION does for a particle.

Referenced by fdActorSetMoveTarget(), fdActorSetPosWithTerrain(), fdActorUpdateAllMotion(), fdActorUpdateAllOnField(), fdCameraFollow(), fdCameraFollowActor(), fdCameraFollowLeaderInBounds(), fdCameraMoveWithinMapBounds(), fdEffectRunSparkEmitter(), fdPsynergyCatch(), fdPsynergyDouse() and fdPsynergyHalt().

Definition at line 330 of file actor.h.

Enumerations in detail

SCREEN_TRANSITION_STYLE

enum SCREEN_TRANSITION_STYLE

How a scene fades in and out: SCENE_TRANSITION's high byte, which fdScreenTransitionStart and fdScreenTransitionFinish read.

EnumeratorValueDescription
TRANSITION_FADE0From or to black.
TRANSITION_BACKDROP_FADE1From or to the backdrop colour.
TRANSITION_WINDOW2A window shape the variant chooses.
TRANSITION_DISSOLVE3
TRANSITION_CENTER_LINE4Opening from, or closing to, the centre line; the variant picks how.

Definition at line 14 of file actor.h.

CENTER_LINE_TRANSITION

enum CENTER_LINE_TRANSITION

TRANSITION_CENTER_LINE's variants.

EnumeratorValueDescription
CENTER_LINE_STEADY0the lines open or close steadily
CENTER_LINE_FLICKER1The lines show only every other tick, as the World Map closes into a battle.

Definition at line 25 of file actor.h.

ACTOR_TARGET

enum ACTOR_TARGET

The values of ACTOR.targetX, targetY and targetZ (and ACTOR_ARM_VIEW's) that are not coordinates.

EnumeratorValueDescription
ACTOR_NO_TARGET(Sint32)0x80000000A target coordinate that is not set: the actor has no target.

Definition at line 42 of file actor.h.

ACTOR_MOTION_FLAG

enum ACTOR_MOTION_FLAG

ACTOR.motionFlags bits.

EnumeratorValueDescription
ACTOR_FOLLOWS_TERRAIN0x01Moves with the ground height under it.
ACTOR_FALLS0x02Falls by its gravity and bounces.
ACTOR_FLOATS0x04Bobs up and down by its gravity.
ACTOR_FLOATS_HIGH0x08With ACTOR_FLOATS, four times as far.
ACTOR_KEEPS_SPEED_ON_SLOPES0x10Keeps its speed on slopes, which slow others down.
ACTOR_MOTION_SPARE0x80Unused: nothing sets or reads it; a jump clears it with ACTOR_FOLLOWS_TERRAIN.
ACTOR_JUMP_KEEPS_MOTION(Uint8)~(ACTOR_FOLLOWS_TERRAIN | ACTOR_MOTION_SPARE)The motion flags a jump keeps as the actor leaves the ground: all but ACTOR_FOLLOWS_TERRAIN and the spare bit.

Definition at line 49 of file actor.h.

ACTOR_STEERING_FLAG

enum ACTOR_STEERING_FLAG

ACTOR.steeringFlags bits.

EnumeratorValueDescription
ACTOR_FACES_MOTION0x01turns toward its velocity, 1/16 turn a tick

Definition at line 68 of file actor.h.

ARRIVAL_AXIS

enum ARRIVAL_AXIS

The axis a moving actor watches to know it has arrived at its target: the one along which it has the furthest to go.

EnumeratorValueDescription
ARRIVAL_AXIS_NONE0no arrival test; set again once it arrives
ARRIVAL_AXIS_X16
ARRIVAL_AXIS_Y17
ARRIVAL_AXIS_Z18

Definition at line 75 of file actor.h.

ACTOR_WATCH_FLAG

enum ACTOR_WATCH_FLAG

Preserves the current action and motion when assigning a watched actor.

EnumeratorValueDescription
ACTOR_WATCH_KEEP_MOTION0x10000

Definition at line 366 of file actor.h.

ACTOR_PRIORITY_FLAG

enum ACTOR_PRIORITY_FLAG

ACTOR.priorityFlags bits.

EnumeratorValueDescription
ACTOR_PRIORITY_AUTOMATIC0x01The sprite takes its priority from the map metatile under it.
ACTOR_PRIORITY_UNDERFOOT0x02The depth sort treats it as 320 pixels higher on the screen.
ACTOR_PRIORITY_OVERHEAD0x04The depth sort treats it as 320 pixels lower on the screen.

Definition at line 372 of file actor.h.

ACTOR_COLLISION_FLAG

enum ACTOR_COLLISION_FLAG

ACTOR.collisionFlags bits.

EnumeratorValueDescription
ACTOR_SOLID0x01blocks other actors and the player
ACTOR_PUSHABLE0x02the player pushes it
ACTOR_NEAR_TALK0x04counts as nearer when picking whom to talk to
ACTOR_NOT_TARGETED0x08never a talk or Psynergy target
ACTOR_NEAR_PSYNERGY0x10counts as nearer when picking a Psynergy target
ACTOR_BLOCKED_BY_SOLID0x80refuses to move into a solid actor (ACTOR.refused)

Definition at line 383 of file actor.h.

anonymous enum

enum { ACTOR_SNAPSHOT_CAPACITY, ACTOR_SNAPSHOT_EMPTY }

EnumeratorValueDescription
ACTOR_SNAPSHOT_CAPACITY32actors a snapshot keeps
ACTOR_SNAPSHOT_EMPTY255an empty slot, and the end of the list

Definition at line 396 of file actor.h.

Functions in detail

fdActorFlagsSet

static inline void fdActorFlagsSet(Uint8 *flags, Uint8 bits)

Sets bits in one of an actor's flag bytes.

Referenced by scVenusLighthouseThrowBackFromLightning().

Definition at line 426 of file actor.h.

Variables in detail

ActorSnapshotWork

extern ACTOR_SNAPSHOT ActorSnapshotWork

The one snapshot, in EWRAM outside the heap so that it outlives the scene change into and out of a battle.

Referenced by fdActorRestore() and fdActorSnapshot().

Definition at line 423 of file actor.h.