Alchemy

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.

Line 80

Scene_GetPlacements

const struct ScenePlacement *Scene_GetPlacements(void)

Selects the movable blocks, falling objects and Frost targets.

Line 98

VaultCave_FindCollidableActorAtCell

static struct FieldActor *VaultCave_FindCollidableActorAtCell(s32 column, s32 row)

Finds a placed actor with collision enabled at the requested map cell.

Line 114

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.

FieldDeclared as
xzs32 xz[16]

Line 156

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.

Line 149

Also, macros without a comment: TILE, DIRECTION_STEP.

Declarations, without a comment: VaultCave_ApplySouthernSwitchCells, VaultCave_UseUnderfootFrostPriorities, VaultCave_UseAutomaticFrostPriorities, VaultCave_SpawnPuffs.

On this page