16 s32 remainingParticles;
40 position.
x = djinni->
x;
41 position.
y = djinni->
y;
42 position.
z = djinni->
z;
47 remainingParticles = 23;
60 }
while (remainingParticles >= 0);
87 u8 *
object = (
u8 *)fieldObject;
90 u32 scale = table[index];
98 void *obj = (
void *)fieldObject;
104 if (step < 0x1000U) {
123 state = effect->state;
126 effect->x = effect->originX;
127 effect->z = effect->originZ;
128 position.
x = effect->x;
129 position.
z = effect->z;
132 ((
Random16() * 3 << 11) >> 16) + 0xc000,
134 effect->targetX = position.
x;
135 effect->targetZ = position.
z;
136 effect->acceleration = 0x50000;
137 effect->maxSpeed = 0x50000;
138 effect->limitTurnStep = state;
147 }
else if (state == 1) {
148 if ((
s16)effect->age == 3) {
154 }
else if (state == 2) {
156 effect->originX = effect->x;
157 effect->originZ = effect->z;
162 effect->callbackDelay = 40;
164 }
else if (state == 3) {
166 effect->x = effect->originX;
167 effect->z = effect->originZ;
168 position.
x = owner->
pos.
x;
169 position.
y = owner->
pos.
y + 0x140000;
170 position.
z = owner->
pos.
z;
173 effect->targetX = position.
x;
174 effect->targetZ = position.
z;
178 }
else if (state == 4) {
181 }
else if (state == 5) {
void Motion_SetVarCbAndRefresh(u32 objectId, s32 count)
The event command "run repeated motion": as ObjectMotion_SetVariantCallback, then waits for it to end...
void ObjectMotion_Launch(u32 objectId, s32 speed, s32 frames)
The event command "actor jump": throws the actor upward at speed pixels per frame with a jump sound (...
void ObjectMotion_ArmCallback(s32 objectId, s32 angle, s32 wait)
The event command "actor face direction": the actor turns toward angle (0x10000 a full turn; ObjectMo...
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
void BattleFx_InitializeSlots(void)
Allocates and clears the effect slots (heap block 56) and starts their update callback.
void BattleFx_RunAngledApproachPhases(struct EffectSlot *particle)
Effect slot callback of a Jupiter Djinni's light particles: each circles its centre while it widens f...
void BattleFx_AdvanceSpinAngle(union FieldObject *fieldObject)
Per-frame update: spins an object 1/8 turn a frame.
void BattleFx_ClearActiveSlotsAndScheduleUpdates(void)
Stops the effect slots: removes their callback, frees every slot still in use and releases their heap...
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 EffectSlot_SetObjectMode(struct EffectSlot *effect, s32 mode)
Sets the animation of an effect slot's sprite.
void ObjectDispatch_ReleaseFar(struct DispatchObject *obj)
void ObjectDispatch_SelectAnimationFar(void *raw, s32 no)
void ObjectGroup_SetChildValueUnlessFifteenFar(void *raw_parent, u32 value)
void Shop_RestoreFieldPaletteFar(void)
void Shop_SaveAndTintFieldPaletteFar(s32 layer)
void AudioCommand_PlayFar(s32 id)
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
u32 gFrameTick
Counted up by every VBlank.
const u32 gBattleFx_PulseScales[3]
Two scales that alternate ((gFrameTick >> 2) & 1); nothing reads the third word.
struct GameState gGameState
void * gEffectWork
Slot 56: points to a scene-specific structure.
void BattleFx_SetObjectAlternatingWords(union FieldObject *fieldObject)
Per-frame update: makes an object pulse, switching its scale between the two values of gBattleFx_Puls...
void BattleEffect_UpdatePhasedRadialParticle(struct EffectSlot *effect)
Effect slot callback of a Mars Djinni's sparks.
void BattleFx_ShrinkObjectAndDestroySlow(union FieldObject *fieldObject)
Spins and shrinks an object by 0x1c0 a frame, then releases it.
void BattleFx_AdvanceAngleWithRamp(union FieldObject *fieldObject)
Per-frame update: spins an object ever faster, from 1/16 turn a frame up to 1/8.
void Djinn_RunJupiterJoinEffect(s32 djinniId)
A Jupiter Djinni joins the party: it bounces three times, spins, leaps out of sight and bursts into 2...
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),...
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 DEFINE_SHRINK_AND_DESTROY(name, step)
Defines a per-frame update that spins an object 1/8 turn a frame while its scale changes by step,...
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
struct AnimationSpritePart image
u16 priority
2 when created
The work of a Psynergy effect scene: its caster and target, where it takes place, the map state it re...
struct EffectSlot slots[24]
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,...
s32 scaleY
16.16 fixed point, 0x10000 full size
void * object
the slot's sprite, released with the slot
s32 scaleX
16.16 fixed point, 0x10000 full size
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
s32 selectedActor
the leader: its unit and its actor
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
void(*) update(union FieldObject *object)
run first each frame
s32 y
16.16 fixed-point pixels
s32 scaleY
16.16 fixed point, 0x10000 full size
s32 x
16.16 fixed-point pixels
A field actor (struct FieldActor), seen with its position as one vector.
struct AnimationObject * sprite
A spinning object: its angle, and at 0x64 the frames its spin has been speeding up for (BattleFx_Adva...
An object on the field, read as an actor or as an effect.