Alchemy
Loading...
Searching...
No Matches

tolbi_interiors.c File Reference

Tolbi's interiors: the houses, inns, shops and sanctum of the festival town. More...

Go to the source code of this file.

Macros

#define FLAG_TOLBI_INTERIORS_SAILORS_SEEN   0x300
 their argument has played
#define TOLBI_INTERIORS_INN_CAMERA_MAX_Z   744
#define TOLBI_INTERIORS_EAST_ROOM_CAMERA_MAX_X   952
#define TOLBI_INTERIORS_SOUTH_ROOM_CAMERA_MAX_Z   936

Enumerations

enum  {
  TOLBI_INTERIORS_WEAPON_SHOP = 26 , TOLBI_INTERIORS_ARMOR_SHOP = 27 , TOLBI_INTERIORS_ITEM_SHOP = 28 , TOLBI_INTERIORS_FIRST_DOOR_TRIGGER = 14 ,
  TOLBI_INTERIORS_ACTOR_SLOT_END = 66
}
 The shop rows and door triggers used by the room event tables below. More...

Functions

static void TolbiInteriors_AskYesNo (s32 question, s32 speaker)
 Asks a yes/no question, then answers with the message after the question for yes or the one after that for no.
const struct SceneEntrance * TolbiInteriors_GetEntrances (void)
const struct SceneRegion * TolbiInteriors_GetRegions (void)
const u32 * TolbiInteriors_GetExits (void)
const struct ScenePlacement * TolbiInteriors_SelectPlacements (void)
 After Colosso the rooms hold a different crowd.
const struct SceneEvent * TolbiInteriors_SelectEvents (void)
 Picks the event table for the current point in the Colosso story.
static UNUSED void TolbiInteriors_ExitThroughWindow (void)
 Leaves through a window transition of 24 frames. No event uses it.
static void TolbiInteriors_EnterDoor (void)
 Walking into one of the four doors at triggers 14 to 17: every placed actor stops, the door opens and the leader walks through it.
static void TolbiInteriors_WatchWomanHideMedal (void)
 After Colosso, entering by entrance 19: a woman finds something on the floor, is startled to see the party and hides it in the barrel behind the trash pile.
static void TolbiInteriors_WatchSailorsArgue (void)
 After Colosso, entering by entrance 16: three sailors argue about their captain, who won't sail the ship.
s32 TolbiInteriors_ApplyEntryState (void)
 Sets up the rooms on entry.
static void TolbiInteriors_TalkToItemShopkeeper (s32 speaker)
 The item shopkeeper: from across the counter (the leader facing west) opens shop 28; from elsewhere talks about the finals.
static void TolbiInteriors_TalkToWeaponShopkeeper (s32 speaker)
 The weapon shopkeeper: across the counter (the leader facing north) opens the shop; otherwise talks about Colosso.
static void TolbiInteriors_TalkToArmorShopkeeper (s32 speaker)
 The armor shopkeeper: across the counter (the leader facing north) opens the shop; otherwise talks about the finals.
static void TolbiInteriors_TalkToChef (s32 speaker)
 The chef asks whether the party watched Colosso, which he missed.
static void TolbiInteriors_TalkToWaiter (s32 speaker)
 After Colosso, a waiter grumbles about the chef's bad mood.
static void TolbiInteriors_TalkToHost (s32 speaker)
 During the festival, a resident offers the party a bed.
static void TolbiInteriors_TalkToMedalWoman (s32 speaker)
 The woman who hid the Lucky Medal.
static void TolbiInteriors_ReadMedalWomanMind (void)
 Mind Read on the medal woman gives the hiding place away.
static void TolbiInteriors_TalkToAngrySailor (s32 speaker)
 The angry sailor complains the ships won't sail after Colosso.
static void TolbiInteriors_TalkToWouldBeWarrior (s32 speaker)
 After Colosso, the would-be warrior asks whether the party remembers him.
static void TolbiInteriors_TalkToPriest (s32 speaker)
 The priest: across the counter (the leader facing north) opens the sanctum; otherwise talks about the festival.

Variables

s32 gTolbiInteriorsSquashStretch []
 An actor that squashes and stretches twice, then rests 40 frames.
struct SceneEntrance gTolbiInteriorsEntrances []
u32 gTolbiInteriorsExits []
struct ScenePlacement gTolbiInteriorsPlacements []
struct ScenePlacement gTolbiInteriorsPlacementsAfterColosso []
struct SceneEvent gTolbiInteriorsEventsFestival []
struct SceneEvent gTolbiInteriorsEventsFinalsDay []
struct SceneEvent gTolbiInteriorsEventsAfterColosso []
u16 gTolbiInteriorsDoorOpening []
struct MapCellAnim gTolbiInteriorsDoors []

Detailed Description

Tolbi's interiors: the houses, inns, shops and sanctum of the festival town.

Like the town outside, the rooms change with the Colosso story flags: the festival, finals day and the quiet after Colosso.

Definition in file tolbi_interiors.c.

Macro Definition Documentation

◆ FLAG_TOLBI_INTERIORS_SAILORS_SEEN

#define FLAG_TOLBI_INTERIORS_SAILORS_SEEN   0x300

their argument has played

Definition at line 23 of file tolbi_interiors.c.

Referenced by TolbiInteriors_ApplyEntryState().

◆ TOLBI_INTERIORS_INN_CAMERA_MAX_Z

#define TOLBI_INTERIORS_INN_CAMERA_MAX_Z   744

Definition at line 30 of file tolbi_interiors.c.

◆ TOLBI_INTERIORS_EAST_ROOM_CAMERA_MAX_X

#define TOLBI_INTERIORS_EAST_ROOM_CAMERA_MAX_X   952

Definition at line 31 of file tolbi_interiors.c.

◆ TOLBI_INTERIORS_SOUTH_ROOM_CAMERA_MAX_Z

#define TOLBI_INTERIORS_SOUTH_ROOM_CAMERA_MAX_Z   936

Definition at line 32 of file tolbi_interiors.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The shop rows and door triggers used by the room event tables below.

Enumerator
TOLBI_INTERIORS_WEAPON_SHOP 
TOLBI_INTERIORS_ARMOR_SHOP 
TOLBI_INTERIORS_ITEM_SHOP 
TOLBI_INTERIORS_FIRST_DOOR_TRIGGER 
TOLBI_INTERIORS_ACTOR_SLOT_END 

Definition at line 36 of file tolbi_interiors.c.

Function Documentation

◆ TolbiInteriors_AskYesNo()

void TolbiInteriors_AskYesNo ( s32 question,
s32 speaker )
inlinestatic

Asks a yes/no question, then answers with the message after the question for yes or the one after that for no.

Definition at line 46 of file tolbi_interiors.c.

Referenced by TolbiInteriors_AskYesNo(), TolbiInteriors_TalkToChef(), TolbiInteriors_TalkToHost(), TolbiInteriors_TalkToItemShopkeeper(), TolbiInteriors_TalkToMedalWoman(), TolbiInteriors_TalkToWeaponShopkeeper(), and TolbiInteriors_TalkToWouldBeWarrior().

◆ TolbiInteriors_GetEntrances()

const struct SceneEntrance * TolbiInteriors_GetEntrances ( void )

Definition at line 58 of file tolbi_interiors.c.

Referenced by TolbiInteriors_GetEntrances().

◆ TolbiInteriors_GetRegions()

const struct SceneRegion * TolbiInteriors_GetRegions ( void )

Definition at line 62 of file tolbi_interiors.c.

Referenced by TolbiInteriors_GetRegions().

◆ TolbiInteriors_GetExits()

const u32 * TolbiInteriors_GetExits ( void )

Definition at line 64 of file tolbi_interiors.c.

Referenced by TolbiInteriors_GetExits().

◆ TolbiInteriors_SelectPlacements()

const struct ScenePlacement * TolbiInteriors_SelectPlacements ( void )

After Colosso the rooms hold a different crowd.

Definition at line 67 of file tolbi_interiors.c.

Referenced by TolbiInteriors_SelectPlacements().

◆ TolbiInteriors_SelectEvents()

const struct SceneEvent * TolbiInteriors_SelectEvents ( void )

Picks the event table for the current point in the Colosso story.

Definition at line 83 of file tolbi_interiors.c.

Referenced by TolbiInteriors_SelectEvents().

◆ TolbiInteriors_ExitThroughWindow()

UNUSED void TolbiInteriors_ExitThroughWindow ( void )
static

Leaves through a window transition of 24 frames. No event uses it.

Definition at line 94 of file tolbi_interiors.c.

Referenced by TolbiInteriors_ExitThroughWindow().

◆ TolbiInteriors_EnterDoor()

void TolbiInteriors_EnterDoor ( void )
static

Walking into one of the four doors at triggers 14 to 17: every placed actor stops, the door opens and the leader walks through it.

Definition at line 104 of file tolbi_interiors.c.

Referenced by TolbiInteriors_EnterDoor().

◆ TolbiInteriors_WatchWomanHideMedal()

void TolbiInteriors_WatchWomanHideMedal ( void )
static

After Colosso, entering by entrance 19: a woman finds something on the floor, is startled to see the party and hides it in the barrel behind the trash pile.

"Hey, what's this?" The thing is a Lucky Medal, found later in that barrel.

Definition at line 136 of file tolbi_interiors.c.

Referenced by TolbiInteriors_ApplyEntryState(), and TolbiInteriors_WatchWomanHideMedal().

◆ TolbiInteriors_WatchSailorsArgue()

void TolbiInteriors_WatchSailorsArgue ( void )
static

After Colosso, entering by entrance 16: three sailors argue about their captain, who won't sail the ship.

Definition at line 205 of file tolbi_interiors.c.

Referenced by TolbiInteriors_ApplyEntryState(), and TolbiInteriors_WatchSailorsArgue().

◆ TolbiInteriors_ApplyEntryState()

s32 TolbiInteriors_ApplyEntryState ( void )

Sets up the rooms on entry.

After Colosso: a row of three map cells takes new attributes, two of the sailors are drawn at a fixed priority, the medal woman stands where she hid the medal, the two short scenes play once each on their entrances, and the would-be warrior and actor 36 have left once the docks refunded the tickets.

Definition at line 238 of file tolbi_interiors.c.

Referenced by TolbiInteriors_ApplyEntryState().

◆ TolbiInteriors_TalkToItemShopkeeper()

void TolbiInteriors_TalkToItemShopkeeper ( s32 speaker)
static

The item shopkeeper: from across the counter (the leader facing west) opens shop 28; from elsewhere talks about the finals.

Definition at line 283 of file tolbi_interiors.c.

Referenced by TolbiInteriors_TalkToItemShopkeeper().

◆ TolbiInteriors_TalkToWeaponShopkeeper()

void TolbiInteriors_TalkToWeaponShopkeeper ( s32 speaker)
static

The weapon shopkeeper: across the counter (the leader facing north) opens the shop; otherwise talks about Colosso.

Definition at line 300 of file tolbi_interiors.c.

Referenced by TolbiInteriors_TalkToWeaponShopkeeper().

◆ TolbiInteriors_TalkToArmorShopkeeper()

void TolbiInteriors_TalkToArmorShopkeeper ( s32 speaker)
static

The armor shopkeeper: across the counter (the leader facing north) opens the shop; otherwise talks about the finals.

Definition at line 320 of file tolbi_interiors.c.

Referenced by TolbiInteriors_TalkToArmorShopkeeper().

◆ TolbiInteriors_TalkToChef()

void TolbiInteriors_TalkToChef ( s32 speaker)
static

The chef asks whether the party watched Colosso, which he missed.

Definition at line 339 of file tolbi_interiors.c.

Referenced by TolbiInteriors_TalkToChef().

◆ TolbiInteriors_TalkToWaiter()

void TolbiInteriors_TalkToWaiter ( s32 speaker)
static

After Colosso, a waiter grumbles about the chef's bad mood.

Definition at line 346 of file tolbi_interiors.c.

Referenced by TolbiInteriors_TalkToWaiter().

◆ TolbiInteriors_TalkToHost()

void TolbiInteriors_TalkToHost ( s32 speaker)
static

During the festival, a resident offers the party a bed.

Definition at line 354 of file tolbi_interiors.c.

Referenced by TolbiInteriors_TalkToHost().

◆ TolbiInteriors_TalkToMedalWoman()

void TolbiInteriors_TalkToMedalWoman ( s32 speaker)
static

The woman who hid the Lucky Medal.

Until the party takes it from the barrel she teases; once it is gone she greets them, startled, the first time, and then claims she is fine.

Definition at line 363 of file tolbi_interiors.c.

Referenced by TolbiInteriors_TalkToMedalWoman().

◆ TolbiInteriors_ReadMedalWomanMind()

void TolbiInteriors_ReadMedalWomanMind ( void )
static

Mind Read on the medal woman gives the hiding place away.

Definition at line 383 of file tolbi_interiors.c.

Referenced by TolbiInteriors_ReadMedalWomanMind().

◆ TolbiInteriors_TalkToAngrySailor()

void TolbiInteriors_TalkToAngrySailor ( s32 speaker)
static

The angry sailor complains the ships won't sail after Colosso.

Definition at line 395 of file tolbi_interiors.c.

Referenced by TolbiInteriors_TalkToAngrySailor().

◆ TolbiInteriors_TalkToWouldBeWarrior()

void TolbiInteriors_TalkToWouldBeWarrior ( s32 speaker)
static

After Colosso, the would-be warrior asks whether the party remembers him.

Definition at line 404 of file tolbi_interiors.c.

Referenced by TolbiInteriors_TalkToWouldBeWarrior().

◆ TolbiInteriors_TalkToPriest()

void TolbiInteriors_TalkToPriest ( s32 speaker)
static

The priest: across the counter (the leader facing north) opens the sanctum; otherwise talks about the festival.

Definition at line 412 of file tolbi_interiors.c.

Referenced by TolbiInteriors_TalkToPriest().

Variable Documentation

◆ gTolbiInteriorsSquashStretch

s32 gTolbiInteriorsSquashStretch[]
Initial value:
= {
SC_SET(SW_SCALE_X, 0x10000),
SC_SET(SW_SCALE_Y, 0x10000),
SC_ADD(SW_SCALE_X, -0x5000),
SC_ADD(SW_SCALE_Y, 0x1000),
SC_WAIT(1),
SC_ADD(SW_SCALE_X, 0x2800),
SC_ADD(SW_SCALE_Y, -2048),
SC_WAIT(1),
SC_ADD(SW_SCALE_X, 0x1400),
SC_ADD(SW_SCALE_Y, -1024),
SC_WAIT(1),
SC_ADD(SW_SCALE_X, 0x1400),
SC_ADD(SW_SCALE_Y, -1024),
SC_WAIT(1),
SC_ADD(SW_SCALE_X, -0x5000),
SC_ADD(SW_SCALE_Y, 0x1000),
SC_WAIT(1),
SC_ADD(SW_SCALE_X, 0x2800),
SC_ADD(SW_SCALE_Y, -2048),
SC_WAIT(1),
SC_ADD(SW_SCALE_X, 0x1400),
SC_ADD(SW_SCALE_Y, -1024),
SC_WAIT(1),
SC_ADD(SW_SCALE_X, 0x1400),
SC_ADD(SW_SCALE_Y, -1024),
SC_WAIT(40),
}
#define SC_SET(w, v)
Write a work value.
Definition objcmd.h:37
#define SC_LOOP(n, to)
Repeat up to n times.
Definition objcmd.h:28
#define SC_FOREVER
Definition objcmd.h:14
#define SC_ADD(w, v)
Definition objcmd.h:38
#define SC_WAIT(n)
Wait n frames.
Definition objcmd.h:16
#define SC_TOP
Script start.
Definition objcmd.h:13
@ SW_SCALE_Y
Definition objcmd.h:63
@ SW_SCALE_X
Definition objcmd.h:62

An actor that squashes and stretches twice, then rests 40 frames.

Definition at line 431 of file tolbi_interiors.c.

◆ gTolbiInteriorsEntrances

struct SceneEntrance gTolbiInteriorsEntrances[]

Definition at line 461 of file tolbi_interiors.c.

Referenced by TolbiInteriors_GetEntrances().

◆ gTolbiInteriorsExits

u32 gTolbiInteriorsExits[]
Initial value:
= {
SCENE_EXITS(136), SCENE_EXIT(1, 135, 2), SCENE_EXIT(2, 135, 3),
SCENE_EXIT(3, 135, 4), SCENE_EXIT(4, 135, 5), SCENE_EXIT(5, 135, 6),
SCENE_EXIT(6, 135, 7), SCENE_EXIT(7, 135, 8), SCENE_EXIT(8, 135, 9),
SCENE_EXIT(9, 135, 10), SCENE_EXIT(10, 136, 11), SCENE_EXIT(11, 136, 10),
SCENE_EXIT(12, 136, 17), SCENE_EXIT(13, 136, 16), SCENE_EXIT(14, 136, 18),
SCENE_EXIT(15, 136, 19), SCENE_EXIT(16, 136, 13), SCENE_EXIT(17, 136, 12),
SCENE_EXIT(18, 136, 14), SCENE_EXIT(19, 136, 15), SCENE_EXITS_END,
}
#define SCENE_EXITS(scene)
Definition field_scene.h:72
#define SCENE_EXIT(exit, scene, entrance)
Definition field_scene.h:73
#define SCENE_EXITS_END
Definition field_scene.h:77

Definition at line 495 of file tolbi_interiors.c.

Referenced by TolbiInteriors_GetExits().

◆ gTolbiInteriorsPlacements

struct ScenePlacement gTolbiInteriorsPlacements[]

Definition at line 506 of file tolbi_interiors.c.

Referenced by TolbiInteriors_SelectPlacements().

◆ gTolbiInteriorsPlacementsAfterColosso

struct ScenePlacement gTolbiInteriorsPlacementsAfterColosso[]

Definition at line 556 of file tolbi_interiors.c.

Referenced by TolbiInteriors_SelectPlacements().

◆ gTolbiInteriorsEventsFestival

struct SceneEvent gTolbiInteriorsEventsFestival[]

Definition at line 618 of file tolbi_interiors.c.

Referenced by TolbiInteriors_SelectEvents().

◆ gTolbiInteriorsEventsFinalsDay

struct SceneEvent gTolbiInteriorsEventsFinalsDay[]

Definition at line 693 of file tolbi_interiors.c.

Referenced by TolbiInteriors_SelectEvents().

◆ gTolbiInteriorsEventsAfterColosso

struct SceneEvent gTolbiInteriorsEventsAfterColosso[]

Definition at line 773 of file tolbi_interiors.c.

Referenced by TolbiInteriors_SelectEvents().

◆ gTolbiInteriorsDoorOpening

u16 gTolbiInteriorsDoorOpening[]
Initial value:
= {
MAP_CELL_STEP(2, 123, 1, 2, 6),
MAP_CELL_STEP(4, 123, 1, 2, 6),
}
#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 860 of file tolbi_interiors.c.

◆ gTolbiInteriorsDoors

struct MapCellAnim gTolbiInteriorsDoors[]
Initial value:
= {
}
u16 gTolbiInteriorsDoorOpening[]

Definition at line 866 of file tolbi_interiors.c.

Referenced by TolbiInteriors_EnterDoor().