vale_interiors.c
The houses and shops of Vale.
games/tbs/src/scene/vale_interiors.c on GitHub
The houses and shops of Vale. Garet's family lives in the house at entrance 6: his grandfather, his grandmother, and his parents ("Mom, Dad... I'm home...").
Functions
ValeInteriors_AdvanceDriftingSprite
static s32 ValeInteriors_AdvanceDriftingSprite(struct ScriptInterpreter *interpreter)
Moves and grows a sprite drifting up from Garet's sleeping grandfather.
Called each frame by gValeInteriors_DriftingSpriteScript; the actor's timer and work are its x and y steps in signed 8.8 pixels, set by ValeInteriors_SpawnDriftingSprite.
Used by gValeInteriors_DriftingSpriteScript.
ValeInteriors_GetExits
const u32 *ValeInteriors_GetExits(void)
On the stormy night, the doors lead out into the storm.
ValeInteriors_GetPlacements
const struct ScenePlacement *ValeInteriors_GetPlacements(void)
Selects the placements for the day the story begins, after the party has left Vale (FLAG_PARTY_LEFT_VALE), or after Kalay (FLAG_REACHED_KALAY), and marks which of their actors are in view.
ValeInteriors_GetEvents
const struct SceneEvent *ValeInteriors_GetEvents(void)
Selects the events for the current visit to Vale: the stormy night's (FLAG_VALE_STORM), after Kalay, after the party has left, or the day the story begins.
Event_AskAboutKradensStudies
static void Event_AskAboutKradensStudies(void)
A villager asks whether Isaac knew why Kraden came to Vale. He came to study Mt. Aleph.
Reached by talking to actor 15 on the day the story begins.
Used by gValeInteriors_Events.
Event_AskToScareVisitors
static void Event_AskToScareVisitors(void)
A villager asks Isaac to help scare Kraden's visitors.
Reached by talking to actor 19 on the day the story begins.
Used by gValeInteriors_Events.
ValeInteriors_GiveFarewellHerb
static void ValeInteriors_GiveFarewellHerb(void)
After the party has left Vale, the item shopkeeper gives Isaac a Herb as a farewell gift, and afterwards urges him to save Jenna.
Called by Event_TalkToItemShopkeeper away from the counter, after the party has left and before Kalay. Gives the Herb and sets FLAG_VALE_FAREWELL_HERB_RECEIVED once; afterwards the shopkeeper turns to watch the leader.
Used by Event_TalkToItemShopkeeper.
Event_AskAboutCulpritsPowers
static void Event_AskAboutCulpritsPowers(void)
A villager tells of the culprits' strange powers and asks about them.
Reached by talking to actor 16 after the party has left Vale.
Used by gValeInteriors_EventsAfterLeaving.
Event_AskAboutDora
static void Event_AskAboutDora(void)
Back from Kalay, Garet's father asks whether Isaac heard them talking about Dora.
Reached by talking to Garet's father (actor 10) after Kalay.
Used by gValeInteriors_EventsAfterKalay.
Event_WorryAboutTravelersHealth
static void Event_WorryAboutTravelersHealth(void)
Garet's mother hopes the travelers did not get sick on the way.
Reached by talking to Garet's mother (actor 11) after Kalay.
Used by gValeInteriors_EventsAfterKalay.
ValeInteriors_RequestWindowExit
static void ValeInteriors_RequestWindowExit(s32 exitId)
Leaves a house through its door: the exit sound plays and the screen closes, stopping the lightning first on the stormy night.
Used by Event_LeaveByDoor1, Event_LeaveByDoor2, Event_LeaveByDoor3, Event_LeaveByDoor4, Event_LeaveByDoor5, Event_LeaveByDoor6, Event_LeaveByDoor7, Event_LeaveByDoor8.
ValeInteriors_Initialize
s32 ValeInteriors_Initialize(void)
Arriving in a house: on the stormy night the residents are gone and lightning flashes outside; back from Kalay, entering Garet's house the first time plays his homecoming.
The scene's initialize entry. Runs Event_GaretComesHome from entrance 6 after Kalay until FLAG_GARET_CAME_HOME is set. From entrance 2, once the party has left Vale, Jenna's grandmother lies sick in bed.
Event_TalkToWeaponShopkeeper
static void Event_TalkToWeaponShopkeeper(void)
Opens the weapon shop across the counter, or the shopkeeper speaks.
Reached by talking to the weapon shopkeeper (actor 21) in every table but the stormy night's. Facing north, across the counter, opens shop 1; else the shopkeeper's line follows the story.
Used by gBilibinInteriorsEvents, gValeInteriors_Events, gValeInteriors_EventsAfterKalay, gValeInteriors_EventsAfterLeaving.
Event_TalkToArmorShopkeeper
static void Event_TalkToArmorShopkeeper(void)
Opens the armor shop across the counter, or the shopkeeper speaks.
Reached by talking to the armor shopkeeper (actor 22) in every table but the stormy night's; opens shop 2 when facing north.
Used by gBilibinInteriorsEvents, gValeInteriors_Events, gValeInteriors_EventsAfterKalay, gValeInteriors_EventsAfterLeaving.
Event_TalkToItemShopkeeper
static void Event_TalkToItemShopkeeper(void)
Opens the item shop across the counter, or the shopkeeper speaks.
Reached by talking to the item shopkeeper (actor 20) in every table but the stormy night's; opens shop 3 when facing north. After the party has left and before Kalay, ValeInteriors_GiveFarewellHerb speaks instead.
Used by gBilibinInteriorsEvents, gValeInteriors_Events, gValeInteriors_EventsAfterKalay, gValeInteriors_EventsAfterLeaving.
ValeInteriors_FamilyNods
static inline void ValeInteriors_FamilyNods(void)
Garet's grandparents and father nod.
Used by Event_GaretComesHome.
ValeInteriors_PlayRepeatedAnimationAndWait
static inline void ValeInteriors_PlayRepeatedAnimationAndWait(s32 actorId, s32 animation)
Starts the repeated motion before waiting for the requested animation.
Used by Event_GaretComesHome.
Event_GaretComesHome
static void Event_GaretComesHome(void)
Back from Kalay, Garet comes home: his grandfather dozes, his parents argue over whether to look for him, and his grandmother spots him first. Garet introduces Ivan and Mia, the family sees them off, and his father paces.
Called by ValeInteriors_Initialize from entrance 6 after Kalay, until FLAG_GARET_CAME_HOME is set; sets it. Adds and removes the callback ValeInteriors_SpawnDriftingSprite, and leaves the father pacing.
Used by ValeInteriors_Initialize.
ValeInteriors_SpawnDriftingSprite
static void ValeInteriors_SpawnDriftingSprite(void)
Sends a sprite drifting up from Garet's sleeping grandfather, one of the three at frames 10, 20 and 30 of every 180.
A callback Event_GaretComesHome adds while the grandfather dozes.
Used by Event_GaretComesHome.
Also, functions without a comment: ValeInteriors_GetEntrances, ValeInteriors_GetRegions, Event_LeaveByDoor1, Event_LeaveByDoor2, Event_LeaveByDoor3, Event_LeaveByDoor4, Event_LeaveByDoor5, Event_LeaveByDoor6, Event_LeaveByDoor7, Event_LeaveByDoor8.
Enumerations
ValeInteriorsActor
enum ValeInteriorsActor
| Value | = | |
|---|---|---|
ACTOR_GARETS_GRANDFATHER | 8 | Garet's grandfather. "Isaac, please take care of my grandson, Garet." |
ACTOR_GARETS_GRANDMOTHER | 9 | Garet's grandmother. "Grandma! What's the matter? Are you choking?" |
ACTOR_GARETS_FATHER | 10 | Garet's father. "I'm proud of you, Garet. My own son...on such an important quest!" |
ACTOR_GARETS_MOTHER | 11 | Garet's mother. "As mothers, Dora and I will always worry about you." |
ACTOR_JENNAS_GRANDMOTHER | 13 | Jenna's grandmother. "Please return my precious granddaughter, Jenna, to me." Once Jenna is taken, actor 14 says she "grew sick with despair", and she lies in bed. |
ACTOR_ITEM_SHOPKEEPER | 20 | |
ACTOR_WEAPON_SHOPKEEPER | 21 | |
ACTOR_ARMOR_SHOPKEEPER | 22 | |
ACTOR_FIRST_DRIFTING_SPRITE | 23 | Three sprites drifting up from Garet's sleeping grandfather. |
Globals, without a comment: gValeInteriors_FaceTargetScript, gValeInteriors_FatherPacingScript, gValeInteriors_PartyLeavesScript, gValeInteriors_DriftingSpriteScript, gValeInteriors_Entrances, gValeInteriors_Exits, gValeInteriors_StormExits, gValeInteriors_Placements, gValeInteriors_PlacementsAfterLeaving, gValeInteriors_PlacementsAfterKalay, gValeInteriors_StormEvents, gValeInteriors_Events, gValeInteriors_EventsAfterLeaving, gValeInteriors_EventsAfterKalay.