Alchemy
Loading...
Searching...
No Matches

psynergy_effects.h

Go to the documentation of this file.
1#ifndef ALCHEMY_UNIT_OBJECT_PSYNERGY_EFFECTS_H
2#define ALCHEMY_UNIT_OBJECT_PSYNERGY_EFFECTS_H
3
4#include "types.h"
5#include "effect_slot.h"
7
8struct AnimationObject;
9struct SceneEvent;
10struct ScenePlacement;
11union FieldObject;
12
13/// A field Psynergy's effect, as the field kind: the type column of
14/// games/tbs/src/game/actions.tsv, named for the abilities that have it. The
15/// effect scene keeps it as its animation.
30 /// Whirlwind and Gale.
34};
35
36/// One frame of a sparkle: its height offset and tile (fxdata.c).
40};
41
42extern const struct SparkleFrame gFieldFx_SparkleFrames[32];
43
44void Event_UpdateDebugSkip(void);
45void FieldEvent_WaitFrames(s32 frames);
46void Leader_StopMoving(void);
47void FieldEvent_Begin(void);
48void FieldEvent_End(void);
49void Event_NoOpHookA(void);
50void Event_NoOpHook(void);
53void Event_SetSceneEvents(const struct SceneEvent *events);
54void Event_PrepareObjectAndApplyValue(s32 unit, s32 announce);
55void Event_PrepareTwoObjectsAndApply(s32 first, s32 second);
61s32 Inventory_TryAddAndReturnOwner(s32 item, s32 unused, s32 unit);
62void Inventory_NoOpCallback(void);
63void Inventory_ReservedNoOp(void);
64void Actor_WaitForAnimationEnd(s32 actor, s32 animation);
66s32 Menu_AskYesNo(s32 atBottom);
67void Party_LearnAbility(s32 unit, s32 ability);
71void Event_SetDestination(s32 scene, s32 entrance);
72void Event_SetSavedDestination(u16 scene, u16 entrance);
73void Event_SetExitRequest(u16 request);
75/// Field_RequestDjinnBattle's flag: the Djinni does not hop first.
76#define DJINN_NO_HOP 0x800
77void Field_RequestDjinnBattle(s32 flag, s32 no);
78void Event_SetNextDestination(s32 scene, s32 entrance);
79void Event_SetDefeatDestination(s32 scene, s32 entrance);
80void Event_RequestDestination(u16 scene, u16 entrance);
83
84struct DispatchObject;
85struct FacingObject;
86struct FieldActor;
87struct ObjectRuntime;
88
89struct FieldActor *Object_GetById(s32 actor);
90void ObjectMotion_SetSpeedParameters(u32 objectId, s32 speedLimit,
92// Built-in actions selected by ObjectMotion_SetActionCallback.
93#define ACTOR_ACTION_IDLE 1
94#define ACTOR_ACTION_FOLLOW_LINKED_OBJECT 5
95#define ACTOR_ACTION_FACE_SELECTED_ACTOR 6
96/// Clears child and collision flags, then returns to the idle script.
97#define ACTOR_ACTION_RESET 7
98
101void Object_LinkObjectAndSetCallback(u32 objectId, u32 linkedObjectId);
102void Object_RefreshSelectorById(u32 objectId);
103/// Accepts a built-in action number or script address; waits up to 300 frames.
104void Object_SetActionCallbackAndRefreshById(u32 objectId, s32 action);
109void ObjectMotion_CenterOnColumn(u32 objectId, s32 priority, s32 zOffset);
111 s32 zOffset);
112void ObjectMotion_OffsetPositionAndReset(u32 objectId, s32 xOffset,
113 s32 zOffset);
114void ObjectMotion_CommitPositionAndActivate(u32 objectId, s32 xOffset,
115 s32 zOffset);
116void Motion_LaunchFromFocusedObject(u32 objectId, s32 xOffset, s32 zOffset,
117 s32 action);
121void Object_SetModeById(u32 objectId, s32 animation);
122void Object_SetActionById(u32 objectId, s32 steps);
124void Motion_SetModeAndWaitAnimation(u32 objectId, s32 animation);
125void ObjectMotion_NoOp(void);
126void ObjectMotion_Launch(u32 objectId, s32 speed, s32 frames);
127void ObjectMotion_SetVariantCallback(u32 objectId, s32 count);
128void Motion_SetVarCbAndRefresh(u32 objectId, s32 count);
129void FieldFx_UpdateParticleLinearMotion(union FieldObject *fieldObject);
130void FieldFx_SpawnBurstParticle(struct FieldActor *source, s32 param);
131void Actor_JumpDownLedge(s32 actor, s32 pose, s32 param);
132void ObjectMotion_SetAngleToward(s32 firstId, s32 secondId, s32 wait);
133void Object_LinkPair(s32 firstId, s32 secondId, s32 wait);
135 struct FacingObject *secondObject);
136void ObjectTable_DestroyById(s32 index);
137void ObjectTable_DestroyNoOp(void);
138void ObjectGroup_ConfigureChildValue(s32 objectId, s32 param);
139void ObjectGroup_ApplyIndexedChildValue(union FieldObject *fieldObject);
140void ObjectGroup_SetChildValue(struct FieldActor *actor, s32 param);
141void Object_SetTargetAndCallback(u32 objectId, s32 targetId,
142 const void *script);
145void ObjectMotion_ArmCallback(s32 objectId, s32 angle, s32 wait);
146void ObjectMotion_SetActionVariant(s32 objectId, s32 priority);
147void ObjectVisual_CopyAttributes(u32 targetId, u32 sourceId);
149
150struct UiWindow;
151
152void Event_SetMessageId(s32 message);
155struct UiWindow *UiText_OpenMessageAtObject(s32 actor, s32 unused);
160void Event_ShowSpeakerMessage(s32 speaker);
161void ObjectTable_CallRefreshHook(s32 unused0, s32 unused1, s32 x, s32 y);
162void Event_ShowMessageAtPosition(s32 unused0, s32 unused1, s32 x, s32 y);
163void ObjectTable_RunIfActive(s32 actor);
164void Battle_ShowPairedUnitWorkAndWait(s32 first, s32 firstX, s32 firstY,
165 s32 firstPortraitX, s32 firstPortraitY,
166 s32 second, s32 secondX, s32 secondY,
167 s32 secondPortraitX, s32 secondPortraitY);
169
170void Camera_FollowActor(s32 actor, s32 keepPosition);
171void Camera_SetSpeedParameters(s32 speedLimit, s32 acceleration);
172void Camera_MoveWithinMapBounds(s32 requestedX, s32 requestedY, s32 requestedZ,
173 s32 glide);
175void Camera_WaitForArrival(void);
177void Camera_FollowObject(struct ObjectRuntime *target, s32 keepCurrentPosition);
178void Map_SetViewBounds(s32 minX, s32 minY, s32 maxX, s32 maxY);
179#ifdef UBFIX
181#else
183#endif
184void BattleFx_ScheduleRatioTransition(s32 zoom, s32 frames);
186#ifdef UBFIX
187void BattleFx_CopyLinkedObjectPosition(union FieldObject *fieldObject);
188#else
190#endif
191void BattleFx_SpawnLinked(s32 actor, s32 emote, s32 wait);
192void BattleFx_ConfigureLinkedObject(s32 actor, s32 flags);
196void ObjectMotion_SetActionCallback(struct ObjectRuntime *object, s32 action);
198 s32 sprite);
200s32 Field_ClimbDown(void);
201s32 Field_ClimbUp(void);
202s32 Object_GetScreenPosition(s32 objectId, s32 *position);
204#ifdef UBFIX
206#else
208#endif
214
219void FieldFx_UpdateLightning(void);
221void FieldMotes_Update(void);
222void FieldMotes_Start(void);
224void FieldEffect_InitSparkles(void);
225void FieldFx_StartLightning(void);
226void FieldFx_StopLightning(void);
227void FieldFx_LastLightning(void);
228void FieldFx_ResumeLightning(void);
229void BattleFx_StartBufferBlend(s32 from, s32 to);
230
232struct EffectSlot;
233struct MotionObject;
234
236void Djinn_RunBattleStartHop(s32 djinniId);
237void Djinn_JoinParty(s32 slot, s32 element, s32 djinn);
239// Declared without a prototype, as Field_RunScene (object.c) calls it with
240// one argument and with two. object.c comes before this unit in ROM order, so
241// in one file the calls would still come before the definition.
243void BattleFx_UpdateAllSlots(void);
244void BattleFx_InitializeSlots(void);
246void BattleFx_AdvanceSpinAngle(union FieldObject *fieldObject);
247void BattleFx_RunAngledApproachPhases(struct EffectSlot *particle);
248void Djinn_RunJupiterJoinEffect(s32 djinniId);
249void BattleFx_SetObjectAlternatingWords(union FieldObject *fieldObject);
250void BattleFx_AdvanceAngleWithRamp(union FieldObject *fieldObject);
252void Djinn_RunMarsJoinEffect(s32 djinniId);
254void BattleFx_UpdateRadialSpread(struct EffectSlot *effect);
257void BattleFx_HalveDistanceToTarget(union FieldObject *fieldObject);
259
260struct EffectVector;
261
263void BattleFx_Run(void);
267s32 Field_RunEventAction(const void *event, s32 param, s32 target);
268void ObjectGroup_ApplyRandomChildValues(union FieldObject *fieldObject);
270 s32 magnitude, s32 angle);
272struct AnimationObject *
273Sprite_ShareVramCache(struct AnimationObject *sourceSprite,
274 struct AnimationObject *sharedSprite);
275struct ObjectRuntime *Object_Spawn(s32 kind, s32 x, s32 y, s32 z);
276void ObjectGroup_SetActionForOthers(struct ObjectRuntime *except, s32 state,
277 s32 value);
278void FieldFx_UpdateScaledArcObjectA(union FieldObject *fieldObject);
279void FieldFx_UpdateScaledArcObjectB(union FieldObject *fieldObject);
280void BattleFx_SpawnScaledArcObjects(struct FieldActor *linked);
281void BattleFx_FlickerObjectAndTick(union FieldObject *fieldObject);
282void FieldFx_CycleObjectValueByCounter(union FieldObject *fieldObject);
284void BattleFx_LoadActionEffectResources(s32 abilityId, s32 mode);
285void BattleFx_SetupObjectPair(s32 userId, s32 targetId);
288void EventObject_Initialize(void);
291void Camera_WorldToScreen(struct EffectVector *position);
292
293struct ArcEffectObject;
294struct Effect05Object;
295struct OrbitEffect;
296struct SparkObject;
297
301void BattleFx_ArmBg0HBlankDma(void);
302void BattleFx_AdvanceHueCycle(void);
303void FieldFx_ComputeHueChannels(s32 hue, s32 *r, s32 *g, s32 *b);
304s32 BattleFx_HueChannelRamp(s32 angle, s32 low, s32 high);
305s32 Fixed_Remainder(s32 value, s32 divisor);
306void BattleFx_SetCallbackWhenTargetUnset(union FieldObject *fieldObject);
307void Ui_FillBank15PaletteGrey(void);
310void BattleFx_UpdateItemBreakFragment(union FieldObject *fieldObject);
311void BattleFx_SteerPushedTarget(s32 targetId);
313void FieldFx_RunMove(void);
314void *BattleFx_StartItemBreak(void *object);
315void BattleFx_SnapScaleToFull(struct MotionObject *obj);
316void UpdateRisingParticleBurst(void *object);
319void FieldFx_RunReveal(void);
321void FieldFx_RunGrowthOnTarget(s32 unused);
322void FieldFx_RunGrowth(void);
324void FieldFx_RunLiftOnTarget(s32 unused);
326 s32 angle);
327void BattleFx_UpdateRadialBurst(struct EffectSlot *slot);
328s32 SpawnHeavyImpactEffect(struct ScriptInterpreter *interpreter);
329void FieldFx_RunForceOnTarget(s32 unused);
330void FieldFx_RunForce(void);
331void BattleFx_UpdateOrbitingParticleMain(union FieldObject *fieldObject);
332void BattleFx_UpdateOrbitingParticleFade(union FieldObject *fieldObject);
333void BattleFx_UpdateOrbitingParticleLeft(union FieldObject *fieldObject);
335void FieldFx_RunFrostOnTarget(s32 unused);
336void FieldFx_RunFrost(void);
337void BattleFx_SwayParticle(union FieldObject *fieldObject);
338void BattleFx_UpdateShrinkingOrbitObject(union FieldObject *fieldObject);
339void BattleFx_RunSparkEmitter(union FieldObject *fieldObject);
340void FieldFx_RunPlyOnTarget(s32 unused);
341void FieldFx_RunPly(void);
342void FieldFx_CheckCloakTile(void);
343void FieldFx_EndCloak(void);
344void FieldFx_ResumeCloakCheck(void);
345void FieldFx_StartCloak(void);
346void FieldFx_SpawnRandomAngleTriplet(union FieldObject *fieldObject);
347void BattleFx_UpdateDriftingFallObject(union FieldObject *fieldObject);
348void FieldFx_RunDouseOnTarget(s32 unused);
349void FieldFx_RunDouse(void);
351void BattleFx_SteerLiftedTarget(s32 targetId);
353 s32 angle);
356void BattleFx_WanderAroundAnchor(union FieldObject *fieldObject);
357void BattleFx_CircleAnchor(union FieldObject *fieldObject);
358void BattleFx_ShrinkObjectScaleUntilHalf(union FieldObject *fieldObject);
360void FieldFx_RunWhirlwind(void);
361void BattleFx_UpdateRadialCamera(struct EffectSlot *effect);
365void BattleEffect_PauseObject(s32 actorId);
366void BattleFx_ResumeObject(s32 actorId);
368void FieldFx_RunCatchOnTarget(s32 unused);
369void FieldFx_RunCatch(void);
370void FieldFx_UpdateSpinAngle(union FieldObject *fieldObject);
371void BattleFx_UpdateDescendingObject(union FieldObject *fieldObject);
372void BattleFx_UpdateRadialLaunch(struct EffectSlot *slot);
373void FieldFx_RunRetreat(void);
375 union FieldObject *fieldObject);
377 union FieldObject *fieldObject);
379void FieldFx_BlinkAvoidCaster(void);
380void BattleFx_UpdatePairedArcSpawner(union FieldObject *fieldObject);
382void FieldFx_RunAvoid(void);
383
384void EffectSlot_Update(struct EffectSlot *effect);
385void BattleFx_DrawScaledObject(struct EffectSlot *object);
386void EffectSlot_UpdateMotion(struct EffectSlot *effect);
388void EffectSlot_SetPosition(struct EffectSlot *effect, s32 x, s32 z);
389void EffectSlot_SetObjectMode(struct EffectSlot *effect, s32 mode);
390void EffectSlot_SetCallback(struct EffectSlot *effect, EffectCallback callback);
391void EffectSlot_Initialize(struct EffectSlot *effect, s32 kind, s32 x, s32 z);
392void BattleFx_ClearOwnedSlot(struct EffectSlot *slot);
393
397void Map_ShowWorldMap(s32 picture);
400
401#endif
void ObjectMotion_SetSpeedParameters(u32 objectId, s32 speedLimit, s32 acceleration)
The event command "set actor speed": its top speed and acceleration, 16.16 pixels per frame.
void ObjectVisual_CopyAttributes(u32 targetId, u32 sourceId)
Makes the target actor's sprite show the source actor's graphics (its VRAM block and tile).
void ObjectMotion_CommitCurrentPositionAndActivate(u32 objectId)
The event command "wait for actor": waits (at most 600 frames) for the actor to arrive and stands it ...
void ObjectMotion_ResetAndSetPositionInMode2(u32 objectId, s32 x, s32 z)
The event command "walk actor to": the actor walks (animation 2) toward (x, z), in pixels.
void Motion_SetVarCbAndRefresh(u32 objectId, s32 count)
The event command "run repeated motion": as ObjectMotion_SetVariantCallback, then waits for it to end...
void ObjectMotion_NoOp(void)
An empty function, reached only through an unnamed veneer in the object bank's far-call table; nothin...
void Object_LinkPair(s32 firstId, s32 secondId, s32 wait)
The event command "actors face each other": turns two actors toward each other, then waits wait frame...
s32 ObjectMotion_StepAngle(struct ObjectRuntime *object)
Script step that turns an actor toward the angle kept in its action: the whole way when within 1/16 t...
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 Object_ResetTargetAndSetMode1(u32 objectId)
Clears an actor's destination, puts it under event control and stands it still.
void ObjectTable_DestroyById(s32 index)
The event command "destroy actor": releases the actor and frees its slot, writing NULL to its place i...
s32 ObjectTable_ReadActiveValue(s32 actor)
Returns the sprite (the first animation's id) of the actor in the low 12 bits of actor,...
void FieldFx_UpdateParticleLinearMotion(union FieldObject *fieldObject)
Moves a dust puff of FieldFx_SpawnBurstParticle: it drifts with its x and z velocity (kept in speed a...
void ObjectMotion_CenterOnColumn(u32 objectId, s32 priority, s32 zOffset)
The event command "center actor and walk": walks the actor sideways to the middle of its 16-pixel col...
void ObjectGroup_SetChildValue(struct FieldActor *actor, s32 param)
Sets the param byte of every animated part of an actor's sprite.
void Object_SetActionCallbackAndRefreshById(u32 objectId, s32 action)
Starts a built-in action or supplied script, then waits up to 300 frames for its script to end.
void Object_RefreshSelectorById(u32 objectId)
Waits, at most 300 frames, for an actor's script to reach its end (command 0x10).
void ObjectMotion_SetHorizontalPositionWithTerrain(u32 objectId, s32 x, s32 z)
The event command "set actor position": puts the actor at (x, z), 16.16 pixels, at rest.
UNUSED void ObjectVisual_ReservedNoOp(void)
void ObjectMotion_ResetAndSetPosition(u32 objectId, s32 x, s32 z)
The event command "set actor destination": the actor heads for (x, z), in pixels, keeping its current...
void Motion_SetModeAndWaitAnimation(u32 objectId, s32 animation)
The event command "set actor animation and wait": plays the animation and waits for it to end.
void ObjectGroup_ApplyIndexedChildValue(union FieldObject *fieldObject)
Per-frame hook of a blinking actor: sets its sprite parts' param from gObjectGroup_BlinkChildValues (...
void ObjectMotion_EnableActionAndSetCallback(u32 objectId, s32 action)
Gives an actor an action script (ObjectMotion_SetActionCallback) and lets it run: sets bit 0 of its a...
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 FieldFx_SpawnBurstParticle(struct FieldActor *source, s32 param)
Kicks up a dust puff (object 222) where source stands: it flies off toward the back at 0....
void Actor_JumpDownLedge(s32 actor, s32 pose, s32 param)
Makes an actor jump down off a ledge in front of it (the field runs it for the leader when the player...
void Object_SetTargetAndCallback(u32 objectId, s32 targetId, const void *script)
Links an actor to the actor in the low 8 bits of targetId and starts script on it.
void ObjectMotion_CommitPositionAndActivate(u32 objectId, s32 xOffset, s32 zOffset)
Walks the actor (xOffset, zOffset) pixels, waits for it to arrive and stands it still.
void ObjectMotion_OffsetPositionAndResetMotion(u32 objectId, s32 xOffset, s32 zOffset)
The event command "set actor destination offset": the actor heads (xOffset, zOffset) pixels from wher...
void Object_LinkObjectAndSetCallback(u32 objectId, u32 linkedObjectId)
Makes an actor follow another (the linked action script): writes its linkedObject.
void ObjectMotion_SetVariantCallback(u32 objectId, s32 count)
The event command "start repeated motion": the actor squashes and springs back count times (1 to 3),...
void Motion_LaunchFromFocusedObject(u32 objectId, s32 xOffset, s32 zOffset, s32 action)
Places an actor on the leader and sends it walking (xOffset, zOffset) pixels away at speed 0....
s32 ObjectTable_FindActiveByValue(s32 sprite)
Returns the first scene actor (8 to 65) showing sprite, or -1.
void ObjectMotion_SetPositionWithTerrain(u32 objectId, s32 x, s32 y, s32 z)
Puts the actor at (x, y, z), 16.16 pixels, at rest; an actor that follows the ground (flag 1) is rais...
void FacingObject_TurnPairToFaceEachOther(struct FacingObject *firstObject, struct FacingObject *secondObject)
Turns two actors to face each other, at most 1/16 turn a frame each, until both do (at most 60 frames...
void ObjectMotion_SetPositionAndReset(u32 objectId, s32 x, s32 z)
The event command "walk actor to and wait": walks the actor to (x, z), in pixels, waits for it to arr...
void Event_SetMessageId(s32 message)
The event command "set message": the number of the event's next message, written to work->message.
void ObjectMotion_WaitForAnimationChange(u32 objectId)
Waits, at most 90 frames, for an actor's animation to change.
void ObjectMotion_OffsetPositionAndReset(u32 objectId, s32 xOffset, s32 zOffset)
Walks the actor (animation 2) (xOffset, zOffset) pixels from where it stands.
void ObjectMotion_SetPositionAndCommit(u32 objectId, s32 x, s32 z)
The event command "move actor and wait": as ObjectMotion_ResetAndSetPosition, then waits (at most 600...
void ObjectMotion_EnableActionAndResetMotion(u32 objectId)
The event command "stop actor": stops its action and puts it back under event control (dispatch scrip...
void Object_SetActionById(u32 objectId, s32 steps)
Sets the animation timer steps of each of an actor's sprites (AnimationObjects_SetActiveTimerSteps).
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
void ObjectMotion_SetAngleToward(s32 firstId, s32 secondId, s32 wait)
The event command "actor face actor": turns the first actor at once to face the second,...
UNUSED void ObjectTable_DestroyNoOp(void)
void Object_SetModeById(u32 objectId, s32 animation)
The event command "set actor animation" (1 stands, 2 walks, 3 nods, 4 shakes the head and so on).
void ObjectGroup_ConfigureChildValue(s32 objectId, s32 param)
The event command "set actor sprite param": gives every sprite part of the actor param (ObjectGroup_S...
void ObjectMotion_SetActionVariant(s32 objectId, s32 priority)
The event command "set actor sprite priority": fixes the priority of the actor's sprite,...
struct ObjectRuntime * Object_FindNearestFacingTarget(struct ObjectRuntime *self, s32 sprite)
Finds the nearest animated object to self within 40 pixels and 48 pixels of height,...
s32 Object_ClearChildAndCollisionFlags(void *obj)
Script step: clears an object's sprite flags and its collision flags.
Definition actor_motion.c:8
void ObjectMotion_SetActionCallback(struct ObjectRuntime *object, s32 action)
Starts an actor's action script: 1 to 4 the fixed action scripts, 5 follow the linked object,...
s32 ObjectMotion_TurnTowardLinkedTarget(struct ObjectRuntime *object)
Script step of action 6: turns the object toward its linked object, at most 1/16 turn a frame.
s32 ObjectMotion_MoveTowardTarget(struct ObjectRuntime *object)
Script step of action 5: follows the linked object.
void BattleFx_FlickerObjectAndTick(union FieldObject *fieldObject)
Per-frame update: flashes an object between sprite param 7 and 0 every 2 frames and spawns the swelli...
Definition arcs.c:134
void FieldFx_CycleObjectValueByCounter(union FieldObject *fieldObject)
Per-frame update: cycles an object through sprite params 0 to 5, one step every 2 frames,...
Definition arcs.c:148
void FieldFx_UpdateScaledArcObjectA(union FieldObject *fieldObject)
Per-frame update of arc A: over 32 frames it swells and shrinks again (scale sin(frame / 64 turn)) wh...
Definition arcs.c:11
void BattleFx_SpawnScaledArcObjects(struct FieldActor *linked)
Spawns the two swelling arcs (object 26) on an object, A and B (B upside down); they follow it for 32...
Definition arcs.c:88
void FieldFx_UpdateScaledArcObjectB(union FieldObject *fieldObject)
Per-frame update of arc B: arc A upside down, 16 pixels in front of the object and up to 5 pixels nea...
Definition arcs.c:36
void FieldFx_RunAvoid(void)
The caster spins and flashes, then blinks, and encounters are kept away until Avoid wears off.
Definition avoid.c:82
void FieldEvent_ShowStatusMessage(void)
Avoid (or the Sacred Feather) has worn off, and the game says so.
Definition avoid.c:58
void FieldFx_BlinkAvoidCaster(void)
End of the effect: switches the caster's display flags between 3 and 1 on a 5-frame cycle.
Definition avoid.c:10
void BattleFx_UpdatePairedArcSpawner(union FieldObject *fieldObject)
The caster during the effect: sheds a pair of falling arcs every 5 frames (7 on the world map),...
Definition avoid.c:33
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...
Definition camera.c:47
void Camera_WaitForArrival(void)
The event command "camera wait for move": waits (at most 600 frames) for the camera to arrive,...
Definition camera.c:125
void Camera_SetSpeedParameters(s32 speedLimit, s32 acceleration)
The event command "camera set speed": the camera's top speed and acceleration, 16....
Definition camera.c:36
struct FieldActor * Camera_GetEventObject(void)
The event command "get view centre": returns the camera object.
Definition camera.c:133
void Camera_FollowActor(s32 actor, s32 keepPosition)
The event command "camera follow actor": the camera (the event's view centre) follows actor.
Definition camera.c:10
UNUSED void Camera_FollowObject(struct ObjectRuntime *target, s32 keepCurrentPosition)
Makes the camera follow target; unless keepCurrentPosition is set it jumps there at once.
Definition camera.c:141
void Object_PlaceCurrentWithinCameraBounds(s32 actor, s32 glide)
The event command "camera move to actor": Camera_MoveWithinMapBounds to the actor's x and z.
Definition camera.c:113
void BattleFx_SteerLiftedTarget(s32 targetId)
Two hands lift it to 24 pixels above the ground; the d-pad moves it 16 pixels at a time and A,...
Definition carry.c:52
struct MotionObject * BattleFx_SpawnItemBreakMode1(s32 x, s32 y, s32 z, s32 angle)
Spawns object 215 with the item break sound, in animation 1, and grows it, spinning,...
Definition carry.c:290
void BattleFx_SpawnFallingParticles(void)
Per-frame update: drops one particle round the lifted object, 8 to 24 pixels above it and 0 to 48 pix...
Definition carry.c:11
void FieldFx_RunCatch(void)
Carries object 215 from 16 pixels above the caster to the goal in 10 steps, growing from a quarter to...
Definition catch.c:22
void FieldFx_RunCatchOnTarget(s32 unused)
Abilities: Catch (field kind 13), cast on a target.
Definition catch.c:10
s32 Field_ClimbUp(void)
Climbing up (the player presses up at a climbable wall).
Definition climbing.c:196
s32 Field_ClimbDown(void)
Climbing down (the player presses down at a climbable wall).
Definition climbing.c:119
s32 Field_TryJumpForward(void)
Makes the leader jump two tiles forward, over the tile in front, when the map allows it (Map_CheckObj...
Definition climbing.c:25
void FieldFx_StartCloak(void)
The leader blinks 10 times and hides (cloaked set), and the tile check starts; where the leader canno...
Definition cloak.c:127
void FieldFx_ResumeCloakCheck(void)
Starts the Cloak tile check if the leader is hidden.
Definition cloak.c:117
void FieldFx_EndCloak(void)
Ends Cloak: stops the tile check and makes the leader blink back into sight, clearing cloaked.
Definition cloak.c:77
void FieldFx_CheckCloakTile(void)
Scheduler callback of Cloak: when the tile under the leader is not CLOAK_TILE, requests CLOAK_END.
Definition cloak.c:13
s32 Object_GetScreenPosition(s32 objectId, s32 *position)
Finds where an actor is on screen: position[0] and position[1] receive its x and y in pixels,...
Definition context.c:12
void ObjectEffect_PrepareContextEffect(s32 animation)
Starts the leader's animation for leaving through an exit: centres it on its tile,...
Definition context.c:101
s32 Field_StartEncounterTransition(s32 unused)
Starts the transition into a random battle: plays the scene's battle cue and the encounter sounds,...
Definition context.c:62
void ObjectEffect_EndContextEffect(s32 animation)
Plays the leader's arrival animation through an exit: centred on its tile at the tile's north edge,...
Definition context.c:148
void ObjectEffect_BeginContextEffect25(void)
Leaves through an exit of kind 0x30 (animation 25), recorded in flag 0x121.
Definition context.c:138
void ObjectEffect_BeginContextEffect26(void)
Leaves through an exit of kind 0x20 (animation 26); flag 0x120 makes the next scene play the matching...
Definition context.c:131
UNUSED void ObjectEffect_ReservedNoOp941DC(void)
Definition context.c:51
s32 ObjectEffect_RunPendingFlagEvent(void)
Plays the leader's arrival for the way the last scene was left: through an exit of kind 0x20 (flag 0x...
Definition context.c:181
void ObjectMotion_MoveHalfwayTowardTarget(union FieldObject *fieldObject)
Update hook shared by the Djinni battle-start and Mercury afterimages.
Definition djinni.c:8
void Djinn_ResolvePendingEvent(s32 shown)
Settles a pending Djinni battle as a scene loads.
Definition djinni.c:209
void BattleFx_InitializeSlots(void)
Allocates and clears the effect slots (heap block 56) and starts their update callback.
Definition djinni.c:261
void Djinn_RunBattleStartHop(s32 djinniId)
A Djinni's battle start: the Djinni (actor id) bounces twice, turns to face the leader,...
Definition djinni.c:17
void BattleFx_RunAngledApproachPhases(struct EffectSlot *particle)
Effect slot callback of a Jupiter Djinni's light particles: each circles its centre while it widens f...
Definition djinni.c:295
void BattleFx_AdvanceSpinAngle(union FieldObject *fieldObject)
Per-frame update: spins an object 1/8 turn a frame.
Definition djinni.c:287
void BattleFx_ClearActiveSlotsAndScheduleUpdates(void)
Stops the effect slots: removes their callback, frees every slot still in use and releases their heap...
Definition djinni.c:271
void BattleFx_UpdateAllSlots(void)
Scheduler callback: updates the 24 effect slots.
Definition djinni.c:257
void FieldObject_PlaceSceneActors(void)
Puts a Djinni's actor back where its battle started from: for a pending Djinni battle (pendingDjinnEv...
Definition djinni.c:168
void Djinn_JoinParty(s32 slot, s32 element, s32 djinn)
A Djinni joins the party: djinn (0 to 19) of element goes to the member with the fewest Djinn,...
Definition djinni.c:124
void FieldFx_SpawnRandomAngleTriplet(union FieldObject *fieldObject)
Per-frame update of a falling particle: on reaching altitude, it scatters three small particles.
Definition douse.c:45
void FieldFx_RunDouse(void)
An orb of light rises from 16 pixels above the target to 32 pixels above the destination (80 with var...
Definition douse.c:112
void BattleFx_UpdateDriftingFallObject(union FieldObject *fieldObject)
Per-frame update: drifts from side to side as it slowly falls, and is released on reaching the ground...
Definition douse.c:86
void FieldFx_RunDouseOnTarget(s32 unused)
Runs Douse cast on a target, through FieldFx_RunDouse.
Definition douse.c:102
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_UpdateMotion(struct EffectSlot *effect)
Moves an effect slot toward its target, turning at most maxTurnStep a frame when limitTurnStep is set...
Definition effect_slot.c:53
void EffectSlot_SetPosition(struct EffectSlot *effect, s32 x, s32 z)
Places an effect slot at (x, z), at rest with no target.
void EffectSlot_Update(struct EffectSlot *effect)
Updates one effect slot: counts its age, runs its callback (after any delay), moves it and draws it.
Definition effect_slot.c:9
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 BattleFx_DrawScaledObject(struct EffectSlot *object)
Draws an effect slot's sprite at its screen position and scale, when it is near the screen.
Definition effect_slot.c:29
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.
Effect slots: the particles Psynergy effects move and draw.
void(*) EffectCallback(struct EffectSlot *)
Definition effect_slot.h:14
void FieldFx_RunForce(void)
A shot appears in front of the caster, grows and flies forward with three afterimages; what it hits (...
Definition force.c:23
void FieldFx_RunForceOnTarget(s32 unused)
Runs Force cast on a target, through FieldFx_RunForce.
Definition force.c:10
const struct SparkleFrame gFieldFx_SparkleFrames[32]
{dy, tile}
Definition fxdata.c:403
void BattleFx_UpdateRadialCamera(struct EffectSlot *effect)
Effect slot callback: state 0 heads for a point 40 to 70 pixels from where the particle appeared; sta...
Definition halt.c:12
void BattleFx_ResumeObject(s32 actorId)
Resumes object id with the update and param kept by BattleEffect_PauseObject.
Definition halt.c:199
s32 BattleFx_FilterObjectIdByFlags(s32 id)
Returns id, or -1 (no target) when the current effect's definition has flags 0xff.
Definition halt.c:216
void BattleEffect_RunFallbackObjectTransition(void)
Throws an object from the caster to the effect's position over 10 frames and scatters it into 16 part...
Definition halt.c:77
void BattleEffect_SetRandomTableValueOnObject(union FieldObject *fieldObject)
Per-frame update of a paused object: gives its sprite one of the table's eight params at random.
Definition halt.c:160
void BattleFx_MarkChildAndRunFallbackTransition(s32 unused)
Pauses the target (scene->child) and runs BattleEffect_RunFallbackObjectTransition.
Definition halt.c:65
void BattleEffect_PauseObject(s32 actorId)
Pauses object id, keeping its per-frame update and, if it is animated, its first animation's param in...
Definition halt.c:173
void BattleFx_SetObjectAlternatingWords(union FieldObject *fieldObject)
Per-frame update: makes an object pulse, switching its scale between the two values of gBattleFx_Puls...
Definition jupiter.c:86
void BattleEffect_UpdatePhasedRadialParticle(struct EffectSlot *effect)
Effect slot callback of a Mars Djinni's sparks.
Definition jupiter.c:117
void BattleFx_AdvanceAngleWithRamp(union FieldObject *fieldObject)
Per-frame update: spins an object ever faster, from 1/16 turn a frame up to 1/8.
Definition jupiter.c:97
void Djinn_RunJupiterJoinEffect(s32 djinniId)
A Jupiter Djinni joins the party: it bounces three times, spins, leaps out of sight and bursts into 2...
Definition jupiter.c:10
s32 SpawnHeavyImpactEffect(struct ScriptInterpreter *interpreter)
A heavy impact: places object 0x11b 32 pixels below the source and scatters 12 shards from it.
Definition lift.c:177
void FieldFx_RunLiftOnTarget(s32 unused)
An object appears 32 pixels to either side, each moves 14 pixels in, and they lift the target 32 pixe...
Definition lift.c:13
struct MotionObject * BattleFx_SpawnItemBreakMode3(s32 x, s32 y, s32 z, s32 angle)
Spawns object 215 and grows it, spinning, from a quarter to full size over 24 frames; angle is the wa...
Definition lift.c:87
void BattleFx_UpdateRadialBurst(struct EffectSlot *slot)
Effect slot callback of a particle that scatters 25 pixels from its origin in a random direction,...
Definition lift.c:118
void BattleFx_UpdateDescendingOrbitObject(union FieldObject *fieldObject)
Per-frame update of a Venus Djinni's falling motes: each circles the leader on a shrinking spiral (ra...
Definition mars.c:143
void Djinn_RunMarsJoinEffect(s32 djinniId)
A Mars Djinni joins the party: it turns to the camera, bounces three times, spins ever faster and shr...
Definition mars.c:14
void BattleFx_UpdateRadialSpread(struct EffectSlot *effect)
Effect slot callback of a Venus Djinni's particles: each starts on screen at a random point 10 to 20 ...
Definition mars.c:174
void BattleFx_RunMercuryDjinnCapture(s32 djinniId)
A Mercury Djinni joins the party: the screen is tinted blue, the Djinni bounces twice and hops three ...
Definition mercury.c:14
void BattleFx_SetCallbackWhenTargetUnset(union FieldObject *fieldObject)
Per-frame update: once the object has arrived (no destination left), runs the script for untargeted o...
Definition mind_read.c:231
s32 Fixed_Remainder(s32 value, s32 divisor)
The 16.16 remainder of value divided by divisor (0 for a zero divisor).
Definition mind_read.c:217
void FieldFx_ComputeHueChannels(s32 hue, s32 *r, s32 *g, s32 *b)
Works out red, green and blue (0 to 31 each, 16.16) for a hue in degrees (16.16).
Definition mind_read.c:197
void BattleFx_ArmBg0HBlankDma(void)
Scheduler callback: restarts the HBlank DMA that writes BG0's horizontal scroll for each scanline fro...
Definition mind_read.c:145
void Ui_SetBank15PaletteAndClearRenderMode(void)
Stops the BG0 scanline scroll and restores BG palette 15.
Definition mind_read.c:279
void Ui_FillBank15PaletteGrey(void)
Turns colours 1 and 3 to 12 of BG palette 15 grey and starts the BG0 scanline scroll (BattleFx_ArmBg0...
Definition mind_read.c:249
void RunSceneTransitionEffect(s32 x, s32 y)
Starts the wave effect of caster sourceId on target targetId: fades the palettes toward a hue that sh...
Definition mind_read.c:27
s32 BattleFx_HueChannelRamp(s32 angle, s32 low, s32 high)
One colour channel's strength at a hue angle: rising from 0 to 60 degrees, high from 60 to 180,...
Definition mind_read.c:205
void FieldFx_UpdateMindReadWave(void)
Scheduler callback of the wave effect: once its delay has run out, writes the next page of scanline o...
Definition mind_read.c:65
void BattleFx_AdvanceHueCycle(void)
Moves the wave's hue on 4 degrees and works out its colour, each channel 4 to 11.
Definition mind_read.c:161
void BattleFx_FinishSceneAndReleaseHeapBlock(void)
Stops the wave effect: restores the caster's colours and the palettes and releases the effect's work.
Definition mind_read.c:47
void BattleFx_UpdateItemBreakFragment(union FieldObject *fieldObject)
Per-frame update of a broken item's main fragment: turns it toward the object it is linked to,...
Definition move.c:17
s32 Input_GetDpadAngle(u32 unused)
Returns the direction of the d-pad (0x10000 a full turn): right 0, down 0x4000, left 0x8000,...
Definition move.c:9
void * BattleFx_StartItemBreak(void *object)
Spawns the broken item (object 215) 16 pixels above object and moves it 16 pixels the way object face...
Definition move.c:323
void UpdateRisingParticleBurst(void *object)
Per-frame update: the object spins as it rises for 31 frames, shrinks, and bursts into 8 particles.
Definition move.c:397
void BattleFx_UpdateOrbitAndReturn(struct EffectSlot *slot)
Effect slot callback of a particle that flies 30 pixels out from where it started,...
Definition move.c:246
void BattleFx_SnapScaleToFull(struct MotionObject *obj)
Per-frame update: grows an object's scale by 1/16 a frame up to full size and fixes its position.
Definition move.c:377
void BattleFx_SteerPushedTarget(s32 targetId)
Puts the pushing hand beside the target and pushes the target 16 pixels the way the d-pad points,...
Definition move.c:65
void FieldFx_RunMove(void)
Shows the broken item beside the caster for 30 frames, then turns it into particles.
Definition move.c:296
void FieldEvent_RunTypeHandler(void)
The extra handler of Reveal, Cloak and Avoid: what each does when it ends.
Definition dispatch.c:216
void ObjectGroup_SetActionForOthers(struct ObjectRuntime *except, s32 state, s32 value)
Sets the movement state and animation timer steps of every object but the player's and except.
Definition dispatch.c:395
s32 ResourceTable_CountFreeBlocks(void)
Counts the free blocks (owner 0xff) of the 512 resource blocks.
Definition dispatch.c:324
void BattleFx_DispatchRequestKind(void)
Casts the current Psynergy effect on its target (secondObjectId): runs the handler of its kind.
Definition dispatch.c:127
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 ...
Definition dispatch.c:242
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 ...
Definition dispatch.c:346
void BattleFx_ClearChildValueOnMismatch(void)
Finishes the current effect when it is Mind Read: ends the effect and lets its target move again,...
Definition dispatch.c:202
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...
Definition dispatch.c:308
void Field_DispatchTypeHandler(s32 kind)
Runs one step of the current Psynergy effect: 0 casts it with no target, 1 casts it on its target (se...
Definition dispatch.c:15
void BattleFx_Run(void)
Casts the current Psynergy effect with no target: runs the body of its kind (scene->fieldKind).
Definition dispatch.c:35
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 ...
Definition dispatch.c:371
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.
Definition dispatch.c:270
s32 Event_AskYesNoWithActorAnimation(s32 actor, s32 forceBottom)
The event command "choose yes or no": once the message on screen has been read, asks yes or no below ...
Definition events.c:416
void Event_SetExitRequest(u16 request)
The event command "request exit": sets the field's exit request (999 leaves for gGameState's scene an...
Definition events.c:536
void Event_SetSavedDestination(u16 scene, u16 entrance)
Makes the event leave and records scene and entrance as the saved destination.
Definition events.c:526
void Actor_WaitForAnimationEnd(s32 actor, s32 animation)
Waits, at most 90 frames, for an actor's animation to stop being animation: the actor has finished a ...
Definition events.c:392
s32 Menu_AskYesNo(s32 atBottom)
Asks yes or no at the top of the screen, or at the bottom with atBottom set.
Definition events.c:468
s32 PartyInventory_GiveItem(s32 item, s32 unused)
The event command "give item": gives item to the first party member with room for it and says so.
Definition events.c:275
UNUSED void Event_NoOpHookA(void)
Nothing calls it.
Definition events.c:127
void Leader_StopMoving(void)
Stops the leader where it stands: no horizontal velocity, the normal walking speed (1....
Definition events.c:67
void FieldEvent_End(void)
Ends an event: stops the debug fast-forward callback, gives the camera back to the leader and refresh...
Definition events.c:120
void Event_UpdateDebugSkip(void)
Debug only: while debug mode is on, R makes every event wait (FieldEvent_WaitFrames) end at once and ...
Definition events.c:38
void Event_FinishScreenTransition(void)
The event command "close screen": finishes the event's screen transition and clears work->transitionA...
Definition events.c:499
void Event_SetSceneEvents(const struct SceneEvent *events)
Sets the scene's event table, which the field checks as the leader moves: writes work->events.
Definition events.c:155
void Inventory_NoOpCallback(void)
An empty function; nothing in ☀️ calls it.
Definition events.c:383
void Event_ClearInvalidPackedValues(void)
Clears each button shortcut whose Psynergy can no longer be cast: zeroes gGameState....
Definition events.c:203
void Event_WaitTransitionFrames(void)
The event command "wait for screen": waits as long as the transition runs (work->transitionFrames).
Definition events.c:509
void FieldEvent_WaitFrames(s32 frames)
The event command "wait": waits the requested frames, unless debug fast forward (Event_UpdateDebugSki...
Definition events.c:55
s32 Party_CheckItemLimit(s32 item)
Checks whether the party can carry one more of item: each member carries at most 30 of one item.
Definition events.c:248
void Event_PrepareTwoObjectsAndApply(s32 first, s32 second)
Adds two units to the party and announces them together.
Definition events.c:175
void Party_RemoveOwnerRestored(s32 unit)
Takes unit out of the party, fully restoring its HP and PP and curing its poison.
Definition events.c:214
void Event_RunObjectHookAndWait(struct ScenePlacement *table)
Respawns the scene's actors from a placement table and waits one frame for them to appear.
Definition events.c:136
void Event_StartScreenTransition(void)
The event command "open screen": starts the event's screen transition and sets work->transitionActive...
Definition events.c:488
s32 Inventory_TryAddAndReturnOwner(s32 item, s32 unused, s32 unit)
Gives item to one party member.
Definition events.c:376
void Event_SetDestination(s32 scene, s32 entrance)
Makes the event leave for the given entrance of the given scene: raises the exit request 999 and writ...
Definition events.c:517
void Event_CallWithLastActiveObjectId(struct ScenePlacement *table)
Spawns the actors of a placement table after the last actor in use.
Definition events.c:148
void FieldEvent_Begin(void)
The event command "begin event": closes any timed notice, stops the leader, resets the message and ti...
Definition events.c:91
s32 Event_ValidatePackedId(u32 shortcut)
Checks an L or R button shortcut, packed as the member in bits 10 to 13 and the Psynergy in bits 0 to...
Definition events.c:186
void Event_NoOpHook(void)
An empty hook; it does nothing in the released game.
Definition events.c:131
void Event_PrepareObjectAndApplyValue(s32 unit, s32 announce)
Adds unit to the party.
Definition events.c:165
void Inventory_ReservedNoOp(void)
An empty function; nothing in ☀️ calls it.
Definition events.c:386
void Party_LearnAbility(s32 unit, s32 ability)
Teaches unit the Psynergy ability and says so with its jingle, waiting for the player to read it.
Definition events.c:475
void BattleFx_UpdateOrbitingParticleLeft(union FieldObject *fieldObject)
Spirals anticlockwise at twice the frames left in pixels, then fades.
Definition frost.c:65
void FieldFx_RunFrost(void)
16 particles spiral in on the effect's position and make the target flash 16 times; without childOpti...
Definition frost.c:96
void FieldFx_RunFrostOnTarget(s32 unused)
Runs Frost cast on a target.
Definition frost.c:79
void BattleFx_UpdateOrbitingParticleMain(union FieldObject *fieldObject)
Per-frame update: flashes (animation 2) for 2 frames in every 8.
Definition frost.c:8
void BattleFx_UpdateOrbitingParticleFade(union FieldObject *fieldObject)
Per-frame update: shrinks by 1/16 a frame and is released at 1/16.
Definition frost.c:19
void BattleFx_UpdateOrbitingParticleRight(union FieldObject *fieldObject)
Per-frame update: as BattleFx_UpdateOrbitingParticleLeft, clockwise.
Definition frost.c:70
void BattleEffect_SpawnBurstParticleField(void)
Sends 24 particles, one every 2 frames, from in front of the caster to points round the effect's posi...
Definition growth.c:107
void FieldFx_RunGrowthOnTarget(s32 unused)
Particles round the target, which takes the sprite priority of the ground under it.
Definition growth.c:50
void FieldFx_RunGrowth(void)
The particles, then five falling objects 4 to 10 pixels round the effect's position.
Definition growth.c:71
struct UiWindow * UiText_OpenMessageAtObject(s32 actor, s32 unused)
The event command "open message": opens the event's current message in a speech window next to the sp...
Definition messages.c:24
void Ui_SetMessageVoiceFromActor(s32 actor)
Sets the voice of the messages that follow to that of actor's sprite, at the rate the message speed o...
Definition messages.c:483
void ObjectTable_RunIfActive(s32 actor)
Closes the portrait of an actor's sprite, if it has one.
Definition messages.c:425
void Event_ShowSpeakerMessage(s32 speaker)
A speaker-message entry point retained by its overlay veneer, with no current scene caller.
Definition messages.c:319
void ObjectTable_CallRefreshHook(s32 unused0, s32 unused1, s32 x, s32 y)
Retained by its overlay veneer; no current caller establishes the coordinates forwarded to Event_Show...
Definition messages.c:392
void BattleEventRuntime_EmptyCallback(void)
Definition messages.c:311
void Event_ShowMessageAtPosition(s32 unused0, s32 unused1, s32 x, s32 y)
A retained coordinate-message entry point: waits for the message and advances the event's message ind...
Definition messages.c:399
void FieldEvent_ShowMessageAndWait(s32 actor, s32 flags)
The event command "show message": opens the current message at actor (UiText_OpenMessageAtObject) and...
Definition messages.c:248
void BattlePres_RunActionThenWaitIfModeZero(s32 actor, s32 flags, s32 wait)
The event command "show message and wait": shows the message, then waits wait frames.
Definition messages.c:283
void Battle_ShowPairedUnitWorkAndWait(s32 first, s32 firstX, s32 firstY, s32 firstPortraitX, s32 firstPortraitY, s32 second, s32 secondX, s32 secondY, s32 secondPortraitX, s32 secondPortraitY)
The event command "show two messages and wait": two actors speak at once, each message at its own (x,...
Definition messages.c:436
s32 FieldEvent_AskYesNoAndShowResponse(s32 actor, s32 flags)
The event command "ask yes or no": opens the question at actor, lets the leader answer,...
Definition messages.c:291
void BattleFx_UpdateAllEffectSlots(void)
Scheduler callback: updates the 24 effect slots.
Definition setup.c:8
void BattleEffect_InitializeSharedScene(void)
Saves the palettes for the effect (once, unless an effect is already shown) and fades them toward one...
Definition setup.c:236
void BattleFx_PrepareBufferInterpolation(void)
Fades the palettes back from an effect's colours to the saved ones (or to palette 0x10001 while an ef...
Definition setup.c:275
void BattleFx_SetupObjectPair(s32 userId, s32 targetId)
Records the caster and the target of an effect.
Definition setup.c:56
void EffectRuntime_StopCurrentObject(void)
Stops the caster's per-frame hook and restores its colours.
Definition setup.c:94
void BattleEffect_CleanupSceneObjects(void)
Ends a Psynergy effect: frees the effect slots still in use and, unless another effect is being resol...
Definition setup.c:110
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...
Definition setup.c:293
void EventObject_Initialize(void)
Starts casting: the caster takes its casting pose (animation 20) and stops.
Definition setup.c:186
void BattleFx_LoadActionEffectResources(s32 abilityId, s32 mode)
Prepares the work of the Psynergy effect for ability (heap slot 56) and loads its spark tiles.
Definition setup.c:13
void Map_SetViewBounds(s32 minX, s32 minY, s32 maxX, s32 maxY)
The event command "set view bounds": the camera keeps the screen inside these map coordinates (Camera...
Definition view.c:13
void BattleFx_ScheduleRatioTransition(s32 zoom, s32 frames)
Starts a zoom to zoom (16.16) over frames frames, on the world map (event mode 3) only.
Definition view.c:69
void Event_WaitForZoomTransition(void)
Waits for a zoom transition to end (on the world map only, at most 300 frames).
Definition view.c:94
void BattleFx_SpawnLinked(s32 actor, s32 emote, s32 wait)
The event command "actor show emote": shows an emote bubble (object 21) over an actor,...
Definition view.c:148
void BattleFx_ConfigureLinkedObject(s32 actor, s32 flags)
The event command "actor set attached effect": with mode (the low 2 bits) 0 removes the object attach...
Definition view.c:211
s32 BattleFx_CopyLinkedObjectPosition(union FieldObject *fieldObject)
Definition view.c:119
s32 FieldFx_StepRatioTransition(void)
Definition view.c:30
void BattleFx_RunVisibilityTransition(void)
On the world map, zooms the view out (0x9d89) while L is held, then back.
Definition world_map.c:535
void Map_UpdateWorldMapMarkers(void)
Scheduler callback of the world map screen: shows a marker at each place whose flag is set,...
Definition world_map.c:188
void BattleFx_SetupResourcesAndWindow(void)
Sets up the world map screen: the marker tiles and their OAM entries, the cursor where the leader is ...
Definition world_map.c:75
void Map_ShowWorldMap(s32 picture)
Borrows the map-cell buffer for the still map until A or B closes it.
Definition world_map.c:427
void Field_UpdateObjectVisibilityBounds(void)
On the world map, shows only the scene actors within 320 pixels sideways, 600 above and 400 below the...
Definition world_map.c:496
void BattleFx_CleanupResourcesAndWindow(void)
Closes the world map screen: returns its VRAM blocks and removes the place-name window.
Definition world_map.c:177
void FieldFx_RunPlyOnTarget(s32 unused)
Runs FieldFx_RunPly, then stops the caster's hook.
Definition ply.c:98
void FieldFx_RunPly(void)
Eight particles spiral into the centre, where one appears, sheds sparks and flies far away.
Definition ply.c:109
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...
Definition ply.c:58
void BattleFx_SwayParticle(union FieldObject *fieldObject)
Per-frame update: sways 4 pixels either side of anchorX, once every 128 frames.
Definition ply.c:10
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...
Definition ply.c:24
FieldKind
A field Psynergy's effect, as the field kind: the type column of games/tbs/src/game/actions....
@ FIELD_KIND_DOUSE
@ FIELD_KIND_MIND_READ
@ FIELD_KIND_FORCE
@ FIELD_KIND_FROST
@ FIELD_KIND_CARRY
@ FIELD_KIND_CATCH
@ FIELD_KIND_PLY
@ FIELD_KIND_RETREAT
@ FIELD_KIND_CLOAK
@ FIELD_KIND_AVOID
@ FIELD_KIND_MOVE
@ FIELD_KIND_REVEAL
@ FIELD_KIND_GROWTH
@ FIELD_KIND_WHIRLWIND
Whirlwind and Gale.
@ FIELD_KIND_LIFT
@ FIELD_KIND_HALT
void Field_RequestBattleFromEncounterTable(s32 zoneNo, s32 slotNo)
Sets up a battle with enemy group slot of encounter table zone.
Definition requests.c:14
void Event_SetDefeatDestination(s32 scene, s32 entrance)
Sets where the party wakes up after losing a battle (gGameState.defeatScene and defeatEntrance).
Definition requests.c:70
void Event_SetNextDestination(s32 scene, s32 entrance)
Sets the scene and entrance that the field goes to next (gGameState.nextScene and nextEntrance).
Definition requests.c:61
void BattleFx_PlayQueuedSound(void)
Plays the sound BattleFx_SetQueuedSoundAndPlay remembered, if any.
Definition requests.c:102
void Field_RequestDjinnBattle(s32 flag, s32 no)
Sets up the battle with Djinni number no.
Definition requests.c:35
void BattleFx_SetQueuedSoundAndPlay(s32 soundId)
Plays SE_298, then soundId (SE_289 for -1), and remembers soundId for BattleFx_PlayQueuedSound in the...
Definition requests.c:90
void Event_RequestDestination(u16 scene, u16 entrance)
Makes the event leave for entrance entrance of scene scene: sets gGameState.scene and entrance and ra...
Definition requests.c:79
void FieldFx_RunRetreat(void)
Spins the main object and shrinks it while 24 particles fly out, one a frame.
Definition retreat.c:88
void FieldFx_UpdateSpinAngle(union FieldObject *fieldObject)
Per-frame update: spins by 0x1000 + timer * 0x50 a frame, speeding up (timer counts up) until timer *...
Definition retreat.c:11
void BattleFx_UpdateDescendingParticleNegativeArc(union FieldObject *fieldObject)
As BattleFx_UpdateDescendingParticlePositiveArc for the arc drawn upside down, 16 pixels in front of ...
Definition retreat.c:192
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...
Definition retreat.c:23
void BattleFx_SpawnDescendingArcParticles(struct FieldActor *arc)
Spawns a pair of falling arcs (one upside down) on arc.
Definition retreat.c:254
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 ...
Definition retreat.c:159
void BattleFx_UpdateRadialLaunch(struct EffectSlot *slot)
Effect slot callback: a particle flies 120 pixels from the main object's screen position (8 pixels lo...
Definition retreat.c:39
void FieldEffect_WatchLeaderDistance(void)
Scheduler callback of the timed effect (kind 8): asks for it to end once the leader is 60 pixels from...
Definition reveal.c:36
void FieldFx_RunReveal(void)
Starts a screen transition centred on the leader, runs the matching event if there is one,...
Definition reveal.c:67
void ResetSceneTransitionEffect(void)
Ends Reveal if it is running: stops its watch, brings the colours back from black over 30 frames and ...
Definition reveal.c:116
void ObjectDispatch_ApplyValueToKind200Children(s32 value)
Passes value (as animation timer steps) to every one of the 64 objects whose first sprite part shows ...
Definition reveal.c:9
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
Definition animspr.h:108
A field object as Avoid's caster: its facing, its animation records and the phase and frame count of ...
Definition fx_scene.h:17
A FieldActor seen with the halfword at 0x64 unsigned and the one at 0x66 signed, as the bytes read th...
A field object as the object dispatcher's far calls take it.
A FieldActor seen with the halfword at 0x5e (here its phase), which FieldActor does not name.
Definition douse.c:9
A particle a Psynergy effect moves and draws: its sprite, its position and target,...
Definition effect_slot.h:18
A world position, as Camera_WorldToScreen converts it to the screen.
Definition battle.h:73
A field object seen as one that turns toward its facing target: its facing, its ground position and t...
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
s32 speed
speed limit, 16.16 fixed-point pixels per frame
Definition field_obj.h:55
union FieldCoordinate x
16.16 fixed-point pixels
Definition field_obj.h:35
union FieldCoordinate y
16.16 fixed-point pixels
Definition field_obj.h:36
union FieldCoordinate z
16.16 fixed-point pixels
Definition field_obj.h:37
s32 acceleration
Added toward the target each frame, or taken off the speed when there is none, in 16....
Definition field_obj.h:58
u16 wait
the object script's wait, in frames (ScriptMotionObject)
Definition field_obj.h:98
An effect object that moves and draws one sprite: its position, scale, velocity and target,...
Definition motobj.h:20
s32 z
16.16 fixed-point pixels
Definition motobj.h:25
s32 y
16.16 fixed-point pixels
Definition motobj.h:24
u16 angle
1/65536 turns
Definition motobj.h:22
s32 x
16.16 fixed-point pixels
Definition motobj.h:23
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
s32 z
16.16 fixed-point pixels
void * animation
its sprite, or its list of four, by animationKind
s32 x
16.16 fixed-point pixels
s32 y
16.16 fixed-point pixels
A scene event: its kind and detail, the trigger it answers, its condition and its value (a message or...
An actor a scene places: its sprite, the condition for placing it, how it behaves,...
Definition field_scene.h:81
The prefix that command handlers read from a field object's 0x70-byte slot.
Definition script.h:16
A FieldActor seen with the halfword at 0x5e (its lifetime), which FieldActor does not name.
One frame of a sparkle: its height offset and tile (fxdata.c).
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
Definition uiwindow.h:11
u16 y
tiles
Definition uiwindow.h:16
u16 flags
UI_WINDOW_ flags; 0 once closing or free.
Definition uiwindow.h:25
u16 x
tiles
Definition uiwindow.h:15
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
An object on the field, read as an actor or as an effect.
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...
Definition venus.c:163
void BattleFx_HalveDistanceToTarget(union FieldObject *fieldObject)
Per-frame update of an afterimage: closes half the distance to the object it is linked to.
Definition venus.c:220
void BattleFx_RunVenusDjinnCapture(s32 djinniId)
A Venus Djinni joins the party: it hops twice, spins and leaps, then shrinks away; the leader turns t...
Definition venus.c:15
void DisplayScroll_DisarmHBlankDma(void)
Stops the wavy background: removes its two callbacks and stops DMA 0.
void DisplayScroll_ArmHBlankDma(void)
Scheduler callback for the wavy background: restarts DMA 0 each frame to copy the current page's BG1 ...
Definition wave_scroll.c:11
void DisplayScroll_BuildAndSwapHBlankPage(void)
Scheduler callback for the wavy background: fills the hidden page with each scanline's BG3,...
Definition wave_scroll.c:44
void FieldMotes_Update(void)
Scheduler callback: the floating motes.
Definition weather.c:160
void FieldFx_ResumeLightning(void)
Restarts the lightning: the next flash in 128 frames, repeating.
Definition weather.c:458
void FieldFx_UpdateLightning(void)
Scheduler callback for the storm: every 150 to 550 frames lightning flashes the palette three times (...
Definition weather.c:61
void FieldMotes_Start(void)
Starts the floating motes (FieldMotes_Update): loads their tiles and puts 32 of them under the leader...
Definition weather.c:226
void FieldFx_StartLightning(void)
Starts the storm's lightning (FieldFx_UpdateLightning): builds the dark (0x10003) and lit (0x10005) p...
Definition weather.c:425
void BattleFx_StartBufferBlend(s32 from, s32 to)
Flashes the palette once, 120 frames from now, from palette from to palette to (BattleFx_BuildBuffer ...
Definition weather.c:467
void FieldFx_UpdateGroundParticles(void)
Scheduler callback: animates the ground particles.
Definition weather.c:12
void FieldEffect_UpdateSparkles(void)
Scheduler callback: the sparkles.
Definition weather.c:277
void FieldFx_StopLightning(void)
Stops the lightning: no flash for 0x7fff frames, and none after.
Definition weather.c:442
void FieldEffect_InitSparkles(void)
Starts the sparkles (FieldEffect_UpdateSparkles): loads their tiles and clears the 32 sparkles.
Definition weather.c:374
void FieldFx_StartGroundParticles(void)
Starts the ground particles (FieldFx_UpdateGroundParticles) with sound 170: loads their tiles and put...
Definition weather.c:105
void FieldFx_LastLightning(void)
One last flash of lightning in 12 frames, then no more.
Definition weather.c:450
void BattleFx_ShrinkObjectScaleUntilHalf(union FieldObject *fieldObject)
Shrinks a scene-selected Whirlwind target each frame; below half size, moves it to the origin,...
Definition whirlwind.c:159
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; ...
Definition whirlwind.c:95
void FieldFx_RunWhirlwind(void)
An orb is carried from the caster to 4 pixels above the effect's position over 10 frames,...
Definition whirlwind.c:189
void BattleFx_CircleAnchor(union FieldObject *fieldObject)
Per-frame update: circles the anchor at 8 pixels; after 121 frames it starts to wander (BattleFx_Wand...
Definition whirlwind.c:127
void FieldFx_RunWhirlwindOnTarget(s32 unused)
Runs Whirlwind using the target already stored in the effect scene.
Definition whirlwind.c:176
void FieldFx_UpdateParticleMotionAndScale(union FieldObject *object)
Per-frame update of a particle: moves by its velocity, slowing its x and z velocity a little,...
Definition whirlwind.c:48
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...
Definition whirlwind.c:65