Alchemy
Loading...
Searching...
No Matches

healing.c

Go to the documentation of this file.
1/// @file
2/// Healing motes: Ply, Wish, Cure, Cure Poison.
3/// Part of effect.c, the battle effect object, compiled only through it.
4
6
7// Healing sparkles come in seven modes of one runner,
8// BattleFx_RunHealingMotes; the wrappers name the mode of each effect.
9//
10// PARTICLES holds the motes: 512 are scattered, and target n draws from the
11// 64 at n * 64 (32 of them, or 128 running into the next target's, by the
12// effect's variant). Each mote keeps its position relative to the target's
13// centre, so swirling the motes is a turn of the whole frame of reference,
14// and drawing one in is a step of 2 pixels a frame along the line to the
15// centre.
16
17#define HEALING_DJINNI_CELLS 0x1000 ///< the djinni picture in the sheet
18
19/// Ply: sparkles of light swirl around each target and close in on it, in the
20/// ice shard's or ice block's colours; the canvas is shown at its own width,
21/// centred on the first target.
22///
23/// Abilities: Ply, Ply Well, Pure Ply, Herb, Nut, Vial, Potion, Soothing Water
24/// (kind 22); Fizz (kind 204).
26 BattleFx_RunHealingMotes(effect, 0);
27}
28/// Wish (scattering style 1): healing motes tumble in from all around each
29/// target.
30///
31/// Abilities: Wish, Wish Well, Pure Wish (kind 23); Regenerate (kind 44);
32/// Reflect (kind 45); Spritz (kind 206).
34 BattleFx_RunHealingMotes(effect, 1);
35}
36/// Cure (mode 2): a ring of healing motes below each target closes in on it, in
37/// the blast sheet's colours.
38///
39/// Abilities: Cure, Cure Well, Potent Cure, Corn (kind 21); Worms (kind 352).
41 BattleFx_RunHealingMotes(effect, 2);
42}
43/// Cure Poison: sparkles twinkle around each target, four more a frame, and go
44/// out one by one instead of closing in.
45///
46/// Abilities: Cure Poison, Restore, Antidote, Elixir (kind 24).
48 if (effect->variant == 0) {
49 BattleFx_RunHealingMotes(effect, 3);
50 return;
51 }
52 BattleFx_RunHealingMotes(effect, 4);
53}
54
55/// Healing sparkles with scattering style 4, sent out from each target, as
56/// Cure Poison plays them for variants other than 0. No effect table entry
57/// reaches this one.
59 BattleFx_RunHealingMotes(effect, 4);
60}
61/// Tonic (scattering style 5): sparkles twinkle around each target, turning on
62/// two axes, and go out one by one; mode 5 plays as mode 4 does.
63///
64/// Abilities: Tonic (kind 208).
66 BattleFx_RunHealingMotes(effect, 5);
67}
68/// Psy Crystal: healing motes gather around each target in the Mars Djinni
69/// palette; with a prelude, a Mars Djinni appears first.
70///
71/// Abilities: Psy Crystal, Adept Ring, Ember (kind 212).
73 BattleFx_RunHealingMotes(effect, 6);
74}
75#define HEALING_MOTES 512 ///< motes in PARTICLES
76#define HEALING_SLOTS 64 ///< particles reserved for each target
77#define HEALING_STAGGER 8 ///< frames between one target's start and the next
78#define HEALING_SOUND_DELAY 20 ///< frames from a target's start to its sound
79#define HEALING_TINT_DELAY 36 ///< frames from a target's start to its tint
80#define HEALING_TINT_FRAMES 28 ///< frames a target stays tinted white
81#define HEALING_DAMAGE_FRAME 40 ///< the frame the battle shows the recovery
82
83/// Healing sparkles: motes of light scattered around each target swirl in
84/// towards it, one target every 8 frames, with the recovery sound on each
85/// target's 20th frame and a tint on its 36th.
86///
87/// Called by the wrappers above: BattleFx_RunPly (mode 0), BattleFx_RunWish
88/// (1), BattleFx_RunCure (2), BattleFx_RunCurePoison (3 or 4),
89/// BattleFx_RunTonic (5) and BattleFx_RunPsyCrystal (6).
90///
91/// Sets work->effect, overwrites PARTICLES 0 to 511 and the first 64 colours
92/// of the background palette, decodes into the battle sheet slot and
93/// work->sheet, and in mode 0 writes REG_BG2X and REG_BG2PA. After a djinni
94/// prelude it clears effect->variant, so the variant's mote count and
95/// resource fall back to variant 0's. The transfer callback it adds is
96/// removed again at the end, with the blitters and the canvas layer.
97///
98/// effect: the targets. With prelude 1, a djinni (Mars in mode 6, Mercury
99/// otherwise) appears first, sways and rises. variant picks the
100/// motes per target (0: 32, 2: 128, others: 64) and, in modes 0,
101/// 1, 3, 4 and 5, the resource (0: ice shard, others: ice block).
102/// mode: how the motes scatter and turn. Only mode 0 shows the canvas at
103/// its own width, centred on the first target. Modes 3, 4 and 5 put
104/// the motes out one by one instead of drawing them in; modes 0, 3,
105/// 4 and 5 draw sparkle dots. Mode 6 takes the Mars resource, mode 2
106/// the blast resource.
108 void **slots;
109 void **cursor;
110 struct BattleEffectWork *work;
111 void *canvas;
112 s32 frameCount;
113 s32 member;
114 u8 *sprites;
115 s32 motesPerTarget;
116 s32 canvasShiftX;
117 s32 doubleWidth;
118 DrawRectangle *draw;
119 s32 frame;
120 s32 i;
121 u8 *resource;
122 struct EffectPosition base;
123 struct EffectPosition screen;
124 s32 point[3];
125 s32 originX;
126 s32 originY;
127 BlitterPair blit;
128
129 EFFECT_GET_SLOTS(slots, cursor, work, canvas);
130 sprites = EFFECT_SLOT(slots, HEAP_SLOT_BATTLE_SHEET);
131 canvasShiftX = 0;
132 work->effect = effect;
134
135 // Bring out the djinni; origin receives where it appears. Modes 0 and 6
136 // pass 0 as the entrance's fourth argument, the others 1.
137 if (work->effect->prelude == 1) {
138 s32 kind = mode == 6 ? 2 : 1;
139
140 if (mode == 6 || mode == 0)
141 BattleFx_RunDjinniEntrance(effect, kind, work->effect->side, 0, &originX,
142 &originY);
143 else
144 BattleFx_RunDjinniEntrance(effect, kind, work->effect->side, 1, &originX,
145 &originY);
146 work->effect->variant = 0;
147 }
148
149 // Mode 0 shows the canvas at its own width, shifted so the first target
150 // is at its centre (64); the others keep it at double width.
151 if (mode == 0) {
153 canvasShiftX = 64 - base.x;
154 REG_BG2X = canvasShiftX << 8;
155 REG_BG2PA = Q_8_8(1);
156 doubleWidth = 0;
157 } else {
158 doubleWidth = 1;
159 }
160
161 // Pictures, and the resource whose first 128 bytes are the palette.
164 if (mode <= 1 || mode == 3 || mode == 4 || mode == 5) {
165 if (work->effect->variant == 0)
167 else
169 } else if (mode == 6) {
171 } else {
173 }
174 Iwram_CopyWords((void *)BG_PLTT, resource, 128);
175
176 // The djinni: 40x40 at the canvas's own width, the small 20x40 picture at
177 // double width.
178 if (doubleWidth == 0) {
179 if (mode == 6)
181 else
183 } else {
184 if (mode == 6)
186 else
187 resource =
189 }
190 resource += 128;
191 Resource_DecodeType01(resource, work->sheet + HEALING_DJINNI_CELLS);
193 draw = blit); // [0] maximum, [1] additive
194
195 // Scatter the motes around the centre (16.16, relative to the point the
196 // frame loop centres on). Modes 3 to 5 end 16 frames sooner than the
197 // others, as their motes go out rather than travel in.
198 if (mode == 0 || mode == 6) {
199 // x and z within 64 pixels, y 32 to 95 pixels up.
200 for (i = 0; i != HEALING_MOTES; i++) {
201 struct EffectStep *spark = &PARTICLES[i];
202
203 SET_POSITION(spark, ((Random16() & 0xff) - 127) << 15,
204 ((Random16() & 0x7f) + 64) << 15,
205 ((Random16() & 0xff) - 127) << 15);
206 spark->variant = 0;
207 }
208 frameCount = work->effect->count * HEALING_STAGGER + 88;
209 } else if (mode == 1) {
210 // All three within 64 pixels.
211 for (i = 0; i != HEALING_MOTES; i++) {
212 struct EffectStep *spark = &PARTICLES[i];
213
214 SET_POSITION(spark, ((Random16() & 0xff) - 127) << 15,
215 ((Random16() & 0xff) - 127) << 15,
216 ((Random16() & 0xff) - 127) << 15);
217 spark->variant = 0;
218 }
219 frameCount = work->effect->count * HEALING_STAGGER + 88;
220 } else if (mode == 2) {
221 // A ring of radius 32 to 95 pixels, 50 pixels down.
222 for (i = 0; i != HEALING_MOTES; i++) {
223 struct EffectStep *spark = &PARTICLES[i];
224 s32 heading = Random16() & 0xffff;
225 s32 radius = (Random16() & 63) + 32;
226
227 SET_POSITION(spark, Trig_Sin(heading) * radius, -50 << 16,
228 Trig_Cos(heading) * radius);
229 spark->velocityY = ((Random16() & 31) + 32) << 13;
230 spark->variant = 0;
231 }
232 frameCount = work->effect->count * HEALING_STAGGER + 88;
233 } else if (mode == 3) {
234 // x and z within 64 pixels, y within 32.
235 for (i = 0; i != HEALING_MOTES; i++) {
236 struct EffectStep *spark = &PARTICLES[i];
237
238 SET_POSITION(spark, ((Random16() & 0xff) - 127) << 15,
239 ((Random16() & 0xff) - 127) << 14,
240 ((Random16() & 0xff) - 127) << 15);
241 spark->variant = 0;
242 }
243 frameCount = work->effect->count * HEALING_STAGGER + 72;
244 } else {
245 // All three within 64 pixels.
246 for (i = 0; i != HEALING_MOTES; i++) {
247 struct EffectStep *spark = &PARTICLES[i];
248
249 SET_POSITION(spark, ((Random16() & 0xff) - 127) << 15,
250 ((Random16() & 0xff) - 127) << 15,
251 ((Random16() & 0xff) - 127) << 15);
252 spark->variant = 0;
253 }
254 frameCount = work->effect->count * HEALING_STAGGER + 72;
255 }
256
257 // Motes for each target: 32 for variant 0, 128 for variant 2, else 64.
258 motesPerTarget = 64;
259 if (work->effect->variant == 0)
260 motesPerTarget = 32;
261 else if (work->effect->variant == 2)
262 motesPerTarget = 128;
263 // Each transfer keeps 75% of every canvas pixel, so the motes leave
264 // trails.
266 work->transferValue = 75;
269
270 for (frame = 0; frame != frameCount; frame++) {
271 struct BattleCamera *camera = gCameraWork;
272
273 if (frame == HEALING_DAMAGE_FRAME)
275
276 // The djinni sways from side to side and, after 32 frames, rises 2 pixels
277 // a frame. For the first 4 frames it is also added on top.
278 if (work->effect->prelude == 1) {
279 if (doubleWidth == 0) {
280 s32 x =
281 ((Trig_Sin(frame << 11) * 20) >> 16) + originX + canvasShiftX - 20;
282 s32 y = ((Trig_Cos(frame << 11) * 4) >> 16) + originY - 24;
283
284 if (frame > 32)
285 y = y - frame * 2 + 64;
286 blit[0](canvas, work->sheet + HEALING_DJINNI_CELLS, x, y, 40, 40);
287 if (frame <= 3)
288 draw[1](canvas, work->sheet + HEALING_DJINNI_CELLS, x, y, 40, 40);
289 } else {
290 s32 x = ((Trig_Sin(frame << 11) * 10) >> 16) + originX / 2 - 10;
291 s32 y = ((Trig_Cos(frame << 11) * 4) >> 16) + originY - 24;
292
293 if (frame > 32)
294 y = y - frame * 2 + 64;
295 blit[0](canvas, work->sheet + HEALING_DJINNI_CELLS, x, y, 20, 40);
296 if (frame <= 3)
297 draw[1](canvas, work->sheet + HEALING_DJINNI_CELLS, x, y, 20, 40);
298 }
299 }
300
301 EFFECT_FOR_EACH_TARGET(member, work->effect) {
302 struct MotionObject *object =
304 s32 start = member * HEALING_STAGGER;
305
306 // Centre on the point 40 pixels above the target.
308 SET_VECTOR(point, object->x, 40 << 16, object->z);
310 if (frame == start + HEALING_SOUND_DELAY)
312 if (frame == start + HEALING_TINT_DELAY)
314 SPRITE_COLOR_WHITE, -1, member,
316
317 // From the target's start, its frame of reference turns 1/128 of a
318 // circle a frame. Mode 2 offsets the yaw by 40 frames a target where
319 // the others offset it by their start, and mode 1 does not offset it.
320 if (frame > start) {
321 if (mode == 0 || mode == 6) {
322 SceneTransform_ApplyYaw((frame - member * HEALING_STAGGER) << 9);
323 } else if (mode == 1) {
324 SceneTransform_ApplyPitch(frame << 9);
325 SceneTransform_ApplyRoll(frame << 9);
326 } else if (mode == 2) {
327 SceneTransform_ApplyYaw((frame - member * 40) << 9);
328 } else if (mode == 3) {
329 SceneTransform_ApplyYaw((frame - member * HEALING_STAGGER) << 9);
330 } else {
331 SceneTransform_ApplyYaw((frame - member * HEALING_STAGGER) << 9);
332 SceneTransform_ApplyPitch((frame - member * HEALING_STAGGER) << 9);
333 }
334
335 // Four motes appear each frame; in modes 3, 4 and 5 mote i goes out at
336 // frame start + i / 2 + 32.
337 for (i = 0; i != motesPerTarget; i++) {
338 struct EffectStep *spark = &PARTICLES[member * HEALING_SLOTS + i];
339 s32 endFrame;
340
341 if (mode == 3 || mode == 4 || mode == 5)
342 endFrame = start + i / 2 + 32;
343 else
344 endFrame = 0x10000;
345 if (frame > start + i / 4 && frame < endFrame) {
346 s32 xx = (spark->x >> 8) * (spark->x >> 8);
347 s32 yy = (spark->y >> 8) * (spark->y >> 8);
348 s32 zz = (spark->z >> 8) * (spark->z >> 8);
349 // The distance to the centre in steps of 2 pixels: dividing each
350 // axis by it moves the mote 2 pixels along the line.
351 s32 distance = Iwram_Sqrt(xx + yy + zz) >> 9;
352
353 if (distance != 0) {
354 s32 size;
355
356 EffectPosition_ProjectPoint(spark, &screen);
357 if (mode == 0)
358 screen.x += canvasShiftX;
359 else
360 screen.x >>= 1;
361 screen.y += 16;
362
363 // Size 3 to 1 over depths 314 to 634 (mode 0 cycles through 9
364 // sizes).
365 CLAMP(screen.depth, 314, 634);
366 size = 3 - (screen.depth - 314) / 128;
367 if (mode == 0)
368 size = (i * 4 + frame) % 9;
369 if (mode == 0 || mode == 3 || mode == 4 || mode == 5) {
370 u8 *cell = work->sheet + gBattleFx_PuffCells[size];
371 u32 edge = gBattleFx_PuffSizes[size];
372 u32 half = edge >> 1;
373
374 draw[1](canvas, cell, screen.x - half, screen.y - half, edge,
375 edge);
376 } else {
377 EFFECT_DRAW_MOTE(draw[1], canvas, sprites, screen.x, screen.y,
378 size);
379 }
380
381 // Modes 0 to 2 and 6 draw the mote in; 3 to 5 leave it where
382 // it is until it goes out.
383 if (mode <= 2 || mode == 6) {
384 spark->x -= spark->x / distance;
385 spark->y -= spark->y / distance;
386 spark->z -= spark->z / distance;
387 }
388 }
389 }
390 }
391 }
392 }
393 EFFECT_END_FRAME(work);
394 }
395
397}
398
399#undef HEALING_DJINNI_CELLS
400#undef HEALING_MOTES
401#undef HEALING_SLOTS
402#undef HEALING_STAGGER
403#undef HEALING_SOUND_DELAY
404#undef HEALING_TINT_DELAY
405#undef HEALING_TINT_FRAMES
406#undef HEALING_DAMAGE_FRAME
@ SPRITE_COLOR_WHITE
solid colour 15, white
Definition animspr.h:26
struct BattleCamera * gCameraWork
BattleEffectDrawRectangle DrawRectangle
#define EFFECT_FOR_EACH_TARGET(i, effect)
Loops i over the effect's targets, effect->actors[0] to effect->actors[effect->count - 1]: the loops ...
void BattleFx_ProcessPendingGraphicsTransfer(void)
Copies the canvas to VRAM once the effect has finished drawing a frame (transferPending): the 128x128...
Definition canvas.c:103
void BattleFx_BeginCanvasLayer(s32 bgControl)
Opens the canvas layer: starts the background palette fade, makes BG2 the canvas, alpha-blended over ...
Definition canvas.c:314
void Resource_LoadAndDecompress(s32 id, void *dst, s32 skipPalette, s32 copyPalette)
Decompresses a resource whose first 128 bytes may be a palette.
void ObjectGroup_UpdateMembers(s32 actorId, s32 palette, s32 animation, s32 timerSlot, s32 timerFrames)
Updates every animation group of one battler's object.
Definition dispatch.c:254
What every part of the battle effect object shares: its includes, macros and frame-loop helpers.
#define EFFECT_DRAW_MOTE(draw, canvas, sheet, x, y, size)
Particle sheets hold ten mote cells, 1x2 to 10x20 pixels.
@ CANVAS_COPY_AND_FADE
copy, keeping 50% or 75% (transferValue) of each pixel in the canvas for the next frame
#define EFFECT_CALLBACK_ORDER
The scheduler order of every per-frame effect callback (Scheduler_AddOrUpdateCallback sorts the frame...
#define EFFECT_SLOT(slots, slot)
A work slot read through a pointer to the effect's own slot, gWorkSlot[HEAP_SLOT_BATTLE_EFFECT].
#define EFFECT_FINISH_CANVAS()
The usual end of a canvas effect: stops the transfer callback before freeing what it reads,...
#define EFFECT_SHOW_DAMAGE(hitSound)
Lets the battle show the damage: resumes its paused playback, which plays hitSound (an SE_ id; 0 keep...
#define EFFECT_GET_SLOTS(slots, cursor, work, canvas)
Starts at the effect's entry in the whole work-slot array.
#define EFFECT_END_FRAME(work)
The usual end of an effect frame: counts down the targets' flash timers (ObjectGroup_TickMemberTimers...
#define EFFECT_VIEW_FROM_CAMERA(camera)
Starts a frame's 3D projection from the battle camera: resets the transform, then looks from camera->...
u8 gBattleFx_PuffSizes[]
Each puff cell's side.
u16 gBattleFx_PuffCells[]
Nine square puff cells, read by the falling, frost, healing, Djinni heal and Boreas parts.
struct BattleObj * GetBattleObjectSlotFar(s32 objectId)
Far call to BattleObjGet.
void AudioCommand_PlayFar(s32 id)
s32 Trig_Cos(s32 angle)
s32 Trig_Sin(s32 angle)
#define HEALING_SOUND_DELAY
frames from a target's start to its sound
Definition healing.c:78
void BattleFx_RunCure(struct BattleEffectArgument *effect)
Cure (mode 2): a ring of healing motes below each target closes in on it, in the blast sheet's colour...
Definition healing.c:40
#define HEALING_MOTES
motes in PARTICLES
Definition healing.c:75
void BattleFx_RunPsyCrystal(struct BattleEffectArgument *effect)
Psy Crystal: healing motes gather around each target in the Mars Djinni palette; with a prelude,...
Definition healing.c:72
void BattleFx_RunCurePoison(struct BattleEffectArgument *effect)
Cure Poison: sparkles twinkle around each target, four more a frame, and go out one by one instead of...
Definition healing.c:47
#define HEALING_DJINNI_CELLS
the djinni picture in the sheet
Definition healing.c:17
#define HEALING_SLOTS
particles reserved for each target
Definition healing.c:76
UNUSED void BattleFx_RunHealingMotesMode4(struct BattleEffectArgument *effect)
Healing sparkles with scattering style 4, sent out from each target, as Cure Poison plays them for va...
Definition healing.c:58
void BattleFx_RunHealingMotes(struct BattleEffectArgument *effect, u32 mode)
Healing sparkles: motes of light scattered around each target swirl in towards it,...
Definition healing.c:107
#define HEALING_TINT_FRAMES
frames a target stays tinted white
Definition healing.c:80
void BattleFx_RunPly(struct BattleEffectArgument *effect)
Ply: sparkles of light swirl around each target and close in on it, in the ice shard's or ice block's...
Definition healing.c:25
#define HEALING_TINT_DELAY
frames from a target's start to its tint
Definition healing.c:79
#define HEALING_DAMAGE_FRAME
the frame the battle shows the recovery
Definition healing.c:81
void BattleFx_RunTonic(struct BattleEffectArgument *effect)
Tonic (scattering style 5): sparkles twinkle around each target, turning on two axes,...
Definition healing.c:65
void BattleFx_RunWish(struct BattleEffectArgument *effect)
Wish (scattering style 1): healing motes tumble in from all around each target.
Definition healing.c:33
#define HEALING_STAGGER
frames between one target's start and the next
Definition healing.c:77
@ HEAP_SLOT_BATTLE_SHEET
Definition heap_state.h:44
#define Q_8_8(n)
The BG2/BG3 affine matrix entries are signed 8.8 fixed point: texels stepped per screen pixel.
Definition io_reg.h:59
#define REG_BG2X
Definition io_reg.h:65
#define BG_PLTT
Definition io_reg.h:157
#define REG_BG2PA
Definition io_reg.h:61
static s32 Iwram_CopyWords(volatile void *destination, const volatile void *source, s32 size)
Definition iwram_call.h:85
static s32 Iwram_Sqrt(s32 value)
Definition iwram_call.h:63
#define SET_POSITION(p, px, py, pz)
Sets the position or the velocity of a particle, a piece of debris or an object in one statement.
Definition macros.h:16
#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
#define CLAMP(v, low, high)
Keeps v within low to high, the low bound tested first.
Definition macros.h:23
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
Definition math.c:10
void BattleFx_FetchRectangleBlitters(s32 flip, BlitterPair out)
Builds the two usual routines that draw onto the 128x128 canvas, both clipped on both axes.
void EffectPosition_ProjectScaledBattler(s32 id, struct EffectPosition *position)
The screen position of a battler, scaled for the battle view, 16 pixels higher.
Definition positions.c:88
s32 EffectPosition_ProjectPoint(const void *point, struct EffectPosition *position)
Projects a point in the current transform onto the screen, 16 pixels higher, and returns the projecti...
Definition positions.c:64
void BattleFx_RunDjinniEntrance(struct BattleEffectArgument *effect, s32 mode, s32 side, s32 anchor, s32 *outX, s32 *outY)
Djinni entrance: sparks swirl around a point that travels from the user to the goal and gather into t...
Definition projectiles.c:29
char ResourceId_MarsDjinnSmallSheet
char ResourceId_SparkleDots
char ResourceId_MercuryDjinnSmallSheet
char ResourceId_MarsDjinnSheet
char ResourceId_BlastSheet
char ResourceId_IceShardSheet
char ResourceId_ParticleSpritesA
char ResourceId_IceBlockSheet
char ResourceId_MercuryDjinnSheet
s32 Resource_DecodeType01(const void *source, void *destination)
Decodes a type-01 resource and returns its unpacked byte count.
Definition decompress.c:31
s32 Scheduler_AddOrUpdateCallback(SchedulerCallback callback, s32 order)
Schedules callback with order, or gives a task already running it the new order, and re-sorts the tab...
Definition scheduler.c:102
#define SE_RECOVERY
Definition songs.h:119
The battle camera: its eye, the focus it turns about, and its pitch, yaw and distance.
The command shared by an effect's caller, dispatcher and handlers.
s32 side
1 when the targets are the party, 0 for enemies
s16 actors[8]
the targets' unit ids, count of them
s32 variant
the ability's size, from 0 (Quake, then Earthquake)
s32 count
targets in actors, at least 1
s32 prelude
1 plays a prelude: in some effects a Djinni appears
The running battle effect's work: its canvas image, 64 particles, the display registers it stages and...
s32 frame
frame counter some effects keep, from 0
s32 transferMode
How the canvas transfer callbacks treat the canvas after each copy (enum CanvasTransferMode in effect...
s32 transferValue
The transfer mode's argument: the fill value, the share kept (50 or 75 percent) or the darken or brig...
struct BattleEffectArgument * effect
the command being run
struct MotionObject * object
NULL once released.
A point projected onto the screen, with its depth.
Definition effect_step.h:46
s32 y
screen pixels
Definition effect_step.h:59
s32 depth
projected depth, larger further away
Definition effect_step.h:60
s32 x
screen pixels
Definition effect_step.h:58
A moving point of an effect: its position, its velocity and a value each effect uses its own way (a s...
Definition effect_step.h:13
s32 z
16.16 fixed-point pixels
Definition effect_step.h:26
s32 variant
each effect's own: a size, a countdown, -1 for idle
Definition effect_step.h:31
s32 x
16.16 fixed-point pixels
Definition effect_step.h:24
s32 y
16.16 fixed-point pixels
Definition effect_step.h:25
s32 velocityY
16.16 fixed-point pixels per frame
Definition effect_step.h:29
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 x
16.16 fixed-point pixels
Definition motobj.h:23
void * Resource_GetTableEntry(s32 index)
Returns the ROM address of resource index from the resource directory.
Definition system.c:150
void SceneTransform_ApplyYaw(s32 angle)
Rotates gTransform about the Y axis by angle.
Definition transform.c:113
void SceneTransform_ApplyPitch(s32 angle)
Rotates gTransform about the X axis by angle.
Definition transform.c:97
void SceneTransform_ApplyPosition(const s32 *position)
Translates gTransform by position (x, y, z in 16.16).
Definition transform.c:145
void SceneTransform_ApplyRoll(s32 angle)
Rotates gTransform about the Z axis by angle.
Definition transform.c:129
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
#define UNUSED
Definition types.h:22
unsigned char u8
Definition types.h:11
#define PARTICLES
The map cell buffer (gMapCellBuffer), which the effects borrow, has two views here: Ram_MapCellBuffer...
Definition effect.h:221
DrawRectangle BlitterPair[2]
A blitter pair: [0] built in HEAP_SLOT_BLITTER and [1] in HEAP_SLOT_BLITTER_ALTERNATE (BattleFx_Fetch...
Definition effect.h:244