Alchemy
Loading...
Searching...
No Matches

lunpa.c File Reference

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. More...

Go to the source code of this file.

Macros

#define LUNPA_ENTRANCE(entrance, x, z, facing)
#define GATE_ENTRANCE(entrance, x, z, facing)
#define ROOM_EXIT(exit)
#define TALK(actor, value)
#define MIND_READ(actor, value)
#define DOOR(trigger)
#define LUNPA_ROADS_AND_DOORS
#define LUNPA_SECRETS

Enumerations

enum  { PALETTE_TRANSLUCENT_EFFECT = 14 , PALETTE_EFFECT = 15 }

Functions

static void Lunpa_WatchForUncloakedParty (void)
 Every frame at the gate: an uncloaked leader in front of the guards is spotted.
const struct SceneEntrance * Scene_GetEntrances (void)
const struct SceneRegion * Scene_GetRegions (void)
const u32 * Scene_GetExits (void)
 Both scenes share one exit table.
const struct ScenePlacement * Scene_GetPlacements (void)
 The townsfolk, or the gate's guards.
static void Event_CatchFloatingNut (void)
 Catch on the nut floating over the town: the party gets it.
static void Lunpa_ApplyFrozenPuddleCollision (void)
 Restores the frozen pillar's three collision cells, including its sides.
static void Event_FreezeHiddenPuddle (void)
 Frost on the puddle Reveal shows: it freezes into a pillar the party can stand on.
static void Lunpa_UpdateIcePillarDrawOrder (void)
 Every frame while the pillar stands: draw it under the leader once the leader is on top.
static void Lunpa_DrawHiddenPassageFrame (s32 sourceColumn, s32 sourceRow)
 Draws the three map regions that make one frame of the hidden passage.
static void Event_RevealSecrets (void)
 Reveal: the Psynergy Stone's spot, the hidden switch's glint, the puddle and, once opened, the passage show.
static void Event_HideSecrets (void)
 Reveal's end, and every entry to the town: the secrets hide again.
static void Event_SearchWell (void)
const struct SceneEvent * Scene_GetEvents (void)
 The gate's events, or the town's before and after trade reopens.
static void Event_TalkToWestGuard (void)
 The west guard of the town asks whether the party wants in.
static void Event_TalkToEastGuard (void)
 The east guard: wants authorization, or once the guards suspect Kalay, asks twice whether the party came from there.
static void Event_ReadEastGuardsThoughts (void)
static void Event_AskAboutLengthOfStay (void)
 Asks how long the party has been in Lunpa.
static void Event_AskAboutHammetsKidnapping (void)
 Asks whether Dodonpa kidnapped Hammet for ransom.
static void Event_AskAboutSeeingDonpa (void)
 Asks whether the party wants to see Donpa.
static void Event_ComplainAboutCold (void)
 Shivers and complains that the weather has become colder.
static void Event_AskAboutFortressCommotion (void)
 Offers to explain the commotion at the fortress.
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.
static void Event_TalkToRightGuard (void)
 The gate's right guard.
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.
static void Event_ReadRightGuardsThoughts (void)
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).
static void Event_GaretTurnsLeaderBack (void)
 Garet reminds the leader they cannot go into the fortress, and the leader steps back.
static void Event_EnterDoor (void)
 The leader walks into a doorway: the door opens and the leader goes in.
static void Event_EnterHiddenPassage (void)
 The hidden passage to the jail, once opened and while Reveal shows it.
static void Event_EnterFortress (void)
 Through the fortress door, out of the gate's top.
static void UNUSED Lunpa_CheckAhead (void)
static UNUSED void Lunpa_PlayRevealCue (void)
 Reveal's sound when it uncovers something.
static void Event_PressHiddenSwitch (void)
 Searching the switch Reveal shows: the passage opens in five steps.
static void Lunpa_CopyGatewayCollision (s32 sourceColumn, s32 sourceRow)
 Copies one open or blocked source cell across the three-cell gateway.
static void Event_GuardsBlockGate (void)
 Coming close uncloaked, the guards step in front of the fortress door and the gateway closes.
static void UNUSED Lunpa_DoNothing (void)
static void Event_CastCloak (void)
 Cloak: the gateway closes behind the guards.
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.
static void Lunpa_ReopenGateway (void)
static void Event_CloakFades (void)
 Cloak fades: if the leader is still among the guards, they are caught.
static void Lunpa_KickUpLeaderDust (void)
 Every 16 frames while the leader is thrown: a puff of dust.
static void Event_GuardsThrowLeaderOut (void)
 Entering the gate after being caught inside: the guards throw the leader out and down the steps.
static void Event_LeaderSneaksOut (void)
 Entering the gate after sneaking out of the fortress: the leader casts Cloak and slips around the guards.
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.

Variables

s32 gShortEffectScript []
 How long an effect of common/effect_spawn.h lasts: 22, 44 or 126 frames, then it moves away and is freed.
s32 gMediumEffectScript []
s32 gLongEffectScript []
const s32 * gEffectScripts []
struct SceneEntrance gLunpaEntrances []
struct SceneEntrance gGateEntrances []
u32 gLunpaExits []
u32 gGateExits []
struct ScenePlacement gLunpaPlacements []
struct ScenePlacement gGatePlacements []
struct SceneEvent gLunpaSealedEvents []
struct SceneEvent gLunpaReopenedEvents []
struct SceneEvent gGateEvents []
u16 gLunpaDoorSteps [DOOR_COUNT][11]
struct LunpaDoor gLunpaDoors []
u32 gLunpaUnusedWord = 0

Detailed Description

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.

Definition in file lunpa.c.

Macro Definition Documentation

◆ LUNPA_ENTRANCE

#define LUNPA_ENTRANCE ( entrance,
x,
z,
facing )
Value:
{(entrance), CONDITION_ALWAYS, (x), 0, (z), (facing), 0, -1, -1, -1, -1, 0}
@ CONDITION_ALWAYS
Definition field_scene.h:44

Definition at line 867 of file lunpa.c.

◆ GATE_ENTRANCE

#define GATE_ENTRANCE ( entrance,
x,
z,
facing )
Value:
{(entrance), CONDITION_ALWAYS, (x), 0, (z), (facing), 0, 32, 48, 272, 344, 0}

Definition at line 869 of file lunpa.c.

◆ ROOM_EXIT

#define ROOM_EXIT ( exit)
Value:
@ SCENE_LUNPA_SUHALLA
Definition field_scene.h:18
#define SCENE_EXIT(exit, scene, entrance)
Definition field_scene.h:73
#define ROOM_ENTRANCE(exit)
Definition lunpa.h:65

Definition at line 898 of file lunpa.c.

◆ TALK

#define TALK ( actor,
value )
Value:
{EVENT_TALK, (actor), CONDITION_ALWAYS, (value)}
@ EVENT_TALK

Definition at line 970 of file lunpa.c.

◆ MIND_READ

#define MIND_READ ( actor,
value )
Value:
@ ABILITY_MIND_READ
Definition ability_ids.h:16
#define PSYNERGY_ON_ACTOR(ability)

Definition at line 971 of file lunpa.c.

◆ DOOR

#define DOOR ( trigger)
Value:
#define EVENT_SCRIPT(script)
#define TOUCH_WALKING_INTO(facing)
@ FACING_NORTH
Definition field_scene.h:32
static void Event_EnterDoor(void)
The leader walks into a doorway: the door opens and the leader goes in.
Definition lunpa.c:438

Definition at line 974 of file lunpa.c.

◆ LUNPA_ROADS_AND_DOORS

#define LUNPA_ROADS_AND_DOORS
Value:
TOUCH_WALKING_INTO(FACING_NORTH), TRIGGER_HIDDEN_PASSAGE, \
}
@ EVENT_EXIT
static void Event_EnterHiddenPassage(void)
The hidden passage to the jail, once opened and while Reveal shows it.
Definition lunpa.c:471
#define DOOR(trigger)
Definition lunpa.c:974
@ LUNPA_EXIT_TO_GATE
Definition lunpa.h:31
@ LUNPA_EXIT_TO_WORLD_MAP
Definition lunpa.h:30
@ LUNPA_EXIT_TO_CAVE
Definition lunpa.h:32
@ TRIGGER_GATE_ROAD
Definition lunpa.h:70
@ TRIGGER_EIGHTH_ROOM_DOOR
Definition lunpa.h:79
@ TRIGGER_HIDDEN_PASSAGE
Definition lunpa.h:80
@ TRIGGER_SECOND_HOME_DOOR
Definition lunpa.h:73
@ TRIGGER_WORLD_MAP_ROAD
Definition lunpa.h:69
@ TRIGGER_INN_DOOR
Definition lunpa.h:77
@ TRIGGER_ARMS_SHOP_DOOR
Definition lunpa.h:75
@ TRIGGER_ITEM_SHOP_DOOR
Definition lunpa.h:76
@ TRIGGER_THIRD_HOME_DOOR
Definition lunpa.h:74
@ TRIGGER_FIRST_HOME_DOOR
Definition lunpa.h:72
@ TRIGGER_CAVE_ROAD
Definition lunpa.h:71

Definition at line 978 of file lunpa.c.

◆ LUNPA_SECRETS

#define LUNPA_SECRETS
Value:
EVENT_SCRIPT(Event_FreezeHiddenPuddle)}, \
EVENT_SCRIPT(Event_RevealSecrets)}, \
EVENT_SCRIPT(Event_HideSecrets)}, \
EVENT_SCRIPT(Event_PressHiddenSwitch)}, \
FIND_ITEM(ITEM_NUT)}, \
EVENT_SCRIPT(Event_SearchWell)}, \
{ \
}
@ ABILITY_CATCH
Definition ability_ids.h:23
@ ABILITY_REVEAL
Definition ability_ids.h:19
@ ABILITY_FROST
Definition ability_ids.h:11
#define SCENE_EVENTS_END
#define FIND_ITEM(item)
#define PSYNERGY_IN_AREA(ability, phase)
#define FIND_PSYNERGY_STONE
#define SEARCH(target)
@ SEARCH_UNNAMED
@ SEARCH_BARREL
@ SEARCH_GRAVE
#define FLAG_LUNPA_BARREL_NUT
Definition flags.h:288
#define FLAG_LUNPA_NUT_CAUGHT
the nut floating over the town
Definition flags.h:291
#define FLAG_LUNPA_PSYNERGY_STONE
Definition flags.h:286
#define FLAG_SCENE_TEMP_00
Definition flags.h:713
#define FLAG_LUNPA_GRAVE_SLEEP_BOMB
Definition flags.h:287
#define FLAG_SCENE_TEMP_01
Definition flags.h:714
@ ITEM_NUT
Definition item_ids.h:41
@ ITEM_SLEEP_BOMB
Definition item_ids.h:68
static void Event_HideSecrets(void)
Reveal's end, and every entry to the town: the secrets hide again.
Definition lunpa.c:205
static void Event_PressHiddenSwitch(void)
Searching the switch Reveal shows: the passage opens in five steps.
Definition lunpa.c:513
static void Event_FreezeHiddenPuddle(void)
Frost on the puddle Reveal shows: it freezes into a pillar the party can stand on.
Definition lunpa.c:123
static void Event_SearchWell(void)
Definition lunpa.c:226
static void Event_CatchFloatingNut(void)
Catch on the nut floating over the town: the party gets it.
Definition lunpa.c:105
static void Event_RevealSecrets(void)
Reveal: the Psynergy Stone's spot, the hidden switch's glint, the puddle and, once opened,...
Definition lunpa.c:159
@ REVEAL_SHOWN
Definition lunpa.h:143
@ REVEAL_FADED
Definition lunpa.h:143
@ ACTOR_FLOATING_NUT
Definition lunpa.h:115
@ ACTOR_HIDDEN_PUDDLE
Definition lunpa.h:103
@ TRIGGER_GRAVE_SLEEP_BOMB
Definition lunpa.h:83
@ TRIGGER_PSYNERGY_STONE
Definition lunpa.h:85
@ TRIGGER_WELL
Definition lunpa.h:82
@ TRIGGER_BARREL_NUT
Definition lunpa.h:84
@ TRIGGER_HIDDEN_SWITCH
Definition lunpa.h:81

Definition at line 991 of file lunpa.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PALETTE_TRANSLUCENT_EFFECT 
PALETTE_EFFECT 

Definition at line 34 of file lunpa.c.

Function Documentation

◆ Lunpa_WatchForUncloakedParty()

void Lunpa_WatchForUncloakedParty ( void )
static

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

Definition at line 669 of file lunpa.c.

Referenced by Event_CloakFades(), Event_GuardsCatchParty(), Lunpa_WatchForUncloakedParty(), and Scene_Initialize().

◆ Scene_GetEntrances()

const struct SceneEntrance * Scene_GetEntrances ( void )

Definition at line 65 of file lunpa.c.

◆ Scene_GetRegions()

const struct SceneRegion * Scene_GetRegions ( void )

Definition at line 77 of file lunpa.c.

◆ Scene_GetExits()

const u32 * Scene_GetExits ( void )

Both scenes share one exit table.

Definition at line 79 of file lunpa.c.

◆ Scene_GetPlacements()

const struct ScenePlacement * Scene_GetPlacements ( void )

The townsfolk, or the gate's guards.

Definition at line 92 of file lunpa.c.

◆ Event_CatchFloatingNut()

void Event_CatchFloatingNut ( void )
static

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

Definition at line 105 of file lunpa.c.

Referenced by Event_CatchFloatingNut(), and Event_CatchFloatingNut().

◆ Lunpa_ApplyFrozenPuddleCollision()

void Lunpa_ApplyFrozenPuddleCollision ( void )
inlinestatic

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

Definition at line 115 of file lunpa.c.

Referenced by Event_FreezeHiddenPuddle(), Event_RevealSecrets(), and Lunpa_ApplyFrozenPuddleCollision().

◆ Event_FreezeHiddenPuddle()

void Event_FreezeHiddenPuddle ( void )
static

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

Definition at line 123 of file lunpa.c.

Referenced by Event_FreezeHiddenPuddle(), and Event_FreezeHiddenPuddle().

◆ Lunpa_UpdateIcePillarDrawOrder()

void Lunpa_UpdateIcePillarDrawOrder ( void )
static

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

Definition at line 139 of file lunpa.c.

Referenced by Event_HideSecrets(), Event_RevealSecrets(), and Lunpa_UpdateIcePillarDrawOrder().

◆ Lunpa_DrawHiddenPassageFrame()

void Lunpa_DrawHiddenPassageFrame ( s32 sourceColumn,
s32 sourceRow )
inlinestatic

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

Definition at line 150 of file lunpa.c.

Referenced by Event_PressHiddenSwitch(), Event_RevealSecrets(), and Lunpa_DrawHiddenPassageFrame().

◆ Event_RevealSecrets()

void Event_RevealSecrets ( void )
static

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

Definition at line 159 of file lunpa.c.

Referenced by Event_RevealSecrets().

◆ Event_HideSecrets()

void Event_HideSecrets ( void )
static

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

Definition at line 205 of file lunpa.c.

Referenced by Event_HideSecrets(), and Scene_Initialize().

◆ Event_SearchWell()

void Event_SearchWell ( void )
static

Definition at line 226 of file lunpa.c.

Referenced by Event_SearchWell(), and Event_SearchWell().

◆ Scene_GetEvents()

const struct SceneEvent * Scene_GetEvents ( void )

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

Definition at line 234 of file lunpa.c.

◆ Event_TalkToWestGuard()

void Event_TalkToWestGuard ( void )
static

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

Definition at line 249 of file lunpa.c.

Referenced by Event_TalkToWestGuard(), and Event_TalkToWestGuard().

◆ Event_TalkToEastGuard()

void Event_TalkToEastGuard ( void )
static

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

Definition at line 259 of file lunpa.c.

Referenced by Event_TalkToEastGuard(), Event_TalkToEastGuard(), and Event_TalkToEastGuard().

◆ Event_ReadEastGuardsThoughts()

void Event_ReadEastGuardsThoughts ( void )
static

Definition at line 279 of file lunpa.c.

Referenced by Event_ReadEastGuardsThoughts().

◆ Event_AskAboutLengthOfStay()

void Event_AskAboutLengthOfStay ( void )
static

Asks how long the party has been in Lunpa.

Definition at line 298 of file lunpa.c.

Referenced by Event_AskAboutLengthOfStay().

◆ Event_AskAboutHammetsKidnapping()

void Event_AskAboutHammetsKidnapping ( void )
static

Asks whether Dodonpa kidnapped Hammet for ransom.

Definition at line 306 of file lunpa.c.

Referenced by Event_AskAboutHammetsKidnapping().

◆ Event_AskAboutSeeingDonpa()

void Event_AskAboutSeeingDonpa ( void )
static

Asks whether the party wants to see Donpa.

Definition at line 314 of file lunpa.c.

Referenced by Event_AskAboutSeeingDonpa().

◆ Event_ComplainAboutCold()

void Event_ComplainAboutCold ( void )
static

Shivers and complains that the weather has become colder.

Definition at line 322 of file lunpa.c.

Referenced by Event_ComplainAboutCold().

◆ Event_AskAboutFortressCommotion()

void Event_AskAboutFortressCommotion ( void )
static

Offers to explain the commotion at the fortress.

Definition at line 331 of file lunpa.c.

Referenced by Event_AskAboutFortressCommotion().

◆ Event_TalkToLeftGuard()

void Event_TalkToLeftGuard ( void )
static

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

Definition at line 340 of file lunpa.c.

Referenced by Event_TalkToLeftGuard().

◆ Event_TalkToRightGuard()

void Event_TalkToRightGuard ( void )
static

The gate's right guard.

Definition at line 361 of file lunpa.c.

Referenced by Event_TalkToRightGuard().

◆ Event_ReadLeftGuardsThoughts()

void Event_ReadLeftGuardsThoughts ( void )
static

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.

Definition at line 375 of file lunpa.c.

Referenced by Event_ReadLeftGuardsThoughts().

◆ Event_ReadRightGuardsThoughts()

void Event_ReadRightGuardsThoughts ( void )
static

Definition at line 401 of file lunpa.c.

Referenced by Event_ReadRightGuardsThoughts().

◆ Lunpa_WatchForFortressApproach()

void Lunpa_WatchForFortressApproach ( void )
static

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

Definition at line 412 of file lunpa.c.

Referenced by Lunpa_WatchForFortressApproach(), and Scene_Initialize().

◆ Event_GaretTurnsLeaderBack()

void Event_GaretTurnsLeaderBack ( void )
static

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

Definition at line 423 of file lunpa.c.

Referenced by Event_GaretTurnsLeaderBack().

◆ Event_EnterDoor()

void Event_EnterDoor ( void )
static

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

Definition at line 438 of file lunpa.c.

Referenced by Event_EnterDoor(), and Event_EnterDoor().

◆ Event_EnterHiddenPassage()

void Event_EnterHiddenPassage ( void )
static

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

Definition at line 471 of file lunpa.c.

Referenced by Event_EnterHiddenPassage().

◆ Event_EnterFortress()

void Event_EnterFortress ( void )
static

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

Definition at line 485 of file lunpa.c.

Referenced by Event_EnterFortress().

◆ Lunpa_CheckAhead()

void UNUSED Lunpa_CheckAhead ( void )
static

Definition at line 503 of file lunpa.c.

Referenced by Lunpa_CheckAhead().

◆ Lunpa_PlayRevealCue()

UNUSED void Lunpa_PlayRevealCue ( void )
static

Reveal's sound when it uncovers something.

Definition at line 506 of file lunpa.c.

Referenced by Lunpa_PlayRevealCue().

◆ Event_PressHiddenSwitch()

void Event_PressHiddenSwitch ( void )
static

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

Definition at line 513 of file lunpa.c.

Referenced by Event_PressHiddenSwitch().

◆ Lunpa_CopyGatewayCollision()

void Lunpa_CopyGatewayCollision ( s32 sourceColumn,
s32 sourceRow )
inlinestatic

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

Definition at line 538 of file lunpa.c.

Referenced by Event_CastCloak(), Event_GuardsBlockGate(), Lunpa_CopyGatewayCollision(), and Lunpa_ReopenGateway().

◆ Event_GuardsBlockGate()

void Event_GuardsBlockGate ( void )
static

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

Definition at line 546 of file lunpa.c.

Referenced by Event_GuardsBlockGate().

◆ Lunpa_DoNothing()

void UNUSED Lunpa_DoNothing ( void )
static

Definition at line 570 of file lunpa.c.

Referenced by Lunpa_DoNothing().

◆ Event_CastCloak()

void Event_CastCloak ( void )
static

Cloak: the gateway closes behind the guards.

Definition at line 573 of file lunpa.c.

Referenced by Event_CastCloak(), and Scene_Initialize().

◆ Event_GuardsCatchParty()

void Event_GuardsCatchParty ( void )
static

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

Definition at line 580 of file lunpa.c.

Referenced by Event_CloakFades(), and Event_GuardsCatchParty().

◆ Lunpa_ReopenGateway()

void Lunpa_ReopenGateway ( void )
static

Definition at line 639 of file lunpa.c.

Referenced by Event_CloakFades(), and Lunpa_ReopenGateway().

◆ Event_CloakFades()

void Event_CloakFades ( void )
static

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

Definition at line 642 of file lunpa.c.

Referenced by Event_CloakFades().

◆ Lunpa_KickUpLeaderDust()

void Lunpa_KickUpLeaderDust ( void )
static

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

Definition at line 684 of file lunpa.c.

Referenced by Event_GuardsThrowLeaderOut(), and Lunpa_KickUpLeaderDust().

◆ Event_GuardsThrowLeaderOut()

void Event_GuardsThrowLeaderOut ( void )
static

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

Definition at line 701 of file lunpa.c.

Referenced by Event_GuardsThrowLeaderOut(), and Scene_Initialize().

◆ Event_LeaderSneaksOut()

void Event_LeaderSneaksOut ( void )
static

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

Definition at line 780 of file lunpa.c.

Referenced by Event_LeaderSneaksOut(), and 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.

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

Definition at line 810 of file lunpa.c.

Variable Documentation

◆ gShortEffectScript

s32 gShortEffectScript[]
Initial value:
= {
}
#define SCRIPT_DELETE
#define SCRIPT_REPEAT(count, label)
#define SCRIPT_SET_POSITION(x, y, z)
#define SCRIPT_WAIT(frames)

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

Definition at line 41 of file lunpa.c.

◆ gMediumEffectScript

s32 gMediumEffectScript[]
Initial value:

Definition at line 47 of file lunpa.c.

◆ gLongEffectScript

s32 gLongEffectScript[]
Initial value:

Definition at line 53 of file lunpa.c.

◆ gEffectScripts

const s32* gEffectScripts[]
Initial value:
= {
}
s32 gMediumEffectScript[]
Definition lunpa.c:47
s32 gShortEffectScript[]
How long an effect of common/effect_spawn.h lasts: 22, 44 or 126 frames, then it moves away and is fr...
Definition lunpa.c:41
s32 gLongEffectScript[]
Definition lunpa.c:53

Definition at line 59 of file lunpa.c.

◆ gLunpaEntrances

struct SceneEntrance gLunpaEntrances[]
Initial value:
= {
}
@ SCENE_TABLE_END
Definition field_scene.h:43
@ FACING_SOUTH
Definition field_scene.h:28
#define LUNPA_ENTRANCE(entrance, x, z, facing)
Definition lunpa.c:867
@ LUNPA_ENTRANCE_FROM_ITEM_SHOP
Definition lunpa.h:22
@ LUNPA_ENTRANCE_FROM_JAIL
Definition lunpa.h:26
@ LUNPA_ENTRANCE_FROM_THIRD_HOME
Definition lunpa.h:20
@ LUNPA_ENTRANCE_FROM_FIRST_HOME
Definition lunpa.h:18
@ LUNPA_ENTRANCE_FROM_GATE
Definition lunpa.h:16
@ LUNPA_ENTRANCE_FROM_CAVE
Definition lunpa.h:17
@ LUNPA_ENTRANCE_FROM_TEMPLE
Definition lunpa.h:24
@ LUNPA_ENTRANCE_FROM_INN
Definition lunpa.h:23
@ LUNPA_ENTRANCE_FROM_SECOND_HOME
Definition lunpa.h:19
@ LUNPA_ENTRANCE_FROM_WORLD_MAP
Definition lunpa.h:15
@ LUNPA_ENTRANCE_FROM_EIGHTH_ROOM
Definition lunpa.h:25
@ LUNPA_ENTRANCE_FROM_ARMS_SHOP
Definition lunpa.h:21

Definition at line 872 of file lunpa.c.

Referenced by Scene_GetEntrances().

◆ gGateEntrances

struct SceneEntrance gGateEntrances[]
Initial value:
= {
GATE_ENTRANCE(0, 152, 328, FACING_NORTH),
}
@ FACING_EAST
Definition field_scene.h:26
#define GATE_ENTRANCE(entrance, x, z, facing)
Definition lunpa.c:869
@ GATE_ENTRANCE_THROWN_OUT
Definition lunpa.h:48
@ GATE_ENTRANCE_FROM_LUNPA
Definition lunpa.h:46
@ GATE_ENTRANCE_SNEAKING_OUT
Definition lunpa.h:47
@ GATE_ENTRANCE_FROM_FORTRESS
Definition lunpa.h:45

Definition at line 889 of file lunpa.c.

Referenced by Scene_GetEntrances().

◆ gLunpaExits

u32 gLunpaExits[]
Initial value:
= {
}
#define SCENE_EXITS(scene)
Definition field_scene.h:72
@ SCENE_WEST_LUNPA_CAVE
Definition field_scene.h:19
@ SCENE_VAULT_JAIL
Definition field_scene.h:15
@ SCENE_LUNPA
Definition field_scene.h:17
@ SCENE_WORLD_MAP
Definition field_scene.h:13
@ SCENE_LUNPA_FORTRESS_GATE
Definition field_scene.h:20
#define SCENE_EXITS_END
Definition field_scene.h:77
#define ROOM_EXIT(exit)
Definition lunpa.c:898
@ LUNPA_EXIT_TO_ARMS_SHOP
Definition lunpa.h:36
@ LUNPA_EXIT_TO_FIRST_HOME
Definition lunpa.h:33
@ LUNPA_EXIT_TO_THIRD_HOME
Definition lunpa.h:35
@ LUNPA_EXIT_TO_JAIL
Definition lunpa.h:41
@ LUNPA_EXIT_TO_EIGHTH_ROOM
Definition lunpa.h:40
@ LUNPA_EXIT_TO_ITEM_SHOP
Definition lunpa.h:37
@ LUNPA_EXIT_TO_SECOND_HOME
Definition lunpa.h:34
@ LUNPA_EXIT_TO_TEMPLE
Definition lunpa.h:39
@ LUNPA_EXIT_TO_INN
Definition lunpa.h:38
@ JAIL_ENTRANCE_FROM_LUNPA
Definition lunpa.h:61
@ WORLD_MAP_ENTRANCE_FROM_LUNPA
Definition lunpa.h:58
@ CAVE_ENTRANCE_FROM_LUNPA
Definition lunpa.h:59

Definition at line 901 of file lunpa.c.

Referenced by Scene_GetExits().

◆ gGateExits

u32 gGateExits[]

◆ gLunpaPlacements

struct ScenePlacement gLunpaPlacements[]
Initial value:
= {
PIXELS(368), 0, PIXELS(256), FACING_WEST, TALK_FACE_PARTY, 0 },
PIXELS(152), 0, PIXELS(184), FACING_SOUTH, TALK_FACE_PARTY, 0 },
}
@ FACING_STEP
Definition field_scene.h:36
@ TALK_KEEP_FACING
@ TALK_FACE_PARTY
@ TALK_FACE_PARTY_AND_BACK
@ ACTOR_WANDER
@ ACTOR_STAND
@ FACING_SOUTHEAST
Definition field_scene.h:27
@ FACING_NORTHWEST
Definition field_scene.h:31
@ FACING_WEST
Definition field_scene.h:30
#define PIXELS(value)
@ SPRITE_TOWNSPERSON_B
Definition lunpa.h:129
@ SPRITE_TOWNSPERSON_C
Definition lunpa.h:130
@ SPRITE_TOWNSPERSON_D
Definition lunpa.h:132
@ SPRITE_GUARD
Definition lunpa.h:136
@ SPRITE_TOWNSPERSON_J
Definition lunpa.h:135
@ SPRITE_PUDDLE
Definition lunpa.h:137
@ SPRITE_TOWNSPERSON_G
Definition lunpa.h:128
@ SPRITE_TOWNSPERSON_H
Definition lunpa.h:131
@ SPRITE_GLINT
Definition lunpa.h:138
@ SPRITE_TOWNSPERSON_I
Definition lunpa.h:133
@ SPRITE_ITEM_ICON
Definition lunpa.h:127
@ SPRITE_TOWNSPERSON_E
Definition lunpa.h:134
@ ACTOR_FLOAT
Definition lunpa.h:141

Definition at line 930 of file lunpa.c.

Referenced by Scene_GetPlacements().

◆ gGatePlacements

struct ScenePlacement gGatePlacements[]

◆ gLunpaSealedEvents

struct SceneEvent gLunpaSealedEvents[]
Initial value:
= {
TALK(ACTOR_VILLAGER_B, MSGNO(MsgLunpaVillageVillagerBSealed)),
TALK(ACTOR_VILLAGER_D, MSGNO(MsgLunpaVillageVillagerDSealed)),
TALK(ACTOR_VILLAGER_E, MSGNO(MsgLunpaVillageVillagerESealed)),
TALK(ACTOR_VILLAGER_F, MSGNO(MsgLunpaVillageVillagerFSealed)),
TALK(ACTOR_VILLAGER_H, MSGNO(MsgLunpaVillageVillagerHSealed)),
MIND_READ(ACTOR_VILLAGER_A, MSGNO(MsgLunpaVillageVillagerASealedThoughts)),
MIND_READ(ACTOR_VILLAGER_B, MSGNO(MsgLunpaVillageVillagerBSealedThoughts)),
MIND_READ(ACTOR_VILLAGER_C, MSGNO(MsgLunpaVillageVillagerCSealedThoughts)),
MIND_READ(ACTOR_VILLAGER_D, MSGNO(MsgLunpaVillageVillagerDSealedThoughts)),
MIND_READ(ACTOR_VILLAGER_E, MSGNO(MsgLunpaVillageVillagerESealedThoughts)),
MIND_READ(ACTOR_VILLAGER_F, MSGNO(MsgLunpaVillageVillagerFSealedThoughts)),
MIND_READ(ACTOR_VILLAGER_G, MSGNO(MsgLunpaVillageVillagerGSealedThoughts)),
MIND_READ(ACTOR_VILLAGER_H, MSGNO(MsgLunpaVillageVillagerHSealedThoughts)),
MIND_READ(ACTOR_WEST_GUARD, MSGNO(MsgLunpaVillageWestGuardSealedThoughts)),
}
static void Event_TalkToWestGuard(void)
The west guard of the town asks whether the party wants in.
Definition lunpa.c:249
static void Event_AskAboutLengthOfStay(void)
Asks how long the party has been in Lunpa.
Definition lunpa.c:298
#define MIND_READ(actor, value)
Definition lunpa.c:971
#define LUNPA_ROADS_AND_DOORS
Definition lunpa.c:978
static void Event_AskAboutHammetsKidnapping(void)
Asks whether Dodonpa kidnapped Hammet for ransom.
Definition lunpa.c:306
static void Event_ReadEastGuardsThoughts(void)
Definition lunpa.c:279
#define LUNPA_SECRETS
Definition lunpa.c:991
static void Event_TalkToEastGuard(void)
The east guard: wants authorization, or once the guards suspect Kalay, asks twice whether the party c...
Definition lunpa.c:259
#define TALK(actor, value)
Definition lunpa.c:970
static void Event_AskAboutSeeingDonpa(void)
Asks whether the party wants to see Donpa.
Definition lunpa.c:314
@ ACTOR_VILLAGER_H
Definition lunpa.h:111
@ ACTOR_VILLAGER_G
Definition lunpa.h:110
@ ACTOR_VILLAGER_E
Definition lunpa.h:108
@ ACTOR_VILLAGER_F
Definition lunpa.h:109
@ ACTOR_EAST_GUARD
Definition lunpa.h:113
@ ACTOR_WEST_GUARD
Definition lunpa.h:112
@ ACTOR_VILLAGER_D
Definition lunpa.h:107
@ ACTOR_VILLAGER_B
Definition lunpa.h:105
@ ACTOR_VILLAGER_C
Definition lunpa.h:106
@ ACTOR_VILLAGER_A
Definition lunpa.h:104

Definition at line 1014 of file lunpa.c.

Referenced by Scene_GetEvents().

◆ gLunpaReopenedEvents

struct SceneEvent gLunpaReopenedEvents[]

Definition at line 1039 of file lunpa.c.

Referenced by Scene_GetEvents().

◆ gGateEvents

struct SceneEvent gGateEvents[]
Initial value:
= {
}
@ ABILITY_CLOAK
Definition ability_ids.h:21
@ EVENT_TOUCH
@ EVENT_RAISED
#define FLAG_SCENE_TEMP_40
Definition flags.h:777
#define FLAG_SCENE_TEMP_42
Definition flags.h:779
static void Event_TalkToLeftGuard(void)
The gate's left guard: hears someone while the party is cloaked; after trade reopens,...
Definition lunpa.c:340
static void Event_GuardsBlockGate(void)
Coming close uncloaked, the guards step in front of the fortress door and the gateway closes.
Definition lunpa.c:546
static void Event_TalkToRightGuard(void)
The gate's right guard.
Definition lunpa.c:361
static void Event_EnterFortress(void)
Through the fortress door, out of the gate's top.
Definition lunpa.c:485
static void Event_GuardsCatchParty(void)
Raised when the guards spot the party: they recognize the man with them, and march the party back dow...
Definition lunpa.c:580
static void Event_CastCloak(void)
Cloak: the gateway closes behind the guards.
Definition lunpa.c:573
static void Event_ReadRightGuardsThoughts(void)
Definition lunpa.c:401
static void Event_CloakFades(void)
Cloak fades: if the leader is still among the guards, they are caught.
Definition lunpa.c:642
static void Event_GaretTurnsLeaderBack(void)
Garet reminds the leader they cannot go into the fortress, and the leader steps back.
Definition lunpa.c:423
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...
Definition lunpa.c:375
@ CLOAK_FADED
Definition lunpa.h:143
@ CLOAK_CAST
Definition lunpa.h:143
@ ACTOR_RIGHT_GUARD
Definition lunpa.h:122
@ ACTOR_LEFT_GUARD
Definition lunpa.h:121
@ TRIGGER_PARTY_SPOTTED
Definition lunpa.h:94
@ TRIGGER_FORTRESS_APPROACH
Definition lunpa.h:93
@ TRIGGER_THIRD_ROAD
Definition lunpa.h:91
@ TRIGGER_LUNPA_ROAD
Definition lunpa.h:90
@ TRIGGER_FORTRESS_DOOR
Definition lunpa.h:89
@ TRIGGER_GUARDED_GROUND
Definition lunpa.h:92
@ GATE_EXIT_THIRD
Definition lunpa.h:54

Definition at line 1074 of file lunpa.c.

Referenced by Scene_GetEvents().

◆ gLunpaDoorSteps

u16 gLunpaDoorSteps[DOOR_COUNT][11]
Initial value:
= {
{MAP_CELL_STEP(38, 35, 2, 2, 5), MAP_CELL_STEP(40, 35, 2, 2, 5),
{MAP_CELL_STEP(42, 35, 2, 2, 5), MAP_CELL_STEP(44, 35, 2, 2, 5),
{MAP_CELL_STEP(46, 33, 2, 2, 5), MAP_CELL_STEP(48, 33, 2, 2, 5),
{MAP_CELL_STEP(46, 35, 2, 2, 5), MAP_CELL_STEP(48, 35, 2, 2, 5),
{MAP_CELL_STEP(50, 33, 2, 2, 5), MAP_CELL_STEP(52, 33, 2, 2, 5),
{MAP_CELL_STEP(50, 35, 2, 2, 5), MAP_CELL_STEP(52, 35, 2, 2, 5),
{MAP_CELL_STEP(42, 33, 4, 2, 5), MAP_CELL_STEP(38, 33, 4, 2, 5),
{MAP_CELL_STEP(54, 33, 2, 2, 5), MAP_CELL_STEP(56, 33, 2, 2, 5),
}
#define MAP_CELL_STEP(srcX, srcY, width, height, frames)
Definition field_event.h:59
#define MAP_CELL_STEPS_END
Definition field_event.h:61

Definition at line 1095 of file lunpa.c.

◆ gLunpaDoors

struct LunpaDoor gLunpaDoors[]
Initial value:
= {
{gLunpaDoorSteps[0], 46, 9}, {gLunpaDoorSteps[1], 52, 12},
{gLunpaDoorSteps[2], 52, 18}, {gLunpaDoorSteps[3], 45, 20},
{gLunpaDoorSteps[4], 51, 5}, {gLunpaDoorSteps[5], 37, 9},
{gLunpaDoorSteps[6], 33, 6}, {gLunpaDoorSteps[7], 44, 17},
}
u16 gLunpaDoorSteps[DOOR_COUNT][11]
Definition lunpa.c:1095

Definition at line 1114 of file lunpa.c.

Referenced by Event_EnterDoor().

◆ gLunpaUnusedWord

u32 gLunpaUnusedWord = 0

Definition at line 1121 of file lunpa.c.