1#ifndef ALCHEMY_UNIT_EFFECT_EFFECT_H
2#define ALCHEMY_UNIT_EFFECT_EFFECT_H
221#define PARTICLES ((struct EffectStep *)Ram_MapCellBuffer)
224#define EFFECT_CLIP_BOUNDS (COMPOSITE_CLIP_X | COMPOSITE_CLIP_Y)
229#define Q_16_16_TO_INT(v) ((s32)(v) >> 16)
231#define Q_16_16_TO_INT(v) (((s16 *)&(v))[1])
248#define EFFECT_BLITTERS ((DrawRectangle *)gWorkSlot)
422 s32 timerSlot,
s32 timerFrames);
void BattleFx_RunAnnihilation(struct BattleEffectArgument *effect)
The user closes on the first target and fire bursts from it in a shower of shards.
void BattleFx_RunAtalanta(struct BattleEffectArgument *effect)
Rain of blades: under a violet sky, a 3x3 formation of objects flies along a stored path while sixtee...
The battle effect argument and the rectangle-drawing routines effects call.
BattleEffectDrawRectangle DrawRectangle
BattleEffectWork, the running battle effect's work, and its animation objects.
void BattleFx_RunRingAndSparkScene(struct BattleEffectArgument *effect)
Plays the selected ring-and-spark strike, restoring the user motion after it.
void BattleFx_RunBeamSequence(struct BattleEffectArgument *effect)
Draws the selected beam and its projected sparks over the first target: a beam, arc or wave shoots fr...
void BattleFx_RunBind(struct BattleEffectArgument *effect)
A triangle of light spins and shrinks onto the first target for 64 frames, then a rune stands on the ...
void BattleFx_RunTriangleStrike(struct BattleEffectArgument *effect)
The spinning triangle and rune of BattleFx_RunBind without the Djinni; on frame 46 the user steps up ...
UNUSED void Graphics_ConvertBackgroundToBlueRamp(void)
Turns the screen into shades of blue, top down, with a ragged edge.
s32 BattleFx_BuildBlitter(s32 slot, s32 widthShift, s32 heightShift, s32 flags, u32 mode)
Writes a drawing routine for the canvas into heap slot slot, built from the template BattleFx_Composi...
void BattleFx_RunBolt(struct BattleEffectArgument *effect)
A bolt of lightning strikes each target in turn, 8 frames apart.
void BattleFx_RunBoreas(struct BattleEffectArgument *effect)
Rocks and ice blocks: a window opens on rocks that crumble, a big ice block drops and throws up spray...
void BattleFx_RunRansack(struct BattleEffectArgument *effect)
Ransack: the same five strikes as Bear Claw (mode 0).
void BattleFx_RunGust(struct BattleEffectArgument *effect)
Gust: the burst scene in mode 6, 7 or 8 as the variant grows, one to three strikes that each fill the...
void BattleFx_RunFlyingAttack(struct BattleEffectArgument *effect)
Flying Attack: the burst scene in mode 3, 4 or 5 as the variant grows, one to three strikes.
void BattleFx_RunBearClaw(struct BattleEffectArgument *effect)
Bear Claw: five strikes, the burst scene in mode 0.
void BattleFx_RunFreebiteRush(struct BattleEffectArgument *effect)
Freebite Rush: nine strikes in the blue palette (mode 2).
void BattleFx_RunBacteriaRush(struct BattleEffectArgument *effect)
Bacteria Rush: seven strikes in the lime palette (mode 1).
void BattleFx_RunBurstScene(struct BattleEffectArgument *effect, s32 mode)
Flurry: the user closes on the first target and strikes it again and again; each strike shows an arc ...
void BattleFx_RunDeadlyGas(struct BattleEffectArgument *effect)
The user fires a stream of Mars-coloured bursts at the targets, from 28 pixels in front of it.
void BattleFx_ArmBg2AffineHBlankDma(void)
Arms DMA 0 to copy one word of gBattleFxWork's bg2xLines table into BG2X at each horizontal blank,...
void BattleFx_RunBurstShower(struct BattleEffectArgument *effect, s32 mode)
Burst shower: for 48 frames the user fires one burst a frame at a random point near one of the target...
void BattleFx_RunStormBlessing(struct BattleEffectArgument *effect)
Shows violet lightning between the user and targets instead of bursts: a bolt flickers through three ...
void BattleFx_RunFireBlessing(struct BattleEffectArgument *effect)
The user fires a stream of flash bursts at the targets, one a frame, each towards a random point near...
void BattleFx_RunEvilBlessing(struct BattleEffectArgument *effect)
The user fires a stream of demon faces at the targets, from 16 pixels in front of it.
void BattleFx_RunAcidBlessing(struct BattleEffectArgument *effect)
Fires pink bursts from 16 pixels below the normal origin.
void BattleFx_RunDarkBlessing(struct BattleEffectArgument *effect)
The user fires a stream of grey bursts at the targets, which turn solid black and stay so.
void BattleFx_RunWaterBlessing(struct BattleEffectArgument *effect)
The user fires a stream of bursts at the targets in the water-spray palette.
void Graphics_ApplyWindowBlendRegisters(void)
Writes the window, display and blend registers the effect keeps in its work, all at once.
void Palette_StepFadeTransfer(void)
Darkens the battle backdrop while the canvas is open: for fadeFrames frames, writes the backdrop's co...
void BattleFx_SetupCanvasTileMap(void)
Shows the canvas on BG1 instead of BG2, at its own size: BG1 becomes a 256-colour layer whose map poi...
void ObjectGroup_TickMemberTimers(void)
Counts down each target's flash timer, which ObjectGroup_UpdateMembers starts; when one runs out,...
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 Display_ApplyBg2Reference(void)
Writes the effect's BG2 reference point (work->bg2x, work->bg2y) to BG2X and BG2Y.
void BattleFx_EndCanvasLayer(void)
Closes the canvas layer: plays the closing sound, restores BG1's scroll and the projection centre,...
void BattleFx_FlushPendingGraphicsTransfer(void)
Copies a full-screen picture to VRAM once the effect has finished drawing a frame: the 0x7800 bytes o...
void BattleFx_HideBg1AndRestoreBackdrop(void)
Hides BG1 and the windows and starts bringing the backdrop's palette back.
void BattleFx_ClearActorTimers(void)
Clears every target's flash timer (work->actorTimers).
void BattleFx_BeginTiledCanvas(s32 bgControl)
Opens the canvas layer with BG2 a wrapping 256x256 map: each row of the map is the canvas's 16 tiles ...
void BattleFx_OpenCanvasLayer(s32 bgControl)
Opens the canvas layer as BattleFx_BeginCanvasLayer does, but with the windows off until the end,...
void BattleFx_DrawClippedCanvasLine(s32 x0, s32 y0, s32 x1, s32 y1, s32 color)
Draws a line on the 128x128 8bpp canvas (16 tiles across), keeping the brighter colour where it cross...
void BattleFx_WipeCanvas(s32 mode, s32 value)
Wipes the whole canvas to one colour with a ragged edge: each row (or column) lags a random 0 to 63 p...
void BattleFx_StepPaletteToResource(s32 resourceId)
Moves each RGB555 channel of background colours 0 to 63 one level towards the resource palette.
void BattleFx_RunCastingImpact(struct BattleEffectArgument *effect, s32 mode)
Gathers sparks around the caster, launches the Djinni and draws the impact on the first target.
void BattleFx_RunCondemn(struct BattleEffectArgument *effect)
A tall panel (57x98) swings across the screen three times, each pass fading out through a ripple,...
void BattleFx_RunCybele(struct BattleEffectArgument *effect)
Thorn vines: thorns fly in from the right, vines grow out of the ground and lift the targets while sp...
void BattleFx_RunShatteringOpening(struct BattleEffectArgument *effect)
The shattering opening of the battle on the Venus aerie storm backdrop: the screen turns white and a ...
void BattleFx_DrawStreaks(void)
Draws a frame of the element streak burst: on its first frame seeds 256 streaks with random axes,...
void BattleFx_RunDeathPlunge(struct BattleEffectArgument *effect)
The user runs 9/10 of the way to the first target, then both leap and turn upside down in the air; on...
void BattleFx_EndElementStreaks(void)
Ends the element streak burst that BattleFx_StartElementStreaks started: stops its callbacks and the ...
void BattleFx_StartElementStreaks(s32 element)
Starts the element streak burst and returns at once: opens the canvas and schedules BattleFx_DrawStre...
UNUSED void BattleFx_RunBladeRain(struct BattleEffectArgument *effect)
Drops 16 swords, one every 4 frames, slanting in towards the first target (the middle of the canvas,...
void BattleFx_RunElementBurst(struct BattleEffectArgument *effect)
The burst of an element over a unit, for 56 frames: sparks flare at the four corners around the unit,...
void BattleFx_RunElementPillar(struct BattleEffectArgument *effect)
The glow of an element around a unit: a symmetrical pillar of light stands at the unit's feet while m...
void BattleFx_ConfigureEffectDisplay(void)
Puts the battle screen back into the display state every effect starts from and ends with: no blendin...
void BattleFx_AdvanceBg2OnInterval(void)
Slides the affine BG2 in steps: once every scrollInterval frames, writes the work block's reference p...
void BattleFx_ArmWin0HBlankDma(void)
Restarts DMA 0 as an HBlank transfer of one WIN0H value a line from PARTICLES (Ram_MapCellBuffer),...
void BattleFx_AdvanceScrollOnInterval(void)
Scrolls BG1 by (scrollStepX, scrollStepY) once every scrollInterval frames.
void BattleFx_RunMars(struct BattleEffectArgument *effect)
Mars Djinni flames: a glowing orb flares, the small Mars Djinni dives to the ground,...
void Graphics_TransposeCopy(const u8 *src, u8 *dst, s32 w, s32 h)
Copies a w x h byte picture into an h x w one turned 90 degrees clockwise: the top row of src becomes...
void BattleFx_RunMercury(struct BattleEffectArgument *effect)
Mercury Djinni flames: the small Mercury Djinni spirals around (96, 60) and fires five blue flames to...
void BattleFx_RunJupiter(struct BattleEffectArgument *effect)
Jupiter Djinni fall: the small Jupiter Djinni spirals while eight flameballs fall from the top right ...
void Resource_LoadAndDecompress(s32 id, void *dst, s32 skipPalette, s32 copyPalette)
Decompresses a resource whose first 128 bytes may be a palette.
void BattleFx_RunVenus(struct BattleEffectArgument *effect)
Venus Djinni columns: the small Venus Djinni sways while ten columns of flame in its colours rise fro...
void BattleFx_RunDew(struct BattleEffectArgument *effect)
With a Mercury Djinni: the same beams of light as Revive.
void BattleFx_RunDjinnBeams(struct BattleEffectArgument *effect, s32 mode)
When effect->prelude is 1, a Djinni appears, sways and then rises out of sight.
void BattleFx_RunRevive(struct BattleEffectArgument *effect)
With a Venus Djinni: beams of light, where motes drift down over each target and a column of light fa...
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...
void BattleFx_RunDragonCloud(struct BattleEffectArgument *effect)
A flame leaves the user along a stored path with a fading trail of 19 copies behind it,...
void BattleFx_RunBreak(struct BattleEffectArgument *effect)
Ice shards burst up from each target in turn, 20 frames apart, tinting the target as they go,...
void BattleFx_RunDrain(struct BattleEffectArgument *effect)
Drain: motes of light burst from each target in turn, 20 frames apart, and are pulled into the centre...
void BattleFx_CallDoNothing(s32 count)
Calls the empty BattleFx_DoNothing count times, without waiting for a frame: a busy delay that change...
void BattleFx_RunTableEffect(struct BattleEffectArgument *effect)
Runs an ordinary battle effect: takes the effect's sheet, work and canvas, runs the entry of gBattleF...
void ObjectGroup_UpdateMembers(s32 actorId, s32 palette, s32 animation, s32 timerSlot, s32 timerFrames)
Updates every animation group of one battler's object.
void BattleFx_BuildWindowEdgeTable(void)
Builds window 0's right edge for every scanline and restarts the HBlank DMA that writes it to WIN0H e...
void BattleFx_SetupBlendedDisplay(void)
Shows the BG1 battle background behind a cleared canvas: clears the canvas buffer and the 16 KiB of V...
void BattleFx_SelectLivingTargets(struct BattleEffectArgument *effect)
Shows the battle objects of every unit with HP left on the targets' side: the enemies (units 128 to 1...
void BattleFx_RunSceneEffect(struct BattleEffectArgument *effect)
Runs one of the large battle effects, the ones whose presentation flags have bit 15 set: takes the ef...
UNUSED void BattleFx_InitTilemapAndFlushQueue(void)
Writes the tiled canvas tilemap for BG2 (priority 1), then closes the canvas layer again,...
void BattleFx_RunFrost(struct BattleEffectArgument *effect)
Rising motes: motes spiral upwards while ice columns spring up one every 3 frames from frame 36; at t...
void BattleFx_RunVine(struct BattleEffectArgument *effect)
Rising vines: sixteen green vines grow from the middle of the row of targets, 2 frames apart,...
void BattleFx_RunThorn(struct BattleEffectArgument *effect)
Rising thorns: thorns burst from the ground one every 8 frames, throwing up dust from their roots.
void BattleFx_RunPunji(struct BattleEffectArgument *effect)
Grows green pillars from the ground, scattering dust from each root.
void BattleFx_RunGrowingColumns(struct BattleEffectArgument *effect, s32 mode)
Vines (mode 0) or green pillars (mode 1) grow one every 4 frames, alternately mirrored,...
void BattleFx_RunGrowth(struct BattleEffectArgument *effect)
Grows vines from the ground, scattering dust from each root.
BattleFxHandler gBattleFx_EffectHandlers[BATTLE_FX_KIND_COUNT - 1]
The effect handlers, indexed by effect kind minus one, which BattleFx_RunTableEffect calls; kind zero...
void BattleFx_RunSmokeBomb(struct BattleEffectArgument *effect)
A fountain of grey motes and puffs of smoke bursts up beside the targets and falls back,...
void BattleFx_SpawnObjects(s32 entryCount, s32 source, u32 priority)
Creates the effect's animation objects in gBattleFxWork's objects.
void BattleFx_DoNothing(void)
Does nothing.
void BattleFx_RunBlast(struct BattleEffectArgument *effect)
A fountain of fire-coloured motes and puffs of smoke bursts up beside the targets and falls back,...
void BattleFx_RunEruption(struct BattleEffectArgument *effect, s32 mode)
A fountain of motes and puffs of smoke bursts up beside the targets and falls back,...
void BattleFx_RunIce(struct BattleEffectArgument *effect)
Ice shards rain down diagonally onto the targets' side of the field and shatter into puffs of sparkle...
void BattleFx_RunDouse(struct BattleEffectArgument *effect)
Blue bolts streak down diagonally onto the targets' side of the field, each bursting into a fountain ...
void BattleFx_RunFire(struct BattleEffectArgument *effect)
Homing embers: embers burst from the top of the user two a frame, turn towards the targets 48 frames ...
void BattleFx_RunFlare(struct BattleEffectArgument *effect)
Flame arc: nine flames rise one after another, 4 frames apart, along a half circle,...
UNUSED s32 BattleFx_BuildCenteredIndexList(BattleEffectIndexWindow *window, s16 *output)
List the indices within indexRadius of where currentValue sits in values, keeping only those from 0 t...
void BattleFx_RunGaia(struct BattleEffectArgument *effect)
Rising wall: the ground swells, a wall of rock rises from it, stands while rocks tumble up its face a...
void BattleFx_RunRumble(struct BattleEffectArgument *effect)
Eight lights in Mars Djinn colours burst out of the user and are pulled into each target.
void BattleFx_RunDemonNight(struct BattleEffectArgument *effect)
Sixteen pink lights burst out of the user and are pulled into each target, with the heavy impact soun...
void BattleFx_RunHaunting(struct BattleEffectArgument *effect)
Twelve lights in Mercury Djinn colours burst out of the user and are pulled into each target.
void BattleFx_RunGatheringLights(struct BattleEffectArgument *effect, s32 mode)
For each target in turn, 20 frames apart, lights burst out of the user, one every 2 frames; from 30 f...
void BattleFx_RunHail(struct BattleEffectArgument *effect)
Water burst: after a Mercury Djinni enters, ice chips burst out of the first target and waves rise al...
void BattleFx_RunGround(struct BattleEffectArgument *effect)
Venus Djinni rock toss: after a Venus Djinni enters, six rocks rise from the user shedding chips,...
void Camera_ApplyShake(s32 rangeX, u32 rangeY)
Shakes the battle view while gBattleFxWork's shakeFrames lasts, moving BG1 and the projection centre ...
void BattleFx_RunCure(struct BattleEffectArgument *effect)
Cure (mode 2): a ring of healing motes below each target closes in on it, in the blast sheet's colour...
void BattleFx_RunPsyCrystal(struct BattleEffectArgument *effect)
Psy Crystal: healing motes gather around each target in the Mars Djinni palette; with a prelude,...
void BattleFx_RunCurePoison(struct BattleEffectArgument *effect)
Cure Poison: sparkles twinkle around each target, four more a frame, and go out one by one instead of...
UNUSED void BattleFx_RunHealingMotesMode4(struct BattleEffectArgument *effect)
Healing sparkles with scattering style 4, sent out from each target, as Cure Poison plays them for va...
void BattleFx_RunHealingMotes(struct BattleEffectArgument *effect, u32 mode)
Healing sparkles: motes of light scattered around each target swirl in towards it,...
void BattleFx_RunPly(struct BattleEffectArgument *effect)
Ply: sparkles of light swirl around each target and close in on it, in the ice shard's or ice block's...
void BattleFx_RunTonic(struct BattleEffectArgument *effect)
Tonic (scattering style 5): sparkles twinkle around each target, turning on two axes,...
void BattleFx_RunWish(struct BattleEffectArgument *effect)
Wish (scattering style 1): healing motes tumble in from all around each target.
void BattleFx_RunImpactBurst(s32 formation, s32 x, s32 y)
Opens an impact flash and scatters sparks and fragments, keeping the effect's objects in formation fo...
void BattleFx_RunHelmSplitter(struct BattleEffectArgument *effect)
The user leaps at the first target and strikes through a fire swirl; on frame 18 the target flashes a...
void BattleFx_PlaceFormationObjects(s32 formation, s32 x, s32 z)
Arranges work->objects in a formation; x and z are its origin in 16.16 pixels.
void BattleFx_RunJudgment(struct BattleEffectArgument *effect)
The battle wipes away to a violet sky where a formation flies forward while motes gather into it,...
void BattleFx_RunKirin(struct BattleEffectArgument *effect)
Over a scrolling forest a row of objects rides in on a wave trailing fire, then sweeps across the tar...
void BattleFx_RunMadSpatter(struct BattleEffectArgument *effect)
Gold shells that burst into shards.
void BattleFx_RunStickyPoison(struct BattleEffectArgument *effect)
Lime shells that burst into smoke.
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.
void BattleFx_RunRottenBlood(struct BattleEffectArgument *effect)
Green shells that burst into shards.
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.
void BattleFx_RunRecovery(struct BattleEffectArgument *effect)
A wide wall of fire, without a shake.
void BattleFx_FetchRectangleBlitters(s32 flip, BlitterPair out)
Builds the two usual routines that draw onto the 128x128 canvas, both clipped on both axes.
void BattleFx_RunBerserk(struct BattleEffectArgument *effect)
The wall rises wide and shakes the screen hard.
void BattleFx_RunMirroredWall(struct BattleEffectArgument *effect, s32 mode)
Raises a symmetrical wall (the EarthWall images) at the first target's feet for 48 frames; the target...
void BattleFx_RunSpasm(struct BattleEffectArgument *effect)
The wall rises with a long gentle shake and the recovery sound.
void BattleFx_RunNeptune(struct BattleEffectArgument *effect)
Over dusk clouds a formation of objects flies in through rising spray, gathers a ring of flares into ...
void Graphics_ResetBg2Pa(void)
Sets BG2's horizontal scale back to one texel a pixel, for the lines above Graphics_SetBg2AffineScale...
void Graphics_SetBg2AffineScaleHalf(void)
Stretches BG2 to twice its width from the current line down.
void BattleFx_RunNereid(struct BattleEffectArgument *effect)
A formation of twelve objects sweeps in among embers and columns of fire, and explodes.
UNUSED void BattleFx_RunTargetBursts(struct BattleEffectArgument *effect)
Target bursts: on each target in turn, 8 frames apart, a burst flares up in the middle while five puf...
UNUSED void BattleFx_RunOrbitingSkulls(void)
Orbiting skulls: three skulls circle each target in turn, 16 frames apart, for 64 frames each,...
UNUSED void BattleFx_RunSwirlingStars(struct BattleEffectArgument *effect)
Swirling stars: 64 stars scattered around a point 80 pixels up spin about it, each on its own axis,...
void BattleFx_RunMeteor(struct BattleEffectArgument *effect)
A formation rises out of a dissolving starfield and bursts into embers and flashes: the particle stre...
void BattleFx_RunOuterSpace(struct BattleEffectArgument *effect)
The user leaps up, and two objects rise out of a dissolving starfield and burst into embers and flash...
void BattleFx_ArmPaletteHBlankDma(void)
Arms DMA 0 to write one halfword of the table at work->sheet + 0x1f80 into background colour 0 at eac...
void BattleFx_RunParticleStreams(struct BattleEffectArgument *effect, s32 mode)
The stream runs in two halves.
void Palette_BrightenBgEntries(s32 blueStep, s32 greenStep, s32 redStep)
Adds per-channel steps to background colours 1 to 63, capped at 31.
void BattleFx_RunHaunt(struct BattleEffectArgument *effect)
Skulls close in on each target in turn.
void BattleFx_RunOrbitingSpirals(struct BattleEffectArgument *effect)
Four spirals circle 40 pixels above each target in turn, 16 frames apart, for 60 frames each,...
void BattleFx_RunPlanetDiver(struct BattleEffectArgument *effect)
The user flashes and leaps into the air, turns into a ball of fire, falls onto the first target and b...
void BattleFx_RunNova(struct BattleEffectArgument *effect)
Bursts at (60, 48), the canvas behind the battle's first layer (priority 1).
void BattleFx_RunPlasma(struct BattleEffectArgument *effect)
Pillars of lightning strike one every 8 frames, each with a white flash, throwing sparks up from the ...
void BattleFx_RunSparkGroups(struct BattleEffectArgument *effect, s32 mode)
One to three bursts, 8 frames apart: each flashes, rings itself with twelve smaller flashes that fade...
void BattleFx_RunDynamite(struct BattleEffectArgument *effect)
Orange bursts at (60, 64), the canvas in front (priority 0).
void EffectPosition_ProjectBattler(s32 id, struct EffectPosition *position)
The screen position of a battler, 16 pixels higher.
void EffectPosition_ProjectScaledBattler(s32 id, struct EffectPosition *position)
The screen position of a battler, scaled for the battle view, 16 pixels higher.
void BattleFx_DispatchByIdRange(struct BattleEffectArgument *effect)
Runs a battle effect from the second range of kinds: 100 to 135 are the casting impacts (kind - 100),...
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,...
void EffectPosition_ProjectSprite(s32 id, struct EffectPosition *position)
The screen position of a battler's sprite, at its scaled height, 16 pixels higher.
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...
void BattleFx_ProbeKeysForExtendedActor(void)
Reads the held keys when the first target is an enemy (id 128 or more) and does nothing with them.
s32 BattleUnit_ProjectToScreen(s32 unit, s32 *screen)
Projects a battler onto the screen, raised by half its table height (the table holds the full height ...
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...
void Graphics_UpdatePhasePalette(s32 frame, s32 redPhase, s32 greenPhase, s32 bluePhase)
Rebuilds the background palette's first ramp as a grey ramp whose red, green and blue each sway with ...
void BattleFx_RunPrism(struct BattleEffectArgument *effect)
Crystals drop out of the sky onto the targets' side, 8 frames apart, and shatter on the ground into 1...
void BattleFx_RunProcne(struct BattleEffectArgument *effect)
A whirlwind lifts the targets, then comets from a block of objects in a violet sky strike them.
void BattleFx_RunWingBeat(struct BattleEffectArgument *effect)
Ten small yellow sparks stream level at each target, one a frame.
UNUSED void BattleFx_InitializeRisingObject(s32 id)
Sends a battler back to its place (its anchor) with a hop.
void BattleFx_RunWingFlutter(struct BattleEffectArgument *effect)
Five yellow sparks fly level at each target, five frames apart.
void BattleFx_RunCuttingEdge(struct BattleEffectArgument *effect)
From the user's action pose, one large comet in ice colours flies at each target and bursts into 80 s...
void BattleFx_RunDjinniEntrance(struct BattleEffectArgument *effect, s32 mode, s32 side, s32 anchor, s32 *outX, s32 *outY)
Djinni entrance: sparks swirl around a point that travels from the user to the goal and gather into t...
void BattleFx_RunProjectileVolley(struct BattleEffectArgument *effect, s32 mode)
Projectile volley: shots fly from the user to each target and burst into a flash and sparks when they...
void BattleFx_RunIceBlessing(struct BattleEffectArgument *effect)
Sixty ice chips stream at each target, one a frame, without knocking it back.
void BattleFx_RunSleet(struct BattleEffectArgument *effect)
Thirty ice chips fall from high above the user onto each target, without shaking the screen or knocki...
void BattleFx_RunHeatWave(struct BattleEffectArgument *effect)
From the user's action pose, seven fireballs trailing embers fly at each target, two frames apart,...
void BattleFx_RunSlash(struct BattleEffectArgument *effect)
Six comets fly at each target, three frames apart, and burst into a flash and sparks; the effect's va...
void BattleFx_RunBlizzard(struct BattleEffectArgument *effect)
From the user's action pose, sixty ice chips stream at each target, one a frame, scattered up and dow...
void BattleFx_RunCrazyVoice(struct BattleEffectArgument *effect)
Ten pellets fly slowly at each target and bounce off it, up or down at random.
void BattleFx_RunShuriken(struct BattleEffectArgument *effect)
Four spinning shurikens fly at each target, five frames apart, and vanish once past it.
void BattleFx_RunWingStroke(struct BattleEffectArgument *effect)
Ten large yellow sparks stream level at each target, one a frame, spread up and down.
void BattleFx_SetApproachMotion(s32 id, s32 targetId, s32 frames)
Moves a battler 80% of the way to another one over a number of frames, in its action pose.
void BattleFx_RunQuake(struct BattleEffectArgument *effect)
Rock wall: three rock pillars rise from the left, 4 frames apart, and sink again, throwing the target...
void BattleFx_RunRagnarok(struct BattleEffectArgument *effect)
A huge flaming blade swings down over the targets and two columns of light strike through them.
void BattleFx_RunRamses(struct BattleEffectArgument *effect)
Over the desert backdrop a formation stands while an orb circles above it, drops three times throwing...
void BattleFx_RunRay(struct BattleEffectArgument *effect)
Closing bolts: four bolts turn in towards the centre for 16 frames, scattering sparks from their root...
A sprite's screen position and scale.
void BattleFx_RunBoneCharge(struct BattleEffectArgument *effect)
Rushes the target and scatters sparks in the fire pillar palette.
void BattleFx_RunHeadbutt(struct BattleEffectArgument *effect)
Rushes the target and scatters sparks in the blast palette.
void BattleFx_RunOnslaught(struct BattleEffectArgument *effect)
Rushes the target and scatters sparks in the pink-burst palette.
void BattleFx_RunBruteForce(struct BattleEffectArgument *effect)
Rushes the target and scatters sparks in the ice-block palette.
void Graphics_PackTileRows(u8 *src, u8 *dst, s32 stride, s32 rowCount)
Packs 288 rows of 40 bytes to half width, keeping every second byte (the bytes of the odd columns win...
void BattleFx_RunRushingStrike(struct BattleEffectArgument *effect, s32 mode)
Rushing strike: the user rushes at the first target and strikes it on frame 10; a ring flares where i...
void BattleFx_RunSpinningBeat(struct BattleEffectArgument *effect)
A magenta swipe that throws the target into the air.
void BattleFx_RunSpiderWeb(struct BattleEffectArgument *effect)
A spider web spreads over the targets, drawn as four mirrored 32x32 quarters around the point between...
void BattleFx_RunSwirlSwipe(struct BattleEffectArgument *effect, s32 mode)
A swirling swipe across the first target, six images four frames each, from the user's side: the firs...
void BattleFx_RunPoisonBeat(struct BattleEffectArgument *effect)
A lime swipe that knocks the target back.
void BattleFx_RunSpire(struct BattleEffectArgument *effect)
Shattering rocks: boulders drop along the row of targets, centred on it, and burst into tumbling shar...
void BattleFx_RunShiningStar(struct BattleEffectArgument *effect)
Eight spinning star outlines fall from 120 pixels above the user towards the first target,...
void BattleFx_RunAstralBlast(struct BattleEffectArgument *effect)
Three star-shaped rings of light fly from 40 pixels above the user at the first target,...
void BattleFx_RunGranite(struct BattleEffectArgument *effect)
Gathers stat-boost light and displays a violet streak in Venus colours.
void BattleFx_RunWard(struct BattleEffectArgument *effect)
Gathers stat-boost light and displays a shield in Jupiter colours.
void BattleFx_RunDull(struct BattleEffectArgument *effect)
Breaks the dagger picture into shards that fade through darker copies.
void BattleFx_RunZephyr(struct BattleEffectArgument *effect)
Gathers stat-boost light and displays a wisp without replacing its palette.
UNUSED void BattleFx_RunStatReductionMode3(struct BattleEffectArgument *effect)
Breaks the shield picture into fading shards with style 3, which plays as style 2 does.
void BattleFx_RunImpair(struct BattleEffectArgument *effect)
A shield appears over each target and breaks into shards that fade through darker copies,...
void BattleFx_RunWeaken(struct BattleEffectArgument *effect)
A shield appears over each target and breaks into fading shards, in the pink burst's colours (style 2...
void BattleFx_RunFlash(struct BattleEffectArgument *effect)
Gathers stat-boost light and displays a violet streak in Mars colours.
void BattleFx_RunGuard(struct BattleEffectArgument *effect)
Gathers stat-boost light and displays a shield in Mars colours.
void BattleFx_RunImpact(struct BattleEffectArgument *effect)
Gathers stat-boost light and displays a dagger in Mars colours.
void BattleFx_RunStatBoost(struct BattleEffectArgument *effect, u32 mode)
Flares of light swirl in to the centre of each target, one target every 8 frames, burst,...
void BattleFx_RunStatReduction(struct BattleEffectArgument *effect, s32 mode)
Stat cuts: a dagger (mode 0) or a shield (other modes) appears over each target, 4 frames apart,...
void BattleFx_RunWickedHowl(struct BattleEffectArgument *effect)
Red streaks.
void BattleFx_RunStreakVolley(struct BattleEffectArgument *effect, s32 mode)
Fires STREAKS_MAX streaks at each target from 20 pixels above the user, one every 6 frames,...
void BattleFx_RunSleepStar(struct BattleEffectArgument *effect)
Rising motes that drift onto the targets and strike.
void BattleFx_RunBansheeHowl(struct BattleEffectArgument *effect)
Violet streaks.
void BattleFx_RunShriek(struct BattleEffectArgument *effect)
Lime streaks.
UNUSED void BattleFx_RunLimeStreaks(struct BattleEffectArgument *effect)
The streak volley in lime. UNUSED: no effect table entry points here.
void BattleFx_RunSonicWave(struct BattleEffectArgument *effect)
Ember streaks.
void BattleFx_RunMoteFountain(struct BattleEffectArgument *effect, s32 mode)
Motes burst out of the user in every direction and float upwards, wobbling, for 128 frames; a new gro...
void BattleFx_RunSoothingStar(struct BattleEffectArgument *effect)
Rising healing motes.
void BattleFx_RunWarCry(struct BattleEffectArgument *effect)
Cyan streaks.
The command shared by an effect's caller, dispatcher and handlers.
What BattleFx_BuildCenteredIndexList (unused) reads: a value to find in a list, and how many indices ...
s32 entryLimit
indices from this up are dropped
s16 values[1]
indexRadius * 2 + 1 values, searched in order
s32 unk_18[3]
not named by TBS code
s32 indexRadius
indices kept either side of where it sits
s32 currentValue
the value looked for in values
s32 unk_00[3]
not named by TBS code
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...
Two-dimensional {x, y} pair for position or velocity, a local of the summon scenes (Nereid,...
s32 x
16.16 pixels in every scene that uses it
void BattleFx_RunDelude(struct BattleEffectArgument *effect)
Cyan smoke that rises.
UNUSED void BattleFx_RunTargetMotesMode1(struct BattleEffectArgument *effect)
Pink smoke; no ☀️ effect table entry points here.
void BattleFx_RunParalyze(struct BattleEffectArgument *effect)
Rising smoke with glints.
void BattleFx_RunSleep(struct BattleEffectArgument *effect)
Twelve sheep drop onto the targets' side, one every 4 frames, tumbling through eight images (the last...
void BattleFx_RunHeartrender(struct BattleEffectArgument *effect)
Hearts.
void BattleFx_RunDemonFire(struct BattleEffectArgument *effect)
Glowing orbs in Mars Djinn colours, and the user strikes.
void BattleFx_RunTargetMotes(struct BattleEffectArgument *effect, u32 mode)
Around each target in turn, 8 frames apart, motes (smoke, hearts, orbs) turn about a point 20 pixels ...
void BattleFx_RunMysticFlame(struct BattleEffectArgument *effect)
Glowing orbs.
void BattleFx_RunDrown(struct BattleEffectArgument *effect)
Vortex motes.
void BattleFx_RunTaint(struct BattleEffectArgument *effect)
Lime smoke (effect->variant 0) or pink smoke.
void BattleFx_RunCurse(struct BattleEffectArgument *effect)
A small flame burns above each target in turn, 16 frames apart, for 72 frames each,...
void BattleFx_RunDrainFang(struct BattleEffectArgument *effect)
Three additive columns that drain the target with large motes, Mars Djinn colours.
void BattleFx_RunTargetStrike(struct BattleEffectArgument *effect, s32 mode)
Strikes the first target TARGET_STRIKE_HITS times with a sideways slash or a column of light,...
void BattleFx_RunElectricBite(struct BattleEffectArgument *effect)
Three lightning columns with glints.
void BattleFx_RunTwinBeaks(struct BattleEffectArgument *effect)
Two slashes with sparks, lightning colours.
void BattleFx_RunRabidFang(struct BattleEffectArgument *effect)
One column with smoke, Mars Djinn colours.
void BattleFx_RunAcidBite(struct BattleEffectArgument *effect)
Three pink columns with smoke.
void BattleFx_RunPoisonousBite(struct BattleEffectArgument *effect)
One lime column with smoke.
void BattleFx_RunPoisonTail(struct BattleEffectArgument *effect)
One lime slash with smoke.
void BattleFx_RunNumbingSting(struct BattleEffectArgument *effect)
One slash with glints, lightning colours.
void BattleFx_RunVampiricFang(struct BattleEffectArgument *effect)
Three columns that drain the target, Mars Djinn colours.
void BattleFx_RunDoubleFang(struct BattleEffectArgument *effect)
Two blue columns with sparks.
void BattleFx_RunCannibalFang(struct BattleEffectArgument *effect)
Three ember columns that drain the target into the user.
void BattleFx_RunMortalBlow(struct BattleEffectArgument *effect)
One heavy slash with sparks, Mars Djinn colours.
void BattleFx_RunThor(struct BattleEffectArgument *effect)
The scene plays in two parts on the effect canvas.
void BattleFx_RunSparkApproachVariant3(struct BattleEffectArgument *effect)
The user leaps at the first target, then a burst of 340 sparks rises beneath it and the canvas flashe...
void BattleFx_RunThrash(struct BattleEffectArgument *effect)
The user leaps high at the first target, then a burst of 32 sparks rises beneath it.
void BattleFx_RunFlashingStrike(struct BattleEffectArgument *effect, s32 mode)
Plays a flashing strike, the runner of BattleFx_RunQuickStrike (mode 1) and BattleFx_RunVorpalSlash (...
void BattleFx_RunVorpalSlash(struct BattleEffectArgument *effect)
The user steps up to the first target, four pictures flash across the effect layer,...
void BattleFx_RunQuickStrike(struct BattleEffectArgument *effect)
The user leaps at the first target, four pictures flash across the effect layer, then it fills with o...
void BattleFx_RunTiamat(struct BattleEffectArgument *effect)
The rising embers with a formation of eight objects that sweeps in and explodes at the end.
void BattleFx_RunDragonDriver(struct BattleEffectArgument *effect)
The rising embers from the user's side, in the LightningBolt colours.
void BattleFx_RunPaletteParticles(struct BattleEffectArgument *effect, s32 mode)
A 208-frame effect of embers rising from the ground; pressing A or B during frames 49 to 159 skips to...
void BattleFx_RunTitanBlade(struct BattleEffectArgument *effect)
A huge sword drops onto the first target amid charging flashes, dust and sparks.
void BattleFx_RunKite(struct BattleEffectArgument *effect)
Shows the extended Jupiter Djinni prelude over the first target, mirrored from the usual side; the Dj...
void BattleFx_RunTorch(struct BattleEffectArgument *effect)
A fiery disc fades in, its rings running outward while every scanline ripples, then fades out.
The integer types, TRUE, UNUSED and the fixed-address macros.
void BattleFx_RunUndeadSword(struct BattleEffectArgument *effect)
Two mirrored columns of light rise at the first target's feet and sink again, scattering 16 sparks th...
BattleFxKind
Effect kinds: the kind an ability's gBattle_ActionFlags entry selects, by the handler that plays it; ...
@ BATTLE_FX_EVIL_BLESSING
@ BATTLE_FX_SOOTHING_STAR
@ BATTLE_FX_FREEBITE_RUSH
@ BATTLE_FX_BACTERIA_RUSH
@ BATTLE_FX_FLYING_ATTACK_329
@ BATTLE_FX_ORBITING_SPIRALS
no ability uses it
@ BATTLE_FX_ACID_BLESSING
@ BATTLE_FX_BEAR_CLAW_342
@ BATTLE_FX_HEARTRENDER_346
@ BATTLE_FX_POISONOUS_BITE_323
@ BATTLE_FX_HELM_SPLITTER
@ BATTLE_FX_DARK_BLESSING
@ BATTLE_FX_FLYING_ATTACK
@ BATTLE_FX_FIRE_BLESSING
@ BATTLE_FX_CANNIBAL_FANG
@ BATTLE_FX_ELECTRIC_BITE
@ BATTLE_FX_SPARK_APPROACH_VARIANT3
no ability uses it
@ BATTLE_FX_VAMPIRIC_FANG
@ BATTLE_FX_SPINNING_BEAT
@ BATTLE_FX_WATER_BLESSING
@ BATTLE_FX_NUMBING_STING
@ BATTLE_FX_DRAGON_DRIVER
@ BATTLE_FX_POISONOUS_BITE
@ BATTLE_FX_STICKY_POISON
@ BATTLE_FX_TRIANGLE_STRIKE
no ability uses it
@ BATTLE_FX_STORM_BLESSING
@ BATTLE_FX_KIND_COUNT
one more than the last kind
SceneEffectKind
The large effects BattleFx_RunSceneEffect runs, by kind: the twelve summons.
@ SCENE_EFFECT_BOREAS
BattleFx_RunBoreas (boreas.c).
@ SCENE_EFFECT_NEPTUNE
BattleFx_RunNeptune (neptune.c).
@ SCENE_EFFECT_JUDGMENT
BattleFx_RunJudgment (judgment.c).
@ SCENE_EFFECT_CYBELE
BattleFx_RunCybele (cybele.c).
@ SCENE_EFFECT_NEREID
BattleFx_RunNereid (nereid.c).
@ SCENE_EFFECT_THOR
BattleFx_RunThor (thor.c).
@ SCENE_EFFECT_TIAMAT
BattleFx_RunTiamat (tiamat.c).
@ SCENE_EFFECT_KIRIN
BattleFx_RunKirin (kirin.c).
@ SCENE_EFFECT_RAMSES
BattleFx_RunRamses (ramses.c).
@ SCENE_EFFECT_METEOR
BattleFx_RunMeteor (particle_streams.c).
@ SCENE_EFFECT_PROCNE
BattleFx_RunProcne (procne.c).
@ SCENE_EFFECT_ATALANTA
BattleFx_RunAtalanta (atalanta.c).
void(*) BattleFxHandler(struct BattleEffectArgument *effect)
An effect handler: plays one effect over the battle, frame by frame, and returns when it is over.
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...
void BattleFx_RunWhirlwind(struct BattleEffectArgument *effect)
Tornadoes sweep across the targets for 80 frames, sparkling with glints; the canvas flashes and the t...
void BattleFx_RunFroth(struct BattleEffectArgument *effect)
Motes fly out of the top of the user, hang, and from 48 frames after each appears home in on the targ...