Alchemy

bilibin.c

Bilibin's village, river crossing and raised warehouse approach.

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

Bilibin's village, river crossing and raised warehouse approach. Town dialogue changes with the tree curse; the river route includes a rescue and Jill's reward for helping the stranded villager.

Functions

Bilibin_GetRegions

const struct SceneRegion *Bilibin_GetRegions(void)

Only the raised approach supplies exit-region boxes.

Line 92

Bilibin_GetExits

const u32 *Bilibin_GetExits(void)

Returns the packed exit destinations shared by the three maps.

Line 100

Event_GustJoins

static void Event_GustJoins(void)

Gust, Jupiter Djinni 0, joins the party on the warehouse approach.

Used by gBilibinEvents2.

Line 103

Bilibin_GetPlacements

const struct ScenePlacement *Bilibin_GetPlacements(void)

Selects the village, river or raised-approach actors.

Line 106

Event_InspectWell

static void Event_InspectWell(void)

Reads the two-part description of the deep well.

Used by gBilibinEvents1.

Line 122

Event_ReadRestrictedAreaSign

static void Event_ReadRestrictedAreaSign(void)

Reads the sign restricting entry without permission.

Used by gBilibinEvents3.

Line 145

Event_ReadWarehouseSign

static void Event_ReadWarehouseSign(void)

Reads McCoy's warning on the hidden warehouse.

Used by gBilibinEvents2.

Line 152

Event_InspectHumanShapedTree

static void Event_InspectHumanShapedTree(void)

Describes the human shape shared by the river's transformed villagers.

Used by gBilibinEvents3.

Line 159

Event_ExamineTreeMan

static void Event_ExamineTreeMan(void)

The tree at the village entrance almost looks like a man; looked at again, like a living person. 0x301 remembers the first look while in the village.

Used by gBilibinEvents1.

Line 167

Event_AskAboutEntranceTree

static void Event_AskAboutEntranceTree(void)

Asks whether the party saw the strange tree at the entrance.

Used by gBilibinEvents1.

Line 179

Event_AskAboutSoutheastRoute

static void Event_AskAboutSoutheastRoute(void)

Asks whether the party tried the route southeast from Bilibin.

Used by gBilibinEvents1.

Line 187

Event_AskAboutBeingATree

static void Event_AskAboutBeingATree(void)

Once the curse is lifted, the man who was the entrance tree asks whether the party can believe it.

Used by gBilibinEvents1.

Line 196

Event_AskAboutCurseBreakers

static void Event_AskAboutCurseBreakers(void)

Asks whether the party are the three warriors who broke the curse.

Used by gBilibinEvents1.

Line 204

Event_AskAboutImil

static void Event_AskAboutImil(void)

Asks whether the party has visited Imil to the north.

Used by gBilibinEvents1.

Line 212

Event_OpenDoorAndLeave

static void Event_OpenDoorAndLeave(void)

Walking into a door: everyone stops, the door opens and the leader walks through it. Doors 3 to 8 lead into the houses and shops, door 9 into the Sanctum, whose door sounds and is stepped through differently.

Used by gBilibinEvents1.

Line 222

Event_PullJillFromRiver

static void Event_PullJillFromRiver(void)

Move on Jill, a tree caught in the river: from cell column 6, by the bank, the leader pulls her ashore in three tugs, and she thanks the party for saving her from being washed downstream.

Used by gBilibinEvents3.

Line 278

Event_CheckAhead

static void Event_CheckAhead(void)

Checks the blocked direction before allowing another movement step.

Used by gBilibinEvents2, gBilibinEvents3, gColossoLogEvents, gColossoWallEvents, gGondowanCaveEvents3, gSolSanctumElementalStarRoom_Events.

Line 331

Event_JillGivesHardNut

static void Event_JillGivesHardNut(void)

Back on the riverbank once the curse is lifted, Jill and her friends recognize the party, and she gives the leader a Hard Nut in thanks. "Remember me? I was that tree!"

Used by gBilibinEvents3.

Line 336

Bilibin_Initialize

s32 Bilibin_Initialize(void)

Restores the current map's actors, collision cells and opening transition.

Line 435

Bilibin_RestoreVillageActors

static void Bilibin_RestoreVillageActors(void)

Restores the village population and entrance-dependent actor positions.

Used by Bilibin_Initialize.

Line 449

Bilibin_UpdateVillageBlockCells

static void Bilibin_UpdateVillageBlockCells(void)

Updates collision cells around the movable block and moves an overlapping leader clear.

Used by Bilibin_RestoreVillageActors, Event_PushBlock, gBilibinEvents1.

Line 487

Bilibin_RestoreRiverActors

static void Bilibin_RestoreRiverActors(void)

Sets up the river: before the curse is lifted, Jill and her friends are trees here; afterwards they are people again on the bank.

Used by Bilibin_Initialize.

Line 530

Bilibin_UpdateRiverBlockCells

static void Bilibin_UpdateRiverBlockCells(void)

Restores ten river cells, then clears the movable block's current cell.

Used by Bilibin_RestoreRiverActors, Event_PushBlock, gBilibinEvents3.

Line 602

Bilibin_RestoreRaisedEntrance

static void Bilibin_RestoreRaisedEntrance(void)

Restores the block cells and starts the raised arrivals above floor height.

Used by Bilibin_Initialize.

Line 623

Event_PushBlock

static void Event_PushBlock(void)

Pushing a block: it slides one cell ahead with the leader behind it, if the cell is free.

Used by gBilibinEvents1, gBilibinEvents2, gBilibinEvents3, gSolSanctumEntranceEvents1Entrances11To13, gSolSanctumEntranceEvents1Entrances14To16.

Line 645

Bilibin_UpdateRiverEffect

static void Bilibin_UpdateRiverEffect(void)

Runs every frame in the river: while the controlled actor is west of x 142 and below 8 pixels high, an effect appears at it every thirty frames.

Used by Bilibin_Initialize.

Line 695

Bilibin_SpawnRiverEffect

static void Bilibin_SpawnRiverEffect(struct FieldActor *actor)

Spawns the semi-transparent effect, which frees itself after thirty frames.

Used by Bilibin_UpdateRiverEffect.

Line 712

Bilibin_UpdateRaisedBlockCells

static void Bilibin_UpdateRaisedBlockCells(void)

Updates the two passage cells according to the movable block's current row.

Used by Bilibin_RestoreRaisedEntrance, Event_PushBlock, gBilibinEvents2.

Line 736

Also, functions without a comment: Bilibin_GetEntrances, Bilibin_GetEvents.

Structures

SpawnCounter

struct SpawnCounter

Counts frames between the river effects, one every 30 frames.

FieldDeclared as
framess16 frames

Used by gBilibin_RiverEffectTimer.

Line 68

Macros

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 1062

Globals, without a comment: gBilibin_RiverEffectTimer, gBilibin_FaceLeaderScript, gBilibinEntrancesOther, gBilibinEntrances1, gBilibinEntrances3, gBilibinEntrances2, gBilibinRegions2, gBilibinExits, gBilibinPlacementsOther, gBilibinPlacements1, gBilibinPlacements3, gBilibinPlacements2, gBilibinEventsOther, gBilibinEvents1, gBilibinEvents3, gBilibinEvents2, gBilibin_DoorSteps6, gBilibin_DoorSteps4, gBilibin_DoorSteps5, gBilibin_DoorSteps1, gBilibin_DoorSteps0, gBilibin_DoorSteps2, gBilibin_DoorSteps3, gBilibin_DoorSteps, gBilibin_DoorCells, gBilibin_RiverBlockCells, gBilibin_FacingCellSteps, gBilibin_TransientEffectScript.

On this page