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.
Kalay_RecruitDjinn
static void Kalay_RecruitDjinn(void)
Talking to the Mars Djinni in the tunnel adds it to the party.
Kalay_UpdateTouristFidget
static s32 Kalay_UpdateTouristFidget(struct ScriptInterpreter *interpreter)
While the tour waits, a tourist now and then nods, shakes his head or turns.
Kalay_GetExits
const u32 *Kalay_GetExits(void)
The numbered exits of all six maps.
Kalay_GetPlacements
const struct ScenePlacement *Kalay_GetPlacements(void)
The people of the town, palace gate, cave and tunnel.
Kalay_SearchWell
static void Kalay_SearchWell(void)
Searching the town well: the party peers in, and it is very clean.
Kalay_CatchCaveNut
static void Kalay_CatchCaveNut(void)
Catch pulls in the Nut floating in the cave.
Kalay_GetEvents
const struct SceneEvent *Kalay_GetEvents(void)
The conversations, exits and Psynergy targets of each map.
Kalay_TalkAboutLeavingHome
static void Kalay_TalkAboutLeavingHome(void)
A man tells why he moved to Kalay: he left Tolbi, afraid of Babi.
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.
Kalay_TalkAboutLayana
static void Kalay_TalkAboutLayana(void)
In the tunnel, a man asks whether Layana was too hard on the party.
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.
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.
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.
Kalay_OpenDoorAndExit
static void Kalay_OpenDoorAndExit(void)
Walking north into a house door, everyone stops, the door opens and the leader walks in.
Kalay_AnimatePalaceDoor
static __inline__ void Kalay_AnimatePalaceDoor(void)
The palace door opens in two frames.
Used by Kalay_EnterPalace, Kalay_IvanMeetsPalaceGuards.
Kalay_EnterPalace
static void Kalay_EnterPalace(void)
Walking north into the palace door, it opens and the leader walks in.
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.
Kalay_StopTrackingLeader
static void Kalay_StopTrackingLeader(void)
Touching trigger 10 in the tunnel stops the fade overlay following the leader.
Kalay_StartTrackingLeader
static void Kalay_StartTrackingLeader(void)
Touching trigger 11 in the tunnel makes the fade overlay follow the leader.
Used by Kalay_UpdateTunnelPassages.
Kalay_EnableLeaderAutomaticPriority
static void Kalay_EnableLeaderAutomaticPriority(void)
Trigger 19 in the tunnel: the leader's depth priority follows his position.
Kalay_DisableLeaderAutomaticPriority
static void Kalay_DisableLeaderAutomaticPriority(void)
Trigger 18 in the tunnel: the leader's depth priority stays fixed.
Kalay_CatchTownNut
static void Kalay_CatchTownNut(void)
Catch pulls in the Nut circling in the town.
Kalay_Initialize
s32 Kalay_Initialize(void)
Every map of Kalay sets flag 0x87a, then prepares its own people and cells.
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.
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.
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.
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.
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.
Kalay_StartTouristsFidgeting
static void Kalay_StartTouristsFidgeting(void)
All eight tourists start fidgeting.
Used by Kalay_WatchTourGroupDeparture.
Kalay_StartTouristFidgeting
static void Kalay_StartTouristFidgeting(s32 actorId)
A tourist starts fidgeting after a random pause.
Used by Kalay_StartTouristsFidgeting, Kalay_WatchTourGroupDeparture.
Kalay_StartGuidesPacing
static void Kalay_StartGuidesPacing(void)
The guides speed up and start pacing in turn.
Used by Kalay_WatchTourGroupDeparture.
Kalay_AlternateGuidesPacing
static void Kalay_AlternateGuidesPacing(void)
Each guide paces in turn, starting when the other finishes.
Used by Kalay_StartGuidesPacing, Kalay_WatchTourGroupDeparture.
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.
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.
Kalay_PushTunnelBlock
static void Kalay_PushTunnelBlock(void)
In the tunnel, walking into a block pushes it one tile when there is room.
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.
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_TOURIST | 14 | the one the tour guides are missing |
ACTOR_TOLBI_EMIGRANT | 19 | |
ACTOR_HEAD_GUIDE | 20 | the Colosso tour's guides |
ACTOR_SECOND_GUIDE | 21 | |
ACTOR_WEAPON_MERCHANT | 22 | |
ACTOR_ARMOR_MERCHANT | 23 | |
ACTOR_ITEM_MERCHANT | 24 | |
ACTOR_TOWN_NUT | 26 | |
ACTOR_PALACE_GUARD | 8 | Hammet's palace gate |
ACTOR_SECOND_PALACE_GUARD | 9 | |
ACTOR_CAVE_GUARD | 8 | The cave by the palace's secret passage |
ACTOR_WAGON | 9 | |
ACTOR_HAMMET | 10 | |
ACTOR_BUNZA | 11 | |
ACTOR_CAVE_NUT | 12 | |
ACTOR_FIRST_BLOCK | 8 | the blocks that open the two passages |
ACTOR_SECOND_BLOCK | 9 | |
ACTOR_FROST_TARGET | 11 | |
ACTOR_TUNNEL_DJINNI | 12 |
KalayTunnelFlag
enum KalayTunnelFlag
The tunnel's own flags, kept while the party is there.
| Value | = | |
|---|---|---|
FLAG_TUNNEL_OVERLAY_FOLLOWS_LEADER | FLAG_SCENE_TEMP_00 | the fade overlay |
FLAG_TUNNEL_FROST_TARGET_FROZEN | FLAG_SCENE_TEMP_01 | |
FLAG_TUNNEL_FIRST_PARTICLES_SOUNDED | FLAG_SCENE_TEMP_02 | Each block's particles have started their sound. |
FLAG_TUNNEL_SECOND_PARTICLES_SOUNDED | FLAG_SCENE_TEMP_03 | |
FLAG_TUNNEL_FIRST_PASSAGE_OPEN | 0x302 | |
FLAG_TUNNEL_SECOND_PASSAGE_OPEN | 0x303 |
Declarations, without a comment: Kalay_UpdateTunnelEmitters, Kalay_SpawnTunnelParticle, Kalay_UpdateNutOrbit.