Alchemy

goma_cave_pillar.c

Goma Cave: the room with two pillars, a stump and the Djinni Forge.

games/tbs/src/scene/goma_cave_pillar.c on GitHub

Goma Cave: the room with two pillars, a stump and the Djinni Forge.

Functions

Event_FightForge

static void Event_FightForge(void)

Talking to Forge: the man beside it jumps in surprise, and the battle with the Djinni begins.

Used by gGomaCavePillar_Events.

Line 64

GomaCavePillar_UpdateFragment

static void GomaCavePillar_UpdateFragment(union FieldObject *fieldObject)

Advances the fragment's selected coordinate plane and keeps its targets in step.

Used by GomaCavePillar_SpawnFragment.

Line 72

GomaCavePillar_FinishFragment

static s32 GomaCavePillar_FinishFragment(struct ScriptInterpreter *interpreter)

Applies child value 15 at the end of a fragment's lifetime.

Used by gGomaCavePillar_FragmentScript0, gGomaCavePillar_FragmentScript1, gGomaCavePillar_FragmentScript2.

Line 100

GomaCavePillar_SpawnFragment

static void GomaCavePillar_SpawnFragment(s32 x, s32 y, s32 z, s32 firstRate, s32 secondRate, s32 scriptAndChildValue, s32 planeAndPriority)

Creates a fragment with two axis rates, a script and packed plane/priority.

Used by Event_PushStumpOver, GomaCavePillar_SettleEastPillar, GomaCavePillar_SpawnStumpDust.

Line 108

GomaCavePillar_CopyWestPillarCells

static inline void GomaCavePillar_CopyWestPillarCells(s32 sourceColumn)

Copies the map cells for the west pillar on either side of its track.

Used by Event_MoveWestPillar, Scene_Initialize.

Line 160

Event_MoveWestPillar

static void Event_MoveWestPillar(void)

Move on the west pillar: it slides between its two places, and the map cells follow it.

Used by Event_PushWestPillar, gGomaCaveEntranceEvents, gGomaCavePillar_Events.

Line 166

GomaCavePillar_SpawnStumpDust

static void GomaCavePillar_SpawnStumpDust(void)

While the stump teeters, dust falls from it: one fragment every eighth frame, two on every sixteenth.

Used by Event_PushStumpOver.

Line 188

Event_PushStumpOver

static void Event_PushStumpOver(void)

Move on the stump: once it is pushed to the edge (column 25), it teeters shedding dust, tips over and falls into the room below with a crash that shakes the screen.

Used by Scene_Initialize, gGomaCavePillar_Events.

Line 258

GomaCavePillar_SettleEastPillar

static void GomaCavePillar_SettleEastPillar(void)

Once the east pillar reaches its place (cell 38, 14), it sinks two pixels into the floor and six fragments fly out around it.

Used by Event_MoveEastPillar, Event_PushEastPillar.

Line 347

Event_MoveEastPillar

static void Event_MoveEastPillar(void)

Move on the east pillar.

Used by Event_PushEastPillar, gGomaCaveEntranceEvents, gGomaCavePillar_Events, gTunnelRuinsEventsOther.

Line 386

Event_PushEastPillar

static void Event_PushEastPillar(void)

Walking into the east pillar pushes it a step.

Used by gGomaCavePillar_Events, gTunnelRuinsEventsOther.

Line 393

Event_JumpGapWest

static void Event_JumpGapWest(void)

Walking west at the gap: the leader jumps across it. Later patches use the shared forward jump.

Used by gGomaCavePillar_Events.

Line 402

GomaCavePillar_FidgetWhileForgeFights

static void GomaCavePillar_FidgetWhileForgeFights(void)

While the battle with Forge runs, the man reacts on a timer; once the Djinni event is over, it raises event 99.

Used by Event_WitnessCheersForgeCaught, Scene_Initialize.

Line 446

Event_WitnessCheersForgeCaught

static void Event_WitnessCheersForgeCaught(void)

Raised once Forge is caught: the man is amazed, then walks off.

Used by gGomaCavePillar_Events.

Line 473

Scene_Initialize

s32 Scene_Initialize(void)

Puts the pillars and the stump where the party left them. Entrance 99 shows the stump falling again; after a Djinni battle, the man's reaction starts.

Line 496

Also, functions without a comment: Scene_GetEntrances, Scene_GetRegions, Scene_GetExits, Scene_GetPlacements, Scene_GetEvents.

Enumerations, without a comment: GomaCavePillarFragmentPlane.

Macros

DIRECTION_STEP

#define DIRECTION_STEP(dx, dz) (((u32)(dx) << 16) | ((dz) & 0xffff))

One step per facing: X pixels in the high halfword, Z pixels in the low half.

Used by gBilibinCave_PushSteps, gBilibin_FacingCellSteps, gColossoRiver_DirectionSteps, gColossoWall_DirectionSteps, gStagedActor_DirectionSteps.

Line 545

Also, macros without a comment: FLAG_GOMA_CAVE_STUMP_FELL, FLAG_GOMA_CAVE_EAST_PILLAR_IN_PLACE, FLAG_GOMA_CAVE_WEST_PILLAR_MOVED, WEST_PILLAR, STUMP, EAST_PILLAR, FORGE, WITNESS.

Globals

gGomaCavePillar_FragmentScripts

struct EffectScripts gGomaCavePillar_FragmentScripts

The scripts a pillar fragment can run, chosen by the low bits of its spawn value.

Used by GomaCavePillar_SpawnFragment.

Line 572

Also, globals without a comment: gGomaCavePillar_WitnessFrames, gStagedActor_DirectionSteps, gStagedActor_FootprintKinds, gStagedActor_FootprintBounds, gGomaCavePillar_FragmentScript0, gGomaCavePillar_FragmentScript1, gGomaCavePillar_FragmentScript2, gGomaCavePillar_Entrances, gGomaCavePillar_Exits, gGomaCavePillar_Placements, gGomaCavePillar_Events.

On this page