14#define VOLCANO_FRAMES 96
15#define VOLCANO_ERUPTION 200
16#define VOLCANO_TRICKLE 4
17#define VOLCANO_SPARK_POOL 1024
18#define VOLCANO_FLAME_IMAGE_ODD 0xdd0
19#define VOLCANO_FLAME_IMAGE_EVEN 0x10b4
78 for (i = 0; i != 4; i++) {
97 camera->
yaw = camera->
yaw + 192;
116 s32 scroll = (frame * 16 + pillar * 25) % 104;
118 draw[pillar & 1](canvas, work->sheet, screen.
x - 17,
119 screen.
y - scroll - 104, 34, 104);
120 draw[pillar & 1](canvas, work->sheet, screen.
x - 17,
121 screen.
y - scroll, 34, scroll);
124 screen.
x - 20, screen.
y - 24, 20, 37);
126 screen.
y - 24, 20, 37);
129 screen.
x - 20, screen.
y - 24, 20, 37);
131 screen.
y - 24, 20, 37);
149 angle = (
Random16() & 0x7fff) - 0x4000;
191 x = spark->
x += spark->
z;
193 spark->
z = spark->
z * 60 / 64;
198 }
else if (
x >= 0 &&
x >> 8 <= 126 &&
y >= 0) {
200 s32 size = (life - 17) / 8;
218#undef VOLCANO_ERUPTION
219#undef VOLCANO_TRICKLE
220#undef VOLCANO_SPARK_POOL
221#undef VOLCANO_FLAME_IMAGE_ODD
222#undef VOLCANO_FLAME_IMAGE_EVEN
@ SPRITE_COLOR_RED_TINT
red raised to full
@ POSE_DAMAGE
taking damage
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_ProcessPendingGraphicsTransfer(void)
Copies the canvas to VRAM once the effect has finished drawing a frame (transferPending): the 128x128...
void BattleFx_BeginCanvasLayer(s32 bgControl)
Opens the canvas layer: starts the background palette fade, makes BG2 the canvas, alpha-blended over ...
void BattleFx_EndCanvasLayer(void)
Closes the canvas layer: plays the closing sound, restores BG1's scroll and the projection centre,...
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_RELEASE_BLITTERS()
Frees the two blitters, the alternate first.
#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_GET_WORK_AND_CANVAS(cursor, work, canvas)
The work block and canvas occupy adjacent slots, starting at HEAP_SLOT_BATTLE_EFFECT.
#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_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_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 gVolcano_Counts[]
How many pillars stand, by variant.
u8 gVolcano_StartFrames[]
The frame each pillar starts.
s8 gVolcano_Depths[][4]
Each pillar's depth, by variant.
struct BattleObj * GetBattleObjectSlotFar(s32 objectId)
Far call to BattleObjGet.
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_CopyWords(volatile void *destination, const volatile void *source, s32 size)
#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.
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
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_OrangePaletteB
char ResourceId_FirePillarSheetA
char ResourceId_ParticleSpritesA
char ResourceId_RedPaletteB
s32 Scheduler_RemoveCallback(SchedulerCallback callback)
Unschedules the task running callback: clears its routine and gives it order 0x7fff,...
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
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 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
struct MotionObject * object
NULL once released.
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 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
An effect object that moves and draws one sprite: its position, scale, velocity and target,...
s32 x
16.16 fixed-point pixels
void * Resource_GetTableEntry(s32 index)
Returns the ROM address of resource index from the resource directory.
#define EFFECT_CLIP_BOUNDS
Clips overflow on all four sides.
#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...
void BattleFx_RunVolcano(struct BattleEffectArgument *effect)
One, two or four columns of fire (gVolcano_Counts by effect->variant) rise near the far edge on the t...
#define VOLCANO_FLAME_IMAGE_EVEN
the flame on even frames
#define VOLCANO_FLAME_IMAGE_ODD
the flame on odd frames
#define VOLCANO_SPARK_POOL
sparks in PARTICLES
#define VOLCANO_ERUPTION
sparks thrown as a pillar starts
#define VOLCANO_TRICKLE
and each frame after