Alchemy
Loading...
Searching...
No Matches

plasma.c

Go to the documentation of this file.
1/// @file
2/// Plasma, and the spark groups of Blast and Dynamite.
3/// Part of effect.c, the battle effect object, compiled only through it.
4
6
7// The lightning pillars throw their sparks into one pool of 1024 in
8// PARTICLES, as Volcano's fire pillars do. A spark's variant is its
9// remaining life, 0 when idle. These sparks move in 16.16 fixed point and
10// bounce off the ground at y = 104; they differ from the shared spark bursts
11// in their fixed point, bounds and how fast they shrink, so they keep their
12// own loops.
13
14#define PLASMA_SPARK_COUNT 1024 ///< sparks
15
16#define PLASMA_SPACING 8 ///< frames between pillars
17#define PLASMA_SECOND_IMAGE 0x1500 ///< the second picture in the sheet
18
19/// gPlasma_Columns has seven pillars for each side.
20#define PLASMA_COLUMN_X(side, pillar) gPlasma_Columns[(side)][(pillar)]
21
22/// Pillars of lightning strike one every 8 frames, each with a white flash,
23/// throwing sparks up from the ground and knocking the targets back; the battle
24/// shows the damage on frame 32.
25///
26/// Abilities: Plasma, Shine Plasma, Spark Plasma, Thunderclap, Thunderbolt,
27/// Thunderstorm (kind 18).
28///
29/// effect->variant picks how many pillars (gPlasma_Counts), how many sparks
30/// each throws and how long the screen shakes (gPlasma_Sparks); with variant 2
31/// the camera also swings round for the first 64 frames. effect->side picks the
32/// row of pillar positions.
33///
34/// Sparks are PARTICLES 0 to 1023, canvas pixels in 16.16. Sets REG_BLDALPHA,
35/// loads the violet palette into the first 64 background colours (variant 2
36/// keeps the lightning pillar sheet's), scrolls the camera
37/// (variant 2) and sets work->shakeFrames at each strike.
39 BlitterPair draw;
40 void **slots;
41 void **cursor;
42 struct BattleEffectWork *work;
43 void *canvas;
44 s32 i;
45 u8 *sprites;
46 s32 count;
47 s32 frame;
48 s32 k;
49 s32 start;
50 s32 *life;
51 struct EffectStep *spark;
52 struct EffectStep *sparks;
53
55 cursor = slots;
56 EFFECT_GET_WORK_AND_CANVAS(cursor, work, canvas);
57 sprites = EFFECT_SLOT(slots, HEAP_SLOT_BATTLE_SHEET);
58 work->effect = effect;
60 REG_BLDALPHA = BLEND_ALPHA(16, 16);
68 1, 1);
70 if (work->effect->variant != 2) {
72 Iwram_CopyWords((void *)BG_PLTT, palette, 128);
73 }
74
75 // Every spark starts idle.
76 life = &((struct EffectStep *)PARTICLES)->variant;
77 for (k = 0; k != PLASMA_SPARK_COUNT; k++) {
78 *life = 0;
79 life += 7;
80 }
81 sparks = PARTICLES;
82 // Trails keep half of each pixel a frame.
84 count = gPlasma_Counts[work->effect->variant];
85
86 // The last pillar strikes on frame (count - 1) * 8; the effect runs on
87 // until frame count * 7 + 48, so a large volley's tail is shorter.
88 for (frame = 0; frame != count * 8 - count + 48; frame++) {
89 // Variant 2 swings the camera round for the first 64 frames.
90 if (work->effect->variant == 2 && frame <= 63) {
91 struct CameraWork *camera = (struct CameraWork *)gCameraWork;
92 s32 speed;
93
94 if (frame <= 55)
95 speed = 256;
96 else
97 speed = 704 - frame * 8;
98 if (work->effect->side == 1)
99 camera->scroll -= speed;
100 else
101 camera->scroll += speed;
102 }
103 if (frame == 32)
105
106 // Pillar i strikes on frame 8i with a flash, shows its first image the
107 // frame after and its second for two frames after that.
108 for (i = 0; i != count; i++) {
109 start = i * PLASMA_SPACING;
110 // The flash fills the canvas with level 16.
111 if (frame == start) {
113 Iwram_FillWords(canvas, CANVAS_BYTES, 0x10101010);
114 }
115 if (frame >= start && frame < start + 9) {
116 if (frame >= start + 1 && frame < start + 2)
117 draw[0](canvas, work->sheet,
118 PLASMA_COLUMN_X(work->effect->side, i) - 24, 0, 48, 112);
119 if (frame >= start + 2 && frame < start + 4)
120 draw[0](canvas, work->sheet + PLASMA_SECOND_IMAGE,
121 PLASMA_COLUMN_X(work->effect->side, i) - 24, 0, 48, 112);
122
123 // Throw sparks from the pillar's foot (y 104), anywhere in the
124 // upper half circle, twice as hard up as across, living 32 to 39
125 // frames, and shake the screen.
126 if (frame == start + 2) {
127 s32 spawned = 0;
128
129 for (k = 0; k != PLASMA_SPARK_COUNT; k++) {
130 spark = &sparks[k];
131 if (spark->variant == 0) {
132 s32 speed;
133 s32 angle;
134
135 speed = (Random16() & 0x3ff) + 32;
136 angle = (Random16() & 0x7fff) - 0x4000;
137
138 spark->x = PLASMA_COLUMN_X(work->effect->side, i) << 16;
139 spark->y = 104 << 16;
140 spark->velocityX = (Trig_Sin(angle) * speed) >> 7;
141 spark->velocityY = -((Trig_Cos(angle) * speed) << 1) >> 7;
142 spark->variant = (Random16() & 7) + 32;
143 spawned++;
144 if (spawned ==
146 break;
147 }
148 }
149 work->shakeFrames =
151 }
152 }
153 // Two frames after the sparks the targets recoil, their motion first.
154 if (frame == start + 4) {
158 POSE_DAMAGE, k, 8);
159 }
160 }
161 }
162
163 // Sparks: bounce off the ground at half speed, and shrink as their lives
164 // run out; only those on the canvas are drawn.
165 for (k = 0; k != PLASMA_SPARK_COUNT; k++) {
166 spark = &sparks[k];
167 if (spark->variant > 0) {
168 spark->variant--;
169 EffectStep_AdvanceWithGravity2D(spark, 60, 0x1000);
170 if (spark->y > 104 << 16) {
171 spark->velocityY = -spark->velocityY / 2;
172 } else {
173 s32 x = spark->x >> 16;
174 s32 y;
175 s32 size;
176
177 if (spark->x >= 0 && x <= 119 && spark->y >= 0) {
178 y = spark->y >> 16;
179 size = spark->variant / 8 + 1;
180 EFFECT_DRAW_MOTE(draw[k & 1], canvas, sprites, x, y, size);
181 }
182 }
183 }
184 }
185 Camera_ApplyShake(8, 16);
186 EFFECT_END_FRAME(work);
187 }
188
190}
191
192// Spark bursts: the folder README describes them under "Effect families".
193
194/// Bursts at (60, 48), the canvas behind the battle's first layer (priority 1).
195///
196/// Abilities: Blast, Nova, Supernova, Fire Bomb, Cluster Bomb, Carpet Bomb
197/// (kind 15).
199 BattleFx_RunSparkGroups(effect, 0);
200}
201/// Orange bursts at (60, 64), the canvas in front (priority 0).
202///
203/// Abilities: Dynamite (kind 338).
205 BattleFx_RunSparkGroups(effect, 1);
206}
207#define SPARK_GROUPS_FLASHES 16 ///< flashes kept per burst
208#define SPARK_GROUPS_SPACING 8 ///< frames between bursts
209#define SPARK_GROUPS_RING 12 ///< of which drawn as the ring
210#define SPARK_GROUPS_FLASH_DRAWN 18 ///< a flash is drawn for its last 18 frames
211
212/// One to three bursts, 8 frames apart: each flashes, rings itself with
213/// twelve smaller flashes that fade, and throws out sparks that bounce on
214/// the ground; every burst knocks the targets back.
215/// effect->variant picks the shape from gPlasma_Shapes: sparks per
216/// burst, how many bursts, and each burst's offset across. Variant 2 also
217/// scrolls the camera, and variant 3 flashes the whole canvas on frame 4.
218/// mode : 0 at (60, 48), the battle shows the damage on frame 24;
219/// 1 at (60, 64), orange; the damage shows on frame 2;
220/// 2 below the user, in the LightningBolt colours, with the sparks
221/// rising instead of falling; the damage shows on frame 2.
222///
223/// Called by BattleFx_RunNova (mode 0) and BattleFx_RunDynamite (mode 1),
224/// and in mode 2 by BattleFx_RunCastingImpact for Severe Blow (variant 3)
225/// and by BattleFx_RunThrash (variant 4) and
226/// BattleFx_RunSparkApproachVariant3 (variant 3) in thrash.c, which set
227/// effect->variant first.
228///
229/// work->particles hold the ring flashes, 16 for each burst; PARTICLES the
230/// sparks, one run of gPlasma_Shapes' count for each burst. Sets
231/// REG_BLDALPHA, loads the flash burst palette into the first 64 background
232/// colours, then the orange (mode 1) or lightning (mode 2) one over it, scrolls
233/// the camera (variant 2) and sets work->shakeFrames at each burst.
235 struct EffectPosition screenPosition;
236 BlitterPair draw;
237 void **slots;
238 void **cursor;
239 struct BattleEffectWork *work;
240 void *canvas;
241 s32 i;
242 s32 frame;
243 u8 *graphics;
244 s32 originX;
245 s32 originY;
246 s32 j;
247 s32 start;
248 struct EffectStep *point;
249 struct EffectStep *spark;
250 struct EffectStep *sparks;
251
253 cursor = slots;
254 EFFECT_GET_WORK_AND_CANVAS(cursor, work, canvas);
255 graphics = EFFECT_SLOT(slots, HEAP_SLOT_BATTLE_SHEET);
256 work->effect = effect;
257 if (mode == 0) {
259 originX = 60;
260 originY = 48;
261 } else if (mode == 1) {
263 originX = 60;
264 originY = 64;
265 } else {
267 EffectPosition_ProjectScaledBattler(work->effect->actor, &screenPosition);
268 originX = screenPosition.x / 2;
269 originY = screenPosition.y + 48;
270 }
271 REG_BLDALPHA = BLEND_ALPHA(16, 16);
278 1);
280 if (mode == 1) {
281 Iwram_CopyWords((void *)BG_PLTT,
283 128);
284 } else if (mode == 2) {
285 Iwram_CopyWords((void *)BG_PLTT,
287 128);
288 }
289 sparks = PARTICLES;
290
291 // For each burst: sixteen ring flashes (the first twelve are drawn) at
292 // random angles, each lying further out (index * 2) and waiting longer
293 // before it shows (life index / 2 + 25) the later it comes; and its
294 // sparks, thrown in every direction, twice as hard up and down as across,
295 // at speeds of 32 to 1055, living 32 to 39 frames.
296 for (i = 0; i != gPlasma_Shapes[work->effect->variant][SPARK_GROUPS_BURSTS];
297 i++) {
298 for (j = 0; j != SPARK_GROUPS_FLASHES; j++) {
299 s32 radius;
300 s32 angle;
301
302 point = &work->particles[i * SPARK_GROUPS_FLASHES + j];
303 radius = j * 2;
304 angle = Random16() & 0xffff;
305 point->x = Trig_Sin(angle) * radius;
306 point->y = -(Trig_Cos(angle) * radius);
307 point->variant = j / 2 + 25;
308 }
309 for (j = 0; j != gPlasma_Shapes[work->effect->variant][SPARK_GROUPS_SPARKS];
310 j++) {
311 s32 speed;
312 s32 angle;
313
314 spark =
315 &sparks[i *
317 j;
318 speed = (Random16() & 0x3ff) + 32;
319 angle = Random16() & 0xffff;
320 if (work->effect->side == 1)
321 spark->x =
322 (originX -
324 28)
325 << 16;
326 else
327 spark->x =
328 (originX +
330 28)
331 << 16;
332 spark->y = originY << 16;
333 spark->velocityX = (Trig_Sin(angle) * speed) >> 6;
334 spark->velocityY = -((Trig_Cos(angle) * speed) << 1) >> 6;
335 spark->variant = (Random16() & 7) + 32;
336 }
337 }
338 // Trails keep 3/4 a frame.
340
341 for (frame = 0;
344 56;
345 frame++) {
346 struct CameraWork *camera =
347 *(struct CameraWork **)(gWorkSlot + HEAP_SLOT_CAMERA);
348
349 if (work->effect->variant == 2 && frame <= 51) {
350 if (work->effect->side == 0)
351 camera->scroll += 256;
352 else
353 camera->scroll -= 256;
354 }
355 /* FAKEMATCH: this fill calls the fixed entry itself;
356 * through Iwram_FillWords a spilled invariant ahead of the frame loop is
357 * built in r2 where the ROM uses r1 (3 of 776 instructions differ). */
358 if (work->effect->variant == 3 && frame == 4)
359 Iwram_FillWordsEntry(canvas, CANVAS_BYTES, 0x3f3f3f3f);
360 if (mode == 1 || mode == 2) {
361 if (frame == 2)
363 } else {
364 if (frame == 2)
366 if (frame == 24)
368 }
369
370 // Burst i starts on frame 8i with a two-frame flash, then its ring and
371 // sparks; the targets reel 6 frames in.
372 for (i = 0; i != gPlasma_Shapes[work->effect->variant][SPARK_GROUPS_BURSTS];
373 i++) {
374 // A burst's centre is its offset from originX, less 28, towards the
375 // targets' side; the 32x64 flash is drawn 16 left of it.
376 start = i * SPARK_GROUPS_SPACING;
377 if (frame == start)
378 work->shakeFrames = 12;
379 if (frame >= start && frame < start + 2) {
380 if (work->effect->side == 1)
381 draw[0](canvas, work->sheet,
382 originX -
384 [SPARK_GROUPS_OFFSET + i] +
385 12,
386 originY - 32, 32, 64);
387 else
388 draw[0](canvas, work->sheet,
389 originX +
391 [SPARK_GROUPS_OFFSET + i] -
392 44,
393 originY - 32, 32, 64);
394 }
395 if (frame >= start) {
396 for (j = 0; j != SPARK_GROUPS_RING; j++) {
397 s32 x;
398 s32 y;
399
400 point = &work->particles[i * SPARK_GROUPS_FLASHES] + j;
401 y = Q_16_16_TO_INT(point->y) + originY;
402 if (work->effect->side == 1)
403 x = Q_16_16_TO_INT(point->x) + originX -
405 28;
406 else
407 x = Q_16_16_TO_INT(point->x) + originX +
409 28;
410 // A ring flash's variant counts down; its last 18 frames step
411 // through the six entries of gPlasma_FlashCells, three frames
412 // each, a 32x64 picture (2048 bytes) apiece.
413 if (point->variant >= 0 && point->variant < SPARK_GROUPS_FLASH_DRAWN)
414 draw[0](canvas,
415 work->sheet +
416 (gPlasma_FlashCells[point->variant / 3] << 11),
417 x - 16, y - 32, 32, 64);
418 if (point->variant > 0)
419 point->variant--;
420 else
421 point->variant = -1;
422 }
423 }
424 // The sparks fly (rising for mode 2). Below y 108 a spark bounces back
425 // at half speed instead of being drawn; otherwise it is drawn while on
426 // the canvas, shrinking with its life, alternate sparks additively.
427 if (frame > start + 5) {
428 s32 gravity;
429
430 if (mode == 2)
431 gravity = -0x1000;
432 else
433 gravity = 0x1000;
434 for (j = 0;
436 j++) {
437 spark = &sparks[i * gPlasma_Shapes[work->effect->variant]
439 j;
440 if (spark->variant > 0) {
441 EffectStep_AdvanceWithGravity2D(spark, 60, gravity);
442 spark->variant--;
443 if (spark->y > 0x6c0000) {
444 spark->velocityY = -spark->velocityY / 2;
445 } else if (spark->x >= 0 && spark->x < 0x7f0000 && spark->y >= 0) {
446 s32 y = spark->y >> 16;
447 s32 x = spark->x >> 16;
448 s32 size = spark->variant / 5 + 1;
449
450 EFFECT_DRAW_MOTE(draw[j & 1], canvas, graphics, x, y, size);
451 }
452 }
453 }
454 }
456 if (frame == start + 6) {
458 POSE_DAMAGE, j, 10);
460 }
461 }
462 }
463 Camera_ApplyShake(16, 16);
464 EFFECT_END_FRAME(work);
465 }
466
468}
469
470#undef PLASMA_SPARK_COUNT
471#undef PLASMA_SPACING
472#undef PLASMA_SECOND_IMAGE
473#undef PLASMA_COLUMN_X
474#undef SPARK_GROUPS_FLASHES
475#undef SPARK_GROUPS_SPACING
476#undef SPARK_GROUPS_RING
477#undef SPARK_GROUPS_FLASH_DRAWN
@ SPRITE_COLOR_WHITE
solid colour 15, white
Definition animspr.h:26
@ POSE_DAMAGE
taking damage
Definition battle.h:176
struct BattleCamera * gCameraWork
@ COMPOSITE_FLIP_X
@ COMPOSITE_ADDITIVE
@ 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 ...
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_GET_WORK_AND_CANVAS(cursor, work, canvas)
The work block and canvas occupy adjacent slots, starting at HEAP_SLOT_BATTLE_EFFECT.
#define CANVAS_BYTES
The canvas: 128x128 pixels, one byte each, in its heap slot and in VRAM at BG_CHAR_BLOCK(1).
#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_START_TRANSFER(work, mode, value)
Sets the transfer, then starts copying the canvas to VRAM once a frame.
#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 EFFECT_END_FRAME(work)
The usual end of an effect frame: counts down the targets' flash timers (ObjectGroup_TickMemberTimers...
u8 gPlasma_FlashCells[]
The flash picture for each three frames at the end of a flash's life.
u16 gPlasma_Sparks[][2]
Plasma, by variant: sparks per pillar and shake frames.
u16 gPlasma_Shapes[][5]
The spark groups, by variant: the SPARK_GROUPS_ columns.
u8 gPlasma_Counts[]
How many pillars strike, by variant.
@ SPARK_GROUPS_BURSTS
bursts, 8 frames apart
@ SPARK_GROUPS_SPARKS
sparks each burst throws
@ SPARK_GROUPS_OFFSET
burst i's offset across, in pixels, at [2 + i]
@ PLASMA_SHAKE_FRAMES
frames the screen shakes at each strike
@ PLASMA_SPARKS
sparks each lightning pillar throws
void BattleMotion_ApplyVariantMotionFar(s32 id, s32 variant)
void AudioCommand_PlayFar(s32 id)
s32 Trig_Cos(s32 angle)
s32 Trig_Sin(s32 angle)
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_CAMERA
Definition heap_state.h:38
@ HEAP_SLOT_BLITTER
Definition heap_state.h:46
#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 BG_PLTT
Definition io_reg.h:157
static s32 Iwram_CopyWords(volatile void *destination, const volatile void *source, s32 size)
Definition iwram_call.h:85
static s32 Iwram_FillWords(void *destination, s32 size, u32 value)
Definition iwram_call.h:59
#define Iwram_FillWordsEntry
Definition iwram_call.h:22
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
Definition math.c:10
#define PLASMA_SPACING
frames between pillars
Definition plasma.c:16
#define PLASMA_SPARK_COUNT
sparks
Definition plasma.c:14
void BattleFx_RunNova(struct BattleEffectArgument *effect)
Bursts at (60, 48), the canvas behind the battle's first layer (priority 1).
Definition plasma.c:198
#define SPARK_GROUPS_FLASH_DRAWN
a flash is drawn for its last 18 frames
Definition plasma.c:210
#define SPARK_GROUPS_FLASHES
flashes kept per burst
Definition plasma.c:207
void BattleFx_RunPlasma(struct BattleEffectArgument *effect)
Pillars of lightning strike one every 8 frames, each with a white flash, throwing sparks up from the ...
Definition plasma.c:38
void BattleFx_RunSparkGroups(struct BattleEffectArgument *effect, s32 mode)
One to three bursts, 8 frames apart: each flashes, rings itself with twelve smaller flashes that fade...
Definition plasma.c:234
#define PLASMA_SECOND_IMAGE
the second picture in the sheet
Definition plasma.c:17
void BattleFx_RunDynamite(struct BattleEffectArgument *effect)
Orange bursts at (60, 64), the canvas in front (priority 0).
Definition plasma.c:204
#define SPARK_GROUPS_RING
of which drawn as the ring
Definition plasma.c:209
#define SPARK_GROUPS_SPACING
frames between bursts
Definition plasma.c:208
#define PLASMA_COLUMN_X(side, pillar)
gPlasma_Columns has seven pillars for each side.
Definition plasma.c:20
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
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
char ResourceId_VioletPaletteB
char ResourceId_OrangePaletteB
char ResourceId_LightningBoltSheet
char ResourceId_ParticleSpritesA
char ResourceId_LightningPillarSheet
char ResourceId_FlashBurstSheet
#define SE_HEAVY_IMPACT
Definition songs.h:127
#define SE_145
Definition songs.h:138
void * gWorkSlot[]
The command shared by an effect's caller, dispatcher and handlers.
s32 actor
the user's unit id
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)
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 BattleEffectArgument * effect
the command being run
struct EffectStep particles[64]
free while variant is -1
The battle camera (struct BattleCamera) as the effects that swing it see it.
Definition battle.h:68
u16 scroll
the camera's yaw, in 1/65536 turns
Definition battle.h:70
A point projected onto the screen, with its depth.
Definition effect_step.h:46
s32 y
screen pixels
Definition effect_step.h:59
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 velocityX
16.16 fixed-point pixels per frame
Definition effect_step.h:28
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
void * Resource_GetTableEntry(s32 index)
Returns the ROM address of resource index from the resource directory.
Definition system.c:150
signed int s32
Definition types.h:14
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
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