57#define LOBBED_SHELLS_BURSTS ((struct EffectStep *)(Ram_MapCellBuffer + 0x1c00))
58#define LOBBED_SHELLS_SLOTS 16
59#define LOBBED_SHELLS_BURST_SLOTS 256
60#define LOBBED_SHELLS_SMOKE_CELLS 0x3e80
65#define LOBBED_SHELLS_SHATTER(mode) gLobbedShells_Records[(mode) * 2]
143 (target->
z - source->
z) >> 4);
151 if (effect->
side == 0) {
185 for (frame = 0; frame != total; frame++) {
195 if (frame >= k * 8) {
198 if (frame == k * 8 + 17) {
211 s32 step = (frame - k * 8) / 3;
218 draw[0](canvas, work->sheet + step * (32 * 24), position.
x - 16,
219 position.
y - 12, 32, 24);
221 draw[0](canvas, work->sheet + step * (24 * 32), position.
x - 12,
222 position.
y - 16, 24, 32);
239 if (records[row] == 0)
243 for (i = 0; i != count; i++) {
282 work->sheet + burst->
variant / 8 * (24 * 48) +
284 position.
x - 12, position.
y - 24, 24, 48);
293 draw[burst->
velocityX > 0 ? flip ^ 1 : flip](
315#undef LOBBED_SHELLS_BURSTS
316#undef LOBBED_SHELLS_SLOTS
317#undef LOBBED_SHELLS_BURST_SLOTS
318#undef LOBBED_SHELLS_SMOKE_CELLS
319#undef LOBBED_SHELLS_SHATTER
@ 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 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_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_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_FREE_PARTICLES(i, particles, count)
Marks particles[0] to particles[count - 1] free: a particle whose variant is -1 is not drawn or moved...
#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 gLobbedShells_ShardWidths[]
Lobbed shells: nine tumbling images in two sets, the second (cells 9 to 17) smaller.
u16 gLobbedShells_ShardOffsets[]
u8 gLobbedShells_ShardHeights[]
s8 gLobbedShells_Records[]
Two bytes for each lobbed shell mode.
struct BattleObj * GetBattleObjectSlotFar(s32 objectId)
Far call to BattleObjGet.
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)
void BattleFx_RunMadSpatter(struct BattleEffectArgument *effect)
Gold shells that burst into shards.
#define LOBBED_SHELLS_BURSTS
The bursts live after the shells in PARTICLES: 32 slots a target, of which 4 smoke puffs or 16 shards...
void BattleFx_RunStickyPoison(struct BattleEffectArgument *effect)
Lime shells that burst into smoke.
#define LOBBED_SHELLS_SMOKE_CELLS
the smoke pictures in the sheet
#define LOBBED_SHELLS_BURST_SLOTS
burst particles after the shells
void BattleFx_RunDecompose(struct BattleEffectArgument *effect)
Green shells that burst into smoke.
void BattleFx_RunBoneChiller(struct BattleEffectArgument *effect)
Blue shells that burst into smoke.
void BattleFx_RunStickyGoo(struct BattleEffectArgument *effect)
Shells in the spider web's colours that burst into smoke.
#define LOBBED_SHELLS_SLOTS
particles reserved for each target
void BattleFx_RunRottenBlood(struct BattleEffectArgument *effect)
Green shells that burst into shards.
#define LOBBED_SHELLS_SHATTER(mode)
Nonzero when the style's shells burst into shards instead of smoke: the first of the style's two entr...
void BattleFx_RunPoisonInk(struct BattleEffectArgument *effect)
Shells in Mars Djinn colours that burst into smoke.
void BattleFx_RunLobbedShells(struct BattleEffectArgument *effect, s32 mode)
Lobs a shell from the user at each target in turn, 8 frames apart.
#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.
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
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_LimePalette
char ResourceId_MarsDjinnSheet
char ResourceId_SpiderWebSheet
char ResourceId_GreenPalette
char ResourceId_GoldShellSheet
char ResourceId_SmokeSheet
char ResourceId_BluePalette
s32 Resource_DecodeType01(const void *source, void *destination)
Decodes a type-01 resource and returns its unpacked byte count.
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 frame
frame counter some effects keep, from 0
struct BattleEffectArgument * effect
the command being run
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 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
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
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...