Skip to Content
The Alchemy Project

src/scene/lunpa.c

Lunpa, the town the righteous thief Lunpa founded, and the Lunpa Fortress Gates above it. More…

Macros

NameDescription
#defineROOM_ENTRANCE (exit) ((exit) - LUNPA_FIRST_HOME + ROOM_ENTRANCE_FIRST)The RockRooms entrance a door's exit leads to.
#defineFLAG_LUNPA_PUDDLE_FROZEN FLAG_SCENE_TEMP(0x00)Frost has frozen the hidden puddle into an ice pillar to stand on.
#defineFLAG_LUNPA_SECRETS_HIDDEN FLAG_SCENE_TEMP(0x01)The town's secrets are hidden: Reveal is not shining.
#defineFLAG_LUNPA_HIDDEN_PASSAGE_OPEN FLAG_SCENE_TEMP(0x02)The hidden switch has opened the passage to the hidden room.
#defineFLAG_LUNPA_FORTRESS_GATES_GUARDS_AT_DOOR FLAG_SCENE_TEMP(0x40)The guards have stepped in front of the fortress door.
#defineFLAG_LUNPA_FORTRESS_GATES_CLOAK_CAST FLAG_SCENE_TEMP(0x41)Cloak has been cast at the gates and has not yet faded.
#defineFLAG_LUNPA_FORTRESS_GATES_ENTERING_FORTRESS FLAG_SCENE_TEMP(0x42)The leader is going through the fortress door.
#defineFLAG_LUNPA_FORTRESS_GATES_GARET_WARNING FLAG_SCENE_TEMP(0x43)Garet's warning against going back up to the fortress is under way.
#defineFLAG_LUNPA_FORTRESS_GATES_GUARDS_CAUGHT_PARTY FLAG_SCENE_TEMP(0x44)The guards have caught the party and are marching it down the steps.
#defineLUNPA_ENTRANCE (entrance, x, z, facing)An entrance of the town, with its camera free, and of the Lunpa Fortress Gates, its camera kept in their bounds.
#defineGATE_ENTRANCE (entrance, x, z, facing)
#defineROOM_EXIT (exit) SCENE_EXIT((exit), RockRooms, ROOM_ENTRANCE(exit))A door's exit into its room of RockRooms.
#defineTALK (actorId, value) {CUE_TALK, (actorId), CONDITION_ALWAYS, (va …A cue for talking to an actor, for Mind Read on it, and for walking north into a door.
#defineMIND_READ (actorId, value)
#defineDOOR (cue)
#defineLUNPA_ROADS_AND_DOORSThe roads out of town and the doors, which every one of the town's cue tables holds.
#defineLUNPA_SECRETS_AND_SEARCHESThe hidden puddle, what Reveal shows, the grave, barrel and well to search and the Nut to Catch, which the town's cue tables share.

Enumerations

NameDescription
enumanonymous enum { GATE_EXIT_THIRD }Unused: the exit of a third road out of the gates (METATILE_BEHAVIOR_LUNPA_FORTRESS_GATES_THIRD_ROAD), which no metatile of the gates' map has.
enumanonymous enum { ROOM_ENTRANCE_FIRST }The first of the rooms in RockRooms that Lunpa's doors lead into.
enumLUNPA_METATILE_BEHAVIOR { METATILE_BEHAVIOR_LUNPA_WORLD_MAP_ROAD, METATILE_BEHAVIOR_LU … }The metatile behaviors Lunpa's cues answer.
enumLUNPA_FORTRESS_GATES_METATILE_BEHAVIOR { METATILE_BEHAVIOR_LUNPA_FORTRESS_GATES_FORTRESS_DOOR, METATI … }The metatile behaviors the Lunpa Fortress Gates' cues answer.
enumLUNPA_FORTRESS_GATES_RAISED_CUE { RAISED_PARTY_SPOTTED }The script the gates' guards raise on spotting the uncloaked party.
enumanonymous enum { DOOR_COUNT, DOOR_TEMPLE }Lunpa's doors that open as the leader walks in (LunpaDoors), counted from the first home's; at the temple's he goes through without first stepping into the doorway.
enumLUNPA_ACTOR_ID { ACTOR_HIDDEN_PUDDLE, ACTOR_MAN_ASKING_HOW_LONG_IN_LUNPA, ACT … }Lunpa's placed actors, numbered in the order of LunpaActorPlacements from ACTOR_FIRST_PLACED.
enumGATE_ACTOR_ID { ACTOR_LEFT_GUARD, ACTOR_RIGHT_GUARD }The Lunpa Fortress Gates' placed actors, numbered in the order of LunpaFortressGatesActorPlacements from ACTOR_FIRST_PLACED.
enumanonymous enum { SPARKLE_SCALE_X, SPARKLE_SCALE_Y }How the switch's sparkle is stretched while Reveal shows it.
enumanonymous enum { GATE_RETREAT_ENTRANCE }Where Retreat at the gates sends the party (MAIN_ROUTINE_STATE.retreatEntrance).
enumCATCH_MESSAGE { CATCH_LEFT_GUARD_CHALLENGES, CATCH_RIGHT_GUARD_WONDERS, CATC … }The gate guards' lines when they catch the party uncloaked, in order.
enumRECOGNITION_MESSAGE { RECOGNITION_SEEN_THAT_MAN, RECOGNITION_IMPOSSIBLE }The left guard's two lines once he has seen Hammet with the party.
enumanonymous enum { ANIM_SPRAWLED }The leader lying where the guards threw him down the steps.
enumanonymous enum { PILLAR_TOP_HEIGHT, METATILE_SIZE }How high the ice pillar's top is, and a metatile: 16 pixels each.
enumanonymous enum { TREASURE_SPOT_PSYNERGY_STONE }The treasure spot of the town's Psynergy Stone.
enumanonymous enum { PALETTE_TRANSLUCENT_EFFECT, PALETTE_EFFECT }Unused: nothing in the scene reads them.

Functions

NameDescription
static voidscLunpaWatchForUncloakedParty (void)Every tick at the Lunpa Fortress Gates: an uncloaked Isaac in the gap of the upper palisade is spotted by the guards.
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)Both scenes share one exit table.
const ACTOR_PLACE *scGetActorPlacements (void)The townsfolk of Lunpa, or the guards of the Lunpa Fortress Gates.
static voidscLunpaCatchFloatingNut (void)Catch on the Nut in the tree just west of Lunpa's shut south gate, outside the palisade, brings it down to Isaac.
static inline voidscLunpaApplyFrozenPuddleCollision (void)Makes the frozen puddle's metatile, (14, 4), and the metatiles either side of it into the ice pillar's top and sides, from copies kept at (17, 4) and (15, 3).
static voidscLunpaFreezeHiddenPuddle (void)Frost on the blue puddle that Reveal shows between the two log pillars at the top of Lunpa (metatile (14, 4)) freezes it into an ice pillar to stand on.
static voidscLunpaUpdateIcePillarDrawOrder (void)Every tick while Reveal shows the puddle: once Isaac is up on the ice pillar, it is drawn under him.
static inline voidscLunpaDrawHiddenPassagePicture (Sint32 srcColumn, Sint32 srcRow)Draws one picture of the hidden passage's cave mouth in the cliff at the west edge of town, from a set of copies kept at (srcColumn, srcRow).
static voidscLunpaRevealSecrets (void)Casting Reveal in Lunpa turns the town grey and shows its secrets: the blue puddle between the log pillars at the top of town, the sparkle of the hidden switch on the west cliff (or, once it has been pressed, the cave mouth it opened), and the Psynergy Stone's spot at metatile (7, 16).
static voidscLunpaHideSecrets (void)As Reveal ends, and on every arrival in Lunpa, the puddle, the sparkle, the cave mouth and the Psynergy Stone's spot are hidden again, and a frozen puddle thaws.
static voidscLunpaSearchWell (void)Searching the well in the middle of Lunpa (metatiles (16, 13) to (17, 14)), Isaac peers in and hears frogs inside.
const CUE *scGetCues (void)The cues of the Lunpa Fortress Gates, or the town's before and after Donpa's judgment.
static voidscLunpaTalkToWestGuard (void)Before Donpa's judgment, the guard on the left of Lunpa's shut south gate winces and asks whether the party wants to enter Lunpa, and sends them back where they came from whatever they answer.
static voidscLunpaTalkToEastGuard (void)Before Donpa's judgment, the guard on the right of Lunpa's shut south gate says no one may enter without Dodonpa's authorization.
static voidscLunpaReadEastGuardsThoughts (void)Mind Read on the guard on the right of Lunpa's south gate.
static voidscLunpaAskAboutLengthOfStay (void)Before Donpa's judgment, a young man with brown hair near the inn asks whether the party has been in Lunpa long, and takes a No to mean they are new members of Dodonpa's gang.
static voidscLunpaAskAboutHammetsKidnapping (void)Before Donpa's judgment, a stout man in Lunpa asks whether it is true that Dodonpa kidnapped Hammet and extorted ransom for him.
static voidscLunpaAskAboutSeeingDonpa (void)Before Donpa's judgment, a small boy at the top of Lunpa asks whether the party wants to see Donpa: he is in the fortress, or, on a No, impossible to see now.
static voidscLunpaComplainAboutCold (void)After Donpa's judgment, a woman with fair hair in Lunpa shivers and complains that it has gotten colder.
static voidscLunpaAskAboutFortressCommotion (void)After Donpa's judgment, a woman in a green dress in Lunpa offers to tell what caused the commotion at the fortress: someone snuck in to save Hammet and ran away.
static voidscLunpaTalkToLeftGuard (void)Talking to the left guard at the Lunpa Fortress Gates under Cloak, he could swear he just heard someone.
static voidscLunpaTalkToRightGuard (void)Talking to the right guard at the Lunpa Fortress Gates, he boasts that not even a mouse could get in while he is on watch.
static voidscLunpaReadLeftGuardsThoughts (void)Mind Read on the left guard at the Lunpa Fortress Gates: he thinks keeping Hammet to squeeze money out of Kalay is genius.
static voidscLunpaReadRightGuardsThoughts (void)Mind Read on the right guard at the Lunpa Fortress Gates: you would have to be a shadow to sneak past him.
static voidscLunpaWatchForFortressApproach (void)Every tick at the Lunpa Fortress Gates between Donpa's judgment and the meeting with Bunza: Isaac stepping into the upper palisade's gap (map row 10) raises Garet's warning, scLunpaGaretTurnsIsaacBack.
static voidscLunpaGaretTurnsIsaacBack (void)After Donpa's judgment, walking up into the gap in the upper palisade at the Lunpa Fortress Gates, Garet reminds Isaac they can't go in there, and Isaac winces and steps back.
static voidscLunpaEnterDoor (void)Walking north into one of Lunpa's doors, it swings open and Isaac goes through into the home, shop, inn, temple or crate room behind it.
static voidscLunpaEnterHiddenPassage (void)Walking north into the cave mouth the hidden switch opened in Lunpa's west cliff, metatile (2, 19), takes Isaac into Lunpa's hidden room.
static voidscLunpaEnterFortress (void)Walking up to the golden door in the cliff at the top of the Lunpa Fortress Gates, metatiles (9, 5) and (10, 5), it opens and Isaac goes into Lunpa Fortress.
static voidscLunpaTryJumpForward (void)Unused: jumps Isaac forward.
static voidscLunpaPlayRevealSound (void)Unused: plays the treasure jingle while Reveal is shining.
static voidscLunpaPressHiddenSwitch (void)Searching the sparkle Reveal shows on Lunpa's west cliff, from metatile (3, 18) below it, makes the rock crumble away into a dark cave mouth, the passage to Lunpa's hidden room.
static inline voidscLunpaCopyGatewayCollision (Sint32 srcColumn, Sint32 srcRow)Copies the metatile at (srcColumn, srcRow) over the three metatiles (7, 11) to (9, 11) at the Lunpa Fortress Gates, just below the west half of the upper palisade.
static voidscLunpaGuardsBlockGate (void)
static voidscLunpaNoOperation (void)Unused: does nothing, and nothing calls it.
static voidscLunpaCastCloak (void)Casting Cloak at the Lunpa Fortress Gates rewrites the three metatiles (7, 11) to (9, 11) from the one at (6, 11); scLunpaCloakFades puts them back.
static voidscLunpaGuardsCatchParty (void)When the guards at the Lunpa Fortress Gates spot the party, they turn and shout who are you, wonder how anyone got past them, and march Isaac back out through the gap in the lower palisade.
static voidscLunpaReopenGateway (void)Puts back the three metatiles (7, 11) to (9, 11) that Cloak and the guards at the door rewrite, from the metatile at (7, 12).
static voidscLunpaCloakFades (void)As Cloak fades at the Lunpa Fortress Gates, a party still in the yard between the palisades is caught by the guards.
static voidscLunpaKickUpLeaderDust (void)Every 16 ticks while Isaac is dragged and thrown: a puff of dust at his feet.
static voidscLunpaGuardsThrowIsaacOut (void)Caught inside Lunpa Fortress, Isaac is dragged out of the door by the two guards, struggling, down through both palisades, and thrown sprawling onto the slope below.
static voidscLunpaLeaderSneaksOut (void)After the rescue, Isaac comes out of the fortress door, casts Cloak in the upper palisade's gap and slips round behind the guards, west along the palisade and down the west side of the slope.
Sint32scInit (void)Sets up Lunpa (secrets hidden, the Nut in its tree) or the Lunpa Fortress Gates (the throw-out or the sneak-out, Garet's watch, the guards' watch and the fortress started over).

Variables

NameDescription
extern SCENE_ENTRANCELunpaEntrances []
extern SCENE_ENTRANCELunpaFortressGatesEntrances []
extern Uint32LunpaExits []
extern Uint32LunpaFortressGatesExits []
extern ACTOR_PLACELunpaActorPlacements []
extern ACTOR_PLACELunpaFortressGatesActorPlacements []
extern CUELunpaSealedCues []
extern CUELunpaReopenedCues []
extern CUELunpaFortressGatesCues []
extern MAP_EDITLunpaDoors []Each door's opening animation and the map grid metatile it plays at, by its step cue from METATILE_BEHAVIOR_LUNPA_FIRST_HOME_DOOR.
const Sint32 *FieldEffectDurationScripts []The resident copy of the scripts EFFECT_SCRIPT_MASK picks, by enum EFFECT_DURATION.
Uint16LunpaDoorSteps [DOOR_COUNT][11]Each door's opening, as a map grid animation.
Uint32LunpaUnusedWordUnused: a zero word nothing reads.

Description

Lunpa, the town the righteous thief Lunpa founded, and the Lunpa Fortress Gates above it. While Dodonpa, Donpa's son, holds Hammet in Lunpa Fortress, his men keep the town sealed: two guards stand outside the shut gate in the log palisade at the south end, where the road from the World Map ends, and turn the party away. The way in is through West Lunpa Cave, whose gate Frost opens; it comes out at the cave mouth in the town's north-west cliff (metatile (7, 4)).

Two areas share this overlay, each a scene of its own:

  • Lunpa (SceneIdLunpa): the town. Doors lead into three homes, the weapon and armor shop, the item shop, the inn, the temple and the crate room (RockRooms, rock_rooms.c). The road out of the top of the town (metatiles (13, 0) to (16, 0)) climbs to the Lunpa Fortress Gates.
  • Lunpa Fortress Gates (SceneIdLunpaFortressGates): the slope up to the golden fortress door in the cliff. Two log palisades cross it, each with a gap in the middle, and two guards stand in the yard between them, just below the upper gap. The party slips past them under Cloak.

The getters choose by MainRoutineStateWork.next. The town's cues also choose by FLAG_DODONPA_LOCKED_UP, which Donpa's judgment in the fortress sets. Before it the townspeople live under Dodonpa's men (LunpaSealedCues). After it they talk of the intruders in the fortress (LunpaReopenedCues). Both tables share the roads and doors (LUNPA_ROADS_AND_DOORS), and Reveal's secrets and the spots to search (LUNPA_SECRETS_AND_SEARCHES).

Reveal turns the town grey and shows three secrets (scLunpaRevealSecrets): a blue puddle between the two log pillars below the road to the gates, which Frost freezes into an ice pillar; a sparkle on the cliff at the west edge of town (metatile (3, 16)), the switch that opens the passage to Lunpa's hidden room, searched from metatile (3, 18) below it; and a Psynergy Stone, found by searching metatile (7, 16), south of the inn. Every entry and the end of Reveal hide them again (scLunpaHideSecrets). Searching the sparkle opens a dark cave mouth in the cliff beside it, and the passage can be walked into only while Reveal shows it (scLunpaEnterHiddenPassage). The room beyond (StoneRooms) holds six chests.

At the gates, walking uncloaked into the yard before the guards (METATILE_BEHAVIOR_LUNPA_FORTRESS_GATES_GUARDED_GROUND) makes them step into the upper gap and warn the party off. An uncloaked leader in that gap, or one still in the yard as Cloak fades, is caught and marched back down through the lower palisade (scLunpaGuardsCatchParty).

A party caught inside the fortress is thrown out by the guards and down the slope (scLunpaGuardsThrowIsaacOut). After the rescue it comes out of the fortress door and Isaac sneaks past the guards under Cloak (scLunpaLeaderSneaksOut).

Every arrival at the gates clears the fortress's puzzle and beaten-guard flags, so the fortress starts over.

Between Donpa's judgment and the meeting with Bunza outside West Lunpa Cave (FLAG_LUNPA_CAVE_REUNION_SEEN), Garet stops Isaac from going back up through the upper gap (scLunpaGaretTurnsIsaacBack).

Macros in detail

ROOM_ENTRANCE

#define ROOM_ENTRANCE(exit) ((exit) - LUNPA_FIRST_HOME + ROOM_ENTRANCE_FIRST)

The RockRooms entrance a door's exit leads to.

Definition at line 96 of file lunpa.c.

FLAG_LUNPA_PUDDLE_FROZEN

#define FLAG_LUNPA_PUDDLE_FROZEN FLAG_SCENE_TEMP(0x00)

Frost has frozen the hidden puddle into an ice pillar to stand on.

Referenced by scLunpaFreezeHiddenPuddle(), scLunpaHideSecrets() and scLunpaRevealSecrets().

Definition at line 264 of file lunpa.c.

FLAG_LUNPA_SECRETS_HIDDEN

#define FLAG_LUNPA_SECRETS_HIDDEN FLAG_SCENE_TEMP(0x01)

The town's secrets are hidden: Reveal is not shining.

Referenced by scInit(), scLunpaEnterHiddenPassage(), scLunpaHideSecrets(), scLunpaPlayRevealSound(), scLunpaPressHiddenSwitch() and scLunpaRevealSecrets().

Definition at line 266 of file lunpa.c.

FLAG_LUNPA_HIDDEN_PASSAGE_OPEN

#define FLAG_LUNPA_HIDDEN_PASSAGE_OPEN FLAG_SCENE_TEMP(0x02)

The hidden switch has opened the passage to the hidden room.

Referenced by scLunpaEnterHiddenPassage(), scLunpaPressHiddenSwitch() and scLunpaRevealSecrets().

Definition at line 268 of file lunpa.c.

FLAG_LUNPA_FORTRESS_GATES_GUARDS_AT_DOOR

#define FLAG_LUNPA_FORTRESS_GATES_GUARDS_AT_DOOR FLAG_SCENE_TEMP(0x40)

The guards have stepped in front of the fortress door.

Referenced by LunpaFortressGatesCues, scLunpaCloakFades() and scLunpaGuardsBlockGate().

Definition at line 270 of file lunpa.c.

FLAG_LUNPA_FORTRESS_GATES_CLOAK_CAST

#define FLAG_LUNPA_FORTRESS_GATES_CLOAK_CAST FLAG_SCENE_TEMP(0x41)

Cloak has been cast at the gates and has not yet faded.

Referenced by scLunpaCastCloak() and scLunpaCloakFades().

Definition at line 272 of file lunpa.c.

FLAG_LUNPA_FORTRESS_GATES_ENTERING_FORTRESS

#define FLAG_LUNPA_FORTRESS_GATES_ENTERING_FORTRESS FLAG_SCENE_TEMP(0x42)

The leader is going through the fortress door.

Referenced by LunpaFortressGatesCues and scLunpaEnterFortress().

Definition at line 274 of file lunpa.c.

FLAG_LUNPA_FORTRESS_GATES_GARET_WARNING

#define FLAG_LUNPA_FORTRESS_GATES_GARET_WARNING FLAG_SCENE_TEMP(0x43)

Garet's warning against going back up to the fortress is under way.

Referenced by scLunpaGaretTurnsIsaacBack() and scLunpaWatchForFortressApproach().

Definition at line 276 of file lunpa.c.

FLAG_LUNPA_FORTRESS_GATES_GUARDS_CAUGHT_PARTY

#define FLAG_LUNPA_FORTRESS_GATES_GUARDS_CAUGHT_PARTY FLAG_SCENE_TEMP(0x44)

The guards have caught the party and are marching it down the steps.

Referenced by scLunpaCloakFades() and scLunpaGuardsCatchParty().

Definition at line 278 of file lunpa.c.

LUNPA_ENTRANCE

#define LUNPA_ENTRANCE(entrance, x, z, facing)

An entrance of the town, with its camera free, and of the Lunpa Fortress Gates, its camera kept in their bounds.

Referenced by LunpaEntrances.

Definition at line 1353 of file lunpa.c.

GATE_ENTRANCE

#define GATE_ENTRANCE(entrance, x, z, facing)

Referenced by LunpaFortressGatesEntrances.

Definition at line 1355 of file lunpa.c.

ROOM_EXIT

#define ROOM_EXIT(exit) SCENE_EXIT((exit), RockRooms, ROOM_ENTRANCE(exit))

A door's exit into its room of RockRooms.

Referenced by LunpaExits.

Definition at line 1402 of file lunpa.c.

TALK

#define TALK(actorId, value) {CUE_TALK, (actorId), CONDITION_ALWAYS, (value)}

A cue for talking to an actor, for Mind Read on it, and for walking north into a door.

Referenced by LunpaFortressGatesCues, LunpaReopenedCues and LunpaSealedCues.

Definition at line 1476 of file lunpa.c.

MIND_READ

#define MIND_READ(actorId, value)

Referenced by LunpaFortressGatesCues, LunpaReopenedCues and LunpaSealedCues.

Definition at line 1477 of file lunpa.c.

DOOR

#define DOOR(cue)

Definition at line 1479 of file lunpa.c.

LUNPA_ROADS_AND_DOORS

#define LUNPA_ROADS_AND_DOORS

The roads out of town and the doors, which every one of the town's cue tables holds.

Referenced by LunpaReopenedCues and LunpaSealedCues.

Definition at line 1487 of file lunpa.c.

LUNPA_SECRETS_AND_SEARCHES

#define LUNPA_SECRETS_AND_SEARCHES

The hidden puddle, what Reveal shows, the grave, barrel and well to search and the Nut to Catch, which the town's cue tables share.

Referenced by LunpaReopenedCues and LunpaSealedCues.

Definition at line 1505 of file lunpa.c.

Enumerations in detail

anonymous enum

enum { GATE_EXIT_THIRD }

Unused: the exit of a third road out of the gates (METATILE_BEHAVIOR_LUNPA_FORTRESS_GATES_THIRD_ROAD), which no metatile of the gates' map has. LunpaFortressGatesExits has no row for it either: gmTakeExit, reaching the end of the gates' exits, would fall back to the script of their first exit at ENTRANCE_DEFAULT, LunpaFortressGroundFloor's default entrance.

EnumeratorValueDescription
GATE_EXIT_THIRD3

Definition at line 84 of file lunpa.c.

anonymous enum

enum { ROOM_ENTRANCE_FIRST }

The first of the rooms in RockRooms that Lunpa's doors lead into.

EnumeratorValueDescription
ROOM_ENTRANCE_FIRST1

Definition at line 90 of file lunpa.c.

LUNPA_METATILE_BEHAVIOR

enum LUNPA_METATILE_BEHAVIOR

The metatile behaviors Lunpa's cues answer.

EnumeratorValueDescription
METATILE_BEHAVIOR_LUNPA_WORLD_MAP_ROAD1
METATILE_BEHAVIOR_LUNPA_GATE_ROAD
METATILE_BEHAVIOR_LUNPA_CAVE_ROAD
METATILE_BEHAVIOR_LUNPA_FIRST_HOME_DOOR
METATILE_BEHAVIOR_LUNPA_SECOND_HOME_DOOR
METATILE_BEHAVIOR_LUNPA_THIRD_HOME_DOOR
METATILE_BEHAVIOR_LUNPA_ARMS_SHOP_DOOR
METATILE_BEHAVIOR_LUNPA_ITEM_SHOP_DOOR
METATILE_BEHAVIOR_LUNPA_INN_DOOR
METATILE_BEHAVIOR_LUNPA_TEMPLE_DOOR
METATILE_BEHAVIOR_LUNPA_CRATE_ROOM_DOOR
METATILE_BEHAVIOR_LUNPA_HIDDEN_PASSAGE
METATILE_BEHAVIOR_LUNPA_HIDDEN_SWITCH20
METATILE_BEHAVIOR_LUNPA_WELL90
METATILE_BEHAVIOR_LUNPA_GRAVE_SLEEP_BOMB100
METATILE_BEHAVIOR_LUNPA_BARREL_NUT
METATILE_BEHAVIOR_LUNPA_PSYNERGY_STONE

Definition at line 99 of file lunpa.c.

LUNPA_FORTRESS_GATES_METATILE_BEHAVIOR

enum LUNPA_FORTRESS_GATES_METATILE_BEHAVIOR

The metatile behaviors the Lunpa Fortress Gates' cues answer. The gates' map has no metatile of the third road, the fortress approach or the well: the approach is raised by scLunpaWatchForFortressApproach instead, and the other two rows never fire.

EnumeratorValueDescription
METATILE_BEHAVIOR_LUNPA_FORTRESS_GATES_FORTRESS_DOOR1
METATILE_BEHAVIOR_LUNPA_FORTRESS_GATES_LUNPA_ROAD
METATILE_BEHAVIOR_LUNPA_FORTRESS_GATES_THIRD_ROAD
METATILE_BEHAVIOR_LUNPA_FORTRESS_GATES_GUARDED_GROUND10
METATILE_BEHAVIOR_LUNPA_FORTRESS_GATES_FORTRESS_APPROACH20
METATILE_BEHAVIOR_LUNPA_FORTRESS_GATES_WELL90

Definition at line 124 of file lunpa.c.

LUNPA_FORTRESS_GATES_RAISED_CUE

enum LUNPA_FORTRESS_GATES_RAISED_CUE

The script the gates' guards raise on spotting the uncloaked party.

EnumeratorValueDescription
RAISED_PARTY_SPOTTED91

Definition at line 135 of file lunpa.c.

anonymous enum

enum { DOOR_COUNT, DOOR_TEMPLE }

Lunpa's doors that open as the leader walks in (LunpaDoors), counted from the first home's; at the temple's he goes through without first stepping into the doorway.

EnumeratorValueDescription
DOOR_COUNT8
DOOR_TEMPLEMETATILE_BEHAVIOR_LUNPA_TEMPLE_DOOR - METATILE_BEHAVIOR_LUNPA_FIRST_HOME_DOOR

Definition at line 143 of file lunpa.c.

LUNPA_ACTOR_ID

enum LUNPA_ACTOR_ID

Lunpa's placed actors, numbered in the order of LunpaActorPlacements from ACTOR_FIRST_PLACED. The townspeople are named by their sprites and by what they say before Donpa's judgment.

EnumeratorValueDescription
ACTOR_HIDDEN_PUDDLEACTOR_FIRST_PLACEDThe blue puddle Reveal shows and Frost freezes into an ice pillar.
ACTOR_MAN_ASKING_HOW_LONG_IN_LUNPAA man with brown hair
ACTOR_WOMAN_WITH_NO_FREEDOM(SPRITE_YOUNG_MAN_WITH_BROWN_HAIR). A woman with fair hair in a white apron (SPRITE_WOMAN_WITH_FAIR_HAIR).
ACTOR_MAN_ON_HAMMETS_KIDNAPPINGA stout man with brown hair (SPRITE_STOUT_MAN).
ACTOR_WOMAN_SAYING_DONPA_IS_TOO_OLDA woman in a green dress (SPRITE_WOMAN_IN_GREEN_DRESS).
ACTOR_OLD_MAN_ON_LUNPA_AND_DONPAA bent old man with a cane (SPRITE_OLD_MAN_WITH_CANE), who wanders.
ACTOR_OLD_WOMAN_ON_DONPAAn old woman with white hair (SPRITE_OLD_WOMAN).
ACTOR_BOY_ASKING_TO_SEE_DONPAA small boy with fair hair (SPRITE_BOY_WITH_FAIR_HAIR).
ACTOR_GIRL_ON_THE_CHEFS_MEALSA little girl with orange pigtails (SPRITE_GIRL_WITH_PIGTAILS), who wanders.
ACTOR_WEST_GUARDThe two soldiers in spiked helmets (SPRITE_SOLDIER_IN_SPIKED_HELMET); this one keeps the road in from the World Map.
ACTOR_EAST_GUARDWants Dodonpa's authorization.
ACTOR_SWITCH_SPARKLEThe hidden switch's sparkle, shown by Reveal.
ACTOR_FLOATING_NUTThe Nut that floats over the town, for Catch.

Definition at line 153 of file lunpa.c.

GATE_ACTOR_ID

enum GATE_ACTOR_ID

The Lunpa Fortress Gates' placed actors, numbered in the order of LunpaFortressGatesActorPlacements from ACTOR_FIRST_PLACED. Garet's row, the third, takes his own actor, GARET, as every row of a party member's sprite does.

EnumeratorValueDescription
ACTOR_LEFT_GUARDACTOR_FIRST_PLACED
ACTOR_RIGHT_GUARD

Definition at line 191 of file lunpa.c.

anonymous enum

enum { SPARKLE_SCALE_X, SPARKLE_SCALE_Y }

How the switch's sparkle is stretched while Reveal shows it.

EnumeratorValueDescription
SPARKLE_SCALE_XtoFIXED(6) / 5
SPARKLE_SCALE_YtoFIXED(3) / 2

Definition at line 198 of file lunpa.c.

anonymous enum

enum { GATE_RETREAT_ENTRANCE }

Where Retreat at the gates sends the party (MAIN_ROUTINE_STATE.retreatEntrance). The gates are an area of their own, so Retreat leads back into them, and they have no entrance 10: the party lands at their first entrance, at the foot of the slope where the road from town comes in.

EnumeratorValueDescription
GATE_RETREAT_ENTRANCE10

Definition at line 209 of file lunpa.c.

CATCH_MESSAGE

enum CATCH_MESSAGE

The gate guards' lines when they catch the party uncloaked, in order.

EnumeratorValueDescription
CATCH_LEFT_GUARD_CHALLENGES
CATCH_RIGHT_GUARD_WONDERS
CATCH_LEFT_GUARD_REFUSES_ENTRY
CATCH_RIGHT_GUARD_SENDS_PARTY_OFF

Definition at line 215 of file lunpa.c.

RECOGNITION_MESSAGE

enum RECOGNITION_MESSAGE

The left guard's two lines once he has seen Hammet with the party.

EnumeratorValueDescription
RECOGNITION_SEEN_THAT_MAN
RECOGNITION_IMPOSSIBLE

Definition at line 224 of file lunpa.c.

anonymous enum

enum { ANIM_SPRAWLED }

The leader lying where the guards threw him down the steps.

EnumeratorValueDescription
ANIM_SPRAWLED19

Definition at line 231 of file lunpa.c.

anonymous enum

enum { PILLAR_TOP_HEIGHT, METATILE_SIZE }

How high the ice pillar's top is, and a metatile: 16 pixels each.

EnumeratorValueDescription
PILLAR_TOP_HEIGHTtoFIXED(16)
METATILE_SIZEtoFIXED(16)

Definition at line 237 of file lunpa.c.

anonymous enum

enum { TREASURE_SPOT_PSYNERGY_STONE }

The treasure spot of the town's Psynergy Stone.

EnumeratorValueDescription
TREASURE_SPOT_PSYNERGY_STONE102

Definition at line 244 of file lunpa.c.

anonymous enum

enum { PALETTE_TRANSLUCENT_EFFECT, PALETTE_EFFECT }

Unused: nothing in the scene reads them.

EnumeratorValueDescription
PALETTE_TRANSLUCENT_EFFECT14
PALETTE_EFFECT15

Definition at line 254 of file lunpa.c.

Functions in detail

scLunpaWatchForUncloakedParty

static void scLunpaWatchForUncloakedParty(void)

Every tick at the Lunpa Fortress Gates: an uncloaked Isaac in the gap of the upper palisade is spotted by the guards.

References fdActorGet(), MainRoutineStateWork, state and syCloseEvent().

Referenced by scInit(), scLunpaCloakFades() and scLunpaGuardsCatchParty().

Definition at lines 251 and 1121 of file lunpa.c.

scGetEntrances

const SCENE_ENTRANCE *scGetEntrances(void)

References LunpaEntrances, LunpaFortressGatesEntrances, MainRoutineStateWork and Sint32.

Definition at line 288 of file lunpa.c.

scGetExitRegions

const SCENE_EXIT_REGION *scGetExitRegions(void)

Definition at line 303 of file lunpa.c.

scGetExits

const Uint32 *scGetExits(void)

References LunpaExits, LunpaFortressGatesExits, MainRoutineStateWork and Sint32.

Definition at line 308 of file lunpa.c.

scGetActorPlacements

const ACTOR_PLACE *scGetActorPlacements(void)

The townsfolk of Lunpa, or the guards of the Lunpa Fortress Gates.

References LunpaActorPlacements, LunpaFortressGatesActorPlacements, MainRoutineStateWork and Sint32.

Definition at line 324 of file lunpa.c.

scLunpaCatchFloatingNut

static void scLunpaCatchFloatingNut(void)

Catch on the Nut in the tree just west of Lunpa's shut south gate, outside the palisade, brings it down to Isaac.

References scCatchNut().

Definition at line 341 of file lunpa.c.

scLunpaApplyFrozenPuddleCollision

static inline void scLunpaApplyFrozenPuddleCollision(void)

Makes the frozen puddle's metatile, (14, 4), and the metatiles either side of it into the ice pillar's top and sides, from copies kept at (17, 4) and (15, 3).

References fdMapGridCopyMetatileAttributes().

Referenced by scLunpaFreezeHiddenPuddle() and scLunpaRevealSecrets().

Definition at line 349 of file lunpa.c.

scLunpaFreezeHiddenPuddle

static void scLunpaFreezeHiddenPuddle(void)

Frost on the blue puddle that Reveal shows between the two log pillars at the top of Lunpa (metatile (14, 4)) freezes it into an ice pillar to stand on.

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

Definition at line 358 of file lunpa.c.

scLunpaUpdateIcePillarDrawOrder

static void scLunpaUpdateIcePillarDrawOrder(void)

Every tick while Reveal shows the puddle: once Isaac is up on the ice pillar, it is drawn under him.

References fdActorGet().

Referenced by scLunpaHideSecrets() and scLunpaRevealSecrets().

Definition at line 377 of file lunpa.c.

scLunpaDrawHiddenPassagePicture

static inline void scLunpaDrawHiddenPassagePicture(Sint32 srcColumn, Sint32 srcRow)

Draws one picture of the hidden passage's cave mouth in the cliff at the west edge of town, from a set of copies kept at (srcColumn, srcRow). The second and third copies are the same mouth on the map's other layers.

References fdMapGridCopyMetatiles() and Sint32.

Referenced by scLunpaPressHiddenSwitch() and scLunpaRevealSecrets().

Definition at line 394 of file lunpa.c.

scLunpaRevealSecrets

static void scLunpaRevealSecrets(void)

Casting Reveal in Lunpa turns the town grey and shows its secrets: the blue puddle between the log pillars at the top of town, the sparkle of the hidden switch on the west cliff (or, once it has been pressed, the cave mouth it opened), and the Psynergy Stone's spot at metatile (7, 16). Isaac standing on that spot is first walked a step south off it.

References fdActorGet(), fdActorSetSpriteFlags(), fdActorWalkByAndWait(), fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatiles(), fdTreasureSpotSetPos(), gmFlagClear(), gmFlagGet(), scLunpaApplyFrozenPuddleCollision(), scLunpaDrawHiddenPassagePicture(), scLunpaUpdateIcePillarDrawOrder(), Sint32 and sySetTickEvent().

Definition at line 407 of file lunpa.c.

scLunpaHideSecrets

static void scLunpaHideSecrets(void)

As Reveal ends, and on every arrival in Lunpa, the puddle, the sparkle, the cave mouth and the Psynergy Stone's spot are hidden again, and a frozen puddle thaws.

References fdActorGet(), fdActorSetAnimation(), fdActorSetColorMode(), fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatiles(), fdTreasureSpotSetPos(), gmFlagClear(), gmFlagSet(), scLunpaUpdateIcePillarDrawOrder() and syCloseEvent().

Referenced by scInit().

Definition at line 466 of file lunpa.c.

scLunpaSearchWell

static void scLunpaSearchWell(void)

Searching the well in the middle of Lunpa (metatiles (16, 13) to (17, 14)), Isaac peers in and hears frogs inside. The gates' table has a row for a well too, but no metatile there answers it.

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

Referenced by LunpaFortressGatesCues.

Definition at line 495 of file lunpa.c.

scGetCues

const CUE *scGetCues(void)

The cues of the Lunpa Fortress Gates, or the town's before and after Donpa's judgment.

References gmFlagGet(), LunpaFortressGatesCues, LunpaReopenedCues, LunpaSealedCues, MainRoutineStateWork and Sint32.

Definition at line 507 of file lunpa.c.

scLunpaTalkToWestGuard

static void scLunpaTalkToWestGuard(void)

Before Donpa's judgment, the guard on the left of Lunpa's shut south gate winces and asks whether the party wants to enter Lunpa, and sends them back where they came from whatever they answer.

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

Referenced by LunpaSealedCues.

Definition at line 527 of file lunpa.c.

scLunpaTalkToEastGuard

static void scLunpaTalkToEastGuard(void)

Before Donpa's judgment, the guard on the right of Lunpa's shut south gate says no one may enter without Dodonpa's authorization. Once Hammet's caravan has gone north to Lunpa (FLAG_LUNPA_GUARDS_SUSPECT_KALAY), he asks instead whether the party is from Kalay, and then whether they have come to save Hammet, and warns them off by their answers.

References fdScriptAskYesNoWithActorAnimation(), fdScriptEnd(), fdScriptOpenMessage(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart() and gmFlagGet().

Referenced by LunpaSealedCues.

Definition at line 544 of file lunpa.c.

scLunpaReadEastGuardsThoughts

static void scLunpaReadEastGuardsThoughts(void)

Mind Read on the guard on the right of Lunpa's south gate. Before Donpa's judgment he fears Dodonpa will blame the guards for any trouble outsiders cause, or, once Hammet's caravan has come, trusts that the gate in the cave opens only from the inside; after it he thinks the merchant is harmless.

References fdScriptSetMessageId(), fdScriptShowMessage(), gmFlagGet() and Sint32.

Referenced by LunpaReopenedCues and LunpaSealedCues.

Definition at line 577 of file lunpa.c.

scLunpaAskAboutLengthOfStay

static void scLunpaAskAboutLengthOfStay(void)

Before Donpa's judgment, a young man with brown hair near the inn asks whether the party has been in Lunpa long, and takes a No to mean they are new members of Dodonpa's gang.

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

Referenced by LunpaSealedCues.

Definition at line 608 of file lunpa.c.

scLunpaAskAboutHammetsKidnapping

static void scLunpaAskAboutHammetsKidnapping(void)

Before Donpa's judgment, a stout man in Lunpa asks whether it is true that Dodonpa kidnapped Hammet and extorted ransom for him.

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

Referenced by LunpaSealedCues.

Definition at line 621 of file lunpa.c.

scLunpaAskAboutSeeingDonpa

static void scLunpaAskAboutSeeingDonpa(void)

Before Donpa's judgment, a small boy at the top of Lunpa asks whether the party wants to see Donpa: he is in the fortress, or, on a No, impossible to see now.

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

Referenced by LunpaSealedCues.

Definition at line 635 of file lunpa.c.

scLunpaComplainAboutCold

static void scLunpaComplainAboutCold(void)

After Donpa's judgment, a woman with fair hair in Lunpa shivers and complains that it has gotten colder.

References fdActorRunRepeatedMotion(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessage() and fdScriptStart().

Referenced by LunpaReopenedCues.

Definition at line 648 of file lunpa.c.

scLunpaAskAboutFortressCommotion

static void scLunpaAskAboutFortressCommotion(void)

After Donpa's judgment, a woman in a green dress in Lunpa offers to tell what caused the commotion at the fortress: someone snuck in to save Hammet and ran away.

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

Referenced by LunpaReopenedCues.

Definition at line 661 of file lunpa.c.

scLunpaTalkToLeftGuard

static void scLunpaTalkToLeftGuard(void)

Talking to the left guard at the Lunpa Fortress Gates under Cloak, he could swear he just heard someone. Uncloaked, he grumbles that Dodonpa is devious; after Donpa's judgment, until the meeting with Bunza, he thinks he has seen the man with the party before, then decides it is impossible.

References fdActorShowEmote(), fdActorStartRepeatedMotion(), fdScriptSetMessageId(), fdScriptShowMessage(), gmFlagGet(), gmFlagSet(), MainRoutineStateWork and Sint32.

Referenced by LunpaFortressGatesCues.

Definition at line 676 of file lunpa.c.

scLunpaTalkToRightGuard

static void scLunpaTalkToRightGuard(void)

Talking to the right guard at the Lunpa Fortress Gates, he boasts that not even a mouse could get in while he is on watch. Under Cloak he answers his partner that the place is kind of creepy; after Donpa's judgment he wonders how the warriors from Kalay got in.

References fdScriptSetMessageId(), fdScriptShowMessage(), gmFlagGet() and MainRoutineStateWork.

Referenced by LunpaFortressGatesCues.

Definition at line 711 of file lunpa.c.

scLunpaReadLeftGuardsThoughts

static void scLunpaReadLeftGuardsThoughts(void)

Mind Read on the left guard at the Lunpa Fortress Gates: he thinks keeping Hammet to squeeze money out of Kalay is genius. After Donpa's judgment, until the meeting with Bunza, he turns to Isaac sure he has seen that man with him before (later, that the man following them looks like that merchant), then dismisses the thought.

References fdActorFaceActor(), fdActorShowEmote(), fdActorStartRepeatedMotion(), fdPsynergyStopMindReadWave(), fdScriptGetFlag(), fdScriptSetMessageId(), fdScriptShowMessage(), gmFlagGet(), gmFlagSet(), MainRoutineStateWork and Sint32.

Referenced by LunpaFortressGatesCues.

Definition at line 738 of file lunpa.c.

scLunpaReadRightGuardsThoughts

static void scLunpaReadRightGuardsThoughts(void)

Mind Read on the right guard at the Lunpa Fortress Gates: you would have to be a shadow to sneak past him. After Donpa's judgment he can't see how anyone got by them.

References fdScriptSetMessageId(), fdScriptShowMessage() and gmFlagGet().

Referenced by LunpaFortressGatesCues.

Definition at line 782 of file lunpa.c.

scLunpaWatchForFortressApproach

static void scLunpaWatchForFortressApproach(void)

Every tick at the Lunpa Fortress Gates between Donpa's judgment and the meeting with Bunza: Isaac stepping into the upper palisade's gap (map row 10) raises Garet's warning, scLunpaGaretTurnsIsaacBack.

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

Referenced by scInit().

Definition at line 800 of file lunpa.c.

scLunpaGaretTurnsIsaacBack

static void scLunpaGaretTurnsIsaacBack(void)

After Donpa's judgment, walking up into the gap in the upper palisade at the Lunpa Fortress Gates, Garet reminds Isaac they can't go in there, and Isaac winces and steps back.

References fdActorSetAnimation(), fdActorSetDestinationOffset(), fdActorShowEmote(), fdActorWaitForMoveById(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart() and gmFlagClear().

Referenced by LunpaFortressGatesCues.

Definition at line 816 of file lunpa.c.

scLunpaEnterDoor

static void scLunpaEnterDoor(void)

Walking north into one of Lunpa's doors, it swings open and Isaac goes through into the home, shop, inn, temple or crate room behind it. The townspeople stand still meanwhile.

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

Definition at line 835 of file lunpa.c.

scLunpaEnterHiddenPassage

static void scLunpaEnterHiddenPassage(void)

Walking north into the cave mouth the hidden switch opened in Lunpa's west cliff, metatile (2, 19), takes Isaac into Lunpa's hidden room. It works only while Reveal shows the mouth; otherwise nothing happens there.

References fdActorCenterAndWalk(), fdActorGet(), fdActorSetAnimation(), fdScriptWait(), gmFlagGet() and syImportScriptSetExitRequest().

Definition at line 874 of file lunpa.c.

scLunpaEnterFortress

static void scLunpaEnterFortress(void)

Walking up to the golden door in the cliff at the top of the Lunpa Fortress Gates, metatiles (9, 5) and (10, 5), it opens and Isaac goes into Lunpa Fortress.

References fdActorGet(), fdActorSetAnimation(), fdActorWalkBy(), fdMapGridCopyMetatiles(), fdScriptEnd(), fdScriptFinishScreenTransition(), fdScriptStart(), fdScriptWait(), fdScriptWaitTransitionTicks(), gmFlagSet(), syImportScriptSetExitRequest() and sySoundPlay().

Referenced by LunpaFortressGatesCues.

Definition at line 893 of file lunpa.c.

scLunpaTryJumpForward

static void scLunpaTryJumpForward(void)

Unused: jumps Isaac forward. Nothing calls it.

References fdTryJumpForward().

Definition at line 914 of file lunpa.c.

scLunpaPlayRevealSound

static void scLunpaPlayRevealSound(void)

Unused: plays the treasure jingle while Reveal is shining. Nothing calls it.

References gmFlagGet() and sySoundPlay().

Definition at line 920 of file lunpa.c.

scLunpaPressHiddenSwitch

static void scLunpaPressHiddenSwitch(void)

Searching the sparkle Reveal shows on Lunpa's west cliff, from metatile (3, 18) below it, makes the rock crumble away into a dark cave mouth, the passage to Lunpa's hidden room.

References fdScriptGetFlag(), gmFlagGet(), gmFlagSet(), scLunpaDrawHiddenPassagePicture(), sySoundPlay() and sySynch().

Definition at line 931 of file lunpa.c.

scLunpaCopyGatewayCollision

static inline void scLunpaCopyGatewayCollision(Sint32 srcColumn, Sint32 srcRow)

Copies the metatile at (srcColumn, srcRow) over the three metatiles (7, 11) to (9, 11) at the Lunpa Fortress Gates, just below the west half of the upper palisade.

References fdMapGridCopyMetatileAttributes() and Sint32.

Referenced by scLunpaCastCloak(), scLunpaGuardsBlockGate() and scLunpaReopenGateway().

Definition at line 960 of file lunpa.c.

scLunpaGuardsBlockGate

static void scLunpaGuardsBlockGate(void)

Walking uncloaked into the yard between the palisades at the Lunpa Fortress
Gates (metatiles (7,
11) to (14, 14)), the two guards cry out, step up into the upper palisade's
    gap and warn the
party not to come any closer to the fortress. The three metatiles west of
them are rewritten as Cloak's cast does.

References fdActorFaceDirection(), fdActorSetAnimation(), fdActorShowEmote(), fdActorStop(), fdActorWaitForMoveById(), fdActorWalkTo(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), fdScriptWait(), gmFlagSet(), MainRoutineStateWork and scLunpaCopyGatewayCollision().

Referenced by LunpaFortressGatesCues.

Definition at line 973 of file lunpa.c.

scLunpaNoOperation

static void scLunpaNoOperation(void)

Unused: does nothing, and nothing calls it.

Definition at line 1003 of file lunpa.c.

scLunpaCastCloak

static void scLunpaCastCloak(void)

Casting Cloak at the Lunpa Fortress Gates rewrites the three metatiles (7, 11) to (9, 11) from the one at (6, 11); scLunpaCloakFades puts them back.

References gmFlagSet() and scLunpaCopyGatewayCollision().

Referenced by LunpaFortressGatesCues and scInit().

Definition at line 1009 of file lunpa.c.

scLunpaGuardsCatchParty

static void scLunpaGuardsCatchParty(void)

When the guards at the Lunpa Fortress Gates spot the party, they turn and shout who are you, wonder how anyone got past them, and march Isaac back out through the gap in the lower palisade.

References fdActorFaceActor(), fdActorGet(), fdActorSetAnimation(), fdActorShowEmote(), fdActorStartRepeatedMotion(), fdActorWaitForMoveById(), fdActorWalkTo(), fdScriptEnd(), fdScriptGetFlag(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), fdScriptWait(), gmFlagSet(), scLunpaWatchForUncloakedParty(), Sint32 and sySetTickEvent().

Referenced by LunpaFortressGatesCues.

Definition at line 1018 of file lunpa.c.

scLunpaReopenGateway

static void scLunpaReopenGateway(void)

Puts back the three metatiles (7, 11) to (9, 11) that Cloak and the guards at the door rewrite, from the metatile at (7, 12).

References scLunpaCopyGatewayCollision().

Referenced by scLunpaCloakFades().

Definition at line 1085 of file lunpa.c.

scLunpaCloakFades

static void scLunpaCloakFades(void)

As Cloak fades at the Lunpa Fortress Gates, a party still in the yard between the palisades is caught by the guards.

References fdActorGet(), gmFlagClear(), scLunpaReopenGateway(), scLunpaWatchForUncloakedParty(), state and syCloseEvent().

Referenced by LunpaFortressGatesCues.

Definition at line 1092 of file lunpa.c.

scLunpaKickUpLeaderDust

static void scLunpaKickUpLeaderDust(void)

Every 16 ticks while Isaac is dragged and thrown: a puff of dust at his feet.

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

Referenced by scLunpaGuardsThrowIsaacOut().

Definition at line 1138 of file lunpa.c.

scLunpaGuardsThrowIsaacOut

static void scLunpaGuardsThrowIsaacOut(void)

Caught inside Lunpa Fortress, Isaac is dragged out of the door by the two guards, struggling, down through both palisades, and thrown sprawling onto the slope below. And don't come back, says one, and they return to their posts.

References fdActorFaceDirection(), fdActorGet(), fdActorSetAnimation(), fdActorSetAttachedEffect(), fdActorSetDestination(), fdActorSetSpritePriority(), fdActorWaitForMoveById(), fdActorWalkTo(), fdCameraFollowActor(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), fdScriptStartScreenTransition(), fdScriptWait(), scLunpaKickUpLeaderDust(), syCloseEvent(), sySetTickEvent() and sySoundPlay().

Referenced by scInit().

Definition at line 1164 of file lunpa.c.

scLunpaLeaderSneaksOut

static void scLunpaLeaderSneaksOut(void)

After the rescue, Isaac comes out of the fortress door, casts Cloak in the upper palisade's gap and slips round behind the guards, west along the palisade and down the west side of the slope.

References fdActorWaitForMoveById(), fdActorWalkTo(), fdPsynergyLoadResources(), fdPsynergyRunHandler(), fdPsynergySetupActorPair(), fdPsynergyStartCast(), fdPsynergyStopCasterUpdate(), fdScriptEnd(), fdScriptStart(), fdScriptStartScreenTransition() and fdScriptWait().

Referenced by scInit().

Definition at line 1257 of file lunpa.c.

scInit

Sint32 scInit(void)

Sets up Lunpa (secrets hidden, the Nut in its tree) or the Lunpa Fortress Gates (the throw-out or the sneak-out, Garet's watch, the guards' watch and the fortress started over).

References fdActorGet(), fdActorSetSpriteFlags(), gmFlagClear(), gmFlagGet(), gmFlagSet(), MainRoutineStateWork, scFloatNut(), scLunpaCastCloak(), scLunpaGuardsThrowIsaacOut(), scLunpaHideSecrets(), scLunpaLeaderSneaksOut(), scLunpaWatchForFortressApproach(), scLunpaWatchForUncloakedParty(), Sint32 and sySetTickEvent().

Definition at line 1288 of file lunpa.c.

Variables in detail

LunpaEntrances

extern SCENE_ENTRANCE LunpaEntrances[]

SCENE_ENTRANCE LunpaEntrances[]

Referenced by scGetEntrances().

Definition at lines 67 and 1369 of file lunpa.c.

LunpaFortressGatesEntrances

extern SCENE_ENTRANCE LunpaFortressGatesEntrances[]

SCENE_ENTRANCE LunpaFortressGatesEntrances[]

Referenced by scGetEntrances().

Definition at lines 68 and 1386 of file lunpa.c.

LunpaExits

extern Uint32 LunpaExits[]

Uint32 LunpaExits[]

Referenced by scGetExits().

Definition at lines 69 and 1404 of file lunpa.c.

LunpaFortressGatesExits

extern Uint32 LunpaFortressGatesExits[]

Uint32 LunpaFortressGatesExits[]

Referenced by scGetExits().

Definition at lines 70 and 1423 of file lunpa.c.

LunpaActorPlacements

extern ACTOR_PLACE LunpaActorPlacements[]

ACTOR_PLACE LunpaActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 71 and 1433 of file lunpa.c.

LunpaFortressGatesActorPlacements

extern ACTOR_PLACE LunpaFortressGatesActorPlacements[]

ACTOR_PLACE LunpaFortressGatesActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 72 and 1463 of file lunpa.c.

LunpaSealedCues

extern CUE LunpaSealedCues[]

CUE LunpaSealedCues[]

References scLunpaAskAboutHammetsKidnapping(), scLunpaAskAboutLengthOfStay(), scLunpaAskAboutSeeingDonpa(), scLunpaReadEastGuardsThoughts(), scLunpaTalkToEastGuard() and scLunpaTalkToWestGuard().

Referenced by scGetCues().

Definition at lines 73 and 1526 of file lunpa.c.

LunpaReopenedCues

extern CUE LunpaReopenedCues[]

CUE LunpaReopenedCues[]

References scLunpaAskAboutFortressCommotion(), scLunpaComplainAboutCold() and scLunpaReadEastGuardsThoughts().

Referenced by scGetCues().

Definition at lines 74 and 1564 of file lunpa.c.

LunpaFortressGatesCues

extern CUE LunpaFortressGatesCues[]

CUE LunpaFortressGatesCues[]

References scLunpaCastCloak(), scLunpaCloakFades(), scLunpaEnterFortress(), scLunpaGaretTurnsIsaacBack(), scLunpaGuardsBlockGate(), scLunpaGuardsCatchParty(), scLunpaReadLeftGuardsThoughts(), scLunpaReadRightGuardsThoughts(), scLunpaSearchWell(), scLunpaTalkToLeftGuard() and scLunpaTalkToRightGuard().

Referenced by scGetCues().

Definition at lines 75 and 1606 of file lunpa.c.

LunpaDoors

extern MAP_EDIT LunpaDoors[]

MAP_EDIT LunpaDoors[]

Each door's opening animation and the map grid metatile it plays at, by its step cue from METATILE_BEHAVIOR_LUNPA_FIRST_HOME_DOOR.

References LunpaDoorSteps.

Referenced by scLunpaEnterDoor().

Definition at lines 249 and 1663 of file lunpa.c.

FieldEffectDurationScripts

const Sint32 *FieldEffectDurationScripts[]

References FieldEffectLongScript, FieldEffectMediumScript, FieldEffectShortScript and Sint32.

Definition at line 282 of file lunpa.c.

LunpaDoorSteps

Uint16 LunpaDoorSteps[DOOR_COUNT][11]

Each door's opening, as a map grid animation.

Referenced by LunpaDoors.

Definition at line 1634 of file lunpa.c.

LunpaUnusedWord

Uint32 LunpaUnusedWord

Unused: a zero word nothing reads.

Definition at line 1675 of file lunpa.c.

On this page

MacrosEnumerationsFunctionsVariablesDescriptionMacros in detailROOM_ENTRANCEFLAG_LUNPA_PUDDLE_FROZENFLAG_LUNPA_SECRETS_HIDDENFLAG_LUNPA_HIDDEN_PASSAGE_OPENFLAG_LUNPA_FORTRESS_GATES_GUARDS_AT_DOORFLAG_LUNPA_FORTRESS_GATES_CLOAK_CASTFLAG_LUNPA_FORTRESS_GATES_ENTERING_FORTRESSFLAG_LUNPA_FORTRESS_GATES_GARET_WARNINGFLAG_LUNPA_FORTRESS_GATES_GUARDS_CAUGHT_PARTYLUNPA_ENTRANCEGATE_ENTRANCEROOM_EXITTALKMIND_READDOORLUNPA_ROADS_AND_DOORSLUNPA_SECRETS_AND_SEARCHESEnumerations in detailanonymous enumanonymous enumLUNPA_METATILE_BEHAVIORLUNPA_FORTRESS_GATES_METATILE_BEHAVIORLUNPA_FORTRESS_GATES_RAISED_CUEanonymous enumLUNPA_ACTOR_IDGATE_ACTOR_IDanonymous enumanonymous enumCATCH_MESSAGERECOGNITION_MESSAGEanonymous enumanonymous enumanonymous enumanonymous enumFunctions in detailscLunpaWatchForUncloakedPartyscGetEntrancesscGetExitRegionsscGetExitsscGetActorPlacementsscLunpaCatchFloatingNutscLunpaApplyFrozenPuddleCollisionscLunpaFreezeHiddenPuddlescLunpaUpdateIcePillarDrawOrderscLunpaDrawHiddenPassagePicturescLunpaRevealSecretsscLunpaHideSecretsscLunpaSearchWellscGetCuesscLunpaTalkToWestGuardscLunpaTalkToEastGuardscLunpaReadEastGuardsThoughtsscLunpaAskAboutLengthOfStayscLunpaAskAboutHammetsKidnappingscLunpaAskAboutSeeingDonpascLunpaComplainAboutColdscLunpaAskAboutFortressCommotionscLunpaTalkToLeftGuardscLunpaTalkToRightGuardscLunpaReadLeftGuardsThoughtsscLunpaReadRightGuardsThoughtsscLunpaWatchForFortressApproachscLunpaGaretTurnsIsaacBackscLunpaEnterDoorscLunpaEnterHiddenPassagescLunpaEnterFortressscLunpaTryJumpForwardscLunpaPlayRevealSoundscLunpaPressHiddenSwitchscLunpaCopyGatewayCollisionscLunpaGuardsBlockGatescLunpaNoOperationscLunpaCastCloakscLunpaGuardsCatchPartyscLunpaReopenGatewayscLunpaCloakFadesscLunpaKickUpLeaderDustscLunpaGuardsThrowIsaacOutscLunpaLeaderSneaksOutscInitVariables in detailLunpaEntrancesLunpaFortressGatesEntrancesLunpaExitsLunpaFortressGatesExitsLunpaActorPlacementsLunpaFortressGatesActorPlacementsLunpaSealedCuesLunpaReopenedCuesLunpaFortressGatesCuesLunpaDoorsFieldEffectDurationScriptsLunpaDoorStepsLunpaUnusedWord