8#define RAGNAROK_FLASH_CELLS (64 * 128)
10#define RAGNAROK_FRAMES 80
11#define RAGNAROK_COLUMNS 2
12#define RAGNAROK_SEEDED 3
13#define RAGNAROK_FLASHES 16
14#define RAGNAROK_RING 12
15#define RAGNAROK_SPARKS 340
16#define RAGNAROK_DRAWN_SPARKS 256
19#define RAGNAROK_COLUMN_X(side, column) \
20 gRagnarok_StrikeColumns[(side)][(column)]
136 top = frame * 16 - 128;
137 }
else if (frame > 20) {
139 top = frame * 2 - 24;
146 x = 128 - frame * 10;
147 top = frame * 16 - 128;
148 }
else if (frame > 20) {
150 top = frame * 2 - 24;
156 if (top + 128 > 104) {
157 height = height - top - 24;
160 blit[0](canvas, work->sheet,
x - 32, top, 64, height);
173 s32 start = col * 8 + 16;
175 if (frame == start) {
178 if (frame >= start) {
180 if (frame < start + 2) {
197 if (life >= 0 && life <= 17) {
201 x - 16,
y + 56, 32, 64);
204 flash->
variant = life > 0 ? life - 1 : -1;
210 if (frame > start + 5) {
223 if (
y > (108 << 16)) {
227 if ((
x >= 0 &&
x <= 0x7effff) &&
y >= 0) {
240 blit[lane](canvas, cell, px, py, size, size * 2);
251 if (frame == start + 6) {
269#undef RAGNAROK_FLASH_CELLS
270#undef RAGNAROK_FRAMES
271#undef RAGNAROK_COLUMNS
272#undef RAGNAROK_SEEDED
273#undef RAGNAROK_FLASHES
275#undef RAGNAROK_SPARKS
276#undef RAGNAROK_DRAWN_SPARKS
277#undef RAGNAROK_COLUMN_X
@ 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.
@ 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...
u8 gRagnarok_FlashCells[]
The flash picture for each three frames at the end of a flash's life.
u16 gBattleFx_MoteCells[]
Mote cells: particle sheets hold ten, cell n (from 0) n + 1 pixels wide and twice that tall.
struct BattleObj * GetBattleObjectSlotFar(s32 objectId)
Far call to BattleObjGet.
void BattleMotion_ApplyVariantMotionFar(s32 id, s32 variant)
void ObjectDispatch_SelectAnimationFar(void *raw, s32 no)
void ObjectDispatch_SetAnimationSpeedFar(struct DispatchObject *obj, s32 val)
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.
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.
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,...
#define RAGNAROK_DRAWN_SPARKS
of which flown
#define RAGNAROK_COLUMN_X(side, column)
gRagnarok_StrikeColumns has three columns for each side.
void BattleFx_RunRagnarok(struct BattleEffectArgument *effect)
A huge flaming blade swings down over the targets and two columns of light strike through them.
#define RAGNAROK_RING
of which drawn as the ring
#define RAGNAROK_SEEDED
columns given particles; the third is unused
#define RAGNAROK_FLASHES
flashes kept per column
#define RAGNAROK_SPARKS
sparks kept per column
#define RAGNAROK_COLUMNS
columns that strike
#define RAGNAROK_FLASH_CELLS
Where the flash graphics start: after the 64x128 sword image.
char ResourceId_FlameBladeSheet
char ResourceId_BlastSheet
char ResourceId_ParticleSpritesA
char ResourceId_FlashBurstSheet
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 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 field object as the object dispatcher's far calls take it.
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
An effect object that moves and draws one sprite: its position, scale, velocity and target,...
#define Q_16_16_TO_INT(v)
#define PARTICLES
The map cell buffer (gMapCellBuffer), which the effects borrow, has two views here: Ram_MapCellBuffer...