src/field/actor_scripts.c
The actor scripts the field and its scenes run.
#include "field/actor.h"#include "field/field_engine_functions.h"#include "field/actor_script.h"#include "field/sprite.h"
Functions
| Name | Description | |
|---|---|---|
Sint32 | fdActorStepAngle () | The SC_CALL functions these scripts run: each takes the actor and returns nonzero to go on with the script this tick. |
Sint32 | fdActorClearSpriteAndCollisionFlags () | The SC_CALL function of MOVEMENT_TYPE_CLEAR_COLLISION: clears an actor's sprite flags and its collision flags, so nothing collides with it. |
Sint32 | fdActorClearSpriteFlags () | Actor script hook: clears the actor's sprite flags (outline and shadow). |
Sint32 | fdActorIgnoreRises () | Actor script hook: the actor takes its metatiles' priority even where the ground in front rises. |
Sint32 | fdActorMoveTowardTarget () | The SC_CALL function of MOVEMENT_TYPE_FOLLOW_WATCHED: walks toward the watched actor, setting out each tick for 16/timer of the way there, and stands once within its timer's pixels of it. |
Sint32 | fdActorTurnTowardWatchedActor () | The SC_CALL function of MOVEMENT_TYPE_FACE_LEADER: turns the actor toward its watched actor, at most 1/16 turn a tick. |
Variables
| Name | Description | |
|---|---|---|
const Uint8 | ScreenTransitionShapesTail [12] | Unused: three rows of 0, 2, 4, 2 that nothing reads. |
const Sint32 | PairTable [2] | {key, value} rows ended by a key of -1; this list has only the end. |
const Sint16 | HeadingWipeSteps [80] | Unused, as fdHeadingClose is: the order the heading's closing wipe clears an 8 by 8 tile in, its pixels (row times 8 plus column) a diagonal at a time from the top left corner, a diagonal every two ticks. |
const Sint32 | ActorOffsetScript [] | The walk-by script (fdActorWalkByById): waits for the actor to arrive, then stands it in its first animation. |
const Sint32 | ActorLaunchScript [] | The launch script (fdActorLaunchFromLeader): waits for the actor to arrive and a tick more, stands it, then turns it a step toward the facing in its timer. |
const Sint32 | ActorStepAngleScript [] | Turns the actor a step toward the facing in its timer. |
const Uint8 | MessageSpeedVoiceRates [4] | The countdown between the sounds of a message's voice as it types, by the message speed the player chose (fdMessageSetVoiceFromActor). |
const Sint32 | EmoteBubbleScript [] | An emote bubble's script (fdActorShowEmoteById): it pops up, squashing and stretching, stays 30 ticks and is released. |
const Sint32 | ActorWaitScript [] | Waits 40 ticks, then releases the actor: the one-off effect fdEffectSetAttached shows over an actor. |
const Sint32 | MovementTypeWanderScript [] | MOVEMENT_TYPE_WANDER: wanders near home, pausing between steps. |
const Sint32 | MovementTypeStandScript [] | MOVEMENT_TYPE_STAND: the actor stands where it was placed. |
const Sint32 | MovementTypeClearCollisionScript [] | MOVEMENT_TYPE_CLEAR_COLLISION: clears the actor's sprite and collision flags. |
const Sint32 | MovementTypeClearSpriteFlagsScript [] | MOVEMENT_TYPE_CLEAR_SPRITE_FLAGS: clears the actor's sprite flags. |
const Sint32 | MovementTypeIgnoreRisesScript [] | MOVEMENT_TYPE_IGNORE_RISES: the actor takes its metatiles' priority even where the ground in front rises. |
const Sint32 | MovementTypeWanderNearScript [] | MOVEMENT_TYPE_WANDER_NEAR: wanders a shorter way near home. |
const Sint32 | MovementTypeWanderCloseScript [] | MOVEMENT_TYPE_WANDER_CLOSE: wanders near home without pausing. |
const Sint32 | MovementTypeSquashScript [] | MOVEMENT_TYPE_SQUASH: the actor bounces on the spot, squashing and stretching, for ever. |
const Sint32 | MovementTypeFollowWatchedScript [] | MOVEMENT_TYPE_FOLLOW_WATCHED: moves the actor toward its watched actor every tick. |
const Sint32 | MovementTypeFaceLeaderScript [] | MOVEMENT_TYPE_FACE_LEADER: turns the actor toward its watched actor, the leader, every tick. |
const Sint32 | MovementTypeTakeLeaderLayerScript [] | MOVEMENT_TYPE_TAKE_LEADER_LAYER: keeps the leader's display layer, every tick. |
const Sint32 | ActorFaceWatchedScript [] | Faces the watched actor every tick, forever. |
Description
The actor scripts the field and its scenes run.
Variables in detail
ScreenTransitionShapesTail
const Uint8 ScreenTransitionShapesTail[12]
Unused: three rows of 0, 2, 4, 2 that nothing reads.
Definition at line 20 of file actor_scripts.c.
PairTable
const Sint32 PairTable[2]
{key, value} rows ended by a key of -1; this list has only the end.
References Sint32.
Referenced by fdPairTableFind().
Definition at line 27 of file actor_scripts.c.
HeadingWipeSteps
const Sint16 HeadingWipeSteps[80]
Unused, as fdHeadingClose is: the order the heading's closing wipe clears an 8 by 8 tile in, its
pixels (row times 8 plus column) a diagonal at a time from the top left corner, a diagonal every
two ticks. A negative entry ends each diagonal and -9 the last; -4 after the longest is read as
any other end, and the 0 after -9 is never reached.
Referenced by fdHeadingClose().
Definition at line 35 of file actor_scripts.c.
ActorOffsetScript
const Sint32 ActorOffsetScript[]
The walk-by script (fdActorWalkByById): waits for the actor to arrive, then
stands it in its first animation.
References Sint32.
Referenced by fdActorWalkByById().
Definition at line 57 of file actor_scripts.c.
ActorLaunchScript
const Sint32 ActorLaunchScript[]
The launch script (fdActorLaunchFromLeader): waits for the actor to arrive
and a tick more, stands it, then turns it a step toward the facing in its
timer.
References fdActorStepAngle() and Sint32.
Referenced by fdActorLaunchFromLeader().
Definition at line 66 of file actor_scripts.c.
ActorStepAngleScript
const Sint32 ActorStepAngleScript[]
Turns the actor a step toward the facing in its timer.
References fdActorStepAngle() and Sint32.
Referenced by fdActorFaceDirectionAndRefreshById(), fdActorFaceDirectionById() and fdTalkToActor().
Definition at line 75 of file actor_scripts.c.
MessageSpeedVoiceRates
const Uint8 MessageSpeedVoiceRates[4]
The countdown between the sounds of a message's voice as it types, by the
message speed the player chose (fdMessageSetVoiceFromActor).
Referenced by fdMessageSetVoiceFromActor().
Definition at line 82 of file actor_scripts.c.
EmoteBubbleScript
const Sint32 EmoteBubbleScript[]
An emote bubble's script (fdActorShowEmoteById): it pops up, squashing and
stretching, stays 30 ticks and is released.
References Sint32.
Referenced by fdActorShowEmoteById().
Definition at line 91 of file actor_scripts.c.
ActorWaitScript
const Sint32 ActorWaitScript[]
Waits 40 ticks, then releases the actor: the one-off effect
fdEffectSetAttached shows over an actor.
References Sint32.
Referenced by fdEffectSetAttached().
Definition at line 122 of file actor_scripts.c.
MovementTypeWanderScript
const Sint32 MovementTypeWanderScript[]
MOVEMENT_TYPE_WANDER: wanders near home, pausing between steps.
References Sint32.
Referenced by fdActorSetMovementType().
Definition at line 128 of file actor_scripts.c.
MovementTypeStandScript
const Sint32 MovementTypeStandScript[]
MOVEMENT_TYPE_STAND: the actor stands where it was placed.
References Sint32.
Referenced by fdActorSetMovementType().
Definition at line 153 of file actor_scripts.c.
MovementTypeClearCollisionScript
const Sint32 MovementTypeClearCollisionScript[]
MOVEMENT_TYPE_CLEAR_COLLISION: clears the actor's sprite and collision flags.
References fdActorClearSpriteAndCollisionFlags() and Sint32.
Referenced by fdActorSetMovementType().
Definition at line 158 of file actor_scripts.c.
MovementTypeClearSpriteFlagsScript
const Sint32 MovementTypeClearSpriteFlagsScript[]
MOVEMENT_TYPE_CLEAR_SPRITE_FLAGS: clears the actor's sprite flags.
References fdActorClearSpriteFlags() and Sint32.
Referenced by fdActorSetMovementType().
Definition at line 164 of file actor_scripts.c.
MovementTypeIgnoreRisesScript
const Sint32 MovementTypeIgnoreRisesScript[]
MOVEMENT_TYPE_IGNORE_RISES: the actor takes its metatiles' priority even
where the ground in front rises.
References fdActorIgnoreRises() and Sint32.
Referenced by fdActorSetMovementType().
Definition at line 171 of file actor_scripts.c.
MovementTypeWanderNearScript
const Sint32 MovementTypeWanderNearScript[]
MOVEMENT_TYPE_WANDER_NEAR: wanders a shorter way near home.
References Sint32.
Referenced by fdActorSetMovementType().
Definition at line 177 of file actor_scripts.c.
MovementTypeWanderCloseScript
const Sint32 MovementTypeWanderCloseScript[]
MOVEMENT_TYPE_WANDER_CLOSE: wanders near home without pausing.
References Sint32.
Referenced by fdActorSetMovementType().
Definition at line 202 of file actor_scripts.c.
MovementTypeSquashScript
const Sint32 MovementTypeSquashScript[]
MOVEMENT_TYPE_SQUASH: the actor bounces on the spot, squashing and
stretching, for ever.
References Sint32.
Referenced by fdActorSetMovementType() and fdSummonTabletPlayRunes().
Definition at line 215 of file actor_scripts.c.
MovementTypeFollowWatchedScript
const Sint32 MovementTypeFollowWatchedScript[]
MOVEMENT_TYPE_FOLLOW_WATCHED: moves the actor toward its watched actor every
tick.
References fdActorMoveTowardTarget() and Sint32.
Referenced by fdActorSetMovementType().
Definition at line 226 of file actor_scripts.c.
MovementTypeFaceLeaderScript
const Sint32 MovementTypeFaceLeaderScript[]
MOVEMENT_TYPE_FACE_LEADER: turns the actor toward its watched actor, the
leader, every tick.
References fdActorTurnTowardWatchedActor() and Sint32.
Referenced by fdActorSetMovementType().
Definition at line 233 of file actor_scripts.c.
MovementTypeTakeLeaderLayerScript
const Sint32 MovementTypeTakeLeaderLayerScript[]
MOVEMENT_TYPE_TAKE_LEADER_LAYER: keeps the leader's display layer, every
tick.
References fdActorTakeLeaderLayer() and Sint32.
Referenced by fdActorSetMovementType().
Definition at line 240 of file actor_scripts.c.
ActorFaceWatchedScript
const Sint32 ActorFaceWatchedScript[]
Faces the watched actor every tick, forever.
References Sint32.
Referenced by fdActorWatchAndSetScript() and fdTalkToActor().
Definition at line 247 of file actor_scripts.c.