src/scene/caverns.c
The four small caves that each keep a Summon's stone tablet, in four scenes that share this overlay. More…
#include "field/script_inline.h"#include "field/actor_script.h"#include "game/game.h"#include "macros.h"#include "field/field_engine.h"#include "field/map_grid.h"#include "field/field_psynergy_state.h"#include "shared/actor_set_sprite_priority.c"#include "shared/actor_create_silhouette.c"#include "shared/scene_create_imported_actor.c"#include "../field/field_effect_move.c"#include "shared/field_effect_spawn.c"#include "shared/map_metatile_get.c"#include "shared/map_metatile_set.c"#include "shared/actor_wait_until_landed.c"#include "shared/field_effect_duration_scripts.c"
Macros
| Name | Description | |
|---|---|---|
#define | FLAG_OSENIA_CAVERN_SCOOPED 0x9af | Story flags: Osenia Cavern's passage dug open by Scoop, Atteka Cavern's water dried by Parch. |
#define | FLAG_ATTEKA_CAVERN_PARCHED 0x917 | |
#define | FLAG_ANGARA_BLOCK_ON_TOP FLAG_SCENE_TEMP(0x12) | Angara Cavern: one block carried on top of the other, and the metatiles about the block's path raised while it moves. |
#define | FLAG_ANGARA_METATILES_RAISED FLAG_SCENE_TEMP(0x13) | |
#define | FLAG_INDRA_ROPE_TIED FLAG_SCENE_TEMP(0x00) | Indra Cavern: set once Lash has tied the rope between its posts. |
#define | EFFECT_SET_MODE fdActorSelectAnimation | |
#define | EFFECT_SET_SCRIPT fdActorStartScript | |
#define | EFFECT_SPRITE_PRIORITY | |
#define | SET_METATILE_HEIGHT (x, z) | Sets the layer 2 metatile at (x, z), 16.16 pixels, to the ground height there plus offset, in height steps, with height keeping it. |
#define | ANGARA_NORTH_ROW_Z 536 | The z of Angara Cavern's two rows of metatiles the blocks start in: the second block's, and the first's south of it. |
#define | ANGARA_SOUTH_ROW_Z 552 | |
#define | INDRA_PILLAR_ROW 10 | Indra Cavern's row of metatiles the pillar stands and moves in (z 168), and the column of its metatile marked as a gap to jump onto, which is copied under the pillar. |
#define | INDRA_GAP_COLUMN 16 |
Enumerations
| Name | Description | |
|---|---|---|
enum | CAVERNS_METATILE_BEHAVIOR { METATILE_BEHAVIOR_WEST_HOLE, METATILE_BEHAVIOR_SCOOPED_HOLE, … } | The map metatiles the caves' step, examine and Psynergy cues answer. |
enum | anonymous enum { DUST_DRAG_X, DUST_DRAG_Z } | A dust puff loses a DUST_DRAG_X-th of its speed east or west each tick, and a DUST_DRAG_Z-th of its speed north or south. |
enum | INDRA_CAVERN_ACTOR_ID { ACTOR_LOWER_ROPE_POST, ACTOR_UPPER_ROPE_POST, ACTOR_PILLAR } | Indra Cavern's things: the post on the floor with the rope Lash throws, the post up on the east ledge it is tied to, and the stone pillar Move pushes across the gap between the ledges. |
enum | OSENIA_CAVERN_ACTOR_ID { ACTOR_PASSAGE_MARKER } | Osenia Cavern's one actor, the row of CavernsPlacements: an unseen marker scCavernsWalkIntoPassage sets down by the hole as Felix climbs into it. |
enum | ANGARA_CAVERN_ACTOR_ID { ACTOR_FIRST_BLOCK, ACTOR_SECOND_BLOCK, ACTOR_WEST_CANDLESTIC … } | Angara Cavern's things in Haurus's chamber, numbering AngaraCavernPlacements. |
Functions
| Name | Description | |
|---|---|---|
void | scCavernsPlaceAngaraBlocks (const Sint16 *data) | Nothing visible happens: Angara Cavern's two spiral blocks are made solid where they stand. |
void | scCavernsPrepareOsenia (void) | Osenia Cavern's map: once Scoop has dug it, the second hole stays open. |
void | scCavernsPrepareAtteka (void) | Atteka Cavern's map: once Parch has dried the pool, it stays dry. |
void | scCavernsInitIndra (void) | Indra Cavern on entry: the rope lies by its post, or runs up to the ledge once Lash has tied it (FLAG_INDRA_ROPE_TIED); the stone pillar stands still, and its metatile is one the leader jumps onto. |
void | scCavernsPrepareAngara (void) | Angara Cavern's map: when the party arrives by entrance 5 or 6, the two staircases at metatiles (28, 5) and (36, 5) lead on by the exits of metatiles (28, 0) and (36, 0) instead of their own. |
void | scCavernsInitAngara (void) | Angara Cavern on entry: the two spiral blocks stand solid where they were left, are drawn over the ground's rises, and the tablet's candlesticks are left out of the search for a block to push. |
Bool | scCavernsJumpAcross (ACTOR *actor, FIELD_COORDINATE *pos) | Jumps the leader across to the position given when nothing is in the way. |
const SCENE_ENTRANCE * | scGetEntrances (void) | Where the party can enter: the cave under the spring has its own entrances. |
const Sint16 * | scGetExitRegions (void) | The regions of the rooms whose exits are rectangles: the Chestbeaters' room and the stream room. |
const Uint32 * | scGetExits (void) | The dock's ways lead back the way the party came into Lemuria, which the harbour and the shore of Ancient Lemuria note in FLAG_LEMURIA_OTHER_WAY_IN. |
const ACTOR_PLACE * | scGetActorPlacements (void) | The scene's actor placements: a room of names for its entrance, else the debug room's. |
static __inline__ Sint32 | scCavernsGetLayer2Height (Sint32 x, Sint32 z) | The terrain height of layer 2 at a point. |
static __inline__ Sint32 | scActorGetPixelZ (ACTOR *actor) | The whole pixels of an actor's z coordinate. |
void | scCavernsShiftAngaraMetatileHeights (Sint32 offset) | Nothing visible happens: while a spiral block moves, the floor around its path in Angara's chamber is raised out of its way (offset 1) and lowered back afterwards (-1), by eight steps: the two metatiles by the ledge while the block is up on it, else the three metatiles of whichever of the two rows the block is not in. |
void | scCavernsStartMovingAngaraBlock (void) | Nothing visible happens as Felix starts to push, Move or Carry one of the two spiral blocks in Angara Cavern's chamber: the game finds the block (the one ahead of him, or the one the Psynergy's hand holds) and lowers the ground under it back to the floor, so that the block can leave its metatile. |
void | scCavernsDriftDust (FIELD_OBJECT *object) | One puff of the ring of dust a fallen block throws up: each tick it drifts outwards, slows, grows and spins. |
void | scCavernsLayerLeaderByTopBlock (ACTOR *actor) | The block stacked on top of the other, each tick: Felix is drawn in front of it while he stands south of it, and behind it otherwise. |
void | scCavernsFinishMovingAngaraBlock (void) | When a push, Move or Carry has finished moving one of the spiral blocks in Angara Cavern's chamber, a block left with no ground under it drops: onto the floor below with a thump and a ring of dust, or onto the other block, where it stays, the two stacked into a step up to Haurus's tablet. |
const CUE * | scGetCues (void) | The scene's cues: the rooms of names' for any entrance above ENTRANCE_NAMES_ABOVE, else the debug room's. |
Sint32 | scInit (void) | Opens the room through the window transition, and in the debug room draws the cat 1.7 times its size. |
Sint32 | scPrepareMap (void) | Once Briggs is caught the pool has dried up: its colours take the dry ground's. |
void | scCavernsMoveIndraPillar (Sint32 unused, Sint32 id) | Move on the stone pillar at the edge of the ledge by Zagan's tablet pushes it one metatile east into the gap; afterwards its new metatile is the one the leader jumps onto, and the metatiles it left are plain floor again. |
void | scCavernsJumpEastAcrossGap (void) | Walking east off the ledge by Zagan's tablet in Indra Cavern (metatile (12, 10)) makes Felix spring and leap two metatiles east over the gap, when nothing blocks where he would land. |
void | scCavernsOpenOseniaPassage (void) | Digs Osenia Cavern's second hole into the map: a hole and the metatiles around it, copied with their behaviours from a spare one beside the cave, over the sand in the pocket of rocks (metatiles (18, 12) to (20, 14)). |
void | scCavernsWalkIntoPassage (void) | Felix, over one of Osenia Cavern's two holes, turns his back and climbs down into it, and the screen leaves for the tunnel below: from the west hole to its west end, from the hole Scoop dug to its east end. |
void | scCavernsWalkEastIntoPassage (void) | Walking east into one of Osenia Cavern's holes in the floor (metatile (8, 13), or (18, 13) once Scoop has dug the second) brings Felix round over the hole, and he climbs down into it to the tunnel below. |
void | scCavernsWalkWestIntoPassage (void) | Walking west into one of Osenia Cavern's holes in the floor (metatile (10, 13), or (20, 13) once Scoop has dug the second) brings Felix round over the hole, and he climbs down into it to the tunnel below. |
void | scCavernsWalkSouthIntoPassage (void) | Walking south into one of Osenia Cavern's holes in the floor (metatile (9, 12), or (19, 12) once Scoop has dug the second) has Felix turn his back, as on a ladder, and climb down into it to the tunnel below. |
void | scCavernsScoopOseniaPassage (Sint32 mode) | Scoop on the sand in the pocket of rocks east of Osenia Cavern's middle (metatile (19, 13)) digs a second hole there for good, the tunnel's way up to Megaera's side of the rocks. |
void | scCavernsParchAttekaWater (void) | Parch on the green pool before Coatlicue's tablet in Atteka Cavern dries it up for good in a burst of heat and a white flash, opening the way to the tablet. |
void | scCavernsOpenAngaraDoor (void) | Walking north into the grey stone door at the west end of the small cave room in Angara Cavern (metatile (6, 32)) opens it, and the screen wipes to Haurus's chamber beyond. |
Variables
| Name | Description | |
|---|---|---|
extern Sint16 | AngaraCavernBlocks [] | The spiral blocks of Angara Cavern's chamber, by actor id, ended by -1. |
extern Sint16 | OseniaCavernRegions [] | Osenia Cavern's exit regions: the tunnel's two ends, climbed up to the west hole (exit 4) and to the one Scoop digs (exit 5). |
extern ACTOR_PLACE | CavernsPlacements [] | Osenia and Atteka Caverns' actors: the passage marker. |
extern ACTOR_PLACE | IndraCavernPlacements [] | Indra Cavern's actors, in INDRA_CAVERN_ACTOR_ID's order. |
extern ACTOR_PLACE | AngaraCavernPlacements [] | Angara Cavern's actors, in ANGARA_CAVERN_ACTOR_ID's order. |
extern CUE | OseniaCavernCues [] | Scoop on the sand where the second is dug. |
extern CUE | IndraCavernCues [] | Indra Cavern's exit, the ledge's edge by the gap, Lash on the rope post and Move on the pillar. |
extern CUE | AttekaCavernCues [] | Atteka Cavern's exit and Parch on its pool. |
extern CUE | AngaraCavernCues [] | Angara Cavern's exits and stairs, its stone door, and pushing, Move and Carry on either spiral block until they are stacked. |
extern Uint32 | FieldEffectShortScript [] | |
extern Uint32 | FieldEffectMediumScript [] | The flash about the Tomegathericon: held 45 ticks, then put away and freed. |
extern Uint32 | FieldEffectLongScript [] | |
const Sint32 * | FieldEffectDurationScripts [] | The field effects' three scripts by how long an effect lasts: short, medium and long. |
SCENE_ENTRANCE | SceneEntrances [] | Besides the party's return to the pier after the ship is stolen, four unused spots about the mast: below the huge block, on the dock by its crate, on the deck, and at the top of the sail's east pole. |
Uint32 | SceneExits [] | The room has no exits of its own. |
Description
The four small caves that each keep a Summon's stone tablet, in four scenes
that share this overlay. In Indra Cavern, west of where the Lemurian ship
lands on Indra (SceneIdIndraCavern), Lash ties a rope up to a ledge and Move
pushes a stone pillar across a gap, so that Felix can leap to Zagan's tablet
(scCavernsJumpEastAcrossGap). In Osenia Cavern, far north of Mikasalla
(OseniaCavern), a maze of rocks walls Megaera's tablet in: Felix climbs down
a hole into a tunnel, and Scoop digs the hole at its other end
(scCavernsScoopOseniaPassage). In Atteka Cavern, which only the flying ship
reaches (AttekaCavern), Parch dries the pool before Coatlicue's tablet
(scCavernsParchAttekaWater). In Angara Cavern, north of Loho (AngaraCavern),
a stone door leads down to Haurus's chamber (scCavernsOpenAngaraDoor), where
two grey spiral blocks are pushed, Moved and Carried until one stands on the
other as a step up to the tablet (scCavernsFinishMovingAngaraBlock).
Macros in detail
FLAG_OSENIA_CAVERN_SCOOPED
#define FLAG_OSENIA_CAVERN_SCOOPED 0x9af
Story flags: Osenia Cavern's passage dug open by Scoop, Atteka Cavern's water dried by Parch.
Referenced by OseniaCavernCues, scCavernsPrepareOsenia() and scCavernsScoopOseniaPassage().
Definition at line 25 of file caverns.c.
FLAG_ATTEKA_CAVERN_PARCHED
#define FLAG_ATTEKA_CAVERN_PARCHED 0x917
Referenced by scCavernsParchAttekaWater() and scCavernsPrepareAtteka().
Definition at line 26 of file caverns.c.
FLAG_ANGARA_BLOCK_ON_TOP
#define FLAG_ANGARA_BLOCK_ON_TOP FLAG_SCENE_TEMP(0x12)
Angara Cavern: one block carried on top of the other, and the metatiles about the block's path raised while it moves.
Referenced by AngaraCavernCues and scCavernsFinishMovingAngaraBlock().
Definition at line 29 of file caverns.c.
FLAG_ANGARA_METATILES_RAISED
#define FLAG_ANGARA_METATILES_RAISED FLAG_SCENE_TEMP(0x13)
Referenced by scCavernsShiftAngaraMetatileHeights().
Definition at line 30 of file caverns.c.
FLAG_INDRA_ROPE_TIED
#define FLAG_INDRA_ROPE_TIED FLAG_SCENE_TEMP(0x00)
Indra Cavern: set once Lash has tied the rope between its posts.
Referenced by IndraCavernCues and scCavernsInitIndra().
Definition at line 32 of file caverns.c.
EFFECT_SET_MODE
#define EFFECT_SET_MODE fdActorSelectAnimation
Referenced by EFFECT_SPAWN.
Definition at line 77 of file caverns.c.
EFFECT_SET_SCRIPT
#define EFFECT_SET_SCRIPT fdActorStartScript
Referenced by EFFECT_SPAWN.
Definition at line 78 of file caverns.c.
EFFECT_SPRITE_PRIORITY
#define EFFECT_SPRITE_PRIORITY
Definition at line 79 of file caverns.c.
SET_METATILE_HEIGHT
#define SET_METATILE_HEIGHT(x, z)
Sets the layer 2 metatile at (x, z), 16.16 pixels, to the ground height there
plus offset, in height steps, with height keeping it.
Referenced by scCavernsShiftAngaraMetatileHeights().
Definition at line 181 of file caverns.c.
ANGARA_NORTH_ROW_Z
#define ANGARA_NORTH_ROW_Z 536
The z of Angara Cavern's two rows of metatiles the blocks start in: the second block's, and the first's south of it.
Referenced by scCavernsShiftAngaraMetatileHeights().
Definition at line 187 of file caverns.c.
ANGARA_SOUTH_ROW_Z
#define ANGARA_SOUTH_ROW_Z 552
Referenced by scCavernsShiftAngaraMetatileHeights().
Definition at line 188 of file caverns.c.
INDRA_PILLAR_ROW
#define INDRA_PILLAR_ROW 10
Indra Cavern's row of metatiles the pillar stands and moves in (z 168), and the column of its metatile marked as a gap to jump onto, which is copied under the pillar.
Referenced by scCavernsInitIndra() and scCavernsMoveIndraPillar().
Definition at line 499 of file caverns.c.
INDRA_GAP_COLUMN
#define INDRA_GAP_COLUMN 16
Referenced by scCavernsInitIndra() and scCavernsMoveIndraPillar().
Definition at line 500 of file caverns.c.
Enumerations in detail
CAVERNS_METATILE_BEHAVIOR
enum CAVERNS_METATILE_BEHAVIOR
The map metatiles the caves' step, examine and Psynergy cues answer.
| Enumerator | Value | Description |
|---|---|---|
METATILE_BEHAVIOR_WEST_HOLE | 2 | Osenia Cavern's two holes down to |
METATILE_BEHAVIOR_SCOOPED_HOLE | 3 | the tunnel: the west one, and the one Scoop digs. Each takes the number of the exit it leads down by. |
METATILE_BEHAVIOR_SCOOP_SAND | 10 | The sand in the pocket of rocks where Scoop digs the second hole. |
METATILE_BEHAVIOR_GAP_EDGE | 10 | Indra Cavern's ledge edge by Zagan's tablet, over the gap. |
METATILE_BEHAVIOR_GREEN_POOL | 60 | Atteka Cavern's green pool before Coatlicue's tablet. |
METATILE_BEHAVIOR_HAURUS_DOOR | 8 | Angara Cavern's stone door to Haurus's chamber, which takes the number of the exit it leads through. |
Definition at line 35 of file caverns.c.
anonymous enum
enum { DUST_DRAG_X, DUST_DRAG_Z }
A dust puff loses a DUST_DRAG_X-th of its speed east or west each tick, and a
DUST_DRAG_Z-th of its speed north or south.
| Enumerator | Value | Description |
|---|---|---|
DUST_DRAG_X | 12 | |
DUST_DRAG_Z | 10 |
Definition at line 290 of file caverns.c.
INDRA_CAVERN_ACTOR_ID
enum INDRA_CAVERN_ACTOR_ID
Indra Cavern's things: the post on the floor with the rope Lash throws, the post up on the east ledge it is tied to, and the stone pillar Move pushes across the gap between the ledges.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_LOWER_ROPE_POST | ACTOR_FIRST_PLACED | |
ACTOR_UPPER_ROPE_POST | ||
ACTOR_PILLAR |
Definition at line 505 of file caverns.c.
OSENIA_CAVERN_ACTOR_ID
enum OSENIA_CAVERN_ACTOR_ID
Osenia Cavern's one actor, the row of CavernsPlacements: an unseen marker
scCavernsWalkIntoPassage sets down by the hole as Felix climbs into it.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_PASSAGE_MARKER | ACTOR_FIRST_PLACED |
Definition at line 605 of file caverns.c.
ANGARA_CAVERN_ACTOR_ID
enum ANGARA_CAVERN_ACTOR_ID
Angara Cavern's things in Haurus's chamber, numbering AngaraCavernPlacements.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_FIRST_BLOCK | ACTOR_FIRST_PLACED | The two grey blocks carved with a |
ACTOR_SECOND_BLOCK | spiral, one on the floor and one up on the ledge, carried until one stands on top of the other. | |
ACTOR_WEST_CANDLESTICK | The lit candlesticks on either | |
ACTOR_EAST_CANDLESTICK | side of Haurus's tablet, which the searches for a block skip. |
Definition at line 754 of file caverns.c.
Functions in detail
scCavernsPlaceAngaraBlocks
void scCavernsPlaceAngaraBlocks(const Sint16 *data)
Nothing visible happens: Angara Cavern's two spiral blocks are made solid where they stand. The ground under each is raised by a block's height, two steps, and its metatile marked as one the leader jumps onto, so that Felix can climb onto a block and stand on it.
References fdActorGetById(), fdActorSetSpriteFlags(), fdCameraFollowActor(), fdMapGetTerrainHeight(), fdMapGridSetMetatileHeight(), MainRoutineStateWork, scMapMetatileGetAttributes(), scMapMetatileSetAttributes(), Sint32, syGameFlagGet() and sySynch().
Referenced by scCavernsInitAngara().
Definition at lines 63 and 128 of file caverns.c.
scCavernsPrepareOsenia
void scCavernsPrepareOsenia(void)
Osenia Cavern's map: once Scoop has dug it, the second hole stays open.
References fdScriptGetFlag(), scCavernsOpenOseniaPassage() and Sint32.
Referenced by scPrepareMap().
Definition at lines 64 and 613 of file caverns.c.
scCavernsPrepareAtteka
void scCavernsPrepareAtteka(void)
Atteka Cavern's map: once Parch has dried the pool, it stays dry.
References fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatilesTo(), fdScriptGetFlag() and Sint32.
Referenced by scPrepareMap().
Definition at lines 65 and 711 of file caverns.c.
scCavernsInitIndra
void scCavernsInitIndra(void)
Indra Cavern on entry: the rope lies by its post, or runs up to the ledge
once Lash has tied it (FLAG_INDRA_ROPE_TIED); the stone pillar stands still,
and its metatile is one the leader jumps onto.
References fdActorGetById(), fdMapCopyMetatileAttributeRect(), fdRopeInit(), fdRopePlace() and Sint32.
Referenced by scInit().
Definition at lines 66 and 515 of file caverns.c.
scCavernsPrepareAngara
void scCavernsPrepareAngara(void)
Angara Cavern's map: when the party arrives by entrance 5 or 6, the two staircases at metatiles (28, 5) and (36, 5) lead on by the exits of metatiles (28, 0) and (36, 0) instead of their own.
References fdMapCopyMetatileAttributeRect(), fdMapGridCopyMetatileAttributes() and MainRoutineStateWork.
Referenced by scPrepareMap().
Definition at lines 67 and 743 of file caverns.c.
scCavernsInitAngara
void scCavernsInitAngara(void)
Angara Cavern on entry: the two spiral blocks stand solid where they were left, are drawn over the ground's rises, and the tablet's candlesticks are left out of the search for a block to push.
References AngaraCavernBlocks, fdActorGetById() and scCavernsPlaceAngaraBlocks().
Referenced by scInit().
Definition at lines 68 and 770 of file caverns.c.
scCavernsJumpAcross
Bool scCavernsJumpAcross(ACTOR *actor, FIELD_COORDINATE *pos)
Jumps the leader across to the position given when nothing is in the way.
References fdActorMoveToAndWaitById(), fdActorSelectAnimation(), fdActorSetSpriteFlags(), fdMapGridCheckCollision(), fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptStart(), MainRoutineStateWork, Sint32, sySoundPlay() and sySynch().
Referenced by scCavernsJumpEastAcrossGap().
Definition at lines 70 and 550 of file caverns.c.
scGetEntrances
const SCENE_ENTRANCE *scGetEntrances(void)
References SceneEntrances.
Definition at line 89 of file caverns.c.
scGetExitRegions
const Sint16 *scGetExitRegions(void)
References MainRoutineStateWork, OseniaCavernRegions and result.
Definition at line 94 of file caverns.c.
scGetExits
const Uint32 *scGetExits(void)
References SceneExits.
Definition at line 103 of file caverns.c.
scGetActorPlacements
const ACTOR_PLACE *scGetActorPlacements(void)
References AngaraCavernPlacements, CavernsPlacements, IndraCavernPlacements, MainRoutineStateWork and Sint32.
Definition at line 108 of file caverns.c.
scCavernsGetLayer2Height
static __inline__ Sint32 scCavernsGetLayer2Height(Sint32 x, Sint32 z)
The terrain height of layer 2 at a point.
References fdMapGetTerrainHeight() and Sint32.
Definition at line 168 of file caverns.c.
scActorGetPixelZ
static __inline__ Sint32 scActorGetPixelZ(ACTOR *actor)
The whole pixels of an actor's z coordinate.
References Sint32.
Referenced by scCavernsShiftAngaraMetatileHeights().
Definition at line 174 of file caverns.c.
scCavernsShiftAngaraMetatileHeights
void scCavernsShiftAngaraMetatileHeights(Sint32 offset)
Nothing visible happens: while a spiral block moves, the floor around its
path in Angara's chamber is raised out of its way (offset 1) and lowered
back afterwards (-1), by eight steps: the two metatiles by the ledge while
the block is up on it, else the three metatiles of whichever of the two rows
the block is not in.
References fdScriptClearFlag(), fdScriptGetFlag(), fdScriptSetFlag(), scActorGetPixelZ() and Sint32.
Referenced by scCavernsFinishMovingAngaraBlock() and scCavernsStartMovingAngaraBlock().
Definition at line 195 of file caverns.c.
scCavernsStartMovingAngaraBlock
void scCavernsStartMovingAngaraBlock(void)
Nothing visible happens as Felix starts to push, Move or Carry one of the two spiral blocks in Angara Cavern's chamber: the game finds the block (the one ahead of him, or the one the Psynergy's hand holds) and lowers the ground under it back to the floor, so that the block can leave its metatile.
References AngaraCavernBlocks, fdActorGetById(), fdMapGetTerrainHeight(), fdMapGridSetMetatileHeight(), MainRoutineStateWork, scCavernsShiftAngaraMetatileHeights(), scMapMetatileSetAttributes(), Sint32 and syVectorAddPolarOffset().
Referenced by AngaraCavernCues.
Definition at line 236 of file caverns.c.
scCavernsDriftDust
void scCavernsDriftDust(FIELD_OBJECT *object)
One puff of the ring of dust a fallen block throws up: each tick it drifts outwards, slows, grows and spins.
Referenced by scCavernsFinishMovingAngaraBlock().
Definition at line 298 of file caverns.c.
scCavernsLayerLeaderByTopBlock
void scCavernsLayerLeaderByTopBlock(ACTOR *actor)
The block stacked on top of the other, each tick: Felix is drawn in front of it while he stands south of it, and behind it otherwise.
References fdActorGetById() and MainRoutineStateWork.
Referenced by scCavernsFinishMovingAngaraBlock().
Definition at line 314 of file caverns.c.
scCavernsFinishMovingAngaraBlock
void scCavernsFinishMovingAngaraBlock(void)
When a push, Move or Carry has finished moving one of the spiral blocks in Angara Cavern's chamber, a block left with no ground under it drops: onto the floor below with a thump and a ring of dust, or onto the other block, where it stays, the two stacked into a step up to Haurus's tablet. Then the ground under the block rises again so that it stands solid where it is. A block dropping onto a metatile that has a behaviour sinks out of sight instead, as a yellow block, and is gone.
References fdActorFindAtMetatile(), fdActorRelease(), fdMapGetTerrainHeight(), fdMapGridGetMetatileBehaviorAt(), fdMapGridSetMetatileHeight(), scActorWaitUntilLanded(), scCavernsDriftDust(), scCavernsLayerLeaderByTopBlock(), scCavernsShiftAngaraMetatileHeights(), scFieldEffectSpawn(), scMapMetatileGetAttributes(), scMapMetatileSetAttributes(), scPlaceTranslucentBlackActorFX(), Sint32, syCos(), syGameFlagSet(), syRandom(), sySin(), sySoundPlay() and sySynch().
Referenced by AngaraCavernCues.
Definition at line 336 of file caverns.c.
scGetCues
const CUE *scGetCues(void)
References AngaraCavernCues, AttekaCavernCues, IndraCavernCues, MainRoutineStateWork, OseniaCavernCues and Sint32.
Definition at line 459 of file caverns.c.
scInit
Sint32 scInit(void)
References MainRoutineStateWork, scCavernsInitAngara(), scCavernsInitIndra() and Sint32.
Definition at line 472 of file caverns.c.
scPrepareMap
Sint32 scPrepareMap(void)
References MainRoutineStateWork, scCavernsPrepareAngara(), scCavernsPrepareAtteka(), scCavernsPrepareOsenia() and Sint32.
Definition at line 483 of file caverns.c.
scCavernsMoveIndraPillar
void scCavernsMoveIndraPillar(Sint32 unused, Sint32 id)
Move on the stone pillar at the edge of the ledge by Zagan's tablet pushes it one metatile east into the gap; afterwards its new metatile is the one the leader jumps onto, and the metatiles it left are plain floor again.
References fdActorGetById(), fdMapCopyMetatileAttributeRect() and Sint32.
Referenced by IndraCavernCues.
Definition at line 536 of file caverns.c.
scCavernsJumpEastAcrossGap
void scCavernsJumpEastAcrossGap(void)
Walking east off the ledge by Zagan's tablet in Indra Cavern (metatile (12, 10)) makes Felix spring and leap two metatiles east over the gap, when nothing blocks where he would land.
References fdActorGetById(), MainRoutineStateWork, scCavernsJumpAcross() and Sint32.
Referenced by IndraCavernCues.
Definition at line 588 of file caverns.c.
scCavernsOpenOseniaPassage
void scCavernsOpenOseniaPassage(void)
Digs Osenia Cavern's second hole into the map: a hole and the metatiles around it, copied with their behaviours from a spare one beside the cave, over the sand in the pocket of rocks (metatiles (18, 12) to (20, 14)).
References fdMapGridCopyMetatileAttributes() and fdMapGridCopyMetatileTilesIndicesRect().
Referenced by scCavernsPrepareOsenia() and scCavernsScoopOseniaPassage().
Definition at lines 610 and 628 of file caverns.c.
scCavernsWalkIntoPassage
void scCavernsWalkIntoPassage(void)
Felix, over one of Osenia Cavern's two holes, turns his back and climbs down into it, and the screen leaves for the tunnel below: from the west hole to its west end, from the hole Scoop dug to its east end.
References fdActorFaceDirectionById(), fdActorGetById(), fdActorSetAnimationById(), fdActorSetDestinationOffsetById(), fdActorSetSpriteFlags(), fdActorWaitForMoveById(), fdMapGridCopyMetatilesTo(), fdScriptWait(), Sint32, syImportScriptSetExitRequest() and sySoundPlay().
Referenced by scCavernsWalkEastIntoPassage(), scCavernsWalkSouthIntoPassage() and scCavernsWalkWestIntoPassage().
Definition at line 639 of file caverns.c.
scCavernsWalkEastIntoPassage
void scCavernsWalkEastIntoPassage(void)
Walking east into one of Osenia Cavern's holes in the floor (metatile (8, 13), or (18, 13) once Scoop has dug the second) brings Felix round over the hole, and he climbs down into it to the tunnel below.
References fdActorWalkByAndWait(), fdActorWalkByAndWaitById(), fdScriptWait() and scCavernsWalkIntoPassage().
Referenced by OseniaCavernCues.
Definition at line 665 of file caverns.c.
scCavernsWalkWestIntoPassage
void scCavernsWalkWestIntoPassage(void)
Walking west into one of Osenia Cavern's holes in the floor (metatile (10, 13), or (20, 13) once Scoop has dug the second) brings Felix round over the hole, and he climbs down into it to the tunnel below.
References fdActorWalkByAndWait(), fdActorWalkByAndWaitById(), fdScriptWait() and scCavernsWalkIntoPassage().
Referenced by OseniaCavernCues.
Definition at line 677 of file caverns.c.
scCavernsWalkSouthIntoPassage
void scCavernsWalkSouthIntoPassage(void)
Walking south into one of Osenia Cavern's holes in the floor (metatile (9, 12), or (19, 12) once Scoop has dug the second) has Felix turn his back, as on a ladder, and climb down into it to the tunnel below.
References fdActorFaceDirectionById(), fdScriptWait() and scCavernsWalkIntoPassage().
Referenced by OseniaCavernCues.
Definition at line 689 of file caverns.c.
scCavernsScoopOseniaPassage
void scCavernsScoopOseniaPassage(Sint32 mode)
Scoop on the sand in the pocket of rocks east of Osenia Cavern's middle (metatile (19, 13)) digs a second hole there for good, the tunnel's way up to Megaera's side of the rocks.
References scCavernsOpenOseniaPassage(), Sint32 and syGameFlagSet().
Referenced by OseniaCavernCues.
Definition at line 700 of file caverns.c.
scCavernsParchAttekaWater
void scCavernsParchAttekaWater(void)
Parch on the green pool before Coatlicue's tablet in Atteka Cavern dries it up for good in a burst of heat and a white flash, opening the way to the tablet.
References fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatilesTo(), fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptStart() and syGameFlagSet().
Referenced by AttekaCavernCues.
Definition at line 728 of file caverns.c.
scCavernsOpenAngaraDoor
void scCavernsOpenAngaraDoor(void)
Walking north into the grey stone door at the west end of the small cave room in Angara Cavern (metatile (6, 32)) opens it, and the screen wipes to Haurus's chamber beyond.
References fdMapGridCopyMetatilesTo(), fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptStart(), fdScriptWait(), syImportScriptSetExitRequest() and sySoundPlay().
Referenced by AngaraCavernCues.
Definition at line 786 of file caverns.c.
Variables in detail
AngaraCavernBlocks
extern Sint16 AngaraCavernBlocks[]
Sint16 AngaraCavernBlocks[]
The spiral blocks of Angara Cavern's chamber, by actor id, ended by -1.
Referenced by scCavernsInitAngara() and scCavernsStartMovingAngaraBlock().
Definition at lines 53 and 803 of file caverns.c.
OseniaCavernRegions
extern Sint16 OseniaCavernRegions[]
Sint16 OseniaCavernRegions[]
Osenia Cavern's exit regions: the tunnel's two ends, climbed up to the west hole (exit 4) and to the one Scoop digs (exit 5).
Referenced by scGetExitRegions().
Definition at lines 54 and 820 of file caverns.c.
CavernsPlacements
extern ACTOR_PLACE CavernsPlacements[]
ACTOR_PLACE CavernsPlacements[]
Osenia and Atteka Caverns' actors: the passage marker.
Referenced by scGetActorPlacements().
Definition at lines 55 and 863 of file caverns.c.
IndraCavernPlacements
extern ACTOR_PLACE IndraCavernPlacements[]
ACTOR_PLACE IndraCavernPlacements[]
Indra Cavern's actors, in INDRA_CAVERN_ACTOR_ID's order.
Referenced by scGetActorPlacements().
Definition at lines 56 and 870 of file caverns.c.
AngaraCavernPlacements
extern ACTOR_PLACE AngaraCavernPlacements[]
ACTOR_PLACE AngaraCavernPlacements[]
Angara Cavern's actors, in ANGARA_CAVERN_ACTOR_ID's order.
Referenced by scGetActorPlacements().
Definition at lines 57 and 881 of file caverns.c.
OseniaCavernCues
extern CUE OseniaCavernCues[]
CUE OseniaCavernCues[]
Scoop on the sand where the second is dug.
References scCavernsScoopOseniaPassage(), scCavernsWalkEastIntoPassage(), scCavernsWalkSouthIntoPassage() and scCavernsWalkWestIntoPassage().
Referenced by scGetCues().
Definition at lines 58 and 896 of file caverns.c.
IndraCavernCues
extern CUE IndraCavernCues[]
CUE IndraCavernCues[]
Indra Cavern's exit, the ledge's edge by the gap, Lash on the rope post and Move on the pillar.
References scCavernsJumpEastAcrossGap() and scCavernsMoveIndraPillar().
Referenced by scGetCues().
Definition at lines 59 and 916 of file caverns.c.
AttekaCavernCues
extern CUE AttekaCavernCues[]
CUE AttekaCavernCues[]
Atteka Cavern's exit and Parch on its pool.
References scCavernsParchAttekaWater().
Referenced by scGetCues().
Definition at lines 60 and 927 of file caverns.c.
AngaraCavernCues
extern CUE AngaraCavernCues[]
CUE AngaraCavernCues[]
Angara Cavern's exits and stairs, its stone door, and pushing, Move and Carry on either spiral block until they are stacked.
References scCavernsFinishMovingAngaraBlock(), scCavernsOpenAngaraDoor() and scCavernsStartMovingAngaraBlock().
Referenced by scGetCues().
Definition at lines 61 and 936 of file caverns.c.
FieldEffectDurationScripts
const Sint32 *FieldEffectDurationScripts[]
References FieldEffectLongScript, FieldEffectMediumScript, FieldEffectShortScript and Sint32.
Referenced by fdEffectSpawnResident(), scFieldEffectSpawn() and scFieldEffectSpawnLocal().
Definition at line 807 of file caverns.c.
SceneEntrances
SCENE_ENTRANCE SceneEntrances[]
Referenced by scGetEntrances().
Definition at line 813 of file caverns.c.
SceneExits
Uint32 SceneExits[]
Referenced by scGetExits().
Definition at line 826 of file caverns.c.