Alchemy

vault_interiors.c

The houses, shops and inn of Vault while Hammet's rod is missing.

games/tbs/src/scene/vault_interiors.c on GitHub

The houses, shops and inn of Vault while Hammet's rod is missing.

Functions

Scene_GetRegions

const struct SceneRegion *Scene_GetRegions(void)

Returns the one exit region: the box around (648, 416) in the room with the crate, which takes exit 13 back out to Vault.

Line 154

Scene_GetPlacements

const struct ScenePlacement *Scene_GetPlacements(void)

Places the townspeople, or, for the inn's loft (entrances 15 to 17), the roofer, the mayor, the thieves, their crates and the found treasures.

Line 162

VaultInteriors_TryJumpTo

static s32 VaultInteriors_TryJumpTo(struct FieldPosition *pos)

Jumps the leader to the requested destination when nothing blocks it there; returns 1 when it jumped. Only the editions before the first patch have it; the patched ones look ahead instead (Engine_LeaderCheckAhead).

Used by Event_JumpAcrossRoofGap.

Line 183

Event_JumpAcrossRoofGap

static void Event_JumpAcrossRoofGap(void)

Facing north or south across the gap in the roof, the leader jumps it.

Reached by walking onto cell code 40. Then copies the cell (41, 85) or (43, 85) over the gap's cell (42, 85), whichever side the leader faced.

Used by gVaultInteriors_Events.

Line 220

Event_CheckCrateMoved

static void Event_CheckCrateMoved(void)

Once the crate has been moved aside to column 42, the passage behind it opens.

Reached by Move on the crate (actor 26) until FLAG_VAULT_CRATE_MOVED is set; sets it when the crate has reached column 42.

Used by gVaultInteriors_Events.

Line 267

Event_TalkToWeaponMerchant

static void Event_TalkToWeaponMerchant(void)

Across the counter the weapon shop opens; otherwise the merchant lost expensive goods too, or found the stolen weapons rusted in the cemetery.

Reached by talking to the weapon merchant (actor 19), before and after the thieves are jailed (FLAG_VAULT_THIEVES_JAILED picks the line). The armor merchant, the inn and the item shop below work the same way: the counter is between them when the leader faces north (0xa001 to 0xdfff).

Used by gInteriorReopenedEvents, gInteriorSealedEvents, gVaultInteriorsRevisit_Events, gVaultInteriors_Events, gVaultInteriors_EventsAfterThieves.

Line 286

Event_TalkToArmorMerchant

static void Event_TalkToArmorMerchant(void)

Across the counter the armor shop opens; otherwise the merchant wants the thieves to pay, or advises preparing for the cave in the Goma Range.

Reached by talking to the armor merchant (actor 20).

Used by gInteriorReopenedEvents, gInteriorSealedEvents, gVaultInteriorsRevisit_Events, gVaultInteriors_Events, gVaultInteriors_EventsAfterThieves.

Line 307

Event_TalkToInnkeeper

static void Event_TalkToInnkeeper(void)

Across the counter the inn opens; otherwise the innkeeper defends the guests everyone suspects, or learns the goods were hidden in his loft.

Reached by talking to the innkeeper (actor 23).

Used by gBilibinInteriorsEvents, gInteriorReopenedEvents, gInteriorSealedEvents, gSuhallaInteriorsEvents, gSuhallaInteriorsEventsAfterAudience, gValeBabi_Events, gValeBabi_EventsAfterKalay, gValeBabi_EventsAfterLeaving, gVaultInteriorsRevisit_Events, gVaultInteriors_Events, gVaultInteriors_EventsAfterThieves.

Line 328

Event_GaretRefusesToLeave

static void Event_GaretRefusesToLeave(void)

Garet refuses to leave. "We don't have time for that, Isaac!"

Reached through raised event 250, which the engine raises in place of a menu or a shortcut while FLAG_MENUS_RAISE_EVENT is set, as the party corners the suspects.

Used by gVaultInteriors_Events.

Line 352

Event_SearchEmptyBarrel

static void Event_SearchEmptyBarrel(void)

Isaac checks the barrel but doesn't find anything.

Reached by searching cell code 41 before the thieves are jailed; after, the same spot holds the Bone (Vault_FindBone).

Used by gVaultInteriors_Events.

Line 364

Event_SearchEmptyChest

static void Event_SearchEmptyChest(void)

Isaac checks the chest, but it is empty.

Reached by talking to one of the loft's three crates (actors 15 to 17).

Used by gVaultInteriors_AtticEvents.

Line 374

Scene_GetEvents

const struct SceneEvent *Scene_GetEvents(void)

Returns the loft's events for entrances 15 to 17, else the houses' events, which change once FLAG_VAULT_THIEVES_JAILED is set.

Line 383

VaultInteriors_StandAndShowMessage

static void VaultInteriors_StandAndShowMessage(s32 x)

Stands the speaker, faces the leader, and shows the selected message.

Used by Event_ChildWorriesAboutFather, Event_MayorAsksHelpForIvan, Event_TalkAboutMissingThings, Event_TalkAboutRocks, Event_WarnAboutThreeStrangers.

Line 397

VaultInteriors_AskYesNoAndShowReply

static void VaultInteriors_AskYesNoAndShowReply(s32 x)

Faces the leader and selects the next reply when the answer is no.

Used by Event_AskAboutDefeatingThieves, Event_AskWhetherThievesCameFromLunpa, Event_ChildAsksAboutTravel, Event_OfferIvansSecret, Event_TalkToItemMerchant.

Line 406

Event_ChildAsksAboutTravel

static void Event_ChildAsksAboutTravel(void)

The child asks about travel. "Hey, mister! Is it fun to see strange new places?"

Reached by talking to the child (actor 11) before the thieves are jailed.

Used by gVaultInteriors_Events.

Line 419

Event_OfferIvansSecret

static void Event_OfferIvansSecret(void)

Offers Ivan's secret. "Ivan has great powers. Wouldn't you like to know what they are?"

Reached by talking to actor 15 until FLAG_VAULT_IVAN_JOINED_ROD_SEARCH is set; then the row after it tells the secret: Ivan can talk with animals.

Used by gVaultInteriors_Events.

Line 432

Event_TalkToItemMerchant

static void Event_TalkToItemMerchant(void)

Across the counter the item shop opens; otherwise a greeting, or, after the thieves are jailed, the bridge is out. "Did you just arrive in town today?"

Reached by talking to the item merchant (actor 21).

Used by gInteriorReopenedEvents, gInteriorSealedEvents, gVaultInteriorsRevisit_Events, gVaultInteriors_Events, gVaultInteriors_EventsAfterThieves.

Line 444

Event_TalkAboutRocks

static void Event_TalkAboutRocks(void)

The gem owner's wife wishes their rocks were gems, or, after the thieves are jailed, is glad they were caught before stealing the gem.

Reached by talking to the gem owner's wife (actor 9).

Used by gVaultInteriors_Events, gVaultInteriors_EventsAfterThieves.

Line 464

Event_TalkAboutMissingThings

static void Event_TalkAboutMissingThings(void)

Talks about missing things, or, after the thieves are jailed, says they hid the treasure in the loft and more in the cemetery. "Is it just me, or am I missing something?"

Reached by talking to Grandpa (actor 12).

Used by gVaultInteriors_Events, gVaultInteriors_EventsAfterThieves.

Line 480

Event_MayorAsksHelpForIvan

static void Event_MayorAsksHelpForIvan(void)

The mayor asks for someone to help Ivan; once the party has agreed, he thanks them the first time and asks them to look after Ivan after that.

Reached by talking to the mayor (actor 16) before the thieves are jailed. Sets FLAG_VAULT_MAYOR_THANKED_PARTY with the thanks.

Used by gVaultInteriors_Events.

Line 496

Event_WarnAboutThreeStrangers

static void Event_WarnAboutThreeStrangers(void)

The three strangers have fooled the innkeeper and his wife.

Reached by talking to the bone giver (actor 18) before the thieves are jailed.

Used by gVaultInteriors_Events.

Line 521

Event_SuspectedLeaderDodges

static void Event_SuspectedLeaderDodges(void)

The suspected leader cries out and runs to his next spot, chosen by the way he faces and where he is on his route. "Ow! Stop it!"

Reached by Mind Read on him (actor 24), and by talking to him once FLAG_VAULT_SUSPECTS_MIND_READ is set (before, he only says Ivan creeps him out); neither while the party corners him. His timer holds his place on the six-step route, wrapping from 5 to 0.

Used by gVaultInteriors_Events.

Line 535

VaultInteriors_ApplySecondSuspectRoute

static inline void VaultInteriors_ApplySecondSuspectRoute(struct FieldActor *actor, s32 scriptRow, s32 routePair, u16 routeDelta)

Selects a response script and advances the second suspect's route state.

Used by Event_SuspectedThiefDodges.

Line 587

Event_SuspectedThiefDodges

static void Event_SuspectedThiefDodges(void)

The suspected thief cries out and runs to his next spot. "No! Leave me alone!"

Reached as Event_SuspectedLeaderDodges is, on actor 25. His timer holds his place on his route (4 at its start).

Used by gVaultInteriors_Events.

Line 601

Event_AskWhetherThievesCameFromLunpa

static void Event_AskWhetherThievesCameFromLunpa(void)

Asks whether the thieves came from Lunpa. "Did those thieves come from Lunpa?"

Reached by talking to the wary neighbor (actor 10) after the thieves are jailed; the child and actor 14 below are reached the same way.

Used by gVaultInteriors_EventsAfterThieves.

Line 653

Event_ChildWorriesAboutFather

static void Event_ChildWorriesAboutFather(void)

The child's father worries about the prisoners from Lunpa.

Used by gVaultInteriors_EventsAfterThieves.

Line 661

Event_AskAboutDefeatingThieves

static void Event_AskAboutDefeatingThieves(void)

Asks about defeating the thieves. "I heard you defeated those thieves!"

Used by gVaultInteriors_EventsAfterThieves.

Line 669

Event_MayorGivesWaterOfLife

static void Event_MayorGivesWaterOfLife(void)

After the thieves are jailed, the mayor thanks Isaac and gives the promised Water of Life, if there is room; then asks whether the party is heading beyond the Goma Range, and points them to the cave on the way to Bilibin.

Reached by talking to the mayor (actor 16) after the thieves are jailed. Gives the Water of Life and sets FLAG_VAULT_WATER_OF_LIFE_RECEIVED, once; with a full bag he says to come back for it.

Used by gVaultInteriors_EventsAfterThieves.

Line 683

Event_OfferBones

static void Event_OfferBones(void)

The bone giver offers leftover bones from dinner; a yes gets a Bone if there is room, a no a nod.

Reached by talking to the bone giver (actor 18) after the thieves are jailed, while the leader is not beside the Bone on the floor (FLAG_SCENE_TEMP_50 clear). Gives a Bone and sets FLAG_VAULT_BONE_RECEIVED.

Used by gVaultInteriorsRevisit_Events, gVaultInteriors_EventsAfterThieves.

Line 722

Event_ReadMindOnRock

static void Event_ReadMindOnRock(void)

Mind Read on the wife: let me see that rock, or maybe it is worthless.

Reached by Mind Read on the gem owner's wife (actor 9); the Mind Read events below are reached the same way on the actor each names, before and after the thieves are jailed (FLAG_VAULT_THIEVES_JAILED picks the thought).

Used by gVaultInteriors_Events, gVaultInteriors_EventsAfterThieves.

Line 764

Event_ReadChildMind

static void Event_ReadChildMind(void)

Mind Read on the child: what is the outside world like, or Father looks sad.

Used by gVaultInteriors_Events, gVaultInteriors_EventsAfterThieves.

Line 777

Event_ReadMindOnThieves

static void Event_ReadMindOnThieves(void)

Mind Read on Grandpa: could they be thieves? Who can be trusted? Or nothing in the house was worth stealing.

Used by gVaultInteriors_Events, gVaultInteriors_EventsAfterThieves.

Line 790

Event_ReadMayorMind

static void Event_ReadMayorMind(void)

Mind Read on the mayor: a laugh, or the cave in the Goma Range is dangerous, but the party will be okay. "That tickles..."

Used by gVaultInteriors_Events, gVaultInteriors_EventsAfterThieves.

Line 803

Event_ReadBoneGiverMind

static void Event_ReadBoneGiverMind(void)

Mind Read on the bone giver: the master and his wife are blinded by money; after the thieves are jailed, hungry while cooking, or, once a Bone was given, wondering about calcium.

Used by gVaultInteriorsRevisit_Events, gVaultInteriors_Events, gVaultInteriors_EventsAfterThieves.

Line 817

Event_MeetIvan

static void Event_MeetIvan(void)

Talking to Ivan at the mayor's: the first time, he reads the two's minds, admits his strange powers and learns they are called Psynergy; then he asks for help finding the rod. A yes has him join the party.

Reached by talking to Ivan (actor 2), except while the party corners the suspects. Sets FLAG_VAULT_MET_IVAN the first time, and on a yes plays VaultInteriors_IvanJoinsRodSearch, sets FLAG_VAULT_IVAN_JOINED_ROD_SEARCH and has Ivan walk into the leader.

Used by gVaultInteriors_Events.

Line 838

VaultInteriors_IvanJoinsRodSearch

static void VaultInteriors_IvanJoinsRodSearch(void)

Ivan thanks them, they exchange names, and he shows Isaac and Garet Mind Read; he joins the party.

Called by Event_MeetIvan when the party agrees to help. Adds Ivan to the party ("Ivan joined your party!").

Used by Event_MeetIvan.

Line 944

Event_FreeRooferAndConfrontThieves

static void Event_FreeRooferAndConfrontThieves(void)

In the loft, Isaac cuts the roofer free; the three thieves arrive, boast of Lunpa and Dodonpa, ask to be let go, and attack.

Reached by talking to the tied-up roofer (actor 8) in the loft; the loft's setup replays the thieves' part through VaultInteriors_ConfrontThievesAgain once FLAG_VAULT_THIEVES_CONFRONTED is set. Sets that flag and starts the battle (encounter 12, 5): a win returns to entrance 17, a loss to 16.

Used by gVaultInteriors_AtticEvents.

Line 1124

Event_GoToEntrance11

static void Event_GoToEntrance11(void)

The party walks through to entrance 11.

Reached by stepping on cell code 7 before the thieves are jailed (after, the same cell is a plain exit); takes exit 11.

Used by gVaultInteriors_Events.

Line 1334

Event_ClimbToAttic

static void Event_ClimbToAttic(void)

The party climbs up into the inn's loft.

Reached by stepping on cell code 26; takes exit 15 to the loft's entrance.

Used by gVaultInteriors_Events, gVaultInteriors_EventsAfterThieves.

Line 1342

Event_LeaveAttic

static void Event_LeaveAttic(void)

Leaving the loft before the thieves are confronted, the party hears the roofer groan. "Uhnn... Uhnn..."

Reached by stepping on cell code 27 in the loft; takes exit 14 back down.

Used by gVaultInteriors_AtticEvents, gVaultInteriors_EventsAfterThieves.

Line 1354

Event_ApproachSuspects

static void Event_ApproachSuspects(void)

The suspects at the inn spot that weird kid with the party and run from him. "What do you want?"

Reached by stepping on cell code 10 at the suspects' room while FLAG_VAULT_IVAN_JOINED_ROD_SEARCH is set. Sets FLAG_VAULT_SUSPECTS_APPROACHED and FLAG_SUSPECTS_FLEEING, starts their routes and the callback that keeps them facing the leader. XXX: the row has no condition that stops it after the first time; whether it plays again depends on the leader's path to cell code 10.

Used by gVaultInteriors_Events.

Line 1377

Event_DiscussSuspiciousGuests

static void Event_DiscussSuspiciousGuests(void)

Stepping out, the party talks it over: Ivan can't read their minds while they run; Garet tells Isaac to take the lead and corner them.

Reached by stepping on cell code 20, at the room's door, while FLAG_SUSPECTS_FLEEING is set. Clears it and stops the facing callback; the suspects go back to their places.

Used by gVaultInteriors_Events.

Line 1429

Event_BeginCorneringSuspects

static void Event_BeginCorneringSuspects(void)

The party sets out to corner the two suspects.

Reached by stepping on cell code 21 while FLAG_VAULT_SUSPECTS_APPROACHED is set. Sets FLAG_MENUS_RAISE_EVENT, so the menus answer with Garet's refusal, and FLAG_SCENE_TEMP_50, so talking to Ivan or the suspects does nothing; then starts the chase (VaultInteriors_StartActorStops).

Used by gVaultInteriors_Events.

Line 1522

VaultInteriors_ResetSuspectRoutes

static void VaultInteriors_ResetSuspectRoutes(void)

Has the suspects react to the party's return and resets their route states. "Hey, they're back!"

Called by VaultInteriors_StartActorStops.

Used by VaultInteriors_StartActorStops.

Line 1532

VaultInteriors_SetPartyImagePriority

static inline void VaultInteriors_SetPartyImagePriority(void)

Sets the three party images to the priority used during the mind-reading scene.

Used by Event_ReadCorneredSuspectsMinds, VaultInteriors_DiscussMindReading.

Line 1567

Event_ReadCorneredSuspectsMinds

static void Event_ReadCorneredSuspectsMinds(void)

Once a suspect is cornered, Garet calls Ivan and Ivan reads their minds. "Uh-oh! I'm surrounded!" "Now, Ivan!"

Reached through raised events 201 to 203, which VaultInteriors_UpdateActorStops raises after thirty frames with at least one suspect blocked: 201 the leader, 202 the thief, 203 both. Stops the chase, clears FLAG_MENUS_RAISE_EVENT and FLAG_SCENE_TEMP_50, plays the party's talk (VaultInteriors_DiscussMindReading) and sets FLAG_VAULT_SUSPECTS_MIND_READ.

Used by gVaultInteriors_Events.

Line 1591

VaultInteriors_DiscussMindReading

static void VaultInteriors_DiscussMindReading(void)

Shows the party's branching conversation about what Ivan learned: the stolen goods are hidden in the inn, which they must search.

Called by Event_ReadCorneredSuspectsMinds while the screen is closed; sets the party outside the room and opens the screen on them.

Used by Event_ReadCorneredSuspectsMinds.

Line 1696

Event_AdvanceSuspectRoutes

static void Event_AdvanceSuspectRoutes(void)

The leader stepping on one of the route triggers 11 to 18 moves the fleeing suspects on to their next spots.

Reached by stepping on cell codes 11 to 18 while FLAG_SUSPECTS_FLEEING is set.

Used by gVaultInteriors_Events.

Line 1821

VaultInteriors_AdvanceSuspectRoute

static void VaultInteriors_AdvanceSuspectRoute(s32 actor, s32 expected, s32 next, const s32 *actions)

Installs a route script only when the suspect is in its expected state.

Used by Event_AdvanceSuspectRoutes.

Line 1883

Scene_Initialize

s32 Scene_Initialize(void)

On arrival: restores each room for the story so far, and plays the loft's scenes: the tied-up roofer, the rematch, and the defeat or victory.

Called by the engine once the actors are placed, by entrance. In the house with the Bone, after the thieves are jailed, places the Bone and starts Vault_UpdateBoneProximityFlag. After a lost battle (entrance 16) takes exit 16; after a won one (17) sets FLAG_VAULT_THIEVES_JAILED through VaultInteriors_ReturnStolenGoods, which also removes Ivan from the party.

Line 1903

VaultInteriors_FaceSuspectsTowardLeader

static void VaultInteriors_FaceSuspectsTowardLeader(void)

Keeps both suspects facing the leader while they evade the party.

Run each frame as a scene callback, from Event_ApproachSuspects until Event_DiscussSuspiciousGuests, and again once their minds are read.

Used by Event_ApproachSuspects, Event_DiscussSuspiciousGuests, Event_ReadCorneredSuspectsMinds, Scene_Initialize.

Line 2050

VaultInteriors_LoseToThieves

static void VaultInteriors_LoseToThieves(void)

Shows the thieves' reaction after the party loses their battle: the party lies beaten and the thieves keep the roofer as their hostage.

Called by Scene_Initialize at entrance 16, the battle's defeat destination; the scene then takes exit 16 to Vault's Sanctum.

Used by Scene_Initialize.

Line 2066

VaultInteriors_ConfrontThievesAgain

static void VaultInteriors_ConfrontThievesAgain(void)

Arranges the attic confrontation and restarts the thieves' battle. "They won't go away, will they? They're back!"

Called by Scene_Initialize at the loft's entrance 15 once FLAG_VAULT_THIEVES_CONFRONTED is set. Starts the same battle as Event_FreeRooferAndConfrontThieves.

Used by Scene_Initialize.

Line 2129

VaultInteriors_GetIvanVenusDjinnCount

static s32 VaultInteriors_GetIvanVenusDjinnCount(void)

Counts the Venus Djinn Ivan holds, which he gives back before he leaves the party.

Used by VaultInteriors_ReturnStolenGoods.

Line 2184

VaultInteriors_DefeatThieves

static void VaultInteriors_DefeatThieves(void)

Stages the defeated thieves and gathers the townspeople in the attic.

Called by Scene_Initialize at entrance 17, the battle's victory destination, unless the party is only coming back to where it was; then VaultInteriors_ReturnStolenGoods follows.

Used by Scene_Initialize.

Line 2195

VaultInteriors_ReturnStolenGoods

static void VaultInteriors_ReturnStolenGoods(void)

Returns the stolen goods and rod, thanks the party, and clears the attic.

Called by Scene_Initialize after VaultInteriors_DefeatThieves. Sets FLAG_VAULT_THIEVES_JAILED; the thieves are led away, the mayor's urn and the Sanctum's gold statue come out of the crates, Ivan takes the Shaman's Rod, gives back any Venus Djinn and leaves the party, and every actor of the loft is cleared away.

Used by Scene_Initialize.

Line 2429

VaultInteriors_OpenWindowTransition

static void VaultInteriors_OpenWindowTransition(void)

Opens the window transition and waits one frame after it finishes.

Used by Scene_Initialize, VaultInteriors_ConfrontThievesAgain, VaultInteriors_DefeatThieves, VaultInteriors_LoseToThieves.

Line 2884

VaultInteriors_PlayAnimationAndWait

static void VaultInteriors_PlayAnimationAndWait(s32 actorId, s32 animation, s32 waitFrames)

Waits for the animation to change before the following pause.

Used by Event_DiscussSuspiciousGuests, Event_FreeRooferAndConfrontThieves, Event_MayorAsksHelpForIvan, Event_MayorGivesWaterOfLife, Event_MeetIvan, VaultInteriors_ConfrontThievesAgain, VaultInteriors_DefeatThieves, VaultInteriors_DiscussMindReading, VaultInteriors_IvanJoinsRodSearch, VaultInteriors_LoseToThieves, VaultInteriors_ReturnStolenGoods.

Line 2912

VaultInteriors_BeginMindRead

static void VaultInteriors_BeginMindRead(s32 casterId, s32 targetId)

Begins Mind Read, chooses its target, and shows its opening effect.

Used by Event_MeetIvan, Event_ReadCorneredSuspectsMinds, VaultInteriors_DefeatThieves, VaultInteriors_IvanJoinsRodSearch.

Line 2920

VaultInteriors_EndMindRead

static void VaultInteriors_EndMindRead(void)

Finishes Mind Read and releases its scene effect objects.

Used by Event_MeetIvan, Event_ReadCorneredSuspectsMinds, VaultInteriors_DefeatThieves, VaultInteriors_IvanJoinsRodSearch.

Line 2929

VaultInteriors_FindStopAtPosition

static struct VaultInteriorsStop * VaultInteriors_FindStopAtPosition(s32 *position)

Finds the route node containing the actor's position on the eight-pixel grid.

Used by VaultInteriors_UpdateActorStops.

Line 2939

VaultInteriors_SnapToNearestStop

static struct VaultInteriorsStop * VaultInteriors_SnapToNearestStop(struct VaultInteriorsStop *node, s16 *requestedFacing)

Chooses the outgoing connection nearest the requested facing.

Used by VaultInteriors_UpdateActorStops.

Line 2963

VaultInteriors_IsActorWithinEightPixels

static s32 VaultInteriors_IsActorWithinEightPixels(s32 x, s32 z, s32 id)

Checks whether an actor's destination or current position lies within eight pixels.

Used by VaultInteriors_CheckStopOccupancy.

Line 3002

VaultInteriors_IsActorWithinSixteenPixels

static s32 VaultInteriors_IsActorWithinSixteenPixels(s32 x, s32 z, s32 id)

Checks whether an actor's destination or current position lies within sixteen pixels.

Used by VaultInteriors_CheckStopOccupancy.

Line 3024

VaultInteriors_CheckStopOccupancy

static s32 VaultInteriors_CheckStopOccupancy(struct VaultInteriorsStop *stop)

Reserves a full cell around the leader and half a cell around each actor following a route. Testing destinations as well as current positions prevents two actors choosing the same stop while still walking.

Used by VaultInteriors_UpdateActorStops.

Line 3045

VaultInteriors_MoveActorToStop

static void VaultInteriors_MoveActorToStop(struct FieldActor *actor, struct VaultInteriorsStop *stop)

Sets the actor's destination to the route stop's cell center.

Used by VaultInteriors_UpdateActorStops.

Line 3067

VaultInteriors_UpdateActorStops

static void VaultInteriors_UpdateActorStops(void)

Steers Ivan and both suspects through the graph and detects a sustained cornering.

Run each frame as a scene callback from VaultInteriors_StartActorStops until Event_ReadCorneredSuspectsMinds removes it. Raises event 200 plus the blocked suspects (1 the leader, 2 the thief) after thirty frames with at least one suspect blocked; a frame when both can move restarts the wait.

Used by Event_ReadCorneredSuspectsMinds, VaultInteriors_StartActorStops.

Line 3080

VaultInteriors_StartActorStops

static void VaultInteriors_StartActorStops(void)

Arranges the chase, constrains its camera, and starts the route callback.

Called by Event_BeginCorneringSuspects. Starts VaultInteriors_UpdateActorStops and the chase music, MUS_009.

Used by Event_BeginCorneringSuspects.

Line 3194

Also, functions without a comment: Scene_GetEntrances, Scene_GetExits, VaultInteriors_ShowMessageAndWait, VaultInteriors_FaceActorAndWait, VaultInteriors_FaceEachOtherAndWait.

Enumerations

VaultInteriorsRaisedEvent

enum VaultInteriorsRaisedEvent

The chase adds the blocked-suspect mask (1 the leader, 2 the thief) to 200.

Value=
VAULT_INTERIORS_CORNERED_EVENT_BASE200
VAULT_INTERIORS_LEADER_CORNERED
VAULT_INTERIORS_THIEF_CORNERED
VAULT_INTERIORS_BOTH_CORNERED

Line 53

Macros

VAULT_INTERIORS_CORNERED_FRAMES

#define VAULT_INTERIORS_CORNERED_FRAMES 30

A cornering lasts half a second before the chase raises an event.

Used by VaultInteriors_UpdateActorStops.

Line 50

Also, macros without a comment: VAULT_INTERIORS_ENTRY_ACTOR_Z, VAULT_INTERIORS_ENTRY_ACTOR_Z, NO_CONNECTION, CONNECTION.

Globals, without a comment: gVaultInteriors_Stops, gVaultInteriors_ActionTable, gVaultInteriors_FirstThiefEntryScript, gVaultInteriors_SecondThiefEntryScript, gVaultInteriors_VaultScriptA, gVaultInteriors_VaultScriptB, gVaultInteriors_VaultScriptC, gVaultInteriors_VaultScriptD, gVaultInteriors_VaultScriptE, gVaultInteriors_PairScriptA, gVaultInteriors_PairScriptB, gVaultInteriors_PairScriptC, gVaultInteriors_PairScriptD, gVaultInteriors_PairScriptE, gVaultInteriors_PairScriptF, gVaultInteriors_PairScriptG, gVaultInteriors_PairScriptH, gVaultInteriors_PairScriptI, gVaultInteriors_PairScriptJ, gVaultInteriors_PairScriptK, gVaultInteriors_PairScriptL, gVaultInteriors_PairScriptM, gVaultInteriors_PairScriptN, gVaultInteriors_PairScriptO, gVaultInteriors_PairScriptP, gVaultInteriors_PairScriptQ, gVaultInteriors_PairScriptR, gVaultInteriors_Entrances, gVaultInteriors_Regions, gVaultInteriors_Exits, gVaultInteriors_Placements, gVaultInteriors_AtticPlacements, gVaultInteriors_Events, gVaultInteriors_AtticEvents, gVaultInteriors_EventsAfterThieves, gVaultInteriors_StepActions, gVaultInteriors_IdleActions, gVaultInteriors_ResponseScripts, gVaultInteriors_StopTimer.

On this page

FunctionsScene_GetRegionsScene_GetPlacementsVaultInteriors_TryJumpToEvent_JumpAcrossRoofGapEvent_CheckCrateMovedEvent_TalkToWeaponMerchantEvent_TalkToArmorMerchantEvent_TalkToInnkeeperEvent_GaretRefusesToLeaveEvent_SearchEmptyBarrelEvent_SearchEmptyChestScene_GetEventsVaultInteriors_StandAndShowMessageVaultInteriors_AskYesNoAndShowReplyEvent_ChildAsksAboutTravelEvent_OfferIvansSecretEvent_TalkToItemMerchantEvent_TalkAboutRocksEvent_TalkAboutMissingThingsEvent_MayorAsksHelpForIvanEvent_WarnAboutThreeStrangersEvent_SuspectedLeaderDodgesVaultInteriors_ApplySecondSuspectRouteEvent_SuspectedThiefDodgesEvent_AskWhetherThievesCameFromLunpaEvent_ChildWorriesAboutFatherEvent_AskAboutDefeatingThievesEvent_MayorGivesWaterOfLifeEvent_OfferBonesEvent_ReadMindOnRockEvent_ReadChildMindEvent_ReadMindOnThievesEvent_ReadMayorMindEvent_ReadBoneGiverMindEvent_MeetIvanVaultInteriors_IvanJoinsRodSearchEvent_FreeRooferAndConfrontThievesEvent_GoToEntrance11Event_ClimbToAtticEvent_LeaveAtticEvent_ApproachSuspectsEvent_DiscussSuspiciousGuestsEvent_BeginCorneringSuspectsVaultInteriors_ResetSuspectRoutesVaultInteriors_SetPartyImagePriorityEvent_ReadCorneredSuspectsMindsVaultInteriors_DiscussMindReadingEvent_AdvanceSuspectRoutesVaultInteriors_AdvanceSuspectRouteScene_InitializeVaultInteriors_FaceSuspectsTowardLeaderVaultInteriors_LoseToThievesVaultInteriors_ConfrontThievesAgainVaultInteriors_GetIvanVenusDjinnCountVaultInteriors_DefeatThievesVaultInteriors_ReturnStolenGoodsVaultInteriors_OpenWindowTransitionVaultInteriors_PlayAnimationAndWaitVaultInteriors_BeginMindReadVaultInteriors_EndMindReadVaultInteriors_FindStopAtPositionVaultInteriors_SnapToNearestStopVaultInteriors_IsActorWithinEightPixelsVaultInteriors_IsActorWithinSixteenPixelsVaultInteriors_CheckStopOccupancyVaultInteriors_MoveActorToStopVaultInteriors_UpdateActorStopsVaultInteriors_StartActorStopsEnumerationsVaultInteriorsRaisedEventMacrosVAULT_INTERIORS_CORNERED_FRAMES