Skip to Content
The Alchemy Project

src/scene/kalay.c

Kalay, the merchants' town Lord Hammet founded, the front of his palace, and the tunnel beneath them: four places in six scenes. More…

Macros

NameDescription
#defineDUST_PUFF_ANIMATION_QUICK 1SPRITE_DUST_PUFF's quick billow: its eight pictures once, then blank.
#defineLARGE_WAGON_ANIMATION_STILL 0SPRITE_LARGE_WAGON standing still, its wheels at rest.
#defineWATERFALL_FIRST_FRAME_COLUMN 67The eight pictures of a hall's waterfall running dry, copied in turn over it on the overhead layer: each one map column five metatiles tall from row 58.
#defineWATERFALL_OPEN_FRAME_COLUMN 70The picture from which the way across counts as open (FLAG_TUNNEL_FIRST_PASSAGE_OPEN, FLAG_TUNNEL_SECOND_PASSAGE_OPEN).
#defineWATERFALL_LAST_FRAME_COLUMN 74The last picture's column: the waterfall gone.
#defineFIRST_STATUE_OPENING_HALF_METATILE 29The half-metatile column each statue must be pushed west to, or past, to open its passage.
#defineSECOND_STATUE_OPENING_HALF_METATILE 87
#defineTUNNEL_PARTICLE_DRAG_X 256The share of a tunnel particle's sideways and vertical speed that drag takes each tick, as one part in this many.
#defineTUNNEL_PARTICLE_DRAG_Y 16
#defineFIRST_STATUE_BY_GATE_WEST_X 381Where the first statue stands once pushed a metatile east of where it starts, below the barred gate, in pixels: there it is drawn at the leader's priority, and the gate hides its top as it would his.
#defineFIRST_STATUE_BY_GATE_EAST_X 393
#defineFIRST_STATUE_BY_GATE_NORTH_Z 777
#defineFIRST_STATUE_SPARKLE_X 245The x at or west of which each hall's statue, near its waterfall, sparkles while its pool is still full.
#defineSECOND_STATUE_SPARKLE_X 709
#definePUDDLE_GROW_TICKS 108The puddle grows out of the drained bed, from a tenth of its size to nearly full, over PUDDLE_GROW_TICKS.

Enumerations

NameDescription
enumKALAY_TUNNEL_METATILE_BEHAVIOR { METATILE_BEHAVIOR_KALAY_TUNNEL_HALL, METATILE_BEHAVIOR_KALAY … }The metatiles of the Kalay Tunnel's treasure rooms the scene gives a meaning of its own.
enumKALAY_METATILE_BEHAVIOR { METATILE_BEHAVIOR_KALAY_WELL, METATILE_BEHAVIOR_KALAY_SLEEP_ … }The metatiles of the town the searches answer.
enumKALAY_TOWN_ACTOR_ID { ACTOR_WELCOMING_SOLDIER, ACTOR_SOLDIER_PROTECTING_THE_PEACE, … }Kalay's actors (SceneIdKalay), numbering the rows of KalayTownActorPlacements from ACTOR_FIRST_PLACED, then the tour group, which scKalayWatchTourGroupDeparture places after them (KalayTourGroupActorPlacements).
enumKALAY_PALACE_ACTOR_ID { ACTOR_PALACE_GUARD, ACTOR_SECOND_PALACE_GUARD }Hammet Palace's front (SceneIdHammetPalaceGrounds), numbering KalayHammetPalaceActorPlacements, whose first row places the party's Ivan.
enumKALAY_TUNNEL_ENTRANCE_ACTOR_ID { ACTOR_TUNNEL_GUARD, ACTOR_WAGON, ACTOR_HAMMET, ACTOR_BUNZA, … }The Kalay Tunnel Entrance (SceneIdKalayTunnelEntrance), numbering KalayTunnelEntranceActorPlacements after its rows for Garet, Ivan and Mia.
enumKALAY_TUNNEL_ACTOR_ID { ACTOR_FIRST_STATUE, ACTOR_SECOND_STATUE, ACTOR_WAITING_MAN, … }The Kalay Tunnel's treasure rooms (SceneIdKalayTunnelTreasureRoom), numbering KalayTunnelActorPlacements.
enumKALAY_TUNNEL_FLAG { FLAG_TUNNEL_MASK_FOLLOWS_LEADER, FLAG_TUNNEL_PUDDLE_FROZEN, … }The Kalay Tunnel's own flags.
enumanonymous enum { SHOP_KALAY_WEAPONS, SHOP_KALAY_ARMOR, SHOP_KALAY_ITEMS }The stock rows the three counters of Kalay's shops open (mnShopRun).

Functions

NameDescription
BSS_DATAALIGNED (8)Unused: twelve bytes nothing reads or writes.
static voidscKalayPrepareTown (void)Sets up Kalay: the rooftop statue already moved aside when the party comes up from the tunnel, the second guide's colours, and the Nut circling until it is caught.
static voidscKalayPrepareHammetPalace (void)Sets up Hammet Palace's front: the first time the party walks up from town, before Ivan has reported to Layana, the guards meet him.
static voidscKalayPrepareTunnelEntrance (void)Sets up the Kalay Tunnel Entrance: its Nut until caught, the guard turned aside once the tunnel is open, and Hammet's homecoming when the party arrives in Bunza's wagon.
static voidscKalayPrepareTunnelPassage (void)Sets up the Kalay Tunnel's passage: the barred gate stands open once the tunnel is, and running water sounds everywhere but in the north-east room.
static voidscKalayPrepareTunnelTreasureRoom (void)Sets up the Kalay Tunnel's treasure rooms: the ground mask, the statues, the waiting man and the open gate once the tunnel is open, and each pool drained if it already was on this visit.
static voidscKalayStartTouristsWaiting (void)All eight tourists in Kalay start waiting.
static voidscKalayStartTouristWaiting (Sint32 actorId)A tourist starts waiting (scKalayUpdateWaitingTourist), the first time after a random 0 to 79 ticks.
static voidscKalayStartGuidesPacing (void)The guides speed up and start pacing in turn.
static voidscKalayUpdatePacingGuides (void)Event: the guides take turns, each counting the tourists and then pacing, one starting when the other finishes.
static voidscKalayIvanMeetsPalaceGuards (void)The first time the party comes to the front of Hammet Palace, the two guards at the door know Ivan and take everyone in to Lady Layana.
static voidscKalayHammetReturnsToPalace (void)After the party has freed Hammet from Lunpa, he comes home with it in the covered wagon of Bunza, a Kalay merchant, to the Kalay Tunnel Entrance: the guard opens the way, Hammet goes in, and the party rides on to Kalay.
static voidscKalayUpdateTunnelPassages (void)Pushing a hall's stone statue in the Kalay Tunnel west until it stands in front of the waterfall stops the waterfall and drains the pool below it, leaving a dry bed with ladders down its sides that Isaac can cross.
static voidscKalayUpdateTunnelStatues (void)Each tick in the Kalay Tunnel's halls: while a pool is still full, sparkles stream from its statue as it nears the waterfall, with the sound of water draining the first time.
static voidscKalaySpawnTunnelParticle (Sint32 x, Sint32 height, Sint32 z)One of the sparkles that stream from a statue as it nears its waterfall: a puff of dust tinted blue, 8 pixels west of the statue, drifting for 20 ticks.
static voidscKalayUpdateNutOrbit (void)The Nut in Kalay circles its spot and rocks as it goes.
static inline voidscKalayClearScriptDone (ACTOR *actor)Clears the flag a guide's script sets when it is done.
static voidscKalayScorchJoins (void)Talking to Scorch, a Mars Djinni on the ledge beyond the east hall's pool in the Kalay Tunnel, makes it join the party without a battle.
static Sint32scKalayUpdateWaitingTourist (ACTOR *actor)An actor script call, each tick: in Kalay, while the tour waits, a tourist now and then nods, shakes his head or turns up to half a turn, and then waits a random 0 to 79 ticks, counted down in userValue.
const SCENE_ENTRANCE *scGetEntrances (void)The six rooms share one entrance table.
const SCENE_EXIT_REGION *scGetExitRegions (void)The scene has no exit regions: its regions entry returns none.
const Uint32 *scGetExits (void)The numbered exits of all six scenes.
const ACTOR_PLACE *scGetActorPlacements (void)The people of Kalay, Hammet Palace's front, the Kalay Tunnel Entrance and the Kalay Tunnel's treasure room.
static voidscKalaySearchWell (void)Searching the well in Kalay: the party peers in, and it is very clean.
static voidscKalayCatchTunnelEntranceNut (void)Catch at the Kalay Tunnel Entrance pulls in the Nut floating there, until it is caught (FLAG_KALAY_TUNNEL_ENTRANCE_NUT_CAUGHT).
const CUE *scGetCues (void)The conversations, exits and Psynergy targets of each scene.
static voidscKalayTalkAboutLeavingHome (void)A man in Kalay tells why he moved there: he left Tolbi, afraid of Babi, who has ruled it for more than a hundred years.
static voidscKalayAskAboutGoingToCave (void)The soldier at the Kalay Tunnel Entrance asks "Do you want to go to the cave up ahead?", and turns the party away whatever it answers.
static voidscKalayTalkAboutLayana (void)The man waiting in the Kalay Tunnel once it is open asks whether Layana was too hard on the party.
static voidscKalayTalkToWeaponMerchant (void)Talking to the weapon merchant in Kalay across the counter, with the leader facing north, opens the weapon shop.
static voidscKalayTalkToArmorMerchant (void)Talking to the armor merchant in Kalay across the counter, with the leader facing west to north, opens the armor shop.
static voidscKalayTalkToItemMerchant (void)Talking to the item merchant in Kalay across the counter, with the leader facing east, opens the item shop.
static voidscKalayOpenDoorAndExit (void)Walking north into one of Kalay's eight doors opens it, and Isaac walks into a house, a shop, the inn or the Sanctum.
static inline voidscKalayAnimatePalaceDoor (void)The palace door swings open in two pictures, five ticks apart, with a thump.
static voidscKalayEnterPalace (void)Walking north into the door of Hammet Palace opens it with a thump, and Isaac walks in.
static voidscKalayWatchTourGroupDeparture (void)Walking out of Kalay by the south or west way, once the party has heard of the Colosso tour at the inn, it watches the tour group stop in the street to be counted.
static voidscKalayGroundMaskLetsGoOfLeader (void)Walking out of the Kalay Tunnel's narrow corridors into a hall with a statue, Isaac leaves the faint green glow of the ground mask behind on the floor.
static voidscKalayGroundMaskFollowsLeader (void)Stepping from a hall of the Kalay Tunnel back into its narrow corridors, Isaac is followed by the faint green glow of the ground mask again.
static voidscKalayFreeLeaderPriority (void)Nothing visible happens when Isaac, back from hopping a water channel on the Kalay Tunnel's narrow ledges, steps onto metatile (15, 51) or (44, 51); from there on he is drawn in front of or behind the scenery by where he stands again (ACTOR_PRIORITY_AUTOMATIC).
static voidscKalayFixLeaderPriority (void)Nothing visible happens when Isaac steps onto metatile (14, 51) or (43, 51), at the end of a narrow ledge in the Kalay Tunnel where a channel of water runs south out of the pool beside it.
static voidscKalayCatchTownNut (void)Catch in Kalay pulls in the Nut circling there, until it is caught.
Sint32scInit (void)Every scene of the overlay sets FLAG_KALAY_REACHED, then prepares its own people and metatiles.
static inline voidscKalayCatchUpWithLunpa (void)Catches the palace's story up with Lunpa's: once Hammet is free, Ivan's report and Layana's scolding count as seen and the tunnel is open; once the party has heard in Lunpa that he is held there, Kalay has heard it too.
static voidscKalayPushTunnelStatue (void)Walking into the stone statue in either hall of the Kalay Tunnel pushes it one metatile, when there is room, with Isaac following it.
static voidscKalayUpdateTunnelParticle (ACTOR *particle)
static voidscKalayFreezePuddle (void)Frost on the puddle in the drained west pool of the Kalay Tunnel freezes it and sinks it into the floor, out of Isaac's way.

Variables

NameDescription
Uint8KalayUnusedBeforePacingStep [12]Unused: twelve bytes nothing reads or writes.
Sint32KalayPacingStepWhich of the two guides' turns scKalayUpdatePacingGuides is at, 0 to 4.
extern Sint32KalayTourGroupWalkScript []
extern Sint32KalayTourGroupLeaveScript []
extern Sint32KalayWaitingTouristScript []
extern Sint32KalayGuideCountScript []
extern Sint32KalayGuidePaceScript []
extern Sint32KalayHeadGuideStopScript []
extern Sint32KalaySecondGuideStopScript []
extern Sint32KalayHeadGuideReturnScript []
extern Sint32KalaySecondGuideReturnScript []
extern Sint32KalayPartyLookAboutScript []
extern Sint32KalayPartyGatherScript []
extern Sint32KalayPuddleGrowScript []
extern SCENE_ENTRANCEKalayTownEntrances []
extern SCENE_ENTRANCEKalayHammetPalaceEntrances []
extern SCENE_ENTRANCEKalayTunnelEntranceEntrances []
extern SCENE_ENTRANCEKalayTunnelCaveEntrances []
extern SCENE_ENTRANCEKalayTunnelPassageEntrances []
extern SCENE_ENTRANCEKalayTunnelEntrances []
extern Uint32KalayExits []
extern ACTOR_PLACEKalayNoActorPlacements []
extern ACTOR_PLACEKalayTownActorPlacements []
extern ACTOR_PLACEKalayTourGroupActorPlacements []
extern ACTOR_PLACEKalayHammetPalaceActorPlacements []
extern ACTOR_PLACEKalayTunnelEntranceActorPlacements []
extern ACTOR_PLACEKalayTunnelActorPlacements []
extern CUEKalayNoCues []
extern CUEKalayTownCues []
extern CUEKalayHammetPalaceCues []
extern CUEKalayTunnelEntranceCues []
extern CUEKalayTunnelCaveCues []
extern CUEKalayTunnelPassageCues []
extern CUEKalayTunnelCues []
extern MAP_EDITKalayDoorMetatiles []
extern Sint32KalayTunnelParticleScript []
Uint16KalayDoorMetatileSteps []A door of the town opening, and where each of the eight doors is, in the order of their exits from KALAY_HOUSE_NORTHWEST.

Description

Kalay, the merchants' town Lord Hammet founded, the front of his palace, and the tunnel beneath them: four places in six scenes.

Kalay (SceneIdKalay), the town. Eight doors open into the houses, the weapon and armor shops, the inn and the Kalay Sanctum (stucco_rooms_a.c), and two more lead in behind the shops' counters. The way north leads up to the front of Hammet's palace; the south and west edges lead out to the World Map. The weapon, armor and item sellers serve the party only when spoken to across the counter. A Nut circles by a tree near the west way out until Catch pulls it in. On a rooftop in the north-east corner, a stone statue that Move pushes aside covers a way down into the Kalay Tunnel; coming back up that way finds it already moved.

Once the party has heard of the Colosso tour at the inn (FLAG_KALAY_HEARD_OF_COLOSSO_TOUR), leaving town plays the tour group's departure, once (FLAG_KALAY_COLOSSO_TOUR_LEFT): the guides stop the group to count it, find a man missing and lead it off without him, and he runs after it. The second guide is the first's sprite with its green and blue swapped (SPRITE_COLOR_RBG), here and in stucco_rooms_a.c and kalay_tolbi_docks.c.

The front of Hammet Palace (SceneIdHammetPalaceGrounds), where two soldiers of Kalay guard the door. The first time the party comes, before Ivan has reported to Lady Layana (FLAG_IVAN_REPORTED_TO_LAYANA), they know Ivan and take everyone in to her; afterwards they only talk. Walking into the door opens it into the palace (hammet_palace.c).

The Kalay Tunnel Entrance (SceneIdKalayTunnelEntrance), out of town and reached from the World Map, where a soldier bars "the cave up ahead" by Hammet and Layana's command and a Nut floats until Catch takes it. Arriving with Hammet in Bunza's covered wagon after Lunpa plays his homecoming: the guard opens the way, Hammet goes in, and the party rides off. Once the tunnel is open (FLAG_KALAY_TUNNEL_OPEN) the guard stands aside, turned east.

The Kalay Tunnel (SceneIdKalayTunnelCave to SceneIdKalayTunnelTreasureRoom), the hidden way between Hammet's palace and his treasure, which Layana opens to the party in thanks once Hammet is home. A cave with a chest holding an Apple leads down from the entrance to a long passage, and on down into the treasure rooms under the town. There each of two halls has a waterfall pouring into a pool. Pushing the hall's stone statue west until it stands in front of the waterfall stops it and drains the pool, so Isaac can climb down into the dry bed and up the far side. In the east hall that reaches Scorch, a Mars Djinni, who joins without a battle; in the west hall the drained bed holds a puddle, which Frost freezes and sinks out of the way. The drained pools last while the party stays in the tunnel (FLAG_TUNNEL_FIRST_PASSAGE_OPEN and FLAG_TUNNEL_SECOND_PASSAGE_OPEN are area temp flags); while a pool is full, sparkles stream from its statue as it nears the waterfall. Five chests hold Spirit Gloves, a Sleep Bomb, a Lucky Medal, 200 coins and a Potion. Once the tunnel is open a man waits here, thinking "The things beyond these doors belong to you all." In the narrow corridors a faint green glow on the floor drifts after Isaac, and in the halls it stays behind (the ground mask, field/field_engine_ground_mask.c). Stairs lead up into Hammet's palace, and a way up into the town under the statue.

Every scene sets FLAG_KALAY_REACHED on entry.

Kalay and the palace's front also catch the palace's story up with Lunpa's. Hearing in Lunpa that Hammet is held there (FLAG_LUNPA_HEARD_OF_PRISONER) sets area temp flag FLAG_KALAY_HEARD_HAMMET_HELD_IN_LUNPA, which changes what Layana says. Once Hammet is free (FLAG_DODONPA_LOCKED_UP, set as Donpa judges Dodonpa in Lunpa), Ivan's report and Layana's scolding count as seen and FLAG_KALAY_TUNNEL_OPEN opens the tunnel.

The getters choose each scene's tables. The cave and the passage have no actor placements, and an empty set serves any other scene.

Macros in detail

DUST_PUFF_ANIMATION_QUICK

#define DUST_PUFF_ANIMATION_QUICK 1

SPRITE_DUST_PUFF's quick billow: its eight pictures once, then blank.

Referenced by scAltinPeakSpawnSpit(), scKalaySpawnTunnelParticle() and scKolimaLowerBridge().

Definition at line 182 of file kalay.c.

LARGE_WAGON_ANIMATION_STILL

#define LARGE_WAGON_ANIMATION_STILL 0

SPRITE_LARGE_WAGON standing still, its wheels at rest.

Referenced by scKalayHammetReturnsToPalace().

Definition at line 184 of file kalay.c.

WATERFALL_FIRST_FRAME_COLUMN

#define WATERFALL_FIRST_FRAME_COLUMN 67

The eight pictures of a hall's waterfall running dry, copied in turn over it on the overhead layer: each one map column five metatiles tall from row 58. This is the first picture's column.

Referenced by scKalayUpdateTunnelPassages().

Definition at line 2229 of file kalay.c.

WATERFALL_OPEN_FRAME_COLUMN

#define WATERFALL_OPEN_FRAME_COLUMN 70

The picture from which the way across counts as open (FLAG_TUNNEL_FIRST_PASSAGE_OPEN, FLAG_TUNNEL_SECOND_PASSAGE_OPEN).

Referenced by scKalayUpdateTunnelPassages().

Definition at line 2232 of file kalay.c.

WATERFALL_LAST_FRAME_COLUMN

#define WATERFALL_LAST_FRAME_COLUMN 74

The last picture's column: the waterfall gone.

Referenced by scKalayUpdateTunnelPassages().

Definition at line 2234 of file kalay.c.

FIRST_STATUE_OPENING_HALF_METATILE

#define FIRST_STATUE_OPENING_HALF_METATILE 29

The half-metatile column each statue must be pushed west to, or past, to open its passage.

Referenced by scKalayUpdateTunnelPassages().

Definition at line 2238 of file kalay.c.

SECOND_STATUE_OPENING_HALF_METATILE

#define SECOND_STATUE_OPENING_HALF_METATILE 87

Referenced by scKalayUpdateTunnelPassages().

Definition at line 2239 of file kalay.c.

TUNNEL_PARTICLE_DRAG_X

#define TUNNEL_PARTICLE_DRAG_X 256

The share of a tunnel particle's sideways and vertical speed that drag takes each tick, as one part in this many.

Referenced by scKalayUpdateTunnelParticle().

Definition at line 2374 of file kalay.c.

TUNNEL_PARTICLE_DRAG_Y

#define TUNNEL_PARTICLE_DRAG_Y 16

Referenced by scKalayUpdateTunnelParticle().

Definition at line 2375 of file kalay.c.

FIRST_STATUE_BY_GATE_WEST_X

#define FIRST_STATUE_BY_GATE_WEST_X 381

Where the first statue stands once pushed a metatile east of where it starts, below the barred gate, in pixels: there it is drawn at the leader's priority, and the gate hides its top as it would his.

Referenced by scKalayUpdateTunnelStatues().

Definition at line 2423 of file kalay.c.

FIRST_STATUE_BY_GATE_EAST_X

#define FIRST_STATUE_BY_GATE_EAST_X 393

Referenced by scKalayUpdateTunnelStatues().

Definition at line 2424 of file kalay.c.

FIRST_STATUE_BY_GATE_NORTH_Z

#define FIRST_STATUE_BY_GATE_NORTH_Z 777

Referenced by scKalayUpdateTunnelStatues().

Definition at line 2425 of file kalay.c.

FIRST_STATUE_SPARKLE_X

#define FIRST_STATUE_SPARKLE_X 245

The x at or west of which each hall's statue, near its waterfall, sparkles while its pool is still full.

Referenced by scKalayUpdateTunnelStatues().

Definition at line 2429 of file kalay.c.

SECOND_STATUE_SPARKLE_X

#define SECOND_STATUE_SPARKLE_X 709

Referenced by scKalayUpdateTunnelStatues().

Definition at line 2430 of file kalay.c.

PUDDLE_GROW_TICKS

#define PUDDLE_GROW_TICKS 108

The puddle grows out of the drained bed, from a tenth of its size to nearly full, over PUDDLE_GROW_TICKS.

Referenced by KalayPuddleGrowScript.

Definition at line 2708 of file kalay.c.

Enumerations in detail

KALAY_TUNNEL_METATILE_BEHAVIOR

enum KALAY_TUNNEL_METATILE_BEHAVIOR

The metatiles of the Kalay Tunnel's treasure rooms the scene gives a meaning of its own.

EnumeratorValueDescription
METATILE_BEHAVIOR_KALAY_TUNNEL_HALL10The floor of the halls with the statues, where the ground mask lets go of Isaac and walking into a statue pushes it.
METATILE_BEHAVIOR_KALAY_TUNNEL_HALL_EDGE11The edge of a hall where it meets a corridor, where the ground mask follows Isaac again and walking into a statue still pushes it.
METATILE_BEHAVIOR_KALAY_TUNNEL_STATUE_PUSH_WEST14Metatiles (26, 45)
METATILE_BEHAVIOR_KALAY_TUNNEL_STATUE_PUSH_CORNER15to (26, 47), and (25, 45), in the west hall, where walking west (or south, on (25, 45)) pushes a statue standing ahead.
METATILE_BEHAVIOR_KALAY_TUNNEL_KEEP_DRAWN18The ends of the two narrow ledges where Isaac hops a water channel: metatiles (14, 51), (14, 52), (43, 51) and (43, 52), where he stays
METATILE_BEHAVIOR_KALAY_TUNNEL_DRAWN_BY_PLACE19drawn as he is while he hops, and the metatiles east of them, where he is drawn by where he stands again.
METATILE_BEHAVIOR_KALAY_TUNNEL_SPIRIT_GLOVES_CHEST100The treasure rooms' chests.
METATILE_BEHAVIOR_KALAY_TUNNEL_SLEEP_BOMB_CHEST102
METATILE_BEHAVIOR_KALAY_TUNNEL_LUCKY_MEDAL_CHEST103
METATILE_BEHAVIOR_KALAY_TUNNEL_COINS_CHEST104
METATILE_BEHAVIOR_KALAY_TUNNEL_POTION_CHEST105
METATILE_BEHAVIOR_KALAY_TUNNEL_CAVE_APPLE_CHEST100The chest in the cave below the Kalay Tunnel Entrance.

Definition at line 92 of file kalay.c.

KALAY_METATILE_BEHAVIOR

enum KALAY_METATILE_BEHAVIOR

The metatiles of the town the searches answer.

EnumeratorValueDescription
METATILE_BEHAVIOR_KALAY_WELL90
METATILE_BEHAVIOR_KALAY_SLEEP_BOMB_JAR100
METATILE_BEHAVIOR_KALAY_VIAL_JAR101

Definition at line 139 of file kalay.c.

KALAY_TOWN_ACTOR_ID

enum KALAY_TOWN_ACTOR_ID

Kalay's actors (SceneIdKalay), numbering the rows of KalayTownActorPlacements from ACTOR_FIRST_PLACED, then the tour group, which scKalayWatchTourGroupDeparture places after them (KalayTourGroupActorPlacements).

EnumeratorValueDescription
ACTOR_WELCOMING_SOLDIERACTOR_FIRST_PLACEDThe two soldiers of Kalay
ACTOR_SOLDIER_PROTECTING_THE_PEACEat the town's entrance from the World Map.
ACTOR_YOUNG_MAN_ON_HAMMET_THE_MERCHANTA young man with brown hair
ACTOR_WOMAN_ON_HAMMETS_CARAVANS(SPRITE_YOUNG_MAN_WITH_BROWN_HAIR). A woman with fair hair (SPRITE_WOMAN_WITH_FAIR_HAIR).
ACTOR_MAN_ON_THE_REBUILT_BRIDGEA burly grey-haired man (SPRITE_BURLY_MAN_WITH_GREY_HAIR).
ACTOR_WOMAN_ON_LAMAKAN_DESERTA woman in a green dress (SPRITE_WOMAN_IN_GREEN_DRESS).
ACTOR_LATE_TOURISTThe tourist the guides are missing, an old man with a cane (SPRITE_OLD_MAN_WITH_CANE), who stands in town until then and takes his place again after.
ACTOR_WOULD_BE_TOURISTAn old woman (SPRITE_OLD_WOMAN). "The guests at the inn are tourists on their way to see Colosso."
ACTOR_BOY_DREAMING_OF_COLOSSOA small boy with fair hair (SPRITE_BOY_WITH_FAIR_HAIR). "I hear Colosso is incredible. I'd love to see such a huge carnival."
ACTOR_GIRL_ON_MT_ALEPHA little girl with pigtails (SPRITE_GIRL_WITH_PIGTAILS).
ACTOR_STRONGMAN_ON_HAMMETS_KNACKA strongman (SPRITE_STRONGMAN).
ACTOR_MAN_WHO_LEFT_TOLBIA bald, muscular man (SPRITE_BALD_MUSCULAR_MAN) who came to Kalay from Tolbi, afraid of Babi (scKalayTalkAboutLeavingHome).
ACTOR_HEAD_GUIDEThe Colosso tour's guides, men carrying packs (SPRITE_MAN_CARRYING_A_PACK), who stand in town and lead the tour off when it leaves.
ACTOR_SECOND_GUIDE
ACTOR_WEAPON_MERCHANT
ACTOR_ARMOR_MERCHANT
ACTOR_ITEM_MERCHANT
ACTOR_TOWN_STATUEThe stone statue on the rooftop in the north-east corner, which Move pushes aside from the way down into the Kalay Tunnel.
ACTOR_TOWN_NUTCircles in the air until Catch pulls it in.
ACTOR_CHEF_TOURISTThe tour group, in KalayTourGroupActorPlacements' order: a chef, a young woman in green, a young man with brown hair, a woman with fair hair, a woman with a sword, a bald, muscular man, a young man with blue hair, and Ouranos, a young man with red hair, whom the one beside him calls so.
ACTOR_TOURIST_IN_GREEN
ACTOR_BROWN_HAIRED_TOURIST
ACTOR_FAIR_HAIRED_TOURIST
ACTOR_TOURIST_WITH_SWORD
ACTOR_BALD_TOURIST
ACTOR_BLUE_HAIRED_TOURIST
ACTOR_OURANOS

Definition at line 190 of file kalay.c.

KALAY_PALACE_ACTOR_ID

enum KALAY_PALACE_ACTOR_ID

Hammet Palace's front (SceneIdHammetPalaceGrounds), numbering KalayHammetPalaceActorPlacements, whose first row places the party's Ivan.

EnumeratorValueDescription
ACTOR_PALACE_GUARDACTOR_FIRST_PLACEDThe soldiers of Kalay before the
ACTOR_SECOND_PALACE_GUARDpalace door. "This is Lord Hammet's palace. The lord is away."

Definition at line 251 of file kalay.c.

KALAY_TUNNEL_ENTRANCE_ACTOR_ID

enum KALAY_TUNNEL_ENTRANCE_ACTOR_ID

The Kalay Tunnel Entrance (SceneIdKalayTunnelEntrance), numbering KalayTunnelEntranceActorPlacements after its rows for Garet, Ivan and Mia.

EnumeratorValueDescription
ACTOR_TUNNEL_GUARDACTOR_FIRST_PLACEDA soldier of Kalay who keeps the passage closed by Hammet and Layana's command.
ACTOR_WAGONA covered wagon drawn by a horse (large_wagon.png).
ACTOR_HAMMET
ACTOR_BUNZA
ACTOR_TUNNEL_ENTRANCE_NUTFloats here until Catch takes it.

Definition at line 262 of file kalay.c.

KALAY_TUNNEL_ACTOR_ID

enum KALAY_TUNNEL_ACTOR_ID

The Kalay Tunnel's treasure rooms (SceneIdKalayTunnelTreasureRoom), numbering KalayTunnelActorPlacements.

EnumeratorValueDescription
ACTOR_FIRST_STATUEACTOR_FIRST_PLACEDThe statues that open the two
ACTOR_SECOND_STATUEpassages.
ACTOR_WAITING_MANA man drawn with SPRITE_BUNZA who waits here once FLAG_KALAY_TUNNEL_OPEN is set. Open question (no evidence in reach): whether he is Bunza; he has the sprite of the man Kalay's arrival calls Bunza ("Well then, Bunza, ..."), but none of his three lines names him, and no line spoken while he stands here does.
ACTOR_PUDDLEThe puddle left in the drained bed of the west hall's pool, which Frost freezes and sinks.
ACTOR_SCORCHA Mars Djinni.

Definition at line 276 of file kalay.c.

KALAY_TUNNEL_FLAG

enum KALAY_TUNNEL_FLAG

The Kalay Tunnel's own flags. The temporary ones last one entry. The passages (area temp flags) last while the party stays in the tunnel's scenes.

EnumeratorValueDescription
FLAG_TUNNEL_MASK_FOLLOWS_LEADERFLAG_SCENE_TEMP(0x00)The ground mask
FLAG_TUNNEL_PUDDLE_FROZENFLAG_SCENE_TEMP(0x01)follows the leader.
FLAG_TUNNEL_FIRST_PARTICLES_SOUNDEDFLAG_SCENE_TEMP(0x02)Each statue's particles have started their sound.
FLAG_TUNNEL_SECOND_PARTICLES_SOUNDEDFLAG_SCENE_TEMP(0x03)
FLAG_TUNNEL_FIRST_PASSAGE_OPENFLAG_AREA_TEMP(0x02)
FLAG_TUNNEL_SECOND_PASSAGE_OPENFLAG_AREA_TEMP(0x03)

Definition at line 299 of file kalay.c.

anonymous enum

enum { SHOP_KALAY_WEAPONS, SHOP_KALAY_ARMOR, SHOP_KALAY_ITEMS }

The stock rows the three counters of Kalay's shops open (mnShopRun).

EnumeratorValueDescription
SHOP_KALAY_WEAPONS22
SHOP_KALAY_ARMOR23
SHOP_KALAY_ITEMS24

Definition at line 313 of file kalay.c.

Functions in detail

scKalayPrepareTown

static void scKalayPrepareTown(void)

Sets up Kalay: the rooftop statue already moved aside when the party comes up from the tunnel, the second guide's colours, and the Nut circling until it is caught.

References fdActorGet(), fdActorSetSpriteColorById(), glyph, gmFlagGet(), MainRoutineStateWork, mnIconDrawItem(), scKalayCatchUpWithLunpa(), scKalayUpdateNutOrbit(), syHeapSlotAllocate(), syHeapSlotRelease(), sySetTickEvent() and syVRAMCacheLoad().

Referenced by scInit().

Definition at lines 320 and 1317 of file kalay.c.

scKalayPrepareHammetPalace

static void scKalayPrepareHammetPalace(void)

Sets up Hammet Palace's front: the first time the party walks up from town, before Ivan has reported to Layana, the guards meet him.

References gmFlagGet(), MainRoutineStateWork, scKalayCatchUpWithLunpa() and scKalayIvanMeetsPalaceGuards().

Referenced by scInit().

Definition at lines 321 and 1362 of file kalay.c.

scKalayPrepareTunnelEntrance

static void scKalayPrepareTunnelEntrance(void)

Sets up the Kalay Tunnel Entrance: its Nut until caught, the guard turned aside once the tunnel is open, and Hammet's homecoming when the party arrives in Bunza's wagon.

References fdActorGet(), gmFlagGet(), MainRoutineStateWork, scFloatNut() and scKalayHammetReturnsToPalace().

Referenced by scInit().

Definition at lines 322 and 1377 of file kalay.c.

scKalayPrepareTunnelPassage

static void scKalayPrepareTunnelPassage(void)

Sets up the Kalay Tunnel's passage: the barred gate stands open once the tunnel is, and running water sounds everywhere but in the north-east room.

References fdMapGridCenterOnFollowedPoint(), fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatilesTo(), fdQueueMusic(), gmFlagGet(), MainRoutineStateWork and sySynch().

Referenced by scInit().

Definition at lines 323 and 1395 of file kalay.c.

scKalayPrepareTunnelTreasureRoom

static void scKalayPrepareTunnelTreasureRoom(void)

Sets up the Kalay Tunnel's treasure rooms: the ground mask, the statues, the waiting man and the open gate once the tunnel is open, and each pool drained if it already was on this visit.

References fdActorGet(), fdActorSetAnimation(), fdActorSetSpriteFlags(), fdEffectStartGroundMask(), fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatilesTo(), fdQueueMusic(), fdScriptSetFlag(), gmFlagClear(), gmFlagGet(), MainRoutineStateWork, scKalayUpdateTunnelStatues(), Sint32, state and sySetTickEvent().

Referenced by scInit().

Definition at lines 324 and 1419 of file kalay.c.

scKalayStartTouristsWaiting

static void scKalayStartTouristsWaiting(void)

All eight tourists in Kalay start waiting.

References scKalayStartTouristWaiting().

Referenced by scKalayWatchTourGroupDeparture().

Definition at lines 325 and 1584 of file kalay.c.

scKalayStartTouristWaiting

static void scKalayStartTouristWaiting(Sint32 actorId)

A tourist starts waiting (scKalayUpdateWaitingTourist), the first time after a random 0 to 79 ticks.

References fdActorGet(), fdActorStartScript(), KalayWaitingTouristScript, Sint32 and syRandomNext().

Referenced by scKalayStartTouristsWaiting() and scKalayWatchTourGroupDeparture().

Definition at lines 326 and 1598 of file kalay.c.

scKalayStartGuidesPacing

static void scKalayStartGuidesPacing(void)

The guides speed up and start pacing in turn.

References KalayPacingStep, scKalayUpdatePacingGuides() and sySetTickEvent().

Referenced by scKalayWatchTourGroupDeparture().

Definition at lines 327 and 1611 of file kalay.c.

scKalayUpdatePacingGuides

static void scKalayUpdatePacingGuides(void)

Event: the guides take turns, each counting the tourists and then pacing, one starting when the other finishes.

References fdActorGet(), fdActorSetScript(), KalayGuideCountScript, KalayGuidePaceScript, KalayPacingStep and scKalayClearScriptDone().

Referenced by scKalayStartGuidesPacing() and scKalayWatchTourGroupDeparture().

Definition at lines 328 and 1621 of file kalay.c.

scKalayIvanMeetsPalaceGuards

static void scKalayIvanMeetsPalaceGuards(void)

The first time the party comes to the front of Hammet Palace, the two guards at the door know Ivan and take everyone in to Lady Layana.

References fdActorFaceDirection(), fdActorGet(), fdActorRunRepeatedMotion(), fdActorSetAnimation(), fdActorSetAnimationAndWait(), fdActorSetAttachedEffect(), fdActorSetPosFX(), fdActorShowEmote(), fdActorStartRepeatedMotion(), fdActorWalkTo(), fdActorWalkToAndWait(), fdScriptAskYesNo(), fdScriptAskYesNoWithActorAnimation(), fdScriptEnd(), fdScriptFinishScreenTransition(), fdScriptOpenMessage(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptShowMessageThenWait(), fdScriptStart(), fdScriptStartScreenTransition(), fdScriptWait(), fdScriptWaitTransitionTicks(), scFieldScriptShowMessageThenWait(), scKalayAnimatePalaceDoor(), syImportScriptSetExitRequest() and sySynch().

Referenced by scKalayPrepareHammetPalace().

Definition at lines 329 and 1665 of file kalay.c.

scKalayHammetReturnsToPalace

static void scKalayHammetReturnsToPalace(void)

After the party has freed Hammet from Lunpa, he comes home with it in the covered wagon of Bunza, a Kalay merchant, to the Kalay Tunnel Entrance: the guard opens the way, Hammet goes in, and the party rides on to Kalay.

References fdActorFaceDirection(), fdActorGet(), fdActorJump(), fdActorRunRepeatedMotion(), fdActorRunScriptAndWait(), fdActorSetAnimation(), fdActorSetAnimationAndWait(), fdActorSetAttachedEffect(), fdActorSetPosFX(), fdActorSetScript(), fdActorSetSpriteFlags(), fdActorShowEmote(), fdActorStartRepeatedMotion(), fdActorStop(), fdActorWalkTo(), fdActorWalkToAndWait(), fdCameraGetActor(), fdMapGridCenterOnFollowedPoint(), fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatilesTo(), fdScriptAskYesNoWithActorAnimation(), fdScriptEnd(), fdScriptFinishScreenTransition(), fdScriptOpenMessage(), fdScriptSetMessageId(), fdScriptShowMessageThenWait(), fdScriptStart(), fdScriptStartScreenTransition(), fdScriptWait(), fdScriptWaitTransitionTicks(), KalayPartyGatherScript, KalayPartyLookAboutScript, scFieldScriptShowMessageThenWait(), Sint32, state, syImportScriptSetExitRequest(), sySoundPlay() and sySynch().

Referenced by scKalayPrepareTunnelEntrance().

Definition at lines 330 and 1879 of file kalay.c.

scKalayUpdateTunnelPassages

static void scKalayUpdateTunnelPassages(void)

Pushing a hall's stone statue in the Kalay Tunnel west until it stands in front of the waterfall stops the waterfall and drains the pool below it, leaving a dry bed with ladders down its sides that Isaac can cross. In the west hall a puddle is left in the bed, for Frost. Each pool drains once per visit to the tunnel, after the statue's push or Move.

References fdActorGet(), fdActorSetScript(), fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatilesTo(), fdScriptEnd(), fdScriptStart(), fdScriptWait(), gmFlagGet(), gmFlagSet(), KalayPuddleGrowScript, scKalayGroundMaskFollowsLeader() and Sint32.

Referenced by KalayTunnelCues and scKalayPushTunnelStatue().

Definition at lines 331 and 2246 of file kalay.c.

scKalayUpdateTunnelStatues

static void scKalayUpdateTunnelStatues(void)

Each tick in the Kalay Tunnel's halls: while a pool is still full, sparkles stream from its statue as it nears the waterfall, with the sound of water draining the first time. While the first statue stands a metatile east of where it starts, it is drawn at the leader's priority.

References fdActorGet(), fdQueueMusic(), fdScriptGetFlag(), gmFlagGet(), gmFlagSet(), scKalaySpawnTunnelParticle(), sySoundPlay() and TickCount.

Referenced by scKalayPrepareTunnelTreasureRoom().

Definition at lines 332 and 2436 of file kalay.c.

scKalaySpawnTunnelParticle

static void scKalaySpawnTunnelParticle(Sint32 x, Sint32 height, Sint32 z)

One of the sparkles that stream from a statue as it nears its waterfall: a puff of dust tinted blue, 8 pixels west of the statue, drifting for 20 ticks.

References fdActorSelectAnimation(), fdActorSetSpriteColor(), fdActorSetSpriteFlags(), fdActorStartScript(), KalayTunnelParticleScript, scFieldActorCreate() and Sint32.

Referenced by scKalayUpdateTunnelStatues().

Definition at lines 333 and 2482 of file kalay.c.

scKalayUpdateNutOrbit

static void scKalayUpdateNutOrbit(void)

The Nut in Kalay circles its spot and rocks as it goes.

References fdActorGet(), syCos() and sySin().

Referenced by scKalayCatchTownNut() and scKalayPrepareTown().

Definition at lines 334 and 2509 of file kalay.c.

scKalayClearScriptDone

static inline void scKalayClearScriptDone(ACTOR *actor)

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

Referenced by scKalayUpdatePacingGuides().

Definition at line 337 of file kalay.c.

scKalayScorchJoins

static void scKalayScorchJoins(void)

Talking to Scorch, a Mars Djinni on the ledge beyond the east hall's pool in the Kalay Tunnel, makes it join the party without a battle.

References fdDjinnJoinParty().

Referenced by KalayTunnelCues.

Definition at line 344 of file kalay.c.

scKalayUpdateWaitingTourist

static Sint32 scKalayUpdateWaitingTourist(ACTOR *actor)

An actor script call, each tick: in Kalay, while the tour waits, a tourist now and then nods, shakes his head or turns up to half a turn, and then waits a random 0 to 79 ticks, counted down in userValue.

References fdActorSelectAnimation() and Sint32.

Referenced by KalayWaitingTouristScript.

Definition at line 352 of file kalay.c.

scGetEntrances

const SCENE_ENTRANCE *scGetEntrances(void)

References KalayFallbackEntrances, KalayHammetPalaceEntrances, KalayTownEntrances, KalayTunnelCaveEntrances, KalayTunnelEntranceEntrances, KalayTunnelEntrances, KalayTunnelPassageEntrances and MainRoutineStateWork.

Definition at line 379 of file kalay.c.

scGetExitRegions

const SCENE_EXIT_REGION *scGetExitRegions(void)

Definition at line 410 of file kalay.c.

scGetExits

const Uint32 *scGetExits(void)

The numbered exits of all six scenes.

References KalayExits.

Definition at line 416 of file kalay.c.

scGetActorPlacements

const ACTOR_PLACE *scGetActorPlacements(void)

The people of Kalay, Hammet Palace's front, the Kalay Tunnel Entrance and the Kalay Tunnel's treasure room.

References KalayHammetPalaceActorPlacements, KalayNoActorPlacements, KalayTownActorPlacements, KalayTunnelActorPlacements, KalayTunnelEntranceActorPlacements and MainRoutineStateWork.

Definition at line 423 of file kalay.c.

scKalaySearchWell

static void scKalaySearchWell(void)

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

References fdScriptEnd(), fdScriptStart() and mnFieldMessageShow().

Referenced by KalayTownCues.

Definition at line 447 of file kalay.c.

scKalayCatchTunnelEntranceNut

static void scKalayCatchTunnelEntranceNut(void)

Catch at the Kalay Tunnel Entrance pulls in the Nut floating there, until it is caught (FLAG_KALAY_TUNNEL_ENTRANCE_NUT_CAUGHT).

References scCatchNut().

Referenced by KalayTunnelEntranceCues.

Definition at line 457 of file kalay.c.

scGetCues

const CUE *scGetCues(void)

The conversations, exits and Psynergy targets of each scene.

References KalayHammetPalaceCues, KalayNoCues, KalayTownCues, KalayTunnelCaveCues, KalayTunnelCues, KalayTunnelEntranceCues, KalayTunnelPassageCues and MainRoutineStateWork.

Definition at line 464 of file kalay.c.

scKalayTalkAboutLeavingHome

static void scKalayTalkAboutLeavingHome(void)

A man in Kalay tells why he moved there: he left Tolbi, afraid of Babi, who has ruled it for more than a hundred years.

References fdScriptAskYesNo(), fdScriptEnd(), fdScriptSetMessageId() and fdScriptStart().

Referenced by KalayTownCues.

Definition at line 497 of file kalay.c.

scKalayAskAboutGoingToCave

static void scKalayAskAboutGoingToCave(void)

The soldier at the Kalay Tunnel Entrance asks "Do you want to go to the cave up ahead?", and turns the party away whatever it answers. Spoken to from the north, behind him, he only stands in the way.

References fdActorGet(), fdActorSetAnimationAndWait(), fdActorTurnToFaceEachOther(), fdScriptAskYesNoWithActorAnimation(), fdScriptEnd(), fdScriptOpenMessage(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart() and fdScriptWait().

Referenced by KalayTunnelEntranceCues.

Definition at line 511 of file kalay.c.

scKalayTalkAboutLayana

static void scKalayTalkAboutLayana(void)

The man waiting in the Kalay Tunnel once it is open asks whether Layana was too hard on the party.

References fdScriptAskYesNo(), fdScriptEnd(), fdScriptSetMessageId() and fdScriptStart().

Referenced by KalayTunnelCues.

Definition at line 543 of file kalay.c.

scKalayTalkToWeaponMerchant

static void scKalayTalkToWeaponMerchant(void)

Talking to the weapon merchant in Kalay across the counter, with the leader facing north, opens the weapon shop.

References fdActorGet(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart() and mnShopRun().

Referenced by KalayTownCues.

Definition at line 556 of file kalay.c.

scKalayTalkToArmorMerchant

static void scKalayTalkToArmorMerchant(void)

Talking to the armor merchant in Kalay across the counter, with the leader facing west to north, opens the armor shop.

References fdActorGet(), fdScriptAskYesNo(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptStart() and mnShopRun().

Referenced by KalayTownCues.

Definition at line 577 of file kalay.c.

scKalayTalkToItemMerchant

static void scKalayTalkToItemMerchant(void)

Talking to the item merchant in Kalay across the counter, with the leader facing east, opens the item shop.

References fdActorGet(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart() and mnShopRun().

Referenced by KalayTownCues.

Definition at line 600 of file kalay.c.

scKalayOpenDoorAndExit

static void scKalayOpenDoorAndExit(void)

Walking north into one of Kalay's eight doors opens it, and Isaac walks into a house, a shop, the inn or the Sanctum.

References fdActorCenterAndWalk(), fdActorGet(), fdActorSetAnimation(), fdMapGridAnimateMetatiles(), fdScriptEnd(), fdScriptFinishScreenTransition(), fdScriptStart(), fdScriptWait(), fdScriptWaitTransitionTicks(), KalayDoorMetatiles, Sint32, state, syImportScriptSetExitRequest() and sySoundPlay().

Referenced by KalayTownCues.

Definition at line 621 of file kalay.c.

scKalayAnimatePalaceDoor

static inline void scKalayAnimatePalaceDoor(void)

The palace door swings open in two pictures, five ticks apart, with a thump.

References fdMapGridCopyMetatilesTo(), sySoundPlay() and sySynch().

Referenced by scKalayEnterPalace() and scKalayIvanMeetsPalaceGuards().

Definition at line 660 of file kalay.c.

scKalayEnterPalace

static void scKalayEnterPalace(void)

Walking north into the door of Hammet Palace opens it with a thump, and Isaac walks in.

References fdActorGet(), fdActorSetAnimation(), fdActorSetDestinationOffset(), fdScriptEnd(), fdScriptFinishScreenTransition(), fdScriptStart(), fdScriptWait(), fdScriptWaitTransitionTicks(), scKalayAnimatePalaceDoor() and syImportScriptSetExitRequest().

Referenced by KalayHammetPalaceCues.

Definition at line 671 of file kalay.c.

scKalayWatchTourGroupDeparture

static void scKalayWatchTourGroupDeparture(void)

Walking out of Kalay by the south or west way, once the party has heard of the Colosso tour at the inn, it watches the tour group stop in the street to be counted. The guides find a man missing, pace while the tourists complain, and lead the group off toward Tolbi without him; the old man with the cane comes out too late and hurries after it. Once.

References fdActorFaceDirection(), fdActorGet(), fdActorJump(), fdActorReleaseById(), fdActorRunRepeatedMotion(), fdActorRunScriptAndWait(), fdActorSetAnimation(), fdActorSetAnimationAndWait(), fdActorSetAttachedEffect(), fdActorSetScript(), fdActorSetSpritePriority(), fdActorShowEmote(), fdActorStartRepeatedMotion(), fdActorStop(), fdActorWaitForScriptEndById(), fdActorWalkToAndWait(), fdMessageSetVoiceFromActor(), fdScriptAppendActorPlacements(), fdScriptEnd(), fdScriptFinishScreenTransition(), fdScriptSetMessageId(), fdScriptShowMessageThenWait(), fdScriptStart(), fdScriptWait(), fdScriptWaitTransitionTicks(), gmFlagGet(), gmFlagSet(), gmPlayMusic(), KalayGuidePaceScript, KalayHeadGuideReturnScript, KalayHeadGuideStopScript, KalaySecondGuideReturnScript, KalaySecondGuideStopScript, KalayTourGroupActorPlacements, KalayTourGroupLeaveScript, KalayTourGroupWalkScript, mnFieldMessageShowCentered(), scKalayStartGuidesPacing(), scKalayStartTouristsWaiting(), scKalayStartTouristWaiting(), scKalayUpdatePacingGuides(), Sint32, state, syCloseEvent(), syImportScriptSetExitRequest(), sySoundPlay() and sySynch().

Referenced by KalayTownCues.

Definition at line 691 of file kalay.c.

scKalayGroundMaskLetsGoOfLeader

static void scKalayGroundMaskLetsGoOfLeader(void)

Walking out of the Kalay Tunnel's narrow corridors into a hall with a statue, Isaac leaves the faint green glow of the ground mask behind on the floor.

References fdScriptGetFlag() and gmFlagClear().

Referenced by KalayTunnelCues.

Definition at line 1211 of file kalay.c.

scKalayGroundMaskFollowsLeader

static void scKalayGroundMaskFollowsLeader(void)

Stepping from a hall of the Kalay Tunnel back into its narrow corridors, Isaac is followed by the faint green glow of the ground mask again.

References fdActorGet(), fdScriptGetFlag(), gmFlagSet() and state.

Referenced by KalayTunnelCues and scKalayUpdateTunnelPassages().

Definition at line 1222 of file kalay.c.

scKalayFreeLeaderPriority

static void scKalayFreeLeaderPriority(void)

Nothing visible happens when Isaac, back from hopping a water channel on the Kalay Tunnel's narrow ledges, steps onto metatile (15, 51) or (44, 51); from there on he is drawn in front of or behind the scenery by where he stands again (ACTOR_PRIORITY_AUTOMATIC).

References fdActorGet().

Referenced by KalayTunnelCues.

Definition at line 1238 of file kalay.c.

scKalayFixLeaderPriority

static void scKalayFixLeaderPriority(void)

Nothing visible happens when Isaac steps onto metatile (14, 51) or (43, 51), at the end of a narrow ledge in the Kalay Tunnel where a channel of water runs south out of the pool beside it. From there he stays drawn as he was until he is back on the metatile east of it: hopping the channel and back, he is drawn whole in front of the water and the ledges' edges.

References fdActorGet().

Referenced by KalayTunnelCues.

Definition at line 1248 of file kalay.c.

scKalayCatchTownNut

static void scKalayCatchTownNut(void)

Catch in Kalay pulls in the Nut circling there, until it is caught.

References fdItemDisplayShowItem(), fdPartyInventoryGiveItem(), gmFlagSet(), scKalayUpdateNutOrbit(), syCloseEvent() and sySynch().

Referenced by KalayTownCues.

Definition at line 1254 of file kalay.c.

scInit

Sint32 scInit(void)

Every scene of the overlay sets FLAG_KALAY_REACHED, then prepares its own people and metatiles.

References gmFlagSet(), MainRoutineStateWork, scKalayPrepareHammetPalace(), scKalayPrepareTown(), scKalayPrepareTunnelEntrance(), scKalayPrepareTunnelPassage(), scKalayPrepareTunnelTreasureRoom() and Sint32.

Definition at line 1267 of file kalay.c.

scKalayCatchUpWithLunpa

static inline void scKalayCatchUpWithLunpa(void)

Catches the palace's story up with Lunpa's: once Hammet is free, Ivan's report and Layana's scolding count as seen and the tunnel is open; once the party has heard in Lunpa that he is held there, Kalay has heard it too.

References gmFlagGet() and gmFlagSet().

Referenced by scKalayPrepareHammetPalace() and scKalayPrepareTown().

Definition at line 1299 of file kalay.c.

scKalayPushTunnelStatue

static void scKalayPushTunnelStatue(void)

Walking into the stone statue in either hall of the Kalay Tunnel pushes it one metatile, when there is room, with Isaac following it.

References fdActorGet(), fdActorSelectAnimation(), fdActorStepFrom(), fdActorWaitForMove(), fdPlayQueuedMusic(), PushedActorDirectionSteps, scActorFindAtMetatile(), scFieldActorCheckMovementCollision(), scFieldActorSetMoveTargetFX(), scKalayUpdateTunnelPassages(), Sint32, sySoundPlay() and sySynch().

Referenced by KalayTunnelCues.

Definition at line 2183 of file kalay.c.

scKalayUpdateTunnelParticle

static void scKalayUpdateTunnelParticle(ACTOR *particle)

References fdActorRelease() and Sint32.

Referenced by KalayTunnelParticleScript.

Definition at line 2386 of file kalay.c.

scKalayFreezePuddle

static void scKalayFreezePuddle(void)

Frost on the puddle in the drained west pool of the Kalay Tunnel freezes it and sinks it into the floor, out of Isaac's way.

References fdActorGet(), fdActorSetSpriteFlags(), fdMapGridCopyMetatileAttributes() and gmFlagSet().

Referenced by KalayTunnelCues.

Definition at line 2527 of file kalay.c.

Variables in detail

KalayUnusedBeforePacingStep

Uint8 KalayUnusedBeforePacingStep[12]

Unused: twelve bytes nothing reads or writes.

Definition at line 86 of file kalay.c.

KalayPacingStep

Sint32 KalayPacingStep

Which of the two guides' turns scKalayUpdatePacingGuides is at, 0 to 4.

References Sint32.

Referenced by scKalayStartGuidesPacing() and scKalayUpdatePacingGuides().

Definition at line 88 of file kalay.c.

KalayTourGroupWalkScript

extern Sint32 KalayTourGroupWalkScript[]

Sint32 KalayTourGroupWalkScript[]

References Sint32.

Referenced by scKalayWatchTourGroupDeparture().

Definition at lines 146 and 2546 of file kalay.c.

KalayTourGroupLeaveScript

extern Sint32 KalayTourGroupLeaveScript[]

Sint32 KalayTourGroupLeaveScript[]

References Sint32.

Referenced by scKalayWatchTourGroupDeparture().

Definition at lines 147 and 2556 of file kalay.c.

KalayWaitingTouristScript

extern Sint32 KalayWaitingTouristScript[]

Sint32 KalayWaitingTouristScript[]

References scKalayUpdateWaitingTourist() and Sint32.

Referenced by scKalayStartTouristWaiting().

Definition at lines 148 and 2579 of file kalay.c.

KalayGuideCountScript

extern Sint32 KalayGuideCountScript[]

Sint32 KalayGuideCountScript[]

References Sint32.

Referenced by scKalayUpdatePacingGuides().

Definition at lines 149 and 2584 of file kalay.c.

KalayGuidePaceScript

extern Sint32 KalayGuidePaceScript[]

Sint32 KalayGuidePaceScript[]

References Sint32.

Referenced by scKalayUpdatePacingGuides() and scKalayWatchTourGroupDeparture().

Definition at lines 150 and 2613 of file kalay.c.

KalayHeadGuideStopScript

extern Sint32 KalayHeadGuideStopScript[]

Sint32 KalayHeadGuideStopScript[]

References Sint32.

Referenced by scKalayWatchTourGroupDeparture().

Definition at lines 151 and 2630 of file kalay.c.

KalaySecondGuideStopScript

extern Sint32 KalaySecondGuideStopScript[]

Sint32 KalaySecondGuideStopScript[]

References Sint32.

Referenced by scKalayWatchTourGroupDeparture().

Definition at lines 152 and 2648 of file kalay.c.

KalayHeadGuideReturnScript

extern Sint32 KalayHeadGuideReturnScript[]

Sint32 KalayHeadGuideReturnScript[]

References Sint32.

Referenced by scKalayWatchTourGroupDeparture().

Definition at lines 153 and 2666 of file kalay.c.

KalaySecondGuideReturnScript

extern Sint32 KalaySecondGuideReturnScript[]

Sint32 KalaySecondGuideReturnScript[]

References Sint32.

Referenced by scKalayWatchTourGroupDeparture().

Definition at lines 154 and 2677 of file kalay.c.

KalayPartyLookAboutScript

extern Sint32 KalayPartyLookAboutScript[]

Sint32 KalayPartyLookAboutScript[]

References scLookAboutRandomly() and Sint32.

Referenced by scKalayHammetReturnsToPalace().

Definition at lines 155 and 2692 of file kalay.c.

KalayPartyGatherScript

extern Sint32 KalayPartyGatherScript[]

Sint32 KalayPartyGatherScript[]

References Sint32.

Referenced by scKalayHammetReturnsToPalace().

Definition at lines 156 and 2697 of file kalay.c.

KalayPuddleGrowScript

extern Sint32 KalayPuddleGrowScript[]

Sint32 KalayPuddleGrowScript[]

References Sint32.

Referenced by scKalayUpdateTunnelPassages().

Definition at lines 157 and 2709 of file kalay.c.

KalayTownEntrances

extern SCENE_ENTRANCE KalayTownEntrances[]

SCENE_ENTRANCE KalayTownEntrances[]

Referenced by scGetEntrances().

Definition at lines 158 and 2720 of file kalay.c.

KalayHammetPalaceEntrances

extern SCENE_ENTRANCE KalayHammetPalaceEntrances[]

SCENE_ENTRANCE KalayHammetPalaceEntrances[]

Referenced by scGetEntrances().

Definition at lines 159 and 2746 of file kalay.c.

KalayTunnelEntranceEntrances

extern SCENE_ENTRANCE KalayTunnelEntranceEntrances[]

SCENE_ENTRANCE KalayTunnelEntranceEntrances[]

Referenced by scGetEntrances().

Definition at lines 160 and 2755 of file kalay.c.

KalayTunnelCaveEntrances

extern SCENE_ENTRANCE KalayTunnelCaveEntrances[]

SCENE_ENTRANCE KalayTunnelCaveEntrances[]

Referenced by scGetEntrances().

Definition at lines 161 and 2766 of file kalay.c.

KalayTunnelPassageEntrances

extern SCENE_ENTRANCE KalayTunnelPassageEntrances[]

SCENE_ENTRANCE KalayTunnelPassageEntrances[]

Referenced by scGetEntrances().

Definition at lines 162 and 2775 of file kalay.c.

KalayTunnelEntrances

extern SCENE_ENTRANCE KalayTunnelEntrances[]

SCENE_ENTRANCE KalayTunnelEntrances[]

Referenced by scGetEntrances().

Definition at lines 163 and 2790 of file kalay.c.

KalayExits

extern Uint32 KalayExits[]

Uint32 KalayExits[]

Referenced by scGetExits().

Definition at lines 164 and 2803 of file kalay.c.

KalayNoActorPlacements

extern ACTOR_PLACE KalayNoActorPlacements[]

ACTOR_PLACE KalayNoActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 165 and 2878 of file kalay.c.

KalayTownActorPlacements

extern ACTOR_PLACE KalayTownActorPlacements[]

ACTOR_PLACE KalayTownActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 166 and 2882 of file kalay.c.

KalayTourGroupActorPlacements

extern ACTOR_PLACE KalayTourGroupActorPlacements[]

ACTOR_PLACE KalayTourGroupActorPlacements[]

Referenced by scKalayWatchTourGroupDeparture().

Definition at lines 167 and 2924 of file kalay.c.

KalayHammetPalaceActorPlacements

extern ACTOR_PLACE KalayHammetPalaceActorPlacements[]

ACTOR_PLACE KalayHammetPalaceActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 168 and 2944 of file kalay.c.

KalayTunnelEntranceActorPlacements

extern ACTOR_PLACE KalayTunnelEntranceActorPlacements[]

ACTOR_PLACE KalayTunnelEntranceActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 169 and 2954 of file kalay.c.

KalayTunnelActorPlacements

extern ACTOR_PLACE KalayTunnelActorPlacements[]

ACTOR_PLACE KalayTunnelActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 170 and 2974 of file kalay.c.

KalayNoCues

extern CUE KalayNoCues[]

CUE KalayNoCues[]

Referenced by scGetCues().

Definition at lines 171 and 2988 of file kalay.c.

KalayTownCues

extern CUE KalayTownCues[]

CUE KalayTownCues[]

References scKalayCatchTownNut(), scKalayOpenDoorAndExit(), scKalaySearchWell(), scKalayTalkAboutLeavingHome(), scKalayTalkToArmorMerchant(), scKalayTalkToItemMerchant(), scKalayTalkToWeaponMerchant() and scKalayWatchTourGroupDeparture().

Referenced by scGetCues().

Definition at lines 172 and 2992 of file kalay.c.

KalayHammetPalaceCues

extern CUE KalayHammetPalaceCues[]

CUE KalayHammetPalaceCues[]

References scKalayEnterPalace().

Referenced by scGetCues().

Definition at lines 173 and 3089 of file kalay.c.

KalayTunnelEntranceCues

extern CUE KalayTunnelEntranceCues[]

CUE KalayTunnelEntranceCues[]

References scKalayAskAboutGoingToCave() and scKalayCatchTunnelEntranceNut().

Referenced by scGetCues().

Definition at lines 174 and 3102 of file kalay.c.

KalayTunnelCaveCues

extern CUE KalayTunnelCaveCues[]

CUE KalayTunnelCaveCues[]

Referenced by scGetCues().

Definition at lines 175 and 3113 of file kalay.c.

KalayTunnelPassageCues

extern CUE KalayTunnelPassageCues[]

CUE KalayTunnelPassageCues[]

Referenced by scGetCues().

Definition at lines 176 and 3122 of file kalay.c.

KalayTunnelCues

extern CUE KalayTunnelCues[]

CUE KalayTunnelCues[]

References scKalayFixLeaderPriority(), scKalayFreeLeaderPriority(), scKalayFreezePuddle(), scKalayGroundMaskFollowsLeader(), scKalayGroundMaskLetsGoOfLeader(), scKalayPushTunnelStatue(), scKalayScorchJoins(), scKalayTalkAboutLayana() and scKalayUpdateTunnelPassages().

Referenced by scGetCues().

Definition at lines 177 and 3136 of file kalay.c.

KalayDoorMetatiles

extern MAP_EDIT KalayDoorMetatiles[]

MAP_EDIT KalayDoorMetatiles[]

References KalayDoorMetatileSteps.

Referenced by scKalayOpenDoorAndExit().

Definition at lines 178 and 3193 of file kalay.c.

KalayTunnelParticleScript

extern Sint32 KalayTunnelParticleScript[]

Sint32 KalayTunnelParticleScript[]

References scKalayUpdateTunnelParticle() and Sint32.

Referenced by scKalaySpawnTunnelParticle().

Definition at lines 179 and 3204 of file kalay.c.

KalayDoorMetatileSteps

Uint16 KalayDoorMetatileSteps[]

A door of the town opening, and where each of the eight doors is, in the order of their exits from KALAY_HOUSE_NORTHWEST.

Referenced by KalayDoorMetatiles.

Definition at line 3188 of file kalay.c.

On this page

MacrosEnumerationsFunctionsVariablesDescriptionMacros in detailDUST_PUFF_ANIMATION_QUICKLARGE_WAGON_ANIMATION_STILLWATERFALL_FIRST_FRAME_COLUMNWATERFALL_OPEN_FRAME_COLUMNWATERFALL_LAST_FRAME_COLUMNFIRST_STATUE_OPENING_HALF_METATILESECOND_STATUE_OPENING_HALF_METATILETUNNEL_PARTICLE_DRAG_XTUNNEL_PARTICLE_DRAG_YFIRST_STATUE_BY_GATE_WEST_XFIRST_STATUE_BY_GATE_EAST_XFIRST_STATUE_BY_GATE_NORTH_ZFIRST_STATUE_SPARKLE_XSECOND_STATUE_SPARKLE_XPUDDLE_GROW_TICKSEnumerations in detailKALAY_TUNNEL_METATILE_BEHAVIORKALAY_METATILE_BEHAVIORKALAY_TOWN_ACTOR_IDKALAY_PALACE_ACTOR_IDKALAY_TUNNEL_ENTRANCE_ACTOR_IDKALAY_TUNNEL_ACTOR_IDKALAY_TUNNEL_FLAGanonymous enumFunctions in detailscKalayPrepareTownscKalayPrepareHammetPalacescKalayPrepareTunnelEntrancescKalayPrepareTunnelPassagescKalayPrepareTunnelTreasureRoomscKalayStartTouristsWaitingscKalayStartTouristWaitingscKalayStartGuidesPacingscKalayUpdatePacingGuidesscKalayIvanMeetsPalaceGuardsscKalayHammetReturnsToPalacescKalayUpdateTunnelPassagesscKalayUpdateTunnelStatuesscKalaySpawnTunnelParticlescKalayUpdateNutOrbitscKalayClearScriptDonescKalayScorchJoinsscKalayUpdateWaitingTouristscGetEntrancesscGetExitRegionsscGetExitsscGetActorPlacementsscKalaySearchWellscKalayCatchTunnelEntranceNutscGetCuesscKalayTalkAboutLeavingHomescKalayAskAboutGoingToCavescKalayTalkAboutLayanascKalayTalkToWeaponMerchantscKalayTalkToArmorMerchantscKalayTalkToItemMerchantscKalayOpenDoorAndExitscKalayAnimatePalaceDoorscKalayEnterPalacescKalayWatchTourGroupDeparturescKalayGroundMaskLetsGoOfLeaderscKalayGroundMaskFollowsLeaderscKalayFreeLeaderPriorityscKalayFixLeaderPriorityscKalayCatchTownNutscInitscKalayCatchUpWithLunpascKalayPushTunnelStatuescKalayUpdateTunnelParticlescKalayFreezePuddleVariables in detailKalayUnusedBeforePacingStepKalayPacingStepKalayTourGroupWalkScriptKalayTourGroupLeaveScriptKalayWaitingTouristScriptKalayGuideCountScriptKalayGuidePaceScriptKalayHeadGuideStopScriptKalaySecondGuideStopScriptKalayHeadGuideReturnScriptKalaySecondGuideReturnScriptKalayPartyLookAboutScriptKalayPartyGatherScriptKalayPuddleGrowScriptKalayTownEntrancesKalayHammetPalaceEntrancesKalayTunnelEntranceEntrancesKalayTunnelCaveEntrancesKalayTunnelPassageEntrancesKalayTunnelEntrancesKalayExitsKalayNoActorPlacementsKalayTownActorPlacementsKalayTourGroupActorPlacementsKalayHammetPalaceActorPlacementsKalayTunnelEntranceActorPlacementsKalayTunnelActorPlacementsKalayNoCuesKalayTownCuesKalayHammetPalaceCuesKalayTunnelEntranceCuesKalayTunnelCaveCuesKalayTunnelPassageCuesKalayTunnelCuesKalayDoorMetatilesKalayTunnelParticleScriptKalayDoorMetatileSteps