gondowan_cave.c
Gondowan Cave: the soldiers guarding the bridge to Gondowan, Iodem waiting there on the way to Babi Lighthouse, and the cave's moving puzzles.
games/tbs/src/scene/gondowan_cave.c on GitHub
Gondowan Cave: the soldiers guarding the bridge to Gondowan, Iodem waiting there on the way to Babi Lighthouse, and the cave's moving puzzles.
Functions
Scene_GetExits
const u32 *Scene_GetExits(void)
All cave sections share the exit table.
Scene_GetPlacements
const struct ScenePlacement *Scene_GetPlacements(void)
Iodem waits in the first room once he is on his way to Babi Lighthouse.
Scene_GetEvents
const struct SceneEvent *Scene_GetEvents(void)
Each room's events, with Iodem's in the first room when he is there.
Event_IodemAsksWhyTurningBack
static void Event_IodemAsksWhyTurningBack(void)
Walking back (trigger 10) with Iodem in the party: he steps out and asks why Isaac is going back. Yes: he waits here for the party's return. No: he rejoins the party and Isaac steps away from the trigger.
Used by gGondowanCaveEvents1WithIodem.
Event_IodemRejoins
static void Event_IodemRejoins(void)
Talking to Iodem where he waits, or walking up to him (trigger 11): he joins the party again. "I've been waiting for you, Isaac! We should go to Babi Lighthouse soon."
Used by gGondowanCaveEvents1WithIodem.
Event_SoldierAsksAboutCrossing
static void Event_SoldierAsksAboutCrossing(void)
Talking to the first soldier, who asks whether the party will cross into Gondowan. "Do you wish to cross into Gondowan?" Yes: "I won't stop you, but I wouldn't go unless I had business there." No: "That's a good idea. They wouldn't let you into Babi Lighthouse, anyway."
Used by gGondowanCaveEvents1.
Event_ReadSoldierMind
static void Event_ReadSoldierMind(void)
Mind Read on the second soldier: once flag 0x950 is set and until Iodem waits here, he grumbles that guard duty made him miss all of Colosso; before, that the warriors fight while he guards the bridge.
Used by gGondowanCaveEvents1.
Event_LeaveThroughEntrance
static void Event_LeaveThroughEntrance(void)
Leaving the third room by its first exit (trigger 1). With temporary flag 0x204 set, the puzzle's saved flags return to one arrangement first.
Used by gGondowanCaveEvents3.
Event_CheckAhead
static void Event_CheckAhead(void)
Walking into the second object from the east or the west (triggers 10 and 11): look at what is ahead, which starts the push.
Used by gBilibinEvents2, gBilibinEvents3, gColossoLogEvents, gColossoWallEvents, gGondowanCaveEvents3, gSolSanctumElementalStarRoom_Events.
Event_MoveFirstObject
static void Event_MoveFirstObject(void)
Move on the first object: from column 30 or less it spins and leaps across, freeing the cell where it stood.
Used by gGondowanCaveEvents3.
Event_PushSecondObject
static void Event_PushSecondObject(void)
Pushing the second object (trigger 50): it moves a step, then may have reached its place.
Used by gGondowanCaveEvents3.
GondowanCave_PlaceMovedSecondObject
static inline void GondowanCave_PlaceMovedSecondObject(s32 animation)
Hides the second object and shows the one that stands in for it in its place.
Used by Event_MoveSecondObject, Scene_Initialize.
Event_MoveSecondObject
static void Event_MoveSecondObject(void)
Move on the second object, and after each push: past column 42 it drops into its place for good.
Used by Event_PushSecondObject, gGondowanCaveEvents3.
GondowanCave_RotateLeapingObject
static void GondowanCave_RotateLeapingObject(union FieldObject *fieldObject)
Rotates the sprite during the airborne part of the leap.
Used by GondowanCave_RunSpinningLeap.
GondowanCave_WaitForDescent
static void GondowanCave_WaitForDescent(struct FieldActor *actor, s32 heightLimit)
Waits at most forty frames for the actor to descend to the height limit.
Used by GondowanCave_RunSpinningLeap.
GondowanCave_RunSpinningLeap
static void GondowanCave_RunSpinningLeap(s32 actorId)
The object spins in place, leaps and lands with a shake and a ring of dust, then comes to rest a little further on.
Used by Event_MoveFirstObject.
Event_LiftObject
static void Event_LiftObject(void)
Lift on the third room's actor 11 also takes away actor 12 beside it.
Used by gGondowanCaveEvents3.
Scene_Initialize
s32 Scene_Initialize(void)
The first room keeps Iodem out of sight while he travels with the party; the third puts the moved objects where the party left them.
Also, functions without a comment: Scene_GetEntrances, Scene_GetRegions, GondowanCave_UnusedActorCallback, GondowanCave_UnusedSceneCallback.
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. Shift the unsigned representation so westward steps remain defined C.
Used by gBilibinCave_PushSteps, gBilibin_FacingCellSteps, gColossoRiver_DirectionSteps, gColossoWall_DirectionSteps, gStagedActor_DirectionSteps.
Also, macros without a comment: SOLDIER_1, SOLDIER_2, SOLDIER_3, IODEM, FIRST_OBJECT, SECOND_OBJECT, SECOND_OBJECT_MOVED.
Globals
gGondowanCaveEvents3
struct SceneEvent gGondowanCaveEvents3[]
Temporary flag 0x205 ends Move on the second object.
Used by Scene_GetEvents.
Also, globals without a comment: gEffectScript0, gEffectScript1, gEffectScript2, gStagedActor_DirectionSteps, gStagedActor_FootprintKinds, gStagedActor_FootprintBounds, gEffectScripts, gGondowanCaveEntrancesOther, gGondowanCaveEntrances1, gGondowanCaveEntrances2, gGondowanCaveEntrances3, gGondowanCaveExits, gGondowanCavePlacementsOther, gGondowanCavePlacements1, gGondowanCavePlacements1WithIodem, gGondowanCavePlacements2, gGondowanCavePlacements3, gGondowanCaveEventsOther, gGondowanCaveEvents1, gGondowanCaveEvents1WithIodem, gGondowanCaveEvents2.