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.
Event_CatchFloatingNut
static void Event_CatchFloatingNut(void)
Catch on the nut floating over the town: the party gets it.
Used by gMcCoyPalaceGardenEvents.
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.
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.
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.
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.
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.
Event_HideSecrets
static void Event_HideSecrets(void)
Reveal's end, and every entry to the town: the secrets hide again.
Used by Scene_Initialize.
Scene_GetEvents
const struct SceneEvent *Scene_GetEvents(void)
The gate's events, or the town's before and after trade reopens.
Event_TalkToWestGuard
static void Event_TalkToWestGuard(void)
The west guard of the town asks whether the party wants in.
Used by gLunpaSealedEvents, gMcCoyPalaceGardenEvents.
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.
Event_AskAboutLengthOfStay
static void Event_AskAboutLengthOfStay(void)
Asks how long the party has been in Lunpa.
Used by gLunpaSealedEvents.
Event_AskAboutHammetsKidnapping
static void Event_AskAboutHammetsKidnapping(void)
Asks whether Dodonpa kidnapped Hammet for ransom.
Used by gLunpaSealedEvents.
Event_AskAboutSeeingDonpa
static void Event_AskAboutSeeingDonpa(void)
Asks whether the party wants to see Donpa.
Used by gLunpaSealedEvents.
Event_ComplainAboutCold
static void Event_ComplainAboutCold(void)
Shivers and complains that the weather has become colder.
Used by gLunpaReopenedEvents.
Event_AskAboutFortressCommotion
static void Event_AskAboutFortressCommotion(void)
Offers to explain the commotion at the fortress.
Used by gLunpaReopenedEvents.
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.
Event_TalkToRightGuard
static void Event_TalkToRightGuard(void)
The gate's right guard.
Used by gGateEvents.
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.
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.
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.
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.
Event_EnterHiddenPassage
static void Event_EnterHiddenPassage(void)
The hidden passage to the jail, once opened and while Reveal shows it.
Event_EnterFortress
static void Event_EnterFortress(void)
Through the fortress door, out of the gate's top.
Used by gGateEvents.
Lunpa_PlayRevealCue
UNUSED static void Lunpa_PlayRevealCue(void)
Reveal's sound when it uncovers something.
Event_PressHiddenSwitch
static void Event_PressHiddenSwitch(void)
Searching the switch Reveal shows: the passage opens in five steps.
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.
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.
Event_CastCloak
static void Event_CastCloak(void)
Cloak: the gateway closes behind the guards.
Used by Scene_Initialize, gGateEvents.
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.
Event_CloakFades
static void Event_CloakFades(void)
Cloak fades: if the leader is still among the guards, they are caught.
Used by gGateEvents.
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.
Lunpa_KickUpLeaderDust
static void Lunpa_KickUpLeaderDust(void)
Every 16 frames while the leader is thrown: a puff of dust.
Used by Event_GuardsThrowLeaderOut.
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.
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.
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.
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.
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.
Also, globals without a comment: gMediumEffectScript, gLongEffectScript, gEffectScripts, UNUSED, UNUSED, gLunpaEntrances, gGateEntrances, gLunpaExits, gGateExits, gLunpaPlacements, gGatePlacements, gLunpaSealedEvents, gLunpaReopenedEvents, gGateEvents, gLunpaDoorSteps, gLunpaUnusedWord.