13 }
else if (frame == 2) {
23 if (particle !=
NULL) {
24 scale = particle->
scaleX - 0x1000;
25 particle->
scaleY -= 0x1000;
42 if (particle !=
NULL) {
43 decrementedTimer = (
u16)particle->
timer - 1;
44 particle->
timer = decrementedTimer;
45 remainingFrames = decrementedTimer;
46 if (remainingFrames != 0) {
52 ? (
s16)particle->
work - (remainingFrames << 11)
53 : (
s16)particle->
work + (remainingFrames << 11),
107 target = scene->
child;
114 remainingCycles = 15;
117 if (particle !=
NULL) {
130 particle->
timer = 60;
137 particle->targetX = p->
x;
138 particle->targetY = p->
y;
139 particle->targetZ = p->
z;
144 }
while (remainingCycles >= 0);
154 remainingCycles = 15;
161 }
while (remainingCycles >= 0);
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 AudioCommand_PlayFar(s32 id)
@ ACTOR_PRIORITY_UNDERFOOT
The depth sort treats it as 320 pixels higher on the screen.
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,...
struct GameState gGameState
void * gEffectWork
Slot 56: points to a scene-specific structure.
void * BattleFx_FindMatchingEvent(s32 eventFlags, s32 group, void *target)
Returns the scene's Psynergy event (kind 5) for Psynergy of the given group that applies to what the ...
#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),...
s32 Field_RunEventAction(const void *event, s32 param, s32 target)
Runs the event tied to an effect: a result below 0x10000 is a message, shown at target; a larger 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 BattleFx_UpdateOrbitingParticleLeft(union FieldObject *fieldObject)
Spirals anticlockwise at twice the frames left in pixels, then fades.
static void FieldFx_UpdateSpiralParticle(union FieldObject *fieldObject, s32 clockwise)
Both winding directions share the countdown and position update.
void FieldFx_RunFrost(void)
16 particles spiral in on the effect's position and make the target flash 16 times; without childOpti...
void FieldFx_RunFrostOnTarget(s32 unused)
Runs Frost cast on a target.
void BattleFx_UpdateOrbitingParticleMain(union FieldObject *fieldObject)
Per-frame update: flashes (animation 2) for 2 frames in every 8.
void BattleFx_UpdateOrbitingParticleFade(union FieldObject *fieldObject)
Per-frame update: shrinks by 1/16 a frame and is released at 1/16.
void BattleFx_UpdateOrbitingParticleRight(union FieldObject *fieldObject)
Per-frame update: as BattleFx_UpdateOrbitingParticleLeft, clockwise.
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...
What every part of psynergy_effects.c shares: its includes and the macros and types more than one par...
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
s8 childOption
Set by some scenes before an effect; Carry, Frost, Force and Reveal treat the target differently with...
s8 childMode
set by some scenes: Frost and Force leave the target be
void * child
the target's object, or NULL
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 targetX
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
u16 radius
Collision radius in pixels: 16, or half the sprite metadata's boxY, when created; the overlap checks ...
union FieldCoordinate x
16.16 fixed-point pixels
s32 targetZ
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
union FieldCoordinate y
16.16 fixed-point pixels
u8 priorityFlags
ActorPriorityFlag bits, read by the scrolling camera.
union FieldCoordinate z
16.16 fixed-point pixels
s32 targetY
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
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.
s32 selectedActor
the leader: its unit and its actor
s32 fixed
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.