Alchemy
Loading...
Searching...
No Matches

dispatch.c

Go to the documentation of this file.
1/// @file
2/// Running a field Psynergy by its kind, and helpers its effects share.
3/// Part of psynergy_effects.c, compiled only through it.
4
6
7// The dispatchers use the common effect scene. Individual update hooks use
8// their actor or EffectSlot contract; neither is a scene-script callback.
9
10/// Runs one step of the current Psynergy effect: 0 casts it with no target,
11/// 1 casts it on its target (secondObjectId), 2 finishes it and 3 runs its
12/// kind's extra handler. Exported as Field_DispatchTypeHandlerFar; Goma Cave's
13/// entrance imports it and passes 1 to play Whirlwind on the stump's ivy from
14/// its own event.
16 if (kind == 0)
18 else if (kind == 1)
20 else if (kind == 2)
22 else if (kind == 3)
24}
25
27
28/// Casts the current Psynergy effect with no target: runs the body of its
29/// kind (scene->fieldKind).
30///
31/// Called by Field_UsePsynergy when no scene event names a target
32/// (FLAG_PSYNERGY_TARGET clear), by Field_UseItem for an item with a field
33/// action, and by Field_DispatchTypeHandler(0). Halt also moves
34/// gGameState.pausedObject to the actor it stops.
35void BattleFx_Run(void) {
36 struct BattleFxScene *scene;
37 struct FieldWork *runtime;
38 s32 kind;
39 s32 targetId;
40 s32 nearestTargetId;
41
42 scene = *(gWorkSlot + HEAP_SLOT_FX);
43 runtime = *(gWorkSlot + HEAP_SLOT_EVENT);
44 kind = scene->fieldKind;
45 targetId = scene->secondObjectId;
46
47 switch (kind) {
48 case FIELD_KIND_MOVE:
50 return;
51 case FIELD_KIND_LIFT:
53 return;
56 return;
59 return;
62 return;
65 return;
68 return;
69 case FIELD_KIND_PLY:
71 return;
74 return;
77 return;
78 case FIELD_KIND_HALT:
79 // Free the object stopped before, then stop the nearest one.
80 if (gGameState.pausedObject != -1) {
83 }
84
85 nearestTargetId =
87 nearestTargetId = BattleFx_FilterObjectIdByFlags(nearestTargetId);
88 if (Scene_FindActorTalkEvent(nearestTargetId) != 0) {
91 BattleEffect_PauseObject(nearestTargetId);
92 gGameState.pausedObject = nearestTargetId;
93 } else {
95 }
96 return;
98 // The wave and colour effect, stopping a running Reveal first.
99 if (runtime->revealActive != 0)
101 RunSceneTransitionEffect(scene->firstObjectId, targetId);
102 return;
105 return;
106 case FIELD_KIND_CLOAK:
108 return;
111 return;
112 case FIELD_KIND_AVOID:
114 return;
115 }
116}
117
118/// Casts the current Psynergy effect on its target (secondObjectId): runs the
119/// handler of its kind.
120///
121/// Called by Field_UsePsynergy when a scene event names the target
122/// (FLAG_PSYNERGY_TARGET still set after the before event), and by
123/// Field_DispatchTypeHandler(1). Clears scene->enabled first: that is how the
124/// runners BattleFx_Run shares (Force, Frost, Ply, Whirlwind, Catch) tell that
125/// a scene event decides what happens to the target. Halt also moves
126/// gGameState.pausedObject to the target.
128 struct BattleFxScene *scene = *(gWorkSlot + HEAP_SLOT_FX);
129 struct FieldWork *runtime = *(gWorkSlot + HEAP_SLOT_EVENT);
130 s32 kind = scene->fieldKind;
131 s32 targetId = scene->secondObjectId;
132
133 scene->enabled = 0;
134 switch (kind) {
136 if (runtime->revealActive != 0)
139 ((struct ObjectRuntime *)scene->child)->movementState = 1;
140 RunSceneTransitionEffect(scene->firstObjectId, targetId);
141 break;
142 case FIELD_KIND_MOVE:
143 // Push the target with the direction keys.
145 break;
146 case FIELD_KIND_LIFT:
147 FieldFx_RunLiftOnTarget(targetId);
148 break;
149 case FIELD_KIND_CARRY:
151 break;
152 case FIELD_KIND_FORCE:
153 FieldFx_RunForceOnTarget(targetId);
154 break;
155 case FIELD_KIND_DOUSE:
156 FieldFx_RunDouseOnTarget(targetId);
157 break;
158 case FIELD_KIND_FROST:
159 FieldFx_RunFrostOnTarget(targetId);
160 break;
163 break;
164 case FIELD_KIND_HALT:
165 if (gGameState.pausedObject != -1) {
168 }
169 BattleEffect_PauseObject(targetId);
170 gGameState.pausedObject = targetId;
172 break;
173 case FIELD_KIND_PLY:
174 FieldFx_RunPlyOnTarget(targetId);
175 break;
178 break;
179 case FIELD_KIND_CATCH:
180 FieldFx_RunCatchOnTarget(targetId);
181 break;
184 break;
185 case FIELD_KIND_CLOAK:
187 break;
190 break;
191 case FIELD_KIND_AVOID:
193 break;
194 }
195}
196
197/// Finishes the current effect when it is Mind Read: ends the effect and lets
198/// its target move again, unless the target is the object kept stopped.
199/// Called by Field_UsePsynergy after the after event, and by
200/// Field_DispatchTypeHandler(2): Mind Read is the one kind whose effect stays
201/// up through the after event, the conversation it reads.
203 struct BattleFxScene *scene = gEffectWork;
204
205 if (scene->fieldKind == FIELD_KIND_MIND_READ) {
207 if (gGameState.pausedObject != scene->secondObjectId) {
208 ((struct ObjectRuntime *)scene->child)->movementState = 0;
209 }
210 }
211}
212
213/// The extra handler of Reveal, Cloak and Avoid: what each does when it ends.
214/// Called by Field_RunPsynergyEvents, which ends a Psynergy that runs out by
215/// itself, and by Field_DispatchTypeHandler(3).
217 u32 kind;
218
219 kind = ((struct BattleFxScene *)gEffectWork)->fieldKind;
220 switch (kind) {
223 return;
224 case FIELD_KIND_CLOAK:
226 return;
227 case FIELD_KIND_AVOID:
229 return;
230 }
231}
232
233/// Runs the event tied to an effect: a result below 0x10000 is a message,
234/// shown at target; a larger one is a routine, called with param and target
235/// (through r3). Afterwards, with FLAG_NOTHING_HAPPENS set, says "But nothing
236/// happens.".
237/// Returns 0.
238///
239/// Called by Field_UsePsynergy and Field_RunPsynergyEvents for the before and
240/// after events, and by Force, Frost and Reveal for the events of their own
241/// phases.
242s32 Field_RunEventAction(const void *event, s32 param, s32 target) {
243 s32 script;
244
245 if (event != NULL) {
246 // Every routine's address is above 0x10000, so one word holds either.
247 script = ((const struct EffectDescriptor *)event)->result;
248 if (script != 0) {
249 if (script < 0x10000) {
251 Event_SetMessageId(((const struct EffectDescriptor *)event)->result);
254 } else {
255 _call_via_r3(param, target);
256 }
257 }
260 UiText_ShowPositionedMessageAndWaitFar(MsgNothingHappens, 1);
262 }
263 }
264 return 0;
265}
266
267/// Per-frame update: sets every part of an object's sprite to param
268/// frame % 6, which cycles its colours. Assigned to the target while Move,
269/// Lift, Carry or Retreat holds it.
271 struct ObjectRuntime *owner = (struct ObjectRuntime *)fieldObject;
272 s32 kind;
273 struct AnimationObject *animation;
274 s32 initialCount;
275 s32 remainingParts;
276 struct AnimationEntry **parts;
277 struct AnimationEntry *spritePart;
278 /* FAKEMATCH(temporary): a pointer local to gFrameCount, volatile as it is
279 * declared, read on each pass; as gFrameCount read in the loop, 6 of 46
280 * instructions differ in tbs-en. */
281 volatile u32 *frameCount;
282 s32 param;
283
284 kind = owner->animationKind;
285 if (kind == 1) {
286 animation = owner->animation;
287 if (animation != 0 && animation->retainCacheEntry == 0) {
288 initialCount = animation->count;
289 if (initialCount != 0) {
290 frameCount = &gFrameCount;
291 parts = animation->entries;
292 remainingParts = initialCount;
293 do {
294 spritePart = *parts++;
295 param = *frameCount % 6;
296 remainingParts--;
297 spritePart->param = param;
298 } while (remainingParts != 0);
299 }
300 animation->dirty = 1;
301 }
302 }
303}
304
305/// Sends an object toward the point magnitude (16.16 pixels) away from it in
306/// direction angle: sets its move target. Carry, Lift, Douse, Move and the
307/// Djinni's hop into battle throw things this way.
309 s32 magnitude, s32 angle) {
310 s32 pos[3];
311
312 if (object != 0) {
313 SET_VECTOR(pos, object->x, object->y, object->z);
314 Vector_AddPolarOffset(magnitude, angle, pos);
315 Object_SetMoveTargetFar(object, pos[0], pos[1], pos[2]);
316 }
317}
318
319// From here on objects are passed in each function's own view of them.
320
321/// Counts the free blocks (owner 0xff) of the 512 resource blocks.
322/// BattleFx_LoadActionEffectResources subtracts this from VRAM_BLOCK_COUNT to
323/// record the blocks already occupied before the effect starts.
325 u8 *marker = gResourceBlockOwners;
326 s32 freeCount = 0;
327 s32 remaining = VRAM_BLOCK_COUNT;
328
329 do {
330 if (*marker++ == VRAM_BLOCK_OWNER_FREE) {
331 freeCount++;
332 }
333 remaining--;
334 } while (remaining != 0);
335 return freeCount;
336}
337
338/// Makes sourceSprite share sharedSprite's VRAM block, releasing its own;
339/// with no sharedSprite it keeps its block. Retains the shared cache entry and
340/// returns the sprite whose block is shared from now on (sharedSprite, or
341/// sourceSprite when there was none), or NULL for no sourceSprite. Chains of
342/// afterimages pass one block along this way. Each sprite retains the entry
343/// so releasing an afterimage cannot free graphics still used by the others.
344/// Sprite teardown leaves the shared entry for the caller to release.
345struct AnimationObject *
347 struct AnimationObject *sharedSprite) {
348 struct AnimationObject *shared;
349 struct AnimationObject *sprite;
350
351 sprite = sourceSprite;
352 shared = NULL;
353 if (sprite != NULL) {
354 if (sharedSprite == NULL) {
355 sprite->retainCacheEntry = 1;
356 } else {
357 Resource_ResetEntry(sprite->slot);
358 sprite->slot = sharedSprite->slot;
359 sprite->retainCacheEntry = 1;
360 sprite = sharedSprite;
361 }
362 shared = sprite;
363 }
364 return shared;
365}
366
367/// Creates an object for an effect, at the caster's ground height, with
368/// sprite priority 0 and animation 1. An object without animation is released
369/// and NULL returned. The effects spawn their orbs, hands and particles
370/// through it, and check for NULL: the object table may be full.
372 struct BattleFxScene *work = gEffectWork;
373 struct ObjectRuntime *object;
374
375 object = Object_CreateFar(kind, x, y, z);
376 if (object != NULL) {
377 if (object->animationKind == 0) {
379 return NULL;
380 }
381 object->terrainHeight =
382 ((struct ObjectRuntime *)work->mainObject)->terrainHeight;
383 object->flags = 4;
384 object->priorityFlags = 4;
385 ((struct AnimationObject *)object->animation)->image.priority = 0;
388 }
389 return object;
390}
391
392/// Sets the movement state and animation timer steps of every object but the
393/// player's and except. EventObject_Initialize stops them (state 1, speed 0)
394/// while an effect plays and lets them go again (state 0, speed 0x10).
396 s32 value) {
397 s16 *player;
398 struct ObjectRuntime *object;
399 s32 actorId;
400
401 actorId = 0;
402 player = (s16 *)gPlayerObjectId;
403 do {
404 object = ObjectTable_Get(actorId);
405 if (actorId != *player && object != NULL && object != except) {
406 object->movementState = state;
408 value);
409 }
410 actorId++;
411 } while (actorId <= OBJ_LAST);
412}
void Event_SetMessageId(s32 message)
The event command "set message": the number of the event's next message, written to work->message.
void * ObjectTable_Get(u32 actorIndex)
Returns the actor in slot index (0 to 65), or NULL.
Definition actors.c:462
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
u8 gPlayerObjectId[]
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
void FieldFx_RunCarry(void)
Carry cast with no target: objects appear above the caster and to either side, move apart and scatter...
Definition carry.c:285
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
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_EndCloak(void)
Ends Cloak: stops the tile check and makes the leader blink back into sight, clearing cloaked.
Definition cloak.c:77
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 FieldFx_RunDouseOnTarget(s32 unused)
Runs Douse cast on a target, through FieldFx_RunDouse.
Definition douse.c:102
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 ObjectDispatch_SetAnimationSpeedFar(struct DispatchObject *obj, s32 val)
void Object_SetMoveTargetFar(struct ObjectRuntime *object, s32 x, s32 y, s32 z)
s32 GameFlag_TestFar(s32 flag)
void UiText_ShowPositionedMessageAndWaitFar(s32 no, s32 flags)
#define FLAG_NOTHING_HAPPENS
Set before an action on the field; still set afterwards, nothing came of it and the game says so.
Definition flags.h:51
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
volatile u32 gFrameCount
Frames WaitFrames has finished.
struct GameState gGameState
void * gEffectWork
Slot 56: points to a scene-specific structure.
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 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
@ HEAP_SLOT_EVENT
Definition heap_state.h:40
void FieldFx_RunLift(void)
Lift cast with no target: objects appear above the caster and to either side, move apart and scatter ...
Definition lift.c:81
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
#define SET_VECTOR(v, x, y, z)
Sets the x, y and z of a three-part vector: a position about to be projected, a per-frame step,...
Definition macros.h:12
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,...
Definition math.c:23
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
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_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
s32 Scene_FindActorTalkEvent(s32 id)
Returns the talk event of actor id: for the actor the party has stopped, its kind 7 event if it has o...
Definition events.c:175
s32 Field_FindNearbyPsynergyTarget(s32 id, s32 kind)
Returns the actor nearest in front of actor id that a field Psynergy of the given kind can reach,...
Definition targets.c:110
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
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 FieldEvent_Begin(void)
The event command "begin event": closes any timed notice, stops the leader, resets the message and ti...
Definition events.c:91
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 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
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 BattleFx_SetupObjectPair(s32 userId, s32 targetId)
Records the caster and the target of an effect.
Definition setup.c:56
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
@ 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
What every part of psynergy_effects.c shares: its includes and the macros and types more than one par...
#define HEAP_SLOT_FX
the Psynergy effect's work (gWorkSlot[56], gEffectWork)
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_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
s32 _call_via_r3(s32, s32, s32, s32)
#define NULL
Definition bilibin.h:6
void * gWorkSlot[]
One animation layer of a sprite: its animation id, frames, running script and timer.
Definition animspr.h:37
u8 param
SpriteColorMode its pixels are drawn with; 0 when taken.
Definition animspr.h:45
u8 pos
byte offset of the next command in script
Definition animspr.h:51
u8 kind
The facing table its frames follow (from the metadata, or ANIM_CMD_SET_KIND); zero marks a free layer...
Definition animspr.h:44
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
Definition animspr.h:108
struct AnimationSpritePart image
Definition animspr.h:109
u8 slot
VRAM cache entry holding its tiles.
Definition animspr.h:112
struct AnimationEntry * entries[4]
its layers; empty ones null
Definition animspr.h:130
u8 count
layers in use, up to the last one present
Definition animspr.h:129
u8 retainCacheEntry
Keeps the VRAM cache entry when it is released or off screen.
Definition animspr.h:114
u8 dirty
nonzero redraws its pixels into VRAM when next drawn
Definition animspr.h:125
u16 priority
2 when created
Definition animspr.h:100
The work of a Psynergy effect scene: its caster and target, where it takes place, the map state it re...
Definition fx_scene.h:31
s16 firstObjectId
the caster's object id
Definition fx_scene.h:38
void * mainObject
the caster's object
Definition fx_scene.h:36
s16 fieldKind
the ability's field kind (FIELD_KIND_)
Definition fx_scene.h:41
void * child
the target's object, or NULL
Definition fx_scene.h:37
s8 enabled
Set at the start: Force then aims in front of the caster; cleared once the target has been dispatched...
Definition fx_scene.h:44
s16 secondObjectId
the target's object id, -1 for none
Definition fx_scene.h:39
A field object as the object dispatcher's far calls take it.
One of the scene's events (the same 12 bytes as struct SceneEvent).
Definition object.h:62
s32 result
below 0x10000 a message, else a function to call
Definition object.h:68
Full event work allocated by Field_RunScene (heap slot 27).
s16 revealActive
nonzero while Reveal is active
s16 pausedObject
Halt: the stopped object; -1 for none.
Definition game_state.h:113
s32 selectedActor
the leader: its unit and its actor
Definition game_state.h:59
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
s32 terrainHeight
16.16 fixed-point pixels
u8 movementState
nonzero skips its script and motion (paused)
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
u8 animationKind
Low four bits: 0 no sprite, 1 one sprite, 2 a group of up to four.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
signed short s16
Definition types.h:12
unsigned char u8
Definition types.h:11
An object on the field, read as an actor or as an effect.
#define OBJ_LAST
the last actor slot searched
Definition object.h:71
s32 Resource_ResetEntry(u32 no)
Frees cache entry no: its blocks go back and the entry is marked free (offset 0xffff).
Definition vram_cache.c:106
u8 gResourceBlockOwners[VRAM_BLOCK_COUNT]
@ VRAM_BLOCK_COUNT
Definition vram_tab.h:13
@ VRAM_BLOCK_OWNER_FREE
Definition vram_tab.h:15
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 FieldFx_RunWhirlwindOnTarget(s32 unused)
Runs Whirlwind using the target already stored in the effect scene.
Definition whirlwind.c:176