Alchemy

babi_lighthouse.c

Babi Lighthouse, the lighthouse Babi is building on old ruins near Lalivero.

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

Babi Lighthouse, the lighthouse Babi is building on old ruins near Lalivero. Four scenes share this overlay:

  • room 1, the stone door Sheba's kidnappers went through, where Iodem and Faran ask the party to follow them; a switch only Reveal shows opens it;
  • room 2, inside, where the party drops between floors, with a Djinni;
  • room 3, where the kidnappers knocked down four men on their way, with two blocks on ledges and a sprout for Growth;
  • the building site outside, with its workers and a block to move.

Functions

Entrance_Divide

static __inline__ s32 UNUSED Entrance_Divide(s32 dividend, s32 divisor)

Unused: a signed division nothing calls.

Line 96

BabiLighthouse_StartDjinnBattle

static void BabiLighthouse_StartDjinnBattle(void)

Talking to the Djinni in room 2 starts the battle for Djinni 66.

Used by gBabiLighthouse_Events2.

Line 106

BabiLighthouse_LandWithParticles

static void BabiLighthouse_LandWithParticles(void)

Arriving by falling from the floor above: the leader drops in, lands with a thud that shakes the screen and throws up a ring of dust, and is startled.

Used by BabiLighthouse_SetupScene.

Line 115

BabiLighthouse_FallToExit

static void BabiLighthouse_FallToExit(s32 exit)

Arriving at one of room 2's drop entrances: the leader drops in and falls on, out through the given exit.

Used by BabiLighthouse_SetupScene.

Line 166

Scene_GetRegions

const struct SceneRegion *Scene_GetRegions(void)

Only room 3 has regions.

Line 211

BabiLighthouse_GetExits

const u32 *BabiLighthouse_GetExits(void)

The four scenes share one exit table.

Line 219

BabiLighthouse_JumpFromLedge

static void BabiLighthouse_JumpFromLedge(void)

After Move on one of room 3's blocks, or a push: a leader left standing on a block's ledge cell jumps off it, and the blocks' cells are redrawn.

Used by BabiLighthouse_AdvancePairAndJump, gBabiLighthouse_Events3.

Line 238

BabiLighthouse_AdvancePairAndJump

static void BabiLighthouse_AdvancePairAndJump(void)

Walking into one of room 3's blocks pushes it.

Used by BabiLighthouse_ClimbDownOrAdvancePair, gBabiLighthouse_Events3.

Line 269

BabiLighthouse_ClimbDownOrAdvancePair

static void BabiLighthouse_ClimbDownOrAdvancePair(void)

Walking south off room 3's ledge: pushes the block below on the leader's side if it stands at the ledge's foot, and otherwise climbs down.

Used by gBabiLighthouse_Events3.

Line 278

BabiLighthouse_RiseAndCloseScreen

static void BabiLighthouse_RiseAndCloseScreen(void)

Raises the leader, then closes the screen before a room transition.

Used by BabiLighthouse_RisePastPairedEffects, BabiLighthouse_RisePastSingleEffect, BabiLighthouse_RiseToAlternateExit, BabiLighthouse_RiseToExit.

Line 301

BabiLighthouse_RiseToExit

static void BabiLighthouse_RiseToExit(void)

Raises the leader and takes exit 11 without preparing an extra effect.

Used by gBabiLighthouse_Events2.

Line 309

BabiLighthouse_RisePastSingleEffect

static void BabiLighthouse_RisePastSingleEffect(void)

Prepares one effect, raises the leader, then takes exit 12.

Used by gBabiLighthouse_Events2.

Line 317

BabiLighthouse_RisePastPairedEffects

static void BabiLighthouse_RisePastPairedEffects(void)

Prepares two effects, raises the leader, then takes exit 13.

Used by gBabiLighthouse_Events2.

Line 326

BabiLighthouse_RiseToAlternateExit

static void BabiLighthouse_RiseToAlternateExit(void)

Raises the leader and takes exit 15 without preparing an extra effect.

Used by gBabiLighthouse_Events2.

Line 336

BabiLighthouse_InspectLockedDoor

static void BabiLighthouse_InspectLockedDoor(void)

Searching room 2's door. "It seems to be locked."

Used by gBabiLighthouse_Events2.

Line 344

BabiLighthouse_RegroupPartyMember

static inline void BabiLighthouse_RegroupPartyMember(s32 actorId)

A companion walks back to the leader and rejoins the party.

Used by BabiLighthouse_DiscussPursuit, BabiLighthouse_ExplainTruthDoor.

Line 352

BabiLighthouse_DiscussPursuit

static void BabiLighthouse_DiscussPursuit(void)

Walking up to room 1's stone door the first time: Faran asks whether the kidnappers really went through it; the onlookers argue, and Iodem, arriving with the party, tells who they are, and Faran, doubting them, asks them to prove they can follow by opening the door.

Used by gBabiLighthouse_Events1.

Line 368

BabiLighthouse_ExplainTruthDoor

static void BabiLighthouse_ExplainTruthDoor(void)

The door opens before Iodem and Faran the first time: everyone marvels, the door closes again, and the party says those without Psynergy cannot follow; Iodem and Faran leave Sheba's rescue to them.

Used by BabiLighthouse_OpenTruthDoor.

Line 629

BabiLighthouse_RefreshTruthDoorTiles

static void BabiLighthouse_RefreshTruthDoorTiles(void)

Reveal shows the door's switch, flipped one way or the other as the door stands.

Used by gBabiLighthouse_Events1.

Line 899

BabiLighthouse_HideTruthDoorSwitch

static void BabiLighthouse_HideTruthDoorSwitch(void)

Reveal's light ends and the switch is hidden again.

Used by gBabiLighthouse_Events1.

Line 908

BabiLighthouse_OpenTruthDoor

static void BabiLighthouse_OpenTruthDoor(void)

The stone door's halves slide open (SE_GATE_MOVE); the first time, Iodem and Faran see it.

Used by BabiLighthouse_InspectTruthDoorSwitch, gBabiLighthouse_Events1.

Line 914

BabiLighthouse_CloseTruthDoor

static void BabiLighthouse_CloseTruthDoor(void)

Walking through the open door: it slides shut behind the party, now on its other side.

Used by BabiLighthouse_ExplainTruthDoor, gBabiLighthouse_Events1.

Line 933

BabiLighthouse_InspectTruthDoorSwitch

static void BabiLighthouse_InspectTruthDoorSwitch(void)

Searching the door's switch: under Reveal's light it is flipped and the door opens; otherwise it reads an inscription. "The truth of this door is open to those seeing with their true heart."

Used by gBabiLighthouse_Events1.

Line 955

BabiLighthouse_FindActorAhead

static struct FieldActor * BabiLighthouse_FindActorAhead(struct FieldActor *actor)

Finds the staged actor one direction-table step ahead, including terrain height.

Used by BabiLighthouse_AdvanceNearbyPair, BabiLighthouse_ClimbOrAdvancePair.

Line 981

BabiLighthouse_EnableChildOption

static void BabiLighthouse_EnableChildOption(void)

Carry's first phase on the building site's block sets the effect's childOption; what that changes is not known.

Used by gBabiLighthouse_EventsOther.

Line 1002

BabiLighthouse_UpdateMovedBlock

static void BabiLighthouse_UpdateMovedBlock(void)

After Move or Carry on the building site's block: in its cell at (20, 12) it settles at a height of 48 pixels.

Used by gBabiLighthouse_EventsOther.

Line 1008

BabiLighthouse_AdvanceNearbyPair

static void BabiLighthouse_AdvanceNearbyPair(void)

Advances the staged pair only when the actor ahead is less than eight pixels away vertically.

Used by BabiLighthouse_ClimbOrAdvancePair, gBabiLighthouse_EventsOther.

Line 1030

BabiLighthouse_ClimbOrAdvancePair

static void BabiLighthouse_ClimbOrAdvancePair(void)

Tries vertical climbing first, then advances the staged pair when appropriate.

Used by gBabiLighthouse_EventsOther.

Line 1059

BabiLighthouse_OpenGrowthPassage

static void BabiLighthouse_OpenGrowthPassage(void)

Growth on room 3's sprout: it grows into a vine the party can climb.

Used by BabiLighthouse_SetupScene, gBabiLighthouse_Events3.

Line 1097

BabiLighthouse_RefreshMovableBlockTiles

static void BabiLighthouse_RefreshMovableBlockTiles(void)

Redraws room 3's ledge cells, then blocks the cells under its two blocks.

Used by BabiLighthouse_JumpFromLedge, BabiLighthouse_SetupScene.

Line 1105

BabiLighthouse_MatchLeaderPriority

static void BabiLighthouse_MatchLeaderPriority(union FieldObject *fieldObject)

Update callback of room 3's blocks (TBS_PATCH_2 and later): each is drawn in front of the leader when nearer the screen, and on its layer otherwise.

Used by BabiLighthouse_SetupScene.

Line 1128

BabiLighthouse_SetupScene

s32 BabiLighthouse_SetupScene(void)

Sets up the scene being entered: Retreat leads back to room 3; the site's block, room 3's blocks, vine and fallen men, room 2's arrivals by falling, and room 1's door and onlookers are restored. Returns 0.

Line 1160

Also, functions without a comment: Scene_GetEntrances, Scene_GetPlacements, Scene_GetEvents.

Macros

SEARCH_CHEST_FACING

#define SEARCH_CHEST_FACING(facing)

A chest searched while facing the given way.

Used by gBabiLighthouse_EventsOther.

Line 89

DIRECTION_STEP

#define DIRECTION_STEP(dx, dz) (((dx) << 16) | ((dz) & 0xffff))

Pixel step by direction: X in the upper halfword, Z in the lower.

Used by gBilibinCave_PushSteps, gBilibin_FacingCellSteps, gColossoRiver_DirectionSteps, gColossoWall_DirectionSteps, gStagedActor_DirectionSteps.

Line 1335

Also, macros without a comment: FIELD_STAGED_ACTOR_IMPORTS.

Globals, without a comment: gStagedActor_DirectionSteps, gStagedActor_FootprintKinds, gStagedActor_FootprintBounds, gEffectScript0, gEffectScript1, gEffectScript2, gEffectScripts, gBabiLighthouse_TrembleScript, gBabiLighthouse_Entrances3, gBabiLighthouse_Entrances2, gBabiLighthouse_Entrances1, gBabiLighthouse_EntrancesOther, gBabiLighthouse_Regions3, gBabiLighthouse_Exits, gBabiLighthouse_NoPlacements, gBabiLighthouse_Placements3, gBabiLighthouse_Placements2, gBabiLighthouse_Placements1, gBabiLighthouse_PlacementsOther, gBabiLighthouse_Events3, gBabiLighthouse_Events2, gBabiLighthouse_Events1, gBabiLighthouse_EventsOther.

On this page