22 statePointer = &effect->
state;
24 state = *statePointer;
35 *statePointer = *statePointer + 1;
41 *statePointer = *statePointer + 1;
46 pos.
y = scene->
y + (8 << 16);
54 *statePointer = *statePointer + 1;
98 from.
y = caster->
y + (16 << 16);
101 to.
y = scene->
y + (8 << 16);
109 from.
y + (to.
y - from.
y) * step / 10,
110 from.
z + (to.
z - from.
z) * step / 10);
134 slot = &scene->
slots[0];
135 for (i = 0; i < 16; i++) {
137 pos.
y = orb->
y + (8 << 16);
148 pos.
y = orb->
y + (8 << 16);
161 void *
object = (
void *)fieldObject;
178 if (
object !=
NULL) {
182 entry =
object->sprite->entries[0];
void * ObjectTable_Get(u32 actorIndex)
Returns the actor in slot index (0 to 65), or NULL.
u32 EffectSlot_HasPendingTarget(struct EffectSlot *effect)
Returns nonzero while an effect slot that stops at its target still has one (it has not arrived),...
void BattleFx_ClearOwnedSlot(struct EffectSlot *slot)
Frees an effect slot and its sprite.
void EffectSlot_Initialize(struct EffectSlot *effect, s32 kind, s32 x, s32 z)
Fills an effect slot with a new sprite of kind at (x, z): stopping at its target, top speed 2,...
void EffectSlot_SetCallback(struct EffectSlot *effect, EffectCallback callback)
Gives an effect slot its per-frame callback, starting at state 0.
void ObjectDispatch_ReleaseFar(struct DispatchObject *obj)
void ObjectDispatch_SelectAnimationFar(void *raw, s32 no)
void ObjectDispatch_SetAnimationSpeedFar(struct DispatchObject *obj, s32 val)
void Animation_ApplyChildValuesFar(struct DispatchObject *obj, u32 val)
void ObjectGroup_SetChildValueUnlessFifteenFar(void *raw_parent, u32 value)
void AudioCommand_PlayFar(s32 id)
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
static __inline__ s32 BattleFx_Interpolate(s32 to, s32 from, s32 step)
const s8 gBattleFx_RandomChildValues[8]
struct GameState gGameState
void * gEffectWork
Slot 56: points to a scene-specific structure.
void BattleFx_UpdateRadialCamera(struct EffectSlot *effect)
Effect slot callback: state 0 heads for a point 40 to 70 pixels from where the particle appeared; sta...
void BattleFx_ResumeObject(s32 actorId)
Resumes object id with the update and param kept by BattleEffect_PauseObject.
s32 BattleFx_FilterObjectIdByFlags(s32 id)
Returns id, or -1 (no target) when the current effect's definition has flags 0xff.
void BattleEffect_RunFallbackObjectTransition(void)
Throws an object from the caster to the effect's position over 10 frames and scatters it into 16 part...
void BattleEffect_SetRandomTableValueOnObject(union FieldObject *fieldObject)
Per-frame update of a paused object: gives its sprite one of the table's eight params at random.
void BattleFx_MarkChildAndRunFallbackTransition(s32 unused)
Pauses the target (scene->child) and runs BattleEffect_RunFallbackObjectTransition.
void BattleEffect_PauseObject(s32 actorId)
Pauses object id, keeping its per-frame update and, if it is animated, its first animation's param in...
#define SET_POSITION(p, px, py, pz)
Sets the position or the velocity of a particle, a piece of debris or an object in one statement.
void Vector_AddPolarOffset(s32 radius, s32 angle, void *position)
Moves the point position by radius in direction angle on the ground plane: x by the cosine,...
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
struct ObjectRuntime * Object_Spawn(s32 kind, s32 x, s32 y, s32 z)
Creates an object for an effect, at the caster's ground height, with sprite priority 0 and animation ...
void BattleEffect_InitializeSharedScene(void)
Saves the palettes for the effect (once, unless an effect is already shown) and fades them toward one...
void BattleFx_PrepareBufferInterpolation(void)
Fades the palettes back from an effect's colours to the saved ones (or to palette 0x10001 while an ef...
void Camera_WorldToScreen(struct EffectVector *position)
Converts a world position (16.16 pixels) to the screen: x and z receive the screen's x and y and y be...
What every part of psynergy_effects.c shares: its includes and the macros and types more than one par...
#define SE_TRIPLE_TONE_HIGH
#define SE_TRIPLE_TONE_LOW
s32 BattleFx_GetFlags(s32 id)
Returns the definition flags of actor id's sprite, which choose its line when it has nothing to say.
One animation layer of a sprite: its animation id, frames, running script and timer.
u8 param
SpriteColorMode its pixels are drawn with; 0 when taken.
The work of a Psynergy effect scene: its caster and target, where it takes place, the map state it re...
s32 y
16.16 fixed-point pixels
struct EffectSlot slots[24]
void * mainObject
the caster's object
void * child
the target's object, or NULL
s32 x
16.16 fixed-point pixels
s32 z
16.16 fixed-point pixels
A field object as the object dispatcher's far calls take it.
A particle a Psynergy effect moves and draws: its sprite, its position and target,...
s8 state
the callback's own step; 0 when it is given
void * object
the slot's sprite, released with the slot
s32 originX
16.16 fixed-point pixels; where the slot started
s16 maxTurnStep
1/65536 turns a frame
s8 limitTurnStep
Clamp steering to maxTurnStep; zero faces the target directly.
s32 originZ
16.16 fixed-point pixels; where the slot started
s32 targetZ
16.16 fixed-point pixels; EFFECT_NO_TARGET at rest
s32 targetX
16.16 fixed-point pixels; EFFECT_NO_TARGET at rest
s32 maxSpeed
16.16 fixed-point pixels per frame
s32 acceleration
16.16 fixed-point pixels per frame, each frame
A world position, as Camera_WorldToScreen converts it to the screen.
s32 y
16.16 fixed-point pixels
s32 z
16.16 fixed-point pixels
s32 x
16.16 fixed-point pixels
A field actor: a person or thing on the field with a position, motion toward a target,...
u8 paused
nonzero skips its script and motion, not its update
u8 spriteStorageKind
Zero hides sprites; one draws a single sprite, two draws a group.
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
The game's state: play time, coins, the scene and the leader's position, the active party and the opt...
s8 pausedPose
Halt: the stopped object's first animation param.
u32 pausedUpdate
Halt: the stopped object's update; not read by name.
An effect object that moves and draws one sprite: its position, scale, velocity and target,...
s32 scaleX
16.16 fixed point, 0x10000 full size
s32 z
16.16 fixed-point pixels
s32 y
16.16 fixed-point pixels
s32 scaleY
16.16 fixed point, 0x10000 full size
s32 x
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.