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…
#include "ability_ids.h"#include "flags.h"#include "item_ids.h"#include "battle/battle.h"#include "debug/debug.h"#include "field/actor_script.h"#include "field/script.h"#include "field/map_grid.h"#include "graphics/graphics.h"#include "scene/actor_step.h"#include "game/system_call.h"#include "text/msg_ids.h"#include "shared/pushed_actor_direction_steps.c"#include "shared/scene_entrances_default.c"
Macros
| Name | Description | |
|---|---|---|
#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. |
#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. |
Enumerations
| Name | Description | |
|---|---|---|
enum | VAULT_CAVE_METATILE_BEHAVIOR { METATILE_BEHAVIOR_VAULT_CAVE_SWITCH, METATILE_BEHAVIOR_VAULT … } | The metatile behaviors of the metatiles the scripts answer. |
enum | anonymous enum { FLAG_VAULT_CAVE_WEST_UPPER_PUDDLE_FROZEN, FLAG_VAULT_CAVE_WE … } | Scene flags, and one area flag. |
enum | FLAME_PILLAR_ANIMATION { FLAME_PILLAR_ANIMATION_UNLIT, FLAME_PILLAR_ANIMATION_BURNING } | SPRITE_FLAME_PILLAR's animations (flame_pillar.tsv). |
enum | VAULT_CAVE_VAMBRACE_ACTOR_ID { ACTOR_PILLAR_EAST_OF_SOUTHERN_SWITCH, ACTOR_SOUTHERN_PILLAR, … } | The actors of SceneIdVaultCaveVambrace, numbering the rows of VaultCaveVambraceActorPlacements. |
enum | VAULT_CAVE_MOUTH_ACTOR_ID { ACTOR_PILLAR_EAST_OF_NORTHERN_SWITCH, ACTOR_PILLAR_SOUTH_OF_ … } | The actors of SceneIdVaultCaveMouth, numbering the rows of VaultCaveMouthActorPlacements. |
Functions
| Name | Description | |
|---|---|---|
static void | scVaultCaveApplySouthernSwitchMetatiles (void) | Draws the room of two flame pillars' wooden gate open and lets the party through it. |
static void | scVaultCaveUseUnderfootFrostPriorities (void) | Keeps all six puddles beneath the leader's feet. |
static void | scVaultCaveUseAutomaticFrostPriorities (void) | Restores automatic draw priority for the same six puddles. |
static void | scVaultCaveSpawnSplash (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 void | scVaultCavePushPillarAhead (void) | Pushes the pillar Isaac faces one metatile, unless another pillar or the rock is in the way. |
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. |
static void | scVaultCaveShowLockedDoor (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 Bool | scVaultCaveIsSouthernPillarOnSwitch (void) | Whether the west pillar of the room of two flame pillars stands on the floor switch. |
static inline void | scVaultCaveCompleteSouthernSwitch (void) | Once the pillar is on the floor switch, plays the puzzle chime and opens the wooden gate. |
static void | scVaultCavePushSouthernPillar (void) | In the room of two flame pillars, up the left-hand branch, Isaac pushes a pillar a metatile. |
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. |
static void UNUSED | scVaultCaveUnusedNoOperation (void) | |
static void | scVaultCaveApplyNorthernSwitchMetatiles (void) | Draws the room of three flame pillars' wooden gate open and lets the party through it. |
static Bool | scVaultCaveIsNorthernPillarOnSwitch (void) | Whether the lower pillar of the room of three flame pillars stands on the floor switch. |
static inline void | scVaultCaveCompleteNorthernSwitch (void) | Opens the gate only for a pillar on the floor switch whose flame no drop has put out. |
static void | scVaultCavePushNorthernPillar (void) | In the room of three flame pillars, on the way to the cave mouth, Isaac pushes a pillar a metatile. |
static void | scVaultCaveMoveUnlitPillar (void) | In the room of three flame pillars, Isaac uses Move on the unlit pillar just south of the floor switch. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
static void | scVaultCaveUpdatePuddlePriorities (void) | Keeps the ice pillars drawn under Isaac while he is up on top of one. |
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. |
static void | scVaultCaveFlipSwitch (void) | Isaac flips the switch on the ledge in the pool room (metatile (28, 29)). |
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. |
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. |
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. |
static void | scVaultCaveOffsetActorRadially (ACTOR *actor, Sint32 radius, Sint32 angle) | Offsets an actor's current position by a polar displacement. |
static void | scVaultCaveStartRandomDrops (void) | Readies the room of six puddles' drops of water and starts them falling. |
static void | scVaultCaveStartTimedDrops (void) | Readies the room of three flame pillars' drops of water and starts them falling. |
Sint32 | scInit (void) | Arriving in any room of Vault Cave restores the room's puzzles and actors. |
Variables
| Name | Description | |
|---|---|---|
extern const Sint32 | VaultCaveSplashScript [] | |
extern SCENE_ENTRANCE | VaultCavePassageEntrances [] | |
extern SCENE_ENTRANCE | VaultCaveVambraceEntrances [] | |
extern SCENE_ENTRANCE | VaultCaveMouthEntrances [] | |
extern SCENE_EXIT_REGION | VaultCaveRegions [] | |
extern Uint32 | VaultCaveFallbackExits [] | |
extern Uint32 | VaultCavePassageExits [] | |
extern Uint32 | VaultCaveVambraceExits [] | |
extern Uint32 | VaultCaveMouthExits [] | |
extern ACTOR_PLACE | VaultCaveFallbackActorPlacements [] | |
extern ACTOR_PLACE | VaultCavePassageActorPlacements [] | |
extern ACTOR_PLACE | VaultCaveVambraceActorPlacements [] | |
extern ACTOR_PLACE | VaultCaveMouthActorPlacements [] | |
extern CUE | VaultCaveFallbackCues [] | |
extern CUE | VaultCavePassageCues [] | |
extern CUE | VaultCaveVambraceCues [] | |
extern CUE | VaultCaveMouthCues [] | |
extern Uint32 | VaultCaveScheduleTicks [] | The tick of the 191-tick beat at which each timed drop falls. |
extern 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. |
extern Sint32 | VaultCaveScheduleIndex | |
extern Sint32 | VaultCaveDropTicks | The ticks counted for the random drops, one picked every 64 ticks, and the one picked, from the first of the six. |
extern Sint32 | VaultCaveSelectedDrop |
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."
SceneIdVaultCavePassageholds the foot of the ladder from Vault (VAULT_CAVE_PASSAGE_VAULT_REVISIT; Retreat leads there too). Its right-hand branch ends at a chest that is a Mimic (FIND_MIMIC). Its pool room has a switch on a ledge: flipping it shakes the cave and drains the pool (scVaultCaveFlipSwitch,FLAG_VAULT_CAVE_SWITCH_FLIPPED), and the water runs down into the floor of the northern room ofSceneIdVaultCaveVambrace, whichscInitdraws dry until then. Coming down the ladder from Vault again resets the switch.SceneIdVaultCaveVambraceis up the left-hand branch. In the room of two flame pillars, stone pillars with a flame burning on top, Isaac pushes or Moves the west pillar east onto the floor switch marked with a flame (scVaultCavePushSouthernPillar,scVaultCaveMoveSouthernPillar): the puzzle chime plays and the wooden gate beyond opens (FLAG_VAULT_CAVE_SOUTH_PILLAR_ON_SWITCH). North of it is the room of six puddles, where drops of water fall from the ceiling one at a time. Frost freezes a puddle into a tall ice pillar whose top Isaac can leap across, and frozen pillars make a way over the room; a drop landing on one stops on its top. Up on the room's ledge, Whirlwind blows away the ivy over the way to the Vambrace's chest (FLAG_VAULT_CAVE_IVY_BLOWN_AWAY, kept while the party stays in the cave).SceneIdVaultCaveMouthleads out to the cave mouth (VAULT_CAVE_MOUTH_VAULT_REVISIT). In its room of three flame pillars, Isaac must get the lower burning pillar north onto the floor switch below the wooden gate, past the unlit pillar in the way, while drops of water fall on a fixed beat (VaultCaveScheduleTicks). A drop that lands on the burning pillar puts its flame out (FLAG_VAULT_CAVE_NORTH_PILLAR_STRUCK), and an unlit pillar opens nothing until the room is entered again and the flame comes back.
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.
| Enumerator | Value | Description |
|---|---|---|
METATILE_BEHAVIOR_VAULT_CAVE_SWITCH | 20 | The switch on the ledge in the pool room: metatile (28, 29). |
METATILE_BEHAVIOR_VAULT_CAVE_NORTHERN_PILLAR | 50 | The 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_PILLAR | 60 | The 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_DOOR | 99 | |
METATILE_BEHAVIOR_VAULT_CAVE_CHEST | 100 |
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.
| Enumerator | Value | Description |
|---|---|---|
FLAG_VAULT_CAVE_WEST_UPPER_PUDDLE_FROZEN | FLAG_SCENE_TEMP(0x00) | The upper western puddle, the first of the six. |
FLAG_VAULT_CAVE_WEST_LOWER_PUDDLE_FROZEN | FLAG_SCENE_TEMP(0x01) | |
FLAG_VAULT_CAVE_INNER_WEST_LOWER_PUDDLE_FROZEN | FLAG_SCENE_TEMP(0x02) | |
FLAG_VAULT_CAVE_EAST_UPPER_PUDDLE_FROZEN | FLAG_SCENE_TEMP(0x03) | |
FLAG_VAULT_CAVE_EAST_LOWER_PUDDLE_FROZEN | FLAG_SCENE_TEMP(0x04) | |
FLAG_VAULT_CAVE_FAR_EAST_PUDDLE_FROZEN | FLAG_SCENE_TEMP(0x05) | |
FLAG_VAULT_CAVE_NORTH_PILLAR_STRUCK | FLAG_SCENE_TEMP(0x07) | A drop of water has put out the flame of the |
FLAG_VAULT_CAVE_IVY_BLOWN_AWAY | FLAG_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).
| Enumerator | Value | Description |
|---|---|---|
FLAME_PILLAR_ANIMATION_UNLIT | 1 | the pillar, no flame on top |
FLAME_PILLAR_ANIMATION_BURNING | 2 | a 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.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_PILLAR_EAST_OF_SOUTHERN_SWITCH | ACTOR_FIRST_PLACED | The 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_PILLAR | The west pillar, which goes onto the floor switch at metatile (15, 54). | |
ACTOR_FIRST_WATER_DROP | The 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_PUDDLE | ACTOR_FIRST_WATER_DROP + 6 | The 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_IVY | The 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).
| Enumerator | Value | Description |
|---|---|---|
ACTOR_PILLAR_EAST_OF_NORTHERN_SWITCH | ACTOR_FIRST_PLACED | The burning pillar beside the wooden gate, two metatiles east of the floor switch. |
ACTOR_PILLAR_SOUTH_OF_NORTHERN_SWITCH | The unlit pillar two metatiles south of the floor switch, in the way. | |
ACTOR_NORTHERN_PILLAR | The lower burning pillar, which goes onto the floor switch. | |
ACTOR_FIRST_TIMED_WATER_DROP | The 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.
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().