vault_cave.c
Vault's cave puzzles: movable switches, Frost targets, falling objects and the rumbling mechanism restored when the party returns.
games/tbs/src/scene/vault_cave.c on GitHub
Vault's cave puzzles: movable switches, Frost targets, falling objects and the rumbling mechanism restored when the party returns.
Functions
Scene_GetRegions
const struct SceneRegion *Scene_GetRegions(void)
Returns the region boxes used by the cave exits.
Scene_GetPlacements
const struct ScenePlacement *Scene_GetPlacements(void)
Selects the movable blocks, falling objects and Frost targets.
VaultCave_FindCollidableActorAtCell
static struct FieldActor *VaultCave_FindCollidableActorAtCell(s32 column, s32 row)
Finds a placed actor with collision enabled at the requested map cell.
Also, functions without a comment: Scene_GetEntrances, Scene_GetExits.
Structures
DirectionSteps
struct DirectionSteps
The step table read as one word per heading: the x step in pixels in the high halfword, the z step in the low. The struct's array reference keeps the native loads; an s32 pointer to the table does not.
| Field | Declared as | |
|---|---|---|
xz | s32 xz[16] |
Macros
DIRECTION_STEP
#define DIRECTION_STEP(heading)
The table stores Z then X as halfwords. Build its packed word without reading a halfword array through an incompatible, more-aligned struct.
Used by gBilibinCave_PushSteps, gBilibin_FacingCellSteps, gColossoRiver_DirectionSteps, gColossoWall_DirectionSteps, gStagedActor_DirectionSteps.
Also, macros without a comment: TILE, DIRECTION_STEP.
Declarations, without a comment: VaultCave_ApplySouthernSwitchCells, VaultCave_UseUnderfootFrostPriorities, VaultCave_UseAutomaticFrostPriorities, VaultCave_SpawnPuffs.