Alchemy

mercury_lighthouse.c

Mercury Lighthouse, in four maps.

games/tbs/src/scene/mercury_lighthouse.c on GitHub

Mercury Lighthouse, in four maps. The fourth is the lighthouse's foot, with the Hermes fountain, the lift and the door Mia opens; the others are floors inside, entered from the entrance hall (mercury_lighthouse_entrance.c). Sprite 0xe0 is a statue: Mia says "This statue wasn't here before" of the one blocking her on the first.

Functions

MercuryLighthouse_StartDjinnBattle

static void MercuryLighthouse_StartDjinnBattle(void)

Talking to Sleet: the Djinni battle (Djinni 21, Mercury Djinni 1).

Line 185

MercuryLighthouse_UpdateLeaderEffectTarget

static void MercuryLighthouse_UpdateLeaderEffectTarget(void)

Scheduler callback: the fade overlay stops following the leader while he crosses the patched floor region (map layer 0, 16-pixel rows 13 to 18).

Line 192

MercuryLighthouse_GetExits

const u32 *MercuryLighthouse_GetExits(void)

Returns the packed exits shared by the lighthouse scenes.

Line 226

MercuryLighthouse_GetPlacements

const struct ScenePlacement *MercuryLighthouse_GetPlacements(void)

Selects the actors and obstacles for the current lighthouse scene.

Line 229

MercuryLighthouse_SpawnTimedRiseEffect

static void MercuryLighthouse_SpawnTimedRiseEffect(void)

On the first map, as in the entrance hall, once Ply has worked there: touching trigger 21 keeps rising sparks appearing on the pillar.

Line 249

MercuryLighthouse_ReleaseRaisedPillar

static void MercuryLighthouse_ReleaseRaisedPillar(void)

Touching trigger 31 or 32: the raised pillar is let go.

Line 254

MercuryLighthouse_TryPillarStep

static void MercuryLighthouse_TryPillarStep(void)

Walking into trigger 11, 21 or 31: one step across the water pillars.

Line 259

MercuryLighthouse_RaiseTouchedPillar

static void MercuryLighthouse_RaiseTouchedPillar(void)

Touching trigger 11: the pillar underfoot rises to its full height.

Line 264

MercuryLighthouse_InspectBlockedPassage

static void MercuryLighthouse_InspectBlockedPassage(void)

Searching trigger 10 at the lighthouse's foot. "Strange forces are at work..."

Line 270

MercuryLighthouse_GetEvents

const struct SceneEvent *MercuryLighthouse_GetEvents(void)

Selects the puzzle interactions and dialogue for the current scene.

Line 277

MercuryLighthouse_ExitWithSparks

static void MercuryLighthouse_ExitWithSparks(void)

Walking north into trigger 53 on the third map: the leader rises through exit 3 (the trigger less 50), as the entrance hall's risers do.

Line 296

MercuryLighthouse_ExitAfterSparkStep

static void MercuryLighthouse_ExitAfterSparkStep(void)

Walking north into trigger 63 on the third map: the same, through exit 13.

Line 301

MercuryLighthouse_LeaveWithSparkTrail

static void MercuryLighthouse_LeaveWithSparkTrail(void)

Walking north into trigger 55 at the foot: the same, through exit 5.

Line 306

MercuryLighthouse_ExitWhenChannelsOpen

static void MercuryLighthouse_ExitWhenChannelsOpen(void)

With all three channel blocks in place the floor shakes, the screen fades and the party is carried down to the entrance hall (exit 13); moving one out again clears the flag.

Used by MercuryLighthouse_MoveChannelBlocks.

Line 313

MercuryLighthouse_MoveChannelBlocks

static void MercuryLighthouse_MoveChannelBlocks(void)

Pushing a channel block (walking into trigger 25) on the first map: each block opens one channel when it reaches its place, and the water runs on through the ones before it.

Line 337

MercuryLighthouse_WalkLeaderIn

static void MercuryLighthouse_WalkLeaderIn(void)

Touching trigger 2, 3 or 4 once the stairs are raised, or 46: the leader is carried to the landing in a trail of sparkles.

Line 401

MercuryLighthouse_PushGateSwitchBlock

static void MercuryLighthouse_PushGateSwitchBlock(void)

Pushing the gate statue (walking into trigger 10) while the gate is shut: it moves a step, and may come to rest on the floor switch.

Line 433

MercuryLighthouse_OpenGateWithMovedBlock

static void MercuryLighthouse_OpenGateWithMovedBlock(void)

Move on the gate statue, or after a push: resting on the floor switch at (5, 13), it sinks two pixels and the gate opens for good.

Used by MercuryLighthouse_PushGateSwitchBlock.

Line 442

MercuryLighthouse_PressGateFloorSwitch

static void MercuryLighthouse_PressGateFloorSwitch(void)

Touching trigger 12 while the gate is shut: standing on the floor switch sinks the leader two pixels and opens the gate.

Line 469

MercuryLighthouse_CloseFloorSwitch

static void MercuryLighthouse_CloseFloorSwitch(void)

Touching trigger 10 or 13: stepping off the switch closes the gate again.

Line 493

MercuryLighthouse_AnimateFountainTiles

static void MercuryLighthouse_AnimateFountainTiles(s32 delayFrames, s32 firstStep, s32 endStep)

Animates the fountain's map strips between the requested steps.

Used by MercuryLighthouse_OpenFountainWithSpray.

Line 511

MercuryLighthouse_RestoreFountainTiles

static void MercuryLighthouse_RestoreFountainTiles(s32 delayFrames)

Restores the fountain's map strips after moving its block away.

Used by MercuryLighthouse_MoveStairAndFountainBlocks.

Line 540

MercuryLighthouse_SprayAtFountain

static void MercuryLighthouse_SprayAtFountain(void)

Emits the scheduled spray at the fountain's fixed position.

Used by MercuryLighthouse_OpenFountainWithSpray, MercuryLighthouse_StopFountainSpray.

Line 579

MercuryLighthouse_OpenFountainWithSpray

static void MercuryLighthouse_OpenFountainWithSpray(s32 delayFrames)

Opens the fountain row by row and starts its continuous spray.

Used by MercuryLighthouse_MoveStairAndFountainBlocks.

Line 584

MercuryLighthouse_StopFountainSpray

static void MercuryLighthouse_StopFountainSpray(void)

Restores the fountain tiles and stops its continuous spray.

Used by MercuryLighthouse_MoveStairAndFountainBlocks.

Line 650

MercuryLighthouse_MoveStairAndFountainBlocks

static void MercuryLighthouse_MoveStairAndFountainBlocks(void)

Pushing a block on the second map (walking into trigger 1 or 45): the stair block raises the stairs at column 11 and lowers them anywhere else; the fountain block starts the fountain at row 40, the first time with the camera watching, and stops it at row 42.

Line 692

MercuryLighthouse_PushStairSwitchBlock

static void MercuryLighthouse_PushStairSwitchBlock(void)

Pushing the fallen statue (walking into trigger 10 or 12) while the stair gate is shut: it moves a step and may come to rest on the floor switch.

Line 755

MercuryLighthouse_OpenStairGateWithMovedBlock

static void MercuryLighthouse_OpenStairGateWithMovedBlock(void)

Move on the fallen statue, or after a push: resting on the switch at (10, 23), it sinks two pixels and the stair gate opens for good.

Used by MercuryLighthouse_PushStairSwitchBlock.

Line 764

MercuryLighthouse_PressStairFloorSwitch

static void MercuryLighthouse_PressStairFloorSwitch(void)

Touching trigger 12 while the stair gate is shut: standing on its switch opens it.

Line 785

MercuryLighthouse_ReleaseStairFloorSwitch

static void MercuryLighthouse_ReleaseStairFloorSwitch(void)

Touching trigger 10: stepping off the switch closes the stair gate.

Line 812

MercuryLighthouse_RandomDoorParticleSpeed

static __inline__ s32 MercuryLighthouse_RandomDoorParticleSpeed(void)

Chooses the random speed component used by stone-door particles.

Used by MercuryLighthouse_OpenStoneDoor.

Line 830

MercuryLighthouse_OpenStoneDoor

static void MercuryLighthouse_OpenStoneDoor(s32 side)

Opens the selected stone door with particles along its moving edge.

Line 840

MercuryLighthouse_CloseStoneDoor

static void MercuryLighthouse_CloseStoneDoor(s32 side)

Restores the selected stone door's tiles with trailing particles.

Line 900

MercuryLighthouse_StartStatueSlide

static s32 MercuryLighthouse_StartStatueSlide(void)

The camera turns to the sliding statue, which moves on only for the door switch block positions recorded; returns 1 when it slides off its ledge.

Line 943

MercuryLighthouse_SprayAboveStatue

static void MercuryLighthouse_SprayAboveStatue(void)

Sparkles rise from the sliding statue as it moves.

Used by MercuryLighthouse_StartStatueSpray.

Line 981

MercuryLighthouse_StartStatueSpray

static s32 MercuryLighthouse_StartStatueSpray(struct ScriptInterpreter *interpreter)

The slide scripts start the sparkles as the statue sets off.

Line 992

Also, functions without a comment: MercuryLighthouse_GetEntrances, MercuryLighthouse_GetRegions.

Enumerations

MercuryLighthouse1Actor

enum MercuryLighthouse1Actor

The first map: Mia, the statue that blocks her and the channel blocks.

Value=
ACTOR_STATUE_BLOCKING_MIAACTOR_FIRST_PLACED
ACTOR_CHANNEL_BLOCK_1
ACTOR_CHANNEL_BLOCK_2
ACTOR_CHANNEL_BLOCK_3

Line 99

MercuryLighthouse2Actor

enum MercuryLighthouse2Actor

The second map: the stair and fountain blocks, the statue for the gate's floor switch and Sleet, Mercury Djinni 1.

Value=
ACTOR_STAIR_BLOCKACTOR_FIRST_PLACED
ACTOR_FOUNTAIN_BLOCKACTOR_FIRST_PLACED + 2
ACTOR_GATE_STATUE
ACTOR_SLEET

Line 108

MercuryLighthouse3Actor

enum MercuryLighthouse3Actor

The third map: the sliding statue and where it lands below, the blocks of the stone-door room, the five blocks of the crossing and one more.

Value=
ACTOR_FALLEN_STATUEACTOR_FIRST_PLACED
ACTOR_SLIDING_STATUE
ACTOR_DOOR_ROOM_BLOCK
ACTOR_DOOR_SWITCH_BLOCK
ACTOR_FIRST_CROSSING_BLOCKACTOR_FIRST_PLACED + 7
ACTOR_LAST_CROSSING_BLOCKACTOR_FIRST_CROSSING_BLOCK + 4
ACTOR_GAP_BLOCK

Line 117

MercuryLighthouse4Actor

enum MercuryLighthouse4Actor

The fourth map: Garet, Ivan and Mia in their own party slots, the statue at the door, the Ply target, the statue by the waterfall, the statue on the lift and the people at the fountain.

Value=
ACTOR_DOOR_STATUEACTOR_FIRST_PLACED + 2
ACTOR_PLY_TARGET
ACTOR_WATERFALL_STATUE
ACTOR_LIFT_STATUE
ACTOR_FIRST_VISITOR

Line 130

Macros, without a comment: MERCURY_LIGHTHOUSE_MOVE_LEADER_TO_ENTRY, MERCURY_LIGHTHOUSE_MOVE_LEADER_TO_ENTRY, MERCURY_LIGHTHOUSE_ANIMATE_ACTOR_AND_WAIT, MERCURY_LIGHTHOUSE_ANIMATE_ACTOR_AND_WAIT, NULL, MERCURY_LIGHTHOUSE_OFFSET_FIXED, MERCURY_LIGHTHOUSE_OFFSET_FIXED.

Declarations, without a comment: MercuryLighthouse_SyncBlockFlags, SceneEffect_SpawnParticleRowsAndDrawTiles, MercuryLighthouse_OpenThreeStepStair, SceneEffect_SpawnParticleEveryFourthFrame, SceneEffect_SpawnRandomEveryFourFrames, SceneEffect_SpawnWithRandomOffset, SceneEffect_SpawnRandomizedBurst, MercuryLighthouse_RideLift, MercuryLighthouse_MiaCastsPlyOnEntrance, MercuryLighthouse_ReplaceInventoryItem.

On this page