Alchemy
Loading...
Searching...
No Matches

streaks.c

Go to the documentation of this file.
1/// @file
2/// Streak volleys (Sonic Wave, Shriek, War Cry ...) and mote fountains (Sleep
3/// Star, Soothing Star).
4/// Part of effect.c, the battle effect object, compiled only through it.
5
7
8// Streak volleys: three streaks of light fly from the user to each target in
9// turn, in one of five colours. The streaks are work->particles, one for each
10// target and streak, and their variant counts the frames since they set off.
11
12/// Column `n` of style `mode`'s row of gStreaks_Records, four flags a style.
13#define STREAKS_VALUE(mode, n) gStreaks_Records[(mode)][(n)]
14#define STREAKS_ANIMATE 0 ///< nonzero: the streak cycles through three images
15#define STREAKS_HIT 1 ///< nonzero: play the hit sound and flash the target
16#define STREAKS_MOTION 2 ///< the target's recoil motion on the hit (-1: none)
17/// nonzero: the struck target trembles from side to side
18#define STREAKS_SHAKE 3
19
20#define STREAKS_MAX 3 ///< streaks fired at each target
21
22/// The streak volley's styles: its colour and its row of gStreaks_Records.
29};
30
31/// Ember streaks.
32///
33/// Abilities: Sonic Wave (kind 300).
34///
35/// Three streaks of ember light fly from the user at each target in turn; each
36/// target flashes and recoils.
39}
40/// Lime streaks.
41///
42/// Abilities: Shriek (kind 301).
43///
44/// Three streaks of lime light fly from the user at each target in turn; each
45/// target flashes and recoils.
48}
49/// Violet streaks.
50///
51/// Abilities: Banshee Howl (kind 302).
52///
53/// Three streaks of violet light fly from the user at each target in turn; each
54/// target flashes and trembles.
57}
58/// Cyan streaks.
59///
60/// Abilities: War Cry (kind 304).
61///
62/// Three flickering cyan streaks, cycling through three colour rows, fly from
63/// the user at each target in turn; each target flashes and recoils.
66}
67/// Red streaks.
68///
69/// Abilities: Wicked Howl (kind 305).
70///
71/// Three flickering red streaks, cycling through three colour rows, fly from
72/// the user at each target in turn; each target flashes and trembles.
75}
76/// The streak volley in lime. UNUSED: no effect table entry points here.
79}
80
81#define STREAKS_SPACING 6 ///< frames between streaks
82#define STREAKS_FLIGHT 24 ///< frames from user to target
83#define STREAKS_TARGET_DELAY 32 ///< frames between targets
84
85/// Fires STREAKS_MAX streaks at each target from 20 pixels above the user,
86/// one every 6 frames, each reaching 20 pixels above its target 24 frames
87/// later; each target's volley starts 32 frames after the previous one's.
88/// A streak image is 20x40 and drawn twice, mirrored upwards, as a 20x80
89/// streak that leaves a fading trail.
90///
91/// Called by the five streak handlers above and the unused
92/// BattleFx_RunLimeStreaks. Loads the style's colours over the first 64 of
93/// the background palette, writes work->bg2xLines and, over the last 16
94/// frames, BLDALPHA; sets work->shakeFrames on a recoiling hit, and moves a
95/// trembling target's x.
96///
97/// mode : the style, 0 to 4: the streak colour (ember, lime, violet, red,
98/// cyan) and the row of gStreaks_Records that says how a hit looks.
100 struct EffectPosition position;
101 void **slots;
102 void **cursor;
103 struct BattleEffectWork *work;
104 void *canvas;
105 s32 k;
106 DrawRectangle drawLower;
107 DrawRectangle drawUpper;
108 struct BattleCamera *camera;
109 struct MotionObject *source;
110 struct MotionObject *target;
111 s32 resource;
112 s32 frame;
113 s32 streakIndex;
114 s32 streaks = STREAKS_MAX;
115 s32 lift = 20 << 16; // 20 pixels, 16.16
116
117 EFFECT_GET_SLOTS(slots, cursor, work, canvas);
118 camera = EFFECT_SLOT(slots, HEAP_SLOT_CAMERA);
119 work->effect = effect;
121
122 // The upper half of a streak is its image flipped vertically; on the
123 // party's side both halves are mirrored as well.
124 if (work->effect->side == 0) {
127 drawUpper = EFFECT_SLOT(slots, HEAP_SLOT_BLITTER);
130 drawLower = EFFECT_SLOT(slots, HEAP_SLOT_BLITTER_ALTERNATE);
131 } else {
134 drawUpper = EFFECT_SLOT(slots, HEAP_SLOT_BLITTER);
137 drawLower = EFFECT_SLOT(slots, HEAP_SLOT_BLITTER_ALTERNATE);
138 }
139
140 // The streak images, and the style's colour as the first 128 bytes of the
141 // background palette. The sheet holds three colour rows of six images,
142 // 4800 bytes a row and 800 (20x40) an image.
144 switch (mode) {
146 resource = (s32)&ResourceId_EmberStreakSheet;
147 break;
149 resource = (s32)&ResourceId_LimePalette;
150 break;
152 resource = (s32)&ResourceId_VioletPaletteD;
153 break;
155 resource = (s32)&ResourceId_RedPaletteB;
156 break;
158 default:
159 resource = (s32)&ResourceId_CyanPalette;
160 break;
161 }
162 Iwram_CopyWords((void *)BG_PLTT, Resource_GetTableEntry(resource), 128);
163 // Halve the canvas each frame, so streaks leave a trail.
165
166 source = GetBattleObjectSlotFar(work->effect->actor)->object;
167 {
168 // XXX: the length counts 6 frames for every streak although targets are
169 // 32 frames apart, so with four targets the fourth's hit (frame 120)
170 // falls on the frame the loop stops at and never plays; the abilities'
171 // target ranges would settle whether four targets can occur.
172 s32 totalFrames = streaks * work->effect->count * STREAKS_SPACING + 48;
173
174 // Every streak starts 20 pixels above the user and moves in a straight
175 // line to 20 pixels above its target over 24 frames.
177 target = GetBattleObjectSlotFar(work->effect->actors[k])->object;
178 for (streakIndex = 0; streakIndex != streaks; streakIndex++) {
179 struct EffectStep *streak = &work->particles[k * streaks + streakIndex];
180
181 SET_POSITION(streak, source->x, source->y + lift, source->z);
182 SET_VELOCITY(streak, (target->x - streak->x) / STREAKS_FLIGHT,
183 (target->y + lift - streak->y) / STREAKS_FLIGHT,
184 (target->z - streak->z) / STREAKS_FLIGHT);
185 streak->variant = 0; // frames since the streak set off
186 }
187 }
188
189 for (frame = 0; frame != totalFrames; frame++) {
190 s32 *row = work->bg2xLines;
191
192 // A sine wave of BG2X offsets, one per scanline, for the wave
193 // HBlank DMA.
194 // XXX: nothing here arms BattleFx_ArmBg2AffineHBlankDma, so the table
195 // seems unread; a scheduler trace during Sonic Wave would settle it.
196 for (k = 0; k != 160; k++)
197 *row++ = (0x80000 - Trig_Sin((frame + k) << 12) * 2) >> 10;
198 // Fade the canvas out over the last 16 frames.
199 if (frame > totalFrames - 16)
200 REG_BLDALPHA = BLEND_ALPHA(totalFrames - frame, 16);
203 if (frame >= k * STREAKS_TARGET_DELAY) {
204 for (streakIndex = 0; streakIndex != streaks; streakIndex++) {
205 if (frame >=
206 k * STREAKS_TARGET_DELAY + streakIndex * STREAKS_SPACING) {
207 struct EffectStep *streak =
208 &work->particles[k * streaks + streakIndex];
209 s32 step;
210
211 // Project the streak onto the half-width canvas; its image
212 // changes every 8 frames and stays on the sixth.
213 EffectPosition_ProjectPoint(streak, &position);
214 position.x >>= 1;
215 step = streak->variant / 8;
216 if (step > 5)
217 step = 5;
218 if (STREAKS_VALUE(mode, STREAKS_ANIMATE)) {
219 u8 *cell = &work->sheet[step * 800 + frame / 2 % 3 * 4800];
220
221 drawUpper(canvas, cell, position.x - 10, position.y - 40, 20,
222 40);
223 drawLower(canvas, cell, position.x - 10, position.y, 20, 40);
224 } else {
225 u8 *cell = &work->sheet[step * 800 + 2 * 4800];
226
227 drawUpper(canvas, cell, position.x - 10, position.y - 40, 20,
228 40);
229 drawLower(canvas, cell, position.x - 10, position.y, 20, 40);
230 }
231 // No drag and no gravity: a straight line.
232 EffectStep_AdvanceWithGravity3D(streak, 64, 0);
233 streak->variant++;
234 }
235 }
236
237 // From 6 frames after the first streak hits, for 32 frames, the
238 // target trembles from side to side.
239 if (STREAKS_VALUE(mode, STREAKS_SHAKE) &&
240 frame >= k * STREAKS_TARGET_DELAY + 30 &&
241 frame < k * STREAKS_TARGET_DELAY + 62) {
242 struct MotionObject *struck =
244
245 struck->x +=
246 gStreaks_Tremble[(frame - k * STREAKS_TARGET_DELAY - 30) % 8]
247 << 16;
248 if (struck->x > 0)
249 struck->x += 0x8000;
250 else
251 struck->x -= 0x8000;
253 -1, 0);
254 }
255
256 // The hit: the first streak plays the hit sound and flashes the
257 // target white in its damage pose for 8 frames, and it
258 // flashes again 16 frames later.
259 if (STREAKS_VALUE(mode, STREAKS_HIT)) {
260 if (frame == k * STREAKS_TARGET_DELAY + 24) {
262 if (k == 0) // the first hit lets the battle show the damage
266 }
267 if (frame == k * STREAKS_TARGET_DELAY + 40)
270 }
271 // The style's recoil motion, with a camera shake.
272 if (STREAKS_VALUE(mode, STREAKS_MOTION) != -1 &&
273 frame == k * STREAKS_TARGET_DELAY + 24) {
274 work->shakeFrames = 4;
276 work->effect->actors[k], STREAKS_VALUE(mode, STREAKS_MOTION));
277 }
278 }
279 }
280 Camera_ApplyShake(8, 8);
281 EFFECT_END_FRAME(work);
282 }
283 }
284
286}
287
288/// The mote fountain's modes (BattleFx_RunMoteFountain).
292};
293
294/// The fountain launches 256 motes in PARTICLES but draws only the first 128.
296
297/// Rising motes that drift onto the targets and strike.
298///
299/// Abilities: Sleep Star (kind 349).
300///
301/// Motes burst out of the user and float up, wobbling, as they drift across the
302/// field; each target flinches in turn.
305}
306/// Rising healing motes.
307///
308/// Abilities: Soothing Star (kind 344).
309///
310/// Orange motes burst out of the user and float up close to it, and each target
311/// glows in turn with the recovery sound.
314}
315#define MOTE_FOUNTAIN_FOUNTAIN_FRAMES 128
316
317/// Motes burst out of the user in every direction and float upwards,
318/// wobbling, for 128 frames; a new group of 32 joins every 8 frames. Each
319/// target in turn reacts from frame 48, 8 frames apart.
320///
321/// Called by BattleFx_RunSleepStar and BattleFx_RunSoothingStar. Fills
322/// PARTICLES 0 to 255 and loads the mode's colours over the first 64 of the
323/// background palette; the healing mode opens the canvas layer with BG
324/// control 0 and the drifting mode with 1.
325///
326/// mode 0: orange motes that stay close to the user; each target plays the
327/// recovery sound and glows (a healing effect).
328/// mode 1: motes on the earth palette that drift across towards the far side
329/// of the field; each target flinches (an attack).
331 s32 worldPoint[3];
332 struct EffectPosition position;
333 struct BattleEffectWork *work;
334 void *canvas;
335 BlitterPair draw;
336 struct BattleCamera *camera;
337 u8 *sheet;
338 struct MotionObject *source;
339 struct EffectStep *mote;
340 s32 resource;
341 s32 frame;
342 s32 i;
343
346 camera = WORK_SLOT(HEAP_SLOT_CAMERA);
348 work->effect = effect;
351 else
360 resource = (s32)&ResourceId_OrangePaletteA;
361 else
362 resource = (s32)&ResourceId_EarthWallSheet;
363 Iwram_CopyWords((void *)BG_PLTT, Resource_GetTableEntry(resource), 128);
364 // Trails keep 3/4 a frame.
366
367 // Every mote starts 5 pixels above the user with a random direction and
368 // speed, mostly upwards, and a life of 48 to 79 frames; the healing mode
369 // halves the spread across the ground.
370 source = GetBattleObjectSlotFar(work->effect->actor)->object;
371 for (i = 0; i != MOTE_FOUNTAIN_INITIALIZED_COUNT; i++) {
372 s32 speed;
373 s32 angle;
374
375 mote = &PARTICLES[i];
376
377 /* FAKEMATCH: the mask set before the Random16() call it masks; as
378 * Random16() & 0x3ff, 5 lines of tbs-en effect.s differ. */
379 speed = 0x3ff;
380 speed &= Random16();
381 angle = Random16() & 0xffff;
382 SET_POSITION(mote, source->x, source->y + 0x50000, source->z);
383 SET_VELOCITY(mote, Trig_Sin(angle) * (speed + 32) >> 8,
384 ((Random16() & 255) - 32) << 9,
385 -(Trig_Cos(angle) * (speed + 32) << 1) >> 8);
386 mote->variant = (Random16() & 31) + 48;
387 if (mode == MOTE_FOUNTAIN_FOUNTAIN_HEALING) {
388 mote->velocityX /= 2;
389 mote->velocityZ /= 2;
390 }
391 }
392
393 for (frame = 0; frame != MOTE_FOUNTAIN_FOUNTAIN_FRAMES; frame++) {
395 // Mote i joins on frame i / 32 * 8, and goes out when its life is spent.
396 for (i = 0; i != MOTE_VISIBLE_COUNT; i++) {
397 mote = &PARTICLES[i];
398 if (frame >= i / 32 * 8 && mote->variant >= 0) {
399 s32 size;
400
401 // Wobble sideways, project onto the half-width canvas and draw a
402 // 1x2 to 6x12 mote, larger the nearer it is to the camera: depths
403 // are held to 314 to 634, one size a 64 of depth.
404 SET_VECTOR(worldPoint,
405 mote->x + Trig_Sin((i * 4 + mote->variant) << 10) * 16,
406 mote->y, mote->z);
407 EffectPosition_ProjectPoint(worldPoint, &position);
408 position.x >>= 1;
409 if (position.depth <= 313)
410 position.depth = 314;
411 if (position.depth > 634)
412 position.depth = 634;
413 size = 6 - (position.depth - 314) / 64;
414 EFFECT_DRAW_MOTE(draw[0], canvas, sheet, position.x, position.y, size);
415 // Damped by 62/64 a frame, with a slight lift (y grows upwards).
416 EffectStep_AdvanceWithGravity3D(mote, 62, 0x400);
417 // Mode 1 pushes every mote towards the other side of the field.
418 if (mode == MOTE_FOUNTAIN_DRIFTING) {
419 if (source->x < 0)
420 mote->velocityX += 0x2000;
421 else
422 mote->velocityX -= 0x2000;
423 }
424 mote->variant--;
425 }
426 }
427 // Each target reacts in turn, and the battle shows its result.
428 if (mode == MOTE_FOUNTAIN_DRIFTING) {
430 if (frame == i * 8 + 48) {
433 POSE_DAMAGE, i, 8);
434 }
435 }
436 } else {
438 if (frame == i * 8 + 48) {
442 -1, i, 8);
443 }
444 }
445 }
446 EFFECT_END_FRAME(work);
447 }
448
450}
451
452#undef STREAKS_VALUE
453#undef STREAKS_ANIMATE
454#undef STREAKS_HIT
455#undef STREAKS_MOTION
456#undef STREAKS_SHAKE
457#undef STREAKS_MAX
458#undef STREAKS_SPACING
459#undef STREAKS_FLIGHT
460#undef STREAKS_TARGET_DELAY
461#undef MOTE_FOUNTAIN_FOUNTAIN_FRAMES
@ SPRITE_COLOR_WHITE
solid colour 15, white
Definition animspr.h:26
@ POSE_DAMAGE
taking damage
Definition battle.h:176
@ COMPOSITE_FLIP_X
@ COMPOSITE_FLIP
@ COMPOSITE_FLIP_Y
@ 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_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_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->...
s8 gStreaks_Tremble[]
Pixels the target trembles by, frame by frame.
struct BattleObj * GetBattleObjectSlotFar(s32 objectId)
Far call to BattleObjGet.
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
@ HEAP_SLOT_BATTLE_CANVAS
Definition heap_state.h:43
#define WORK_SLOT(n)
Reads slots through their own addresses; adjacent slots are reached by offsets.
Definition heap_state.h:14
#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
#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
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
Definition math.c:10
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_CyanPalette
char ResourceId_FiveModeImage
char ResourceId_VioletPaletteD
char ResourceId_LimePalette
char ResourceId_EarthWallSheet
char ResourceId_ParticleSpritesA
char ResourceId_RedPaletteB
char ResourceId_OrangePaletteA
char ResourceId_EmberStreakSheet
#define SE_RECOVERY
Definition songs.h:119
#define SE_133
Definition songs.h:126
void * gWorkSlot[]
#define STREAKS_VALUE(mode, n)
Column n of style mode's row of gStreaks_Records, four flags a style.
Definition streaks.c:13
#define STREAKS_SPACING
frames between streaks
Definition streaks.c:81
void BattleFx_RunWickedHowl(struct BattleEffectArgument *effect)
Red streaks.
Definition streaks.c:73
void BattleFx_RunStreakVolley(struct BattleEffectArgument *effect, s32 mode)
Fires STREAKS_MAX streaks at each target from 20 pixels above the user, one every 6 frames,...
Definition streaks.c:99
#define STREAKS_TARGET_DELAY
frames between targets
Definition streaks.c:83
#define MOTE_FOUNTAIN_FOUNTAIN_FRAMES
Definition streaks.c:315
#define STREAKS_MAX
streaks fired at each target
Definition streaks.c:20
void BattleFx_RunSleepStar(struct BattleEffectArgument *effect)
Rising motes that drift onto the targets and strike.
Definition streaks.c:303
void BattleFx_RunBansheeHowl(struct BattleEffectArgument *effect)
Violet streaks.
Definition streaks.c:55
void BattleFx_RunShriek(struct BattleEffectArgument *effect)
Lime streaks.
Definition streaks.c:46
#define STREAKS_SHAKE
nonzero: the struck target trembles from side to side
Definition streaks.c:18
#define STREAKS_FLIGHT
frames from user to target
Definition streaks.c:82
UNUSED void BattleFx_RunLimeStreaks(struct BattleEffectArgument *effect)
The streak volley in lime. UNUSED: no effect table entry points here.
Definition streaks.c:77
@ MOTE_VISIBLE_COUNT
Definition streaks.c:295
@ MOTE_FOUNTAIN_INITIALIZED_COUNT
Definition streaks.c:295
StreakStyle
The streak volley's styles: its colour and its row of gStreaks_Records.
Definition streaks.c:23
@ STREAKS_STYLE_LIME
Definition streaks.c:25
@ STREAKS_STYLE_VIOLET
Definition streaks.c:26
@ STREAKS_STYLE_CYAN
Definition streaks.c:28
@ STREAKS_STYLE_EMBER
Definition streaks.c:24
@ STREAKS_STYLE_RED
Definition streaks.c:27
#define STREAKS_HIT
nonzero: play the hit sound and flash the target
Definition streaks.c:15
void BattleFx_RunSonicWave(struct BattleEffectArgument *effect)
Ember streaks.
Definition streaks.c:37
#define STREAKS_ANIMATE
nonzero: the streak cycles through three images
Definition streaks.c:14
MoteFountainMode
The mote fountain's modes (BattleFx_RunMoteFountain).
Definition streaks.c:289
@ MOTE_FOUNTAIN_FOUNTAIN_HEALING
Soothing Star.
Definition streaks.c:290
@ MOTE_FOUNTAIN_DRIFTING
Sleep Star.
Definition streaks.c:291
void BattleFx_RunMoteFountain(struct BattleEffectArgument *effect, s32 mode)
Motes burst out of the user in every direction and float upwards, wobbling, for 128 frames; a new gro...
Definition streaks.c:330
#define STREAKS_MOTION
the target's recoil motion on the hit (-1: none)
Definition streaks.c:16
void BattleFx_RunSoothingStar(struct BattleEffectArgument *effect)
Rising healing motes.
Definition streaks.c:312
void BattleFx_RunWarCry(struct BattleEffectArgument *effect)
Cyan streaks.
Definition streaks.c:64
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
s32 count
targets in actors, at least 1
The running battle effect's work: its canvas image, 64 particles, the display registers it stages and...
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 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 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 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
signed int s32
Definition types.h:14
#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 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