Alchemy

lunpa.c

Lunpa, the town under Dodonpa's fortress, on two maps: the town itself (Lunpa 1), with its well, its hidden passage to the jail and Reveal's secrets, and the gate below the fortress (Lunpa 2), where two guards turn the party away until Cloak gets them past.

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

Lunpa, the town under Dodonpa's fortress, on two maps: the town itself (Lunpa 1), with its well, its hidden passage to the jail and Reveal's secrets, and the gate below the fortress (Lunpa 2), where two guards turn the party away until Cloak gets them past.

Scene flags in the town: FLAG_SCENE_TEMP_00, the puddle is frozen into a pillar; FLAG_SCENE_TEMP_01, Reveal's secrets are hidden; FLAG_SCENE_TEMP_02, the hidden passage to the jail is open. At the gate, FLAG_SCENE_TEMP_40 to _44, as flags.h describes them.

Functions

Scene_GetPlacements

const struct ScenePlacement *Scene_GetPlacements(void)

The townsfolk, or the gate's guards.

Line 92

Event_CatchFloatingNut

static void Event_CatchFloatingNut(void)

Catch on the nut floating over the town: the party gets it.

Used by gMcCoyPalaceGardenEvents.

Line 105

Lunpa_ApplyFrozenPuddleCollision

static inline void Lunpa_ApplyFrozenPuddleCollision(void)

Restores the frozen pillar's three collision cells, including its sides.

Used by Event_FreezeHiddenPuddle, Event_RevealSecrets.

Line 115

Event_FreezeHiddenPuddle

static void Event_FreezeHiddenPuddle(void)

Frost on the puddle Reveal shows: it freezes into a pillar the party can stand on.

Used by gCaveEvents.

Line 123

Lunpa_UpdateIcePillarDrawOrder

static void Lunpa_UpdateIcePillarDrawOrder(void)

Every frame while the pillar stands: draw it under the leader once the leader is on top.

Used by Event_HideSecrets, Event_RevealSecrets.

Line 139

Lunpa_DrawHiddenPassageFrame

static inline void Lunpa_DrawHiddenPassageFrame(s32 sourceColumn, s32 sourceRow)

Draws the three map regions that make one frame of the hidden passage.

Used by Event_PressHiddenSwitch, Event_RevealSecrets.

Line 150

Event_RevealSecrets

static void Event_RevealSecrets(void)

Reveal: the Psynergy Stone's spot, the hidden switch's glint, the puddle and, once opened, the passage show.

Line 159

Event_HideSecrets

static void Event_HideSecrets(void)

Reveal's end, and every entry to the town: the secrets hide again.

Used by Scene_Initialize.

Line 205

Scene_GetEvents

const struct SceneEvent *Scene_GetEvents(void)

The gate's events, or the town's before and after trade reopens.

Line 234

Event_TalkToWestGuard

static void Event_TalkToWestGuard(void)

The west guard of the town asks whether the party wants in.

Used by gLunpaSealedEvents, gMcCoyPalaceGardenEvents.

Line 249

Event_TalkToEastGuard

static void Event_TalkToEastGuard(void)

The east guard: wants authorization, or once the guards suspect Kalay, asks twice whether the party came from there.

Used by gLunpaSealedEvents, gMcCoyPalaceGardenEvents, gSuhallaGateEventsOther.

Line 259

Event_AskAboutLengthOfStay

static void Event_AskAboutLengthOfStay(void)

Asks how long the party has been in Lunpa.

Used by gLunpaSealedEvents.

Line 298

Event_AskAboutHammetsKidnapping

static void Event_AskAboutHammetsKidnapping(void)

Asks whether Dodonpa kidnapped Hammet for ransom.

Used by gLunpaSealedEvents.

Line 306

Event_AskAboutSeeingDonpa

static void Event_AskAboutSeeingDonpa(void)

Asks whether the party wants to see Donpa.

Used by gLunpaSealedEvents.

Line 314

Event_ComplainAboutCold

static void Event_ComplainAboutCold(void)

Shivers and complains that the weather has become colder.

Used by gLunpaReopenedEvents.

Line 322

Event_AskAboutFortressCommotion

static void Event_AskAboutFortressCommotion(void)

Offers to explain the commotion at the fortress.

Used by gLunpaReopenedEvents.

Line 331

Event_TalkToLeftGuard

static void Event_TalkToLeftGuard(void)

The gate's left guard: hears someone while the party is cloaked; after trade reopens, nearly recognizes Hammet with the party.

Used by gGateEvents.

Line 340

Event_TalkToRightGuard

static void Event_TalkToRightGuard(void)

The gate's right guard.

Used by gGateEvents.

Line 361

Event_ReadLeftGuardsThoughts

static void Event_ReadLeftGuardsThoughts(void)

Mind Read on the left guard: before the cave reunion he thinks the man with the party looks like that merchant, and Mind Read is cut short the first time as he turns to look.

Used by gGateEvents.

Line 375

Lunpa_WatchForFortressApproach

static void Lunpa_WatchForFortressApproach(void)

Every frame at the gate after trade reopens: stepping up to row 10 raises Garet's warning (trigger TRIGGER_FORTRESS_APPROACH).

Used by Scene_Initialize.

Line 412

Event_GaretTurnsLeaderBack

static void Event_GaretTurnsLeaderBack(void)

Garet reminds the leader they cannot go into the fortress, and the leader steps back.

Used by gGateEvents.

Line 423

Event_EnterDoor

static void Event_EnterDoor(void)

The leader walks into a doorway: the door opens and the leader goes in.

Used by gSuhallaEvents, gSuhallaEventsLater.

Line 438

Event_EnterHiddenPassage

static void Event_EnterHiddenPassage(void)

The hidden passage to the jail, once opened and while Reveal shows it.

Line 471

Event_EnterFortress

static void Event_EnterFortress(void)

Through the fortress door, out of the gate's top.

Used by gGateEvents.

Line 485

Lunpa_PlayRevealCue

UNUSED static void Lunpa_PlayRevealCue(void)

Reveal's sound when it uncovers something.

Line 506

Event_PressHiddenSwitch

static void Event_PressHiddenSwitch(void)

Searching the switch Reveal shows: the passage opens in five steps.

Line 513

Lunpa_CopyGatewayCollision

static inline void Lunpa_CopyGatewayCollision(s32 sourceColumn, s32 sourceRow)

Copies one open or blocked source cell across the three-cell gateway.

Used by Event_CastCloak, Event_GuardsBlockGate, Lunpa_ReopenGateway.

Line 538

Event_GuardsBlockGate

static void Event_GuardsBlockGate(void)

Coming close uncloaked, the guards step in front of the fortress door and the gateway closes.

Used by gGateEvents.

Line 546

Event_CastCloak

static void Event_CastCloak(void)

Cloak: the gateway closes behind the guards.

Used by Scene_Initialize, gGateEvents.

Line 573

Event_GuardsCatchParty

static void Event_GuardsCatchParty(void)

Raised when the guards spot the party: they recognize the man with them, and march the party back down to the gate's foot.

Used by Event_CloakFades, gGateEvents.

Line 580

Event_CloakFades

static void Event_CloakFades(void)

Cloak fades: if the leader is still among the guards, they are caught.

Used by gGateEvents.

Line 642

Lunpa_WatchForUncloakedParty

static void Lunpa_WatchForUncloakedParty(void)

Every frame at the gate: an uncloaked leader in front of the guards is spotted.

Used by Event_CloakFades, Event_GuardsCatchParty, Scene_Initialize.

Line 669

Lunpa_KickUpLeaderDust

static void Lunpa_KickUpLeaderDust(void)

Every 16 frames while the leader is thrown: a puff of dust.

Used by Event_GuardsThrowLeaderOut.

Line 684

Event_GuardsThrowLeaderOut

static void Event_GuardsThrowLeaderOut(void)

Entering the gate after being caught inside: the guards throw the leader out and down the steps.

Used by Scene_Initialize.

Line 701

Event_LeaderSneaksOut

static void Event_LeaderSneaksOut(void)

Entering the gate after sneaking out of the fortress: the leader casts Cloak and slips around the guards.

Used by Scene_Initialize.

Line 780

Scene_Initialize

s32 Scene_Initialize(void)

Sets either map up: Reveal's secrets hidden and the floating nut in the town; at the gate, the thrown-out or sneaking-out scene, the watchers and the fortress visit flags cleared.

Line 810

Also, functions without a comment: Scene_GetEntrances, Scene_GetRegions, Scene_GetExits, Event_SearchWell, Event_ReadEastGuardsThoughts, Event_ReadRightGuardsThoughts, void, void, Lunpa_ReopenGateway.

Macros, without a comment: LUNPA_ENTRANCE, GATE_ENTRANCE, ROOM_EXIT, TALK, MIND_READ, DOOR, LUNPA_ROADS_AND_DOORS, LUNPA_SECRETS.

Globals

gShortEffectScript

s32 gShortEffectScript[]

How long an effect of common/effect_spawn.h lasts: 22, 44 or 126 frames, then it moves away and is freed.

Used by gEffectScripts.

Line 41

gLunpaDoors

struct MapCellAnim gLunpaDoors[]

Each door's opening animation and the map cell it plays at, by its trigger from TRIGGER_FIRST_HOME_DOOR.

Used by Event_EnterDoor.

Line 1116

Also, globals without a comment: gMediumEffectScript, gLongEffectScript, gEffectScripts, UNUSED, UNUSED, gLunpaEntrances, gGateEntrances, gLunpaExits, gGateExits, gLunpaPlacements, gGatePlacements, gLunpaSealedEvents, gLunpaReopenedEvents, gGateEvents, gLunpaDoorSteps, gLunpaUnusedWord.

On this page