7#define DJINN_HEAL_SWIRL_FRAMES 98
8#define DJINN_HEAL_SWIRL_MOTES 32
52 for (i = 0; i != 64; i++) {
71 SET_VECTOR(delta, (target[0] - position[0]) / 40,
72 (target[1] - position[1]) / 40, (target[2] - position[2]) / 40);
80 if (frame >= 30 && frame < 70) {
81 position[0] += delta[0];
82 position[1] += delta[1];
83 position[2] += delta[2];
97 if (frame > i && spark->
variant == 0) {
119 size = 9 - (screen.
depth - 250) / 64;
122 if (frame > i + 30) {
123 s32 dx = -spark->
x >> 8;
124 s32 dy = -spark->
y >> 8;
125 s32 dz = -spark->
z >> 8;
138 draw[1](canvas, work->sheet, screen.
x - 10, screen.
y - 17, 20, 34);
145 for (i = 0; i != 512; i++) {
153 for (frame = 0; frame != work->
effect->
count * 8 + 72; frame++) {
158 target[1] += 0x40000;
160 target[2] +
Trig_Sin(frame << 11) * 40);
163 callbacks[0](canvas, work->sheet, view.
x - 10, view.
y - 17, 20, 34);
167 s32 start = member * 8;
174 if (frame == start + 30)
176 if (frame == start + 40)
179 if (frame == start + 64)
183 for (i = 0; i != 64; i++) {
186 if (frame > start + i / 2) {
187 s32 xx = (spark->
x >> 8) * (spark->
x >> 8);
188 s32 yy = (spark->
y >> 8) * (spark->
y >> 8);
189 s32 zz = (spark->
z >> 8) * (spark->
z >> 8);
200 cellIndex = 3 - (view.
depth - 314) / 128;
201 cellIndex = (i * 4 + frame) % 9;
205 u32 half = edge >> 1;
207 draw[1](canvas, cell, view.
x - half, view.
y - half, edge, edge);
209 spark->
x -= spark->
x / distance;
210 spark->
y -= spark->
y / distance;
211 spark->
z -= spark->
z / distance;
250#undef DJINN_HEAL_SWIRL_FRAMES
251#undef DJINN_HEAL_SWIRL_MOTES
@ SPRITE_COLOR_WHITE
solid colour 15, white
struct BattleCamera * gCameraWork
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 Resource_LoadAndDecompress(s32 id, void *dst, s32 skipPalette, s32 copyPalette)
Decompresses a resource whose first 128 bytes may be a palette.
#define DJINN_HEAL_SWIRL_FRAMES
frames of the swirl
void Camera_ApplyPhasedDelta(void)
Turns the battle camera by cameraDelta.
UNUSED void BattleFx_RunDjinnHeal(struct BattleEffectArgument *effect)
A small Mercury Djinni healing the party: the user glows while motes swirl round a point that rises f...
#define DJINN_HEAL_SWIRL_MOTES
motes swirled in
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.
#define EFFECT_PRESENT_FRAME(work)
Ends a frame of a canvas effect: marks the canvas ready for the transfer callback,...
@ 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_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_VIEW_FROM_CAMERA(camera)
Starts a frame's 3D projection from the battle camera: resets the transform, then looks from camera->...
u8 gBattleFx_PuffSizes[]
Each puff cell's side.
u16 gBattleFx_PuffCells[]
Nine square puff cells, read by the falling, frost, healing, Djinni heal and Boreas parts.
struct BattleObj * GetBattleObjectSlotFar(s32 objectId)
Far call to BattleObjGet.
void AudioCommand_PlayFar(s32 id)
@ HEAP_SLOT_BATTLE_EFFECT
static s32 Iwram_Sqrt(s32 value)
#define SET_VELOCITY(p, vx, vy, vz)
#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.
#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,...
#define CLAMP(v, low, high)
Keeps v within low to high, the low bound tested first.
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_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...
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...
char ResourceId_SparkleDots
char ResourceId_MercuryDjinnSmallSheet
char ResourceId_ParticleSpritesA
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 cameraDelta
camera yaw turned per effect frame
s32 cameraPhase
The effect sets 1 after a frame; Camera_ApplyPhasedDelta then turns the whole cameraDelta and sets 0,...
struct BattleEffectArgument * effect
the command being run
struct MotionObject * object
NULL once released.
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
An effect object that moves and draws one sprite: its position, scale, velocity and target,...
s32 z
16.16 fixed-point pixels
s32 x
16.16 fixed-point pixels
#define PARTICLES
The map cell buffer (gMapCellBuffer), which the effects borrow, has two views here: Ram_MapCellBuffer...
DrawRectangle BlitterPair[2]
A blitter pair: [0] built in HEAP_SLOT_BLITTER and [1] in HEAP_SLOT_BLITTER_ALTERNATE (BattleFx_Fetch...