include/field/actor.h
Actors, the actor snapshot, and the screen transition styles.
#include "fixed_math.h"#include "static_assert.h"#include "types.h"#include "field/field_state.h"#include "field/field_coordinate.h"#include "field/sprite.h"
Included by actor_update_arm.h, field.h, scene_tables.h, script.h and pushed_actor.h.
Structures
| Name | Description | |
|---|---|---|
struct | ACTOR | An 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. |
struct | ACTOR_SNAPSHOT | Actors kept across a battle or a saved scene, with parallel sprite state. |
Macros
| Name | Description | |
|---|---|---|
#define | SCENE_TRANSITION (style, variant) ((style) << 8 | (variant)) | A scene transition as FIELD_STATE.transition holds it. |
#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. |
#define | SCENE_TRANSITION_VARIANT (transition) ((transition) & 0xff) | |
#define | ACTOR_COUNT 64 | The actors of ActorsWork (HEAP_SLOT_ACTORS). |
#define | SET_ACTOR_POSITION (p, fixedX, fixedY, fixedZ) | Sets an actor's position in one statement, as SET_POSITION does for a particle. |
Enumerations
| Name | Description | |
|---|---|---|
enum | SCREEN_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. |
enum | CENTER_LINE_TRANSITION { CENTER_LINE_STEADY, CENTER_LINE_FLICKER } | TRANSITION_CENTER_LINE's variants. |
enum | ACTOR_TARGET { ACTOR_NO_TARGET } | The values of ACTOR.targetX, targetY and targetZ (and ACTOR_ARM_VIEW's) that are not coordinates. |
enum | ACTOR_MOTION_FLAG { ACTOR_FOLLOWS_TERRAIN, ACTOR_FALLS, ACTOR_FLOATS, ACTOR_FLOA … } | ACTOR.motionFlags bits. |
enum | ACTOR_STEERING_FLAG { ACTOR_FACES_MOTION } | ACTOR.steeringFlags bits. |
enum | ARRIVAL_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. |
enum | ACTOR_WATCH_FLAG { ACTOR_WATCH_KEEP_MOTION } | Preserves the current action and motion when assigning a watched actor. |
enum | ACTOR_PRIORITY_FLAG { ACTOR_PRIORITY_AUTOMATIC, ACTOR_PRIORITY_UNDERFOOT, ACTOR_PR … } | ACTOR.priorityFlags bits. |
enum | ACTOR_COLLISION_FLAG { ACTOR_SOLID, ACTOR_PUSHABLE, ACTOR_NEAR_TALK, ACTOR_NOT_TARG … } | ACTOR.collisionFlags bits. |
enum | anonymous enum { ACTOR_SNAPSHOT_CAPACITY, ACTOR_SNAPSHOT_EMPTY } |
Functions
| Name | Description | |
|---|---|---|
static inline void | fdActorFlagsSet (Uint8 *flags, Uint8 bits) | Sets bits in one of an actor's flag bytes. |
Variables
| Name | Description | |
|---|---|---|
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. |
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.
| Enumerator | Value | Description |
|---|---|---|
TRANSITION_FADE | 0 | From or to black. |
TRANSITION_BACKDROP_FADE | 1 | From or to the backdrop colour. |
TRANSITION_WINDOW | 2 | A window shape the variant chooses. |
TRANSITION_DISSOLVE | 3 | |
TRANSITION_CENTER_LINE | 4 | Opening 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.
| Enumerator | Value | Description |
|---|---|---|
CENTER_LINE_STEADY | 0 | the lines open or close steadily |
CENTER_LINE_FLICKER | 1 | The 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.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_NO_TARGET | (Sint32)0x80000000 | A 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.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_FOLLOWS_TERRAIN | 0x01 | Moves with the ground height under it. |
ACTOR_FALLS | 0x02 | Falls by its gravity and bounces. |
ACTOR_FLOATS | 0x04 | Bobs up and down by its gravity. |
ACTOR_FLOATS_HIGH | 0x08 | With ACTOR_FLOATS, four times as far. |
ACTOR_KEEPS_SPEED_ON_SLOPES | 0x10 | Keeps its speed on slopes, which slow others down. |
ACTOR_MOTION_SPARE | 0x80 | Unused: 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.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_FACES_MOTION | 0x01 | turns 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.
| Enumerator | Value | Description |
|---|---|---|
ARRIVAL_AXIS_NONE | 0 | no arrival test; set again once it arrives |
ARRIVAL_AXIS_X | 16 | |
ARRIVAL_AXIS_Y | 17 | |
ARRIVAL_AXIS_Z | 18 |
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.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_WATCH_KEEP_MOTION | 0x10000 |
Definition at line 366 of file actor.h.
ACTOR_PRIORITY_FLAG
enum ACTOR_PRIORITY_FLAG
ACTOR.priorityFlags bits.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_PRIORITY_AUTOMATIC | 0x01 | The sprite takes its priority from the map metatile under it. |
ACTOR_PRIORITY_UNDERFOOT | 0x02 | The depth sort treats it as 320 pixels higher on the screen. |
ACTOR_PRIORITY_OVERHEAD | 0x04 | The 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.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_SOLID | 0x01 | blocks other actors and the player |
ACTOR_PUSHABLE | 0x02 | the player pushes it |
ACTOR_NEAR_TALK | 0x04 | counts as nearer when picking whom to talk to |
ACTOR_NOT_TARGETED | 0x08 | never a talk or Psynergy target |
ACTOR_NEAR_PSYNERGY | 0x10 | counts as nearer when picking a Psynergy target |
ACTOR_BLOCKED_BY_SOLID | 0x80 | refuses 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 }
| Enumerator | Value | Description |
|---|---|---|
ACTOR_SNAPSHOT_CAPACITY | 32 | actors a snapshot keeps |
ACTOR_SNAPSHOT_EMPTY | 255 | an 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.