sol_sanctum_entrance.c
Sol Sanctum's entrance, in two maps: the door, the two minotaur reliefs that open passages once the Small Jewels are set in them, and the rooms of movable blocks.
games/tbs/src/scene/sol_sanctum_entrance.c on GitHub
Sol Sanctum's entrance, in two maps: the door, the two minotaur reliefs that open passages once the Small Jewels are set in them, and the rooms of movable blocks.
Functions
SolSanctumEntrance_GetEntrances
const struct SceneEntrance *SolSanctumEntrance_GetEntrances(void)
Returns the approach's entrances (scene 19) or the halls' (scene 16), which share this overlay.
SolSanctumEntrance_GetPlacements
const struct ScenePlacement *SolSanctumEntrance_GetPlacements(void)
Selects the actors for the current map and puzzle room. Inside, entrances 11 to 13 (the outer block room) and 14 to 16 (the inner one) place Kraden and the blocks, the rest of the halls Kraden and actor 9; the approach places its sentry.
SolSanctumEntrance_GetEvents
const struct SceneEvent *SolSanctumEntrance_GetEvents(void)
Selects the events for the current map and puzzle room, by the same entrances as SolSanctumEntrance_GetPlacements.
Event_OpenDoorAndEnter
static void Event_OpenDoorAndEnter(void)
Walking up to the sanctum's door: it slides open and the leader walks in. Reached by walking north into the door (cell code 2) on the approach. Takes exit 2, into the halls at entrance 8.
Used by gSolSanctumEntranceEvents2.
Event_InspectFirstMinotaurRelief
static void Event_InspectFirstMinotaurRelief(void)
Searching the first minotaur relief: one eye sparkles, or both once the Small Jewel is set. "The right eye is sparkling, but there's a hole where the left eye should be." Reached by searching the relief (cell code 20) in the halls. Once the first Small Jewel is found, and until it is set, it requests the field menu (the event work's unk172, FieldWork's menu), which opens when the search ends so that the jewel can be used.
Used by gSolSanctumEntranceEvents1.
SolSanctumEntrance_ReactToOpeningPassage
static inline void SolSanctumEntrance_ReactToOpeningPassage(void)
The room shakes as stone shifts; the leader looks around and jumps.
Used by Event_SetFirstSmallJewel, Event_SetSecondSmallJewel.
Event_SetFirstSmallJewel
static void Event_SetFirstSmallJewel(void)
Using the Small Jewel on the first relief: the leader sets it in and a passage opens. "set the small gem into the empty socket.", "You hear the sound of shifting stone." Reached by using the Small Jewel on the relief (trigger 0x414: cell code 20, with its own message); does nothing until the first Small Jewel is found, or once it is set. Sets FLAG_SOL_SANCTUM_FIRST_GEM_PLACED and FLAG_ITEM_USED_UP, which takes the jewel.
Used by gSolSanctumEntranceEvents1.
Event_InspectSecondMinotaurRelief
static void Event_InspectSecondMinotaurRelief(void)
Searching the second minotaur relief, as the first. Reached by searching it (cell code 21) in the inner block room; once the second Small Jewel is found, and until it is set, it requests the field menu.
Used by gSolSanctumEntranceEvents1Entrances14To16.
Event_SetSecondSmallJewel
static void Event_SetSecondSmallJewel(void)
Using the Small Jewel on the second relief: as the first, and the inner doorway opens. Reached by using the Small Jewel on it (trigger 0x415: cell code 21, with its own message) in the inner block room, once the second Small Jewel is found and until it is set. Sets FLAG_SOL_SANCTUM_SECOND_GEM_PLACED and FLAG_ITEM_USED_UP.
Used by gSolSanctumEntranceEvents1Entrances14To16.
SolSanctumEntrance_RecordBlockColumn
static inline void SolSanctumEntrance_RecordBlockColumn(s32 column, s32 flagBase, s32 leftColumn, s32 rightColumn)
Remembers which of a movable block's two destination columns it occupies.
Used by Event_InnerBlock1Moved, Event_InnerBlock2Moved, Event_InnerBlock3Moved, Event_InnerBlock4Moved, Event_InnerBlock5Moved, Event_InnerBlock6Moved, Event_OuterLeftBlockMoved.
Event_OuterLeftBlockMoved
static void Event_OuterLeftBlockMoved(void)
Moving the outer left block with Move: the column it stops in is saved. Reached by Move on actor 9 in the outer block room while FLAG_SCENE_TEMP_34 is clear, and called by Event_PushBlock there. Sets one of FLAG_SOL_SANCTUM_OUTER_LEFT_BLOCK_EAST and _WEST, or clears both when the block stands in neither column.
Used by Event_PushBlock, gSolSanctumEntranceEvents1Entrances11To13.
Event_OuterRightBlockMoved
static void Event_OuterRightBlockMoved(void)
Moving the outer right block with Move: the column it stops in is saved. Reached by Move on actor 10, as the left block. Sets one of FLAG_SOL_SANCTUM_OUTER_RIGHT_BLOCK_EAST and _WEST, or clears both.
Used by Event_PushBlock, gSolSanctumEntranceEvents1Entrances11To13.
Event_InnerBlock1Moved
static void Event_InnerBlock1Moved(void)
Moving an inner block with Move: the column it stops in is saved and the floor under all six is set again. Reached by Move on actor 9 in the inner block room, and called by Event_PushBlock there. Sets one of FLAG_SOL_SANCTUM_INNER_BLOCK_1_EAST and _WEST, or clears both.
Used by Event_PushBlock, gSolSanctumEntranceEvents1Entrances14To16.
Event_InnerBlock2Moved
static void Event_InnerBlock2Moved(void)
As Event_InnerBlock1Moved, for the second block (actor 10).
Used by Event_PushBlock, gSolSanctumEntranceEvents1Entrances14To16.
Event_InnerBlock3Moved
static void Event_InnerBlock3Moved(void)
As Event_InnerBlock1Moved, for the third block (actor 11).
Used by Event_PushBlock, gSolSanctumEntranceEvents1Entrances14To16.
Event_InnerBlock4Moved
static void Event_InnerBlock4Moved(void)
As Event_InnerBlock1Moved, for the fourth block (actor 12).
Used by Event_PushBlock, gSolSanctumEntranceEvents1Entrances14To16.
Event_InnerBlock5Moved
static void Event_InnerBlock5Moved(void)
As Event_InnerBlock1Moved, for the fifth block (actor 13).
Used by Event_PushBlock, gSolSanctumEntranceEvents1Entrances14To16.
Event_InnerBlock6Moved
static void Event_InnerBlock6Moved(void)
As Event_InnerBlock1Moved, for the sixth block (actor 14).
Used by Event_PushBlock, gSolSanctumEntranceEvents1Entrances14To16.
Event_PushBlock
static void Event_PushBlock(void)
Walking into a block: the leader pushes it one cell, and its column is saved. Reached by walking into a block's cell: code 22, or 23 facing east and 25 facing west, in the outer block room, and code 24 in the inner one. Updates the room's block flags through the Moved events.
Used by gBilibinEvents1, gBilibinEvents2, gBilibinEvents3, gSolSanctumEntranceEvents1Entrances11To13, gSolSanctumEntranceEvents1Entrances14To16.
SolSanctumEntrance_Initialize
s32 SolSanctumEntrance_Initialize(void)
Restores the outdoor or interior state for this entrance. Called by Field_RunScene once the actors exist.
SolSanctumEntrance_ApplyEntryState
static void SolSanctumEntrance_ApplyEntryState(void)
Sets up the approach: after the eruption it rumbles now and then, the collision of two rows of cells changes with FLAG_VALE_RETURNED_FROM_MT_ALEPH and FLAG_PARTY_LEFT_VALE, and with the latter the sentry stands at another spot. Called by SolSanctumEntrance_Initialize for scene 19. Sets FLAG_RETREAT_BLOCKED and starts SolSanctumEntrance_UpdateEruptionRumbles after the eruption.
Used by SolSanctumEntrance_Initialize.
SolSanctumEntrance_RestoreInteriorState
static void SolSanctumEntrance_RestoreInteriorState(void)
Restores opened passages and the current room's block positions, and plays a room's first cutscene. Called by SolSanctumEntrance_Initialize for scene 16. Entrance 8, the way in, sets the Retreat point there and introduces the sanctum until FLAG_SOL_SANCTUM_ENTERED is set; the outer block room plays Kraden's search until FLAG_SEARCHING_FOR_HIDDEN_PASSAGE is set, the inner one shows the statues out of reach until FLAG_SOL_SANCTUM_INNER_STATUES_SEEN is set and sets FLAG_SCENE_TEMP_34.
Used by SolSanctumEntrance_Initialize.
SolSanctumEntrance_IntroduceSanctum
static void SolSanctumEntrance_IntroduceSanctum(void)
Kraden welcomes the party into Sol Sanctum on their first visit, asking whether it is their first time here. Called by SolSanctumEntrance_RestoreInteriorState at entrance 8 until FLAG_SOL_SANCTUM_ENTERED is set. Sets FLAG_SOL_SANCTUM_ENTERED and clears FLAG_SHOW_LOCATION_NAME.
Used by SolSanctumEntrance_RestoreInteriorState.
SolSanctumEntrance_KradenSuspectsHiddenPassage
static void SolSanctumEntrance_KradenSuspectsHiddenPassage(void)
Kraden looks around the outer block room and decides a hidden passage must lead deeper in; Garet asks whether to split up. Called by SolSanctumEntrance_RestoreInteriorState in the outer block room until FLAG_SEARCHING_FOR_HIDDEN_PASSAGE is set. Sets FLAG_SEARCHING_FOR_HIDDEN_PASSAGE and clears FLAG_SHOW_LOCATION_NAME.
Used by SolSanctumEntrance_RestoreInteriorState.
SolSanctumEntrance_InspectInnerStatues
static void SolSanctumEntrance_InspectInnerStatues(void)
Shows the inner statues that Kraden cannot reach; he asks Isaac to try Psynergy. Called by SolSanctumEntrance_RestoreInteriorState in the inner block room until FLAG_SOL_SANCTUM_INNER_STATUES_SEEN is set, which it sets.
Used by SolSanctumEntrance_RestoreInteriorState.
SolSanctumEntrance_RestoreInnerBlockCells
static void SolSanctumEntrance_RestoreInnerBlockCells(s32 placeActors)
Restores the inner blocks' collision cells and, when placeActors is nonzero (on entry), moves the blocks to their saved columns.
Used by Event_InnerBlock1Moved, Event_InnerBlock2Moved, Event_InnerBlock3Moved, Event_InnerBlock4Moved, Event_InnerBlock5Moved, Event_InnerBlock6Moved, SolSanctumEntrance_RestoreInteriorState.
Event_DoorTightlyLocked
static void Event_DoorTightlyLocked(void)
Searching the door beside the way in. "The door is tightly locked." Reached by searching cell code 10 on the approach.
Used by gSolSanctumEntranceEvents2.
SolSanctumEntrance_UpdateEruptionRumbles
static void SolSanctumEntrance_UpdateEruptionRumbles(void)
After the eruption the approach rumbles now and then, and each shake fades. Run each frame as a callback that SolSanctumEntrance_ApplyEntryState adds once FLAG_SOL_SANCTUM_ERUPTED is set.
Used by SolSanctumEntrance_ApplyEntryState.
Also, functions without a comment: SolSanctumEntrance_GetRegions, SolSanctumEntrance_GetExits.
Macros
PUSH_STEP
#define PUSH_STEP(x, z) (((x) << 16) | ((z) & 0xffff))
Packs a push step: X in the upper halfword, Z in the lower (pixels).
Used by gSolSanctumPushSteps.
Also, macros without a comment: FLAG_SOL_SANCTUM_OUTER_RIGHT_BLOCK_EAST, FLAG_SOL_SANCTUM_OUTER_RIGHT_BLOCK_WEST, FLAG_SOL_SANCTUM_OUTER_LEFT_BLOCK_EAST, FLAG_SOL_SANCTUM_OUTER_LEFT_BLOCK_WEST, FLAG_SOL_SANCTUM_INNER_BLOCK_1_EAST, FLAG_SOL_SANCTUM_INNER_BLOCK_1_WEST, FLAG_SOL_SANCTUM_INNER_BLOCK_2_EAST, FLAG_SOL_SANCTUM_INNER_BLOCK_2_WEST, FLAG_SOL_SANCTUM_INNER_BLOCK_3_EAST, FLAG_SOL_SANCTUM_INNER_BLOCK_3_WEST, FLAG_SOL_SANCTUM_INNER_BLOCK_4_EAST, FLAG_SOL_SANCTUM_INNER_BLOCK_4_WEST, FLAG_SOL_SANCTUM_INNER_BLOCK_5_EAST, FLAG_SOL_SANCTUM_INNER_BLOCK_5_WEST, FLAG_SOL_SANCTUM_INNER_BLOCK_6_EAST, FLAG_SOL_SANCTUM_INNER_BLOCK_6_WEST, EXIT_FLAG_NONE.
Globals, without a comment: gSolSanctumEntrance_RumbleTimer, gSolSanctumEntranceEntrancesOther, gSolSanctumEntranceEntrances2, gSolSanctumEntranceEntrances1, gSolSanctumEntrance_Exits, gSolSanctumEntrancePlacementsOther, gSolSanctumEntrancePlacements1, gSolSanctumEntrancePlacements1Entrances11To13, gSolSanctumEntrancePlacements1Entrances14To16, gSolSanctumEntrancePlacements2, gSolSanctumEntranceEventsOther, gSolSanctumEntranceEvents2, gSolSanctumEntranceEvents1, gSolSanctumEntranceEvents1Entrances11To13, gSolSanctumEntranceEvents1Entrances14To16, gSolSanctumPushSteps.
Declarations, without a comment: InitializeSceneRecordBuffer.