Alchemy
Loading...
Searching...
No Matches

altmiller_cave.c File Reference

Altmiller Cave, six dark rooms where the party finds Babi, the ruler of Tolbi, invisible and unable to move. More...

Go to the source code of this file.

Data Structures

struct  LightWheel
 The ring of five lights above room 6's rocks as it spins to its next light: angles are 16-bit turns, the light at the top is the chosen one. More...
struct  RockPuzzle
 Room 6's rock puzzle, kept in gSceneState: the rounds of lights matched in byte 0, then the state and the light shown. More...

Macros

#define ROCK_PUZZLE   ((struct RockPuzzle *)&gSceneState[1])
#define DIRECTION_STEP(dx, dz)
 Pixel step by direction: X in the upper halfword, Z in the lower.

Enumerations

enum  { ACTOR_INVISIBLE_BABI = 8 , ACTOR_BABI = 9 , ACTOR_FIRST_GUARD = 10 , ACTOR_SECOND_GUARD = 11 }
 Room 2's actors: Babi while invisible and once seen, and the two Tolbi soldiers who come looking for him. More...
enum  { ACTOR_FIRST_OBSTACLE = 8 , ACTOR_ROOM4_PUDDLE = 11 , ACTOR_ROOM4_BLOCK = 12 , ACTOR_DJINNI = 13 }
 Rooms 4 and 6 place first the three obstacles the party pushes; room 4 then a puddle, a block for Move and Djinni 65. More...
enum  {
  ACTOR_FIRST_LIGHT = 11 , ACTOR_BLUE_LIGHT = ACTOR_FIRST_LIGHT , ACTOR_GREEN_LIGHT , ACTOR_WHITE_LIGHT ,
  ACTOR_YELLOW_LIGHT , ACTOR_RED_LIGHT , ACTOR_FIRST_ROCK , ACTOR_BLUE_ROCK = ACTOR_FIRST_ROCK ,
  ACTOR_GREEN_ROCK , ACTOR_WHITE_ROCK , ACTOR_YELLOW_ROCK , ACTOR_RED_ROCK
}
 Room 6: the five colored lights and the five rocks, each in Babi's order, the rocks left to right. More...
enum  { LIGHT_COUNT = 5 }
enum  {
  COLOR_BLUE = 1 , COLOR_GREEN = 4 , COLOR_WHITE = 11 , COLOR_YELLOW = 2 ,
  COLOR_RED = 3 , COLOR_NONE = 6
}
 The palette a light or rock is drawn in, as its child value: the five colors in the same order, and none for a rock while Reveal is off. More...
enum  { FLAG_DARK = FLAG_SCENE_TEMP_00 , FLAG_GRADED_DARKNESS = FLAG_SCENE_TEMP_01 , FLAG_PUDDLE_FROZEN = FLAG_SCENE_TEMP_11 , FLAG_BLOCK_IN_PLACE = FLAG_SCENE_TEMP_12 }
 The scene flags the cave keeps. More...
enum  {
  WHEEL_SPEEDING_UP , WHEEL_COASTING , WHEEL_SLOWING , WHEEL_STOPPING ,
  WHEEL_STOPPED = 99
}
 The ring speeds up, coasts half a second, slows down, then stops with the chosen light at the top. More...
enum  { PUZZLE_START , PUZZLE_LEFT_ROCK_TURNED , PUZZLE_LIGHTS_SHOWN , PUZZLE_SOLVED = 99 }
 The puzzle's states: the leftmost rock turned, then the rightmost, which shows the lights; after three lights matched the wall opens. More...

Functions

static void AltmillerCave_ReleaseWallBurst (void)
 The wall bursts: 24 pieces fly out from the ring's center, the wall's cells open to the passage, and the shaking calms.
static void AltmillerCave_StartDjinnBattle (void)
 Talking to the Djinni in room 4 starts the battle for Djinni 65.
const struct SceneEntrance * AltmillerCave_GetEntrances (void)
 The six rooms share one entrance table.
const struct SceneRegion * AltmillerCave_GetRegions (void)
const u32 * AltmillerCave_GetExits (void)
const struct ScenePlacement * AltmillerCave_GetPlacements (void)
static void AltmillerCave_ApplyFadeBlend (void)
 Darkens room 1 to its current level: the brighter blend at level 0, each level one step darker.
static void AltmillerCave_SetFadeLevel (s32 level)
 Keeps room 1's darkness level, and shows it unless Reveal is lighting the room.
static void AltmillerCave_DarkenToLevel0 (void)
 Room 1's darkness boundaries: crossing one sets its level.
static void AltmillerCave_DarkenToLevel1 (void)
static void AltmillerCave_DarkenToLevel2 (void)
static void AltmillerCave_DarkenToLevel3 (void)
static void AltmillerCave_DarkenToLevel4 (void)
static void AltmillerCave_DarkenToLevel5 (void)
static void AltmillerCave_InitializeDarkness (void)
 Darkens the cave on entry: room 1 by its levels, the other dark rooms evenly.
static void AltmillerCave_StartReveal (void)
 Reveal's light: room 1 is lit and room 6's rocks show their colors.
static void AltmillerCave_EndReveal (void)
 Reveal's light ends: the cave darkens again and room 6's rocks lose their colors.
static void AltmillerCave_BeginRetreat (void)
 Retreat's first phase: the Psynergy's first actor faces south, and its object is copied into a new one for the effect to use.
static void AltmillerCave_UpdateMovedObstacle (void)
 After Move on room 4's block: in its cell at (30, 20) it settles and opens the way beside it (remembered in TBS_PATCH_1 and later).
static void AltmillerCave_AdvanceObstacleAndCheckPassage (void)
 Walking east into room 4's block pushes it a cell.
static void AltmillerCave_CheckFrostTargetCollision (void)
 Frost's first phase on room 4's puddle: notes whether its place is blocked, which keeps it from freezing.
static void AltmillerCave_FreezePuddle (void)
 Frost on room 4's puddle, unless blocked: it freezes and its cell takes the frozen attributes kept at (76, 16).
static void AltmillerCave_HopSelectedActor (void)
 Walking into room 4's puddle while it is not frozen: the leader hops 32 pixels over it, if the landing is clear.
static void AltmillerCave_MoveStagedActorToClearPosition (void)
 Walking into one of the three obstacles pushes it, if there is room.
static void AltmillerCave_PulseLight (union FieldObject *fieldObject)
 Update callback of the light at the top of the stopped ring: it pulses through four sizes.
static void AltmillerCave_PlaceLight (s32 actorId, s32 radius, s32 angle)
 Puts a light on the ring, radius pixels from its center above the rocks, at the given angle.
static void AltmillerCave_PlaceLights (s32 angle)
 Spaces the five lights evenly around the ring, the first at the given angle.
static void AltmillerCave_SpinLights (void)
 Scheduler task that spins the ring of lights: it speeds up, coasts, slows and stops with the chosen light at the top, which then pulses; a click (SE_135) sounds for each fifth of a turn.
static void AltmillerCave_TurnRock (s32 rock)
 Talking to one of room 6's rocks rotates it.
s32 Math_DivideUnsigned (s32 value, s32 divisor)
 Divides the nonnegative random value for wall-fragment scaling.
static __inline__ void AltmillerCave_FacePartyNorth (void)
 The party turns north, toward Babi.
static void AltmillerCave_RestoreBabiAndInviteParty (void)
 Bringing Babi the Mystic Draught: he drinks it and appears, startling the party; Ivan reads his mind and finds him to be Babi, the ruler of Tolbi, who sought Lemurians to escape growing old.
static void AltmillerCave_MeetInvisibleBabi (void)
 Talking to the invisible Babi the first time: he can be heard but not seen, cannot move, and asks the party to bring his draught from deep in the cave, telling the order of the five rocks.
static void AltmillerCave_RepeatRockOrder (void)
 Talking to Babi again before the draught is found: he asks whether the party forgot the order of the rock colors, and tells it again.
static void AltmillerCave_BabiCallsPartyBack (void)
 Walking away from Babi once: the party is told where the draught is.
const struct SceneEvent * AltmillerCave_GetEvents (void)
static void AltmillerCave_MatchLeaderPriority (union FieldObject *fieldObject)
 Update callback of room 6's obstacles: drawn on the leader's sprite priority.
static __inline__ void AltmillerCave_RedrawObstacleFootprints (void)
 Redraws the three obstacles' cells where they stand.
s32 AltmillerCave_Initialize (void)
 Sets up the room being entered: an entry from outside the cave takes the room's first entrance; room 1 picks its darkness from the entrance; room 2's Babi is invisible until rescued; room 4's obstacles and pillar and room 6's obstacles, lights and rocks are restored.
static void AltmillerCave_UpdateWallFragment (struct EffectSlot *fragment)
 Update callback of a piece of the burst wall: it flies off to a random point 120 pixels away, with a crash every fourth frame as they start.

Variables

struct LightWheel gAltmillerCave_LightWheelState
s32 gStagedActor_DirectionSteps []
 Pixel step by direction: X in the upper halfword, Z in the lower.
u32 gStagedActor_FootprintKinds []
s32 gStagedActor_FootprintBounds []
struct LightWheel * gAltmillerCave_LightWheel = &gAltmillerCave_LightWheelState
struct SceneEntrance gAltmillerCave_Entrances []
u32 gAltmillerCave_Exits []
struct ScenePlacement gAltmillerCave_PlacementsOther []
struct ScenePlacement gAltmillerCave_Placements2 []
struct ScenePlacement gAltmillerCave_Placements4 []
struct ScenePlacement gAltmillerCave_Placements6 []
u32 gAltmillerCave_PulseScales []
 The sizes the light at the top pulses through.
s32 gAltmillerCave_GuardsArrivePath []
 The two soldiers walk in to Babi.
s32 gAltmillerCave_SecondGuardLeavePath []
 Babi and the soldiers walk out of the room, each by his own path.
s32 gAltmillerCave_FirstGuardLeavePath []
s32 gAltmillerCave_BabiLeavePath []
struct SceneEvent gAltmillerCave_EventsOther []
struct SceneEvent gAltmillerCave_Events2 []
struct SceneEvent gAltmillerCave_Events3 []
struct SceneEvent gAltmillerCave_Events4 []
struct SceneEvent gAltmillerCave_Events5 []
struct SceneEvent gAltmillerCave_Events6 []

Detailed Description

Altmiller Cave, six dark rooms where the party finds Babi, the ruler of Tolbi, invisible and unable to move.

He sends the party for the Mystic Draught behind a wall deep in the cave, which opens to five rocks turned in the order of the colored lights over them. Restored, Babi is found by two Tolbi soldiers and invites the party to fight in Colosso's finals.

The cave darkens as the party walks in, and Reveal lights it up.

Definition in file altmiller_cave.c.

Macro Definition Documentation

◆ ROCK_PUZZLE

#define ROCK_PUZZLE   ((struct RockPuzzle *)&gSceneState[1])

Definition at line 148 of file altmiller_cave.c.

Referenced by AltmillerCave_TurnRock().

◆ DIRECTION_STEP

#define DIRECTION_STEP ( dx,
dz )
Value:
(((u32)(dx) << 16) | ((dz) & 0xffff))
unsigned int u32
Definition types.h:15

Pixel step by direction: X in the upper halfword, Z in the lower.

Definition at line 2129 of file altmiller_cave.c.

Referenced by VaultCave_PushBlockAhead().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Room 2's actors: Babi while invisible and once seen, and the two Tolbi soldiers who come looking for him.

Enumerator
ACTOR_INVISIBLE_BABI 
ACTOR_BABI 
ACTOR_FIRST_GUARD 
ACTOR_SECOND_GUARD 

Definition at line 59 of file altmiller_cave.c.

◆ anonymous enum

anonymous enum

Rooms 4 and 6 place first the three obstacles the party pushes; room 4 then a puddle, a block for Move and Djinni 65.

Enumerator
ACTOR_FIRST_OBSTACLE 
ACTOR_ROOM4_PUDDLE 
ACTOR_ROOM4_BLOCK 
ACTOR_DJINNI 

Definition at line 68 of file altmiller_cave.c.

◆ anonymous enum

anonymous enum

Room 6: the five colored lights and the five rocks, each in Babi's order, the rocks left to right.

The order is "blue, green, white, yellow, red".

Enumerator
ACTOR_FIRST_LIGHT 
ACTOR_BLUE_LIGHT 
ACTOR_GREEN_LIGHT 
ACTOR_WHITE_LIGHT 
ACTOR_YELLOW_LIGHT 
ACTOR_RED_LIGHT 
ACTOR_FIRST_ROCK 
ACTOR_BLUE_ROCK 
ACTOR_GREEN_ROCK 
ACTOR_WHITE_ROCK 
ACTOR_YELLOW_ROCK 
ACTOR_RED_ROCK 

Definition at line 77 of file altmiller_cave.c.

◆ anonymous enum

anonymous enum
Enumerator
LIGHT_COUNT 

Definition at line 92 of file altmiller_cave.c.

◆ anonymous enum

anonymous enum

The palette a light or rock is drawn in, as its child value: the five colors in the same order, and none for a rock while Reveal is off.

Enumerator
COLOR_BLUE 
COLOR_GREEN 
COLOR_WHITE 
COLOR_YELLOW 
COLOR_RED 
COLOR_NONE 

Definition at line 96 of file altmiller_cave.c.

◆ anonymous enum

anonymous enum

The scene flags the cave keeps.

Enumerator
FLAG_DARK 

The cave is dark: set on entry everywhere but rooms 4 and 6.

FLAG_GRADED_DARKNESS 

Room 1 darkens by steps as the party walks in.

FLAG_PUDDLE_FROZEN 

Frost has frozen room 4's puddle.

FLAG_BLOCK_IN_PLACE 

Room 4's block stands where Move opens the passage.

Definition at line 106 of file altmiller_cave.c.

◆ anonymous enum

anonymous enum

The ring speeds up, coasts half a second, slows down, then stops with the chosen light at the top.

Enumerator
WHEEL_SPEEDING_UP 
WHEEL_COASTING 
WHEEL_SLOWING 
WHEEL_STOPPING 
WHEEL_STOPPED 

Definition at line 133 of file altmiller_cave.c.

◆ anonymous enum

anonymous enum

The puzzle's states: the leftmost rock turned, then the rightmost, which shows the lights; after three lights matched the wall opens.

Enumerator
PUZZLE_START 
PUZZLE_LEFT_ROCK_TURNED 
PUZZLE_LIGHTS_SHOWN 
PUZZLE_SOLVED 

Definition at line 152 of file altmiller_cave.c.

Function Documentation

◆ AltmillerCave_ReleaseWallBurst()

void AltmillerCave_ReleaseWallBurst ( void )
static

The wall bursts: 24 pieces fly out from the ring's center, the wall's cells open to the passage, and the shaking calms.

Definition at line 2076 of file altmiller_cave.c.

Referenced by AltmillerCave_ReleaseWallBurst(), and AltmillerCave_TurnRock().

◆ AltmillerCave_StartDjinnBattle()

void AltmillerCave_StartDjinnBattle ( void )
static

Talking to the Djinni in room 4 starts the battle for Djinni 65.

Definition at line 165 of file altmiller_cave.c.

Referenced by AltmillerCave_StartDjinnBattle().

◆ AltmillerCave_GetEntrances()

const struct SceneEntrance * AltmillerCave_GetEntrances ( void )

The six rooms share one entrance table.

Definition at line 170 of file altmiller_cave.c.

Referenced by AltmillerCave_GetEntrances().

◆ AltmillerCave_GetRegions()

const struct SceneRegion * AltmillerCave_GetRegions ( void )

Definition at line 174 of file altmiller_cave.c.

Referenced by AltmillerCave_GetRegions().

◆ AltmillerCave_GetExits()

const u32 * AltmillerCave_GetExits ( void )

Definition at line 176 of file altmiller_cave.c.

Referenced by AltmillerCave_GetExits().

◆ AltmillerCave_GetPlacements()

const struct ScenePlacement * AltmillerCave_GetPlacements ( void )

Definition at line 178 of file altmiller_cave.c.

Referenced by AltmillerCave_GetPlacements().

◆ AltmillerCave_ApplyFadeBlend()

void AltmillerCave_ApplyFadeBlend ( void )
static

Darkens room 1 to its current level: the brighter blend at level 0, each level one step darker.

Definition at line 195 of file altmiller_cave.c.

Referenced by AltmillerCave_ApplyFadeBlend(), AltmillerCave_InitializeDarkness(), and AltmillerCave_SetFadeLevel().

◆ AltmillerCave_SetFadeLevel()

void AltmillerCave_SetFadeLevel ( s32 level)
static

◆ AltmillerCave_DarkenToLevel0()

void AltmillerCave_DarkenToLevel0 ( void )
static

Room 1's darkness boundaries: crossing one sets its level.

Definition at line 240 of file altmiller_cave.c.

Referenced by AltmillerCave_DarkenToLevel0().

◆ AltmillerCave_DarkenToLevel1()

void AltmillerCave_DarkenToLevel1 ( void )
static

Definition at line 244 of file altmiller_cave.c.

Referenced by AltmillerCave_DarkenToLevel1().

◆ AltmillerCave_DarkenToLevel2()

void AltmillerCave_DarkenToLevel2 ( void )
static

Definition at line 248 of file altmiller_cave.c.

Referenced by AltmillerCave_DarkenToLevel2().

◆ AltmillerCave_DarkenToLevel3()

void AltmillerCave_DarkenToLevel3 ( void )
static

Definition at line 252 of file altmiller_cave.c.

Referenced by AltmillerCave_DarkenToLevel3().

◆ AltmillerCave_DarkenToLevel4()

void AltmillerCave_DarkenToLevel4 ( void )
static

Definition at line 256 of file altmiller_cave.c.

Referenced by AltmillerCave_DarkenToLevel4().

◆ AltmillerCave_DarkenToLevel5()

void AltmillerCave_DarkenToLevel5 ( void )
static

Definition at line 260 of file altmiller_cave.c.

Referenced by AltmillerCave_DarkenToLevel5().

◆ AltmillerCave_InitializeDarkness()

void AltmillerCave_InitializeDarkness ( void )
static

Darkens the cave on entry: room 1 by its levels, the other dark rooms evenly.

Definition at line 266 of file altmiller_cave.c.

Referenced by AltmillerCave_EndReveal(), AltmillerCave_Initialize(), and AltmillerCave_InitializeDarkness().

◆ AltmillerCave_StartReveal()

void AltmillerCave_StartReveal ( void )
static

Reveal's light: room 1 is lit and room 6's rocks show their colors.

Definition at line 324 of file altmiller_cave.c.

Referenced by AltmillerCave_StartReveal().

◆ AltmillerCave_EndReveal()

void AltmillerCave_EndReveal ( void )
static

Reveal's light ends: the cave darkens again and room 6's rocks lose their colors.

Definition at line 341 of file altmiller_cave.c.

Referenced by AltmillerCave_EndReveal().

◆ AltmillerCave_BeginRetreat()

void AltmillerCave_BeginRetreat ( void )
static

Retreat's first phase: the Psynergy's first actor faces south, and its object is copied into a new one for the effect to use.

Definition at line 359 of file altmiller_cave.c.

Referenced by AltmillerCave_BeginRetreat().

◆ AltmillerCave_UpdateMovedObstacle()

void AltmillerCave_UpdateMovedObstacle ( void )
static

After Move on room 4's block: in its cell at (30, 20) it settles and opens the way beside it (remembered in TBS_PATCH_1 and later).

Definition at line 383 of file altmiller_cave.c.

Referenced by AltmillerCave_AdvanceObstacleAndCheckPassage(), and AltmillerCave_UpdateMovedObstacle().

◆ AltmillerCave_AdvanceObstacleAndCheckPassage()

void AltmillerCave_AdvanceObstacleAndCheckPassage ( void )
static

Walking east into room 4's block pushes it a cell.

Definition at line 398 of file altmiller_cave.c.

Referenced by AltmillerCave_AdvanceObstacleAndCheckPassage().

◆ AltmillerCave_CheckFrostTargetCollision()

void AltmillerCave_CheckFrostTargetCollision ( void )
static

Frost's first phase on room 4's puddle: notes whether its place is blocked, which keeps it from freezing.

Definition at line 405 of file altmiller_cave.c.

Referenced by AltmillerCave_CheckFrostTargetCollision().

◆ AltmillerCave_FreezePuddle()

void AltmillerCave_FreezePuddle ( void )
static

Frost on room 4's puddle, unless blocked: it freezes and its cell takes the frozen attributes kept at (76, 16).

Definition at line 421 of file altmiller_cave.c.

Referenced by AltmillerCave_FreezePuddle().

◆ AltmillerCave_HopSelectedActor()

void AltmillerCave_HopSelectedActor ( void )
static

Walking into room 4's puddle while it is not frozen: the leader hops 32 pixels over it, if the landing is clear.

Definition at line 440 of file altmiller_cave.c.

Referenced by AltmillerCave_HopSelectedActor().

◆ AltmillerCave_MoveStagedActorToClearPosition()

void AltmillerCave_MoveStagedActorToClearPosition ( void )
static

Walking into one of the three obstacles pushes it, if there is room.

Definition at line 479 of file altmiller_cave.c.

Referenced by AltmillerCave_MoveStagedActorToClearPosition().

◆ AltmillerCave_PulseLight()

void AltmillerCave_PulseLight ( union FieldObject * fieldObject)
static

Update callback of the light at the top of the stopped ring: it pulses through four sizes.

Definition at line 491 of file altmiller_cave.c.

Referenced by AltmillerCave_PulseLight(), and AltmillerCave_SpinLights().

◆ AltmillerCave_PlaceLight()

void AltmillerCave_PlaceLight ( s32 actorId,
s32 radius,
s32 angle )
static

Puts a light on the ring, radius pixels from its center above the rocks, at the given angle.

Definition at line 503 of file altmiller_cave.c.

Referenced by AltmillerCave_PlaceLight(), AltmillerCave_PlaceLights(), and AltmillerCave_TurnRock().

◆ AltmillerCave_PlaceLights()

void AltmillerCave_PlaceLights ( s32 angle)
static

Spaces the five lights evenly around the ring, the first at the given angle.

Definition at line 521 of file altmiller_cave.c.

Referenced by AltmillerCave_Initialize(), AltmillerCave_PlaceLights(), and AltmillerCave_SpinLights().

◆ AltmillerCave_SpinLights()

void AltmillerCave_SpinLights ( void )
static

Scheduler task that spins the ring of lights: it speeds up, coasts, slows and stops with the chosen light at the top, which then pulses; a click (SE_135) sounds for each fifth of a turn.

Definition at line 534 of file altmiller_cave.c.

Referenced by AltmillerCave_SpinLights(), and AltmillerCave_TurnRock().

◆ AltmillerCave_TurnRock()

void AltmillerCave_TurnRock ( s32 rock)
static

Talking to one of room 6's rocks rotates it.

"Isaac rotated the rock." Turning the leftmost rock, then the rightmost, brings out the ring of lights; then each time the rock matching the light at the top is turned, the ring spins to another light, and a wrong rock puts the lights away and starts over. After three lights matched the ring shrinks away, the wall bursts and the way to Babi's draught opens.

Definition at line 586 of file altmiller_cave.c.

Referenced by AltmillerCave_TurnRock().

◆ Math_DivideUnsigned()

s32 Math_DivideUnsigned ( s32 value,
s32 divisor )

Divides the nonnegative random value for wall-fragment scaling.

Referenced by AltmillerCave_ReleaseWallBurst(), Math_DivideUnsigned(), Math_DivideUnsigned(), and ShipGlow_CyclePalette().

◆ AltmillerCave_FacePartyNorth()

__inline__ void AltmillerCave_FacePartyNorth ( void )
static

The party turns north, toward Babi.

Definition at line 740 of file altmiller_cave.c.

Referenced by AltmillerCave_FacePartyNorth(), and AltmillerCave_RestoreBabiAndInviteParty().

◆ AltmillerCave_RestoreBabiAndInviteParty()

void AltmillerCave_RestoreBabiAndInviteParty ( void )
static

Bringing Babi the Mystic Draught: he drinks it and appears, startling the party; Ivan reads his mind and finds him to be Babi, the ruler of Tolbi, who sought Lemurians to escape growing old.

Two Tolbi soldiers find him and lead him home, and he invites the party to Colosso's finals; Garet asks whether they should take part.

Definition at line 752 of file altmiller_cave.c.

Referenced by AltmillerCave_RestoreBabiAndInviteParty().

◆ AltmillerCave_MeetInvisibleBabi()

void AltmillerCave_MeetInvisibleBabi ( void )
static

Talking to the invisible Babi the first time: he can be heard but not seen, cannot move, and asks the party to bring his draught from deep in the cave, telling the order of the five rocks.

Definition at line 1532 of file altmiller_cave.c.

Referenced by AltmillerCave_MeetInvisibleBabi().

◆ AltmillerCave_RepeatRockOrder()

void AltmillerCave_RepeatRockOrder ( void )
static

Talking to Babi again before the draught is found: he asks whether the party forgot the order of the rock colors, and tells it again.

Definition at line 1807 of file altmiller_cave.c.

Referenced by AltmillerCave_RepeatRockOrder().

◆ AltmillerCave_BabiCallsPartyBack()

void AltmillerCave_BabiCallsPartyBack ( void )
static

Walking away from Babi once: the party is told where the draught is.

"Wait... The draught is... on a table behind the door."

Definition at line 1828 of file altmiller_cave.c.

Referenced by AltmillerCave_BabiCallsPartyBack().

◆ AltmillerCave_GetEvents()

const struct SceneEvent * AltmillerCave_GetEvents ( void )

Definition at line 1849 of file altmiller_cave.c.

Referenced by AltmillerCave_GetEvents().

◆ AltmillerCave_MatchLeaderPriority()

void AltmillerCave_MatchLeaderPriority ( union FieldObject * fieldObject)
static

Update callback of room 6's obstacles: drawn on the leader's sprite priority.

Definition at line 1872 of file altmiller_cave.c.

Referenced by AltmillerCave_Initialize(), and AltmillerCave_MatchLeaderPriority().

◆ AltmillerCave_RedrawObstacleFootprints()

__inline__ void AltmillerCave_RedrawObstacleFootprints ( void )
static

Redraws the three obstacles' cells where they stand.

Definition at line 1882 of file altmiller_cave.c.

Referenced by AltmillerCave_Initialize(), and AltmillerCave_RedrawObstacleFootprints().

◆ AltmillerCave_Initialize()

s32 AltmillerCave_Initialize ( void )

Sets up the room being entered: an entry from outside the cave takes the room's first entrance; room 1 picks its darkness from the entrance; room 2's Babi is invisible until rescued; room 4's obstacles and pillar and room 6's obstacles, lights and rocks are restored.

Returns 0.

Definition at line 1892 of file altmiller_cave.c.

Referenced by AltmillerCave_Initialize().

◆ AltmillerCave_UpdateWallFragment()

void AltmillerCave_UpdateWallFragment ( struct EffectSlot * fragment)
static

Update callback of a piece of the burst wall: it flies off to a random point 120 pixels away, with a crash every fourth frame as they start.

Definition at line 2037 of file altmiller_cave.c.

Referenced by AltmillerCave_ReleaseWallBurst(), and AltmillerCave_UpdateWallFragment().

Variable Documentation

◆ gAltmillerCave_LightWheelState

struct LightWheel gAltmillerCave_LightWheelState

Definition at line 159 of file altmiller_cave.c.

◆ gStagedActor_DirectionSteps

s32 gStagedActor_DirectionSteps[]
Initial value:
= {
DIRECTION_STEP(0, 16), DIRECTION_STEP(-16, 0), DIRECTION_STEP(-16, 0),
DIRECTION_STEP(-16, 0), DIRECTION_STEP(-16, 0), DIRECTION_STEP(0, -16),
DIRECTION_STEP(0, -16), DIRECTION_STEP(0, -16), DIRECTION_STEP(0, -16),
}
#define DIRECTION_STEP(dx, dz)
Pixel step by direction: X in the upper halfword, Z in the lower.

Pixel step by direction: X in the upper halfword, Z in the lower.

Definition at line 2131 of file altmiller_cave.c.

Referenced by BabiLighthouse_FindActorAhead(), ColossoLog_PushActorAhead(), CrossboneIslePillarRooms_TryJumpAcrossPillar(), Event_JumpAcrossGap(), FieldScene_FindActorRegion(), SceneActor_MoveAndRedraw(), StagedActor_AdvancePair(), StagedActor_FindClearPosition(), StagedActor_StopBlockedMotion(), and VenusLighthouse_PushAdjacentBlock().

◆ gStagedActor_FootprintKinds

u32 gStagedActor_FootprintKinds[]
Initial value:
= {
207, 205, 228, 229, 298, 297,
}

Definition at line 2140 of file altmiller_cave.c.

Referenced by CrossboneIslePillarRooms_QueryFootprint(), FieldScene_FindActorRegion(), FieldScene_RedrawActorFootprint(), and StagedActor_StopBlockedMotion().

◆ gStagedActor_FootprintBounds

s32 gStagedActor_FootprintBounds[]
Initial value:
= {
-32, -8, 32, 8, -8, -32, 8, 32, -32, -16, 32, 0,
-8, -32, 8, 32, -32, -8, 32, 8, -8, -32, 8, 32,
}

Definition at line 2144 of file altmiller_cave.c.

Referenced by CrossboneIslePillarRooms_QueryFootprint(), FieldScene_FindActorRegion(), FieldScene_RedrawActorFootprint(), SceneActor_MoveAndRedraw(), and StagedActor_FindClearPosition().

◆ gAltmillerCave_LightWheel

struct LightWheel* gAltmillerCave_LightWheel = &gAltmillerCave_LightWheelState

◆ gAltmillerCave_Entrances

struct SceneEntrance gAltmillerCave_Entrances[]
Initial value:
= {
{0, CONDITION_ALWAYS, 172, 0, 149, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
{1, CONDITION_ALWAYS, 456, 0, 504, FACING_NORTH, 0, 0, 0, 544, 528, 0},
{2, CONDITION_ALWAYS, 280, 0, 360, FACING_SOUTH, 0, 0, 0, 544, 528, 0},
{3, CONDITION_ALWAYS, 120, 0, 696, FACING_NORTH, 0, 0, 552, 240, 720, 0},
{4, CONDITION_ALWAYS, 120, 0, 600, FACING_SOUTH, 0, 0, 552, 240, 720, 0},
{10, CONDITION_ALWAYS, 392, 0, 504, FACING_SOUTH, 0, 48, 16, 496, 672, 0},
{11, CONDITION_ALWAYS, 136, 0, 104, FACING_SOUTH, 0, 48, 16, 496, 672, 0},
{20, CONDITION_ALWAYS, 232, 0, 216, FACING_SOUTH, 0, 64, 48, 592, 576, 0},
{21, CONDITION_ALWAYS, 328, 0, 264, FACING_SOUTH, 0, 64, 48, 592, 576, 0},
{30, CONDITION_ALWAYS, 200, 0, 424, FACING_SOUTH, 0, 48, 80, 576, 480, 0},
{31, CONDITION_ALWAYS, 520, 0, 328, FACING_SOUTH, 0, 48, 80, 576, 480, 0},
{40, CONDITION_ALWAYS, 680, 0, 152, FACING_SOUTH, 0, 0, 0, 768, 512, 0},
{41, CONDITION_ALWAYS, 40, 0, 248, FACING_SOUTH, 0, 0, 0, 768, 512, 0},
{50, CONDITION_ALWAYS, 296, 0, 392, FACING_SOUTH, 0, 160, 304, 576, 704, 0},
{51, CONDITION_ALWAYS, 424, 0, 392, FACING_SOUTH, 0, 160, 304, 576, 704, 0},
{52, CONDITION_ALWAYS, 504, 0, 232, FACING_NORTH, 0, 384, 64, 624, 240, 0},
{53, CONDITION_ALWAYS, 504, 0, 152, FACING_SOUTH, 0, 384, 64, 624, 240, 0},
{54, CONDITION_ALWAYS, 184, 0, 216, FACING_NORTH, 0, 64, 64, 304, 240, 0},
}
@ SCENE_TABLE_END
Definition field_scene.h:43
@ CONDITION_ALWAYS
Definition field_scene.h:44
@ FACING_NORTH
Definition field_scene.h:32
@ FACING_SOUTH
Definition field_scene.h:28

Definition at line 2151 of file altmiller_cave.c.

Referenced by AltmillerCave_GetEntrances().

◆ gAltmillerCave_Exits

u32 gAltmillerCave_Exits[]
Initial value:
= {
SCENE_EXITS(146), SCENE_EXIT(1, 2, 24), SCENE_EXIT(2, 146, 3),
SCENE_EXIT(3, 146, 2), SCENE_EXIT(4, 147, 10), SCENE_EXIT(0, 147, 0),
SCENE_EXIT(10, 146, 4), SCENE_EXIT(11, 148, 20), SCENE_EXIT(0, 148, 0),
SCENE_EXIT(20, 147, 11), SCENE_EXIT(21, 149, 30), SCENE_EXIT(0, 149, 0),
SCENE_EXIT(30, 148, 21), SCENE_EXIT(31, 150, 40), SCENE_EXIT(0, 150, 0),
SCENE_EXIT(40, 149, 31), SCENE_EXIT(41, 151, 50), SCENE_EXIT(0, 151, 0),
SCENE_EXIT(50, 150, 41), SCENE_EXIT(51, 151, 52), SCENE_EXIT(52, 151, 51),
SCENE_EXIT(53, 151, 54), SCENE_EXIT(54, 151, 53), SCENE_EXITS_END,
}
#define SCENE_EXITS(scene)
Definition field_scene.h:72
#define SCENE_EXIT(exit, scene, entrance)
Definition field_scene.h:73
#define SCENE_EXITS_END
Definition field_scene.h:77

Definition at line 2173 of file altmiller_cave.c.

Referenced by AltmillerCave_GetExits().

◆ gAltmillerCave_PlacementsOther

struct ScenePlacement gAltmillerCave_PlacementsOther[]
Initial value:
= {
}

Definition at line 2184 of file altmiller_cave.c.

Referenced by AltmillerCave_GetPlacements().

◆ gAltmillerCave_Placements2

struct ScenePlacement gAltmillerCave_Placements2[]
Initial value:
= {
0},
0},
{0x41, CONDITION_ALWAYS, ACTOR_STAND, PIXELS(232), 0, PIXELS(160),
{0x34, CONDITION_ALWAYS, ACTOR_STAND, -PIXELS(64), 0, -PIXELS(64),
{0xa3, CONDITION_ALWAYS, ACTOR_STAND, -PIXELS(64), 0, -PIXELS(64),
{0xa3, CONDITION_ALWAYS, ACTOR_STAND, -PIXELS(64), 0, -PIXELS(64),
}
#define GARET
Jerald.
#define MIA
Mary.
#define IVAN
Ivan.
@ TALK_KEEP_FACING
@ TALK_FACE_PARTY
@ ACTOR_STAND
@ FACING_EAST
Definition field_scene.h:26
#define PIXELS(value)

Definition at line 2188 of file altmiller_cave.c.

Referenced by AltmillerCave_GetPlacements().

◆ gAltmillerCave_Placements4

struct ScenePlacement gAltmillerCave_Placements4[]
Initial value:
= {
{0x129, CONDITION_ALWAYS, 7, PIXELS(328), 0, PIXELS(256), FACING_SOUTH,
{0x12a, CONDITION_ALWAYS, 7, PIXELS(352), 0, PIXELS(296), FACING_SOUTH,
{0x12a, CONDITION_ALWAYS, 7, PIXELS(368), 0, PIXELS(200), FACING_SOUTH,
{0xe3, CONDITION_ALWAYS, ACTOR_STAND, PIXELS(376), 0, PIXELS(280),
{0xd3, CONDITION_ALWAYS, ACTOR_STAND, PIXELS(472), 0, PIXELS(328),
{0x5d, FLAG_DJINNI_0 + 65, ACTOR_STAND, PIXELS(264), 0, PIXELS(200),
}
@ FACING_SOUTHWEST
Definition field_scene.h:29
#define FLAG_DJINNI_0
the flag of Djinni 0, set once it is caught
Definition flags.h:15

Definition at line 2206 of file altmiller_cave.c.

Referenced by AltmillerCave_GetPlacements().

◆ gAltmillerCave_Placements6

struct ScenePlacement gAltmillerCave_Placements6[]

◆ gAltmillerCave_PulseScales

u32 gAltmillerCave_PulseScales[]
Initial value:
= {
11 * Q16_ONE / 10,
6 * Q16_ONE / 5,
11 * Q16_ONE / 10,
}
#define Q16_ONE
One in the engine's signed 16.16 fixed-point format.
Definition fixed_math.h:10

The sizes the light at the top pulses through.

Definition at line 2253 of file altmiller_cave.c.

Referenced by AltmillerCave_PulseLight().

◆ gAltmillerCave_GuardsArrivePath

s32 gAltmillerCave_GuardsArrivePath[]
Initial value:
= {
SC_MOVE_BY(0, 0, -PIXELS(32)),
SC_MOVE_BY(-PIXELS(64), 0, 0),
SC_MOVE_BY(0, 0, -PIXELS(64)),
}
@ ANIM_WALK
Definition field_event.h:44
@ ANIM_STAND
Definition field_event.h:43
#define SC_SYNC
Wait for arrival.
Definition objcmd.h:17
#define SC_ARG(v)
Definition objcmd.h:44
#define SC_END
Return to the main script.
Definition objcmd.h:32
#define SC_MOVE_BY(x, y, z)
Move by a relative offset.
Definition objcmd.h:20

The two soldiers walk in to Babi.

Definition at line 2261 of file altmiller_cave.c.

Referenced by AltmillerCave_RestoreBabiAndInviteParty().

◆ gAltmillerCave_SecondGuardLeavePath

s32 gAltmillerCave_SecondGuardLeavePath[]
Initial value:

Babi and the soldiers walk out of the room, each by his own path.

Definition at line 2274 of file altmiller_cave.c.

Referenced by AltmillerCave_RestoreBabiAndInviteParty().

◆ gAltmillerCave_FirstGuardLeavePath

s32 gAltmillerCave_FirstGuardLeavePath[]
Initial value:

Definition at line 2286 of file altmiller_cave.c.

Referenced by AltmillerCave_RestoreBabiAndInviteParty().

◆ gAltmillerCave_BabiLeavePath

s32 gAltmillerCave_BabiLeavePath[]
Initial value:

Definition at line 2300 of file altmiller_cave.c.

Referenced by AltmillerCave_RestoreBabiAndInviteParty().

◆ gAltmillerCave_EventsOther

struct SceneEvent gAltmillerCave_EventsOther[]
Initial value:
= {
{0x31, 4, CONDITION_ALWAYS, 4},
}
@ ABILITY_REVEAL
Definition ability_ids.h:19
@ ABILITY_RETREAT
Definition ability_ids.h:24
static void AltmillerCave_EndReveal(void)
Reveal's light ends: the cave darkens again and room 6's rocks lose their colors.
static void AltmillerCave_DarkenToLevel1(void)
static void AltmillerCave_DarkenToLevel2(void)
static void AltmillerCave_DarkenToLevel0(void)
Room 1's darkness boundaries: crossing one sets its level.
static void AltmillerCave_DarkenToLevel4(void)
static void AltmillerCave_BeginRetreat(void)
Retreat's first phase: the Psynergy's first actor faces south, and its object is copied into a new on...
static void AltmillerCave_DarkenToLevel3(void)
static void AltmillerCave_StartReveal(void)
Reveal's light: room 1 is lit and room 6's rocks show their colors.
static void AltmillerCave_DarkenToLevel5(void)
#define SCENE_EVENTS_END
@ EVENT_TOUCH
@ EVENT_EXIT
#define PSYNERGY_IN_AREA(ability, phase)
#define EVENT_SCRIPT(script)

Definition at line 2315 of file altmiller_cave.c.

Referenced by AltmillerCave_GetEvents().

◆ gAltmillerCave_Events2

struct SceneEvent gAltmillerCave_Events2[]
Initial value:
= {
{0x21, 10, CONDITION_ALWAYS, 10},
{0x31, 11, CONDITION_ALWAYS, 11},
{SEARCH(SEARCH_CHEST), 100, 0xef5, 0x500005},
}
@ ABILITY_MIND_READ
Definition ability_ids.h:16
@ ACTOR_INVISIBLE_BABI
static void AltmillerCave_RepeatRockOrder(void)
Talking to Babi again before the draught is found: he asks whether the party forgot the order of the ...
static void AltmillerCave_MeetInvisibleBabi(void)
Talking to the invisible Babi the first time: he can be heard but not seen, cannot move,...
static void AltmillerCave_BabiCallsPartyBack(void)
Walking away from Babi once: the party is told where the draught is.
static void AltmillerCave_RestoreBabiAndInviteParty(void)
Bringing Babi the Mystic Draught: he drinks it and appears, startling the party; Ivan reads his mind ...
@ EVENT_TALK
#define PSYNERGY_ON_ACTOR(ability)
#define SEARCH(target)
@ SEARCH_CHEST
#define FLAG_BABI_SAVED
The party has saved Babi in Altmiller Cave with his Mystic Draught; Tolbi then holds the Colosso fina...
Definition flags.h:170
#define FLAG_MET_INVISIBLE_BABI
Babi has asked for his draught.
Definition flags.h:165
#define FLAG_ALTMILLER_CAVE_MYSTIC_DRAUGHT
behind the rocks' wall
Definition flags.h:171
#define FLAG_BABI_CALLED_PARTY_BACK
Babi has called the party back once as it made to leave without him.
Definition flags.h:167

Definition at line 2334 of file altmiller_cave.c.

Referenced by AltmillerCave_GetEvents().

◆ gAltmillerCave_Events3

struct SceneEvent gAltmillerCave_Events3[]
Initial value:

Definition at line 2353 of file altmiller_cave.c.

Referenced by AltmillerCave_GetEvents().

◆ gAltmillerCave_Events4

struct SceneEvent gAltmillerCave_Events4[]
Initial value:
= {
{0x21, 30, CONDITION_ALWAYS, 30},
{0x31, 31, CONDITION_ALWAYS, 31},
}
@ ABILITY_MOVE
Definition ability_ids.h:15
@ ABILITY_FROST
Definition ability_ids.h:11
@ ACTOR_DJINNI
Definition altin_peak.c:118
static void AltmillerCave_StartDjinnBattle(void)
Talking to the Djinni in room 4 starts the battle for Djinni 65.
static void AltmillerCave_AdvanceObstacleAndCheckPassage(void)
Walking east into room 4's block pushes it a cell.
static void AltmillerCave_UpdateMovedObstacle(void)
After Move on room 4's block: in its cell at (30, 20) it settles and opens the way beside it (remembe...
@ ACTOR_ROOM4_PUDDLE
@ ACTOR_ROOM4_BLOCK
static void AltmillerCave_CheckFrostTargetCollision(void)
Frost's first phase on room 4's puddle: notes whether its place is blocked, which keeps it from freez...
static void AltmillerCave_FreezePuddle(void)
Frost on room 4's puddle, unless blocked: it freezes and its cell takes the frozen attributes kept at...
static void AltmillerCave_MoveStagedActorToClearPosition(void)
Walking into one of the three obstacles pushes it, if there is room.
static void AltmillerCave_HopSelectedActor(void)
Walking into room 4's puddle while it is not frozen: the leader hops 32 pixels over it,...
#define PSYNERGY_PHASE_ON_ACTOR(ability, phase)
A Psynergy event on an actor at one phase of the cast, as PSYNERGY_IN_AREA is for an area.
#define EVENT_TOUCH_WALKING
#define TOUCH_WALKING_INTO(facing)
@ FACING_WEST
Definition field_scene.h:30

Definition at line 2363 of file altmiller_cave.c.

Referenced by AltmillerCave_GetEvents().

◆ gAltmillerCave_Events5

struct SceneEvent gAltmillerCave_Events5[]

◆ gAltmillerCave_Events6

struct SceneEvent gAltmillerCave_Events6[]
Initial value:
= {
{0x21, 50, CONDITION_ALWAYS, 50},
}
@ ACTOR_RED_ROCK
@ ACTOR_GREEN_ROCK
@ ACTOR_BLUE_ROCK
@ ACTOR_WHITE_ROCK
@ ACTOR_YELLOW_ROCK
static void AltmillerCave_TurnRock(s32 rock)
Talking to one of room 6's rocks rotates it.
@ ITEM_MYSTIC_DRAUGHT
Definition item_ids.h:78

Definition at line 2390 of file altmiller_cave.c.

Referenced by AltmillerCave_GetEvents().