Alchemy

kalay.c

Kalay, in six maps: the town, the palace gate, the cave by the palace's secret passage, two more maps and the tunnel with the two blocks.

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

Kalay, in six maps: the town, the palace gate, the cave by the palace's secret passage, two more maps and the tunnel with the two blocks. Leaving town after hearing of the Colosso tour, the party watches the tour group stop and set off without its missing man.

Functions

Kalay_ClearScriptDone

static __inline__ void Kalay_ClearScriptDone(struct FieldActor *actor)

Clears the flag a guide's script sets when it is done.

Used by Kalay_AlternateGuidesPacing.

Line 109

Kalay_RecruitDjinn

static void Kalay_RecruitDjinn(void)

Talking to the Mars Djinni in the tunnel adds it to the party.

Line 116

Kalay_UpdateTouristFidget

static s32 Kalay_UpdateTouristFidget(struct ScriptInterpreter *interpreter)

While the tour waits, a tourist now and then nods, shakes his head or turns.

Line 121

Kalay_GetExits

const u32 *Kalay_GetExits(void)

The numbered exits of all six maps.

Line 179

Kalay_GetPlacements

const struct ScenePlacement *Kalay_GetPlacements(void)

The people of the town, palace gate, cave and tunnel.

Line 182

Kalay_SearchWell

static void Kalay_SearchWell(void)

Searching the town well: the party peers in, and it is very clean.

Line 201

Kalay_CatchCaveNut

static void Kalay_CatchCaveNut(void)

Catch pulls in the Nut floating in the cave.

Line 209

Kalay_GetEvents

const struct SceneEvent *Kalay_GetEvents(void)

The conversations, exits and Psynergy targets of each map.

Line 219

Kalay_TalkAboutLeavingHome

static void Kalay_TalkAboutLeavingHome(void)

A man tells why he moved to Kalay: he left Tolbi, afraid of Babi.

Line 244

Kalay_AskAboutCaveAccess

static void Kalay_AskAboutCaveAccess(void)

Spoken to from any side but the north, the cave guard asks whether the party wants to go into the cave, and turns it away either way.

Line 253

Kalay_TalkAboutLayana

static void Kalay_TalkAboutLayana(void)

In the tunnel, a man asks whether Layana was too hard on the party.

Line 280

Kalay_TalkToWeaponMerchant

static void Kalay_TalkToWeaponMerchant(void)

Across the counter, the leader facing north, the weapon shop opens; from elsewhere the merchant grumbles that Hammet sells his best weapons away.

Line 289

Kalay_TalkToArmorMerchant

static void Kalay_TalkToArmorMerchant(void)

Across the counter, the leader facing west to north, the armor shop opens; from elsewhere the merchant asks whether the party found its weapons.

Line 307

Kalay_TalkToItemMerchant

static void Kalay_TalkToItemMerchant(void)

Across the counter, the leader facing east, the item shop opens; from elsewhere the merchant praises Lady Layana.

Line 325

Kalay_OpenDoorAndExit

static void Kalay_OpenDoorAndExit(void)

Walking north into a house door, everyone stops, the door opens and the leader walks in.

Line 343

Kalay_AnimatePalaceDoor

static __inline__ void Kalay_AnimatePalaceDoor(void)

The palace door opens in two frames.

Used by Kalay_EnterPalace, Kalay_IvanMeetsPalaceGuards.

Line 379

Kalay_EnterPalace

static void Kalay_EnterPalace(void)

Walking north into the palace door, it opens and the leader walks in.

Line 388

Kalay_WatchTourGroupDeparture

static void Kalay_WatchTourGroupDeparture(void)

Leaving town (triggers 9 and 10) after hearing of the Colosso tour, the party watches the tour group stop: the guides count everyone, pace back and forth while the tourists grumble, give up on the missing man and lead the group off. The late tourist then runs after it. Otherwise the party leaves.

Line 406

Kalay_StopTrackingLeader

static void Kalay_StopTrackingLeader(void)

Touching trigger 10 in the tunnel stops the fade overlay following the leader.

Line 867

Kalay_StartTrackingLeader

static void Kalay_StartTrackingLeader(void)

Touching trigger 11 in the tunnel makes the fade overlay follow the leader.

Used by Kalay_UpdateTunnelPassages.

Line 875

Kalay_EnableLeaderAutomaticPriority

static void Kalay_EnableLeaderAutomaticPriority(void)

Trigger 19 in the tunnel: the leader's depth priority follows his position.

Line 886

Kalay_DisableLeaderAutomaticPriority

static void Kalay_DisableLeaderAutomaticPriority(void)

Trigger 18 in the tunnel: the leader's depth priority stays fixed.

Line 897

Kalay_CatchTownNut

static void Kalay_CatchTownNut(void)

Catch pulls in the Nut circling in the town.

Line 908

Kalay_Initialize

s32 Kalay_Initialize(void)

Every map of Kalay sets flag 0x87a, then prepares its own people and cells.

Line 918

Kalay_PrepareTown

static void Kalay_PrepareTown(void)

Once Lunpa's trade has reopened, Hammet's palace flags (0x321 and 0x912 to 0x915) are set. Until it is caught, the Nut circles above the town.

Used by Kalay_Initialize.

Line 939

Kalay_PreparePalaceGate

static void Kalay_PreparePalaceGate(void)

The palace flags as in the town; walking up to the gate the first time, Ivan introduces himself to the guards.

Used by Kalay_Initialize.

Line 986

Kalay_PrepareCave

static void Kalay_PrepareCave(void)

The cave's Nut floats until caught, the guard turns after flag 0x915, and arriving through entrance 10 brings Hammet back by wagon.

Used by Kalay_Initialize.

Line 1005

Kalay_StartWindowTransition

static void Kalay_StartWindowTransition(void)

The fifth map opens with a window transition. After flag 0x915 its passage cells are open; entrances 1 to 3 start sound 170.

Used by Kalay_Initialize.

Line 1022

Kalay_PrepareTunnel

static void Kalay_PrepareTunnel(void)

The tunnel: the fade overlay follows the leader unless he came in by entrance 4; pushed blocks, frozen target and opened passages are restored.

Used by Kalay_Initialize.

Line 1040

Kalay_StartTouristsFidgeting

static void Kalay_StartTouristsFidgeting(void)

All eight tourists start fidgeting.

Used by Kalay_WatchTourGroupDeparture.

Line 1215

Kalay_StartTouristFidgeting

static void Kalay_StartTouristFidgeting(s32 actorId)

A tourist starts fidgeting after a random pause.

Used by Kalay_StartTouristsFidgeting, Kalay_WatchTourGroupDeparture.

Line 1227

Kalay_StartGuidesPacing

static void Kalay_StartGuidesPacing(void)

The guides speed up and start pacing in turn.

Used by Kalay_WatchTourGroupDeparture.

Line 1239

Kalay_AlternateGuidesPacing

static void Kalay_AlternateGuidesPacing(void)

Each guide paces in turn, starting when the other finishes.

Used by Kalay_StartGuidesPacing, Kalay_WatchTourGroupDeparture.

Line 1248

Kalay_IvanMeetsPalaceGuards

static void Kalay_IvanMeetsPalaceGuards(void)

At the palace gate the guards turn the party away until they recognize Ivan, tanned and grown, and learn that he does not know Hammet is a prisoner. Ivan insists his friends hear everything, and the guards open the door for the party.

Used by Kalay_PreparePalaceGate.

Line 1288

Kalay_HammetReturnsToPalace

static void Kalay_HammetReturnsToPalace(void)

Arriving through the cave's entrance 10, Hammet comes home by Bunza's wagon with the party. Hammet explains the secret passage to the palace and asks Bunza to take the party round through the town, so the passage stays secret; the cave guard opens it, Hammet goes in and the party rides off.

Used by Kalay_PrepareCave.

Line 1471

Kalay_PushTunnelBlock

static void Kalay_PushTunnelBlock(void)

In the tunnel, walking into a block pushes it one tile when there is room.

Line 1765

Kalay_UpdateTunnelPassages

static void Kalay_UpdateTunnelPassages(void)

Once a block is pushed far enough west, its passage opens step by step and the frost target appears for the first.

Used by Kalay_PushTunnelBlock.

Line 1816

Also, functions without a comment: Kalay_GetEntrances, Kalay_GetRegions.

Enumerations

KalayActor

enum KalayActor

Kalay's maps share actor numbers; each is named on the map it is proved.

Value=
ACTOR_LATE_TOURIST14the one the tour guides are missing
ACTOR_TOLBI_EMIGRANT19
ACTOR_HEAD_GUIDE20the Colosso tour's guides
ACTOR_SECOND_GUIDE21
ACTOR_WEAPON_MERCHANT22
ACTOR_ARMOR_MERCHANT23
ACTOR_ITEM_MERCHANT24
ACTOR_TOWN_NUT26
ACTOR_PALACE_GUARD8Hammet's palace gate
ACTOR_SECOND_PALACE_GUARD9
ACTOR_CAVE_GUARD8The cave by the palace's secret passage
ACTOR_WAGON9
ACTOR_HAMMET10
ACTOR_BUNZA11
ACTOR_CAVE_NUT12
ACTOR_FIRST_BLOCK8the blocks that open the two passages
ACTOR_SECOND_BLOCK9
ACTOR_FROST_TARGET11
ACTOR_TUNNEL_DJINNI12

Line 55

KalayTunnelFlag

enum KalayTunnelFlag

The tunnel's own flags, kept while the party is there.

Value=
FLAG_TUNNEL_OVERLAY_FOLLOWS_LEADERFLAG_SCENE_TEMP_00the fade overlay
FLAG_TUNNEL_FROST_TARGET_FROZENFLAG_SCENE_TEMP_01
FLAG_TUNNEL_FIRST_PARTICLES_SOUNDEDFLAG_SCENE_TEMP_02Each block's particles have started their sound.
FLAG_TUNNEL_SECOND_PARTICLES_SOUNDEDFLAG_SCENE_TEMP_03
FLAG_TUNNEL_FIRST_PASSAGE_OPEN0x302
FLAG_TUNNEL_SECOND_PASSAGE_OPEN0x303

Line 82

Declarations, without a comment: Kalay_UpdateTunnelEmitters, Kalay_SpawnTunnelParticle, Kalay_UpdateNutOrbit.

On this page