vale_babi.c
The south-west of Vale around Isaac's house, through the stormy night, the party's departure and its return; entrance 19 is instead a room of Babi's scholars, and entrance 22 shows the Mythril Bag.
games/tbs/src/scene/vale_babi.c on GitHub
The south-west of Vale around Isaac's house, through the stormy night, the party's departure and its return; entrance 19 is instead a room of Babi's scholars, and entrance 22 shows the Mythril Bag.
Functions
ValeBabi_GetEntrances
const struct SceneEntrance *ValeBabi_GetEntrances(void)
Returns the entrances, among them the scenes played on arrival: 19 from Babi's palace (its exit 11), 20 where a new game begins (menu/clear.c, and ValeHome's exit 50), 21 from this scene's own exit 20, and 22 from Kraden's cottage (ValeKraden's exit 13).
ValeBabi_GetExits
const u32 *ValeBabi_GetExits(void)
On the stormy night the exits lead into the storm.
ValeBabi_GetPlacements
const struct ScenePlacement *ValeBabi_GetPlacements(void)
Places Babi's scholars, or Vale's villagers as the story has left them.
Event_ScholarAsksAboutKraden
static void Event_ScholarAsksAboutKraden(s32 speakerId)
A scholar asks whether the party knows Kraden. Reached by talking to scholar 9 in Babi's scholars' room (entrance 19) once FLAG_COLOSSO_OVER is set; speakerId is the actor spoken to.
Used by gValeBabi_ScholarsLaterEvents.
ValeBabi_GetEvents
const struct SceneEvent *ValeBabi_GetEvents(void)
Chooses the events: Babi's scholars talk differently once the Colosso finals are over; Vale's villagers follow the storm and the story.
Event_AskIsaacHisBusiness
static void Event_AskIsaacHisBusiness(void)
The neighbour asks whether Isaac has business with him, and sends him off either way. "Hey... Boy..." Reached by talking to the neighbour (actor 16) before the party leaves Vale (gValeBabi_Events).
Used by gValeBabi_Events.
Event_AskWhetherMaskedManWasFelix
static void Event_AskWhetherMaskedManWasFelix(void)
A villager asks whether the masked man was Felix, and wonders whether Jenna can be trusted. Reached by talking to actor 14 once the party has left Vale and until it reaches Kalay (gValeBabi_EventsAfterLeaving).
Used by gValeBabi_EventsAfterLeaving.
ValeBabi_CloseScreenAndExit
static void ValeBabi_CloseScreenAndExit(s32 exitId)
Stops storm lightning before fading through the requested exit. Called by the exit events below.
Used by Event_ExitCenterAreaNorth, Event_ExitCenterAreaSouth, Event_ExitNorthArea, Event_ExitNortheastArea, Event_ExitNorthwestArea, Event_ExitSouthAreaSouth, Event_ExitSouthAreaWest, Event_ExitSoutheastArea, Event_ExitSouthwestArea, Event_ExitWestAreaNorth, Event_ExitWestAreaSouth.
Event_ExitNorthwestArea
static void Event_ExitNorthwestArea(void)
Reached by cell code 1; takes exit 1, to ValeHome's entrance 6.
Used by gValeBabi_Events, gValeBabi_EventsAfterKalay, gValeBabi_EventsAfterLeaving, gValeBabi_StormEvents.
Event_ExitNorthArea
static void Event_ExitNorthArea(void)
Reached by cell code 2; takes exit 2, to Kraden's cottage (ValeKraden's entrance 3).
Used by gValeBabi_Events, gValeBabi_EventsAfterKalay, gValeBabi_EventsAfterLeaving, gValeBabi_StormEvents.
Event_ExitNortheastArea
static void Event_ExitNortheastArea(void)
Reached by cell code 3; takes exit 3, to ValeHome's entrance 2.
Used by gValeBabi_Events, gValeBabi_EventsAfterKalay, gValeBabi_EventsAfterLeaving, gValeBabi_StormEvents.
Event_ExitWestAreaSouth
static void Event_ExitWestAreaSouth(void)
Reached by cell code 4; takes exit 4, to ValeHome's entrance 7.
Used by gValeBabi_Events, gValeBabi_EventsAfterKalay, gValeBabi_EventsAfterLeaving, gValeBabi_StormEvents.
Event_ExitWestAreaNorth
static void Event_ExitWestAreaNorth(void)
Reached by cell code 5; takes exit 5, to this scene's entrance 8.
Used by gValeBabi_Events, gValeBabi_EventsAfterKalay, gValeBabi_EventsAfterLeaving, gValeBabi_StormEvents.
Event_ExitCenterAreaSouth
static void Event_ExitCenterAreaSouth(void)
Reached by cell code 6; takes exit 6, to Vale's entrance 8, or on the stormy night to ValeStorm's.
Used by gValeBabi_Events, gValeBabi_EventsAfterKalay, gValeBabi_EventsAfterLeaving, gValeBabi_StormEvents.
Event_ExitCenterAreaNorth
static void Event_ExitCenterAreaNorth(void)
Reached by cell code 7; takes exit 7, to this scene's entrance 9.
Used by gValeBabi_Events, gValeBabi_EventsAfterKalay, gValeBabi_EventsAfterLeaving, gValeBabi_StormEvents.
Event_ExitSouthwestArea
static void Event_ExitSouthwestArea(void)
Reached by cell code 8; takes exit 8, to this scene's entrance 5.
Used by gValeBabi_Events, gValeBabi_EventsAfterKalay, gValeBabi_EventsAfterLeaving, gValeBabi_StormEvents.
Event_ExitSouthAreaWest
static void Event_ExitSouthAreaWest(void)
Reached by cell code 9; takes exit 9, to this scene's entrance 7.
Used by gValeBabi_Events, gValeBabi_EventsAfterKalay, gValeBabi_EventsAfterLeaving, gValeBabi_StormEvents.
Event_ExitSouthAreaSouth
static void Event_ExitSouthAreaSouth(void)
Reached by cell code 10; takes exit 10, to ValeStorm's entrance 12.
Used by gValeBabi_Events, gValeBabi_EventsAfterKalay, gValeBabi_EventsAfterLeaving, gValeBabi_StormEvents.
Event_ExitSoutheastArea
static void Event_ExitSoutheastArea(void)
Reached by cell code 11; takes exit 11, to ValeStorm's entrance 13.
Used by gValeBabi_Events, gValeBabi_EventsAfterKalay, gValeBabi_EventsAfterLeaving, gValeBabi_StormEvents.
ValeBabi_Initialize
s32 ValeBabi_Initialize(void)
Sets up the stormy night or the villagers of the story, and plays the scenes of entrances 20 to 22. Called by Field_RunScene once the actors are placed. Entrance 20 sets FLAG_VALE_STORM before Event_DoraWakesIsaac; back from Kalay, Dora is put back in her sickbed unless FLAG_SCENE_TEMP_03 says she got up.
Event_DoraWakesIsaac
static void Event_DoraWakesIsaac(void)
Dora wakes Isaac on the stormy night, makes him take his tunic, and leads him out into the storm. "The Mt. Aleph Boulder is going to fall!" Called by ValeBabi_Initialize on arrival by entrance 20, where a new game begins. Sets FLAG_ISAAC_WEARS_TUNIC and takes exit 20, back into this scene by entrance 21, where Event_HurryToThePlaza follows.
Used by ValeBabi_Initialize.
SetBlendTarget
static __inline__ void SetBlendTarget(u32 value)
Selects the hardware blend targets for the storm sequence.
Used by Event_HurryToThePlaza.
Event_HurryToThePlaza
static void Event_HurryToThePlaza(void)
Kyle calls to Isaac and Dora to hurry; actor 10 shakes, falls and fades as they run to the plaza. Called by ValeBabi_Initialize on arrival by entrance 21, after Event_DoraWakesIsaac. Takes exit 21, to ValeStorm's entrance 15, where Event_DoraSendsIsaacToThePlaza follows.
Used by ValeBabi_Initialize.
Event_TalkToInnkeeper
static void Event_TalkToInnkeeper(void)
The innkeeper offers a room from behind the counter; elsewhere talks of the travelers, the eruption, or, back from Kalay, welcomes Isaac home. Reached by talking to the innkeeper (actor 13) in every Vale table but the storm's, and back from Kalay by Mind Read on him until he has welcomed Isaac. Sets FLAG_VALE_INNKEEPER_WELCOMED_ISAAC on that welcome.
Used by gBilibinInteriorsEvents, gInteriorReopenedEvents, gInteriorSealedEvents, gSuhallaInteriorsEvents, gSuhallaInteriorsEventsAfterAudience, gValeBabi_Events, gValeBabi_EventsAfterKalay, gValeBabi_EventsAfterLeaving, gVaultInteriorsRevisit_Events, gVaultInteriors_Events, gVaultInteriors_EventsAfterThieves.
Event_NeighborSeesIsaacHasGrown
static void Event_NeighborSeesIsaacHasGrown(void)
Back from Kalay, the neighbour remarks how much Isaac has grown. Reached by talking to the neighbour (actor 16) while FLAG_VALE_INNKEEPER_WELCOMED_ISAAC is clear, or by Mind Read on him until FLAG_VALE_NEIGHBOR_SAW_ISAAC_GROWN is set, which this sets. XXX: the talk row tests the innkeeper's flag, not this one; likely a slip, because the Mind Read row tests this one, but both show the same line.
Used by gValeBabi_EventsAfterKalay.
Event_ReadInnkeepersThoughts
static void Event_ReadInnkeepersThoughts(void)
Mind Read on the innkeeper: Dora would not let Isaac stay in Vale. Reached back from Kalay once he has welcomed Isaac. Sets FLAG_READ_THOUGHTS_ABOUT_DORA.
Used by gValeBabi_EventsAfterKalay.
Event_ReadThoughtsAboutDorasIllness
static void Event_ReadThoughtsAboutDorasIllness(void)
Mind Read on the neighbour: Dora was struck with illness. Reached back from Kalay once he has remarked on Isaac. Sets FLAG_READ_THOUGHTS_ABOUT_DORA.
Used by gValeBabi_EventsAfterKalay.
Event_VisitSickDora
static void Event_VisitSickDora(void)
Back from Kalay, Isaac visits Dora in her sickbed; she asks who told him she was ill, then gets up to show she feels well. Reached by talking to Dora (actor 8), or by Mind Read on her, until FLAG_VISITED_SICK_DORA is set. Sets it and FLAG_SCENE_TEMP_03.
Used by gValeBabi_EventsAfterKalay.
Event_TalkToDora
static void Event_TalkToDora(void)
Talking to Dora: in her sickbed she murmurs Kyle's name; once up, she tells Isaac not to worry. Reached by talking to her back from Kalay once FLAG_VISITED_SICK_DORA is set; she is up while FLAG_SCENE_TEMP_03 is set.
Used by gValeBabi_EventsAfterKalay.
ValeBabi_RestoreRoomPatch
static void ValeBabi_RestoreRoomPatch(void)
Restores the room's tiles and collision patch outside the storm sequence. Called by ValeBabi_Initialize when FLAG_VALE_STORM is clear.
Used by ValeBabi_Initialize.
Event_ShowMythrilBag
static void Event_ShowMythrilBag(void)
The Mythril Bag rises and wobbles before Kraden, with no text. Called by ValeBabi_Initialize on arrival by entrance 22, from Kraden's cottage, while he prepares for the first Sol Sanctum visit (Event_TalkToKraden). Takes exit 22 back outside (ValeKraden's entrance 10), where Event_KradenSetsOff gathers the party.
Used by ValeBabi_Initialize.
ValeBabi_FlashPaletteAndSpawnPair
UNUSED static void ValeBabi_FlashPaletteAndSpawnPair(union FieldObject *object)
Flashes between two palettes and emits a paired effect every sixteen frames.
ValeBabi_CyclePaletteAndSpawnPair
static void ValeBabi_CyclePaletteAndSpawnPair(union FieldObject *object)
Cycles six palettes on odd frames and periodically emit paired effects.
Used by ValeBabi_CyclePaletteWithParticles.
ValeBabi_CyclePaletteOnOddFrames
static void ValeBabi_CyclePaletteOnOddFrames(union FieldObject *object)
Advances deterministically through six palettes on odd frames.
Used by ValeBabi_CyclePaletteWithoutParticles.
ValeBabi_SpawnEffectPair
static void ValeBabi_SpawnEffectPair(union FieldObject *object)
Copies the parent's terrain height into two oppositely moving vertical effects.
Used by ValeBabi_CyclePaletteAndSpawnPair, ValeBabi_FlashPaletteAndSpawnPair.
ValeBabi_DemonstrateCatch
static void ValeBabi_DemonstrateCatch(void)
Catch's effect plays on Dora, then its objects are released. Called by Event_DoraWakesIsaac as Dora hands Isaac his tunic.
Used by Event_DoraWakesIsaac.
Also, functions without a comment: ValeBabi_GetRegions, SetBlendAlpha, ValeBabi_CyclePaletteWithParticles, ValeBabi_CyclePaletteWithoutParticles.
Enumerations
ValeBabiActor
enum ValeBabiActor
Vale's placed actors, numbered in the order of gValeBabi_Placements (the scholars of entrance 19 are numbered from 8 in their own table).
| Value | = | |
|---|---|---|
ACTOR_DORA | 8 | Isaac's mother. "Isaac, wake up!" |
ACTOR_KYLE | 9 | Isaac's father (sprite 0x35, Kyle in vale_storm.c). "Isaac, Dora, hurry! The Boulder could fall at any second!" |
ACTOR_INNKEEPER | 13 | |
ACTOR_NEIGHBOR | 16 | A neighbour who tells Isaac to be off, and who knows of Dora's illness once the party is back from Kalay. "Hey... Boy..." |
ACTOR_KRADEN | 18 | Kraden's sprite (0x1e, as in Sol Sanctum's scenes), seen only from entrance 22. |
ValeBabiPlaceFlag
enum ValeBabiPlaceFlag
Vale's place flags this scene keeps while the party is in Vale.
| Value | = | |
|---|---|---|
FLAG_VALE_INNKEEPER_WELCOMED_ISAAC | 0x300 | Back from Kalay, the innkeeper welcomed Isaac home. |
FLAG_VALE_NEIGHBOR_SAW_ISAAC_GROWN | 0x301 | Back from Kalay, the neighbour remarked how much Isaac has grown. |
Globals, without a comment: gValeBabi_LeaveHouseScript, gValeBabi_DoraLeavesScript, gValeBabi_IsaacLeavesScript, gValeBabi_DoraRunsAheadScript, gValeBabi_IsaacRunsAheadScript, gValeBabi_DoraRunsBackScript, gValeBabi_IsaacRunsBackScript, gValeBabi_RunToPlazaScript, gValeBabi_Actor10ShakesScript, gValeBabi_Actor10FallsScript, gValeBabi_DoraFacesIsaacScript, gValeBabi_MythrilBagRisesScript, gValeBabi_MythrilBagWobblesScript, gValeBabi_Entrances, gValeBabi_Exits, gValeBabi_StormExits, gValeBabi_Placements, gValeBabi_PlacementsAfterLeaving, gValeBabi_PlacementsAfterKalay, gValeBabi_ScholarsPlacements, gValeBabi_StormEvents, gValeBabi_Events, gValeBabi_EventsAfterLeaving, gValeBabi_EventsAfterKalay, gValeBabi_ScholarsEvents, gValeBabi_ScholarsLaterEvents.