Alchemy
Loading...
Searching...
No Matches

west_lunpa_cave.c File Reference

West Lunpa Cave: a gate puzzle of switches and puddles that Frost freezes into pillars, and Bunza, whose wagon carries the party out of Lunpa. More...

Go to the source code of this file.

Functions

static void Reunion_Converse (void)
 Explains Bunza's arrival and offers his wagon as a way out of Lunpa.
static void WagonChoice_Run (void)
 Reconciles the party's answers until they either ride or stay behind.
static u8 Leader_AnswersYes (void)
 The scene menu encodes Yes as zero; expose it as a Boolean to the dialogue.
static u8 Garet_AsksIfNotRiding (void)
 Asks whether the party really intends to refuse the ride.
static u8 Garet_AsksAboutUnfinishedBusiness (void)
 Asks whether unfinished business explains the refusal to ride.
static u8 Party_ConfirmsStaying (void)
 Reserved confirmation step; it always succeeds and displays no message.
static u8 Bunza_AsksAboutUnfinishedBusiness (void)
 Lets Bunza check whether the party has unfinished business before leaving.
static u8 Garet_ChecksNothingLeftToDo (void)
 Opens Garet's confirmation prompt; WagonChoice_Run collects the answer.
static u8 Mia_AsksIfRidingAfterAll (void)
 Asks whether the party has changed its mind about taking the wagon.
static u8 Bunza_CannotWait (void)
 Explains that Bunza cannot wait and asks again about the party's business.
static u8 Garet_AsksAboutThingsToDo (void)
 Asks the leader to confirm that something still needs doing here.
static void Party_StaysBehind (void)
 Sends Hammet and Bunza ahead, then returns the companions to the leader.
static void Party_RidesWagon (void)
 Leads everyone down the passage and requests the wagon departure exit.
const struct SceneEntrance * Scene_GetEntrances (void)
const struct SceneRegion * Scene_GetRegions (void)
const u32 * Scene_GetExits (void)
 Both passages and the wagon departure return through this exit table.
const struct ScenePlacement * Scene_GetPlacements (void)
 Only the cave scene places puddles, Hammet, Bunza and the party members.
const struct SceneEvent * Scene_GetEvents (void)
 Routes switches, Frost targets and the reunion trigger to their handlers.
static void Event_FreezeHiddenPuddle (void)
 Frost on the hidden puddle: it freezes, and no flag remembers it.
static void Event_FreezeSouthPuddle (void)
 Frost on the south puddle: it rises as an ice pillar the party can climb.
static void Gate_DrawPropped (void)
 Animates the raised gate resting on the frozen pillar, then opens collision.
static void Event_FreezeGatePuddle (void)
 Frost on the puddle under the gate: its pillar props the gate open, and if the gate was down the player sees it rise and hears the puzzle solved.
static void Event_FreezeNorthPuddle (void)
 Frost on the north puddle: its pillar stays frozen when the party returns.
static void Gate_Lower (void)
 Lowers the gate in four-frame steps and restores the blocked cell attributes.
static void Event_FlipLoweringSwitch (void)
 Searching the lowering switch: the hero flips it and the gate comes down, unless it is down already or a frozen pillar props it open.
static void Gate_Raise (void)
 Raises the unpropped gate and restores its passable cell attributes.
static void Event_FlipRaisingSwitch (void)
 Searching the raising switch: the hero flips it and the gate goes up, unless it is up already or propped open.
static void Event_HammetFindsBunza (void)
 Walking past Bunza's hiding place once Lunpa's trade has reopened: Bunza steps out, Hammet knows his voice, and the reunion and the wagon talk follow.
s32 Scene_Initialize (void)
 Restores the gate and frozen puddles from the persistent puzzle flags.

Variables

const struct SceneEntrance gCaveEntrances []
const u32 gCaveExits []
const struct ScenePlacement gCaveNoPlacements []
const struct ScenePlacement gCavePlacements []
const struct SceneEvent gCaveNoEvents []
const struct SceneEvent gCaveEvents []

Detailed Description

West Lunpa Cave: a gate puzzle of switches and puddles that Frost freezes into pillars, and Bunza, whose wagon carries the party out of Lunpa.

Definition in file west_lunpa_cave.c.

Function Documentation

◆ Reunion_Converse()

void Reunion_Converse ( void )
static

Explains Bunza's arrival and offers his wagon as a way out of Lunpa.

Definition at line 316 of file west_lunpa_cave.c.

Referenced by Event_HammetFindsBunza(), and Reunion_Converse().

◆ WagonChoice_Run()

void WagonChoice_Run ( void )
static

Reconciles the party's answers until they either ride or stay behind.

Definition at line 611 of file west_lunpa_cave.c.

Referenced by Reunion_Converse(), and WagonChoice_Run().

◆ Leader_AnswersYes()

u8 Leader_AnswersYes ( void )
static

The scene menu encodes Yes as zero; expose it as a Boolean to the dialogue.

Definition at line 673 of file west_lunpa_cave.c.

Referenced by Leader_AnswersYes(), and WagonChoice_Run().

◆ Garet_AsksIfNotRiding()

u8 Garet_AsksIfNotRiding ( void )
static

Asks whether the party really intends to refuse the ride.

Definition at line 678 of file west_lunpa_cave.c.

Referenced by Garet_AsksIfNotRiding(), and WagonChoice_Run().

◆ Garet_AsksAboutUnfinishedBusiness()

u8 Garet_AsksAboutUnfinishedBusiness ( void )
static

Asks whether unfinished business explains the refusal to ride.

Definition at line 685 of file west_lunpa_cave.c.

Referenced by Garet_AsksAboutUnfinishedBusiness(), and WagonChoice_Run().

◆ Party_ConfirmsStaying()

u8 Party_ConfirmsStaying ( void )
static

Reserved confirmation step; it always succeeds and displays no message.

Definition at line 692 of file west_lunpa_cave.c.

Referenced by Party_ConfirmsStaying(), and WagonChoice_Run().

◆ Bunza_AsksAboutUnfinishedBusiness()

u8 Bunza_AsksAboutUnfinishedBusiness ( void )
static

Lets Bunza check whether the party has unfinished business before leaving.

Definition at line 695 of file west_lunpa_cave.c.

Referenced by Bunza_AsksAboutUnfinishedBusiness(), and WagonChoice_Run().

◆ Garet_ChecksNothingLeftToDo()

u8 Garet_ChecksNothingLeftToDo ( void )
static

Opens Garet's confirmation prompt; WagonChoice_Run collects the answer.

Definition at line 702 of file west_lunpa_cave.c.

Referenced by Garet_ChecksNothingLeftToDo(), and WagonChoice_Run().

◆ Mia_AsksIfRidingAfterAll()

u8 Mia_AsksIfRidingAfterAll ( void )
static

Asks whether the party has changed its mind about taking the wagon.

Definition at line 709 of file west_lunpa_cave.c.

Referenced by Mia_AsksIfRidingAfterAll(), and WagonChoice_Run().

◆ Bunza_CannotWait()

u8 Bunza_CannotWait ( void )
static

Explains that Bunza cannot wait and asks again about the party's business.

Definition at line 716 of file west_lunpa_cave.c.

Referenced by Bunza_CannotWait(), and WagonChoice_Run().

◆ Garet_AsksAboutThingsToDo()

u8 Garet_AsksAboutThingsToDo ( void )
static

Asks the leader to confirm that something still needs doing here.

Definition at line 736 of file west_lunpa_cave.c.

Referenced by Garet_AsksAboutThingsToDo(), and WagonChoice_Run().

◆ Party_StaysBehind()

void Party_StaysBehind ( void )
static

Sends Hammet and Bunza ahead, then returns the companions to the leader.

Definition at line 743 of file west_lunpa_cave.c.

Referenced by Party_StaysBehind(), and WagonChoice_Run().

◆ Party_RidesWagon()

void Party_RidesWagon ( void )
static

Leads everyone down the passage and requests the wagon departure exit.

Definition at line 851 of file west_lunpa_cave.c.

Referenced by Party_RidesWagon(), and WagonChoice_Run().

◆ Scene_GetEntrances()

const struct SceneEntrance * Scene_GetEntrances ( void )

Definition at line 35 of file west_lunpa_cave.c.

◆ Scene_GetRegions()

const struct SceneRegion * Scene_GetRegions ( void )

Definition at line 37 of file west_lunpa_cave.c.

◆ Scene_GetExits()

const u32 * Scene_GetExits ( void )

Both passages and the wagon departure return through this exit table.

Both scenes share one exit table.

Definition at line 40 of file west_lunpa_cave.c.

◆ Scene_GetPlacements()

const struct ScenePlacement * Scene_GetPlacements ( void )

Only the cave scene places puddles, Hammet, Bunza and the party members.

Definition at line 43 of file west_lunpa_cave.c.

◆ Scene_GetEvents()

const struct SceneEvent * Scene_GetEvents ( void )

Routes switches, Frost targets and the reunion trigger to their handlers.

Definition at line 51 of file west_lunpa_cave.c.

◆ Event_FreezeHiddenPuddle()

void Event_FreezeHiddenPuddle ( void )
static

Frost on the hidden puddle: it freezes, and no flag remembers it.

Definition at line 54 of file west_lunpa_cave.c.

◆ Event_FreezeSouthPuddle()

void Event_FreezeSouthPuddle ( void )
static

Frost on the south puddle: it rises as an ice pillar the party can climb.

Definition at line 64 of file west_lunpa_cave.c.

Referenced by Event_FreezeSouthPuddle().

◆ Gate_DrawPropped()

void Gate_DrawPropped ( void )
static

Animates the raised gate resting on the frozen pillar, then opens collision.

Definition at line 77 of file west_lunpa_cave.c.

Referenced by Event_FreezeGatePuddle(), Gate_DrawPropped(), and Scene_Initialize().

◆ Event_FreezeGatePuddle()

void Event_FreezeGatePuddle ( void )
static

Frost on the puddle under the gate: its pillar props the gate open, and if the gate was down the player sees it rise and hears the puzzle solved.

Definition at line 102 of file west_lunpa_cave.c.

Referenced by Event_FreezeGatePuddle().

◆ Event_FreezeNorthPuddle()

void Event_FreezeNorthPuddle ( void )
static

Frost on the north puddle: its pillar stays frozen when the party returns.

Definition at line 120 of file west_lunpa_cave.c.

Referenced by Event_FreezeNorthPuddle().

◆ Gate_Lower()

void Gate_Lower ( void )
static

Lowers the gate in four-frame steps and restores the blocked cell attributes.

Definition at line 126 of file west_lunpa_cave.c.

Referenced by Event_FlipLoweringSwitch(), Gate_Lower(), and Scene_Initialize().

◆ Event_FlipLoweringSwitch()

void Event_FlipLoweringSwitch ( void )
static

Searching the lowering switch: the hero flips it and the gate comes down, unless it is down already or a frozen pillar props it open.

"flipped the switch."

Definition at line 152 of file west_lunpa_cave.c.

Referenced by Event_FlipLoweringSwitch().

◆ Gate_Raise()

void Gate_Raise ( void )
static

Raises the unpropped gate and restores its passable cell attributes.

Definition at line 165 of file west_lunpa_cave.c.

Referenced by Event_FlipRaisingSwitch(), Gate_Raise(), and Scene_Initialize().

◆ Event_FlipRaisingSwitch()

void Event_FlipRaisingSwitch ( void )
static

Searching the raising switch: the hero flips it and the gate goes up, unless it is up already or propped open.

"flipped the switch."

Definition at line 181 of file west_lunpa_cave.c.

Referenced by Event_FlipRaisingSwitch().

◆ Event_HammetFindsBunza()

void Event_HammetFindsBunza ( void )
static

Walking past Bunza's hiding place once Lunpa's trade has reopened: Bunza steps out, Hammet knows his voice, and the reunion and the wagon talk follow.

Definition at line 196 of file west_lunpa_cave.c.

Referenced by Event_HammetFindsBunza().

◆ Scene_Initialize()

s32 Scene_Initialize ( void )

Restores the gate and frozen puddles from the persistent puzzle flags.

Sets up whichever scene is being entered and runs its arrival events.

Definition at line 942 of file west_lunpa_cave.c.

Variable Documentation

◆ gCaveEntrances

const struct SceneEntrance gCaveEntrances[]
Initial value:
= {
{ 0, CONDITION_ALWAYS, 168, 0, 632, FACING_NORTH, 0, -1, -1, -1, -1, 0 },
{ CAVE_ENTRANCE_FROM_WORLD_MAP, CONDITION_ALWAYS, 168, 0, 632, FACING_NORTH, 0, 88, 56, 648, 648, 0 },
{ CAVE_ENTRANCE_FROM_LUNPA, CONDITION_ALWAYS, 552, 0, 328, FACING_NORTH, 0, 88, 56, 648, 648, 0 },
{ CAVE_ENTRANCE_THIRD, CONDITION_ALWAYS, 552, 0, 328, FACING_NORTH, 0, 88, 56, 648, 488, 0 },
}
@ SCENE_TABLE_END
Definition field_scene.h:43
@ CONDITION_ALWAYS
Definition field_scene.h:44
@ FACING_NORTH
Definition field_scene.h:32
@ CAVE_ENTRANCE_FROM_LUNPA
Definition lunpa.h:59
@ CAVE_ENTRANCE_FROM_WORLD_MAP
@ CAVE_ENTRANCE_THIRD

Definition at line 970 of file west_lunpa_cave.c.

Referenced by Scene_GetEntrances().

◆ gCaveExits

const u32 gCaveExits[]
Initial value:
= {
}
#define SCENE_EXITS(scene)
Definition field_scene.h:72
@ SCENE_WEST_LUNPA_CAVE
Definition field_scene.h:19
@ SCENE_LUNPA
Definition field_scene.h:17
@ SCENE_WORLD_MAP
Definition field_scene.h:13
#define SCENE_EXIT(exit, scene, entrance)
Definition field_scene.h:73
#define SCENE_EXITS_END
Definition field_scene.h:77
@ LUNPA_ENTRANCE_FROM_CAVE
Definition lunpa.h:17
@ CAVE_EXIT_BY_WAGON
@ CAVE_EXIT_TO_WORLD_MAP
@ CAVE_EXIT_TO_LUNPA
@ WORLD_MAP_ENTRANCE_FROM_CAVE

Definition at line 978 of file west_lunpa_cave.c.

Referenced by Scene_GetExits().

◆ gCaveNoPlacements

const struct ScenePlacement gCaveNoPlacements[]
Initial value:
= {
}

Definition at line 986 of file west_lunpa_cave.c.

Referenced by Scene_GetPlacements().

◆ gCavePlacements

const struct ScenePlacement gCavePlacements[]
Initial value:
= {
PIXELS(136), 0, PIXELS(520), FACING_SOUTH, TALK_FACE_PARTY, 0 },
PIXELS(344), 0, PIXELS(248), FACING_SOUTH, TALK_FACE_PARTY, 0 },
PIXELS(424), 0, PIXELS(136), FACING_SOUTH, TALK_FACE_PARTY, 0 },
}
#define GARET
Jerald.
#define MIA
Mary.
#define IVAN
Ivan.
@ TALK_KEEP_FACING
@ TALK_FACE_PARTY
@ ACTOR_STAND
@ FACING_SOUTH
Definition field_scene.h:28
@ FACING_WEST
Definition field_scene.h:30
#define PIXELS(value)
@ SPRITE_PUDDLE
Definition lunpa.h:137
@ SPRITE_BUNZA
@ SPRITE_HAMMET

Definition at line 990 of file west_lunpa_cave.c.

Referenced by Scene_GetPlacements().

◆ gCaveNoEvents

const struct SceneEvent gCaveNoEvents[]
Initial value:
= {
}
#define SCENE_EVENTS_END

Definition at line 1006 of file west_lunpa_cave.c.

◆ gCaveEvents

const struct SceneEvent gCaveEvents[]
Initial value:
= {
}
@ ABILITY_FROST
Definition ability_ids.h:11
@ EVENT_TOUCH
@ EVENT_EXIT
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
#define SEARCH(target)
@ SEARCH_UNNAMED
#define FLAG_LUNPA_CAVE_REUNION_SEEN
Definition flags.h:124
@ ACTOR_HIDDEN_PUDDLE
Definition lunpa.h:103
@ ACTOR_NORTH_PUDDLE
@ ACTOR_SOUTH_PUDDLE
@ ACTOR_GATE_PUDDLE
@ TRIGGER_LOWERING_SWITCH
@ TRIGGER_BUNZA_HIDING_PLACE
@ TRIGGER_LUNPA_PASSAGE
@ TRIGGER_RAISING_SWITCH
@ TRIGGER_WORLD_MAP_PASSAGE
static void Event_FreezeSouthPuddle(void)
Frost on the south puddle: it rises as an ice pillar the party can climb.
static void Event_FlipLoweringSwitch(void)
Searching the lowering switch: the hero flips it and the gate comes down, unless it is down already o...
static void Event_FlipRaisingSwitch(void)
Searching the raising switch: the hero flips it and the gate goes up, unless it is up already or prop...
static void Event_FreezeHiddenPuddle(void)
Frost on the hidden puddle: it freezes, and no flag remembers it.
static void Event_FreezeGatePuddle(void)
Frost on the puddle under the gate: its pillar props the gate open, and if the gate was down the play...
static void Event_HammetFindsBunza(void)
Walking past Bunza's hiding place once Lunpa's trade has reopened: Bunza steps out,...
static void Event_FreezeNorthPuddle(void)
Frost on the north puddle: its pillar stays frozen when the party returns.

Definition at line 1010 of file west_lunpa_cave.c.

Referenced by Scene_GetEvents().