src/scene/common
games/tbs/src/scene/common on GitHub
colosso_item_icon.h
games/tbs/src/scene/common/colosso_item_icon.h
Colosso Log, River and Wall, and Crossbone Isle's platform rooms: an actor drawn as an item's menu icon, such as the two items at a Colosso course's finish or the Red Key on Crossbone Isle.
Functions
Colosso_ShowItemIcon
void Colosso_ShowItemIcon(s32 id, s32 item)
Replaces the picture of actor id, when it has a sprite of its own, with the icon of item: the icon's tiles, decoded into heap block 17, are loaded into the sprite's VRAM block and its animation is stopped.
Used by ColossoLog_Initialize, ColossoRiver_Initialize, ColossoWall_Initialize.
colosso_marker.h
games/tbs/src/scene/common/colosso_marker.h
Functions
Colosso_FadeInCompetitor
void Colosso_FadeInCompetitor(s32 id, s32 x, s32 z)
Isaac (id) appears at pixel (x, z) on the stage, facing south: he fades in through the backgrounds while he stretches from thin and tall to his own shape, settles and nods. While he is shown his sprite is outlined, in edge colour 1 and fill colour 4. His position and facing are kept for Colosso_RestoreCompetitor.
Used by Event_TalkToBoardWalkAttendant, Event_TalkToBridgeAttendant, Event_TalkToFreeClimbAttendant, Event_TalkToLogRollingAttendant, Event_TalkToLumberAttendant, Event_TalkToMiniMazeAttendant, Event_TalkToMovingSidewalkAttendant, Event_TalkToRockAttendant, Event_TalkToShiftingFloorAttendant, Event_TalkToSteppingStoneAttendant, Event_TalkToWallAttendant, Event_TalkToWallWedgeAttendant.
Colosso_RestoreCompetitor
void Colosso_RestoreCompetitor(s32 id)
Puts Isaac (id) back where Colosso_FadeInCompetitor found him: he stands (or turns south, nods and waits half a second), then returns to his kept position and facing with his motion stopped, and the outline colours are the field's again (edge 15, fill 0).
Used by Event_TalkToBoardWalkAttendant, Event_TalkToBridgeAttendant, Event_TalkToFreeClimbAttendant, Event_TalkToLogRollingAttendant, Event_TalkToLumberAttendant, Event_TalkToMiniMazeAttendant, Event_TalkToMovingSidewalkAttendant, Event_TalkToRockAttendant, Event_TalkToShiftingFloorAttendant, Event_TalkToSteppingStoneAttendant, Event_TalkToWallAttendant, Event_TalkToWallWedgeAttendant.
OverlayObject_ResetMotionFields
void OverlayObject_ResetMotionFields(s32 actor)
Stops the actor where it is: no velocity and no destination.
Used by Event_TalkToMovingSidewalkAttendant, Event_TalkToRockAttendant.
Colosso_EnsureMarkerSlot
static void Colosso_EnsureMarkerSlot(void)
Loads the pointer's picture into a free VRAM block, once.
Used by Colosso_ShowPointer.
Colosso_UpdateMarker
static void Colosso_UpdateMarker(void)
The pointer's scene callback: glide one step, then draw it while it blinks on (a glide keeps it on).
Used by Colosso_HidePointer, Colosso_MovePointer, Colosso_ShowPointer.
Colosso_ShowPointer
void Colosso_ShowPointer(u32 x, u32 y, u32 style)
Shows the pointer at screen pixel (x, y), drawn at priority style & 3.
Used by Event_TalkToLogRollingAttendant, Event_TalkToLumberAttendant, Event_TalkToPipeworksAttendant, Event_TalkToScalesAttendant, Event_TalkToSteppingStoneAttendant.
Colosso_MovePointer
void Colosso_MovePointer(u32 x, u32 y, u32 duration)
Glides the pointer to screen pixel (x, y) over duration frames.
Used by Event_TalkToLogRollingAttendant, Event_TalkToPipeworksAttendant, Event_TalkToScalesAttendant, Event_TalkToSteppingStoneAttendant.
Colosso_HidePointer
void Colosso_HidePointer(void)
Hides the pointer and frees its VRAM block.
Used by Event_TalkToLogRollingAttendant, Event_TalkToLumberAttendant, Event_TalkToPipeworksAttendant, Event_TalkToScalesAttendant, Event_TalkToSteppingStoneAttendant.
Colosso_WalkActorTo
void Colosso_WalkActorTo(s32 actorId, s32 x, s32 z)
Walks the actor at 2 pixels a frame towards pixel (x, z) and returns at once.
Used by Event_TalkToWallWedgeAttendant.
Colosso_WalkActorToAndStand
void Colosso_WalkActorToAndStand(s32 actorId, s32 x, s32 z)
Walks the actor at 1.25 pixels a frame to pixel (x, z), waits until it arrives and stands it there.
Used by Event_TalkToBoardWalkAttendant, Event_TalkToLogRollingAttendant, Event_TalkToLumberAttendant, Event_TalkToMiniMazeAttendant, Event_TalkToRockAttendant, Event_TalkToShiftingFloorAttendant, Event_TalkToSteppingStoneAttendant, Event_TalkToWallAttendant.
Unions
MarkerCoordinate
union MarkerCoordinate
The pointer's glide start on one axis, read signed or unsigned.
| Field | Declared as | |
|---|---|---|
signedValue | s16 signedValue | screen pixels |
value | u16 value | screen pixels |
Used by Colosso_UpdateMarker, gColosso_MarkerStartX, gColosso_MarkerStartY.
Globals, without a comment: gColosso_MarkerSteps, gColosso_MarkerStep, gColosso_MarkerX, gColosso_MarkerStartX, gColosso_MarkerEndX, gColosso_MarkerY, gColosso_MarkerStartY, gColosso_MarkerEndY, gColosso_MarkerBlink, gColosso_MarkerPriority.
colosso_occupant.h
games/tbs/src/scene/common/colosso_occupant.h
Functions
Colosso_FindActorAhead
void *Colosso_FindActorAhead(void)
Returns the placed actor standing one cell, or else two cells, ahead of the actor the player moves (straight ahead in the nearest of the four directions), or 0 when there is none.
Used by Event_CheckAhead, Event_PushRockOrCheckAhead, Event_PushWeightOrCheckAhead.
colosso_path_rival.h
games/tbs/src/scene/common/colosso_path_rival.h
Functions
Colosso_UpdatePathRival
static void Colosso_UpdatePathRival(void)
The rival's scene callback. Mode 1 plays the path back: each frame the rival steps to the next point (mirrored across the finish when asked), turning by at most a sixteenth of a turn, and stands once still for three frames. At the path's end the rival walks to the finish, beside the first finisher's item actor or the second's, and sets FLAG_SCENE_TEMP_11 (a racer has finished). Mode 2 records the actor's own path instead, up to 0x383e halfwords, then plays it back with the rival.
Used by ColossoWall_StartRivalPath, Colosso_StartRival.
Colosso_DrawGauge
static void Colosso_DrawGauge(void)
The race gauge's scene callback: a bar across the top of the screen, with the finish at its centre and blinking marks for the rival and Isaac at their distances from it (a pixel of bar for 14 of course). It slides down when the race starts and back up while FLAG_MENU_OPEN is set; hold keeps it down.
Used by Colosso_StartRaceGauge, FieldScene_BuildDescriptorAndInstallTask.
Structures
ColossoRaceWork
struct ColossoRaceWork
The race's work in HEAP_SLOT_COLOSSO_RACE, allocated whole when the gauge starts: the gauge, then the rival's path.
| Field | Declared as | |
|---|---|---|
gauge | struct ColossoGaugeWork gauge | |
path | s16 path[0x3840] | Pixels, as pairs of x and z, one pair a frame, ending with (0, 0): decoded from the course's resource, or recorded in mode 2. |
Used by ColossoWall_StartRivalPath, Colosso_StartRaceGauge, Colosso_StartRival, Colosso_UpdatePathRival, FieldScene_BuildDescriptorAndInstallTask.
Globals, without a comment: gColosso_GaugeGraphics.
colosso_scene_state.h
games/tbs/src/scene/common/colosso_scene_state.h
The Colosso finals' three courses (Colosso Log, River and Wall): a helper for the race gauge that no scene calls.
Functions
Colosso_SetGaugeHold
static void UNUSED Colosso_SetGaugeHold(s16 v)
Sets the race gauge's hold, which keeps the gauge on the screen.
colosso_setup.h
games/tbs/src/scene/common/colosso_setup.h
Colosso Log and Colosso River: setting up a race against the rival, with the race gauge at the top of the screen and the rival running a recorded path (colosso_path_rival.h).
Functions
Colosso_StartRaceGauge
void Colosso_StartRaceGauge(s32 playerActor, s32 rivalActor, s32 segments, s32 finishX, s32 finishZ, s32 finishItemActorA, s32 finishItemActorB)
Starts the race gauge (struct ColossoRaceWork, in HEAP_SLOT_COLOSSO_RACE): Isaac and the rival as playerActor and rivalActor, a bar of segments pieces either side, and the finish at pixel (finishX, finishZ) in 16.16, where the two item actors stand. Unless the party returns to where it was, the rival is put opposite Isaac across x = finishX.
Used by ColossoLog_Initialize, ColossoRiver_Initialize.
Colosso_StartRival
void Colosso_StartRival(s32 resource)
Decodes the rival's recorded path (resource) after the gauge's work and, unless the party returns to where it was, has the rival run it from the start, mirrored across the finish; then starts the rival's callback.
Used by ColossoLog_Initialize, ColossoRiver_Initialize.
colosso_solo.h
games/tbs/src/scene/common/colosso_solo.h
Functions
Colosso_PlaceFriendsAtCheeringSpots
void Colosso_PlaceFriendsAtCheeringSpots(void)
Puts Garet, Ivan and Mia back at the cells where they chose to cheer, at the centre of each cell.
Used by ColossoLog_Initialize, ColossoRiver_Initialize, ColossoWall_Initialize.
Colosso_ControlCharacterAlone
void Colosso_ControlCharacterAlone(s32 id)
Makes the character the party's only member, the one the player moves and the camera follows, with full HP and PP and no poison. The gauges are the battle's (0x4000 full; a character with any HP or PP left shows at least 1).
Used by ColossoLog_Initialize, ColossoLog_RunCompetitorTalk, ColossoRiver_Initialize, ColossoWall_Initialize, Colosso_AskDoneCheering, Colosso_TakePlaceForMatch.
Colosso_RaiseTakePlaceOnPsynergy
void Colosso_RaiseTakePlaceOnPsynergy(void)
A scene callback while a friend looks around the course alone (entrance 2): when the Psynergy request names that friend and flag 0x141 is set, raise event 99, Colosso_TakePlaceForMatch.
Used by ColossoLog_Initialize, ColossoRiver_Initialize, ColossoWall_Initialize.
Colosso_TakePlaceForMatch
static void Colosso_TakePlaceForMatch(void)
Raised event 99: the nearest actor with animation 165 level with or below the friend on the map calls the competitors to their places, and the friend's cell becomes their place to cheer from. "The match is about to begin. Please take your places." The next friend then looks around, or, after Mia, the party leaves by exit 10.
Used by gColossoLogEvents, gColossoRiver_Events, gColossoWallEvents.
Colosso_AskDoneCheering
void Colosso_AskDoneCheering(s32 id)
A stage's guide, talking to a friend who looks around alone, asks whether they are done cheering. "Huh? Are you done cheering?" On "Yeah", "Then please wait here until the match begins.": the friend's cell becomes their place, and the next friend looks around, or, after Mia, the party leaves by exit 10. On "Nope", "Then cheer as best you can!"
Used by Event_TalkToBoardWalkAttendant, Event_TalkToBridgeAttendant, Event_TalkToFreeClimbAttendant, Event_TalkToLogRollingAttendant, Event_TalkToLumberAttendant, Event_TalkToMiniMazeAttendant, Event_TalkToMovingSidewalkAttendant, Event_TalkToPipeworksAttendant, Event_TalkToRockAttendant, Event_TalkToScalesAttendant, Event_TalkToShiftingFloorAttendant, Event_TalkToSteppingStoneAttendant, Event_TalkToWallAttendant, Event_TalkToWallWedgeAttendant.
Colosso_AskReadyToRace
static void Colosso_AskReadyToRace(s32 actorId)
The guide at the course's start. Once the friends have all gone to cheer (Isaac is the party), "Isaac, did you get a good look around?": on yes the guide steps aside, Isaac walks past and the party leaves by exit 11. Otherwise "Wait, shouldn't you decide where the best place to cheer for Isaac is?"
Used by gColossoLogEvents, gColossoRiver_Events, gColossoWallEvents.
Colosso_ClearCheeringSpots
void Colosso_ClearCheeringSpots(void)
Forgets where Garet, Ivan and Mia cheer from.
Used by ColossoLog_Initialize, ColossoRiver_Initialize, ColossoWall_Initialize.
Colosso_GreetAtStage
s32 Colosso_GreetAtStage(s32 speaker, s32 competitor)
A stage's guide names the stage and decides what to do next. "This is stage
N of the first finals match." (Colosso River; the second is Colosso Wall
and the third Colosso Log). Returns what the guide does next:
0: describe the stage (yes to "Would you like to hear a description of this
stage?", asked the first time, or "Descriptions" afterwards);
1: no description, then offer a friend's cheering;
2: "Cheer" chosen, or a friend already cheers here;
3: "Nothing", or the choice cancelled.Used by Event_TalkToBoardWalkAttendant, Event_TalkToBridgeAttendant, Event_TalkToFreeClimbAttendant, Event_TalkToLogRollingAttendant, Event_TalkToLumberAttendant, Event_TalkToMiniMazeAttendant, Event_TalkToMovingSidewalkAttendant, Event_TalkToPipeworksAttendant, Event_TalkToRockAttendant, Event_TalkToScalesAttendant, Event_TalkToShiftingFloorAttendant, Event_TalkToSteppingStoneAttendant, Event_TalkToWallAttendant, Event_TalkToWallWedgeAttendant.
Colosso_RepeatStageNumber
void Colosso_RepeatStageNumber(s32 speaker, s32 competitor)
A stage's guide, after describing the stage, names it again: the copy of that line after it in the text. "This is stage N of the first finals match." (or the second or third)
Used by Event_TalkToBoardWalkAttendant, Event_TalkToBridgeAttendant, Event_TalkToFreeClimbAttendant, Event_TalkToLogRollingAttendant, Event_TalkToLumberAttendant, Event_TalkToMiniMazeAttendant, Event_TalkToMovingSidewalkAttendant, Event_TalkToPipeworksAttendant, Event_TalkToRockAttendant, Event_TalkToScalesAttendant, Event_TalkToShiftingFloorAttendant, Event_TalkToSteppingStoneAttendant, Event_TalkToWallAttendant, Event_TalkToWallWedgeAttendant.
Colosso_OfferCheeringSpot
void Colosso_OfferCheeringSpot(s32 mode, s32 guide, s32 stage)
The guide at a stage, with the mode Colosso_GreetAtStage returned: offer a friend's cheering at the stage. With Isaac alone, "All right, do your best!"; with the stage taken, "Unfortunately, we have a full house."; otherwise "Would you like a friend to cheer for you here?" (taken as yes in mode 2) and the party's character menu. The friend chosen is led to the stage and leaves the party, and their cell is kept. Mode 3, no or no choice: "If you know who you want to cheer you on, please let me know!"
Used by Event_TalkToBoardWalkAttendant, Event_TalkToBridgeAttendant, Event_TalkToFreeClimbAttendant, Event_TalkToLogRollingAttendant, Event_TalkToLumberAttendant, Event_TalkToMiniMazeAttendant, Event_TalkToMovingSidewalkAttendant, Event_TalkToPipeworksAttendant, Event_TalkToRockAttendant, Event_TalkToScalesAttendant, Event_TalkToShiftingFloorAttendant, Event_TalkToSteppingStoneAttendant, Event_TalkToWallAttendant, Event_TalkToWallWedgeAttendant.
Macros
COLOSSO_STAGE_CHEERED
#define COLOSSO_STAGE_CHEERED 0x200
Scene flags, by stage number: a friend cheers at the stage, and its description was heard. When a friend cheers there, the guide says "Unfortunately, we have a full house."
Used by Colosso_GreetAtStage, Colosso_OfferCheeringSpot.
Also, macros without a comment: COLOSSO_CHEER_COLUMN, COLOSSO_CHEER_ROW, COLOSSO_CHEER_SLOT, COLOSSO_STAGE_DESCRIBED.
colosso_story_flags.h
games/tbs/src/scene/common/colosso_story_flags.h
colosso_task.h
games/tbs/src/scene/common/colosso_task.h
Functions
Colosso_LoadLettering
static void Colosso_LoadLettering(s32 id)
Loads lettering picture id into the lettering's VRAM block (taken once) and its palette into sprite palette 15. Picture 8 is picture 4 in another palette.
Used by ColossoLogRollingStage_RunScriptedTransition, ColossoRiver_ShowMatchResult, ColossoRiver_ShowRoundIntroduction, ColossoWall_ShowBattleResultLettering, ColossoWall_ShowRoundStartLettering, FieldScene_RunScene3bcSequenceA.
Colosso_UpdateLettering
static void Colosso_UpdateLettering(void)
The lettering's scene callback: run its script, move, scale and fade it, and draw it as double-size affine sprites blended over the screen, in the shape of gColosso_LetteringMode (gColosso_LetteringParam picks the second half of a picture): 1: four 32x16 pieces in a row (Match 1 to 3, Lend a Hand); 2: one 32x32 piece (3, 2, 1); 3: two 32x16 pieces (Won or Lose); 4: Go!, one 64x32 piece, or two 32x16 in French.
Used by ColossoLogRollingStage_InitializeModeTask, ColossoRiver_SelectPresentationScript, ColossoWall_StartLetteringAnimation.
Also, functions without a comment: Dma_Wait.
Enumerations
ColossoLetteringCommand
enum ColossoLetteringCommand
The Colosso finals' three courses (Colosso Log, River and Wall): the large lettering a race starts with. It reads "Match 1", "3", "2", "1", "Go!", from the pictures of games/tbs/src/graphics/colosso/lettering.tsv, in this order: 0 Lend a Hand, 1 to 3 Match 1 to 3, 4 Won and Lose, 5 the 3 and the 2, 6 the 1 and 7 Go. Each picture is 0x400 bytes of tiles after the palettes.
The lettering moves by a script of 16-bit words, a command and its values:
| Value | = | |
|---|---|---|
COLOSSO_LETTERING_PLACE | 0x4000 | x, speed: put the lettering at x pixels from the centre, moving at speed 256ths of a pixel a frame |
COLOSSO_LETTERING_ACCELERATE | 0x3000 | speed, frames: change the speed over that many frames |
COLOSSO_LETTERING_SCALE | 0x1000 | scale, frames: grow or shrink to scale (256 is its own size) |
COLOSSO_LETTERING_FADE | 0x2000 | weight, frames: fade to weight sixteenths over the screen |
COLOSSO_LETTERING_WAIT | 0x7fff | frames: run the moves for that many frames before the next command |
COLOSSO_LETTERING_END | -1 | remove the lettering and free its VRAM block |
Globals, without a comment: gColosso_LetteringTimer, gColosso_ModeMoveTarget, gColosso_ModeMoveDuration, gColosso_LetteringMode, gColosso_LetteringParam, gColosso_LetteringPosition, gColosso_LetteringScript.
effect_advance.h
games/tbs/src/scene/common/effect_advance.h
Functions
Effect_AdvanceMotion
static void Effect_AdvanceMotion(union FieldObject *object)
An effect's update hook: move by its velocity, which loses an eighteenth of its x and a sixteenth of its z each frame, and grow and spin at its rates.
Used by BabiLighthouse_LandWithParticles, CrossboneIsle_SpawnBlockMovedBurst, Event_HopDownStep, SceneEffect_SpawnNineRadialEffects, TretTreeInteriors_RunLandingDustScene, VenusLighthouse_LandWithRadialDust.
effect_create.h
games/tbs/src/scene/common/effect_create.h
Functions
SetEffectRecordMode
UNUSED static void SetEffectRecordMode(struct FieldActor *work, s32 mode)
Sets the actor's sprite priority (0 in front of the backgrounds, 3 behind).
OverlayObject_PrepareObject
UNUSED static void *OverlayObject_PrepareObject(s32 x, s32 y, s32 z, s32 type)
A still, translucent effect in palette 14, at sprite priority 0.
Used by BabiLighthouse_RisePastPairedEffects, BabiLighthouse_RisePastSingleEffect, BabiLighthouse_SetupScene, CrossboneIslePillarRooms_LowerActorToLedge, Event_SinkPillarA, Event_SinkPillarB.
OverlayObject_CreateConfiguredObject
UNUSED static void *OverlayObject_CreateConfiguredObject(s32 x, s32 y, s32 z, s32 type)
A still effect in palette 15, at sprite priority 1, drawn under the actors.
Used by MogallForest_Initialize, Scene_Initialize, XianInteriors_Initialize.
effect_psynergy.h
games/tbs/src/scene/common/effect_psynergy.h
Vale, its home, storm and Babi scenes, Sol Sanctum's eruption and Venus Lighthouse's aerie: Psynergy shown in a cutscene. One is the villager's in Vale: "Behold, the power of Psynergy!"
Functions
Scene_BeginCutscenePsynergy
void Scene_BeginCutscenePsynergy(void)
Prepares the effect work and spark tiles of Move (ability 140) for the cutscene's Psynergy.
Used by Event_ConfrontSaturosAndMenardi, Event_DemonstrateLevitation, Event_DemonstratePsynergy, Event_WatchBoulderFall, SolSanctumEruption_PlayWiseOneRescue.
Scene_EndCutscenePsynergy
void Scene_EndCutscenePsynergy(void)
Ends the cutscene's Psynergy and releases its effect work.
Used by Event_ConfrontSaturosAndMenardi, Event_DemonstrateLevitation, Event_DemonstratePsynergy, Event_WatchBoulderFall, SolSanctumEruption_PlayWiseOneRescue.
effect_radial.h
games/tbs/src/scene/common/effect_radial.h
Functions
SceneEffect_SpawnNineRadialEffects
static void SceneEffect_SpawnNineRadialEffects(s32 actor)
Burst nine particles out from the actor in a ring (the ninth on the first), flung a third further east and west, slowing as they go (Effect_AdvanceMotion).
Used by TunnelRuins_DropBlockOnStack, VenusLighthouse_StackFloatingBlock.
effect_spawn.h
games/tbs/src/scene/common/effect_spawn.h
Functions
BattleFx_UpdateObjectMotionScaleAndLinkedAngle
void BattleFx_UpdateObjectMotionScaleAndLinkedAngle(union FieldObject *object)
Integrates linear motion, scale changes and rotation once per effect frame.
Effect_InitializeMotion
static inline void Effect_InitializeMotion(struct FieldEffect *effect, struct AnimationObject *sprite, struct FieldActor *leader, s32 velocityX, s32 velocityY, s32 velocityZ)
Starts with linear motion and the leader's draw order; options can override it.
Macros, without a comment: EFFECT_SPAWN.
Globals, without a comment: gEffectScripts.
effect_vertical.h
games/tbs/src/scene/common/effect_vertical.h
Functions
Effect_AnimateVerticalPositive
static void Effect_AnimateVerticalPositive(union FieldObject *object)
Rises beside the linked actor, expanding and shrinking over half a sine wave.
Used by SolSanctumEruption_SpawnEffectPair, ValeBabi_SpawnEffectPair, ValeHome_SpawnEffectPair, ValeStorm_SpawnEffectPair, VenusLighthouseAerie_SpawnLinkedPairEffects, WorldMap_CreateLinkedEffects.
Effect_AnimateVerticalNegative
static void Effect_AnimateVerticalNegative(union FieldObject *object)
Mirrors the rising particle vertically and passes behind the linked actor.
Used by SolSanctumEruption_SpawnEffectPair, ValeBabi_SpawnEffectPair, ValeHome_SpawnEffectPair, ValeStorm_SpawnEffectPair, VenusLighthouseAerie_SpawnLinkedPairEffects, WorldMap_CreateLinkedEffects.
item_equip.h
games/tbs/src/scene/common/item_equip.h
Colosso Log, River and Wall, and Goma Cave's entrance: giving a character an item and putting it on.
Functions
Scene_GiveAndEquipItem
UNUSED static void Scene_GiveAndEquipItem(s32 character, s32 item)
Gives the character the item, then equip every slot of their 15 that holds it.
kolima_blink.h
games/tbs/src/scene/common/kolima_blink.h
Kolima and its forest bridge: the sparkling dust that falls when Tret's curse strikes. "That sparkly stuff on the ground... What is it?"
Functions
Kolima_FlickerCurseDust
static s32 Kolima_FlickerCurseDust(struct ScriptInterpreter *interpreter)
An object script call, each frame of the fall: the speck flickers between palettes 10 and 7, every second frame.
Used by gFallingEffectScript.
kolima_forest_bridge_falling_effect.h
games/tbs/src/scene/common/kolima_forest_bridge_falling_effect.h
Functions
Kolima_UpdateCurseDust
void Kolima_UpdateCurseDust(void)
A scene callback: every eighth frame a speck (object 285, its script gFallingEffectScript) starts 160 pixels up at a random point near the point the map view follows, with SE_246 every 64 frames. gFallingEffectState shapes the fall: 0 within 128 pixels of that point; 1 and 2 over a band that widens (by 50 a frame, to 15000 and 30000) as it moves towards it; 3 drifting on until it is far past, then back to 0.
Used by KolimaForestBridge_WitnessForestCurse, Kolima_WitnessForestCurse.
Globals, without a comment: gFallingEffectOffset, gFallingEffectWidth, gFallingEffectState.
kolima_grow.h
games/tbs/src/scene/common/kolima_grow.h
Kolima, its forest bridge and the forest's tree: an effect (object 26) that stretches as it travels.
Functions
SceneEffect_AdvanceAngleUntilIdle
static s32 SceneEffect_AdvanceAngleUntilIdle(struct ScriptInterpreter *interpreter)
An object script call: widen the object by 0x1eb8 (about 0.12) a frame, and release it once it has reached its destination.
Used by gKolimaForestBridge_SparkleScript, gKolimaForestTreeEffectScript, gKolima_Object26Script.
kolima_jump.h
games/tbs/src/scene/common/kolima_jump.h
Kolima's forest bridge and river: the hop east onto actor 10 (the third placement).
Functions
StagedActor_RunStepEffect
static s32 StagedActor_RunStepEffect(struct FieldPosition *request)
Hops the leader to the pixel of the 16.16 position request, unless something blocks the way: the leader crouches, jumps (3 pixels a frame, rising at 4) and lands while actor 10 plays its animation 7; the leader then dips a pixel twice, its height and its ground height together, and rises back. Returns 1 after a hop.
Used by KolimaForest_HopEast.
KolimaForest_HopEast
static void KolimaForest_HopEast(void)
Touch trigger 11, walking east: hop 30 pixels east of the leader. The patched editions hop from the centre of the moving character's cell, 40 pixels.
Used by gKolimaForestBridge_Events, gKolimaForestRiverEvents.
kolima_palette.h
games/tbs/src/scene/common/kolima_palette.h
Functions
KolimaPalette_Curse
void KolimaPalette_Curse(s32 strength)
Keeps the healthy colours, curses the background palettes 0 to 13 (all but colours 1 to 7 of palette 1 and 1 to 8 of palette 12) by strength, keeps the cursed colours too, and shows them.
Used by KolimaForestBend_Initialize, KolimaForestClearing_Initialize, KolimaForestRiver_Initialize, KolimaForestTree_Initialize.
SceneEffect_AdjustColorChannels
static u16 SceneEffect_AdjustColorChannels(u16 color, s32 adj)
One cursed colour: red gains a 4 * adj'th of itself (up to 31), and green and blue lose an adj'th.
Used by KolimaPalette_Curse.
KolimaPalette_SaveFirst
static void KolimaPalette_SaveFirst(void)
Keeps the healthy colours: the colour buffer into gKolimaPalette_First.
Used by KolimaPalette_Curse.
KolimaPalette_SaveSecond
static void KolimaPalette_SaveSecond(void)
Keeps the cursed colours: the colour buffer into gKolimaPalette_Second.
Used by KolimaPalette_Curse.
KolimaPalette_Capture
static void KolimaPalette_Capture(void)
Copies the palettes on the screen, background and sprites, into the colour buffer as the colours to fade from.
Used by KolimaPalette_Curse, KolimaPalette_Restore.
KolimaPalette_Restore
void KolimaPalette_Restore(s32 second)
Makes the healthy colours (second 0) or the cursed ones (second 1) the colours to fade to; the scene then fades with Engine_ColorBufferInterpolate.
Used by KolimaForestTree_RestoreTret, KolimaForestTree_UpdateHealingPalette.
map_panel.h
games/tbs/src/scene/common/map_panel.h
Functions
Map_DrawCellPanel
static void Map_DrawCellPanel(s32 x, s32 y, s32 width, s32 height, s32 plane, s32 destX, s32 destY)
Draws the width by height cells at cell (x, y) of the map into screen block 5 from cell (destX, destY), wrapped to 16 by 16 cells, in band plane (16 cell rows each): each cell is its block's tiles from Ram_MapBlocks.
Used by CrossboneIslePillarRooms_AnimateWaterLevel, KolimaForestBend_FlipFloodgateSwitch.
mercury_lighthouse_arrive.h
games/tbs/src/scene/common/mercury_lighthouse_arrive.h
Mercury Lighthouse and its entrance: arriving on a floor through one of its sparkling passages.
Functions
MercuryLighthouse_ArriveWithSparks
static void MercuryLighthouse_ArriveWithSparks(void)
Unless the party returns to where it was, the leader appears 16 pixels north of the entrance, hidden, as the screen opens, then comes south with the trail of sparks and is drawn again on the way.
mercury_lighthouse_lights.h
games/tbs/src/scene/common/mercury_lighthouse_lights.h
Functions
MercuryLighthouse_RestoreLights
void MercuryLighthouse_RestoreLights(s32 region, struct MercuryLighthouseLights *st)
Keeps the lights' state st in work slot 35 for the floor's region, the pool's collision code. On an ordinary entrance the leader has no lights. When the party returns to where it was, the column of lights over the leader and the light under them in the pool are made again.
mercury_lighthouse_palette_cycle.h
games/tbs/src/scene/common/mercury_lighthouse_palette_cycle.h
Functions
MercuryLighthouse_CyclePalette
static void MercuryLighthouse_CyclePalette(void)
A scene callback: every fifth frame colour 9's red level steps on by 4, and each of colours 10 to 15 takes the red level of the colour below it (13 to 15 dimmed by four tenths), so the shimmer runs up the ramp; green and blue stay those of gPaletteCycleGreen and gPaletteCycleBlue.
MercuryLighthouse_ClearPalette
static void MercuryLighthouse_ClearPalette(void)
While the pool sleeps: colours 9 to 15 of background palette 6 are black.
mercury_lighthouse_pillar.h
games/tbs/src/scene/common/mercury_lighthouse_pillar.h
Functions
SceneEffect_AdvanceAnchoredRiseFrame
static s32 SceneEffect_AdvanceAnchoredRiseFrame(struct ScriptInterpreter *interpreter)
Raises the spark while its scale follows a half-sine pulse.
OverlayObject_RampWords24And28Over16Frames
static s32 OverlayObject_RampWords24And28Over16Frames( struct ScriptInterpreter *interpreter)
Grows the moving light over the first sixteen script frames.
OverlayObject_AdvanceScaleCounter
static s32 OverlayObject_AdvanceScaleCounter(struct ScriptInterpreter *interpreter)
Expands the released light before its script removes it.
MercuryLighthouse_FollowLeader
static s32 MercuryLighthouse_FollowLeader(struct ScriptInterpreter *interpreter)
Follows the linked actor and alternates the light's animation parameter.
MercuryLighthouse_SpawnSparkPair
static void MercuryLighthouse_SpawnSparkPair(void)
Places the two spark animations on the selected actor.
Used by MercuryLighthouse_ChargeLights.
MercuryLighthouse_ChargeLights
void MercuryLighthouse_ChargeLights(void)
Touch trigger 11, the pool's heart: the column of light appears over the leader if it is not there, and grows a stage with each pair of sparks, half a second apart, up to three lights. The column's cell is where a sinking leader comes back to; flag 0x161 is set while the leader has lights.
Used by MercuryLighthouse_RaiseTouchedPillar.
MercuryLighthouse_LoseLights
void MercuryLighthouse_LoseLights(void)
Touch trigger 31: the leader loses their lights, and the column swells and fades away.
Used by MercuryLighthouse_ReleaseRaisedPillar.
MercuryLighthouse_HopAcrossPool
void MercuryLighthouse_HopAcrossPool(void)
Pushing against the pool's edge (triggers 11, 21 and 31): the leader hops two cells the way the pad points, unless the hop leads into the pool without a light or is blocked. A hop into the pool spends a light, which flies ahead to the landing cell; the column shrinks a stage, or goes with the last light. Landing in the pool with no light under them, the leader sinks until a key is pressed after half a second, and is put back at the heart.
Used by MercuryLighthouse_TryPillarStep.
MercuryLighthouse_SparkleAtLeader
void MercuryLighthouse_SparkleAtLeader(void)
Touch trigger 21: while the leader stands there, a sparkle rises from them every 10 to 39 frames.
Used by MercuryLighthouse_SpawnTimedRiseEffect.
MercuryLighthouse_RemoveColumnOnRetreat
static void MercuryLighthouse_RemoveColumnOnRetreat(void)
Retreat (PSYNERGY_IN_AREA(ABILITY_RETREAT, 1)): remove the column of light.
Macros, without a comment: MAP_CELLS.
mercury_lighthouse_risedrop.h
games/tbs/src/scene/common/mercury_lighthouse_risedrop.h
Mercury Lighthouse and its entrance: leaving a floor through one of its sparkling passages.
Functions
MercuryLighthouse_LeaveThroughPassage
static void MercuryLighthouse_LeaveThroughPassage(s32 exit)
Touch a passage: the leader moves north with the trail of sparks, vanishes, and after half a second the screen fades and the party takes exit.
Used by MercuryLighthouse_ExitAfterSparkStep, MercuryLighthouse_ExitWithSparks, MercuryLighthouse_LeaveWithSparkTrail.
MercuryLighthouse_DropLeaderToColumn
static void UNUSED MercuryLighthouse_DropLeaderToColumn(s32 a0)
Unused: the leader moves north with the passages' sound and vanishes, then is put at pixel (8 * a0 + 8, 0).
mercury_lighthouse_sparks.h
games/tbs/src/scene/common/mercury_lighthouse_sparks.h
object_depth.h
games/tbs/src/scene/common/object_depth.h
object_distance.h
games/tbs/src/scene/common/object_distance.h
Functions
FixedPoint_Distance
UNUSED static s32 FixedPoint_Distance(const u8 *firstPosition, const u8 *secondPosition)
The distance in whole pixels between two 16.16 positions of x, y and z. Callers take byte views of complete actors; their coordinate members do not form an array.
Used by SceneActor_FindNearestSlotOfKindF2, Tolbi_KidStopForTarget, Vault_StopIfFacingNear, Xian_UpdateCarrierTracking.
object_facing.h
games/tbs/src/scene/common/object_facing.h
Functions
Scene_TurnTowardTarget
static s32 Scene_TurnTowardTarget(struct ScriptInterpreter *interpreter)
An object script call: an actor with a facing target turns towards it, at most a sixteenth of a turn a frame.
Used by gBilibin_FaceLeaderScript, gGuardWatchesParty, gImil_FaceTargetScript, gKolima_FaceLeaderScript, gPalace_FacingActions, gSolSanctumElementalStarRoom_AngleScript, gValeBabi_DoraFacesIsaacScript, gValeHome_FaceTargetActions, gValeInteriors_FaceTargetScript, gValeKraden_FaceTargetActions.
object_findcell.h
games/tbs/src/scene/common/object_findcell.h
Functions
SceneActor_FindActorAtCell
static struct FieldActor *SceneActor_FindActorAtCell(s32 x, s32 z)
Returns the placed actor (8 to 65) standing on cell (x, z), or 0.
Used by Event_PushActorAhead, Event_PushBlock, Kalay_PushTunnelBlock.
object_findslot.h
games/tbs/src/scene/common/object_findslot.h
Functions
SceneData_FindSlotAtPosition
static void *SceneData_FindSlotAtPosition(const struct FieldPosition *position, void *self)
Returns the placed actor (8 to 65) whose cell, and 16-pixel step of height, is that of the 16.16 position, or 0. self is not read.
Used by ColossoLog_PushActorAhead, ColossoRiver_PushObjectAhead, ColossoWall_PushAdjacentObstacle, Colosso_FindActorAhead, Event_JumpAcrossGap, VenusLighthouse_DispatchPushScript, VenusLighthouse_PushAdjacentBlock.
object_heading.h
games/tbs/src/scene/common/object_heading.h
Functions
Scene_LookAboutRandomly
static s32 Scene_LookAboutRandomly(struct ScriptInterpreter *interpreter)
An object script call, each frame: when the actor's countdown (work) runs out, it turns by a random amount up to half a turn and waits a random 0 to 79 frames.
Used by gVenusLighthouseAerie_PartyHeadingAction.
object_nearest.h
games/tbs/src/scene/common/object_nearest.h
Functions
SceneActor_FindNearestSlotOfKindF2
s32 SceneActor_FindNearestSlotOfKindF2(void)
Returns the placed actor drawn with sprite 0xf2 nearest the leader, within 640 pixels, or 0.
Used by Event_LandOnPillar, MercuryLighthouseAerie_Initialize, MercuryLighthouseAerie_StepOntoPlatform, VenusLighthouseAerie_Initialize.
object_orbit.h
games/tbs/src/scene/common/object_orbit.h
Functions
SceneEffect_UpdateOrbitPosition
static s32 SceneEffect_UpdateOrbitPosition(s32 *p)
The Nut's callback, each frame: it sways up to two pixels either side of its spot and dips up to two pixels below it, at a random pace.
Used by Scene_FloatNut.
Scene_FloatNut
void Scene_FloatNut(s32 id)
Draws actor id as the Nut's icon and starts it floating, 32 pixels up unless the party returns to where it was.
Used by Garden_ApplyProgress, Kalay_PrepareCave, KolimaForestClearing_Initialize, MogallForest_Initialize, Scene_Initialize.
object_pairmove.h
games/tbs/src/scene/common/object_pairmove.h
Functions
SceneActor_PlacePairAtOffset
static void SceneActor_PlacePairAtOffset(s32 id, s32 dx, s32 dz)
Moves the character the player controls (in mode 27) and actor id together by (dx, dz) pixels to the centres of their cells, at a pixel a frame, as when pushing it; the actor faces the way it goes.
Used by Fuchin_FirstRoom_MoveFirstPlatformEast, Fuchin_FirstRoom_MoveFirstPlatformWest, Fuchin_FirstRoom_MoveSecondPlatformNorth, Fuchin_FirstRoom_MoveSecondPlatformSouth, Fuchin_FirstRoom_MoveThirdPlatformNorth, Fuchin_FirstRoom_MoveThirdPlatformSouth, Fuchin_FourthRoom_MoveFirstPlatformNorth, Fuchin_FourthRoom_MoveFirstPlatformSouth, Fuchin_FourthRoom_MoveSecondPlatformEast, Fuchin_FourthRoom_MoveSecondPlatformWest, Fuchin_FourthRoom_MoveThirdPlatformEast, Fuchin_FourthRoom_MoveThirdPlatformWest, Fuchin_SecondRoom_MoveFirstPlatformEast, Fuchin_SecondRoom_MoveFirstPlatformToEastEnd, Fuchin_SecondRoom_MoveFirstPlatformToWestEnd, Fuchin_SecondRoom_MoveSecondPlatformNorth, Fuchin_SecondRoom_MoveSecondPlatformSouth, Fuchin_SecondRoom_MoveThirdPlatformNorth, Fuchin_SecondRoom_MoveThirdPlatformSouth, Fuchin_SecondRoom_NudgeFirstPlatformWest, Fuchin_ThirdRoom_MoveFirstPlatformEastFromMiddle, Fuchin_ThirdRoom_MoveFirstPlatformEastFromWestEnd, Fuchin_ThirdRoom_MoveFirstPlatformWest, Fuchin_ThirdRoom_MoveFirstPlatformWestIfClear, Fuchin_ThirdRoom_MoveFourthPlatformNorth, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromLastStop, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromLowerStop, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromMiddle, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromNorthEnd, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromUpperStop, Fuchin_ThirdRoom_MoveSecondPlatformEast, Fuchin_ThirdRoom_MoveSecondPlatformWest, Fuchin_ThirdRoom_MoveThirdPlatformNorthFromLowerStop, Fuchin_ThirdRoom_MoveThirdPlatformNorthFromMiddle, Fuchin_ThirdRoom_MoveThirdPlatformNorthFromSouthEnd, Fuchin_ThirdRoom_MoveThirdPlatformSouthFromLowerStop, Fuchin_ThirdRoom_MoveThirdPlatformSouthFromMiddle, Fuchin_ThirdRoom_MoveThirdPlatformSouthFromNorthEnd, Fuchin_ThirdRoom_MoveThirdPlatformSouthFromUpperStop, Fuchin_ThirdRoom_NudgeFourthPlatformNorth and 1 more.
object_pulse.h
games/tbs/src/scene/common/object_pulse.h
Functions
Scene_SquashAndStretch
static s32 Scene_SquashAndStretch(struct ScriptInterpreter *interpreter)
An object script call, each frame: every 60 to 149 frames the actor squashes and stretches back to its own shape over six frames.
Used by gTolbiShipDeck_RandomActorActions, gValeStorm_ActorEightScript.
object_staged_actor.h
games/tbs/src/scene/common/object_staged_actor.h
Functions
StagedActor_FindAtTile
static struct FieldActor * StagedActor_FindAtTile(const struct FieldPosition *position, const struct FieldActor *origin)
Returns the placed actor on the cell of the 16.16 position and at its height (in whole pixels), or 0. origin is not read.
Used by BabiLighthouse_FindActorAhead, CrossboneIslePillarRooms_TryJumpAcrossPillar, Event_PushOrClimbDown, StagedActor_AdvancePair.
StagedActor_AdvancePair
UNUSED static void StagedActor_AdvancePair(void)
The leader pushes the block in front of them a cell on, unless something solid is beyond it or on top of it, the ground beyond refuses it or it is still moving: after a quarter second's push (mode 8) the block and the leader slide one cell together, with SE_185.
Used by AltmillerCave_AdvanceObstacleAndCheckPassage, BabiLighthouse_AdvanceNearbyPair, BabiLighthouse_AdvancePairAndJump, Event_JumpOrPushPillar, Event_JumpOrPushRoom4Pillar, Event_PushBlock, Event_PushBlocks, Event_PushColumn, Event_PushDousePillar, Event_PushEastPillar, Event_PushFirstPillars, Event_PushLadyStatue, Event_PushObject, Event_PushSecondObject, Event_PushSecondPillars, Event_PushSinkingPillar, Event_PushSinkingPillarA, Event_PushSinkingPillarB, MercuryLighthouse_PushGateSwitchBlock, MercuryLighthouse_PushStairSwitchBlock.
StagedActor_FillGridAttributeRectangle
static s32 StagedActor_FillGridAttributeRectangle(u32 layer, s32 x, s32 z, u32 width, u32 height, s32 value)
Sets the collision code of a width by height rectangle of cells, from cell (x, z), to value, on map layer 0 to 2, or (3 and up) in gMapCellBuffer.
Used by CrossboneIslePillarRooms_RestoreGroundFootprint, Event_MoveSinkingPillar, Event_StartMovingSinkingPillar, KolimaForestBridge_Initialize, KolimaForestBridge_PushLog, KolimaForestRiver_Initialize, KolimaForestRiver_PushLog, MogallForest_Initialize, MogallForest_SecondArea_PushLog, MogallForest_ThirdArea_UpdateSouthObstacle, MogallForest_UpdateObstacleFootprint, TunnelRuins_MarkPushPillarCells.
Globals
gStagedActor_DirectionSteps
extern s32 gStagedActor_DirectionSteps[]
Pixel step by direction: X in the upper halfword, Z in the lower.
Used by BabiLighthouse_FindActorAhead, ColossoLog_PushActorAhead, CrossboneIslePillarRooms_TryJumpAcrossPillar, Event_JumpAcrossGap, StagedActor_AdvancePair, VenusLighthouse_PushAdjacentBlock.
Also, globals without a comment: gStagedActor_FootprintBounds.
object_waitdown.h
games/tbs/src/scene/common/object_waitdown.h
Functions
SceneActor_WaitObjectBelowHeight
static void SceneActor_WaitObjectBelowHeight(struct FieldActor *object, s32 height)
Waits until the object has come down to height (16.16), a second at most.
Used by CollapseFromHeat, GomaCaveEntrance_LeapStump, GomaCaveWaterway_LeapStump.
object_waitidle.h
games/tbs/src/scene/common/object_waitidle.h
Functions
OverlayObject_WaitUntilIdle
static void OverlayObject_WaitUntilIdle(struct FieldActor *obj)
Waits until the object stops rising or falling, a second at most.
Used by BabiLighthouse_FallToExit, Event_CarryBlockAcrossGap, Event_CarryFloatingBlock, Event_FallThroughFloor, Event_MoveGateBlock, Event_MovePillarSwitchBlock, Event_MoveSwitchBlock, Scene_RunEntrySetup, VenusLighthouse_ReleaseFallenCarryBlock.
scroll_initialize_hblank_dma.h
games/tbs/src/scene/common/scroll_initialize_hblank_dma.h
Functions
DisplayScroll_InitializeHBlankDma
void DisplayScroll_InitializeHBlankDma(s32 mode, s32 freqX, s32 stepX, s32 ampX, s32 freqY, s32 stepY, s32 ampY)
Starts the ripple: its work (heap block 34) holds the mode and, for x and y, the wave's frequency, its step each frame and its amplitude; two scene callbacks build each frame's table of line offsets and sends it by DMA in the horizontal blank.
Used by Ripple_Start.
Also, functions without a comment: WaitDma.
sol_sanctum_elemental_star_ring_setup.h
games/tbs/src/scene/common/sol_sanctum_elemental_star_ring_setup.h
Functions
SolSanctum_UpdateRing
static void SolSanctum_UpdateRing(void)
A scene callback, the lights' work in work slot 33. Every third frame each light grows to its largest scale and shrinks to a tenth; at the smallest it vanishes for 24 steps while its drift carries on, and comes back where the drift has taken it. Its drift is a random speed on each axis, as its tables allow, turned into a sine swing.
Used by SolSanctum_StartFloatingLights.
SolSanctum_StartFloatingLights
void SolSanctum_StartFloatingLights(s32 first, u32 count)
Starts the floating lights: count actors (at most 10) from first, each drawn translucent and starting at its largest scale.
Used by SolSanctumElementalStarRoom_Initialize.
Structures
SolSanctumRingEntry
struct SolSanctumRingEntry
One floating light: its actor, its drift and its pulsing scale, and where it is while hidden.
| Field | Declared as | |
|---|---|---|
obj | struct FieldActor *obj | |
x | s32 x | 16.16 fixed-point pixels |
y | s32 y | 16.16 fixed-point pixels |
z | s32 z | 16.16 fixed-point pixels |
speedX | s32 speedX | |
speedY | s32 speedY | |
speedZ | s32 speedZ | |
scale | s32 scale | 16.16 fixed point, where 0x10000 is full size |
scaleStep | s32 scaleStep | 16.16 fixed point |
timer | u8 timer | |
hold | u8 hold | |
pad26 | u8 pad26[2] |
Used by SolSanctum_StartFloatingLights, SolSanctum_UpdateRing.
SolSanctumRingList
struct SolSanctumRingList
The floating lights' work in work slot 33, one entry per light.
| Field | Declared as | |
|---|---|---|
entries | struct SolSanctumRingEntry entries[SOL_SANCTUM_RING_MAX] | |
count | u16 count |
Used by SolSanctum_StartFloatingLights, SolSanctum_UpdateRing.
sol_sanctum_init_zoom.h
games/tbs/src/scene/common/sol_sanctum_init_zoom.h
Sol Sanctum's corridor and maze: the scenes' initialization.
Functions
SolSanctumRooms_Initialize
s32 SolSanctumRooms_Initialize(void)
The scene opens in the window transition over 16 frames. Once Mt. Aleph has erupted (FLAG_SOL_SANCTUM_ERUPTED), the rooms rumble (SE_141), the map shakes without end and sparkles start.
vale.h
games/tbs/src/scene/common/vale.h
Vale's storm and Vale's homes: going indoors through a door.
Functions
Vale_RequestBackdropExit
static void Vale_RequestBackdropExit(s32 no)
Takes exit no in the backdrop fade over 16 frames, first stopping the storm's lightning while the storm rages (FLAG_VALE_STORM).
Used by Event_LeaveByExit1, Event_LeaveByExit10, Event_LeaveByExit12, Event_LeaveByExit13, Event_LeaveByExit2, Event_LeaveByExit3, Event_LeaveByExit4, Event_LeaveByExit5, Event_LeaveByExit6, Event_LeaveByExit7, Event_LeaveByExit8, Event_LeaveByExit9, Event_LeaveThroughSouthPassage, Event_LeaveThroughWestPassage, Event_OpenCentralEastDoor, Event_OpenCentralWestDoor, Event_OpenNortheastDoor, Event_OpenNorthwestDoor, Event_OpenSoutheastDoor, Event_OpenSouthwestDoor, Event_OpenWestEdgeDoor, ValeStorm_OpenBackdropExit11.
vault_bone.h
games/tbs/src/scene/common/vault_bone.h
Vault's interiors, before and after the thieves are caught: the Bone left on the floor of the house where the dog's owner offers bones. They are "leftover bones from dinner".
Functions
Vault_FindBone
static void Vault_FindBone(void)
Searching cell code 41 beside the bone giver takes a Bone after the thieves are jailed. The floor Bone remains, so the party can take more. With no room for it, actor 18 (the bone giver in both scenes) shakes their head: "Aren't you a greedy lad!"
Used by gVaultInteriorsRevisit_Events, gVaultInteriors_EventsAfterThieves.
vault_djinn.h
games/tbs/src/scene/common/vault_djinn.h
Vault and its interiors: Ivan hands back Isaac's Djinni before he leaves the party. "Oh, wait, I don't want to take your Djinni."
vault_itemobj.h
games/tbs/src/scene/common/vault_itemobj.h
Vault's interiors, before and after the thieves are caught: an item lying on the floor, drawn as its menu icon (the Bone, at (568, 16, 672)).
Functions
Vault_PlaceItemIcon
void Vault_PlaceItemIcon(s32 item, s32 fixed_x, s32 fixed_y, s32 fixed_z)
Creates object 22 at the 16.16 position and draws it as the item's icon: the sprite's own animation is stopped (flags and count 0, 16-colour, palette 0), the object stays put (motionFlags 0), and the icon's tiles, decoded into heap block 17, are loaded into the sprite's VRAM block.
Used by Scene_Initialize.
vault_nearby.h
games/tbs/src/scene/common/vault_nearby.h
Vault, before and after the thieves are caught: the two villagers who walk about together (actors 14 and 15).
vault_range.h
games/tbs/src/scene/common/vault_range.h
Vault, before and after the thieves are caught: villagers who walk about stop when someone is close in front of them.
Functions
Vault_StopIfFacingNear
s32 Vault_StopIfFacingNear(struct FieldActor *actor, struct FieldActor *target, s32 range, s32 force)
Stops the actor (paused, mode 1) when the target is nearer than range pixels and lies ahead of it, within a sixteenth of a turn either side of its heading; force stops it regardless. Returns 1 when it stopped. A target out of range sets it walking again (mode 2).
vault_scene_cells.h
games/tbs/src/scene/common/vault_scene_cells.h
Vault, before and after the thieves are caught: the doorway of exit 11, which opens in two frames as the leader walks into it facing north.
Functions
Vault_DrawDoorwayFrame
static inline void Vault_DrawDoorwayFrame(s32 sourceColumn)
The two square halves are stacked in the source map and drawn side by side.
Used by Vault_OpenDoorwayAndEnter.
Vault_OpenDoorwayAndEnter
static void Vault_OpenDoorwayAndEnter(void)
Walking north into cell code 11 opens the doorway to the Sanctum. The leader passes behind the doorframe through exit 11.
Used by gVaultRevisit_Events.
vault_spotflag.h
games/tbs/src/scene/common/vault_spotflag.h
Vault's interiors, before and after the thieves are caught: whether the leader stands beside the Bone on the floor, which the scenes' event tables test through FLAG_SCENE_TEMP_50.
Functions
Vault_UpdateBoneProximityFlag
static void Vault_UpdateBoneProximityFlag(void)
Prevents the bone giver offering another Bone while the leader stands beside the one on the floor. Each scene adds this callback in the bone giver's house after the thieves are jailed. FLAG_SCENE_TEMP_50 records proximity for the talk-event table.
Used by Scene_Initialize.
vault_talk.h
games/tbs/src/scene/common/vault_talk.h
Vault and its interiors: a villager's thought read with Mind Read.
Functions
Vault_ShowThought
static void Vault_ShowThought(s32 actorId)
Shows the message already set as the actor's thought: the actor stops and stands while the thought is shown.
Used by Event_ReadBoneGiverMind, Event_ReadChildMind, Event_ReadMayorMind, Event_ReadMindOnRock, Event_ReadMindOnThieves.
vault_toggle.h
games/tbs/src/scene/common/vault_toggle.h
Vault, before and after the thieves are caught: touch triggers 1 and 2 swap the collision of the 4x2 cells at cell (23, 26) between two versions kept elsewhere in the map. FLAG_SCENE_TEMP_00 remembers the alternate version, which each scene restores on a kept-position return, such as after battle.
Functions
Vault_EnableAlternatePassageCells
static void Vault_EnableAlternatePassageCells(void)
Cell code 1 selects the passage's alternate collision and sets FLAG_SCENE_TEMP_00, preserving that choice across a kept-position return.
Used by gVaultRevisit_Events.
Vault_RestorePassageCells
static void Vault_RestorePassageCells(void)
Cell code 2 restores the passage's usual collision and clears FLAG_SCENE_TEMP_00.
Used by gVaultRevisit_Events.
world_map_linked_effects.h
games/tbs/src/scene/common/world_map_linked_effects.h
Functions
WorldMap_CreateLinkedEffects
void WorldMap_CreateLinkedEffects(struct FieldActor *parent)
Attaches two rising particles to the actor, sharing the effect's cached tiles.
Used by Event_MeetFlint, WorldMap_UpdateBlinkingLinkedEffects, WorldMap_UpdateCyclingLinkedEffects.