15 step = obj->
timer * 0x50;
28 scale = obj->
scaleX - 0x280;
32 if ((
s32)scale < 0x3000)
55 slot->
z = pos.
z + (8 << 16);
63 120 << 16, ((spread << 13) >> 16) - ((
Random16() << 13) >> 16) + 0xc000,
75 }
else if (state == 1) {
78 }
else if (state == 2) {
133 scale = (
Random16() >> 1) + 0x13333;
180 scale = particle->
scaleX + 0xC00;
186 particle->
y.
fixed =
y - 0x20000;
187 particle->
z.
fixed = source->
z.
fixed + ((0x10000 - scale) * 5) + 0x90000;
211 scale = particle->
scaleX + 0xC00;
215 particle->
scaleY = -scale;
217 particle->
y.
fixed =
y - 0x20000;
218 particle->
z.
fixed = source->
z.
fixed - ((0x10000 - scale) * 5) + 0x100000;
264 for (arcIndex = 0; arcIndex <= 1; arcIndex++) {
267 objects[arcIndex] = object;
272 object->motionFlags = 0;
275 object->linkedObject = source;
277 object->scaleX = 0x6666;
281 sprite->animation = zero;
286 sprite->flags05_5 = 0;
289 sprite->frame->frame = zero;
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...
void Camera_MoveWithinMapBounds(s32 requestedX, s32 requestedY, s32 requestedZ, s32 glide)
The event command "camera move to": sends the camera to the requested axes, 16.16 pixels (-1 keeps th...
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.
struct ObjectRuntime * Object_CreateFar(s32 id, s32 x, s32 y, s32 z)
Far call to FieldObject_Create.
void ObjectDispatch_ReleaseFar(struct DispatchObject *obj)
s32 AnimationObjects_SelectAnimationFar(struct AnimationObject *state, s32 flags)
void ObjectDispatch_SetSingleChildFlagsFar(struct DispatchObject *obj, u32 flags)
void ObjectDispatch_SelectAnimationFar(void *raw, s32 no)
void Animation_ApplyChildValuesFar(struct DispatchObject *obj, u32 val)
void ObjectGroup_SetChildValueUnlessFifteenFar(void *raw_parent, u32 value)
void AudioCommand_PlayFar(s32 id)
#define ACTOR_NO_TARGET
A target coordinate that is not set: the object has no target.
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
volatile u32 gFrameCount
Frames WaitFrames has finished.
struct GameState gGameState
void * gEffectWork
Slot 56: points to a scene-specific structure.
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 ObjectGroup_ApplyRandomChildValues(union FieldObject *fieldObject)
Per-frame update: sets every part of an object's sprite to param frame % 6, which cycles its colours.
void FieldEvent_Begin(void)
The event command "begin event": closes any timed notice, stops the leader, resets the message and ti...
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 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 PSYNERGY_EFFECT_SLOT_COUNT
The effect slots of a Psynergy effect's scene (gEffectWork->slots).
void FieldFx_RunRetreat(void)
Spins the main object and shrinks it while 24 particles fly out, one a frame.
void FieldFx_UpdateSpinAngle(union FieldObject *fieldObject)
Per-frame update: spins by 0x1000 + timer * 0x50 a frame, speeding up (timer counts up) until timer *...
void BattleFx_UpdateDescendingParticleNegativeArc(union FieldObject *fieldObject)
As BattleFx_UpdateDescendingParticlePositiveArc for the arc drawn upside down, 16 pixels in front of ...
void BattleFx_UpdateDescendingObject(union FieldObject *fieldObject)
Per-frame update: spins 1/8 turn a frame as it shrinks, rising a pixel a frame; released once its sca...
void BattleFx_SpawnDescendingArcParticles(struct FieldActor *arc)
Spawns a pair of falling arcs (one upside down) on arc.
void BattleFx_UpdateDescendingParticlePositiveArc(union FieldObject *fieldObject)
Per-frame update of a falling arc: grows toward full size as it falls 2 pixels a frame on the object ...
void BattleFx_UpdateRadialLaunch(struct EffectSlot *slot)
Effect slot callback: a particle flies 120 pixels from the main object's screen position (8 pixels lo...
One animation layer of a sprite: its animation id, frames, running script and timer.
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
The work of a Psynergy effect scene: its caster and target, where it takes place, the map state it re...
s16 arcTileSlot
resource entry of Avoid's and Retreat's arcs
s16 firstObjectId
the caster's object id
struct EffectSlot slots[24]
void * mainObject
the caster's object
A falling arc's sprite, seen as the attribute bits, resource slot and animation that Retreat sets on ...
struct AnimationEntry * frame
union DescendingArcSprite::@070326302264055037332103030165235113044074342054 attr
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
s8 state
the callback's own step; 0 when it is given
void * object
the slot's sprite, released with the slot
s32 originX
16.16 fixed-point pixels; where the slot started
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 originZ
16.16 fixed-point pixels; where the slot started
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
s8 active
nonzero while the slot is in use
s32 maxSpeed
16.16 fixed-point pixels per frame
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
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
struct FieldActor * linkedObject
The object its action script follows or faces.
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
s32 terrainHeight
16.16 fixed-point pixels
u8 spriteStorageKind
Zero hides sprites; one draws a single sprite, two draws a group.
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.
s16 map
the scene's map; SceneId_Clear for the world map
u16 offset
bytes from the start of OBJ VRAM
struct DescendingArcSprite::@070326302264055037332103030165235113044074342054::@366172057311017000224265030261306246063356262336 byte
struct DescendingArcSprite::@070326302264055037332103030165235113044074342054::@311162361350244237316110147377355002302351324357 half
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).
struct VramBlockCacheEntry gVramBlockCache[]