Alchemy
Loading...
Searching...
No Matches

target_strike.c

Go to the documentation of this file.
1/// @file
2/// Monster bites, fangs and slashes on one target.
3/// Part of effect.c, the battle effect object, compiled only through it.
4
6
7// Target strikes: repeated slashes or columns of light on the first target.
8// The folder README describes them under "Effect families".
9
10/// The strike sparks, 512 of them, live after the motes in PARTICLES. Only
11/// the first 128 are drawn; a heavy hit lights all 512.
12#define TARGET_STRIKE_SPARKS ((struct EffectStep *)(Ram_MapCellBuffer + 0x3800))
13
14/// The smoke pictures in the sheet: six 24x48 puffs.
15#define TARGET_STRIKE_SMOKE_CELLS 0x3200
16
17/// Column `field` of style `mode`'s row of gTargetStrike_Records.
18#define TARGET_STRIKE_VALUE(mode, field) gTargetStrike_Records[(mode)][(field)]
19
20/// The columns of gTargetStrike_Records.
21enum {
22 TARGET_STRIKE_KIND, ///< STRIKE_KIND_SLASH or STRIKE_KIND_COLUMN
23 TARGET_STRIKE_HITS, ///< how many times the target is struck
24 TARGET_STRIKE_FLAGS, ///< STRIKE_SMOKE and so on
25 TARGET_STRIKE_COLOUR, ///< background palette, 0 to 5 (see below)
26 TARGET_STRIKE_IMAGE_FRAMES, ///< frames each strike image is shown
27 TARGET_STRIKE_COMPOSITE, ///< how the columns are drawn (COMPOSITE_MAX or
28 ///< _ADDITIVE)
29 TARGET_STRIKE_FRAMES ///< length of the effect in frames
30};
31// STRIKE_KIND_* and the STRIKE_SMOKE flags are in effect_table.h.
32
33/// The twelve styles, rows of gTargetStrike_Records.
34enum {
47};
48
49/// One slash with glints, lightning colours.
50///
51/// Abilities: Numbing Sting (kind 313).
54}
55/// Three ember columns that drain the target into the user.
56///
57/// Abilities: Cannibal Fang (kind 316).
60}
61/// One lime column with smoke.
62///
63/// Abilities: Poisonous Bite (kind 318); Poison Fang (kind 323).
66}
67/// One column with smoke, Mars Djinn colours.
68///
69/// Abilities: Rabid Fang (kind 336).
72}
73/// Three lightning columns with glints.
74///
75/// Abilities: Electric Bite (kind 324).
78}
79/// One lime slash with smoke.
80///
81/// Abilities: Poison Tail (kind 325).
84}
85/// Three columns that drain the target, Mars Djinn colours.
86///
87/// Abilities: Vampiric Fang (kind 327).
90}
91/// Two blue columns with sparks.
92///
93/// Abilities: Double Fang (kind 332).
96}
97/// One heavy slash with sparks, Mars Djinn colours.
98///
99/// Abilities: Mortal Blow (kind 333).
102}
103/// Two slashes with sparks, lightning colours.
104///
105/// Abilities: Twin Beaks (kind 335).
108}
109/// Three pink columns with smoke.
110///
111/// Abilities: Acid Bite (kind 337).
114}
115/// Three additive columns that drain the target with large motes, Mars Djinn
116/// colours.
117///
118/// Abilities: Drain Fang (kind 386).
122}
123/// Strikes the first target TARGET_STRIKE_HITS times with a sideways slash or a
124/// column of light, with the extras its flags choose, and lets the battle
125/// show the damage on the hits.
126///
127/// Called by the twelve wrappers above, from BattleFx_RunNumbingSting to
128/// BattleFx_RunDrainFang. Loads the style's colours over the first 64 of the
129/// background palette; uses work->particles 0 to 63 for smoke, PARTICLES 0
130/// to 127 for motes and TARGET_STRIKE_SPARKS for sparks; builds and frees its
131/// blitters in both slots every frame, sets work->shakeFrames on each hit and
132/// lights the user while an absorb runs. Leaves the canvas layer closed.
133///
134/// mode : the style, 0 to 11, a row of gTargetStrike_Records.
136 struct EffectPosition ground;
137 struct EffectPosition targetPosition;
138 struct EffectPosition alternate;
139 struct EffectPosition position;
140 BlitterPair draw;
141 void **slots;
142 void **cursor;
143 struct BattleEffectWork *work;
144 void *canvas;
145 s32 frame;
146 s32 k;
147 u8 *particleSheet;
148 struct BattleCamera *camera;
149 struct MotionObject *target;
150 struct MotionObject *source;
151 s32 resource;
152 s32 i;
153 s32 wispSheet = TARGET_STRIKE_SMOKE_CELLS;
154 DrawRectangle *lower;
155
156 EFFECT_GET_SLOTS(slots, cursor, work, canvas);
158 particleSheet = EFFECT_SLOT(slots, HEAP_SLOT_BATTLE_SHEET);
159 camera = EFFECT_SLOT(slots, HEAP_SLOT_CAMERA);
160 work->effect = effect;
163 else
165 REG_BLDALPHA = BLEND_ALPHA(16, 16);
166
167 // Setup. The images: glints at the start of the sheet, the slashes or the
168 // columns at 0xc80, smoke at TARGET_STRIKE_SMOKE_CELLS, and the style's
169 // palette.
171 0, 0);
175 work->sheet + 0xc80, 0, 0);
176 else
178 work->sheet + 0xc80, 0, 0);
180 case 0:
181 resource = (s32)&ResourceId_BlueBeamSheet;
182 break;
183 case 1:
184 resource = (s32)&ResourceId_LimePalette;
185 break;
186 case 2:
187 resource = (s32)&ResourceId_PinkPalette;
188 break;
189 case 3:
190 resource = (s32)&ResourceId_EmberStreakSheet;
191 break;
192 case 4:
193 resource = (s32)&ResourceId_MarsDjinnSheet;
194 break;
195 case 5:
196 default:
198 break;
199 }
200 Iwram_CopyWords((void *)BG_PLTT, Resource_GetTableEntry(resource), 128);
202 work->sheet + TARGET_STRIKE_SMOKE_CELLS, 1, 0);
203
204 // Park every particle, idle, where it will start: smoke at the target's
205 // feet, motes and sparks 20 pixels up its body, each with a random
206 // velocity.
207 // DEAD: runs once, for the first target only; the ROM keeps the loop.
208 for (k = 0; k != 1; k++) {
209 target = GetBattleObjectSlotFar(work->effect->actors[k])->object;
210 for (i = 0; i != 64; i++) {
211 struct EffectStep *step = &work->particles[i];
212
213 EffectPosition_ProjectBattler(work->effect->actors[k], &ground);
214 SET_POSITION(step, (ground.x / 2) << 16, 0x500000, 0);
215 SET_VELOCITY(step, ((Random16() & 255) - 128) << 9,
216 ((Random16() & 255) - 128) << 9, 0);
217 step->variant = -1;
218 }
219 for (i = 0; i != 128; i++) {
220 struct EffectStep *step = &PARTICLES[k * 128 + i];
221
222 SET_POSITION(step, target->x, 0x140000, target->z);
223 SET_VELOCITY(step, ((Random16() & 255) - 128) << 11,
224 ((Random16() & 255) - 128) << 11,
225 ((Random16() & 255) - 128) << 11);
226 step->variant = -1;
227 }
228 for (i = 0; i != 512; i++) {
229 TARGET_STRIKE_SPARKS[i].x = target->x;
230 TARGET_STRIKE_SPARKS[i].y = 0x140000;
231 TARGET_STRIKE_SPARKS[i].z = target->z;
233 TARGET_STRIKE_SPARKS[i].velocityX = ((Random16() & 255) - 128) << 11;
234 TARGET_STRIKE_SPARKS[i].velocityY = ((Random16() & 255) - 128) << 11;
235 TARGET_STRIKE_SPARKS[i].velocityZ = ((Random16() & 255) - 128) << 11;
236 } else {
237 // The heavy slash throws its sparks twice as wide.
239 TARGET_STRIKE_SPARKS[i].velocityX = (Random16() & 0x1ff) << 11;
240 TARGET_STRIKE_SPARKS[i].velocityY = ((Random16() & 0x1ff) - 256)
241 << 11;
242 TARGET_STRIKE_SPARKS[i].velocityZ = ((Random16() & 0x1ff) - 256)
243 << 11;
244 } else {
245 TARGET_STRIKE_SPARKS[i].velocityX = (Random16() & 255) << 11;
246 TARGET_STRIKE_SPARKS[i].velocityY = ((Random16() & 255) - 128) << 11;
247 TARGET_STRIKE_SPARKS[i].velocityZ = ((Random16() & 255) - 128) << 11;
248 }
249 // Slashes throw sparks towards the middle of the field.
250 if (TARGET_STRIKE_SPARKS[i].x > 0)
251 TARGET_STRIKE_SPARKS[i].velocityX =
252 -TARGET_STRIKE_SPARKS[i].velocityX;
253 }
254 TARGET_STRIKE_SPARKS[i].variant = -1;
255 }
256 }
257
258 // Trails keep 3/4 a frame.
260
261 // Strike halfway between the target's middle and its feet.
262 EffectPosition_ProjectScaledBattler(work->effect->actors[0], &targetPosition);
263 EffectPosition_ProjectBattler(work->effect->actors[0], &alternate);
264 targetPosition.y += (alternate.y - targetPosition.y) / 2;
265
266 for (frame = 0; frame != TARGET_STRIKE_VALUE(mode, TARGET_STRIKE_FRAMES);
267 frame++) {
268 // Frame loop: the strike, then glints, then smoke, motes and sparks,
269 // each drawn over the last. Hit n lights particle group n, found as
270 // frame / (6 * IMAGE_FRAMES).
273 s32 length = span * 4;
274 s32 glint = 0;
275
277 // Slashes: six images sweep across the target from the user's side,
278 // once per hit; the fifth image of each sweep is the hit.
279 if (frame < span * 6) {
280 s32 picture =
282
283 if (work->effect->side == 1) {
288 canvas, work->sheet + gTargetStrike_Offsets[picture],
289 targetPosition.x / 2 - (gTargetStrike_Reach[picture] / 2) -
290 gTargetStrike_Widths[picture] + 8,
291 targetPosition.y - (gTargetStrike_Heights[picture] / 2),
293 } else {
297 canvas, work->sheet + gTargetStrike_Offsets[picture],
298 targetPosition.x / 2 + (gTargetStrike_Reach[picture] / 2) - 8,
299 targetPosition.y - (gTargetStrike_Heights[picture] / 2),
301 }
303 if (frame %
308 } else {
311 }
312 // A heavy hit lights every spark at once; otherwise the hit
313 // lights the next 32. Each hit also starts 8 smoke puffs, the
314 // first half of its group of 16.
316 work->shakeFrames = 8;
317 EFFECT_STRIKE_TARGET(work->effect, 0, 12, 4);
318 for (i = 0; i != 512; i++)
319 TARGET_STRIKE_SPARKS[i].variant = (Random16() & 15) + 15;
320 } else {
321 work->shakeFrames = 4;
324 for (i = 0; i != 32; i++) {
325 struct EffectStep *step =
326 &TARGET_STRIKE_SPARKS[frame /
328 mode,
330 6) *
331 32 +
332 i];
333
334 step->variant = (Random16() & 15) + 7;
335 }
336 }
337 for (i = 0; i != 8; i++) {
338 struct EffectStep *step =
339 &work->particles[frame /
342 6) *
343 16 +
344 i];
345
346 step->variant = 0;
347 }
348 }
349 }
350 // Slashes show their glints on frames 12 to 31; columns while stage 3
351 // is drawn.
352 if (frame >= 12 && frame <= 31)
353 glint = 1;
354 } else if (frame < length + 4) {
355 // Columns: a column of light, drawn as two mirrored halves, rises
356 // through its stages on the target once per hit, then holds stage 3
357 // for 4 frames.
358 s32 stage;
359
360 if (frame < length) {
361 s32 picture =
363
364 while (picture > 4)
365 picture -= 4;
366 stage = gTargetStrike_ColumnStages[picture];
367 } else {
368 stage = 3;
369 }
373 canvas, work->sheet + stage * (18 * 48) + 0xc80,
374 targetPosition.x / 2 - 18, 56, 18, 48);
380 canvas, work->sheet + stage * (18 * 48) + 0xc80, targetPosition.x / 2,
381 56, 18, 48);
383 if (frame % (TARGET_STRIKE_VALUE(mode, TARGET_STRIKE_IMAGE_FRAMES) * 4) ==
385 // A hit: the target flashes; the last hit lets the battle show the
386 // damage, the others only play the hit sound. Each hit lights a
387 // group of 64 sparks, 8 smoke puffs and 16 motes.
388 // XXX: the group is frame / (6 * IMAGE_FRAMES), a slash's period,
389 // though column hits are four images apart, so a three-hit column's
390 // second and third hits light the same group; a capture of Acid Bite
391 // would show whether the third hit throws anything new.
393 POSE_DAMAGE, 0, 8);
394 work->shakeFrames = 4;
395 if (frame > (TARGET_STRIKE_VALUE(mode, TARGET_STRIKE_HITS) * 4 - 4) *
398 else
400 for (i = 0; i != 64; i++) {
401 struct EffectStep *step =
402 &TARGET_STRIKE_SPARKS[frame /
405 6) *
406 64 +
407 i];
408
409 step->variant = (Random16() & 15) + 7;
410 }
411 for (i = 0; i != 8; i++) {
412 struct EffectStep *step =
413 &work->particles[frame /
416 6) *
417 16 +
418 i];
419
420 step->variant = 0;
421 }
422 for (i = 0; i != 16; i++)
423 PARTICLES[frame /
425 6) *
426 16 +
427 i]
428 .variant = 0;
429 }
430 if (stage == 3)
431 glint = 1;
432 }
433
434 // Glints: three a frame, scattered at random around the target in
435 // random flips.
437 glint) {
438 for (i = 0; i != 3; i++) {
439 s32 image = frame & 3;
440 s32 angle = Random16() & 0xffff;
441 s32 range = 31;
442 s32 radius = Random16() & range;
443 s32 x;
444 s32 y;
445
446 x = targetPosition.x / 2 + (Trig_Sin(angle) * (radius + 4) >> 17) -
447 (gBattleFx_GlintCellWidths[image] / 2);
448 y = targetPosition.y - (Trig_Cos(angle) * (radius + 4) >> 17) -
449 (gBattleFx_GlintCellHeights[image] / 2);
454 (*lower)(canvas, work->sheet + gBattleFx_GlintCells[image], x, y,
458 }
459 }
460
466 draw[1] = *lower;
467 // DEAD: runs once, for the user only; the ROM keeps the loop.
468 for (k = 0; k != 1; k++) {
469 source = GetBattleObjectSlotFar(work->effect->actor)->object;
470 // Smoke puffs rise and spread through six images over 24 frames.
472 for (i = 0; i != 64; i++) {
473 struct EffectStep *step = &work->particles[i];
474
475 if (step->variant >= 0 && step->variant <= 23) {
476 s32 picture = step->variant / 4;
477
478 draw[i & 1](canvas, work->sheet + picture * (24 * 48) + wispSheet,
479 Q_16_16_TO_INT(step->x) - 12,
480 Q_16_16_TO_INT(step->y) - 24, 24, 48);
481 EffectStep_AdvanceWithGravity2D(step, 62, -0x400);
482 step->variant++;
483 }
484 }
485 }
486 // Motes burst out of the target, then after 10 frames are pulled
487 // into the user, who glows from frame 55 to 90; a mote goes out when
488 // it is within 16 pixels of the user across the ground (dx and dz are
489 // 1/256 of the distance).
491 s32 size = 3;
492
494 size = 8;
495 if (frame == 55)
497 -1, 0);
498 if (frame == 90)
499 ObjectGroup_UpdateMembers(work->effect->actor, 0, -1, -1, 0);
500 for (i = 0; i != 64; i++) {
501 struct EffectStep *step = &PARTICLES[i];
502
503 if (step->variant >= 0) {
504 EffectPosition_ProjectPoint(step, &position);
505 position.x >>= 1;
506 draw[1](canvas, particleSheet + gBattleFx_MoteCells[size - 1],
507 position.x - ((u32)size >> 1), position.y - size, size,
508 size * 2);
510 step->variant++;
511 if (step->variant > 10) {
512 s32 dx = (source->x - step->x) >> 8;
513 s32 dy = (source->y - step->y + 0x140000) >> 8;
514 s32 dz = (source->z - step->z) >> 8;
515
516 step->velocityX += dx;
517 step->velocityY += dy;
518 step->velocityZ += dz;
519 if ((dx >= -0xfff && dx <= 0xfff) &&
520 (dz >= -0xfff && dz <= 0xfff))
521 step->variant = -1;
522 }
523 }
524 }
525 }
526 // Sparks fly out and shrink as their lives run out.
528 for (i = 0; i != 128; i++) {
529 struct EffectStep *step = &TARGET_STRIKE_SPARKS[i];
530 s32 size = step->variant;
531
532 if (size >= 0) {
533 EffectPosition_ProjectPoint(step, &position);
534 position.x >>= 1;
536 size >>= 3;
537 size++;
538 EFFECT_DRAW_MOTE(draw[1], canvas, particleSheet, position.x,
539 position.y, size);
540 step->variant--;
541 }
542 }
543 }
544 }
547 Camera_ApplyShake(8, 8);
548 else
549 Camera_ApplyShake(2, 4);
550 EFFECT_END_FRAME(work);
551 }
552
553 // Finish: the blitters were freed each frame.
556}
557
558#undef TARGET_STRIKE_SPARKS
559#undef TARGET_STRIKE_VALUE
560#undef TARGET_STRIKE_SMOKE_CELLS
@ SPRITE_COLOR_WHITE
solid colour 15, white
Definition animspr.h:26
@ POSE_DAMAGE
taking damage
Definition battle.h:176
@ COMPOSITE_FLIP_X
@ COMPOSITE_ADDITIVE
@ COMPOSITE_MAX
BattleEffectDrawRectangle DrawRectangle
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 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_RELEASE_BLITTERS()
Frees the two blitters, the alternate first.
#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_SLOT(slots, slot)
A work slot read through a pointer to the effect's own slot, gWorkSlot[HEAP_SLOT_BATTLE_EFFECT].
#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_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->...
#define EFFECT_STRIKE_TARGET(effect, i, frames, motion)
Strikes target i: it flashes white in its damage pose for frames frames and plays battle motion motio...
u8 gTargetStrike_Heights[]
u8 gBattleFx_GlintCellHeights[]
u16 gBattleFx_MoteCells[]
Mote cells: particle sheets hold ten, cell n (from 0) n + 1 pixels wide and twice that tall.
u16 gTargetStrike_Offsets[]
u8 gTargetStrike_Widths[]
u16 gBattleFx_GlintCells[]
u8 gTargetStrike_Reach[]
u8 gTargetStrike_GlintDrawFlags[]
The flips a glint may be drawn in.
u8 gBattleFx_GlintCellWidths[]
u8 gTargetStrike_ColumnStages[]
The column stage shown by each picture of a rise.
#define STRIKE_KIND_SLASH
sideways slashes
Definition effect_table.h:9
#define STRIKE_HEAVY
one heavy hit: a big shake and the target recoils
#define STRIKE_GLINTS
glints sparkle around the target
#define STRIKE_SMOKE
each hit raises smoke puffs from the target's feet
#define STRIKE_ABSORB
motes fly out of the target and back into the user
#define STRIKE_SPARKS
each hit scatters sparks
#define STRIKE_KIND_COLUMN
columns of light
struct BattleObj * GetBattleObjectSlotFar(s32 objectId)
Far call to BattleObjGet.
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_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
#define SET_VELOCITY(p, vx, vy, vz)
Definition macros.h:18
#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
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
Definition math.c:10
void Runtime_ReleaseHeapBlock(s32 slot)
void EffectPosition_ProjectBattler(s32 id, struct EffectPosition *position)
The screen position of a battler, 16 pixels higher.
Definition positions.c:100
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
void EffectStep_AdvanceWithGravity3D(struct EffectStep *step, s32 damping, s32 gravity)
Moves a particle one frame in three dimensions: adds its velocity, then gravity to its vertical speed...
Definition positions.c:29
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
char ResourceId_BlueBeamSheet
char ResourceId_PinkPalette
char ResourceId_TornadoSheet
char ResourceId_LimePalette
char ResourceId_BeamSequenceImage
char ResourceId_MarsDjinnSheet
char ResourceId_LightningBoltSheet
char ResourceId_TwelveModeImage
char ResourceId_SmokeSheet
char ResourceId_ParticleSpritesA
char ResourceId_EmberStreakSheet
s32 Scheduler_RemoveCallback(SchedulerCallback callback)
Unschedules the task running callback: clears its routine and gives it order 0x7fff,...
Definition scheduler.c:146
#define SE_133
Definition songs.h:126
#define SE_HEAVY_IMPACT
Definition songs.h:127
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 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
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
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 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 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 velocityZ
16.16 fixed-point pixels per frame
Definition effect_step.h:30
An effect object that moves and draws one sprite: its position, scale, velocity and target,...
Definition motobj.h:20
s32 z
16.16 fixed-point pixels
Definition motobj.h:25
s32 y
16.16 fixed-point pixels
Definition motobj.h:24
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 BattleFx_RunDrainFang(struct BattleEffectArgument *effect)
Three additive columns that drain the target with large motes, Mars Djinn colours.
#define TARGET_STRIKE_VALUE(mode, field)
Column field of style mode's row of gTargetStrike_Records.
void BattleFx_RunTargetStrike(struct BattleEffectArgument *effect, s32 mode)
Strikes the first target TARGET_STRIKE_HITS times with a sideways slash or a column of light,...
@ TARGET_STRIKE_KIND
STRIKE_KIND_SLASH or STRIKE_KIND_COLUMN.
@ TARGET_STRIKE_IMAGE_FRAMES
frames each strike image is shown
@ TARGET_STRIKE_FLAGS
STRIKE_SMOKE and so on.
@ TARGET_STRIKE_COMPOSITE
how the columns are drawn (COMPOSITE_MAX or _ADDITIVE)
@ TARGET_STRIKE_COLOUR
background palette, 0 to 5 (see below)
@ TARGET_STRIKE_FRAMES
length of the effect in frames
@ TARGET_STRIKE_HITS
how many times the target is struck
#define TARGET_STRIKE_SPARKS
The strike sparks, 512 of them, live after the motes in PARTICLES.
@ TARGET_STRIKE_STYLE_PINK_SMOKE_COLUMNS
@ TARGET_STRIKE_STYLE_LIGHTNING_GLINT_SLASH
@ TARGET_STRIKE_STYLE_LIGHTNING_SPARK_SLASHES
@ TARGET_STRIKE_STYLE_LIGHTNING_GLINT_COLUMNS
@ TARGET_STRIKE_STYLE_MARS_ADDITIVE_DRAIN_COLUMNS
@ TARGET_STRIKE_STYLE_MARS_DRAIN_COLUMNS
@ TARGET_STRIKE_STYLE_MARS_SMOKE_COLUMN
@ TARGET_STRIKE_STYLE_EMBER_DRAIN_COLUMNS
@ TARGET_STRIKE_STYLE_BLUE_SPARK_COLUMNS
@ TARGET_STRIKE_STYLE_MARS_HEAVY_SLASH
@ TARGET_STRIKE_STYLE_LIME_SMOKE_COLUMN
@ TARGET_STRIKE_STYLE_LIME_SMOKE_SLASH
void BattleFx_RunElectricBite(struct BattleEffectArgument *effect)
Three lightning columns with glints.
void BattleFx_RunTwinBeaks(struct BattleEffectArgument *effect)
Two slashes with sparks, lightning colours.
#define TARGET_STRIKE_SMOKE_CELLS
The smoke pictures in the sheet: six 24x48 puffs.
void BattleFx_RunRabidFang(struct BattleEffectArgument *effect)
One column with smoke, Mars Djinn colours.
void BattleFx_RunAcidBite(struct BattleEffectArgument *effect)
Three pink columns with smoke.
void BattleFx_RunPoisonousBite(struct BattleEffectArgument *effect)
One lime column with smoke.
void BattleFx_RunPoisonTail(struct BattleEffectArgument *effect)
One lime slash with smoke.
void BattleFx_RunNumbingSting(struct BattleEffectArgument *effect)
One slash with glints, lightning colours.
void BattleFx_RunVampiricFang(struct BattleEffectArgument *effect)
Three columns that drain the target, Mars Djinn colours.
void BattleFx_RunDoubleFang(struct BattleEffectArgument *effect)
Two blue columns with sparks.
void BattleFx_RunCannibalFang(struct BattleEffectArgument *effect)
Three ember columns that drain the target into the user.
void BattleFx_RunMortalBlow(struct BattleEffectArgument *effect)
One heavy slash with sparks, Mars Djinn colours.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
unsigned char u8
Definition types.h:11
#define EFFECT_BLITTERS
The work slots read as blitters: EFFECT_BLITTERS[HEAP_SLOT_BLITTER] and EFFECT_BLITTERS[HEAP_SLOT_BLI...
Definition effect.h:248
#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