Skip to Content
The Alchemy Project

src/scene/rock_rooms.c

The rooms inside Lunpa's buildings, and the house beside Suhalla Gate (SceneIdRockRooms). More…

Macros

NameDescription
#defineROOM_DOOR (room) {CUE_EXIT, (room), CONDITION_ALWAYS, (room)}A doorway's exit, its metatiles carrying its room's number.

Enumerations

NameDescription
enumROCK_ROOMS_ROOM { ROOM_FIRST_HOME, ROOM_SECOND_HOME, ROOM_THIRD_HOME, ROOM_ARM … }The rooms by the entrance the party comes in by; each is also its door's cue and exit kind (ROOM_DOOR).
enumROCK_ROOMS_METATILE_BEHAVIOR { METATILE_BEHAVIOR_ROCK_ROOMS_WOODEN_BOX, METATILE_BEHAVIOR_R … }The metatiles the rooms' examine cues answer.
enumROCK_ROOMS_ACTOR_ID { ACTOR_MAN_ON_HIS_LATE_GRANDFATHER, ACTOR_WOMAN_NEVER_WORKING … }The placed actors of Lunpa's houses, shops, inn and temple, numbered in the order of RockRoomsActorPlacements.
enumanonymous enum { SHOP_LUNPA_ITEMS, SHOP_LUNPA_WEAPONS, SHOP_LUNPA_ARMOR }Lunpa's shops, as mnShopRun numbers them.
enumanonymous enum { INN_ID_LUNPA }Lunpa's inn, as mnInnCheckIn numbers the inns.

Functions

NameDescription
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 villagers, shopkeepers and counters of every room, and the traveling Healer of the house beside Suhalla Gate.
const CUE *scGetCues (void)The house beside Suhalla Gate has its own cues; Lunpa's rooms have one table for the sealed village and one for after Donpa has dealt with Dodonpa.
static voidscRockRoomsTalkToInnkeeper (void)Talking to the innkeeper behind the counter of Lunpa's inn offers a night's rest once the village has reopened, and only a joke about his own home while it is sealed.
static voidscRockRoomsTalkToChef (void)Talking to the chef at Lunpa's inn, west of the counter, while the village is sealed: he asks whether the party wants to hear how he delivered meals to the fortress.
static voidscRockRoomsReadChefsThoughts (void)Mind Read on the chef at Lunpa's inn while the village is sealed: he feels bad for the poor man locked up in the dungeon.
static voidscRockRoomsAskWhetherDonpasGuest (void)Talking to the woman in an apron by the door of Lunpa's inn, once the village has reopened: she asks "Are you Donpa's guest?" A yes gets the royal treatment she was told to give, and a reminder to visit Donpa again; a no leaves her wondering who the guest is.
static voidscRockRoomsTalkToHealer (void)Talking to the Healer behind the altar of Lunpa Temple: facing him across it, the Sanctum's services, sealed village or not.
static voidscRockRoomsReadItemMerchantsThoughts (void)Mind Read on the woman with a ponytail behind the counter of Lunpa's item shop: while the village is sealed she is already running out of the stock she bought; once it has reopened, she is almost out of products too, like the weapons vendors.
static voidscRockRoomsTalkToItemMerchant (void)Talking to the woman behind the counter of Lunpa's item shop: facing her across it opens the shop, even while the village is sealed.
static voidscRockRoomsReadWeaponMerchantsThoughts (void)Mind Read on the bald man in red behind the west counter of Lunpa's weapon and armor shop: while the village is sealed he fears he will have to close the shop; once it has reopened, he doubts Dodonpa's henchmen can use all those weapons.
static voidscRockRoomsTalkToWeaponMerchant (void)Talking to the bald man in red behind the west counter of Lunpa's weapon and armor shop: while the village is sealed, from any side, he says they can't buy or sell anything.
static voidscRockRoomsReadArmorMerchantsThoughts (void)Mind Read on the young man in green behind the east counter of Lunpa's weapon and armor shop: while the village is sealed he wishes he had bought more stock; once it has reopened, he means to close the shop when his armor is sold.
static voidscRockRoomsTalkToArmorMerchant (void)Talking to the young man in green behind the east counter of Lunpa's weapon and armor shop: while the village is sealed, from any side, he promises all the armor the party likes once it reopens.
Sint32scInit (void)Entering the house beside Suhalla Gate makes it the place a defeated party wakes, and shows no area name.
static voidscRockRoomsTalkToTravelingHealer (void)Talking to the traveling Healer, the bearded man in a long robe in the house beside Suhalla Gate: facing him from the south, the Sanctum's services; from any other side, "I have been traveling the lands spreading good will."

Variables

NameDescription
const SCENE_ENTRANCERockRoomsEntrances []
const Uint32RockRoomsExits []
const ACTOR_PLACERockRoomsActorPlacements []
extern const CUERockRoomsSealedCues []
extern const CUERockRoomsReopenedCues []
extern const CUERockRoomsGateToSuhallaCues []

Description

The rooms inside Lunpa's buildings, and the house beside Suhalla Gate (SceneIdRockRooms). The game packs rooms that share a rocky tile style onto one map; the door the party comes in by decides which room they are in, and the area name follows it.

Lunpa's doors (lunpa.c) lead into three homes, the weapon and armor shop, the item shop, the inn, the temple and a crate room the walkthrough calls the shop's attic. Two villagers live in each home and talk of Dodonpa, his fortress, and old Lunpa, who was lost in the great flood. The wooden box in the second home (metatile (23, 10)) holds a Lucky Medal and the barrel in the crate room (metatile (30, 53)) a Vial. Something is cooking in the ovens of the first and third homes: Thieves' Stew, and Thieves' Cookies in the shape of Dodonpa's face.

While the village is sealed, the weapon and armor merchants will not sell and the innkeeper only offers his own home, though the item shop and the temple's Healer serve as usual. The inn's chef is the one villager let into the fortress, and talking to him or reading his mind tells of the prisoner he feeds there, Hammet; what Layana says in Kalay changes once the party has heard it. Once Donpa has dealt with his son (FLAG_DODONPA_LOCKED_UP), the shops sell their last stock, the inn takes guests, and the villagers talk of a shimmering creature seen slipping into the fortress and of the guests Donpa is expecting. scGetCues picks the sealed or the reopened table by that flag.

The temple has a second entrance before the altar, where a party defeated in Lunpa wakes.

The house beside Suhalla Gate's checkpoint (suhalla_gate.c) is a small room with two beds, where a traveling Healer offers the Sanctum's services. It has its own cue table. Entering it makes it the place a defeated party wakes, and hides the area name.

Each door leads back out the way the party came in: a room's entrance number is also its doorway's metatile behavior and its exit (ROOM_DOOR).

A merchant or Healer serves a leader who talks to them facing north, from in front of the counter; from any other side they only talk. The counters are invisible actors standing in front of the merchants, so talking across one reaches the merchant.

Macros in detail

ROOM_DOOR

#define ROOM_DOOR(room) {CUE_EXIT, (room), CONDITION_ALWAYS, (room)}

A doorway's exit, its metatiles carrying its room's number.

Referenced by RockRoomsGateToSuhallaCues, RockRoomsReopenedCues and RockRoomsSealedCues.

Definition at line 66 of file rock_rooms.c.

Enumerations in detail

ROCK_ROOMS_ROOM

enum ROCK_ROOMS_ROOM

The rooms by the entrance the party comes in by; each is also its door's cue and exit kind (ROOM_DOOR).

EnumeratorValueDescription
ROOM_FIRST_HOME1
ROOM_SECOND_HOME
ROOM_THIRD_HOME
ROOM_ARMS_SHOP
ROOM_ITEM_SHOP
ROOM_INN
ROOM_TEMPLE
ROOM_CRATE_ROOM
ROOM_NINTH_UNUSEDno exit leads here
ROOM_GATE_TO_SUHALLA
ROOM_TEMPLE_SECOND_ENTRANCE

Definition at line 50 of file rock_rooms.c.

ROCK_ROOMS_METATILE_BEHAVIOR

enum ROCK_ROOMS_METATILE_BEHAVIOR

The metatiles the rooms' examine cues answer. A doorway's metatiles carry the number of its room instead.

EnumeratorValueDescription
METATILE_BEHAVIOR_ROCK_ROOMS_WOODEN_BOX100The wooden box in the second home, metatile (23, 10): a Lucky Medal.
METATILE_BEHAVIOR_ROCK_ROOMS_BARRELThe barrel in the crate room, metatile (30, 53): a Vial.
METATILE_BEHAVIOR_ROCK_ROOMS_FIRST_OVEN200The oven in the first home, metatiles (6, 4) and (7, 4): Thieves' Stew.
METATILE_BEHAVIOR_ROCK_ROOMS_SECOND_OVENThe oven in the third home, metatiles (8, 29) and (9, 29): Thieves' Cookies.

Definition at line 70 of file rock_rooms.c.

ROCK_ROOMS_ACTOR_ID

enum ROCK_ROOMS_ACTOR_ID

The placed actors of Lunpa's houses, shops, inn and temple, numbered in the order of RockRoomsActorPlacements. Two people live in each of the three homes, named by their sprites and by what they say while the town is sealed.

EnumeratorValueDescription
ACTOR_MAN_ON_HIS_LATE_GRANDFATHERACTOR_FIRST_PLACEDIn the first
ACTOR_WOMAN_NEVER_WORKING_FOR_DODONPAhome: this man with brown hair (SPRITE_YOUNG_MAN_WITH_BROWN_HAIR) and a woman with fair hair (SPRITE_WOMAN_WITH_FAIR_HAIR).
ACTOR_MAN_ON_DONPAS_FORTRESSIn the second home: this burly grey-haired
ACTOR_WOMAN_ON_THE_INNS_CHEFman (SPRITE_BURLY_MAN_WITH_GREY_HAIR) and a woman in a pink apron (SPRITE_WOMAN_IN_PINK_APRON).
ACTOR_OLD_MAN_ON_LUNPAS_DEATHIn the third home: this bent old man with a cane (SPRITE_OLD_MAN_WITH_CANE) and an old woman (SPRITE_OLD_WOMAN).
ACTOR_OLD_WOMAN_ON_THE_GREAT_FLOOD
ACTOR_WEAPON_MERCHANT
ACTOR_ARMOR_MERCHANT
ACTOR_ITEM_MERCHANT
ACTOR_INNKEEPER
ACTOR_WOMAN_ASKING_FOR_DONPAS_GUESTA woman in a pink apron (SPRITE_WOMAN_IN_PINK_APRON) at the inn, beside the innkeeper.
ACTOR_INN_WORKER
ACTOR_CHEF
ACTOR_HEALERBehind the temple's altar; across it, the Sanctum's services (scRockRoomsTalkToHealer).
ACTOR_TRAVELING_HEALERIn the Healer's sprite, a bearded man in a long robe (SPRITE_BEARDED_MAN_IN_LONG_ROBE), in the house beside Suhalla Gate.
ACTOR_WEAPON_COUNTERInvisible (SPRITE_BLANK), on the counter before each merchant, so that talking across it reaches the merchant.
ACTOR_ARMOR_COUNTER
ACTOR_ITEM_COUNTER

Definition at line 90 of file rock_rooms.c.

anonymous enum

enum { SHOP_LUNPA_ITEMS, SHOP_LUNPA_WEAPONS, SHOP_LUNPA_ARMOR }

Lunpa's shops, as mnShopRun numbers them.

EnumeratorValueDescription
SHOP_LUNPA_ITEMS25
SHOP_LUNPA_WEAPONS29
SHOP_LUNPA_ARMOR30

Definition at line 132 of file rock_rooms.c.

anonymous enum

enum { INN_ID_LUNPA }

Lunpa's inn, as mnInnCheckIn numbers the inns.

EnumeratorValueDescription
INN_ID_LUNPA8

Definition at line 140 of file rock_rooms.c.

Functions in detail

scGetEntrances

const SCENE_ENTRANCE *scGetEntrances(void)

References RockRoomsEntrances.

Definition at line 226 of file rock_rooms.c.

scGetExitRegions

const SCENE_EXIT_REGION *scGetExitRegions(void)

Definition at line 231 of file rock_rooms.c.

scGetExits

const Uint32 *scGetExits(void)

References RockRoomsExits.

Definition at line 236 of file rock_rooms.c.

scGetActorPlacements

const ACTOR_PLACE *scGetActorPlacements(void)

The villagers, shopkeepers and counters of every room, and the traveling Healer of the house beside Suhalla Gate.

References RockRoomsActorPlacements.

Definition at line 243 of file rock_rooms.c.

scGetCues

const CUE *scGetCues(void)

The house beside Suhalla Gate has its own cues; Lunpa's rooms have one table for the sealed village and one for after Donpa has dealt with Dodonpa.

References gmFlagGet(), MainRoutineStateWork, RockRoomsGateToSuhallaCues, RockRoomsReopenedCues and RockRoomsSealedCues.

Definition at line 250 of file rock_rooms.c.

scRockRoomsTalkToInnkeeper

static void scRockRoomsTalkToInnkeeper(void)

Talking to the innkeeper behind the counter of Lunpa's inn offers a night's rest once the village has reopened, and only a joke about his own home while it is sealed. Facing him across the counter after Donpa has dealt with Dodonpa checks the party in (mnInnCheckIn). From any other side, he asks whether they want to rest at the inn, and either answer is only words. While the village is sealed, he asks whether they want to sleep at his place, and a yes gets "Go rest in your own home!"

References fdActorGet(), fdScriptAskYesNo(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptStart(), gmFlagGet() and mnInnCheckIn().

Referenced by RockRoomsReopenedCues and RockRoomsSealedCues.

Definition at line 270 of file rock_rooms.c.

scRockRoomsTalkToChef

static void scRockRoomsTalkToChef(void)

Talking to the chef at Lunpa's inn, west of the counter, while the village is sealed: he asks whether the party wants to hear how he delivered meals to the fortress. Yes tells of being led blindfolded down an echoing path underground; no, of his relief at getting back, and that the man he fed is called Hammet. Either way the party has now heard of the prisoner (FLAG_LUNPA_HEARD_OF_PRISONER), which changes what Layana says in Kalay.

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

Referenced by RockRoomsSealedCues.

Definition at line 306 of file rock_rooms.c.

scRockRoomsReadChefsThoughts

static void scRockRoomsReadChefsThoughts(void)

Mind Read on the chef at Lunpa's inn while the village is sealed: he feels bad for the poor man locked up in the dungeon. Like talking to him, it counts as hearing of the prisoner (FLAG_LUNPA_HEARD_OF_PRISONER).

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

Referenced by RockRoomsSealedCues.

Definition at line 321 of file rock_rooms.c.

scRockRoomsAskWhetherDonpasGuest

static void scRockRoomsAskWhetherDonpasGuest(void)

Talking to the woman in an apron by the door of Lunpa's inn, once the village has reopened: she asks "Are you Donpa's guest?" A yes gets the royal treatment she was told to give, and a reminder to visit Donpa again; a no leaves her wondering who the guest is.

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

Referenced by RockRoomsReopenedCues.

Definition at line 335 of file rock_rooms.c.

scRockRoomsTalkToHealer

static void scRockRoomsTalkToHealer(void)

Talking to the Healer behind the altar of Lunpa Temple: facing him across it, the Sanctum's services, sealed village or not. From any other side he speaks of Dodonpa: while the village is sealed, that it is not fair to blame the Lunpans for him; once it has reopened, that a number of Dodonpa's men set out not long ago.

References fdActorGet(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), gmFlagGet() and mnSanctumRun().

Referenced by RockRoomsReopenedCues and RockRoomsSealedCues.

Definition at line 351 of file rock_rooms.c.

scRockRoomsReadItemMerchantsThoughts

static void scRockRoomsReadItemMerchantsThoughts(void)

Mind Read on the woman with a ponytail behind the counter of Lunpa's item shop: while the village is sealed she is already running out of the stock she bought; once it has reopened, she is almost out of products too, like the weapons vendors.

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

Referenced by RockRoomsReopenedCues and RockRoomsSealedCues.

Definition at line 379 of file rock_rooms.c.

scRockRoomsTalkToItemMerchant

static void scRockRoomsTalkToItemMerchant(void)

Talking to the woman behind the counter of Lunpa's item shop: facing her across it opens the shop, even while the village is sealed. From any other side she talks of the weapon and armor merchants: holding up on the stock they bought while the village is sealed, selling the last of it once it has reopened.

References fdActorGet(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), gmFlagGet() and mnShopRun().

Referenced by RockRoomsReopenedCues and RockRoomsSealedCues.

Definition at line 404 of file rock_rooms.c.

scRockRoomsReadWeaponMerchantsThoughts

static void scRockRoomsReadWeaponMerchantsThoughts(void)

Mind Read on the bald man in red behind the west counter of Lunpa's weapon and armor shop: while the village is sealed he fears he will have to close the shop; once it has reopened, he doubts Dodonpa's henchmen can use all those weapons.

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

Referenced by RockRoomsReopenedCues and RockRoomsSealedCues.

Definition at line 432 of file rock_rooms.c.

scRockRoomsTalkToWeaponMerchant

static void scRockRoomsTalkToWeaponMerchant(void)

Talking to the bald man in red behind the west counter of Lunpa's weapon and armor shop: while the village is sealed, from any side, he says they can't buy or sell anything. Once it has reopened, facing him across the counter opens the weapon shop, and from any other side he cries "To arms!" and urges the party to buy while stocks last.

References fdActorGet(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), gmFlagGet(), mnShopRun() and Sint32.

Referenced by RockRoomsReopenedCues and RockRoomsSealedCues.

Definition at line 453 of file rock_rooms.c.

scRockRoomsReadArmorMerchantsThoughts

static void scRockRoomsReadArmorMerchantsThoughts(void)

Mind Read on the young man in green behind the east counter of Lunpa's weapon and armor shop: while the village is sealed he wishes he had bought more stock; once it has reopened, he means to close the shop when his armor is sold.

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

Referenced by RockRoomsReopenedCues and RockRoomsSealedCues.

Definition at line 485 of file rock_rooms.c.

scRockRoomsTalkToArmorMerchant

static void scRockRoomsTalkToArmorMerchant(void)

Talking to the young man in green behind the east counter of Lunpa's weapon and armor shop: while the village is sealed, from any side, he promises all the armor the party likes once it reopens. Once it has, facing him across the counter opens the armor shop, and from any other side he boasts of his incredible products.

References fdActorGet(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), gmFlagGet(), mnShopRun() and Sint32.

Referenced by RockRoomsReopenedCues and RockRoomsSealedCues.

Definition at line 506 of file rock_rooms.c.

scInit

Sint32 scInit(void)

Entering the house beside Suhalla Gate makes it the place a defeated party wakes, and shows no area name. In every room, the three invisible counter actors are given no shadow (fdActorSetSpriteFlags with no flags), so nothing shows where they stand.

References fdActorGet(), fdActorSetSpriteFlags(), gmFlagClear(), MainRoutineStateWork and Sint32.

Definition at line 538 of file rock_rooms.c.

scRockRoomsTalkToTravelingHealer

static void scRockRoomsTalkToTravelingHealer(void)

Talking to the traveling Healer, the bearded man in a long robe in the house beside Suhalla Gate: facing him from the south, the Sanctum's services; from any other side, "I have been traveling the lands spreading good will."

References fdActorGet(), fdScriptSetMessageId(), fdScriptShowMessage() and mnSanctumRun().

Referenced by RockRoomsGateToSuhallaCues and RockRoomsSealedCues.

Definition at line 560 of file rock_rooms.c.

Variables in detail

RockRoomsEntrances

const SCENE_ENTRANCE RockRoomsEntrances[]

Referenced by scGetEntrances().

Definition at line 146 of file rock_rooms.c.

RockRoomsExits

const Uint32 RockRoomsExits[]

Referenced by scGetExits().

Definition at line 165 of file rock_rooms.c.

RockRoomsActorPlacements

const ACTOR_PLACE RockRoomsActorPlacements[]

Referenced by scGetActorPlacements().

Definition at line 180 of file rock_rooms.c.

RockRoomsSealedCues

extern const CUE RockRoomsSealedCues[]

const CUE RockRoomsSealedCues[]

References scRockRoomsReadArmorMerchantsThoughts(), scRockRoomsReadChefsThoughts(), scRockRoomsReadItemMerchantsThoughts(), scRockRoomsReadWeaponMerchantsThoughts(), scRockRoomsTalkToArmorMerchant(), scRockRoomsTalkToChef(), scRockRoomsTalkToHealer(), scRockRoomsTalkToInnkeeper(), scRockRoomsTalkToItemMerchant(), scRockRoomsTalkToTravelingHealer() and scRockRoomsTalkToWeaponMerchant().

Referenced by scGetCues().

Definition at lines 222 and 583 of file rock_rooms.c.

RockRoomsReopenedCues

extern const CUE RockRoomsReopenedCues[]

const CUE RockRoomsReopenedCues[]

References scRockRoomsAskWhetherDonpasGuest(), scRockRoomsReadArmorMerchantsThoughts(), scRockRoomsReadItemMerchantsThoughts(), scRockRoomsReadWeaponMerchantsThoughts(), scRockRoomsTalkToArmorMerchant(), scRockRoomsTalkToHealer(), scRockRoomsTalkToInnkeeper(), scRockRoomsTalkToItemMerchant() and scRockRoomsTalkToWeaponMerchant().

Referenced by scGetCues().

Definition at lines 223 and 666 of file rock_rooms.c.

RockRoomsGateToSuhallaCues

extern const CUE RockRoomsGateToSuhallaCues[]

const CUE RockRoomsGateToSuhallaCues[]

References scRockRoomsTalkToTravelingHealer().

Referenced by scGetCues().

Definition at lines 224 and 748 of file rock_rooms.c.