31 if (particle !=
NULL) {
32 decrementedTimer = (
u16)particle->
timer - 1;
33 particle->
timer = decrementedTimer;
34 remainingFrames = decrementedTimer;
35 if (remainingFrames != 0) {
38 pos.
y = scene->
y + (10 << 16);
41 (
s16)particle->
work + (remainingFrames << 11),
76 SET_VECTOR(pos, emitter->
x, emitter->
y + (2 << 16), emitter->
z);
121 for (i = 0; i < 8; i++) {
125 object->scaleY = 0xb333;
126 object->scaleX = 0xb333;
129 object->work = i << 13;
130 object->motionFlags = 4;
139 resourceSlot = last->
slot;
152 target->
y.
fixed = scene->
y + 0x100000;
162 for (i = 0; i < 30; i++) {
192 target->
speed = 0x50000;
202 if (resourceSlot != 0x60)
void ObjectDispatch_ReleaseFar(struct DispatchObject *obj)
void ObjectDispatch_InitializeFar(struct DispatchObject *obj, const s32 *script)
void Animation_ApplyChildValuesFar(struct DispatchObject *obj, u32 val)
void FieldObject_WaitForMoveFar(void *fieldObject)
void AudioCommand_PlayFar(s32 id)
@ ACTOR_FALLS
falls by its gravity and bounces
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
volatile u32 gFrameCount
Frames WaitFrames has finished.
const s32 gBattleFx_CommonParticleScript[]
[0] only frees the actor, +1 waits for it to arrive and frees it; +3 is gBattleFx_SourceHoldScript,...
void * gEffectWork
Slot 56: points to a scene-specific structure.
#define Iwram_MulQ16(left, right)
#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.
#define SET_VECTOR(v, x, y, z)
Sets the x, y and z of a three-part vector: a position about to be projected, a per-frame step,...
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 AnimationObject * Sprite_ShareVramCache(struct AnimationObject *sourceSprite, struct AnimationObject *sharedSprite)
Makes sourceSprite share sharedSprite's VRAM block, releasing its own; with no sharedSprite it keeps ...
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 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 EffectRuntime_StopCurrentObject(void)
Stops the caster's per-frame hook and restores its colours.
void FieldFx_RunPlyOnTarget(s32 unused)
Runs FieldFx_RunPly, then stops the caster's hook.
void FieldFx_RunPly(void)
Eight particles spiral into the centre, where one appears, sheds sparks and flies far away.
void BattleFx_RunSparkEmitter(union FieldObject *fieldObject)
Per-frame update: sways 6 pixels either side (a 64-frame cycle) 16 pixels above the effect's position...
void BattleFx_SwayParticle(union FieldObject *fieldObject)
Per-frame update: sways 4 pixels either side of anchorX, once every 128 frames.
void BattleFx_UpdateShrinkingOrbitObject(union FieldObject *fieldObject)
Per-frame update: spirals in on a point 10 pixels above the effect's position, at a radius of as many...
What every part of psynergy_effects.c shares: its includes and the macros and types more than one par...
#define ABOVE
16 pixels up
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
u8 slot
VRAM cache entry holding its tiles.
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
void(*) finishCallback(void)
run, when set, as Ply's effect ends
void * mainObject
the caster's object
s8 enabled
Set at the start: Force then aims in front of the caster; cleared once the target has been dispatched...
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 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,...
s16 timer
The parameter its action script reads (a follow distance or an angle to face), the player's frames to...
s32 speed
speed limit, 16.16 fixed-point pixels per frame
u8 steeringFlags
ActorSteeringFlag bits.
u8 motionFlags
ActorMotionFlag bits; zero is free flight in 3D, and 3 is set on creation.
union FieldCoordinate x
16.16 fixed-point pixels
union FieldCoordinate y
16.16 fixed-point pixels
union FieldCoordinate z
16.16 fixed-point pixels
s32 acceleration
Added toward the target each frame, or taken off the speed when there is none, in 16....
s32 scaleX
16.16 fixed point, 0x10000 full size
s32 scaleY
16.16 fixed point, 0x10000 full size
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
u16 work
The side of the player's next footprint (2 after a stop), or scene scratch.
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
A FieldActor seen with the halfword at 0x5e (its lifetime), which FieldActor does not name.
s16 phase
phase of the sway (128 frames a cycle)
s32 anchorX
centre of the sway (FieldActor's targetX)
s32 gravity
as in FieldActor
void(*) update(union FieldObject *object)
u8 motionFlags
as in FieldActor
s32 fixed
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.
s32 Resource_ResetEntry(u32 no)
Frees cache entry no: its blocks go back and the entry is marked free (offset 0xffff).