bilibin_cave.c
The cave that leads past Bilibin, in three sections walked in turn: the entrance section (BilibinCave3) with a Growth plant, the middle section (BilibinCave2) with Reveal and Douse, and the exit section (BilibinCave1), a puzzle of Douse, Frost and pushed actors.
games/tbs/src/scene/bilibin_cave.c on GitHub
The cave that leads past Bilibin, in three sections walked in turn: the entrance section (BilibinCave3) with a Growth plant, the middle section (BilibinCave2) with Reveal and Douse, and the exit section (BilibinCave1), a puzzle of Douse, Frost and pushed actors.
Functions
BilibinCave_ClearScriptedActorSpriteFlags
static s32 BilibinCave_ClearScriptedActorSpriteFlags( struct ScriptInterpreter *interpreter)
Clears the scripted actor's sprite flags and completes this script command.
Used by gBilibinCave_ClearSpriteScript.
Event_AlterCrossingCell
static void Event_AlterCrossingCell(void)
Replaces the crossing cell with the attributes at source cell (1, 0).
Used by gBilibinCaveEvents3.
Event_RestoreCrossingCell
static void Event_RestoreCrossingCell(void)
Restores the crossing cell from source cell (0, 0).
Used by gBilibinCaveEvents3.
Event_RevealHiddenPath
static void Event_RevealHiddenPath(void)
Replaces the narrow tile strip and its two-row collision rectangle.
Used by gBilibinCaveEvents2.
Event_HideRevealedPath
static void Event_HideRevealedPath(void)
Restores the strip's tiles and its one-row collision rectangle.
Used by gBilibinCaveEvents2.
Event_DouseMiddleSectionTarget
static void Event_DouseMiddleSectionTarget(void)
Douse on the middle section's target: it disappears, for good.
Used by gBilibinCaveEvents2.
Event_DouseExitSectionTarget
static void Event_DouseExitSectionTarget(void)
Douse on the exit section's target: it disappears, and the first Frost target settles into a surface the party can walk over.
Used by gBilibinCaveEvents1.
BilibinCave_FreezeTarget
static inline void BilibinCave_FreezeTarget(s32 actor)
Clears a Frost target's child effect, then plays its freezing animation.
Used by Event_FreezeFirstTarget, Event_FreezeSecondTarget, Event_FreezeThirdTarget.
Event_FreezeFirstTarget
static void Event_FreezeFirstTarget(void)
Frost on the first target, before the Douse target is gone.
Used by gBilibinCaveEvents1.
Event_FreezeSecondTarget
static void Event_FreezeSecondTarget(void)
Frost on the second target.
Used by gBilibinCaveEvents1.
Event_FreezeThirdTarget
static void Event_FreezeThirdTarget(void)
Frost on the third target, while 0x302 is set.
Used by gBilibinCaveEvents1.
BilibinCave_UpdateFrostTargetFromMovableActors
static void BilibinCave_UpdateFrostTargetFromMovableActors(void)
After a push or Move: while either pushed actor stands on cell (35, 23) (0x303 and 0x304), the third Frost target changes with a sound, and 0x302 says so; when both leave, it changes back.
Used by Event_PushActorAhead, gBilibinCaveEvents1.
Event_GrowPlant
static void Event_GrowPlant(void)
Growth on the entrance section's target: the plant grows and its cell's collision changes; 0x305 keeps it grown.
Used by gBilibinCaveEvents3, gColossoLogEvents, gColossoRiver_Events, gColossoWallEvents.
Event_SetMapTriggerFlag
static void Event_SetMapTriggerFlag(void)
Enables the map-work byte while crossing this touch trigger.
Used by gBilibinCaveEvents1.
Event_ClearMapTriggerFlag
static void Event_ClearMapTriggerFlag(void)
Clears the same map-work byte at the opposing trigger.
Used by gBilibinCaveEvents1.
BilibinCave_Initialize
s32 BilibinCave_Initialize(void)
Restores the current section's saved puzzle state.
BilibinCave_RestoreGrowthSection
static void BilibinCave_RestoreGrowthSection(void)
Restores the collision change already made by Growth.
Used by BilibinCave_Initialize.
BilibinCave_RestoreDouseSection
static void BilibinCave_RestoreDouseSection(void)
Opens section 2 and restores its Douse target.
Used by BilibinCave_Initialize.
BilibinCave_ClearActorSpriteFlags
static inline void BilibinCave_ClearActorSpriteFlags(s32 actorId)
Clears the drawing flags of an actor used by the cave's animations.
Used by BilibinCave_RestoreIcePuzzleSection.
BilibinCave_RestoreIcePuzzleSection
static void BilibinCave_RestoreIcePuzzleSection(void)
Initializes section 1's animated actors and persistent puzzle states.
Used by BilibinCave_Initialize.
Event_PushActorAhead
static void Event_PushActorAhead(void)
Pushes the actor ahead only when its next cell and movement probe are clear.
Used by gBilibinCaveEvents1.
BilibinCave_EmptyActorSetupHook
static void BilibinCave_EmptyActorSetupHook(s32 actorId)
The original setup invokes this empty hook for every animated actor.
Used by BilibinCave_RestoreIcePuzzleSection.
Also, functions without a comment: BilibinCave_GetEntrances, BilibinCave_GetRegions, BilibinCave_GetExits, BilibinCave_GetPlacements, BilibinCave_GetEvents.
Macros
DIRECTION_STEP
#define DIRECTION_STEP(dx, dz) (((u32)(dx) << 16) | ((dz) & 0xffff))
Packs signed pixel steps with X in the upper halfword and Z in the lower.
Used by gBilibinCave_PushSteps, gBilibin_FacingCellSteps, gColossoRiver_DirectionSteps, gColossoWall_DirectionSteps, gStagedActor_DirectionSteps.
Globals, without a comment: gBilibinCave_ClearSpriteScript, gBilibinCaveEntrancesOther, gBilibinCaveEntrances3, gBilibinCaveEntrances2, gBilibinCaveEntrances1, gBilibinCaveExits, gBilibinCavePlacementsOther, gBilibinCavePlacements3, gBilibinCavePlacements2, gBilibinCavePlacements1, gBilibinCaveEventsOther, gBilibinCaveEvents3, gBilibinCaveEvents2, gBilibinCaveEvents1, gBilibinCave_PushSteps.