1#ifndef ALCHEMY_FIELD_OBJ_H
2#define ALCHEMY_FIELD_OBJ_H
20#define SCENE_TRANSITION(style, variant) ((style) << 8 | (variant))
145#define ACTOR_NO_TARGET ((s32)0x80000000)
Animated sprites: their layers, frames and colour modes, and the resource slots they draw from.
EventWork, the running scene's event work.
FieldCoordinate, a position on the field.
ActorLinkFlag
Preserves the current action and motion when assigning a linked target.
@ TRANSITION_BACKDROP_FADE
ActorPriorityFlag
FieldActor.priorityFlags bits.
@ ACTOR_PRIORITY_UNDERFOOT
The depth sort treats it as 320 pixels higher on the screen.
@ ACTOR_PRIORITY_AUTOMATIC
The sprite takes its priority from the map cell under it.
ActorMotionFlag
FieldActor.motionFlags bits.
@ ACTOR_FOLLOWS_TERRAIN
moves with the ground height under it
@ ACTOR_FALLS
falls by its gravity and bounces
ActorSteeringFlag
FieldActor.steeringFlags bits.
@ ACTOR_FACES_MOTION
turns toward its velocity, 1/16 turn a frame
struct EventWork * gEventWork
STATIC_ASSERT, a compile-time check that emits nothing.
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
A field actor: a person or thing on the field with a position, motion toward a target,...
s16 timer
The parameter its action script reads (a follow distance or an angle to face), the player's frames to...
s32 speed
speed limit, 16.16 fixed-point pixels per frame
s32 targetX
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
struct FieldActor * linkedObject
The object its action script follows or faces.
u16 radius
Collision radius in pixels: 16, or half the sprite metadata's boxY, when created; the overlap checks ...
u8 steeringFlags
ActorSteeringFlag bits.
u8 motionFlags
ActorMotionFlag bits; zero is free flight in 3D, and 3 is set on creation.
u8 refused
Frames a solid object has refused its move (ScriptMotionObject's refused); SC_SYNC stops waiting afte...
u8 riseCounter
not read by the engine; scene code's own counter
union FieldCoordinate x
16.16 fixed-point pixels
s32 targetZ
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
u8 retainSpriteCache
Nonzero keeps its sprite's VRAM cache entry while sprites are suspended or it is off screen (ObjectSy...
s32 velocityX
16.16 fixed-point pixels per frame
u8 paused
nonzero skips its script and motion, not its update
s32 bounce
The share of its falling speed kept as it bounces on landing, 16.16 fixed point (0x4000 when created)...
union FieldCoordinate y
16.16 fixed-point pixels
u8 priorityFlags
ActorPriorityFlag bits, read by the scrolling camera.
u8 repeatCount
the object script's SC_LOOP count (ScriptInterpreter)
s32 terrainHeight
16.16 fixed-point pixels
s32 velocityY
16.16 fixed-point pixels per frame
u8 spriteStorageKind
Zero hides sprites; one draws a single sprite, two draws a group.
s32 gravity
Taken off the vertical velocity each frame while it is above the ground, in 16.16 fixed-point pixels ...
u8 unk56[3]
The ARRIVAL_AXIS_* watched for arrival, the object script's last flag test (ScriptInterpreter....
union FieldCoordinate z
16.16 fixed-point pixels
s32 acceleration
Added toward the target each frame, or taken off the speed when there is none, in 16....
s32 targetY
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
s32 scaleX
16.16 fixed point, 0x10000 full size
s32 scaleY
16.16 fixed point, 0x10000 full size
u8 unk00[6]
The object's script pointer (nonzero while the object is live) and its cursor, which ObjectRuntime na...
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
s32 riseBaseY
Zeroed by FieldObject_Create and not read by the engine; scene code keeps a resting height,...
u16 wait
the object script's wait, in frames (ScriptMotionObject)
u16 work
The side of the player's next footprint (2 after a stop), or scene scratch.
u8 collisionFlags
bits: 7 refuses to move into a solid object | 4 nearer for Psynergy targets | 3 never a talk or Psyne...
s32 velocityZ
16.16 fixed-point pixels per frame
u8 riseEnabled
not read by the engine; scene code's own state
u8 terrainId
The map layer (0 to 3) its ground height is read from, which the scrolling camera updates from the ce...
u8 frozen
Nonzero skips steering, terrain, gravity and floating; its velocity still moves it (ScriptMotionObjec...
The integer types, TRUE, UNUSED and the fixed-address macros.
struct AnimationObject * sprite
spriteStorageKind 1
void ** sprites
spriteStorageKind 2: four sprites, empty ones null
A field coordinate, read whole or as its fraction and its whole pixels.
An object on the field, read as an actor or as an effect.