8#define TITAN_BLADE_SWORD_SPARKS \
9 ((struct EffectStep *)(Ram_MapCellBuffer + \
10 TITAN_BLADE_DUST * sizeof(struct EffectStep)))
12#define TITAN_BLADE_FRAMES 102
13#define TITAN_BLADE_SWORD_IMAGE 20000
14#define TITAN_BLADE_FLASHES 32
15#define TITAN_BLADE_RING 16
16#define TITAN_BLADE_DUST 684
17#define TITAN_BLADE_FIRST_DUST 256
18#define TITAN_BLADE_DRAWN_DUST 342
19#define TITAN_BLADE_SPARKS 340
21#define TITAN_BLADE_FLASH_CELLS (34 * 104)
54 canvasCenterX = screenPosition.
x / 2;
97 sparkOriginX = canvasCenterX << 16;
110 spark->
x = sparkOriginX;
111 spark->
y = 176 << 15;
122 if (frame >= 25 && frame <= 47) {
165 if (life >= 0 && life <= 17) {
169 x - 16,
y + 48, 32, 64);
172 flash->
variant = life > 0 ? life - 1 : -1;
191 dust->
x = ((
Trig_Sin(ang) * mag) >> 3) + sparkOriginX;
192 dust->
y = ((
Trig_Cos(ang) * mag) >> 2) + (192 << 15);
205 if (step >= 0 && step <= 31) {
219 dust->
x = ((
Trig_Sin(ang) * mag) >> 3) + sparkOriginX;
220 dust->
y = ((
Trig_Cos(ang) * mag) >> 2) + (192 << 15);
233 if (step >= 0 && step <= 31) {
234 s32 phase = frame * 16;
235 s32 x = canvasCenterX - 17;
239 s32 size = (phase - 256) % high;
241 blit(canvas, work->sheet,
x, 4 - size, width, high);
242 blit(canvas, work->sheet,
x, 108 - size, width, size);
260 if (frame > 68 && size <= 5) {
263 if (frame > 70 && size <= 6) {
266 if (frame > 72 && size <= 7) {
269 if (frame > 74 && size <= 8) {
304 x = canvasCenterX - 18;
307 top = frame * 8 - 450;
308 }
else if (frame > 32) {
310 }
else if (frame <= 9) {
311 top = frame * 16 - 128;
315 if (top + 120 > 108) {
316 high = high - top - 12;
338 if (
y > (216 << 15)) {
342 if ((
x >= 0 &&
x <= 0x7effff) &&
y >= 0) {
351 blitters[0](canvas, cell,
x,
y, size, size * 2);
385#undef TITAN_BLADE_SWORD_SPARKS
386#undef TITAN_BLADE_FRAMES
387#undef TITAN_BLADE_SWORD_IMAGE
388#undef TITAN_BLADE_FLASHES
389#undef TITAN_BLADE_RING
390#undef TITAN_BLADE_DUST
391#undef TITAN_BLADE_FIRST_DUST
392#undef TITAN_BLADE_DRAWN_DUST
393#undef TITAN_BLADE_SPARKS
394#undef TITAN_BLADE_FLASH_CELLS
@ SPRITE_COLOR_WHITE
solid colour 15, white
@ POSE_DAMAGE
taking damage
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 ...
void BattleFx_StepPaletteToResource(s32 resourceId)
Moves each RGB555 channel of background colours 0 to 63 one level towards the resource palette.
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.
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 CANVAS_BYTES
The canvas: 128x128 pixels, one byte each, in its heap slot and in VRAM at BG_CHAR_BLOCK(1).
#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...
s32 gTitanBlade_DustGravity[]
Dust gravity, by particle index & 3.
u16 gBattleFx_MoteCells[]
Mote cells: particle sheets hold ten, cell n (from 0) n + 1 pixels wide and twice that tall.
u8 gTitanBlade_FlashCells[]
The flash picture for each three frames at the end of a flash's life.
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 ...
@ HEAP_SLOT_BATTLE_EFFECT
@ HEAP_SLOT_BLITTER_ALTERNATE
#define BLEND_ALPHA(top, bottom)
A REG_BLDALPHA value: top and bottom are the two targets' weights, out of 16.
static s32 Iwram_FillWords(void *destination, s32 size, u32 value)
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
void EffectPosition_ProjectBattler(s32 id, struct EffectPosition *position)
The screen position of a battler, 16 pixels higher.
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,...
char ResourceId_FirePillarSheetA
char ResourceId_BlastSheet
char ResourceId_LightningBoltSheet
char ResourceId_ParticleSpritesA
char ResourceId_SwordSheet
char ResourceId_FlashBurstSheet
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 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.
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 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
#define TITAN_BLADE_DRAWN_DUST
dust moved and drawn
#define TITAN_BLADE_FLASH_CELLS
The flash pictures in the sheet, after the 34x104 fire pillar.
#define TITAN_BLADE_FLASHES
flashes scattered
#define TITAN_BLADE_RING
of which drawn as the ring
#define TITAN_BLADE_SPARKS
sparks after the dust
#define TITAN_BLADE_SWORD_SPARKS
The sparks, in PARTICLES after the dust.
#define TITAN_BLADE_FRAMES
#define TITAN_BLADE_DUST
dust slots in PARTICLES, before the sparks
void BattleFx_RunTitanBlade(struct BattleEffectArgument *effect)
A huge sword drops onto the first target amid charging flashes, dust and sparks.
#define TITAN_BLADE_SWORD_IMAGE
the sword picture in the sheet
#define TITAN_BLADE_FIRST_DUST
dust lit at once on frame 28
#define EFFECT_CLIP_BOUNDS
Clips overflow on all four sides.
#define Q_16_16_TO_INT(v)
#define PARTICLES
The map cell buffer (gMapCellBuffer), which the effects borrow, has two views here: Ram_MapCellBuffer...