41#define EFFECT_SPAWN_RESIDENT
43#undef EFFECT_SPAWN_RESIDENT
111 effect->
angle += 0xfff0;
112 if (effect->
pause != 0) {
114 effect->
angle += 0x800;
115 }
else if ((
Random16() << 5) >> 16 == 0)
206 to.
y = scene->
y - (4 << 16);
226 }
while (step < steps);
244 pos.
y = ball->
y.
fixed + step * 0xcccc + (4 << 16);
void ObjectDispatch_ReleaseFar(struct DispatchObject *obj)
void Object_SetPositionAndResetMotionFar(struct ObjectRuntime *obj, s32 x, s32 y, s32 z)
void ObjectDispatch_SelectAnimationFar(void *raw, s32 no)
void ObjectDispatch_InitializeFar(struct DispatchObject *obj, const s32 *script)
void AudioCommand_PlayFar(s32 id)
void Effect_SpawnResident(s32 x, s32 y, s32 z, s32 velocityX, s32 velocityY, s32 velocityZ, u32 flags, const struct EffectOptions *options)
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,...
void * gEffectWork
Slot 56: points to a scene-specific structure.
#define Iwram_MulQ16(left, right)
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...
What every part of psynergy_effects.c shares: its includes and the macros and types more than one par...
u16 rotation
1/65536 turns
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 * mainObject
the caster's object
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.
The options of a spawned field effect, each used when its EFFECT_USE_ flag (or EFFECT_SCALE_TO_TARGET...
s32 palette
passed to ObjectGroup_SetChildValue
s32 startScaleY
16.16 fixed point, 0x10000 full size
s32 startScaleX
16.16 fixed point, 0x10000 full size
void(*) update(union FieldObject *object)
replaces the update hook
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...
struct FieldActor * linkedObject
The object its action script follows or faces.
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 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.
A field effect: a small object on the field that moves at its velocity and grows and spins at its rat...
struct Vector3 velocity
Added to x, y and z each frame by the update hooks, in 16.16 fixed-point pixels per frame; FieldActor...
s32 z
16.16 fixed-point pixels
struct AnimationObject * sprite
the sprite spin turns
s32 scaleRateX
Added to scaleX each frame by the update hooks, in 16.16 fixed point a frame; zeroed by the spawner.
s32 scaleY
16.16 fixed point, 0x10000 full size
s32 scaleX
16.16 fixed point, 0x10000 full size
s32 y
16.16 fixed-point pixels
s32 x
16.16 fixed-point pixels
s32 scaleRateY
as scaleRateX, for scaleY
u16 spin
Added to the sprite's rotation each frame by the update hooks, in 1/65536 turns per frame; Imil's ris...
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
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
A field object as the motion code sees it: its script, position, motion toward a target,...
void(*) hook(union FieldObject *object)
Called each frame before its script.
A FieldActor seen with the halfword at 0x64 unsigned and the one at 0x66 signed, as the bytes read th...
s16 pause
frames left of a sharp turn
u16 angle
heading or orbit angle, in 1/65536 turns
s32 velocityY
applied by the engine, in 16.16 pixels per frame
s32 gravity
vertical deceleration, in 16.16 pixels per frame squared
struct WhirlwindOrbit * anchor
orb at the centre of the orbit
void(*) update(union FieldObject *object)
engine's per-frame callback
s32 fixed
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.
void BattleFx_ShrinkObjectScaleUntilHalf(union FieldObject *fieldObject)
Shrinks a scene-selected Whirlwind target each frame; below half size, moves it to the origin,...
void BattleFx_WanderAroundAnchor(union FieldObject *fieldObject)
Per-frame update: wanders away from the anchor, 2 to 3 pixels a frame, now and then turning sharply; ...
void FieldFx_RunWhirlwind(void)
An orb is carried from the caster to 4 pixels above the effect's position over 10 frames,...
@ WHIRLWIND_TARGET_MIN_SCALE
@ WHIRLWIND_TRAVEL_FRAMES
@ WHIRLWIND_RADIAL_ANGLE_SHIFT
@ WHIRLWIND_ORBIT_PARTICLES
@ WHIRLWIND_ORBIT_ANGLE_STEP
@ WHIRLWIND_TARGET_SCALE_STEP
@ WHIRLWIND_RADIAL_DIRECTIONS
@ WHIRLWIND_WANDER_FRAMES
void BattleFx_CircleAnchor(union FieldObject *fieldObject)
Per-frame update: circles the anchor at 8 pixels; after 121 frames it starts to wander (BattleFx_Wand...
void FieldFx_RunWhirlwindOnTarget(s32 unused)
Runs Whirlwind using the target already stored in the effect scene.
void FieldFx_UpdateParticleMotionAndScale(union FieldObject *object)
Per-frame update of a particle: moves by its velocity, slowing its x and z velocity a little,...
void BattleFx_SpawnRadialParticleRing(struct MotionObject *origin)
Spawns 17 particles that spread from origin in a flat ring, their x velocity 1.5 times their z veloci...