7#define MERCURY_PARTICLE_MAX 24
8#define MERCURY_AFTERIMAGE_MAX 8
57 kind = djinni->sprite->entries[0]->animId;
77 copy->linkedObject = previous;
84 resourceId = resource->
slot;
87 for (remaining = 14; remaining >= 0; remaining--) {
88 djinni->
y.
fixed += 8 << 16;
111 slot = effectScene->
slots;
121 }
while (remaining >= 0);
131 slotState = (
s8 *)effectScene;
136 if (slotState[5] != 0)
137 slotState[0] = nextState;
140 }
while (remaining >= 0);
149#undef MERCURY_PARTICLE_MAX
150#undef MERCURY_AFTERIMAGE_MAX
void Motion_SetVarCbAndRefresh(u32 objectId, s32 count)
The event command "run repeated motion": as ObjectMotion_SetVariantCallback, then waits for it to end...
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_ClearActiveSlotsAndScheduleUpdates(void)
Stops the effect slots: removes their callback, frees every slot still in use and releases their heap...
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)
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 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.
struct GameState gGameState
void * gEffectWork
Slot 56: points to a scene-specific structure.
#define RGB(r, g, b)
A 15-bit colour from its red, green and blue levels (0 to 31 each), as the palette stores it: blue in...
void BattleFx_RunMercuryDjinnCapture(s32 djinniId)
A Mercury Djinni joins the party: the screen is tinted blue, the Djinni bounces twice and hops three ...
#define MERCURY_PARTICLE_MAX
droplets (one an effect slot)
#define MERCURY_AFTERIMAGE_MAX
afterimages of the rising Djinni
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 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...
@ PALETTE_TRANSFORM_TINT
The brightness (2R + 4G + B) times the colour carried.
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)
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...
struct EffectSlot slots[24]
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,...
void * object
the slot's sprite, released with the slot
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,...
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
u8 paused
nonzero skips its script and motion, not its update
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 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.
s32 selectedActor
the leader: its unit and its actor
s32 fixed
16.16 fixed-point pixels
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.
s32 Resource_ResetEntry(u32 no)
Frees cache entry no: its blocks go back and the entry is marked free (offset 0xffff).