Vault's cave puzzles: movable switches, Frost targets, falling objects and the rumbling mechanism restored when the party returns. More...
Go to the source code of this file.
Data Structures | |
| 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. More... | |
Macros | |
| #define | TILE(position) |
| #define | DIRECTION_STEP(heading) |
Enumerations | |
| enum | { FLAG_WEST_UPPER_FROZEN = FLAG_SCENE_TEMP_00 , FLAG_WEST_LOWER_FROZEN = FLAG_SCENE_TEMP_01 , FLAG_INNER_WEST_LOWER_FROZEN = FLAG_SCENE_TEMP_02 , FLAG_EAST_UPPER_FROZEN = FLAG_SCENE_TEMP_03 , FLAG_EAST_LOWER_FROZEN = FLAG_SCENE_TEMP_04 , FLAG_FAR_EAST_FROZEN = FLAG_SCENE_TEMP_05 , FLAG_NORTH_BLOCK_STRUCK = FLAG_SCENE_TEMP_07 , FLAG_WHIRLWIND_USED = FLAG_SCENE_TEMP_00 + 0x100 } |
| Scene flags. More... | |
Functions | |
| static void | VaultCave_ApplySouthernSwitchCells (void) |
| Restores the map cells and attributes of the completed southern switch. | |
| static void | VaultCave_UseUnderfootFrostPriorities (void) |
| Keeps all six Frost targets beneath the leader's feet. | |
| static void | VaultCave_UseAutomaticFrostPriorities (void) |
| Restores automatic draw priority for the same six targets. | |
| static void | VaultCave_SpawnPuffs (struct FieldActor *source) |
| Spawns up to four short-lived puffs around a landing object. | |
| const struct SceneEntrance * | Scene_GetEntrances (void) |
| const struct SceneRegion * | Scene_GetRegions (void) |
| Returns the region boxes used by the cave exits. | |
| const u32 * | Scene_GetExits (void) |
| Both scenes share one exit table. | |
| const struct ScenePlacement * | Scene_GetPlacements (void) |
| Selects the movable blocks, falling objects and Frost targets. | |
| static struct FieldActor * | VaultCave_FindCollidableActorAtCell (s32 column, s32 row) |
| Finds a placed actor with collision enabled at the requested map cell. | |
| static void | VaultCave_PushBlockAhead (void) |
| Pushes the faced block one cell unless another actor or terrain blocks it. | |
| static void | Event_UseWhirlwind (void) |
| Whirlwind on the target in the second map blows it away for good. | |
| static void | Event_ShowLockedDoor (void) |
| Searching the locked door. "The door is tightly locked.". | |
| const struct SceneEvent * | Scene_GetEvents (void) |
| Selects the cave map's searches, movement checks and Psynergy callbacks. | |
| static s32 | VaultCave_IsSouthernBlockOnSwitch (void) |
| Tests the southern block's cell, rounding fixed coordinates toward zero. | |
| static void | VaultCave_CompleteSouthernSwitch (void) |
| Finishes the southern switch only after the block reaches its target cell. | |
| static void | Event_PushSouthernBlock (void) |
| Pushing the southern block; once it rests on its switch, the puzzle chime plays and the switch opens the way. | |
| static void | Event_MoveSouthernBlock (void) |
| Move on the southern block, with the same switch check. | |
| static void UNUSED | VaultCave_UnusedNoOp (void) |
| static void | VaultCave_ApplyNorthernSwitchCells (void) |
| Restores the map cells and attributes of the completed northern switch. | |
| static s32 | VaultCave_IsNorthernBlockOnSwitch (void) |
| Tests the northern block's cell with the same signed-coordinate rounding. | |
| static void | VaultCave_CompleteNorthernSwitch (void) |
| The northern switch also waits until the falling-object guard is clear. | |
| static void | Event_PushNorthernBlock (void) |
| Pushing the northern block; it opens its switch only if no falling object has struck it. | |
| static void | Event_IgnoreMove (void) |
| Move on the southern block in the third map does nothing. | |
| static void | Event_MoveNorthernBlock (void) |
| Move on the northern block, with the same switch check. | |
| static void | Event_FreezeWestUpperTarget (void) |
| Frost on the upper western target freezes it and changes its map cell; arriving again re-freezes every target whose flag is set. | |
| static void | Event_FreezeWestLowerTarget (void) |
| static void | Event_FreezeInnerWestLowerTarget (void) |
| static void | Event_FreezeEastUpperTarget (void) |
| static void | Event_FreezeEastLowerTarget (void) |
| static void | Event_FreezeFarEastTarget (void) |
| static void | VaultCave_UpdateFrostTargetPriorities (void) |
| Changes the Frost targets' draw priorities when the leader is above them. | |
| static void | VaultCave_RunRumble (void) |
| Moves the third map layer through its phases, then fades the mechanism's final map state. | |
| static void | Event_FlipSwitch (void) |
| Flips the switch. | |
| static s32 | VaultCave_ResetFallingObjectAtActorCell (s32 subjectActorId) |
| Resets a low falling object sharing the subject's cell and reports a hit. | |
| static void | VaultCave_UpdateTimedFallingObjects (void) |
| Drops four objects on a repeating schedule and handles their landings. | |
| static void | VaultCave_UpdateFrostControlledFallingObjects (void) |
| Drops a random object every 64 frames, with reset height set by its Frost target. | |
| static void | VaultCave_OffsetActorRadially (struct FieldActor *actor, s32 radius, s32 angle) |
| Offsets an actor's current position by a polar displacement. | |
| static void | VaultCave_StartFrostControlledFalls (void) |
| Initializes six falling objects and starts their Frost-controlled updater. | |
| static void | VaultCave_StartTimedFalls (void) |
| Initializes four falling objects and starts their timed updater. | |
| s32 | Scene_Initialize (void) |
| Restores each room's puzzles and actors, then sets the Retreat destination. | |
Variables | |
| const s16 | gVaultCave_DirectionSteps [] |
| const s32 | gVaultCave_PuffScript [] |
| struct SceneEntrance | gVaultCaveEntrancesOther [] |
| struct SceneEntrance | gVaultCaveEntrances1 [] |
| struct SceneEntrance | gVaultCaveEntrances2 [] |
| struct SceneEntrance | gVaultCaveEntrances3 [] |
| struct SceneRegion | gVaultCaveRegions [] |
| u32 | gVaultCaveExitsOther [] |
| u32 | gVaultCaveExits1 [] |
| u32 | gVaultCaveExits2 [] |
| u32 | gVaultCaveExits3 [] |
| struct ScenePlacement | gVaultCavePlacementsOther [] |
| struct ScenePlacement | gVaultCavePlacements1 [] |
| struct ScenePlacement | gVaultCavePlacements2 [] |
| struct ScenePlacement | gVaultCavePlacements3 [] |
| struct SceneEvent | gVaultCaveEventsOther [] |
| struct SceneEvent | gVaultCaveEvents1 [] |
| struct SceneEvent | gVaultCaveEvents2 [] |
| struct SceneEvent | gVaultCaveEvents3 [] |
| u32 | gVaultCave_ScheduleFrames [] |
| s32 | gVaultCave_ScheduleTimer = 0 |
| s32 | gVaultCave_ScheduleIndex = 0 |
| s32 | gVaultCave_TickCounter = 0 |
| s32 | gVaultCave_TickValue = 0 |
Vault's cave puzzles: movable switches, Frost targets, falling objects and the rumbling mechanism restored when the party returns.
Definition in file vault_cave.c.
| #define TILE | ( | position | ) |
Definition at line 48 of file vault_cave.c.
Referenced by VaultCave_ResetFallingObjectAtActorCell().
| #define DIRECTION_STEP | ( | heading | ) |
Definition at line 159 of file vault_cave.c.
| anonymous enum |
Scene flags.
The six Frost targets of the second map keep their frozen state in six flags in a row, read by index as well.
Definition at line 52 of file vault_cave.c.
|
static |
Restores the map cells and attributes of the completed southern switch.
Definition at line 297 of file vault_cave.c.
Referenced by Scene_Initialize(), VaultCave_ApplySouthernSwitchCells(), and VaultCave_CompleteSouthernSwitch().
|
static |
Keeps all six Frost targets beneath the leader's feet.
Definition at line 473 of file vault_cave.c.
Referenced by VaultCave_UpdateFrostTargetPriorities(), and VaultCave_UseUnderfootFrostPriorities().
|
static |
Restores automatic draw priority for the same six targets.
Definition at line 485 of file vault_cave.c.
Referenced by VaultCave_UpdateFrostTargetPriorities(), and VaultCave_UseAutomaticFrostPriorities().
|
static |
Spawns up to four short-lived puffs around a landing object.
Definition at line 723 of file vault_cave.c.
Referenced by VaultCave_SpawnPuffs(), and VaultCave_UpdateTimedFallingObjects().
| const struct SceneEntrance * Scene_GetEntrances | ( | void | ) |
Definition at line 64 of file vault_cave.c.
| const struct SceneRegion * Scene_GetRegions | ( | void | ) |
Returns the region boxes used by the cave exits.
Definition at line 80 of file vault_cave.c.
| const u32 * Scene_GetExits | ( | void | ) |
Both scenes share one exit table.
Definition at line 82 of file vault_cave.c.
| const struct ScenePlacement * Scene_GetPlacements | ( | void | ) |
Selects the movable blocks, falling objects and Frost targets.
Definition at line 98 of file vault_cave.c.
|
static |
Finds a placed actor with collision enabled at the requested map cell.
Definition at line 114 of file vault_cave.c.
Referenced by VaultCave_FindCollidableActorAtCell(), and VaultCave_PushBlockAhead().
|
static |
Pushes the faced block one cell unless another actor or terrain blocks it.
Definition at line 164 of file vault_cave.c.
Referenced by Event_PushNorthernBlock(), Event_PushSouthernBlock(), and VaultCave_PushBlockAhead().
|
static |
Whirlwind on the target in the second map blows it away for good.
Definition at line 230 of file vault_cave.c.
Referenced by Event_UseWhirlwind().
|
static |
Searching the locked door. "The door is tightly locked.".
Definition at line 235 of file vault_cave.c.
Referenced by Event_ShowLockedDoor().
| const struct SceneEvent * Scene_GetEvents | ( | void | ) |
Selects the cave map's searches, movement checks and Psynergy callbacks.
Definition at line 240 of file vault_cave.c.
|
static |
Tests the southern block's cell, rounding fixed coordinates toward zero.
Definition at line 256 of file vault_cave.c.
Referenced by VaultCave_CompleteSouthernSwitch(), and VaultCave_IsSouthernBlockOnSwitch().
|
inlinestatic |
Finishes the southern switch only after the block reaches its target cell.
Definition at line 279 of file vault_cave.c.
Referenced by Event_MoveSouthernBlock(), Event_PushSouthernBlock(), and VaultCave_CompleteSouthernSwitch().
|
static |
Pushing the southern block; once it rests on its switch, the puzzle chime plays and the switch opens the way.
Definition at line 289 of file vault_cave.c.
Referenced by Event_PushSouthernBlock().
|
static |
Move on the southern block, with the same switch check.
Definition at line 304 of file vault_cave.c.
Referenced by Event_MoveSouthernBlock().
|
static |
Definition at line 310 of file vault_cave.c.
Referenced by VaultCave_UnusedNoOp().
|
static |
Restores the map cells and attributes of the completed northern switch.
Definition at line 313 of file vault_cave.c.
Referenced by Scene_Initialize(), VaultCave_ApplyNorthernSwitchCells(), and VaultCave_CompleteNorthernSwitch().
|
static |
Tests the northern block's cell with the same signed-coordinate rounding.
Definition at line 320 of file vault_cave.c.
Referenced by VaultCave_CompleteNorthernSwitch(), and VaultCave_IsNorthernBlockOnSwitch().
|
inlinestatic |
The northern switch also waits until the falling-object guard is clear.
Definition at line 343 of file vault_cave.c.
Referenced by Event_MoveNorthernBlock(), Event_PushNorthernBlock(), and VaultCave_CompleteNorthernSwitch().
|
static |
Pushing the northern block; it opens its switch only if no falling object has struck it.
Definition at line 357 of file vault_cave.c.
Referenced by Event_PushNorthernBlock().
|
static |
Move on the southern block in the third map does nothing.
Definition at line 363 of file vault_cave.c.
|
static |
Move on the northern block, with the same switch check.
Definition at line 366 of file vault_cave.c.
Referenced by Event_MoveNorthernBlock().
|
static |
Frost on the upper western target freezes it and changes its map cell; arriving again re-freezes every target whose flag is set.
Definition at line 372 of file vault_cave.c.
Referenced by Event_FreezeWestUpperTarget(), and Scene_Initialize().
|
static |
Definition at line 388 of file vault_cave.c.
Referenced by Event_FreezeWestLowerTarget(), and Scene_Initialize().
|
static |
Definition at line 402 of file vault_cave.c.
Referenced by Event_FreezeInnerWestLowerTarget(), and Scene_Initialize().
|
static |
Definition at line 416 of file vault_cave.c.
Referenced by Event_FreezeEastUpperTarget(), and Scene_Initialize().
|
static |
Definition at line 431 of file vault_cave.c.
Referenced by Event_FreezeEastLowerTarget(), and Scene_Initialize().
|
static |
Definition at line 446 of file vault_cave.c.
Referenced by Event_FreezeFarEastTarget(), and Scene_Initialize().
|
static |
Changes the Frost targets' draw priorities when the leader is above them.
Definition at line 462 of file vault_cave.c.
Referenced by Scene_Initialize(), and VaultCave_UpdateFrostTargetPriorities().
|
static |
Moves the third map layer through its phases, then fades the mechanism's final map state.
Definition at line 501 of file vault_cave.c.
Referenced by Event_FlipSwitch(), and VaultCave_RunRumble().
|
static |
Flips the switch.
"Isaac flipped the switch." The first time, the switch turns, the cave rumbles and shakes for eight seconds and the map changes as it fades.
Definition at line 553 of file vault_cave.c.
Referenced by Event_FlipSwitch().
Resets a low falling object sharing the subject's cell and reports a hit.
Definition at line 579 of file vault_cave.c.
Referenced by VaultCave_ResetFallingObjectAtActorCell(), and VaultCave_UpdateTimedFallingObjects().
|
static |
Drops four objects on a repeating schedule and handles their landings.
Definition at line 609 of file vault_cave.c.
Referenced by VaultCave_StartTimedFalls(), and VaultCave_UpdateTimedFallingObjects().
|
static |
Drops a random object every 64 frames, with reset height set by its Frost target.
Definition at line 660 of file vault_cave.c.
Referenced by VaultCave_StartFrostControlledFalls(), and VaultCave_UpdateFrostControlledFallingObjects().
|
static |
Offsets an actor's current position by a polar displacement.
Definition at line 709 of file vault_cave.c.
Referenced by VaultCave_OffsetActorRadially(), and VaultCave_SpawnPuffs().
|
static |
Initializes six falling objects and starts their Frost-controlled updater.
Definition at line 750 of file vault_cave.c.
Referenced by Scene_Initialize(), and VaultCave_StartFrostControlledFalls().
|
static |
Initializes four falling objects and starts their timed updater.
Definition at line 771 of file vault_cave.c.
Referenced by Scene_Initialize(), and VaultCave_StartTimedFalls().
| s32 Scene_Initialize | ( | void | ) |
Restores each room's puzzles and actors, then sets the Retreat destination.
Sets up whichever scene is being entered and runs its arrival events.
Definition at line 793 of file vault_cave.c.
| const s16 gVaultCave_DirectionSteps[] |
Definition at line 917 of file vault_cave.c.
| const s32 gVaultCave_PuffScript[] |
Definition at line 936 of file vault_cave.c.
Referenced by VaultCave_SpawnPuffs().
| struct SceneEntrance gVaultCaveEntrancesOther[] |
Definition at line 940 of file vault_cave.c.
Referenced by Scene_GetEntrances().
| struct SceneEntrance gVaultCaveEntrances1[] |
Definition at line 945 of file vault_cave.c.
Referenced by Scene_GetEntrances().
| struct SceneEntrance gVaultCaveEntrances2[] |
Definition at line 963 of file vault_cave.c.
Referenced by Scene_GetEntrances().
| struct SceneEntrance gVaultCaveEntrances3[] |
Definition at line 981 of file vault_cave.c.
Referenced by Scene_GetEntrances().
| struct SceneRegion gVaultCaveRegions[] |
Definition at line 992 of file vault_cave.c.
Referenced by Scene_GetRegions().
| u32 gVaultCaveExitsOther[] |
Definition at line 997 of file vault_cave.c.
Referenced by Scene_GetExits().
| u32 gVaultCaveExits1[] |
Definition at line 1001 of file vault_cave.c.
Referenced by Scene_GetExits().
| u32 gVaultCaveExits2[] |
Definition at line 1020 of file vault_cave.c.
Referenced by Scene_GetExits().
| u32 gVaultCaveExits3[] |
Definition at line 1038 of file vault_cave.c.
Referenced by Scene_GetExits().
| struct ScenePlacement gVaultCavePlacementsOther[] |
Definition at line 1049 of file vault_cave.c.
Referenced by Scene_GetPlacements().
| struct ScenePlacement gVaultCavePlacements1[] |
Definition at line 1053 of file vault_cave.c.
Referenced by Scene_GetPlacements().
| struct ScenePlacement gVaultCavePlacements2[] |
Definition at line 1057 of file vault_cave.c.
Referenced by Scene_GetPlacements().
| struct ScenePlacement gVaultCavePlacements3[] |
Definition at line 1091 of file vault_cave.c.
Referenced by Scene_GetPlacements().
| struct SceneEvent gVaultCaveEventsOther[] |
Definition at line 1109 of file vault_cave.c.
Referenced by Scene_GetEvents().
| struct SceneEvent gVaultCaveEvents1[] |
Definition at line 1113 of file vault_cave.c.
Referenced by Scene_GetEvents().
| struct SceneEvent gVaultCaveEvents2[] |
Definition at line 1133 of file vault_cave.c.
Referenced by Scene_GetEvents().
| struct SceneEvent gVaultCaveEvents3[] |
Definition at line 1161 of file vault_cave.c.
Referenced by Scene_GetEvents().
| u32 gVaultCave_ScheduleFrames[] |
Definition at line 1175 of file vault_cave.c.
Referenced by VaultCave_UpdateTimedFallingObjects().
| s32 gVaultCave_ScheduleTimer = 0 |
Definition at line 1180 of file vault_cave.c.
Referenced by VaultCave_UpdateTimedFallingObjects().
| s32 gVaultCave_ScheduleIndex = 0 |
Definition at line 1182 of file vault_cave.c.
Referenced by VaultCave_UpdateTimedFallingObjects().
| s32 gVaultCave_TickCounter = 0 |
Definition at line 1184 of file vault_cave.c.
Referenced by VaultCave_UpdateFrostControlledFallingObjects().
| s32 gVaultCave_TickValue = 0 |
Definition at line 1186 of file vault_cave.c.
Referenced by VaultCave_UpdateFrostControlledFallingObjects().