Alchemy
Loading...
Searching...
No Matches

boreas.c

Go to the documentation of this file.
1/// @file
2/// The Boreas summon.
3/// Part of effect.c, the battle effect object, compiled only through it.
4
6
7// The smoke trails behind the spray, after the 128 particles in PARTICLES.
8#define BOREAS_ICE_BLOCK_TRAILS \
9 ((struct EffectStep *)(Ram_MapCellBuffer + 0xe00))
10#define BOREAS_BIG_BLOCK_CELLS 0xc46 ///< the dropping 24x48 ice block
11#define BOREAS_FALLING_BLOCK_CELLS 0x14f9 ///< the diagonal 40x80 ice block
12
13/// gBoreas_Points has an x and a y for each rock.
14#define BOREAS_POINT_X(rock) gBoreas_Points[rock][0]
15#define BOREAS_POINT_Y(rock) gBoreas_Points[rock][1]
16
17/// Rocks and ice blocks: a window opens on rocks that crumble, a big ice block
18/// drops and throws up spray; then ice blocks rain down on the targets, and
19/// boulders crumble into bouncing chips.
20///
21/// Abilities: Boreas (scene kind 10).
22///
23/// The longest of the effects, in two halves. The first (288 frames, which A
24/// or B cuts short after frame 16) opens a window on a field of 16 rocks over
25/// the violet sky and nine animation objects; the rocks crumble in three
26/// waves (frames 32, 64 and 104), throwing up chips, a big ice block drops in
27/// on frames 160 to 175 and, from frame 224, bursts into spray trailed by
28/// smoke. The second (146 frames) gives the battle background back and rains
29/// ice blocks on the targets while boulders rise, crumble on frame 72 and
30/// bounce on the ground; the targets tint blue from frame 32 and the damage
31/// shows on frame 96.
32///
33/// Particles, by half: in the first, PARTICLES 0 to 63 are the chips (screen
34/// pixels in 16.16; a negative variant is one not yet thrown), then 0 to 127
35/// the spray, with its smoke at BOREAS_ICE_BLOCK_TRAILS; in the second,
36/// work->particles 0 to 63 are the falling ice blocks and then the boulder
37/// chips, and PARTICLES 0 to 63 the smoke puffs, in whole pixels.
38///
39/// Also clears background colours 0 and 1 for the wipe and then loads the
40/// ice block palette over the first 64, writes the window registers and the
41/// window-edge table at Ram_MapCellBuffer (through
42/// BattleFx_BuildWindowEdgeTable), gBgScroll[1] for the shake,
43/// gProjection.centerY and work->shakeFrames; it releases the nine objects
44/// before the second half and its callbacks and blitters at the end.
46 static struct SpriteScale unitScale = {{{0x10000, 0x10000}}};
47 // A copy of gBoreas_Points that nothing reads.
48 UNUSED s32 rockPoints[32][2];
49 struct SpritePlacement position;
50 void *canvas;
51 struct BattleEffectWork *work;
52 s32 frame;
53 DrawRectangle draw;
54 DrawRectangle drawAlt;
55 u8 *puffSheet;
56 s32 edgeSpeed;
57 s32 row;
58 u32 *slots;
59 s32 count;
60 s32 i;
61 s32 j;
62 s32 shakeX;
63 s32 shakeY;
64 s32 y;
65 s32 dropFrame;
66 struct EffectStep *spray;
67 struct EffectStep *trail;
68 struct SpriteScale scale;
69
71 canvas = (void *)slots[0];
73 puffSheet = (u8 *)CANVAS_SLOT(slots, HEAP_SLOT_BATTLE_SHEET);
74 edgeSpeed = 1;
75 work->effect = effect;
78 PLTT_BACKDROP = 0;
79 *(u16 *)&BG_PLTT[1] = 0; // background palette 0, colour 1
85 REG_WIN0H = WIN_RANGE(240, 240); // an empty window
93 gProjection.centerY = 240;
95 WaitFrames(1);
97 BattleFx_SpawnObjects(9, 0x174, 1);
100
101 // Mark the chips unthrown. Their positions here are never drawn: each chip
102 // gets a new one when its wave throws it.
103 for (i = 0; i != 64; i++) {
104 PARTICLES[i].x = (Random16() & 63) + 32;
105 PARTICLES[i].y = (Random16() & 31) + 120;
106 PARTICLES[i].variant = -1;
107 }
108
109 for (i = 0; i != 32; i++) {
110 rockPoints[i][0] = BOREAS_POINT_X(i);
111 rockPoints[i][1] = BOREAS_POINT_Y(i);
112 }
113
115
116 //------------------------------------------------------------------
117 // First half: the rocks, the big ice block and the spray (A or B skips
118 // to the second half).
119 //------------------------------------------------------------------
120 for (frame = 0; frame != 288; frame++) {
121 count = 16;
122 if ((gKeysRepeat & (KEY_A | KEY_B)) && frame > 16) {
123 break;
124 }
125
126 // Open the window from the left: its right edge speeds up, and each line
127 // lags 0 to 63 pixels behind it.
128 if (frame >= 0 && frame < 16) {
129 u16 *edge = (u16 *)Ram_MapCellBuffer;
130 if (frame == 1) {
131 u8 *inset = Ram_MapCellBuffer + 2;
132 s32 line;
133 for (line = 0; line != 128; line++) {
134 inset[line] = Random16() & 63;
135 }
136 *edge = 0;
139 }
140 *edge += edgeSpeed;
141 edgeSpeed += 3;
142 if (frame == 15) {
144 }
145 }
146
147 // The rocks still standing: 16, then 10 from frame 32, 6 from frame 64
148 // and none from frame 104, as each wave crumbles into chips.
149 if (frame > 103) {
150 count = 0;
151 } else if (frame > 63) {
152 count = 6;
153 } else if (frame > 31) {
154 count = 10;
155 }
156
157 // Shake: random until frame 167, from the table on frames 176 to 179,
158 // when the big block lands. The backdrop (BG1) sits 32 lines down, and
159 // the rocks and objects are drawn offset by the same amount, so they
160 // shake with it.
161 if (frame <= 167) {
162 shakeX = (Random16() & 3) - 1;
163 shakeY = (Random16() & 3) - 1;
164 gBgScroll[1].x = shakeX;
165 gBgScroll[1].y = shakeY + 32;
166 } else {
167 shakeX = 0;
168 shakeY = 0;
169 gBgScroll[1].x = 0;
170 gBgScroll[1].y = 32;
171 }
172 if (frame >= 176 && frame < 180) {
173 shakeX = -gBoreas_ShakeOffsets[frame - 176];
174 shakeY = gBoreas_ShakeOffsets[frame - 176];
175 gBgScroll[1].x = shakeX;
176 gBgScroll[1].y = shakeY + 32;
177 }
178
179 for (i = 0; i != count; i++) {
180 s32 cell = i % 3;
181 draw(canvas, work->sheet + gBoreas_RockCells[cell],
182 BOREAS_POINT_X(i) - shakeX,
183 BOREAS_POINT_Y(i) - gBoreas_RockHeights[cell] - shakeY,
185 }
186
187 // Lay out the 3x3 objects 32 pixels apart, moved against the shake. They
188 // come to the front on frame 174, and from frame 209 the third one
189 // animates.
190 scale = unitScale;
191 if (frame == 174) {
192 for (i = 0; i != 9; i++) {
193 work->objects[i]->image.priority = 0;
194 }
195 }
196 if (frame > 208) {
198 gBoreas_Animations[(frame / 4) & 3]);
199 }
200
201 scale.x = 0x10000;
202 scale.y = 0x10000;
203 position.groundHeight = 0;
204 position.height = 255 << 16;
205 for (row = 0; row != 3; row++) {
206 for (j = 0; j != 3; j++) {
207 position.x = (j * 32 + 144 - shakeX) << 16;
208 position.y = (row * 32 + 76 - shakeY) << 16;
209 Object_ApplyProjectedPlacementFar(work->objects[row * 3 + j], &position,
210 &scale, 0);
211 }
212 }
213
214 // The big ice block (24x48) falls from the top right on frames 160 to
215 // 175 and sinks slowly from frame 208.
216 dropFrame = frame - 160;
217 if (dropFrame >= 0 && dropFrame < 158) {
218 s32 sinkFrame = frame - 208;
219 s32 blockX = 80;
220 s32 blockY = 8;
221 if (frame <= 175) {
222 blockX = 96 - dropFrame;
223 blockY = dropFrame * 4 - 56;
224 } else if (frame > 208) {
225 blockY = sinkFrame / 4 + 8;
226 }
227 drawAlt(canvas, work->sheet + BOREAS_BIG_BLOCK_CELLS, blockX, blockY, 24,
228 48);
229 }
230
231 if (frame == 32) {
233 }
234 if (frame == 64) {
236 }
237 if (frame == 104) {
239 }
240 if (frame == 176) {
242 }
243 if (frame == 226) {
245 }
247
248 // Each time rocks crumble, throw up 32 chips: the first and third waves
249 // reuse chips 0 to 31, the second takes 32 to 63, and all fall at 1/8
250 // pixel a frame per frame.
251 if (frame == 32) {
252 for (i = 0; i != 32; i++) {
253 PARTICLES[i].x = ((Random16() & 31) + 68) << 16;
254 PARTICLES[i].y = ((Random16() & 31) + 8) << 16;
255 PARTICLES[i].velocityX = ((Random16() & 127) - 63) << 11;
256 PARTICLES[i].velocityY = ((-Random16() & 127) - 64) << 11;
257 PARTICLES[i].variant = (Random16() & 15) + 32;
258 }
259 }
260 if (frame == 64) {
261 for (i = 0; i != 32; i++) {
262 PARTICLES[i + 32].x = (Random16() % 48 + 60) << 16;
263 PARTICLES[i + 32].y = ((Random16() & 31) + 52) << 16;
264 PARTICLES[i + 32].velocityX = ((Random16() & 127) - 63) << 12;
265 PARTICLES[i + 32].velocityY = ((-Random16() & 31) - 32) << 13;
266 PARTICLES[i + 32].variant = (Random16() & 15) + 32;
267 }
268 }
269 if (frame == 104) {
270 for (i = 0; i != 32; i++) {
271 PARTICLES[i].x = ((Random16() & 63) + 52) << 16;
272 PARTICLES[i].y = ((Random16() & 31) + 72) << 16;
273 PARTICLES[i].velocityX = ((Random16() & 127) - 63) << 11;
274 PARTICLES[i].velocityY = ((-Random16() & 31) - 32) << 13;
275 PARTICLES[i].variant = (Random16() & 15) + 32;
276 }
277 }
278
279 // The chips fly on frames 32 to 207: the four large pictures, then the
280 // seven small ones from frame 192. A chip whose variant is negative has
281 // not been thrown.
282 if (frame >= 32 && frame < 208) {
283 for (i = 0; i != 64; i++) {
284 if (PARTICLES[i].variant >= 0) {
285 s32 cell;
286 if (frame > 191) {
287 cell = i % 7 + 4;
288 } else {
289 cell = i & 3;
290 }
291 drawAlt(canvas, work->sheet + gBoreas_DebrisCells[cell],
295 PARTICLES[i].x += PARTICLES[i].velocityX;
296 PARTICLES[i].y += PARTICLES[i].velocityY;
297 PARTICLES[i].velocityY += 0x2000;
298 }
299 }
300 }
301
302 // Spray: 128 drops from (72, 56) towards the bottom left, leaving smoke
303 // behind them from frame 228. Drop i starts on frame 224 + i / 4 and
304 // every other drop is drawn; one that leaves the canvas starts again.
305 // Trail i starts on frame 228 + i and, each time its 18-frame puff ends,
306 // starts again where its drop is.
307 if (frame > 223) {
308 if (frame == 224) {
309 for (i = 0; i != 128; i++) {
310 PARTICLES[i].x = 72 << 16;
311 PARTICLES[i].y = 56 << 16;
312 PARTICLES[i].velocityX = (-(Random16() & 127) - 64) << 11;
313 PARTICLES[i].velocityY = ((Random16() & 127) + 16) << 11;
314 PARTICLES[i].variant = Random16();
315 }
316 }
317 for (i = 0; i != 128; i++) {
318 if (frame >= i / 4 + 224) {
319 s32 cell = i % 3;
320 if ((i & 1) == 0) {
321 draw(canvas, work->sheet + gBoreas_SprayCells[cell],
324 }
325 PARTICLES[i].x += PARTICLES[i].velocityX;
326 PARTICLES[i].y += PARTICLES[i].velocityY;
327 if ((PARTICLES[i].x >> 16) < -16 || (PARTICLES[i].y >> 16) > 120) {
328 PARTICLES[i].x = 72 << 16;
329 PARTICLES[i].y = 56 << 16;
330 }
331 PARTICLES[i].variant++;
332 }
333 }
334 if (frame == 228) {
335 for (i = 0; i != 128; i++) {
336 spray = &PARTICLES[i];
337 trail = &BOREAS_ICE_BLOCK_TRAILS[i];
338 trail->x = spray->x;
339 trail->y = spray->y;
340 trail->variant = 0;
341 }
342 }
343 for (i = 0, trail = BOREAS_ICE_BLOCK_TRAILS, spray = PARTICLES; i != 128;
344 i++, trail++, spray++) {
345 if (frame >= i + 228) {
346 s32 cell = trail->variant / 2 % 9;
347 s32 size = gBattleFx_PuffSizes[cell];
348 draw(canvas, puffSheet + gBattleFx_PuffCells[cell],
349 Q_16_16_TO_INT(trail->x) - size / 2,
350 Q_16_16_TO_INT(trail->y) - size / 2, size, size);
351 if (++trail->variant == 18) {
352 trail->x = spray->x;
353 trail->y = spray->y;
354 trail->variant = 0;
355 }
356 }
357 }
358 }
359
361 }
362
363 //------------------------------------------------------------------
364 // Second half: ice blocks rain down on the targets, and boulders crumble
365 // into bouncing chips.
366 //------------------------------------------------------------------
367 for (i = 0; i != 9; i++) {
369 }
370 // Blend the canvas fully over the battle background, set the ice blocks
371 // above the canvas to the right, and stagger the smoke puffs, puff i
372 // waiting i / 2 frames (its negative variant) before it shows.
374 REG_BLDALPHA = BLEND_ALPHA(16, 16);
376
377 for (i = 0; i != 64; i++) {
378 work->particles[i].x = ((Random16() & 127) + 64) << 16;
379 work->particles[i].z = -(16 << 16);
380 work->particles[i].y = (-(Random16() & 127) - 64) << 16;
381 work->particles[i].velocityX = (-(Random16() & 63) - 127) << 12;
382 work->particles[i].velocityY = ((Random16() & 63) + 127) << 12;
383 work->particles[i].variant = 0;
384 }
385 for (i = 0; i != 64; i++) {
386 PARTICLES[i].x = Random16() & 127;
387 PARTICLES[i].y = (Random16() & 63) + i / 2;
388 PARTICLES[i].variant = -i / 2;
389 }
390
391 for (frame = 0; frame != 146; frame++) {
392 count = 0;
393 if (frame == 96) {
395 }
396 if (frame == 16) {
397 work->shakeFrames = 32;
398 }
399 // Raise one boulder every 2 frames from frame 18, up to 16; frame 16
400 // starts a 32-frame shake and frames 9 to 71 play a thud every 4.
401 if (frame > 16) {
402 count = (frame - 16) / 2;
403 if (count > 16) {
404 count = 16;
405 }
406 }
407 if (frame >= 9 && frame < 72 && (frame & 3) == 0) {
409 }
410 if (frame == 72) {
412 }
413 // From frame 65 a 40x80 block falls diagonally from the top right, 7
414 // pixels left and 14 down a frame.
415 if (frame > 64) {
416 draw(canvas, work->sheet + BOREAS_FALLING_BLOCK_CELLS,
417 (64 - frame) * 7 + 88, frame * 14 - 992, 40, 80);
418 }
419 if (frame <= 71) {
420 for (i = 0; i != count; i++) {
421 s32 cell = i % 3;
422 draw(canvas, work->sheet + gBoreas_BoulderCells[cell],
423 BOREAS_POINT_X(i) - 56,
426 }
427 }
428 // Frame 72: the boulders crumble, throwing up 64 chips from where they
429 // stood, four from each, and the ice blocks are gone; the chips take
430 // over work->particles. The second frame 72 test is redundant.
431 if (frame == 72) {
432 for (i = 0; i != 64; i++) {
433 work->particles[i].x = (BOREAS_POINT_X(i & 15) - 56) << 16;
434 work->particles[i].y = BOREAS_POINT_Y(i & 15) << 16;
435 work->particles[i].velocityX = ((Random16() & 127) - 63) << 13;
436 work->particles[i].velocityY = (-(Random16() & 31) - 16) << 14;
437 }
438 if (frame == 72) {
439 work->shakeFrames = 4;
440 }
441 }
442 // Chips, 32 on the first frame and 64 after: one below y 135 is gone, and
443 // one that lands faster than 8 pixels a frame at y 120 bounces back at a
444 // quarter of its speed, jolting the screen for a frame.
445 if (frame > 71) {
446 count = 32;
447 if (frame != 72) {
448 count = 64;
449 }
450 for (i = 0; i != count; i++) {
451 struct EffectStep *chip = &work->particles[i];
452 y = Q_16_16_TO_INT(chip->y);
453 if (y <= 135) {
454 s32 cell = i % 3;
455 draw(canvas, work->sheet + gBoreas_FallCells[cell],
456 Q_16_16_TO_INT(chip->x), y - gBoreas_FallHeights[cell],
458 EffectStep_AdvanceWithGravity2D(chip, 64, 1 << 16);
459 if (Q_16_16_TO_INT(chip->y) > 120 && chip->velocityY > 8 << 16) {
460 chip->velocityY = -chip->velocityY / 4;
461 chip->y = 120 << 16;
462 work->shakeFrames = 1;
463 }
464 }
465 }
466 }
467 // The falling ice blocks (24x48): until frame 47, one that lands starts
468 // again at the top.
469 if (frame <= 71) {
470 for (i = 0; i != 64; i++) {
471 draw(canvas, work->sheet, Q_16_16_TO_INT(work->particles[i].x) - 12,
472 Q_16_16_TO_INT(work->particles[i].y) - 24, 24, 48);
473 work->particles[i].x += work->particles[i].velocityX;
474 work->particles[i].y += work->particles[i].velocityY;
475 if ((work->particles[i].y >> 16) > 120 && frame <= 47) {
476 work->particles[i].x = ((Random16() & 127) + 64) << 16;
477 work->particles[i].y = -(16 << 16);
478 }
479 }
480 }
481
482 // Target i takes a blue tint and its damage pose on frame 32 + 8i.
484 if (frame == i * 8 + 32) {
487 }
488 }
489
490 // Smoke (from frame 73): a puff lives 18 frames; until frame 127, each
491 // puff that ends starts again somewhere new, lower as the frames pass.
492 if (frame > 72) {
493 for (i = 0; i != 64; i++) {
494 if (PARTICLES[i].variant >= 0 && PARTICLES[i].variant < 18) {
495 s32 cell = PARTICLES[i].variant / 2 % 9;
496 s32 size = gBattleFx_PuffSizes[cell];
497 draw(canvas, puffSheet + gBattleFx_PuffCells[cell],
498 PARTICLES[i].x - size / 2, PARTICLES[i].y - size / 2, size,
499 size);
500 }
501 if (++PARTICLES[i].variant == 18 && frame <= 127) {
502 PARTICLES[i].x = Random16() & 127;
503 PARTICLES[i].y = (Random16() & 63) + (frame - 54) / 2;
504 PARTICLES[i].variant = 0;
505 }
506 }
507 }
508
509 // The camera shakes hard while the boulders crumble, gently otherwise.
510 if (frame >= 72 && frame < 80) {
511 Camera_ApplyShake(8, 8);
512 } else {
513 Camera_ApplyShake(2, 2);
514 }
516 }
517
521}
522
523#undef BOREAS_ICE_BLOCK_TRAILS
524#undef BOREAS_BIG_BLOCK_CELLS
525#undef BOREAS_FALLING_BLOCK_CELLS
526#undef BOREAS_POINT_X
527#undef BOREAS_POINT_Y
@ SPRITE_COLOR_BLUE_TINT
blue raised to full
Definition animspr.h:27
@ POSE_DAMAGE
taking damage
Definition battle.h:176
@ COMPOSITE_TRANSPARENT
@ COMPOSITE_MAX
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 ...
#define BOREAS_ICE_BLOCK_TRAILS
Definition boreas.c:8
#define BOREAS_BIG_BLOCK_CELLS
the dropping 24x48 ice block
Definition boreas.c:10
#define BOREAS_FALLING_BLOCK_CELLS
the diagonal 40x80 ice block
Definition boreas.c:11
void BattleFx_RunBoreas(struct BattleEffectArgument *effect)
Rocks and ice blocks: a window opens on rocks that crumble, a big ice block drops and throws up spray...
Definition boreas.c:45
#define BOREAS_POINT_Y(rock)
Definition boreas.c:15
#define BOREAS_POINT_X(rock)
gBoreas_Points has an x and a y for each rock.
Definition boreas.c:14
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 BattleFx_EndCanvasLayer(void)
Closes the canvas layer: plays the closing sound, restores BG1's scroll and the projection centre,...
Definition canvas.c:490
void BattleFx_WipeCanvas(s32 mode, s32 value)
Wipes the whole canvas to one colour with a ragged edge: each row (or column) lags a random 0 to 63 p...
Definition canvas.c:27
void BattleFx_ConfigureEffectDisplay(void)
Puts the battle screen back into the display state every effect starts from and ends with: no blendin...
Definition display.c:16
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
void BattleFx_BuildWindowEdgeTable(void)
Builds window 0's right edge for every scanline and restarts the HBlank DMA that writes it to WIN0H e...
Definition dispatch.c:148
void BattleFx_SetupBlendedDisplay(void)
Shows the BG1 battle background behind a cleared canvas: clears the canvas buffer and the 16 KiB of V...
Definition dispatch.c:217
void BattleFx_SelectLivingTargets(struct BattleEffectArgument *effect)
Shows the battle objects of every unit with HP left on the targets' side: the enemies (units 128 to 1...
Definition dispatch.c:184
What every part of the battle effect object shares: its includes, macros and frame-loop helpers.
#define EFFECT_SHOW_WIDE_CANVAS(top)
Shows the canvas: the effect display mode, BG2 stretched to twice its width (the 128-pixel canvas sho...
#define EFFECT_RELEASE_BLITTERS()
Frees the two blitters, the alternate first.
#define EFFECT_PRESENT_FRAME(work)
Ends a frame of a canvas effect: marks the canvas ready for the transfer callback,...
#define EFFECT_SET_TRANSFER(work, mode, value)
Sets how the canvas transfer treats what is left in the canvas after each copy: mode with value (see ...
@ CANVAS_COPY
copy as drawn
@ 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_SHOW_DAMAGE(hitSound)
Lets the battle show the damage: resumes its paused playback, which plays hitSound (an SE_ id; 0 keep...
#define EFFECT_LOAD_BLITTER(slot, flags, mode)
Builds a blitter for the 128x128 canvas (1 << 7 pixels each way) in work slot slot: BattleFx_BuildBli...
#define CANVAS_SLOT(slots, slot)
A work slot read through a pointer to the canvas slot, gWorkSlot[HEAP_SLOT_BATTLE_CANVAS],...
#define EFFECT_WIN0_LAYERS
Window 0, the battle view, shows BG0 to BG2, sprites and blending.
u16 gBoreas_BoulderCells[]
u8 gBoreas_FallHeights[]
s8 gBoreas_ShakeOffsets[]
The backdrop's jolt on frames 176 to 179.
u8 gBoreas_SprayHeights[]
u8 gBoreas_BoulderWidths[]
u16 gBoreas_RockCells[]
u8 gBoreas_DebrisWidths[]
u16 gBoreas_FallCells[]
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.
u16 gBoreas_SprayCells[]
u8 gBoreas_SprayWidths[]
u8 gBoreas_BoulderHeights[]
u8 gBoreas_RockWidths[]
u8 gBoreas_FallWidths[]
u16 gBoreas_DebrisCells[]
u8 gBoreas_Animations[]
The third object's animations from frame 209, one every 4 frames.
u8 gBoreas_RockHeights[]
u8 gBoreas_DebrisHeights[]
void BattleFx_SpawnObjects(s32 entryCount, s32 source, u32 priority)
Creates the effect's animation objects in gBattleFxWork's objects.
Definition eruption.c:220
void BattleBackground_LoadFar(s32 mode, s32 resource, s32 level)
s32 AnimationObjects_SelectAnimationFar(struct AnimationObject *state, s32 flags)
void Object_ApplyProjectedPlacementFar(struct AnimationObject *sprite, const struct SpritePlacement *position, const struct SpriteScale *scale, s32 facing)
Far call to Render_ApplyProjectedPlacement.
void ResourceObject_ReleaseFar(struct AnimationObject *sprite)
void AudioCommand_PlayFar(s32 id)
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
Definition frame.c:97
void Camera_ApplyShake(s32 rangeX, u32 rangeY)
Shakes the battle view while gBattleFxWork's shakeFrames lasts, moving BG1 and the projection centre ...
Definition hail.c:364
@ HEAP_SLOT_BATTLE_EFFECT
Definition heap_state.h:42
@ HEAP_SLOT_BLITTER_ALTERNATE
Definition heap_state.h:47
@ HEAP_SLOT_BATTLE_SHEET
Definition heap_state.h:44
@ HEAP_SLOT_BLITTER
Definition heap_state.h:46
@ HEAP_SLOT_BATTLE_CANVAS
Definition heap_state.h:43
#define REG_WININ
Definition io_reg.h:81
#define REG_WIN0H
Definition io_reg.h:74
#define WININ_WIN1_BG0
Definition io_reg.h:93
#define WININ_WIN1_CLR
Definition io_reg.h:98
@ KEY_B
Definition io_reg.h:244
@ KEY_A
Definition io_reg.h:243
#define PLTT_BACKDROP
Definition io_reg.h:155
#define BLEND_ALPHA(top, bottom)
A REG_BLDALPHA value: top and bottom are the two targets' weights, out of 16.
Definition io_reg.h:145
#define REG_BLDALPHA
Definition io_reg.h:142
#define WIN_RANGE(start, end)
A REG_WINxH or REG_WINxV value: the window covers start up to, but not including, end.
Definition io_reg.h:80
#define BG_PLTT
Definition io_reg.h:157
volatile u32 gKeysRepeat
Pressed keys, repeating while held: after 19 frames, then every 6.
struct BgScroll gBgScroll[]
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
Definition math.c:10
void EffectStep_AdvanceWithGravity2D(struct EffectStep *step, s32 damping, s32 gravity)
Moves a particle one frame on the screen: adds its velocity, then gravity to its vertical speed,...
Definition positions.c:46
struct Projection gProjection
#define Ram_MapCellBuffer
Definition ram_buffer.h:10
char ResourceId_SparkleDots
char ResourceId_VioletSkyBackdrop
char ResourceId_IceBlockSheet
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
s32 Scheduler_RemoveCallback(SchedulerCallback callback)
Unschedules the task running callback: clears its routine and gives it order 0x7fff,...
Definition scheduler.c:146
#define SE_132
Definition songs.h:125
#define SE_141
Definition songs.h:134
#define SE_HEAVY_IMPACT
Definition songs.h:127
#define SE_145
Definition songs.h:138
#define SE_289
Definition songs.h:282
void * gWorkSlot[]
struct AnimationSpritePart image
Definition animspr.h:109
u16 priority
2 when created
Definition animspr.h:100
The command shared by an effect's caller, dispatcher and handlers.
s16 actors[8]
the targets' unit ids, count of them
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 shakeFrames
shake frames left; Camera_ApplyShake counts down
struct AnimationObject * objects[16]
the effect's animation objects
s32 transferMode
How the canvas transfer callbacks treat the canvas after each copy (enum CanvasTransferMode in effect...
struct BattleEffectArgument * effect
the command being run
struct EffectStep particles[64]
free while variant is -1
u16 y
pixels
Definition map_scroll.h:65
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 velocityX
16.16 fixed-point pixels per frame
Definition effect_step.h:28
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
s32 centerY
screen pixels
Definition project.h:17
A sprite's screen position and its two vertical offsets, in 16.16 pixels.
s32 x
screen x of the sprite's centre
s32 y
screen y at the ground; sets the depth slot
s32 groundHeight
how far the shadow is raised above y
s32 height
how far the image is raised above y
Horizontal and vertical sprite scale; 0x10000 is the original size.
void Render_ResetTransformState(void)
Allocates the one-level save area (heap slot HEAP_SLOT_TRANSFORM_STACK), clears gTransformStackDepth ...
Definition transform.c:19
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
unsigned short u16
Definition types.h:13
#define UNUSED
Definition types.h:22
unsigned char u8
Definition types.h:11
#define EFFECT_CLIP_BOUNDS
Clips overflow on all four sides.
Definition effect.h:224
#define Q_16_16_TO_INT(v)
Definition effect.h:231
#define PARTICLES
The map cell buffer (gMapCellBuffer), which the effects borrow, has two views here: Ram_MapCellBuffer...
Definition effect.h:221