Skip to Content
The Alchemy Project

struct FIELD_EFFECT

A field effect: a small object on the field that moves at its velocity and grows and spins at its rates, run by its script and update hook. More…

Declared in field_effect.h.

Fields

NameDescription
const Sint32 *scriptActor's script pointer, cursor and facing.
Sint16scriptCursor
Uint16facing
FIXEDx16.16 fixed-point pixels.
FIXEDy16.16 fixed-point pixels.
FIXEDz16.16 fixed-point pixels.
Sint32groundHeightActor's.
FIXEDscaleX16.16 fixed point, toFIXED(1) full size.
FIXEDscaleY16.16 fixed point, toFIXED(1) full size.
Uint16radiusActor's.
Uint8layerActor's.
Uint8priorityFlagsThe spawner clears bit 0 when EFFECT_USE_PRIORITY sets the sprite's priority.
VECTOR3objectVelocityActor's velocityX to velocityZ; effects move by velocity instead.
FIXEDscaleRateXAdded to scaleX each tick by the update hooks, in 16.16 fixed point a tick; zeroed by the spawner.
Sint32scaleRateYAs scaleRateX, for scaleY.
Sint32targetXActor's targetX to targetZ.
Sint32targetY
Sint32targetZ
VECTOR3velocityAdded to x, y and z each tick by the update hooks, in 16.16 fixed-point pixels per tick.
FIELD_SPR *spriteThe sprite spin turns.
Uint8spriteStorageKindActor's.
Uint8motionFlagsZeroed by the spawner.
Uint8arrivalAxisActor's arrival axis, last flag test and snap flag.
Uint8conditionResult
Uint8snapToTarget
Uint8collisionFlagsActor's.
Uint8steeringFlagsActor's steeringFlags to sceneByte.
Uint8paused
Uint8retainSpriteCache
Uint8repeatCount
Sint16wait
Uint8refused
Uint8frozen
Uint8sceneCount
Uint8sceneByte
Uint16spinAdded to the sprite's rotation each tick by the update hooks, in 1/65536 turns per tick; zeroed by the spawner.
Sint16userValueActor's.
Sint32countdownNo code names it.
void (*update )( union FIELD_OBJECT *object)Called each tick while the effect is

Description

A field effect: a small object on the field that moves at its velocity and grows and spins at its rates, run by its script and update hook. It lies over ACTOR; a field marked "Actor's" is the actor's field of that place and name, which no code reads through this struct.

struct FIELD_EFFECT

Referenced by EFFECT_SPAWN, fdEffectAdvanceMotion(), fdEffectSpawnResident(), scCavernsDriftDust(), scDehkanPlateauCrackPillar(), scDustBurst(), scDustScatter(), scEffectAdvanceMotionAndSpin(), scEffectAdvanceMotionAtLeaderPriority(), scEffectAdvanceMotionLocal(), scFieldEffectSpawn(), scFieldEffectSpawnLocal(), scMagmaRockInsideSpawnDustRing(), scMagmaRockSpawnDustRing() and scTrialRoadDriftDust().

Definition at line 20 of file field_effect.h.

Fields in detail

script

const Sint32 *script

Actor's script pointer, cursor and facing.

scriptCursor

Sint16 scriptCursor

facing

Uint16 facing

x

FIXED x

16.16 fixed-point pixels.

y

FIXED y

16.16 fixed-point pixels.

z

FIXED z

16.16 fixed-point pixels.

groundHeight

Sint32 groundHeight

Actor's.

scaleX

FIXED scaleX

16.16 fixed point, toFIXED(1) full size.

scaleY

FIXED scaleY

16.16 fixed point, toFIXED(1) full size.

radius

Uint16 radius

Actor's.

layer

Uint8 layer

Actor's.

priorityFlags

Uint8 priorityFlags

The spawner clears bit 0 when EFFECT_USE_PRIORITY sets the sprite's priority.

objectVelocity

VECTOR3 objectVelocity

Actor's velocityX to velocityZ; effects move by velocity instead.

scaleRateX

FIXED scaleRateX

Added to scaleX each tick by the update hooks, in 16.16 fixed point a tick; zeroed by the spawner.

scaleRateY

Sint32 scaleRateY

As scaleRateX, for scaleY.

targetX

Sint32 targetX

Actor's targetX to targetZ.

targetY

Sint32 targetY

targetZ

Sint32 targetZ

velocity

VECTOR3 velocity

Added to x, y and z each tick by the update hooks, in 16.16 fixed-point pixels per tick.

sprite

FIELD_SPR *sprite

The sprite spin turns.

spriteStorageKind

Uint8 spriteStorageKind

Actor's.

motionFlags

Uint8 motionFlags

Zeroed by the spawner.

arrivalAxis

Uint8 arrivalAxis

Actor's arrival axis, last flag test and snap flag.

conditionResult

Uint8 conditionResult

snapToTarget

Uint8 snapToTarget

collisionFlags

Uint8 collisionFlags

Actor's.

steeringFlags

Uint8 steeringFlags

Actor's steeringFlags to sceneByte.

paused

Uint8 paused

retainSpriteCache

Uint8 retainSpriteCache

repeatCount

Uint8 repeatCount

wait

Sint16 wait

refused

Uint8 refused

frozen

Uint8 frozen

sceneCount

Uint8 sceneCount

sceneByte

Uint8 sceneByte

spin

Uint16 spin

Added to the sprite's rotation each tick by the update hooks, in 1/65536 turns per tick; zeroed by the spawner.

userValue

Sint16 userValue

Actor's.

countdown

Sint32 countdown

No code names it.

update

void (*update)( union FIELD_OBJECT *object)

Called each tick while the effect is