Alchemy
Loading...
Searching...
No Matches

EffectSlot Struct Reference

A particle a Psynergy effect moves and draws: its sprite, its position and target, its speed, scale and heading, and its per-frame callback. More...

#include <battle/effect_slot.h>

Data Fields

void * object
 the slot's sprite, released with the slot
s32 x
 16.16 fixed-point pixels
s32 z
 16.16 fixed-point pixels
s32 targetX
 16.16 fixed-point pixels; EFFECT_NO_TARGET at rest
s32 targetZ
 16.16 fixed-point pixels; EFFECT_NO_TARGET at rest
s32 originX
 16.16 fixed-point pixels; where the slot started
s32 originZ
 16.16 fixed-point pixels; where the slot started
s32 speed
 16.16 fixed-point pixels per frame
s32 maxSpeed
 16.16 fixed-point pixels per frame
s32 acceleration
 16.16 fixed-point pixels per frame, each frame
s32 scaleX
 16.16 fixed point, 0x10000 full size
s32 scaleY
 16.16 fixed point, 0x10000 full size
u16 heading
 1/65536 turns
s16 maxTurnStep
 1/65536 turns a frame
EffectCallback callback
 run each frame once callbackDelay is 0
u16 age
 frames
s16 callbackDelay
 frames
s16 orbitRadius
 pixels
s16 orbitAngle
 1/32 turns
s8 state
 the callback's own step; 0 when it is given
s8 stopAtTarget
 nonzero: lands on the target within 8 pixels
s8 limitTurnStep
 Clamp steering to maxTurnStep; zero faces the target directly.
s8 updateMotion
 nonzero: EffectSlot_UpdateMotion moves it each frame
s8 render
 nonzero: drawn each frame
s8 active
 nonzero while the slot is in use
u8 randomValue
 random when filled; not read by name in TBS
u8 flags
 bits: 2 z also lifts the sprite (set when the slot is filled)

Detailed Description

A particle a Psynergy effect moves and draws: its sprite, its position and target, its speed, scale and heading, and its per-frame callback.

Definition at line 18 of file effect_slot.h.

Field Documentation

◆ object

◆ x

◆ z

◆ targetX

◆ targetZ

◆ originX

◆ originZ

◆ speed

s32 EffectSlot::speed

16.16 fixed-point pixels per frame

Definition at line 26 of file effect_slot.h.

Referenced by BattleFx_UpdateRandomTargetParticle(), EffectSlot_SetPosition(), and EffectSlot_UpdateMotion().

◆ maxSpeed

◆ acceleration

◆ scaleX

◆ scaleY

◆ heading

u16 EffectSlot::heading

1/65536 turns

Definition at line 31 of file effect_slot.h.

Referenced by EffectSlot_UpdateMotion().

◆ maxTurnStep

s16 EffectSlot::maxTurnStep

◆ callback

EffectCallback EffectSlot::callback

run each frame once callbackDelay is 0

Definition at line 33 of file effect_slot.h.

Referenced by EffectSlot_SetCallback(), and EffectSlot_Update().

◆ age

u16 EffectSlot::age

frames

Definition at line 34 of file effect_slot.h.

Referenced by BattleFx_RunAngledApproachPhases(), EffectSlot_SetCallback(), and EffectSlot_Update().

◆ callbackDelay

s16 EffectSlot::callbackDelay

◆ orbitRadius

s16 EffectSlot::orbitRadius

pixels

Definition at line 36 of file effect_slot.h.

Referenced by BattleFx_RunAngledApproachPhases().

◆ orbitAngle

s16 EffectSlot::orbitAngle

1/32 turns

Definition at line 37 of file effect_slot.h.

Referenced by BattleFx_RunAngledApproachPhases().

◆ state

◆ stopAtTarget

s8 EffectSlot::stopAtTarget

nonzero: lands on the target within 8 pixels

Definition at line 39 of file effect_slot.h.

Referenced by BattleFx_UpdateRandomTargetParticle(), EffectSlot_HasPendingTarget(), EffectSlot_Initialize(), and EffectSlot_UpdateMotion().

◆ limitTurnStep

◆ updateMotion

s8 EffectSlot::updateMotion

nonzero: EffectSlot_UpdateMotion moves it each frame

Definition at line 42 of file effect_slot.h.

Referenced by EffectSlot_Initialize(), and EffectSlot_Update().

◆ render

s8 EffectSlot::render

nonzero: drawn each frame

Definition at line 43 of file effect_slot.h.

Referenced by EffectSlot_Initialize(), and EffectSlot_Update().

◆ active

◆ randomValue

u8 EffectSlot::randomValue

random when filled; not read by name in TBS

Definition at line 45 of file effect_slot.h.

Referenced by EffectSlot_Initialize().

◆ flags

u8 EffectSlot::flags

bits: 2 z also lifts the sprite (set when the slot is filled)

Definition at line 47 of file effect_slot.h.

Referenced by BattleFx_DrawScaledObject(), and EffectSlot_Initialize().