venus_lighthouse.c
Venus Lighthouse, in six scenes: floor switches that slide walls aside, blocks that sink into sockets to open gates, and sparkling passages the leader steps through.
games/tbs/src/scene/venus_lighthouse.c on GitHub
Venus Lighthouse, in six scenes: floor switches that slide walls aside, blocks that sink into sockets to open gates, and sparkling passages the leader steps through.
Functions
VenusLighthouse_ConfigurePassageEffect
static void VenusLighthouse_ConfigurePassageEffect(struct FieldActor *object, s32 childValue)
Sets up a passage effect's motion, collision and child value.
Used by VenusLighthouse_CreateBlendedPassageEffect, VenusLighthouse_CreateOccludingPassageEffect.
VenusLighthouse_CreateBlendedPassageEffect
static struct FieldActor * VenusLighthouse_CreateBlendedPassageEffect(s32 x, s32 y, s32 z, s32 type)
Creates a blended passage effect behind the actors.
Used by Event_CarryFloatingBlock, Event_EnterRisingPassage, Event_FallThroughFloor, Scene_RunEntrySetup, VenusLighthouse_ReleaseFallenCarryBlock.
VenusLighthouse_CreateOccludingPassageEffect
static struct FieldActor * VenusLighthouse_CreateOccludingPassageEffect(s32 x, s32 y, s32 z, s32 type)
Creates a passage effect that preserves the overlapping actors' draw order.
Used by Event_MoveGateBlock, Event_MovePillarSwitchBlock, Event_MoveSwitchBlock.
VenusLighthouse_PushAdjacentBlock
static void VenusLighthouse_PushAdjacentBlock(void)
Pushes the adjacent block only when its destination and overhead space are clear.
Used by Event_JumpOrPushCarryBlock, Event_JumpOrPushGateBlock, Event_JumpOrPushPillarBlock, Event_JumpOrPushSwitchBlock, Event_PushBlockTowardWall, Event_PushDepthBlock, Event_PushPuzzleBlock.
StagedActor_FillGridAttributeRectangle
static UNUSED s32 StagedActor_FillGridAttributeRectangle(u32 layerIndex, s32 x, s32 z, u32 width, u32 height, s32 collisionCode)
Fills collision codes in a rectangular area of the requested map layer.
Used by CrossboneIslePillarRooms_RestoreGroundFootprint, Event_MoveSinkingPillar, Event_StartMovingSinkingPillar, KolimaForestBridge_Initialize, KolimaForestBridge_PushLog, KolimaForestRiver_Initialize, KolimaForestRiver_PushLog, MogallForest_Initialize, MogallForest_SecondArea_PushLog, MogallForest_ThirdArea_UpdateSouthObstacle, MogallForest_UpdateObstacleFootprint, TunnelRuins_MarkPushPillarCells.
VenusLighthouse_RestoreScriptedChildValues
static void VenusLighthouse_RestoreScriptedChildValues(void)
Restores child values encoded in the placed actors' script timers.
Used by Scene_RunEntrySetup.
VenusLighthouse_UpdateChildFromTimer
static s32 VenusLighthouse_UpdateChildFromTimer(struct ScriptInterpreter *interpreter)
Applies the current script timer's child value and advances the script.
Used by gVenusLighthousePlacements2_0, gVenusLighthousePlacements3_Data.
VenusLighthouse_ClearScriptedSpriteFlags
static s32 VenusLighthouse_ClearScriptedSpriteFlags( struct ScriptInterpreter *interpreter)
Clears the scripted actor's sprite flags and advances its script.
Used by gVenusLighthousePlacements2_1, gVenusPushScript.
Event_EnterSparklingPassage
static void Event_EnterSparklingPassage(void)
Walking north into a sparkling passage: the leader dissolves in sparks and comes out at the passage's exit.
Used by gVenusLighthouseEvents4, gVenusLighthouseEvents5.
VenusLighthouse_ArriveThroughSparkPassage
static void VenusLighthouse_ArriveThroughSparkPassage(void)
Brings the leader out of a sparkling passage on a fresh entrance.
Used by Scene_RunEntrySetup.
Event_SetLeaderAsEffectTarget
static void Event_SetLeaderAsEffectTarget(void)
Stepping onto this spot makes the leader the actor the room's effect follows.
Used by gVenusLighthouseEvents3.
Event_ClearEffectTarget
static void Event_ClearEffectTarget(void)
Stepping onto this spot: the room's effect follows no one.
Used by gVenusLighthouseEvents3.
VenusLighthouse_LandWithRadialDust
static void VenusLighthouse_LandWithRadialDust(void)
Drops the leader onto the floor and emits the radial landing dust.
Used by Scene_RunEntrySetup.
VenusLighthouse_CreateScriptedGateEffect
static struct FieldActor * VenusLighthouse_CreateScriptedGateEffect(s32 x, s32 z, const s32 *script)
Creates a scripted gate effect at the supplied pixel coordinates.
Used by Event_MovePillarSwitchBlock, Event_MoveSwitchBlock.
Event_JumpAcrossGap
static s32 Event_JumpAcrossGap(void)
Walking into a one-tile gap: the leader jumps it if the far side is clear. Returns 1 after a jump, 0 when there was none.
Used by Event_JumpOrPushCarryBlock, Event_JumpOrPushGateBlock, Event_JumpOrPushPillarBlock, Event_JumpOrPushSwitchBlock, gVenusLighthouseEvents6.
SceneData_ReturnZero
const struct SceneRegion *SceneData_ReturnZero(void)
These scenes supply no exit regions.
SceneData_GetPrimaryTable
const u32 *SceneData_GetPrimaryTable(void)
Returns the packed exits shared by the lighthouse scenes.
Scene_GetPlacements
const struct ScenePlacement *Scene_GetPlacements(void)
Selects and clips the placement rows using the original scene dispatch.
Event_SearchLockedDoor
static void Event_SearchLockedDoor(void)
Searching a locked door. "The door is tightly locked."
Used by gTunnelRuinsEventsOther, gVenusLighthouseEvents4, gVenusLighthouseEvents5, gVenusLighthouseEvents6.
Event_HearOfTheAttack
static void Event_HearOfTheAttack(void)
Talking to the man at the entrance (or reading his mind): he flickers away. "Venus Lighthouse was attacked by strange wanderers..."
Used by gVenusLighthouseEvents1.
Event_TalkToWaitingScholar
static void Event_TalkToWaitingScholar(void)
Talking to the scholar who has waited to see inside Venus Lighthouse.
Used by gVenusLighthouseEvents1.
Event_CarryBlockPastWall
static void Event_CarryBlockPastWall(void)
Carry on the block Move could not push past the wall: once it is set down beyond, it stays there (FLAG_VENUS_LIGHTHOUSE_BLOCK_CARRIED).
Used by gVenusLighthouseEvents2.
Event_ReadRelief
static void Event_ReadRelief(void)
Searching a relief shows its words; each relief has its own message, except in English, which keeps one. "There are words carved into the relief..."
Used by gVenusLighthouseEvents2.
Event_HidePath
static void Event_HidePath(void)
Reveal fading: the hidden path disappears again.
Used by gVenusLighthouseEvents2.
Event_RevealPath
static void Event_RevealPath(void)
Reveal: the hidden path appears and can be walked on.
Used by gVenusLighthouseEvents2.
Event_JumpDown
static void Event_JumpDown(void)
Walking off the ledge before the floor switch is held down: the leader jumps down to the floor below and shakes his head.
Used by gVenusLighthouseEvents2.
Event_SearchStatue
static void Event_SearchStatue(void)
Searching the statue: the room flashes and the path it opens changes, and the camera shows it. "The statue speaks to Isaac's soul..."
Used by gVenusLighthouseEvents2.
Event_MoveBlockTowardWall
static void Event_MoveBlockTowardWall(void)
Move on the block by the wall: once it reaches the wall, the first time only, Garet comes out. "Hmmm. We can't push the block farther than this."
Used by Event_PushBlockTowardWall, gVenusLighthouseEvents2.
Event_PushBlockTowardWall
static void Event_PushBlockTowardWall(void)
Pushing the block by the wall: as Move, with Garet's remark at the wall.
Used by gVenusLighthouseEvents2.
Event_MoveBlockOntoSwitch
static void Event_MoveBlockOntoSwitch(void)
Move on the block by the floor switch: on the switch it sinks in and holds it down.
Used by gVenusLighthouseEvents2.
Event_StepOnFloorSwitch
static void Event_StepOnFloorSwitch(void)
Standing on the floor switch presses it; stepping off releases it.
Used by gVenusLighthouseEvents2.
Event_TalkToScholarByDoor
static void Event_TalkToScholarByDoor(void)
Talking to the scholar by the door: he explored once it opened, until Kraden and the others appeared; the camera looks at the door.
Used by gVenusLighthouseEvents2.
Event_FallThroughFloor
static void Event_FallThroughFloor(void)
Stepping onto the hole in the floor: the leader looks down, falls through and lands in the room below.
Used by gVenusLighthouseEvents3.
Event_MoveDepthBlock
static void Event_MoveDepthBlock(void)
Move on one of the three blocks in a row: the floor under each block is solid again and the nearer block draws in front.
Used by Event_PushDepthBlock, Scene_RunEntrySetup, gVenusLighthouseEvents3.
Event_PushDepthBlock
static void Event_PushDepthBlock(void)
Pushing one of the three blocks in a row.
Used by gVenusLighthouseEvents3.
Event_LiftCarryBlock
static void Event_LiftCarryBlock(void)
Move or Carry starting on one of the two blocks by the gap: their tiles are marked before they move.
Used by Event_JumpOrPushCarryBlock, gVenusLighthouseEvents3.
Event_MoveCarryBlock
static void Event_MoveCarryBlock(void)
Move on one of the two blocks by the gap: blocks still above the floor are solid again.
Used by Event_JumpOrPushCarryBlock, Scene_RunEntrySetup, VenusLighthouse_ReleaseFallenCarryBlock, gVenusLighthouseEvents3.
Event_JumpOrPushCarryBlock
static void Event_JumpOrPushCarryBlock(void)
Walking into a gap or a block by it: jump the gap, else push the block.
Used by gVenusLighthouseEvents3.
VenusLighthouse_FixBlockAtDestination
static void VenusLighthouse_FixBlockAtDestination(struct FieldActor *block)
Fixes a block at its destination and restores the cell beneath it.
Used by Event_CarryBlockAcrossGap, Scene_RunEntrySetup.
VenusLighthouse_ReleaseFallenCarryBlock
static void VenusLighthouse_ReleaseFallenCarryBlock(struct FieldActor *block)
Removes a fallen Carry block, or restores collision under the remaining blocks.
Used by Event_CarryBlockAcrossGap.
Event_CarryBlockAcrossGap
static void Event_CarryBlockAcrossGap(void)
Carry on one of the two blocks: set down in its place it stays fixed; dropped into the gap it falls through the floor.
Used by gVenusLighthouseEvents3.
Event_StepOnWallSwitch
static void Event_StepOnWallSwitch(void)
Stepping on the floor switch: the wall slides aside in a cloud of dust, the first time only, and the party goes on through the next exit.
Used by gVenusLighthouseEvents4.
Event_MoveGateBlock
static void Event_MoveGateBlock(void)
Move on the block before the gate: in its socket it sinks in and the gate opens, the first time only.
Used by Event_JumpOrPushGateBlock, Scene_RunEntrySetup, gVenusLighthouseEvents4.
Event_JumpOrPushGateBlock
static void Event_JumpOrPushGateBlock(void)
Walking into the gap or the block before the gate: jump the gap, else push the block, which may sink into its socket.
Used by gVenusLighthouseEvents4.
Event_MoveSwitchBlock
static void Event_MoveSwitchBlock(void)
Move on one of the three blocks: a block on a free socket sinks in, and with all three sunk the gate opens.
Used by Event_JumpOrPushSwitchBlock, Scene_RunEntrySetup, gVenusLighthouseEvents5.
Event_JumpOrPushSwitchBlock
static void Event_JumpOrPushSwitchBlock(void)
Walking into the gap or one of the three blocks: jump the gap, else push the block, which may sink into a socket.
Used by gVenusLighthouseEvents5.
VenusLighthouse_LowerFloatingBlocks
static void VenusLighthouse_LowerFloatingBlocks(s32 waitFrames)
Moves the floating supports to the heights selected by their timers.
Used by Event_CarryFloatingBlock, Scene_RunEntrySetup.
VenusLighthouse_StackFloatingBlock
static void VenusLighthouse_StackFloatingBlock(s32 blockId)
Moves a floating block atop the highest support in its map cell.
Used by Event_CarryFloatingBlock.
FloatingBlock_Settle
static __inline__ void FloatingBlock_Settle(struct FieldActor *block, s32 resetValue)
Stops a floating block and resets its vertical motion and timer.
Used by Event_CarryFloatingBlock.
Actor_CopyPosition
static __inline__ void Actor_CopyPosition(struct FieldActor *destination, struct FieldActor *source)
Copies all three fixed-point position components without changing motion.
Used by Event_CarryFloatingBlock.
Event_CarryFloatingBlock
static void Event_CarryFloatingBlock(void)
Carry on one of the four floating blocks: it settles where it is set down and the platforms under the blocks rise or sink to their weight.
Used by gVenusLighthouseEvents6.
Event_PushPuzzleBlock
static void Event_PushPuzzleBlock(void)
Pushing a block in the pillar room.
Used by gVenusLighthouseEvents6.
Event_StepOnWestWallSwitch
static void Event_StepOnWestWallSwitch(void)
Stepping on the west floor switch: the west wall slides aside, the first time only, and the party goes on through the next exit.
Used by gVenusLighthouseEvents6.
Event_StepOnEastWallSwitch
static void Event_StepOnEastWallSwitch(void)
Stepping on the east floor switch: the east wall slides aside, the first time only, and the party goes on through the next exit.
Used by gVenusLighthouseEvents6.
Event_MovePillarSwitchBlock
static void Event_MovePillarSwitchBlock(void)
Move on one of the four blocks in the pillar room: on a free socket it sinks in, and with all four sunk the gate opens.
Used by Event_JumpOrPushPillarBlock, Scene_RunEntrySetup, gVenusLighthouseEvents6.
Event_JumpOrPushPillarBlock
static void Event_JumpOrPushPillarBlock(void)
Walking into the gap or a pillar-room block: jump the gap, else push the block, which may sink into a socket.
Used by gVenusLighthouseEvents6.
Event_EnterRisingPassage
static void Event_EnterRisingPassage(void)
Walking south into the passage: the leader rises out of the room to the floor above.
Used by gVenusLighthouseEvents6.
Scene_GetEvents
const struct SceneEvent *Scene_GetEvents(void)
Selects the puzzle interactions and dialogue for the current lighthouse scene.
VenusLighthouse_PrepareStandingActor
static void VenusLighthouse_PrepareStandingActor(s32 actorId)
Prepares a stationary actor with the room's initial collision and draw state.
Used by Scene_RunEntrySetup.
VenusLighthouse_VisitPillarActors
static void VenusLighthouse_VisitPillarActors(void)
Visits the four pillar actors through the object lookup service.
Used by Scene_RunEntrySetup.
Scene_RunEntrySetup
s32 Scene_RunEntrySetup(void)
Restores puzzle progress, actors and entrance effects for all six scenes.
Event_DriftNorth
static void Event_DriftNorth(void)
Standing on this floor carries the party north in a trail of dust; at a ledge they drop down.
Used by gVenusLighthouseEvents6.
Event_DriftSouth
static void Event_DriftSouth(void)
As Event_DriftNorth, south.
Used by gVenusLighthouseEvents3, gVenusLighthouseEvents5, gVenusLighthouseEvents6.
Event_DriftWest
static void Event_DriftWest(void)
As Event_DriftNorth, west.
Used by gVenusLighthouseEvents6.
Event_DriftEast
static void Event_DriftEast(void)
As Event_DriftNorth, east.
Used by gVenusLighthouseEvents6.
VenusLighthouse_StepActorWithDust
static void VenusLighthouse_StepActorWithDust(struct Vector3 *direction)
Follows the selected actor through the passage, adjusting for walls and drops. @param direction The way the drifting floor carries the party: -1, 0 or 1 on x and on z; y is not read.
Used by Event_DriftEast, Event_DriftNorth, Event_DriftSouth, Event_DriftWest.
Rubble_SetScaleAndSpin
static __inline__ void Rubble_SetScaleAndSpin(struct EffectOptions *options)
Chooses the particle scales and spin used by the tile-wave animations.
Used by VenusLighthouse_AnimateEastTileWave, VenusLighthouse_AnimatePairedTileWaves, VenusLighthouse_AnimateWestTileWave.
VenusLighthouse_AnimatePairedTileWaves
static void VenusLighthouse_AnimatePairedTileWaves(void)
Animates the two tile waves before taking the linked passage exit.
Used by Scene_RunEntrySetup.
VenusLighthouse_SpawnRandomParticles
static void VenusLighthouse_SpawnRandomParticles(s32 x, s32 z)
Emits the scheduled particles at the supplied passage coordinates.
Used by VenusLighthouse_EmitEastPassageParticles, VenusLighthouse_EmitWestPassageParticles.
VenusLighthouse_AnimateWestTileWave
static void VenusLighthouse_AnimateWestTileWave(void)
Animates the western tile wave and starts its lingering particle task.
Used by Scene_RunEntrySetup.
VenusLighthouse_AnimateEastTileWave
static void VenusLighthouse_AnimateEastTileWave(void)
Animates the eastern tile wave and starts its lingering particle task.
Used by Scene_RunEntrySetup.
VenusLighthouse_RaiseLeaderWithSpray
static void VenusLighthouse_RaiseLeaderWithSpray(void)
Lands the leader on the spray, then raises both toward the exit.
Used by Scene_RunEntrySetup.
VenusLighthouse_DispatchPushScript
static s32 VenusLighthouse_DispatchPushScript(struct ScriptInterpreter *interpreter)
Selects the block's push script from its direction, support animation and socket.
Used by gVenusFirstGateOpenScript, gVenusPillarPushScript2_0, gVenusPillarPushScript3_0, gVenusPillarPushScript4_0, gVenusPillarPushScript5_0, gVenusPillarPushScript5_1, gVenusPillarPushScript6_0, gVenusPillarPushScript7_0, gVenusSecondGateScript, gVenusSettleScriptA, gVenusSettleScriptB, gVenusSwitchPushScript0_1, gVenusSwitchPushScript1_0, gVenusSwitchPushScript1_1, gVenusSwitchPushScript2_1, gVenusSwitchPushScript3_0, gVenusSwitchPushScript3_1.
Also, functions without a comment: SetFlagBits, VenusLighthouse_PulseChildEffect, VenusLighthouse_EmitRisingParticles, VenusLighthouse_EmitPassageSparkTrail, VenusLighthouse_EmitGateParticles, Scene_GetEntrances, VenusLighthouse_FollowSupportingBlockHeight, VenusLighthouse_EmitWestPassageParticles, VenusLighthouse_EmitEastPassageParticles, VenusLighthouse_UpdateRisingSpray.
Macros, without a comment: NULL, FLAG_VENUS_LIGHTHOUSE_WALL_MOVED, FLAG_VENUS_LIGHTHOUSE_WEST_WALL_MOVED, FLAG_VENUS_LIGHTHOUSE_EAST_WALL_MOVED, FLAG_VENUS_LIGHTHOUSE_GATE_OPEN, FLAG_VENUS_LIGHTHOUSE_SOCKETS_A, FLAG_VENUS_LIGHTHOUSE_SOCKETS_B, FLAG_VENUS_LIGHTHOUSE_THREE_BLOCK_GATE_OPEN, FLAG_VENUS_LIGHTHOUSE_PILLAR_GATE_OPEN, VENUS_LIGHTHOUSE_FIXED_OFFSET, VENUS_LIGHTHOUSE_FIXED_OFFSET, VENUS_LIGHTHOUSE_RUN_OPENING_SEQUENCE, VENUS_LIGHTHOUSE_RUN_OPENING_SEQUENCE, VENUS_DESCENT_COLLISION_X, VENUS_DESCENT_COLLISION_WIDTH, VENUS_DESCENT_COLLISION_X, VENUS_DESCENT_COLLISION_WIDTH, DIRECTION_STEP, DIRECTION_STEP.
Globals, without a comment: gEffectScript0, gEffectScript1, gEffectScript2, gStagedActor_DirectionSteps, gVenusSwitchCells, gVenusBlockHeights, gVenusPillarCells, gVenusShapesPushedLeft, gVenusShapesPushedRight, gVenusShapesPushedUp, gVenusShapesPushedDown, gVenusSwitchShape0, gVenusSwitchShape1, gVenusSwitchShape2, gVenusSwitchShape3, gVenusPillarShape0, gVenusPillarShape1, gVenusPillarShape2, gVenusPillarShape3, gVenusPillarShape4, gVenusPillarShape5, gVenusPillarShape6, gEffectScripts, gVenusLighthousePlacements2_0, gVenusLighthousePlacements3_Data, gVenusLeaderApproachScript, gVenusLighthousePlacements2_1, gVenusSprayScript, gVenusLighthousePlacements4_1, gVenusLighthousePlacements5_3, gVenusLighthousePlacements6_4, gVenusLighthousePlacements5_2, gVenusLighthousePlacements5_1, gVenusLighthousePlacements6_3, gVenusPushScript, gVenusSettleScriptA, gVenusSettleScriptB, gVenusRefusedPushScript, gVenusSwitchPushScript0_0, gVenusSwitchPushScript0_1, gVenusSwitchPushScript1_0, gVenusSwitchPushScript1_1, gVenusSwitchPushScript2_1, gVenusSwitchPushScript2_0, gVenusSwitchPushScript3_1, gVenusSwitchPushScript3_0, gVenusFirstGateScript, gVenusFirstGateOpenScript, gVenusPillarPushScript7_0, gVenusPillarPushScript5_1, gVenusPillarPushScript5_0, gVenusPillarPushScript2_0, gVenusPillarPushScript3_0, gVenusSecondGateScript, gVenusPillarPushScript6_0, gVenusPillarPushScript4_0, gVenusPillarPushScript0_0, gVenusPushCells, gVenusSettleCells, gVenusGateCells, gVenusLighthouseEntrances1, gVenusLighthouseEntrancesOther, gVenusLighthouseEntrances3, gVenusLighthouseEntrances4, gVenusLighthouseEntrances5, gVenusLighthouseEntrances6, gVenusLighthousePrimaryTable, gVenusLighthousePlacementsOther, gVenusLighthousePlacements1, gVenusLighthousePlacements2, gVenusLighthousePlacements3, gVenusLighthousePlacements4, gVenusLighthousePlacements5, gVenusLighthousePlacements6, gVenusLighthouseEvents1, gVenusLighthouseEvents2, gVenusLighthouseEvents3, gVenusLighthouseEvents4, gVenusLighthouseEvents5, gVenusLighthouseEvents6, gVenusSwitchShapes, gVenusSwitchPushScript0, gVenusSwitchPushScript1, gVenusSwitchPushScript2, gVenusSwitchPushScript3, gVenusSwitchPushScripts, gVenusPillarShapes, gVenusPillarPushScript0, gVenusPillarPushScript1, gVenusPillarPushScript2, gVenusPillarPushScript3, gVenusPillarPushScript4, gVenusPillarPushScript5, gVenusPillarPushScript6, gVenusPillarPushScript7, gVenusPillarPushScripts.