Skip to Content
The Alchemy Project

src/scene/vault_cave.c

Vault Cave, the optional cave under Vault that the party can explore once it comes back to the town (SceneIdVaultRevisit), with the Vambrace in a chest and Sap, the Venus Djinni, waiting outside its far end. More…

Macros

NameDescription
#defineMETATILE_OF (position) ((position) / toFIXED(16))The map metatile a 16.16 coordinate lies in, by division: the same as FIELD_METATILE's shift but for a coordinate below 0, which it rounds toward metatile 0.
#definePUSHED_ACTOR_TABLES_READ_ONLYThe cave keeps its pushed-actor steps with its read-only data, though they are not const: the pushes read the step again after each call.

Enumerations

NameDescription
enumVAULT_CAVE_METATILE_BEHAVIOR { METATILE_BEHAVIOR_VAULT_CAVE_SWITCH, METATILE_BEHAVIOR_VAULT … }The metatile behaviors of the metatiles the scripts answer.
enumanonymous enum { FLAG_VAULT_CAVE_WEST_UPPER_PUDDLE_FROZEN, FLAG_VAULT_CAVE_WE … }Scene flags, and one area flag.
enumFLAME_PILLAR_ANIMATION { FLAME_PILLAR_ANIMATION_UNLIT, FLAME_PILLAR_ANIMATION_BURNING }SPRITE_FLAME_PILLAR's animations (flame_pillar.tsv).
enumVAULT_CAVE_VAMBRACE_ACTOR_ID { ACTOR_PILLAR_EAST_OF_SOUTHERN_SWITCH, ACTOR_SOUTHERN_PILLAR, … }The actors of SceneIdVaultCaveVambrace, numbering the rows of VaultCaveVambraceActorPlacements.
enumVAULT_CAVE_MOUTH_ACTOR_ID { ACTOR_PILLAR_EAST_OF_NORTHERN_SWITCH, ACTOR_PILLAR_SOUTH_OF_ … }The actors of SceneIdVaultCaveMouth, numbering the rows of VaultCaveMouthActorPlacements.

Functions

NameDescription
static voidscVaultCaveApplySouthernSwitchMetatiles (void)Draws the room of two flame pillars' wooden gate open and lets the party through it.
static voidscVaultCaveUseUnderfootFrostPriorities (void)Keeps all six puddles beneath the leader's feet.
static voidscVaultCaveUseAutomaticFrostPriorities (void)Restores automatic draw priority for the same six puddles.
static voidscVaultCaveSpawnSplash (ACTOR *src)Splashes up to four little drops around a drop of water where it lands.
const SCENE_ENTRANCE *scGetEntrances (void)The six rooms share one entrance table.
const SCENE_EXIT_REGION *scGetExitRegions (void)The scene has no exit regions: its regions entry returns none.
const Uint32 *scGetExits (void)Both scenes share one exit table.
const ACTOR_PLACE *scGetActorPlacements (void)Selects the pillars, drops of water, puddles and ivy of the room.
static ACTOR *scVaultCaveFindCollidableActorAtMetatile (Sint32 column, Sint32 row)Finds a placed actor with collision enabled at the requested map metatile.
static voidscVaultCavePushPillarAhead (void)Pushes the pillar Isaac faces one metatile, unless another pillar or the rock is in the way.
static voidscVaultCaveUseWhirlwind (void)Whirlwind on the ivy on the ledge above the room of six puddles blows it away, opening the way to the Vambrace's chest.
static voidscVaultCaveShowLockedDoor (void)Searching a locked door in Vault Cave: "The door is tightly locked."
const CUE *scGetCues (void)Selects the room's cues: its exits, doors, chest and switch, its pillars to push, and its Psynergy targets.
static BoolscVaultCaveIsSouthernPillarOnSwitch (void)Whether the west pillar of the room of two flame pillars stands on the floor switch.
static inline voidscVaultCaveCompleteSouthernSwitch (void)Once the pillar is on the floor switch, plays the puzzle chime and opens the wooden gate.
static voidscVaultCavePushSouthernPillar (void)In the room of two flame pillars, up the left-hand branch, Isaac pushes a pillar a metatile.
static voidscVaultCaveMoveSouthernPillar (void)In the room of two flame pillars, Isaac uses Move on the west pillar: a great hand slides it a metatile, and if that puts it on the floor switch the puzzle chime plays and the wooden gate opens.
static void UNUSEDscVaultCaveUnusedNoOperation (void)
static voidscVaultCaveApplyNorthernSwitchMetatiles (void)Draws the room of three flame pillars' wooden gate open and lets the party through it.
static BoolscVaultCaveIsNorthernPillarOnSwitch (void)Whether the lower pillar of the room of three flame pillars stands on the floor switch.
static inline voidscVaultCaveCompleteNorthernSwitch (void)Opens the gate only for a pillar on the floor switch whose flame no drop has put out.
static voidscVaultCavePushNorthernPillar (void)In the room of three flame pillars, on the way to the cave mouth, Isaac pushes a pillar a metatile.
static voidscVaultCaveMoveUnlitPillar (void)In the room of three flame pillars, Isaac uses Move on the unlit pillar just south of the floor switch.
static voidscVaultCaveMoveNorthernPillar (void)In the room of three flame pillars, Isaac uses Move on the lower burning pillar: a great hand slides it a metatile, and if that puts it on the floor switch still burning, the puzzle chime plays and the wooden gate opens.
static voidscVaultCaveFreezeWestUpperPuddle (void)In the room of six puddles, Isaac casts Frost on the north-west puddle (metatile (23, 32)), and it freezes into a tall ice pillar whose top Isaac can leap across.
static voidscVaultCaveFreezeWestLowerPuddle (void)In the room of six puddles, Isaac casts Frost on the south-west puddle (metatile (23, 34)), and it freezes into a tall ice pillar whose top Isaac can leap across.
static voidscVaultCaveFreezeInnerWestLowerPuddle (void)In the room of six puddles, Isaac casts Frost on the puddle just east of the south-west one (metatile (24, 34)), and it freezes into a tall ice pillar whose top Isaac can leap across.
static voidscVaultCaveFreezeEastUpperPuddle (void)In the room of six puddles, Isaac casts Frost on the north-east puddle (metatile (26, 32)), and it freezes into a tall ice pillar whose top Isaac can leap across.
static voidscVaultCaveFreezeEastLowerPuddle (void)In the room of six puddles, Isaac casts Frost on the south-east puddle (metatile (26, 34)), and it freezes into a tall ice pillar whose top Isaac can leap across.
static voidscVaultCaveFreezeFarEastPuddle (void)In the room of six puddles, Isaac casts Frost on the far east puddle (metatile (28, 33)), and it freezes into a tall ice pillar whose top Isaac can leap across.
static voidscVaultCaveUpdatePuddlePriorities (void)Keeps the ice pillars drawn under Isaac while he is up on top of one.
static voidscVaultCaveRunRumble (void)The cave rumbles and shakes for eight seconds while the pool's water churns, then the water fades away and the drained pool is drawn.
static voidscVaultCaveFlipSwitch (void)Isaac flips the switch on the ledge in the pool room (metatile (28, 29)).
static Sint32scVaultCaveCatchDropOnActor (Sint32 subjectActorId)Whether a drop of water about to land is over the given actor's metatile; if so, the drop is sent back up to fall again.
static voidscVaultCaveUpdateTimedDrops (void)In the room of three flame pillars, lets the four drops of water fall on their fixed beat, splashing where they land and putting out the lower pillar's flame if one lands on it.
static voidscVaultCaveUpdateRandomDrops (void)In the room of six puddles, lets a drop of water chosen at random fall every 64 ticks, onto its puddle or onto the top of its ice pillar.
static voidscVaultCaveOffsetActorRadially (ACTOR *actor, Sint32 radius, Sint32 angle)Offsets an actor's current position by a polar displacement.
static voidscVaultCaveStartRandomDrops (void)Readies the room of six puddles' drops of water and starts them falling.
static voidscVaultCaveStartTimedDrops (void)Readies the room of three flame pillars' drops of water and starts them falling.
Sint32scInit (void)Arriving in any room of Vault Cave restores the room's puzzles and actors.

Variables

NameDescription
extern const Sint32VaultCaveSplashScript []
extern SCENE_ENTRANCEVaultCavePassageEntrances []
extern SCENE_ENTRANCEVaultCaveVambraceEntrances []
extern SCENE_ENTRANCEVaultCaveMouthEntrances []
extern SCENE_EXIT_REGIONVaultCaveRegions []
extern Uint32VaultCaveFallbackExits []
extern Uint32VaultCavePassageExits []
extern Uint32VaultCaveVambraceExits []
extern Uint32VaultCaveMouthExits []
extern ACTOR_PLACEVaultCaveFallbackActorPlacements []
extern ACTOR_PLACEVaultCavePassageActorPlacements []
extern ACTOR_PLACEVaultCaveVambraceActorPlacements []
extern ACTOR_PLACEVaultCaveMouthActorPlacements []
extern CUEVaultCaveFallbackCues []
extern CUEVaultCavePassageCues []
extern CUEVaultCaveVambraceCues []
extern CUEVaultCaveMouthCues []
extern Uint32VaultCaveScheduleTicks []The tick of the 191-tick beat at which each timed drop falls.
extern Sint32VaultCaveScheduleTimerThe tick of the drops' 191-tick beat, and the timed drop that falls next when it reaches that drop's tick in VaultCaveScheduleTicks.
extern Sint32VaultCaveScheduleIndex
extern Sint32VaultCaveDropTicksThe ticks counted for the random drops, one picked every 64 ticks, and the one picked, from the first of the six.
extern Sint32VaultCaveSelectedDrop

Description

Vault Cave, the optional cave under Vault that the party can explore once it comes back to the town (SceneIdVaultRevisit), with the Vambrace in a chest and Sap, the Venus Djinni, waiting outside its far end. Its three parts are scenes of their own, all named Vault Cave (area 31).

The way in is the passage Reveal uncovers among Vault's six gravestones, where the dog jumps once given a Bone; a ladder leads down from it. The way out is a cave mouth in the town's north-east cliff, above which the bell sent Sap.

The cave is a side trip of puzzles for Move, Frost and Whirlwind. No one speaks, and the only messages are "The door is tightly locked." and "Isaac flipped the switch."

Each room has a door that only says it is locked (scVaultCaveShowLockedDoor).

The pushes share scVaultCavePushPillarAhead, which moves the pillar the leader faces one metatile unless another actor or the rock is in the way. The water drops run as events started by scInit.

Macros in detail

METATILE_OF

#define METATILE_OF(position) ((position) / toFIXED(16))

The map metatile a 16.16 coordinate lies in, by division: the same as FIELD_METATILE's shift but for a coordinate below 0, which it rounds toward metatile 0.

Referenced by scVaultCaveCatchDropOnActor().

Definition at line 94 of file vault_cave.c.

PUSHED_ACTOR_TABLES_READ_ONLY

#define PUSHED_ACTOR_TABLES_READ_ONLY

The cave keeps its pushed-actor steps with its read-only data, though they are not const: the pushes read the step again after each call.

Definition at line 1197 of file vault_cave.c.

Enumerations in detail

VAULT_CAVE_METATILE_BEHAVIOR

enum VAULT_CAVE_METATILE_BEHAVIOR

The metatile behaviors of the metatiles the scripts answer.

EnumeratorValueDescription
METATILE_BEHAVIOR_VAULT_CAVE_SWITCH20The switch on the ledge in the pool room: metatile (28, 29).
METATILE_BEHAVIOR_VAULT_CAVE_NORTHERN_PILLAR50The floor of the room of three flame pillars, where Isaac pushes them: metatiles (12, 14) to (20, 17) and the switch's metatile (16, 12).
METATILE_BEHAVIOR_VAULT_CAVE_SOUTHERN_PILLAR60The floor of the room of two flame pillars, where Isaac pushes them: metatiles (10, 55) to (16, 55) and the rows either side.
METATILE_BEHAVIOR_VAULT_CAVE_LOCKED_DOOR99
METATILE_BEHAVIOR_VAULT_CAVE_CHEST100

Definition at line 97 of file vault_cave.c.

anonymous enum

enum { FLAG_VAULT_CAVE_WEST_UPPER_PUDDLE_FROZEN, FLAG_VAULT_CAVE_WEST_LOWER_PUDDLE_FROZEN, FLAG_VAULT_CAVE_INNER_WEST_LOWER_PUDDLE_FROZEN, FLAG_VAULT_CAVE_EAST_UPPER_PUDDLE_FROZEN, … }

Scene flags, and one area flag. The six puddles of SceneIdVaultCaveVambrace keep their frozen state in six flags in a row, read by index as well.

EnumeratorValueDescription
FLAG_VAULT_CAVE_WEST_UPPER_PUDDLE_FROZENFLAG_SCENE_TEMP(0x00)The upper western puddle, the first of the six.
FLAG_VAULT_CAVE_WEST_LOWER_PUDDLE_FROZENFLAG_SCENE_TEMP(0x01)
FLAG_VAULT_CAVE_INNER_WEST_LOWER_PUDDLE_FROZENFLAG_SCENE_TEMP(0x02)
FLAG_VAULT_CAVE_EAST_UPPER_PUDDLE_FROZENFLAG_SCENE_TEMP(0x03)
FLAG_VAULT_CAVE_EAST_LOWER_PUDDLE_FROZENFLAG_SCENE_TEMP(0x04)
FLAG_VAULT_CAVE_FAR_EAST_PUDDLE_FROZENFLAG_SCENE_TEMP(0x05)
FLAG_VAULT_CAVE_NORTH_PILLAR_STRUCKFLAG_SCENE_TEMP(0x07)A drop of water has put out the flame of the
FLAG_VAULT_CAVE_IVY_BLOWN_AWAYFLAG_AREA_TEMP(0x00)lower pillar in the room of three flame pillars. The drop's metatile matched the pillar's (scVaultCaveCatchDropOnActor). Whirlwind has blown the ivy away.

Definition at line 119 of file vault_cave.c.

FLAME_PILLAR_ANIMATION

enum FLAME_PILLAR_ANIMATION

SPRITE_FLAME_PILLAR's animations (flame_pillar.tsv).

EnumeratorValueDescription
FLAME_PILLAR_ANIMATION_UNLIT1the pillar, no flame on top
FLAME_PILLAR_ANIMATION_BURNING2a flame flickering on top

Definition at line 138 of file vault_cave.c.

VAULT_CAVE_VAMBRACE_ACTOR_ID

enum VAULT_CAVE_VAMBRACE_ACTOR_ID

The actors of SceneIdVaultCaveVambrace, numbering the rows of VaultCaveVambraceActorPlacements.

EnumeratorValueDescription
ACTOR_PILLAR_EAST_OF_SOUTHERN_SWITCHACTOR_FIRST_PLACEDThe burning pillar beside the wooden gate in the room of two flame pillars, two metatiles east of the floor switch. It is drawn underfoot when the party arrives by VAULT_CAVE_VAMBRACE_VAULT_CAVE_PASSAGE_SOUTH or VAULT_CAVE_VAMBRACE_SOUTH_FROST_ROOM.
ACTOR_SOUTHERN_PILLARThe west pillar, which goes onto the floor switch at metatile (15, 54).
ACTOR_FIRST_WATER_DROPThe first of six drops of water that fall at random, one every 64 ticks (scVaultCaveUpdateRandomDrops). scVaultCaveSpawnSplash also uses their sprite for the splash where one lands.
ACTOR_WEST_UPPER_PUDDLEACTOR_FIRST_WATER_DROP + 6The six puddles under the drops, in their order and in the order of their flags (FLAG_VAULT_CAVE_WEST_UPPER_PUDDLE_FROZEN to FLAG_VAULT_CAVE_FAR_EAST_PUDDLE_FROZEN). Frost freezes each into an ice pillar, as in bilibin_cave.c, and a drop landing on one stops on its top, 32 pixels up.
ACTOR_WEST_LOWER_PUDDLE
ACTOR_INNER_WEST_LOWER_PUDDLE
ACTOR_EAST_UPPER_PUDDLE
ACTOR_EAST_LOWER_PUDDLE
ACTOR_FAR_EAST_PUDDLE
ACTOR_IVYThe ivy on the ledge above the room of six puddles, over the way to the Vambrace's chest (SPRITE_IVY, as in bilibin.c, drawn half as tall again). It is placed until Whirlwind blows it away (FLAG_VAULT_CAVE_IVY_BLOWN_AWAY).

Definition at line 146 of file vault_cave.c.

VAULT_CAVE_MOUTH_ACTOR_ID

enum VAULT_CAVE_MOUTH_ACTOR_ID

The actors of SceneIdVaultCaveMouth, numbering the rows of VaultCaveMouthActorPlacements. The floor switch in the room of three flame pillars is map metatile (16, 12).

EnumeratorValueDescription
ACTOR_PILLAR_EAST_OF_NORTHERN_SWITCHACTOR_FIRST_PLACEDThe burning pillar beside the wooden gate, two metatiles east of the floor switch.
ACTOR_PILLAR_SOUTH_OF_NORTHERN_SWITCHThe unlit pillar two metatiles south of the floor switch, in the way.
ACTOR_NORTHERN_PILLARThe lower burning pillar, which goes onto the floor switch.
ACTOR_FIRST_TIMED_WATER_DROPThe first of four drops of water that fall on a fixed schedule (scVaultCaveUpdateTimedDrops).

Definition at line 182 of file vault_cave.c.

Functions in detail

scVaultCaveApplySouthernSwitchMetatiles

static void scVaultCaveApplySouthernSwitchMetatiles(void)

Draws the room of two flame pillars' wooden gate open and lets the party through it.

References fdMapGridCopyMetatileAttributes() and fdMapGridCopyMetatiles().

Referenced by scInit() and scVaultCaveCompleteSouthernSwitch().

Definition at lines 86 and 441 of file vault_cave.c.

scVaultCaveUseUnderfootFrostPriorities

static void scVaultCaveUseUnderfootFrostPriorities(void)

Keeps all six puddles beneath the leader's feet.

References fdActorGet() and Sint32.

Referenced by scVaultCaveUpdatePuddlePriorities().

Definition at lines 87 and 663 of file vault_cave.c.

scVaultCaveUseAutomaticFrostPriorities

static void scVaultCaveUseAutomaticFrostPriorities(void)

Restores automatic draw priority for the same six puddles.

References fdActorGet() and Sint32.

Referenced by scVaultCaveUpdatePuddlePriorities().

Definition at lines 88 and 677 of file vault_cave.c.

scVaultCaveSpawnSplash

static void scVaultCaveSpawnSplash(ACTOR *src)

Splashes up to four little drops around a drop of water where it lands.

References fdActorStartScript(), scFieldActorCreate(), scVaultCaveOffsetActorRadially(), Sint32, syRandomNext() and VaultCaveSplashScript.

Referenced by scVaultCaveUpdateTimedDrops().

Definition at lines 89 and 955 of file vault_cave.c.

scGetEntrances

const SCENE_ENTRANCE *scGetEntrances(void)

References MainRoutineStateWork, SceneFallbackEntrances, VaultCaveMouthEntrances, VaultCavePassageEntrances and VaultCaveVambraceEntrances.

Definition at line 198 of file vault_cave.c.

scGetExitRegions

const SCENE_EXIT_REGION *scGetExitRegions(void)

References VaultCaveRegions.

Definition at line 217 of file vault_cave.c.

scGetExits

const Uint32 *scGetExits(void)

References MainRoutineStateWork, VaultCaveFallbackExits, VaultCaveMouthExits, VaultCavePassageExits and VaultCaveVambraceExits.

Definition at line 222 of file vault_cave.c.

scGetActorPlacements

const ACTOR_PLACE *scGetActorPlacements(void)

Selects the pillars, drops of water, puddles and ivy of the room.

References MainRoutineStateWork, VaultCaveFallbackActorPlacements, VaultCaveMouthActorPlacements, VaultCavePassageActorPlacements and VaultCaveVambraceActorPlacements.

Definition at line 242 of file vault_cave.c.

scVaultCaveFindCollidableActorAtMetatile

static ACTOR *scVaultCaveFindCollidableActorAtMetatile(Sint32 column, Sint32 row)

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

References Sint32 and state.

Referenced by scVaultCavePushPillarAhead().

Definition at line 262 of file vault_cave.c.

scVaultCavePushPillarAhead

static void scVaultCavePushPillarAhead(void)

Pushes the pillar Isaac faces one metatile, unless another pillar or the rock is in the way.

References fdActorGet(), fdActorSelectAnimation(), fdActorStepFrom(), fdActorWaitForMove(), PushedActorDirectionSteps, scFieldActorCheckMovementCollision(), scFieldActorSetMoveTargetFX(), scVaultCaveFindCollidableActorAtMetatile(), Sint32, sySoundPlay() and sySynch().

Referenced by scVaultCavePushNorthernPillar() and scVaultCavePushSouthernPillar().

Definition at line 290 of file vault_cave.c.

scVaultCaveUseWhirlwind

static void scVaultCaveUseWhirlwind(void)

Whirlwind on the ivy on the ledge above the room of six puddles blows it away, opening the way to the Vambrace's chest.

References gmFlagSet().

Referenced by VaultCaveVambraceCues.

Definition at line 368 of file vault_cave.c.

scVaultCaveShowLockedDoor

static void scVaultCaveShowLockedDoor(void)

Searching a locked door in Vault Cave: "The door is tightly locked."

References mnFieldMessageShow().

Referenced by VaultCaveMouthCues, VaultCavePassageCues and VaultCaveVambraceCues.

Definition at line 374 of file vault_cave.c.

scGetCues

const CUE *scGetCues(void)

Selects the room's cues: its exits, doors, chest and switch, its pillars to push, and its Psynergy targets.

References MainRoutineStateWork, VaultCaveFallbackCues, VaultCaveMouthCues, VaultCavePassageCues and VaultCaveVambraceCues.

Definition at line 381 of file vault_cave.c.

scVaultCaveIsSouthernPillarOnSwitch

static Bool scVaultCaveIsSouthernPillarOnSwitch(void)

Whether the west pillar of the room of two flame pillars stands on the floor switch.

References fdActorGet() and Sint32.

Referenced by scVaultCaveCompleteSouthernSwitch().

Definition at line 402 of file vault_cave.c.

scVaultCaveCompleteSouthernSwitch

static inline void scVaultCaveCompleteSouthernSwitch(void)

Once the pillar is on the floor switch, plays the puzzle chime and opens the wooden gate.

References gmFlagSet(), scVaultCaveApplySouthernSwitchMetatiles(), scVaultCaveIsSouthernPillarOnSwitch() and sySoundPlay().

Referenced by scVaultCaveMoveSouthernPillar() and scVaultCavePushSouthernPillar().

Definition at line 417 of file vault_cave.c.

scVaultCavePushSouthernPillar

static void scVaultCavePushSouthernPillar(void)

In the room of two flame pillars, up the left-hand branch, Isaac pushes a pillar a metatile. Once the west pillar reaches the floor switch (metatile (15, 54)), the puzzle chime plays and the wooden gate north of it opens.

References fdScriptGetFlag(), scVaultCaveCompleteSouthernSwitch() and scVaultCavePushPillarAhead().

Referenced by VaultCaveVambraceCues.

Definition at line 430 of file vault_cave.c.

scVaultCaveMoveSouthernPillar

static void scVaultCaveMoveSouthernPillar(void)

In the room of two flame pillars, Isaac uses Move on the west pillar: a great hand slides it a metatile, and if that puts it on the floor switch the puzzle chime plays and the wooden gate opens.

References fdScriptGetFlag() and scVaultCaveCompleteSouthernSwitch().

Referenced by VaultCaveVambraceCues.

Definition at line 451 of file vault_cave.c.

scVaultCaveUnusedNoOperation

static void UNUSED scVaultCaveUnusedNoOperation(void)

Definition at line 459 of file vault_cave.c.

scVaultCaveApplyNorthernSwitchMetatiles

static void scVaultCaveApplyNorthernSwitchMetatiles(void)

Draws the room of three flame pillars' wooden gate open and lets the party through it.

References fdMapGridCopyMetatileAttributes() and fdMapGridCopyMetatiles().

Referenced by scInit() and scVaultCaveCompleteNorthernSwitch().

Definition at line 465 of file vault_cave.c.

scVaultCaveIsNorthernPillarOnSwitch

static Bool scVaultCaveIsNorthernPillarOnSwitch(void)

Whether the lower pillar of the room of three flame pillars stands on the floor switch.

References fdActorGet() and Sint32.

Referenced by scVaultCaveCompleteNorthernSwitch().

Definition at line 474 of file vault_cave.c.

scVaultCaveCompleteNorthernSwitch

static inline void scVaultCaveCompleteNorthernSwitch(void)

Opens the gate only for a pillar on the floor switch whose flame no drop has put out.

References gmFlagGet(), gmFlagSet(), scVaultCaveApplyNorthernSwitchMetatiles(), scVaultCaveIsNorthernPillarOnSwitch() and sySoundPlay().

Referenced by scVaultCaveMoveNorthernPillar() and scVaultCavePushNorthernPillar().

Definition at line 489 of file vault_cave.c.

scVaultCavePushNorthernPillar

static void scVaultCavePushNorthernPillar(void)

In the room of three flame pillars, on the way to the cave mouth, Isaac pushes a pillar a metatile. If the lower pillar reaches the floor switch below the wooden gate (metatile (16, 12)) still burning, the puzzle chime plays and the gate opens; if a drop of water has put its flame out, nothing happens.

References scVaultCaveCompleteNorthernSwitch() and scVaultCavePushPillarAhead().

Referenced by VaultCaveMouthCues.

Definition at line 510 of file vault_cave.c.

scVaultCaveMoveUnlitPillar

static void scVaultCaveMoveUnlitPillar(void)

In the room of three flame pillars, Isaac uses Move on the unlit pillar just south of the floor switch. The great hand slides it a metatile like any pillar, even onto the switch, but an unlit pillar opens nothing.

The script itself is empty: Move does the sliding.

Referenced by VaultCaveMouthCues.

Definition at line 521 of file vault_cave.c.

scVaultCaveMoveNorthernPillar

static void scVaultCaveMoveNorthernPillar(void)

In the room of three flame pillars, Isaac uses Move on the lower burning pillar: a great hand slides it a metatile, and if that puts it on the floor switch still burning, the puzzle chime plays and the wooden gate opens.

References scVaultCaveCompleteNorthernSwitch().

Referenced by VaultCaveMouthCues.

Definition at line 528 of file vault_cave.c.

scVaultCaveFreezeWestUpperPuddle

static void scVaultCaveFreezeWestUpperPuddle(void)

In the room of six puddles, Isaac casts Frost on the north-west puddle (metatile (23, 32)), and it freezes into a tall ice pillar whose top Isaac can leap across.

References fdActorGet(), fdMapGridCopyMetatileAttributes() and gmFlagSet().

Referenced by scInit() and VaultCaveVambraceCues.

Definition at line 536 of file vault_cave.c.

scVaultCaveFreezeWestLowerPuddle

static void scVaultCaveFreezeWestLowerPuddle(void)

In the room of six puddles, Isaac casts Frost on the south-west puddle (metatile (23, 34)), and it freezes into a tall ice pillar whose top Isaac can leap across.

References fdActorGet(), fdMapGridCopyMetatileAttributes() and gmFlagSet().

Referenced by scInit() and VaultCaveVambraceCues.

Definition at line 554 of file vault_cave.c.

scVaultCaveFreezeInnerWestLowerPuddle

static void scVaultCaveFreezeInnerWestLowerPuddle(void)

In the room of six puddles, Isaac casts Frost on the puddle just east of the south-west one (metatile (24, 34)), and it freezes into a tall ice pillar whose top Isaac can leap across.

References fdActorGet(), fdMapGridCopyMetatileAttributes() and gmFlagSet().

Referenced by scInit() and VaultCaveVambraceCues.

Definition at line 572 of file vault_cave.c.

scVaultCaveFreezeEastUpperPuddle

static void scVaultCaveFreezeEastUpperPuddle(void)

In the room of six puddles, Isaac casts Frost on the north-east puddle (metatile (26, 32)), and it freezes into a tall ice pillar whose top Isaac can leap across.

References fdActorGet(), fdActorSetSpriteFlags(), fdMapGridCopyMetatileAttributes() and gmFlagSet().

Referenced by scInit() and VaultCaveVambraceCues.

Definition at line 590 of file vault_cave.c.

scVaultCaveFreezeEastLowerPuddle

static void scVaultCaveFreezeEastLowerPuddle(void)

In the room of six puddles, Isaac casts Frost on the south-east puddle (metatile (26, 34)), and it freezes into a tall ice pillar whose top Isaac can leap across.

References fdActorGet(), fdActorSetSpriteFlags(), fdMapGridCopyMetatileAttributes() and gmFlagSet().

Referenced by scInit() and VaultCaveVambraceCues.

Definition at line 610 of file vault_cave.c.

scVaultCaveFreezeFarEastPuddle

static void scVaultCaveFreezeFarEastPuddle(void)

In the room of six puddles, Isaac casts Frost on the far east puddle (metatile (28, 33)), and it freezes into a tall ice pillar whose top Isaac can leap across.

References fdActorGet(), fdActorSetSpriteFlags(), fdMapGridCopyMetatileAttributes() and gmFlagSet().

Referenced by scInit() and VaultCaveVambraceCues.

Definition at line 630 of file vault_cave.c.

scVaultCaveUpdatePuddlePriorities

static void scVaultCaveUpdatePuddlePriorities(void)

Keeps the ice pillars drawn under Isaac while he is up on top of one.

References fdActorGet(), scVaultCaveUseAutomaticFrostPriorities() and scVaultCaveUseUnderfootFrostPriorities().

Referenced by scInit().

Definition at line 648 of file vault_cave.c.

scVaultCaveRunRumble

static void scVaultCaveRunRumble(void)

The cave rumbles and shakes for eight seconds while the pool's water churns, then the water fades away and the drained pool is drawn.

References fdMapGridCenterOnFollowedPoint(), fdMapGridCopyMetatiles(), fdMapGridWaitForShakeToSettle(), fdScriptEnd(), fdScriptStart(), fdScriptWait(), Sint32, syIOWriteQueueStore16(), sySoundPlay() and TickCount.

Referenced by scVaultCaveFlipSwitch().

Definition at line 692 of file vault_cave.c.

scVaultCaveFlipSwitch

static void scVaultCaveFlipSwitch(void)

Isaac flips the switch on the ledge in the pool room (metatile (28, 29)). "Isaac flipped the switch." The cave rumbles and shakes, and the pool drains away, and its water runs down into the northern room of SceneIdVaultCaveVambrace below, whose floor scInit draws dry until then.

The switch can be flipped once each time the party comes down the ladder from Vault.

References fdMapGridCopyMetatiles(), fdScriptGetFlag(), fdScriptWait(), gmFlagSet(), mnFieldMessageShow(), scVaultCaveRunRumble(), Sint32 and sySoundPlay().

Referenced by VaultCavePassageCues.

Definition at line 759 of file vault_cave.c.

scVaultCaveCatchDropOnActor

static Sint32 scVaultCaveCatchDropOnActor(Sint32 subjectActorId)

Whether a drop of water about to land is over the given actor's metatile; if so, the drop is sent back up to fall again.

References fdActorGet() and Sint32.

Referenced by scVaultCaveUpdateTimedDrops().

Definition at line 785 of file vault_cave.c.

scVaultCaveUpdateTimedDrops

static void scVaultCaveUpdateTimedDrops(void)

In the room of three flame pillars, lets the four drops of water fall on their fixed beat, splashing where they land and putting out the lower pillar's flame if one lands on it.

References fdActorGet(), fdActorSetAnimation(), fdScriptGetFlag(), gmFlagSet(), scVaultCaveCatchDropOnActor(), scVaultCaveSpawnSplash(), Sint32, sySoundPlay(), VaultCaveScheduleIndex, VaultCaveScheduleTicks and VaultCaveScheduleTimer.

Referenced by scVaultCaveStartTimedDrops().

Definition at line 819 of file vault_cave.c.

scVaultCaveUpdateRandomDrops

static void scVaultCaveUpdateRandomDrops(void)

In the room of six puddles, lets a drop of water chosen at random fall every 64 ticks, onto its puddle or onto the top of its ice pillar.

References fdActorGet(), gmFlagGet(), Sint32, syMathRemainderUnsigned(), syRandomNext(), sySoundPlay(), VaultCaveDropTicks and VaultCaveSelectedDrop.

Referenced by scVaultCaveStartRandomDrops().

Definition at line 884 of file vault_cave.c.

scVaultCaveOffsetActorRadially

static void scVaultCaveOffsetActorRadially(ACTOR *actor, Sint32 radius, Sint32 angle)

Offsets an actor's current position by a polar displacement.

References scFieldActorSetMoveTargetFX(), Sint32 and syVectorAddPolarOffset().

Referenced by scVaultCaveSpawnSplash().

Definition at line 940 of file vault_cave.c.

scVaultCaveStartRandomDrops

static void scVaultCaveStartRandomDrops(void)

Readies the room of six puddles' drops of water and starts them falling.

References fdActorGet(), fdActorSetSpriteFlags(), scVaultCaveUpdateRandomDrops(), Sint32 and sySetTickEvent().

Referenced by scInit().

Definition at line 979 of file vault_cave.c.

scVaultCaveStartTimedDrops

static void scVaultCaveStartTimedDrops(void)

Readies the room of three flame pillars' drops of water and starts them falling.

References fdActorGet(), fdActorSetSpriteFlags(), fdActorSetSpritePriority(), scVaultCaveUpdateTimedDrops(), Sint32 and sySetTickEvent().

Referenced by scInit().

Definition at line 1001 of file vault_cave.c.

scInit

Sint32 scInit(void)

Arriving in any room of Vault Cave restores the room's puzzles and actors. It then sets the Retreat destination, the foot of the ladder from Vault.

References fdActorGet(), fdActorSetAnimation(), fdActorSetSpriteFlags(), fdMapGridCenterOnFollowedPoint(), fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatiles(), gmFlagClear(), gmFlagGet(), MainRoutineStateWork, scVaultCaveApplyNorthernSwitchMetatiles(), scVaultCaveApplySouthernSwitchMetatiles(), scVaultCaveFreezeEastLowerPuddle(), scVaultCaveFreezeEastUpperPuddle(), scVaultCaveFreezeFarEastPuddle(), scVaultCaveFreezeInnerWestLowerPuddle(), scVaultCaveFreezeWestLowerPuddle(), scVaultCaveFreezeWestUpperPuddle(), scVaultCaveStartRandomDrops(), scVaultCaveStartTimedDrops(), scVaultCaveUpdatePuddlePriorities(), Sint32, sySetTickEvent() and sySynch().

Definition at line 1025 of file vault_cave.c.

Variables in detail

VaultCaveSplashScript

extern const Sint32 VaultCaveSplashScript[]

const Sint32 VaultCaveSplashScript[]

References Sint32.

Referenced by scVaultCaveSpawnSplash().

Definition at lines 63 and 1201 of file vault_cave.c.

VaultCavePassageEntrances

extern SCENE_ENTRANCE VaultCavePassageEntrances[]

SCENE_ENTRANCE VaultCavePassageEntrances[]

Referenced by scGetEntrances().

Definition at lines 64 and 1207 of file vault_cave.c.

VaultCaveVambraceEntrances

extern SCENE_ENTRANCE VaultCaveVambraceEntrances[]

SCENE_ENTRANCE VaultCaveVambraceEntrances[]

Referenced by scGetEntrances().

Definition at lines 65 and 1238 of file vault_cave.c.

VaultCaveMouthEntrances

extern SCENE_ENTRANCE VaultCaveMouthEntrances[]

SCENE_ENTRANCE VaultCaveMouthEntrances[]

Referenced by scGetEntrances().

Definition at lines 66 and 1269 of file vault_cave.c.

VaultCaveRegions

extern SCENE_EXIT_REGION VaultCaveRegions[]

SCENE_EXIT_REGION VaultCaveRegions[]

Referenced by scGetExitRegions().

Definition at lines 67 and 1286 of file vault_cave.c.

VaultCaveFallbackExits

extern Uint32 VaultCaveFallbackExits[]

Uint32 VaultCaveFallbackExits[]

Referenced by scGetExits().

Definition at lines 68 and 1291 of file vault_cave.c.

VaultCavePassageExits

extern Uint32 VaultCavePassageExits[]

Uint32 VaultCavePassageExits[]

Referenced by scGetExits().

Definition at lines 69 and 1295 of file vault_cave.c.

VaultCaveVambraceExits

extern Uint32 VaultCaveVambraceExits[]

Uint32 VaultCaveVambraceExits[]

Referenced by scGetExits().

Definition at lines 70 and 1343 of file vault_cave.c.

VaultCaveMouthExits

extern Uint32 VaultCaveMouthExits[]

Uint32 VaultCaveMouthExits[]

Referenced by scGetExits().

Definition at lines 71 and 1387 of file vault_cave.c.

VaultCaveFallbackActorPlacements

extern ACTOR_PLACE VaultCaveFallbackActorPlacements[]

ACTOR_PLACE VaultCaveFallbackActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 72 and 1406 of file vault_cave.c.

VaultCavePassageActorPlacements

extern ACTOR_PLACE VaultCavePassageActorPlacements[]

ACTOR_PLACE VaultCavePassageActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 73 and 1410 of file vault_cave.c.

VaultCaveVambraceActorPlacements

extern ACTOR_PLACE VaultCaveVambraceActorPlacements[]

ACTOR_PLACE VaultCaveVambraceActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 74 and 1414 of file vault_cave.c.

VaultCaveMouthActorPlacements

extern ACTOR_PLACE VaultCaveMouthActorPlacements[]

ACTOR_PLACE VaultCaveMouthActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 75 and 1448 of file vault_cave.c.

VaultCaveFallbackCues

extern CUE VaultCaveFallbackCues[]

CUE VaultCaveFallbackCues[]

Referenced by scGetCues().

Definition at lines 76 and 1466 of file vault_cave.c.

VaultCavePassageCues

extern CUE VaultCavePassageCues[]

CUE VaultCavePassageCues[]

References scVaultCaveFlipSwitch() and scVaultCaveShowLockedDoor().

Referenced by scGetCues().

Definition at lines 77 and 1470 of file vault_cave.c.

VaultCaveVambraceCues

extern CUE VaultCaveVambraceCues[]

CUE VaultCaveVambraceCues[]

References scVaultCaveFreezeEastLowerPuddle(), scVaultCaveFreezeEastUpperPuddle(), scVaultCaveFreezeFarEastPuddle(), scVaultCaveFreezeInnerWestLowerPuddle(), scVaultCaveFreezeWestLowerPuddle(), scVaultCaveFreezeWestUpperPuddle(), scVaultCaveMoveSouthernPillar(), scVaultCavePushSouthernPillar(), scVaultCaveShowLockedDoor() and scVaultCaveUseWhirlwind().

Referenced by scGetCues().

Definition at lines 78 and 1497 of file vault_cave.c.

VaultCaveMouthCues

extern CUE VaultCaveMouthCues[]

CUE VaultCaveMouthCues[]

References scVaultCaveMoveNorthernPillar(), scVaultCaveMoveUnlitPillar(), scVaultCavePushNorthernPillar() and scVaultCaveShowLockedDoor().

Referenced by scGetCues().

Definition at lines 79 and 1542 of file vault_cave.c.

VaultCaveScheduleTicks

extern Uint32 VaultCaveScheduleTicks[]

Uint32 VaultCaveScheduleTicks[]

The tick of the 191-tick beat at which each timed drop falls.

Referenced by scVaultCaveUpdateTimedDrops().

Definition at lines 80 and 1564 of file vault_cave.c.

VaultCaveScheduleTimer

extern Sint32 VaultCaveScheduleTimer

Sint32 VaultCaveScheduleTimer

The tick of the drops' 191-tick beat, and the timed drop that falls next when it reaches that drop's tick in VaultCaveScheduleTicks.

References Sint32.

Referenced by scVaultCaveUpdateTimedDrops().

Definition at lines 81 and 1571 of file vault_cave.c.

VaultCaveScheduleIndex

extern Sint32 VaultCaveScheduleIndex

Sint32 VaultCaveScheduleIndex

References Sint32.

Referenced by scVaultCaveUpdateTimedDrops().

Definition at lines 82 and 1572 of file vault_cave.c.

VaultCaveDropTicks

extern Sint32 VaultCaveDropTicks

Sint32 VaultCaveDropTicks

The ticks counted for the random drops, one picked every 64 ticks, and the one picked, from the first of the six.

References Sint32.

Referenced by scVaultCaveUpdateRandomDrops().

Definition at lines 83 and 1576 of file vault_cave.c.

VaultCaveSelectedDrop

extern Sint32 VaultCaveSelectedDrop

Sint32 VaultCaveSelectedDrop

References Sint32.

Referenced by scVaultCaveUpdateRandomDrops().

Definition at lines 84 and 1577 of file vault_cave.c.

On this page

MacrosEnumerationsFunctionsVariablesDescriptionMacros in detailMETATILE_OFPUSHED_ACTOR_TABLES_READ_ONLYEnumerations in detailVAULT_CAVE_METATILE_BEHAVIORanonymous enumFLAME_PILLAR_ANIMATIONVAULT_CAVE_VAMBRACE_ACTOR_IDVAULT_CAVE_MOUTH_ACTOR_IDFunctions in detailscVaultCaveApplySouthernSwitchMetatilesscVaultCaveUseUnderfootFrostPrioritiesscVaultCaveUseAutomaticFrostPrioritiesscVaultCaveSpawnSplashscGetEntrancesscGetExitRegionsscGetExitsscGetActorPlacementsscVaultCaveFindCollidableActorAtMetatilescVaultCavePushPillarAheadscVaultCaveUseWhirlwindscVaultCaveShowLockedDoorscGetCuesscVaultCaveIsSouthernPillarOnSwitchscVaultCaveCompleteSouthernSwitchscVaultCavePushSouthernPillarscVaultCaveMoveSouthernPillarscVaultCaveUnusedNoOperationscVaultCaveApplyNorthernSwitchMetatilesscVaultCaveIsNorthernPillarOnSwitchscVaultCaveCompleteNorthernSwitchscVaultCavePushNorthernPillarscVaultCaveMoveUnlitPillarscVaultCaveMoveNorthernPillarscVaultCaveFreezeWestUpperPuddlescVaultCaveFreezeWestLowerPuddlescVaultCaveFreezeInnerWestLowerPuddlescVaultCaveFreezeEastUpperPuddlescVaultCaveFreezeEastLowerPuddlescVaultCaveFreezeFarEastPuddlescVaultCaveUpdatePuddlePrioritiesscVaultCaveRunRumblescVaultCaveFlipSwitchscVaultCaveCatchDropOnActorscVaultCaveUpdateTimedDropsscVaultCaveUpdateRandomDropsscVaultCaveOffsetActorRadiallyscVaultCaveStartRandomDropsscVaultCaveStartTimedDropsscInitVariables in detailVaultCaveSplashScriptVaultCavePassageEntrancesVaultCaveVambraceEntrancesVaultCaveMouthEntrancesVaultCaveRegionsVaultCaveFallbackExitsVaultCavePassageExitsVaultCaveVambraceExitsVaultCaveMouthExitsVaultCaveFallbackActorPlacementsVaultCavePassageActorPlacementsVaultCaveVambraceActorPlacementsVaultCaveMouthActorPlacementsVaultCaveFallbackCuesVaultCavePassageCuesVaultCaveVambraceCuesVaultCaveMouthCuesVaultCaveScheduleTicksVaultCaveScheduleTimerVaultCaveScheduleIndexVaultCaveDropTicksVaultCaveSelectedDrop