59 position.
x = djinni->
x;
60 position.
y = djinni->
y;
61 position.
z = djinni->
z;
65 slot = effectScene->
slots;
77 }
while (remaining >= 0);
87 slotState = (
s8 *)effectScene;
92 if (slotState[5] != 0)
93 slotState[0] = nextState;
96 }
while (remaining >= 0);
105 for (remaining = 0; remaining <= 23; remaining++) {
106 position.
x = leader->
x;
107 position.
y = leader->
y + 0x780000;
108 position.
z = leader->
z;
111 if (djinni !=
NULL) {
116 djinni->
angle = (remaining << 16) / 24;
128 position.
x = leader->
x;
129 position.
y = leader->
y + 0x120000;
130 position.
z = leader->
z;
133 for (remaining = 0; remaining <= 7; remaining++) {
142 djinni->
baseY = djinni->
y;
147 djinni->lifetime = 8;
170 statePointer = &effect->
state;
171 state = *statePointer;
174 position.
x = source->
x;
175 position.
y = source->
y +
Random16() * 5 + 0xf0000;
176 position.
z = source->
z;
182 effect->
x = position.
x;
183 effect->
z = position.
z - 0x640000;
191 }
else if ((
u8)(effect->
state - 1) <= 1) {
193 position.
x = effect->
x;
194 position.
z = effect->
z;
199 effect->
speed = 0x10000;
206 if (*statePointer == 1)
212 }
else if (state == 3) {
221 BattleFx_MoveAfterimageHalfway(fieldObject);
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_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_SelectAnimationFar(void *raw, s32 no)
void ObjectDispatch_InitializeFar(struct DispatchObject *obj, const s32 *script)
void Animation_ApplyChildValuesFar(struct DispatchObject *obj, u32 val)
void ObjectGroup_SetChildValueUnlessFifteenFar(void *raw_parent, u32 value)
void Map_SetScreenShakeFar(s32 value0, s32 value1, s32 value2)
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.
const s32 gBattleFx_CommonParticleScript[]
[0] only frees the actor, +1 waits for it to arrive and frees it; +3 is gBattleFx_SourceHoldScript,...
struct GameState gGameState
void * gEffectWork
Slot 56: points to a scene-specific structure.
void BattleFx_ShrinkObjectAndDestroyFast(union FieldObject *fieldObject)
Spins and shrinks an object by 0x400 a frame, then releases it.
void BattleFx_UpdateDescendingOrbitObject(union FieldObject *fieldObject)
Per-frame update of a Venus Djinni's falling motes: each circles the leader on a shrinking spiral (ra...
void BattleFx_UpdateRadialSpread(struct EffectSlot *effect)
Effect slot callback of a Venus Djinni's particles: each starts on screen at a random point 10 to 20 ...
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 Motion_SetTargetPositionFromMagnitudeAngle(struct ObjectRuntime *object, s32 magnitude, s32 angle)
Sends an object toward the point magnitude (16.16 pixels) away from it in direction angle: sets its m...
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 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_JUMP
An actor jumps: ObjectMotion_Launch plays the high jump above 5 pixels a frame.
#define offsetof(type, member)
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 FieldActor seen with the halfword at 0x5e (lifetime), which FieldActor does not name.
void(*) callback(union FieldObject *object)
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 speed
16.16 fixed-point pixels per frame
s32 scaleY
16.16 fixed point, 0x10000 full size
s8 state
the callback's own step; 0 when it is given
void * object
the slot's sprite, released with the slot
s32 z
16.16 fixed-point pixels
s32 x
16.16 fixed-point pixels
s8 limitTurnStep
Clamp steering to maxTurnStep; zero faces the target directly.
s32 targetZ
16.16 fixed-point pixels; EFFECT_NO_TARGET at rest
s32 scaleX
16.16 fixed point, 0x10000 full size
s32 targetX
16.16 fixed-point pixels; EFFECT_NO_TARGET at rest
s32 maxSpeed
16.16 fixed-point pixels per frame
s8 stopAtTarget
nonzero: lands on the target within 8 pixels
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
s32 selectedActor
the leader: its unit and its actor
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
s32 z
16.16 fixed-point pixels
s32 x
16.16 fixed-point pixels
s32 y
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.
void BattleFx_UpdateRandomTargetParticle(struct EffectSlot *effect)
Effect slot callback of a Mercury Djinni's droplets: each falls from 100 pixels above to a random poi...
void BattleFx_HalveDistanceToTarget(union FieldObject *fieldObject)
Per-frame update of an afterimage: closes half the distance to the object it is linked to.
void BattleFx_RunVenusDjinnCapture(s32 djinniId)
A Venus Djinni joins the party: it hops twice, spins and leaps, then shrinks away; the leader turns t...