7#define DRAGON_CLOUD_FRAMES 150
8#define DRAGON_CLOUD_STRIKE_FRAME 83
9#define DRAGON_CLOUD_TRAIL_CELL_BYTES (24 * 39)
10#define DRAGON_CLOUD_FIRST_EMBER 8
11#define DRAGON_CLOUD_FIRST_FLASH 48
12#define DRAGON_CLOUD_TRAIL_CELLS 0x1680
13#define DRAGON_CLOUD_PUFF_CELLS 0x3c00
14#define DRAGON_CLOUD_PUFFS 8
15#define DRAGON_CLOUD_EMBERS 40
16#define DRAGON_CLOUD_FLASHES 16
20#define DRAGON_CLOUD_DRAW_PUFF(blit, canvas, sheet, cell, x, y) \
22 &(sheet)[DRAGON_CLOUD_PUFF_CELLS] + gBattleFx_PuffArcCells[cell], x, y, \
23 gBattleFx_PuffArcCellWidths[cell], gBattleFx_PuffArcCellHeights[cell])
71 for (i = 1; i != 20; i++) {
76 shade = shade - i * 4 + 40;
112 flash->
x = -0x380000;
127 puff->
x = (-(
Trig_Sin(j) * 24) >> 16) + 16;
143 camera->
yaw -= 0x100;
146 camera->
yaw += 0x100;
150 s32 cell = frame / 3;
160 if (frame >= 18 && frame <= 58) {
162 x = (path[0] << 8) + (
u8)path[1];
163 y = (path[2] << 8) + (
u8)path[3] + 16;
171 if (frame >= 78 && frame <= 118) {
181 for (j = 19; j != 0; j--) {
182 if (frame > j + 18 && frame <= j + 83) {
183 trail[j].
x = trail[j - 1].
x;
184 trail[j].
y = trail[j - 1].
y;
189 trail[j].
x, trail[j].
y, 24, 39);
203 position.
x = 64 -
x / 2;
205 position.
x =
x / 2 + 64;
207 lift = (position.
y - trail[0].
y - 24) / 2;
217 lift = drift / 4 + 2;
218 trail[0].
x = position.
x - 12;
219 trail[0].
y = position.
y - 20;
220 draw[0](canvas, &work->sheet[lift * (24 * 48)], trail[0].
x - 6,
221 trail[0].
y - 2, 24, 48);
235 for (i = 0; i != 56; i++) {
244 if (position.
depth <= 159)
245 position.
depth = 160;
246 if (position.
depth > 799)
247 position.
depth = 799;
252 size = 9 - (position.
depth - 160) / 64;
257 position.
x - 16, position.
y - 32, 32, 64);
300#undef DRAGON_CLOUD_FRAMES
301#undef DRAGON_CLOUD_STRIKE_FRAME
302#undef DRAGON_CLOUD_TRAIL_CELL_BYTES
303#undef DRAGON_CLOUD_FIRST_EMBER
304#undef DRAGON_CLOUD_FIRST_FLASH
305#undef DRAGON_CLOUD_TRAIL_CELLS
306#undef DRAGON_CLOUD_PUFF_CELLS
307#undef DRAGON_CLOUD_PUFFS
308#undef DRAGON_CLOUD_EMBERS
309#undef DRAGON_CLOUD_FLASHES
310#undef DRAGON_CLOUD_DRAW_PUFF
@ SPRITE_COLOR_WHITE
solid colour 15, white
@ POSE_DAMAGE
taking damage
struct BattleCamera * gCameraWork
BattleEffectDrawRectangle DrawRectangle
void BattleFx_BeginCanvasLayer(s32 bgControl)
Opens the canvas layer: starts the background palette fade, makes BG2 the canvas, alpha-blended over ...
void Resource_LoadAndDecompress(s32 id, void *dst, s32 skipPalette, s32 copyPalette)
Decompresses a resource whose first 128 bytes may be a palette.
#define DRAGON_CLOUD_FLASHES
flashes, from FIRST_FLASH
#define DRAGON_CLOUD_DRAW_PUFF(blit, canvas, sheet, cell, x, y)
Draws puff picture cell of sheet on canvas at (x, y) with blit, sized by the puff tables.
#define DRAGON_CLOUD_PUFFS
puffs, particles 0 to 7
#define DRAGON_CLOUD_STRIKE_FRAME
the flame strikes the first target
void BattleFx_RunDragonCloud(struct BattleEffectArgument *effect)
A flame leaves the user along a stored path with a fading trail of 19 copies behind it,...
#define DRAGON_CLOUD_EMBERS
embers, from FIRST_EMBER
#define DRAGON_CLOUD_PUFF_CELLS
the puff pictures in the sheet
#define DRAGON_CLOUD_TRAIL_CELLS
the trail picture in the sheet
#define DRAGON_CLOUD_FIRST_EMBER
the first ember in work->particles
#define DRAGON_CLOUD_TRAIL_CELL_BYTES
bytes in each trail copy
#define DRAGON_CLOUD_FIRST_FLASH
the first flash in work->particles
#define DRAGON_CLOUD_FRAMES
void ObjectGroup_UpdateMembers(s32 actorId, s32 palette, s32 animation, s32 timerSlot, s32 timerFrames)
Updates every animation group of one battler's object.
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_GET_SLOTS(slots, cursor, work, canvas)
Starts at the effect's entry in the whole work-slot array.
#define EFFECT_END_FRAME(work)
The usual end of an effect frame: counts down the targets' flash timers (ObjectGroup_TickMemberTimers...
#define EFFECT_VIEW_FROM_CAMERA(camera)
Starts a frame's 3D projection from the battle camera: resets the transform, then looks from camera->...
u8 gBattleFx_PuffArcCellBiasY[]
u8 gBattleFx_PuffArcCellWidths[]
void BattlePres_SetupTransitionSceneFar(s32 x, s32 depth, s32 y, s32 zoom)
void BattleMotion_ApplyVariantMotionFar(s32 id, s32 variant)
void AudioCommand_PlayFar(s32 id)
void Camera_ApplyShake(s32 rangeX, u32 rangeY)
Shakes the battle view while gBattleFxWork's shakeFrames lasts, moving BG1 and the projection centre ...
#define BLEND_ALPHA(top, bottom)
A REG_BLDALPHA value: top and bottom are the two targets' weights, out of 16.
#define SET_VELOCITY(p, vx, vy, vz)
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
void BattleFx_FetchRectangleBlitters(s32 flip, BlitterPair out)
Builds the two usual routines that draw onto the 128x128 canvas, both clipped on both axes.
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...
#define Ram_MapCellBuffer
char ResourceId_DualStreamPath
char ResourceId_ParticleSpritesA
char ResourceId_FirePillarSheetB
char ResourceId_FlashBurstSheet
char ResourceId_EmberStreakSheet
The battle camera: its eye, the focus it turns about, and its pitch, yaw and distance.
The command shared by an effect's caller, dispatcher and handlers.
s32 side
1 when the targets are the party, 0 for enemies
s16 actors[8]
the targets' unit ids, count of them
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
A point projected onto the screen, with its depth.
s32 depth
projected depth, larger further away
A moving point of an effect: its position, its velocity and a value each effect uses its own way (a s...
s32 velocityX
16.16 fixed-point pixels per frame
s32 z
16.16 fixed-point pixels
s32 variant
each effect's own: a size, a countdown, -1 for idle
s32 x
16.16 fixed-point pixels
s32 y
16.16 fixed-point pixels
s32 velocityY
16.16 fixed-point pixels per frame
s32 velocityZ
16.16 fixed-point pixels per frame
Two-dimensional {x, y} pair for position or velocity, a local of the summon scenes (Nereid,...
s32 x
16.16 pixels in every scene that uses it
void * Resource_GetTableEntry(s32 index)
Returns the ROM address of resource index from the resource directory.