sol_sanctum_statue.c
Sol Sanctum's statue hall: four statues pushed onto their seals and two that shine their beams at the centre open a hole in the hall's floor, and Kraden explains the puzzle.
games/tbs/src/scene/sol_sanctum_statue.c on GitHub
Sol Sanctum's statue hall: four statues pushed onto their seals and two that shine their beams at the centre open a hole in the hall's floor, and Kraden explains the puzzle.
Functions
SolSanctumStatue_GetPlacements
const struct ScenePlacement *SolSanctumStatue_GetPlacements(void)
Returns Kraden (actor 8), the eight statues (9 to 16), the centre statue (17) and its moved copy (18), then Jenna and Garet.
SolSanctumStatue_GetEvents
const struct SceneEvent *SolSanctumStatue_GetEvents(void)
Returns the statues' Move and push events, each row only until its seal or beam is done.
SolSanctumStatue_SelectStoryExit
static s32 SolSanctumStatue_SelectStoryExit(void)
Chooses the cutscene in the Luna and Sol rooms that a newly opened seal leads to, and requests its exit: the trap (exit 3) once the centre statue has moved, until FLAG_SOL_SANCTUM_STATUE_TRAP_SPRUNG is set; the falling lights (exit 4) before then, until FLAG_SOL_SANCTUM_FALLING_LIGHTS_SEEN is set. Returns 1 when it requests an exit, otherwise -1.
Used by SolSanctumStatue_OpenSeal.
SolSanctumStatue_OpenCentralHole
static void SolSanctumStatue_OpenCentralHole(void)
Animates the floor opening after both light beams meet, then lets the centre statue drop in if it stands there. Called by the beams, the second one shining. Sets FLAG_SCENE_TEMP_07.
Used by SolSanctumStatue_ShineLeftBeam, SolSanctumStatue_ShineRightBeam.
SolSanctumStatue_VisitStatueHall
static void SolSanctumStatue_VisitStatueHall(void)
Kraden comes back after the trap to find the hole in the floor, has the party tell how it opened, and decides the statue disarmed the trap. Called by SolSanctumStatue_Initialize at entrance 3 (back from the trap) until FLAG_SOL_SANCTUM_STATUE_HALL_VISITED is set, which the caller sets. Clears FLAG_SHOW_LOCATION_NAME.
Used by SolSanctumStatue_Initialize.
SolSanctumStatue_ExplainStatuePuzzle
static void SolSanctumStatue_ExplainStatuePuzzle(void)
Kraden comes back after the falling lights to warn that the statues are a trap, and leaves the mystery to the party. Called by SolSanctumStatue_Initialize at entrance 4 (back from the falling lights) until FLAG_SOL_SANCTUM_STATUE_PUZZLE_EXPLAINED is set, which the caller sets. Clears FLAG_SHOW_LOCATION_NAME.
Used by SolSanctumStatue_Initialize.
SolSanctumStatue_RunSealOpenedSequence
static void SolSanctumStatue_RunSealOpenedSequence(void)
Pans toward the seals' lights, which flash ever faster until the stairway in the floor is uncovered, then restores the camera. Called by SolSanctumStatue_OpenSeal once the seals are open after the centre statue has moved.
Used by SolSanctumStatue_OpenSeal.
SolSanctumStatue_UpdateScrollingSprites
static void SolSanctumStatue_UpdateScrollingSprites(void)
Draws the three parallax rows while they overlap the screen. Run each frame as a callback that SolSanctumStatue_InitializeScrollingSprites adds.
Used by SolSanctumStatue_InitializeScrollingSprites.
Event_CheckAheadFacingNorth
static void Event_CheckAheadFacingNorth(void)
Walking north over cell code 10: the way ahead is checked as on any field.
Used by gSolSanctumStatue_Events.
Event_CheckAheadFacingSouth
static void Event_CheckAheadFacingSouth(void)
Walking south over cell code 11: the way ahead is checked as on any field.
Used by gSolSanctumStatue_Events.
SolSanctumStatue_MoveUnusedNorthwestStatue
UNUSED static void SolSanctumStatue_MoveUnusedNorthwestStatue(void)
Unused sequence moving the northwest statue to its seal position.
SolSanctumStatue_Initialize
s32 SolSanctumStatue_Initialize(void)
Restores the hall's statues, beams and seals from their flags and plays Kraden's arrival cutscenes. Called by Field_RunScene once the actors exist. Sets FLAG_RETREAT_BLOCKED; starts the parallax rows; at entrance 3 plays SolSanctumStatue_VisitStatueHall and at entrance 4 SolSanctumStatue_ExplainStatuePuzzle, each once (setting FLAG_SOL_SANCTUM_STATUE_HALL_VISITED or FLAG_SOL_SANCTUM_STATUE_PUZZLE_EXPLAINED), and not on a return after a battle.
SolSanctumStatue_InitializeScrollingSprites
static void SolSanctumStatue_InitializeScrollingSprites(void)
Loads three graphic strips and initializes their scrolling sprite rows.
Used by SolSanctumStatue_Initialize.
Event_NorthwestStatueMoved
static void Event_NorthwestStatueMoved(void)
Moving the northwest statue with Move: on its seal, the seal opens. Reached by Move on actor 9 until FLAG_SOL_SANCTUM_NORTHWEST_SEAL_OPEN is set.
Used by gSolSanctumStatue_Events.
Event_NortheastStatueMoved
static void Event_NortheastStatueMoved(void)
Moving the northeast statue with Move: on its seal, the seal opens. Reached by Move on actor 11 until FLAG_SOL_SANCTUM_NORTHEAST_SEAL_OPEN is set.
Used by gSolSanctumStatue_Events.
Event_SouthwestStatueMoved
static void Event_SouthwestStatueMoved(void)
Moving the southwest statue with Move: on its seal, the seal opens. Reached by Move on actor 13 until FLAG_SOL_SANCTUM_SOUTHWEST_SEAL_OPEN is set.
Used by gSolSanctumStatue_Events.
Event_SoutheastStatueMoved
static void Event_SoutheastStatueMoved(void)
Moving the southeast statue with Move: on its seal, the seal opens. Reached by Move on actor 15 until FLAG_SOL_SANCTUM_SOUTHEAST_SEAL_OPEN is set.
Used by gSolSanctumStatue_Events.
Event_LeftBeamStatueMoved
static void Event_LeftBeamStatueMoved(void)
Moving the left beam statue with Move: its cell is freed, and in front of the centre it shines its beam. Reached by Move on actor 10 until FLAG_SOL_SANCTUM_LEFT_BEAM_SHINING is set.
Used by gSolSanctumStatue_Events.
Event_RightBeamStatueMoved
static void Event_RightBeamStatueMoved(void)
Moving the right beam statue with Move: as the left one. Reached by Move on actor 12 until FLAG_SOL_SANCTUM_RIGHT_BEAM_SHINING is set.
Used by gSolSanctumStatue_Events.
Event_BlockCenterTriggerCells
static void Event_BlockCenterTriggerCells(void)
Starting Move beside the centre statue: its cells are blocked while the leader stands in their row. Reached by the first phase of Move on actor 17 until FLAG_SOL_SANCTUM_CENTER_STATUE_MOVED is set.
Used by gSolSanctumStatue_Events.
Event_BlockLeftTriggerCell
static void Event_BlockLeftTriggerCell(void)
Starting Move beside the left beam statue: its cell is blocked while the leader stands beside it. Reached by the first phase of Move on actor 10 until FLAG_SOL_SANCTUM_LEFT_BEAM_SHINING is set.
Used by gSolSanctumStatue_Events.
Event_BlockRightTriggerCell
static void Event_BlockRightTriggerCell(void)
Starting Move beside the right beam statue: as the left one, on actor 12.
Used by gSolSanctumStatue_Events.
Event_CenterStatueMoved
static void Event_CenterStatueMoved(void)
Moving the centre statue with Move, or a beam completing the pair: with both beams shining the statue slides into the opened floor and the hall shakes. "Something clicked!" Reached by Move on actor 17 until FLAG_SOL_SANCTUM_CENTER_STATUE_MOVED is set, and called by SolSanctumStatue_OpenCentralHole. Sets FLAG_SOL_SANCTUM_CENTER_STATUE_MOVED, and FLAG_SOL_SANCTUM_ALL_SEALS_OPEN when the four seals are open; actor 18 takes the statue's place in the hole.
Used by SolSanctumStatue_OpenCentralHole, gSolSanctumStatue_Events.
Event_PushCenterStatueNorth
static void Event_PushCenterStatueNorth(void)
Walking into the centre statue from the south: the leader pushes it north. Reached by walking north into cell code 32 until FLAG_SOL_SANCTUM_CENTER_STATUE_MOVED is set.
Used by gSolSanctumStatue_Events.
Event_PushNorthwestStatue
static void Event_PushNorthwestStatue(void)
Walking into the northwest statue: the leader pushes it onto its seal. Reached by walking east into cell code 5 until FLAG_SOL_SANCTUM_NORTHWEST_SEAL_OPEN is set.
Used by gSolSanctumStatue_Events.
Event_PushNortheastStatue
static void Event_PushNortheastStatue(void)
Walking into the northeast statue: the leader pushes it onto its seal. Reached by walking west into cell code 6 until FLAG_SOL_SANCTUM_NORTHEAST_SEAL_OPEN is set.
Used by gSolSanctumStatue_Events.
Event_PushSouthwestStatue
static void Event_PushSouthwestStatue(void)
Walking into the southwest statue: the leader pushes it onto its seal. Reached by walking east into cell code 7 until FLAG_SOL_SANCTUM_SOUTHWEST_SEAL_OPEN is set.
Used by gSolSanctumStatue_Events.
Event_PushSoutheastStatue
static void Event_PushSoutheastStatue(void)
Walking into the southeast statue: the leader pushes it onto its seal. Reached by walking west into cell code 8 until FLAG_SOL_SANCTUM_SOUTHEAST_SEAL_OPEN is set.
Used by gSolSanctumStatue_Events.
Event_PushLeftBeamStatueEast
static void Event_PushLeftBeamStatueEast(void)
Walking into the left beam statue from the west: it slides east in front of the centre and shines its beam. Reached by walking east into cell codes 20 and 21 until FLAG_SOL_SANCTUM_LEFT_BEAM_SHINING is set.
Used by gSolSanctumStatue_Events.
Event_PushLeftBeamStatueSouth
static void Event_PushLeftBeamStatueSouth(void)
Walking into the left beam statue from the north: it slides one cell south. Reached by walking south into cell code 21 until the beam shines.
Used by gSolSanctumStatue_Events.
Event_PushLeftBeamStatueNorth
static void Event_PushLeftBeamStatueNorth(void)
Walking into the left beam statue from the south: it slides one cell north. Reached by walking north into cell codes 23 and 24 until the beam shines.
Used by gSolSanctumStatue_Events.
Event_PushRightBeamStatueWest
static void Event_PushRightBeamStatueWest(void)
Walking into the right beam statue from the east: as the left one. Reached by walking west into cell codes 25 and 26 until FLAG_SOL_SANCTUM_RIGHT_BEAM_SHINING is set.
Used by gSolSanctumStatue_Events.
Event_PushRightBeamStatueSouth
static void Event_PushRightBeamStatueSouth(void)
Walking into the right beam statue from the north: it slides one cell south. Reached by walking south into cell code 26 until the beam shines.
Used by gSolSanctumStatue_Events.
Event_PushRightBeamStatueNorth
static void Event_PushRightBeamStatueNorth(void)
Walking into the right beam statue from the south: it slides one cell north. Reached by walking north into cell codes 28 and 29 until the beam shines.
Used by gSolSanctumStatue_Events.
SolSanctumStatue_PushStatue
static void SolSanctumStatue_PushStatue(s32 statueId, s32 statueColumn, s32 statueRow, s32 leaderColumn, s32 leaderRow)
Moves the leader and statue together to the centers of their target cells.
Used by Event_PushLeftBeamStatueEast, Event_PushLeftBeamStatueNorth, Event_PushLeftBeamStatueSouth, Event_PushNortheastStatue, Event_PushNorthwestStatue, Event_PushRightBeamStatueNorth, Event_PushRightBeamStatueSouth, Event_PushRightBeamStatueWest, Event_PushSoutheastStatue, Event_PushSouthwestStatue.
SolSanctumStatue_IsActorAtCell
static s32 SolSanctumStatue_IsActorAtCell(s32 actorId, s32 column, s32 row)
Returns 1 when the actor stands in the given map cell.
Used by Event_LeftBeamStatueMoved, Event_NortheastStatueMoved, Event_NorthwestStatueMoved, Event_RightBeamStatueMoved, Event_SoutheastStatueMoved, Event_SouthwestStatueMoved.
SolSanctumStatue_OpenNorthwestSeal
static void SolSanctumStatue_OpenNorthwestSeal(void)
Configures the northwest seal animation and statue return position.
Used by Event_NorthwestStatueMoved, Event_PushNorthwestStatue.
SolSanctumStatue_OpenNortheastSeal
static void SolSanctumStatue_OpenNortheastSeal(void)
Configures the northeast seal animation and statue return position.
Used by Event_NortheastStatueMoved, Event_PushNortheastStatue.
SolSanctumStatue_OpenSouthwestSeal
static void SolSanctumStatue_OpenSouthwestSeal(void)
Configures the southwest seal animation and statue return position.
Used by Event_PushSouthwestStatue, Event_SouthwestStatueMoved.
SolSanctumStatue_OpenSoutheastSeal
static void SolSanctumStatue_OpenSoutheastSeal(void)
Configures the southeast seal animation and statue return position.
Used by Event_PushSoutheastStatue, Event_SoutheastStatueMoved.
SolSanctumStatue_OpenSeal
static void SolSanctumStatue_OpenSeal(void)
Animates the seal and either advances the story or resets its statue. Called by the four OpenXSeal functions with sSealScene filled in. Sets the seal's flag; when no cutscene follows and the centre statue has not moved, the statue slides back, the leader jumps clear and the flag is cleared again.
Used by SolSanctumStatue_OpenNortheastSeal, SolSanctumStatue_OpenNorthwestSeal, SolSanctumStatue_OpenSoutheastSeal, SolSanctumStatue_OpenSouthwestSeal.
SolSanctumStatue_ShineLeftBeam
static void SolSanctumStatue_ShineLeftBeam(void)
Draws the left beam and opens the floor when the right beam is also lit. Called when the left beam statue reaches its place in front of the centre, until the centre statue has moved. Sets FLAG_SOL_SANCTUM_LEFT_BEAM_SHINING.
Used by Event_LeftBeamStatueMoved, Event_PushLeftBeamStatueEast.
SolSanctumStatue_ShineRightBeam
static void SolSanctumStatue_ShineRightBeam(void)
Draws the right beam and opens the floor when the left beam is also lit. As the left one; sets FLAG_SOL_SANCTUM_RIGHT_BEAM_SHINING.
Used by Event_PushRightBeamStatueWest, Event_RightBeamStatueMoved.
Event_SayThenWait
static void Event_SayThenWait(s32 speaker, s32 frames)
Shows the selected message from one speaker and waits the requested frames.
Used by Event_DemonstrateLevitation, Event_DepartForQuest, Event_MeetSurvivingTravelers, Event_SentToAidElders, Event_TalkAboutFallenStone, SolSanctumStatue_ExplainStatuePuzzle, SolSanctumStatue_VisitStatueHall, ValeHome_FightTravelers.
Also, functions without a comment: SolSanctumStatue_GetEntrances, SolSanctumStatue_GetRegions, SolSanctumStatue_GetExits.
Structures
CellCopy
struct CellCopy
A block of map cells copied from one place in the map to another.
| Field | Declared as | |
|---|---|---|
srcX | s32 srcX | map cells |
srcY | s32 srcY | map cells |
destX | s32 destX | map cells |
destY | s32 destY | map cells |
width | s32 width | map cells |
height | s32 height | map cells |
SealScene
struct SealScene
The seal being opened: its cell animations, its flag, where the leader jumps back to and where its statue returns if the story does not go on.
| Field | Declared as | |
|---|---|---|
open | struct CellCopy open | |
pulseA | struct CellCopy pulseA | |
pulseB | struct CellCopy pulseB | |
opened | struct CellCopy opened | |
flag | s32 flag | |
facing | s32 facing | 1/65536 turns |
destX | s32 destX | pixels |
destZ | s32 destZ | pixels |
stairs | struct CellCopy stairs[3] | |
actor | s32 actor | |
actorX | s32 actorX | pixels |
actorZ | s32 actorZ | pixels |
unused | s32 unused[3] | never read or written; the bss keeps its 12 bytes |
Used by SolSanctumStatue_OpenNortheastSeal, SolSanctumStatue_OpenNorthwestSeal, SolSanctumStatue_OpenSeal, SolSanctumStatue_OpenSoutheastSeal, SolSanctumStatue_OpenSouthwestSeal, sSealScene.
Enumerations
StatueHallActor
enum StatueHallActor
The placed actors: Kraden, the eight statues, and the centre statue in its two places. Of the statues, four are pushed onto seals and two shine beams at the centre; the other two never move.
| Value | = | |
|---|---|---|
ACTOR_KRADEN | ACTOR_FIRST_PLACED | |
ACTOR_NORTHWEST_STATUE | ||
ACTOR_LEFT_BEAM_STATUE | ||
ACTOR_NORTHEAST_STATUE | ||
ACTOR_RIGHT_BEAM_STATUE | ||
ACTOR_SOUTHWEST_STATUE | ||
ACTOR_SOUTHEAST_STATUE | ACTOR_FIRST_PLACED + 7 | |
ACTOR_CENTER_STATUE | ACTOR_FIRST_PLACED + 9 | |
ACTOR_MOVED_CENTER_STATUE |
Macros, without a comment: FLAG_SOL_SANCTUM_STATUE_HALL_VISITED, FLAG_SOL_SANCTUM_STATUE_PUZZLE_EXPLAINED, SOL_SANCTUM_STATUE_BACK_SCROLL_ROW_Y_OFFSET, SOL_SANCTUM_STATUE_BACK_SCROLL_ROW_Y_OFFSET, SOL_SANCTUM_STATUE_ROW_SPRITE_COUNT, SOL_SANCTUM_STATUE_SPRITE_WIDTH, NULL, COPY_CELLS.
Globals
sSealScene
static struct SealScene sSealScene
The scene's bss, in this order; as commons of one object the linker would sort them itself.
Used by SolSanctumStatue_OpenNortheastSeal, SolSanctumStatue_OpenNorthwestSeal, SolSanctumStatue_OpenSeal, SolSanctumStatue_OpenSoutheastSeal, SolSanctumStatue_OpenSouthwestSeal.
Also, globals without a comment: gSolSanctumStatue_Entrances, gSolSanctumStatue_Exits, gSolSanctumStatue_Placements, gSolSanctumStatue_Events, gSolSanctumStatue_ScrollPhase.