src/scene/yampi_desert_cave.c
The Yampi Desert Cave, the hidden dungeon behind the desert's sand slide: a Teleport circle leads on from the room the party comes in by, and in the rooms beyond the party pushes logs, sinks a stake with Pound, bursts pillars, slips under walls with Sand, Scoops up the Venus Djinni Crystal racing through the sand, and meets Valukar, the guardian of fire.
#include "macros.h"#include "edition.h"#include "field/actor_script.h"#include "field/script_inline.h"#include "field/field_engine.h"#include "field/field_engine_script.h"#include "game/game.h"#include "graphics/palette_buffers.h"#include "scene/scene.h"#include "text/msg_ids.h"#include "scene/pushed_actor.h"#include "shared/map_metatile_fill.c"#include "shared/teleport_shimmer.c"#include "shared/pillar_place.c"#include "shared/pound_sink_target.c"#include "shared/actor_set_metatile_open.c"#include "shared/push_kinds.c"#include "shared/push_leader_steps.c"#include "shared/teleport_circle_palette.c"#include "shared/scene_entrances_default.c"
Structures
| Name | Description | |
|---|---|---|
struct | LOG_ROLL | Where a pushed log comes to rest, found before the leader pushes it. |
Macros
| Name | Description | |
|---|---|---|
#define | FLAG_YAMPI_DESERT_CAVE_ENTRANCE_PILLAR_BURST FLAG_AREA_TEMP(0x00) | Set once Burst has broken the pillar in the entrance. |
#define | FLAG_YAMPI_DESERT_CAVE_CRYSTAL_ROOM_PILLAR_BURST FLAG_AREA_TEMP(0x01) | Set once Burst has broken the pillar in Crystal's room. |
#define | FLAG_YAMPI_DESERT_CAVE_MYTHRIL_SILVER_DUG_UP FLAG_AREA_TEMP(0x02) | Set once Scoop has dug up the Mythril Silver in Valukar's room. |
#define | FLAG_YAMPI_DESERT_CAVE_GUARDIAN_PILLAR_MOVED FLAG_AREA_TEMP(0x03) | Set as Move leaves each pillar where it opens the way: Valukar's room's, and Crystal's room's west and east pillars. |
#define | FLAG_YAMPI_DESERT_CAVE_WEST_PILLAR_MOVED FLAG_AREA_TEMP(0x04) | |
#define | FLAG_YAMPI_DESERT_CAVE_EAST_PILLAR_MOVED FLAG_AREA_TEMP(0x05) | |
#define | FLAG_YAMPI_DESERT_CAVE_STAKE_POUNDED FLAG_SCENE_TEMP(0x06) | Set once Pound has sunk the stake in Crystal's room. |
#define | FLAG_YAMPI_DESERT_CAVE_RIPPLE_RUNNING FLAG_SCENE_TEMP(0x70) | Set while the sand ripple runs, the Djinni Crystal racing under it. |
#define | FLAG_YAMPI_DESERT_CAVE_CRYSTAL_DUG_UP FLAG_SCENE_TEMP(0x71) | Set once Scoop has dug Crystal out of the sand. |
#define | FLAG_BYTE_YAMPI_DESERT_CAVE_RIPPLE_STEP FLAG_SCENE_TEMP(0x78) | The ripple's step count, the byte of flags from FLAG_SCENE_TEMP(0x78): each RIPPLE_STEPS_PER_POINT steps it moves on one point of YampiDesertCaveRipplePath. |
#define | RIPPLE_STEPS_PER_POINT 32 | The steps the ripple takes at each point of its path. |
#define | FLAG_VALUKAR_BEATEN 0x9cd | Set once Valukar, the guardian of fire, has been beaten; he is gone. |
#define | DEFINE_TELEPORT_FROM_CIRCLE (name, entrance) | Teleport on one of the entrance's circles: the circle shimmers and the party arrives on the other, by its entrance. |
#define | DEFINE_BURST_PILLAR (name, flag, actorId) | Burst breaks a pillar for good (flag) with its last and largest blast. |
#define | TELEPORT_CIRCLE_FIRST_ENTRY 9 |
Enumerations
| Name | Description | |
|---|---|---|
enum | YAMPI_DESERT_CAVE_ENTRANCE_ACTOR_ID { ACTOR_ENTRANCE_FIRST_LOG, ACTOR_ENTRANCE_SECOND_LOG, ACTOR_E … } | The entrance's actors (SceneIdYampiDesertCaveEntrance), the rows of YampiDesertCavePlacements. |
enum | YAMPI_DESERT_CAVE_TELEPORT_CIRCLE { NORTH_CIRCLE_METATILES, SOUTH_CIRCLE_METATILES, NORTH_CIRCLE … } | The entrance's two Teleport circles, the north one where the party comes in from the desert and the south one: the collision code of each circle's metatiles, and the entrance on it. |
enum | YAMPI_DESERT_CAVE_WAY { ENTRANCE_MIDDLE_PASSAGE, ENTRANCE_WEST_PASSAGE, ENTRANCE_NOR … } | The ways between two parts of one room: each leads to its partner's entrance and back. |
enum | YAMPI_DESERT_CAVE_METATILE { METATILE_AROUND_LOG, METATILE_BURST_PILLAR, METATILE_RIPPLE_ … } | The metatiles the rooms' cue tables answer, by the behaviour the maps give them: round the logs, the entrance's pillar Burst breaks, the stretch of sand in Crystal's room the ripple races over (metatiles (46, 14) on, which Burst and Scoop both answer on), before Valukar, and over the buried Mythril Silver. |
enum | YAMPI_DESERT_CAVE_GUARDIAN_ACTOR_ID { ACTOR_GUARDIAN_ROOM_PILLAR, ACTOR_VALUKAR } | Valukar's room's actors (SceneIdYampiDesertCaveGuardian). |
enum | YAMPI_DESERT_CAVE_CRYSTAL_ACTOR_ID { ACTOR_CRYSTAL_ROOM_FIRST_LOG, ACTOR_CRYSTAL_ROOM_SECOND_LOG, … } | Crystal's room's actors (SceneIdYampiDesertCaveCrystal). |
enum | anonymous enum { ACTOR_MYTHRIL_SILVER } | The Mythril Silver buried in Valukar's room, its first scene item's treasure spot. |
Functions
| Name | Description | |
|---|---|---|
void | scYampiDesertCaveStopLeaderAtLog (ACTOR *actor) | The leader's update while pushing: it stops at a wall or another log. |
void | scTeleportArriveWhirling (void) | The party arrives by Teleport on the circle: the room fades in grey while the circle shimmers and the whirl plays, then its colours come back. |
void | scYampiDesertCaveFightCrystal (void) | Talking to Crystal, the Venus Djinni Scoop has dug out of the sand, starts its battle. |
void | scYampiDesertCaveWonderAtRipple (void) | Talking to the ripple racing through the sand of Crystal's room only puts a question mark over Felix's head. |
void | scYampiDesertCaveTryPushLog (void) | Walking against one of the logs lying in the inner cave or in Crystal's room pushes it, and it rolls on until it meets a wall or another log. |
void | scYampiDesertCaveTeleportFromNorthCircle (void) | Teleport cast on the pale carved circle in the small round chamber at the north of the cave's first room (metatiles (14, 7) to (17, 9)) makes the circle shimmer and carries the party to the circle in the inner cave. |
void | scYampiDesertCaveTeleportFromSouthCircle (void) | Teleport cast on the carved circle in the inner cave (metatiles (21, 56) to (24, 58)) makes it shimmer and carries the party back to the circle in the small chamber of the cave's first room, near the Water of Life's chest. |
void | scYampiDesertCaveCastSand (void) | As Sand melts Felix into the sand, the ways only a sunk Felix can take open in the entrance and in Crystal's room. |
void | scYampiDesertCaveEndSand (void) | As Sand fades and Felix rises out of the sand, those ways close again. |
BSS_DATA | ALIGNED (4) | The blend of one turn of the two maps' alternation in the throne room, a step every four ticks: the first map fades up and down, then the second. |
Bool | scYampiDesertCaveSetLogMetatiles (Sint32 id) | Makes a log's metatiles solid where it lies: its rectangle's metatiles take the raised layers' attributes and block the ground; returns 0 for an actor that is no log. |
ACTOR * | scYampiDesertCaveFindPushedLog (Sint32 *direction, Sint32 *slot, Sint32 *kind) | Finds the log the leader faces and can push: its kind, its actor slot and the direction, or NULL. |
static inline Sint32 | scFieldActorCheckMovementCollision (ACTOR *actor, Sint32 *pos) | What fdMapGridCheckCollision says of a step to a position, under the name The Broken Seal's system_call.h gives it. |
Bool | scYampiDesertCaveFindLogRoll (LOG_ROLL *roll) | Finds how far a pushed object can roll in the leader's direction, probing its rectangle metatile by metatile until fdMapGridCheckCollision reports a wall. |
void | scYampiDesertCavePushLog (LOG_ROLL roll) | The leader pushes a log to where scYampiDesertCaveFindLogRoll stopped it, and its metatiles move with it. |
void | scTeleportStartShimmer (void) | Starts the shimmer at its slow pace, as Teleport is cast: the first step after 16 ticks, each after a tick less, down to two. |
void | scTeleportStopShimmer (void) | Stops the shimmer, leaving the next transition a backdrop fade. |
Sint32 | scListCountEntries (Uint16 *list) | The number of entries in a list of palette slots ended by PALETTE_LIST_END, less one. |
void | fdPaletteCycleFade (void) | Steps a palette cycle that fades as it slows. |
void | fdPoundSinkTarget (Uint16 *list, Sint32 mode, Sint32 count) | Pound's state on a listed actor, an entry of (actor, kind, flag) ended by ACTOR_LIST_END: while it is the target, it sinks a step a tick for the first eight ticks, and once the fist has landed (POUND_STAGE_LANDED) its flag is set and its metatile opened. |
void | fdTeleportPlaySparks (void) | The leaving half of a teleport, fdTeleportPlayWhirl's companion in the same scenes: the leader raises both arms in changing colours, spins faster and faster as sparks burst from it, shrinks away and is hidden. |
void | fdActorSetMetatileOpen (Sint32 id, Uint32 kind, Sint32 flag, Sint32 layer) | A stake as its flag leaves it: driven down by Pound, its metatile is open ground and it is drawn underfoot, sunk to its top; still standing, its metatile is a wall. |
const SCENE_ENTRANCE * | scGetEntrances (void) | Where the party can enter: the cave under the spring has its own entrances. |
const SCENE_REGION * | 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. |
DEFINE_BURST_PILLAR( | scYampiDesertCaveBurstEntrancePillar , FLAG_YAMPI_DESERT_CAVE_ENTRANCE_PILLAR_BURST, ACTOR_ENTRANCE_BURST_PILLAR) | Burst on the entrance's pillar breaks it for good. |
DEFINE_BURST_PILLAR( | scYampiDesertCaveBurstCrystalRoomPillar , FLAG_YAMPI_DESERT_CAVE_CRYSTAL_ROOM_PILLAR_BURST, ACTOR_CRYSTAL_ROOM_BURST_PILLAR) | Burst on the pillar in Crystal's room breaks it for good. |
void | scYampiDesertCaveStartMovingPillar (Sint32 unused, Sint32 id) | Move takes a pillar: the metatiles it stood on open, as the room has them without it. |
void | scYampiDesertCaveFinishMovingPillar (Sint32 unused, Sint32 id) | Move sets a pillar down: where it opens the way it stays for good, and the metatiles under it close again. |
void | scYampiDesertCavePoundStake (Sint32 mode, Sint32 count) | Pound on the wooden stake in Crystal's room hammers it into the ground and opens the way past it. |
void | scYampiDesertCaveMoveSandRipple (void) | Moves the ripple along its path, a row of YampiDesertCaveRipplePath for every RIPPLE_STEPS_PER_POINT steps of its counter, which counts on while the player has control, whether the party walks or stands. |
void | scYampiDesertCaveScoopDjinni (Sint32 mode) | Scoop cast right beside the ripple racing through the sand of Crystal's room stops it and digs up Crystal, the Venus Djinni, who drops to the ground. |
void | scYampiDesertCaveMeetGuardianOfFire (void) | Stepping up to Valukar in his chamber (metatiles (11, 11) to (13, 11)), the screen glows warm as he says "I am the guardian of fire. |
void | scYampiDesertCaveDigUpMythrilSilver (Sint32 mode) | Scoop at the west end of a passage in the part of the inner cave below Valukar's chamber (metatile (5, 38)) digs up the Mythril Silver: "Felix got some Mythril Silver." |
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) | Sets up Yampi Desert Cave's three rooms as each one loads: the first room's palette cycle and Retreat destination, the third room's background priorities, and in each room the objects its flags place. |
Sint32 | scPrepareMap (void) | Once Briggs is caught the pool has dried up: its colours take the dry ground's. |
Variables
| Name | Description | |
|---|---|---|
extern Uint16 | PushKinds [] | The sprites of the things pushed: a log, a pipe and a fallen column, each lying west to east and north to south. |
extern Uint16 | TeleportCircleShimmerSlots [] | The shimmer's six steps: for each, the entries its colours go to. |
extern Uint32 | YampiDesertCaveSettle [] | A pushed pillar or stake stands still where it was placed. |
Uint16 | PaletteCycleBright | The Teleport circles' shimmer (shared/teleport_shimmer.c). |
Uint16 | PaletteCycleTimer | |
Uint16 | PaletteCycleDelay | |
extern Sint8 | PushRectangles [][4] | Each kind's rectangle: its corners from the actor, x and z in pixels (scPushTargetFillRectangle). |
extern Sint32 | PushLeaderSteps [] | One metatile along each facing's nearest direction (PUSH_STEP). |
extern ACTOR_PLACE | YampiDesertCavePlacements [] | The entrance: three logs and the pillar Burst breaks. |
extern ACTOR_PLACE | YampiDesertCaveGuardianPlacements [] | Valukar's room: the pillar Move pushes, and Valukar until he is beaten. |
extern ACTOR_PLACE | YampiDesertCaveCrystalPlacements [] | Crystal's room, in YAMPI_DESERT_CAVE_CRYSTAL_ACTOR_ID order. |
extern Uint16 | YampiDesertCaveCrystalStakes [] | The stake Pound sinks in Crystal's room: its actor, its kind and the flag set once it is sunk, as fdPoundSinkTarget reads them. |
extern CUE | YampiDesertCaveCues [] | |
extern CUE | YampiDesertCaveGuardianCues [] | |
extern CUE | YampiDesertCaveCrystalCues [] | |
extern Sint16 | YampiDesertCaveRipplePath [] | The ripple's path, a column and a row in half metatiles (8 pixels) for each RIPPLE_STEPS_PER_POINT steps: it shows at four places in turn, and between them lies at the origin, out of sight. |
extern Uint16 | TeleportCirclePaletteSlots [] | The entries the circle is drawn in. |
extern Uint16 | TeleportCircleColors [] | The circle's colours: one pale grey-green on every entry. |
extern Uint16 | TeleportCircleShimmerColors [] | The shimmer's colours, which it moves round the entries: lilac, blues deepening to violet, and white. |
Uint32 | SceneExits [] | The room has no exits of its own. |
Description
The Yampi Desert Cave, the hidden dungeon behind the desert's sand slide: a Teleport circle leads on from the room the party comes in by, and in the rooms beyond the party pushes logs, sinks a stake with Pound, bursts pillars, slips under walls with Sand, Scoops up the Venus Djinni Crystal racing through the sand, and meets Valukar, the guardian of fire.
Macros in detail
FLAG_YAMPI_DESERT_CAVE_ENTRANCE_PILLAR_BURST
#define FLAG_YAMPI_DESERT_CAVE_ENTRANCE_PILLAR_BURST FLAG_AREA_TEMP(0x00)
Set once Burst has broken the pillar in the entrance.
Referenced by scInit().
Definition at line 20 of file yampi_desert_cave.c.
FLAG_YAMPI_DESERT_CAVE_CRYSTAL_ROOM_PILLAR_BURST
#define FLAG_YAMPI_DESERT_CAVE_CRYSTAL_ROOM_PILLAR_BURST FLAG_AREA_TEMP(0x01)
Set once Burst has broken the pillar in Crystal's room.
Referenced by scInit().
Definition at line 22 of file yampi_desert_cave.c.
FLAG_YAMPI_DESERT_CAVE_MYTHRIL_SILVER_DUG_UP
#define FLAG_YAMPI_DESERT_CAVE_MYTHRIL_SILVER_DUG_UP FLAG_AREA_TEMP(0x02)
Set once Scoop has dug up the Mythril Silver in Valukar's room.
Referenced by scInit() and scYampiDesertCaveDigUpMythrilSilver().
Definition at line 24 of file yampi_desert_cave.c.
FLAG_YAMPI_DESERT_CAVE_GUARDIAN_PILLAR_MOVED
#define FLAG_YAMPI_DESERT_CAVE_GUARDIAN_PILLAR_MOVED FLAG_AREA_TEMP(0x03)
Set as Move leaves each pillar where it opens the way: Valukar's room's, and Crystal's room's west and east pillars.
Referenced by scInit() and scYampiDesertCaveFinishMovingPillar().
Definition at line 27 of file yampi_desert_cave.c.
FLAG_YAMPI_DESERT_CAVE_WEST_PILLAR_MOVED
#define FLAG_YAMPI_DESERT_CAVE_WEST_PILLAR_MOVED FLAG_AREA_TEMP(0x04)
Referenced by scInit() and scYampiDesertCaveFinishMovingPillar().
Definition at line 28 of file yampi_desert_cave.c.
FLAG_YAMPI_DESERT_CAVE_EAST_PILLAR_MOVED
#define FLAG_YAMPI_DESERT_CAVE_EAST_PILLAR_MOVED FLAG_AREA_TEMP(0x05)
Referenced by scInit() and scYampiDesertCaveFinishMovingPillar().
Definition at line 29 of file yampi_desert_cave.c.
FLAG_YAMPI_DESERT_CAVE_STAKE_POUNDED
#define FLAG_YAMPI_DESERT_CAVE_STAKE_POUNDED FLAG_SCENE_TEMP(0x06)
Set once Pound has sunk the stake in Crystal's room.
Referenced by scInit().
Definition at line 31 of file yampi_desert_cave.c.
FLAG_YAMPI_DESERT_CAVE_RIPPLE_RUNNING
#define FLAG_YAMPI_DESERT_CAVE_RIPPLE_RUNNING FLAG_SCENE_TEMP(0x70)
Set while the sand ripple runs, the Djinni Crystal racing under it.
Referenced by scInit() and scYampiDesertCaveScoopDjinni().
Definition at line 33 of file yampi_desert_cave.c.
FLAG_YAMPI_DESERT_CAVE_CRYSTAL_DUG_UP
#define FLAG_YAMPI_DESERT_CAVE_CRYSTAL_DUG_UP FLAG_SCENE_TEMP(0x71)
Set once Scoop has dug Crystal out of the sand.
Referenced by scInit() and scYampiDesertCaveFightCrystal().
Definition at line 35 of file yampi_desert_cave.c.
FLAG_BYTE_YAMPI_DESERT_CAVE_RIPPLE_STEP
#define FLAG_BYTE_YAMPI_DESERT_CAVE_RIPPLE_STEP FLAG_SCENE_TEMP(0x78)
The ripple's step count, the byte of flags from FLAG_SCENE_TEMP(0x78): each
RIPPLE_STEPS_PER_POINT steps it moves on one point of
YampiDesertCaveRipplePath.
Referenced by scInit(), scYampiDesertCaveMoveSandRipple() and scYampiDesertCaveScoopDjinni().
Definition at line 39 of file yampi_desert_cave.c.
RIPPLE_STEPS_PER_POINT
#define RIPPLE_STEPS_PER_POINT 32
The steps the ripple takes at each point of its path.
Referenced by scInit(), scYampiDesertCaveMoveSandRipple() and scYampiDesertCaveScoopDjinni().
Definition at line 41 of file yampi_desert_cave.c.
FLAG_VALUKAR_BEATEN
#define FLAG_VALUKAR_BEATEN 0x9cd
Set once Valukar, the guardian of fire, has been beaten; he is gone.
Referenced by scYampiDesertCaveMeetGuardianOfFire() and YampiDesertCaveGuardianPlacements.
Definition at line 44 of file yampi_desert_cave.c.
DEFINE_TELEPORT_FROM_CIRCLE
#define DEFINE_TELEPORT_FROM_CIRCLE(name, entrance)
Teleport on one of the entrance's circles: the circle shimmers and the party arrives on the other, by its entrance.
Definition at line 607 of file yampi_desert_cave.c.
DEFINE_BURST_PILLAR
#define DEFINE_BURST_PILLAR(name, flag, actorId)
Burst breaks a pillar for good (flag) with its last and largest blast.
Definition at line 631 of file yampi_desert_cave.c.
TELEPORT_CIRCLE_FIRST_ENTRY
#define TELEPORT_CIRCLE_FIRST_ENTRY 9
Definition at line 1102 of file yampi_desert_cave.c.
Enumerations in detail
YAMPI_DESERT_CAVE_ENTRANCE_ACTOR_ID
enum YAMPI_DESERT_CAVE_ENTRANCE_ACTOR_ID
The entrance's actors (SceneIdYampiDesertCaveEntrance), the rows of
YampiDesertCavePlacements.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_ENTRANCE_FIRST_LOG | ACTOR_FIRST_PLACED | The three fallen columns pushed as logs (PushKinds). |
ACTOR_ENTRANCE_SECOND_LOG | ||
ACTOR_ENTRANCE_THIRD_LOG | ||
ACTOR_ENTRANCE_BURST_PILLAR | The pillar Burst breaks (SPRITE_BURST_PILLAR). |
Definition at line 48 of file yampi_desert_cave.c.
YAMPI_DESERT_CAVE_TELEPORT_CIRCLE
enum YAMPI_DESERT_CAVE_TELEPORT_CIRCLE
The entrance's two Teleport circles, the north one where the party comes in from the desert and the south one: the collision code of each circle's metatiles, and the entrance on it. Each circle sends the party to the other.
| Enumerator | Value | Description |
|---|---|---|
NORTH_CIRCLE_METATILES | 30 | |
SOUTH_CIRCLE_METATILES | 31 | |
NORTH_CIRCLE_ENTRANCE | 9 | |
SOUTH_CIRCLE_ENTRANCE | 10 |
Definition at line 61 of file yampi_desert_cave.c.
YAMPI_DESERT_CAVE_WAY
enum YAMPI_DESERT_CAVE_WAY
The ways between two parts of one room: each leads to its partner's entrance and back.
| Enumerator | Value | Description |
|---|---|---|
ENTRANCE_MIDDLE_PASSAGE | 3 | The entrance: the middle and west passages north out of its south part, to the south-east and south-west feet of its north part. |
ENTRANCE_WEST_PASSAGE | 4 | |
ENTRANCE_NORTH_PART_WEST_FOOT | 5 | |
ENTRANCE_NORTH_PART_EAST_FOOT | 6 | |
GUARDIAN_SOUTH_CAVE_STAIRS | 2 | Valukar's rooms: the stairs |
GUARDIAN_LADDER_ROOM_STAIRS | 17 | down in the north wall of the south cave, to the stairs up at the north-east of the room with the ladder. |
CRYSTAL_LADDER_ROOM_WEST_DOORWAY | 2 | Crystal's rooms: the west doorway of the room with the ladder and the chest, to the foot of the room of fallen columns; that room's north doorway and its doorway on the ledge, to the north-west room's south-east foot and the north-east room's east end; the north-east room's north doorway, to the north-west room's south-west foot. |
CRYSTAL_LOG_ROOM_FOOT | 3 | |
CRYSTAL_LOG_ROOM_NORTH_DOORWAY | 4 | |
CRYSTAL_LOG_ROOM_LEDGE_DOORWAY | 5 | |
CRYSTAL_NORTHEAST_ROOM_EAST_END | 6 | |
CRYSTAL_NORTHWEST_ROOM_EAST_FOOT | 7 | |
CRYSTAL_NORTHEAST_ROOM_NORTH_DOORWAY | 9 | |
CRYSTAL_NORTHWEST_ROOM_WEST_FOOT | 10 |
Definition at line 71 of file yampi_desert_cave.c.
YAMPI_DESERT_CAVE_METATILE
enum YAMPI_DESERT_CAVE_METATILE
The metatiles the rooms' cue tables answer, by the behaviour the maps give them: round the logs, the entrance's pillar Burst breaks, the stretch of sand in Crystal's room the ripple races over (metatiles (46, 14) on, which Burst and Scoop both answer on), before Valukar, and over the buried Mythril Silver.
| Enumerator | Value | Description |
|---|---|---|
METATILE_AROUND_LOG | 42 | |
METATILE_BURST_PILLAR | 33 | |
METATILE_RIPPLE_SAND | 33 | |
METATILE_BEFORE_VALUKAR | 52 | |
METATILE_MYTHRIL_SILVER | 100 |
Definition at line 105 of file yampi_desert_cave.c.
YAMPI_DESERT_CAVE_GUARDIAN_ACTOR_ID
enum YAMPI_DESERT_CAVE_GUARDIAN_ACTOR_ID
Valukar's room's actors (SceneIdYampiDesertCaveGuardian).
| Enumerator | Value | Description |
|---|---|---|
ACTOR_GUARDIAN_ROOM_PILLAR | ACTOR_FIRST_PLACED | The stone pillar Move pushes (SPRITE_STONE_PILLAR). |
ACTOR_VALUKAR | Valukar, the guardian of fire: "I am the..." (MsgIAmThe). |
Definition at line 115 of file yampi_desert_cave.c.
YAMPI_DESERT_CAVE_CRYSTAL_ACTOR_ID
enum YAMPI_DESERT_CAVE_CRYSTAL_ACTOR_ID
Crystal's room's actors (SceneIdYampiDesertCaveCrystal).
| Enumerator | Value | Description |
|---|---|---|
ACTOR_CRYSTAL_ROOM_FIRST_LOG | ACTOR_FIRST_PLACED | |
ACTOR_CRYSTAL_ROOM_SECOND_LOG | ||
ACTOR_CRYSTAL_ROOM_THIRD_LOG | ||
ACTOR_CRYSTAL_ROOM_FOURTH_LOG | ||
ACTOR_EAST_PILLAR | The two stone pillars Move pushes, east | |
ACTOR_WEST_PILLAR | and west. | |
ACTOR_STAKE | The stake Pound sinks. | |
ACTOR_CRYSTAL_ROOM_BURST_PILLAR | The pillar Burst breaks. | |
ACTOR_SAND_RIPPLE | The ripple of sand the Djinni Crystal races under (scYampiDesertCaveWonderAtRipple). | |
ACTOR_CRYSTAL | Crystal, the Venus Djinni, dug out of the sand (scYampiDesertCaveFightCrystal). |
Definition at line 126 of file yampi_desert_cave.c.
anonymous enum
enum { ACTOR_MYTHRIL_SILVER }
The Mythril Silver buried in Valukar's room, its first scene item's treasure spot.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_MYTHRIL_SILVER | FIELD_TREASURE_ACTOR |
Definition at line 147 of file yampi_desert_cave.c.
Functions in detail
scYampiDesertCaveStopLeaderAtLog
void scYampiDesertCaveStopLeaderAtLog(ACTOR *actor)
The leader's update while pushing: it stops at a wall or another log.
References fdActorFindAtMetatile(), fdActorSetPosAndResetMotion(), fdMapGridCheckCollision(), PushKinds, Sint32 and syVectorAddPolarOffset().
Referenced by scYampiDesertCavePushLog().
Definition at lines 154 and 510 of file yampi_desert_cave.c.
scYampiDesertCaveFightCrystal
void scYampiDesertCaveFightCrystal(void)
Talking to Crystal, the Venus Djinni Scoop has dug out of the sand, starts its battle.
References fdScriptRequestDjinnBattle() and fdScriptSetFlag().
Definition at lines 157 and 555 of file yampi_desert_cave.c.
scYampiDesertCaveWonderAtRipple
void scYampiDesertCaveWonderAtRipple(void)
Talking to the ripple racing through the sand of Crystal's room only puts a question mark over Felix's head.
References fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptStart(), MainRoutineStateWork and scFieldActorShowEmote().
Definition at lines 158 and 563 of file yampi_desert_cave.c.
scYampiDesertCaveTryPushLog
void scYampiDesertCaveTryPushLog(void)
Walking against one of the logs lying in the inner cave or in Crystal's room pushes it, and it rolls on until it meets a wall or another log.
References scYampiDesertCaveFindLogRoll() and scYampiDesertCavePushLog().
Definition at lines 162 and 597 of file yampi_desert_cave.c.
scYampiDesertCaveTeleportFromNorthCircle
void scYampiDesertCaveTeleportFromNorthCircle(void)
DEFINE_TELEPORT_FROM_CIRCLE(scYampiDesertCaveTeleportFromNorthCircle, SOUTH_CIRCLE_ENTRANCE)
Teleport cast on the pale carved circle in the small round chamber at the north of the cave's first room (metatiles (14, 7) to (17, 9)) makes the circle shimmer and carries the party to the circle in the inner cave.
Definition at lines 164 and 621 of file yampi_desert_cave.c.
scYampiDesertCaveTeleportFromSouthCircle
void scYampiDesertCaveTeleportFromSouthCircle(void)
DEFINE_TELEPORT_FROM_CIRCLE(scYampiDesertCaveTeleportFromSouthCircle, NORTH_CIRCLE_ENTRANCE)
Teleport cast on the carved circle in the inner cave (metatiles (21, 56) to (24, 58)) makes it shimmer and carries the party back to the circle in the small chamber of the cave's first room, near the Water of Life's chest.
Definition at lines 165 and 627 of file yampi_desert_cave.c.
scYampiDesertCaveCastSand
void scYampiDesertCaveCastSand(void)
As Sand melts Felix into the sand, the ways only a sunk Felix can take open in the entrance and in Crystal's room.
References fdActorGetById(), fdMapGridCopyMetatileAttributes() and MainRoutineStateWork.
Definition at lines 166 and 742 of file yampi_desert_cave.c.
scYampiDesertCaveEndSand
void scYampiDesertCaveEndSand(void)
As Sand fades and Felix rises out of the sand, those ways close again.
References fdActorGetById(), fdMapGridCopyMetatileAttributes() and MainRoutineStateWork.
Definition at lines 167 and 763 of file yampi_desert_cave.c.
scYampiDesertCaveSetLogMetatiles
Bool scYampiDesertCaveSetLogMetatiles(Sint32 id)
Makes a log's metatiles solid where it lies: its rectangle's metatiles take the raised layers' attributes and block the ground; returns 0 for an actor that is no log.
References fdActorGetById(), fdMapGridCopyMetatileAttributes(), PushKinds, PushRectangles, scMapGridFillCollisionRectangle() and Sint32.
Referenced by scInit().
Definition at line 187 of file yampi_desert_cave.c.
scYampiDesertCaveFindPushedLog
ACTOR * scYampiDesertCaveFindPushedLog(Sint32 *direction, Sint32 *slot, Sint32 *kind)
Finds the log the leader faces and can push: its kind, its actor slot and the
direction, or NULL.
References fdActorGetById(), MainRoutineStateWork, PushKinds, PushLeaderSteps, PushRectangles and Sint32.
Referenced by scYampiDesertCaveFindLogRoll().
Definition at lines 245 and 319 of file yampi_desert_cave.c.
scFieldActorCheckMovementCollision
static inline Sint32 scFieldActorCheckMovementCollision(ACTOR *actor, Sint32 *pos)
What fdMapGridCheckCollision says of a step to a position, under the name The
Broken Seal's system_call.h gives it.
References fdMapGridCheckCollision() and Sint32.
Referenced by scPushTargetFindStop() and scYampiDesertCaveFindLogRoll().
Definition at line 250 of file yampi_desert_cave.c.
scYampiDesertCaveFindLogRoll
Bool scYampiDesertCaveFindLogRoll(LOG_ROLL *roll)
Finds how far a pushed object can roll in the leader's direction, probing its
rectangle metatile by metatile until fdMapGridCheckCollision reports a wall.
Returns 1 with the log's end position in roll, or 0 if it cannot move.
References PushLeaderSteps, PushRectangles, scFieldActorCheckMovementCollision(), scYampiDesertCaveFindPushedLog() and Sint32.
Referenced by scYampiDesertCaveTryPushLog().
Definition at lines 259 and 384 of file yampi_desert_cave.c.
scYampiDesertCavePushLog
void scYampiDesertCavePushLog(LOG_ROLL roll)
The leader pushes a log to where scYampiDesertCaveFindLogRoll stopped it, and
its metatiles move with it.
References fdActorGetById(), fdActorSelectAnimation(), fdActorSetAnimation(), fdActorSetDestinationOffset(), fdActorSetMoveTarget(), fdActorSetPosAndResetMotion(), fdActorWaitForMoveById(), fdMapGridCopyMetatileAttributes(), fdScriptNoOperation(), fdScriptPlaySound(), MainRoutineStateWork, PushLeaderSteps, PushRectangles, scFieldActorWaitForMove(), scMapGridFillCollisionRectangle(), scYampiDesertCaveStopLeaderAtLog(), Sint32 and sySynch().
Referenced by scYampiDesertCaveTryPushLog().
Definition at lines 387 and 395 of file yampi_desert_cave.c.
scGetEntrances
const SCENE_ENTRANCE *scGetEntrances(void)
References SceneEntrances.
Definition at line 573 of file yampi_desert_cave.c.
scGetExitRegions
const SCENE_REGION *scGetExitRegions(void)
Definition at line 578 of file yampi_desert_cave.c.
scGetExits
const Uint32 *scGetExits(void)
References SceneExits.
Definition at line 583 of file yampi_desert_cave.c.
scGetActorPlacements
const ACTOR_PLACE *scGetActorPlacements(void)
References MainRoutineStateWork, YampiDesertCaveCrystalPlacements, YampiDesertCaveGuardianPlacements and YampiDesertCavePlacements.
Definition at line 588 of file yampi_desert_cave.c.
scYampiDesertCaveBurstEntrancePillar
DEFINE_BURST_PILLAR(scYampiDesertCaveBurstEntrancePillar, FLAG_YAMPI_DESERT_CAVE_ENTRANCE_PILLAR_BURST, ACTOR_ENTRANCE_BURST_PILLAR)
Burst on the entrance's pillar breaks it for good. The pillar is taken away
and FLAG_YAMPI_DESERT_CAVE_ENTRANCE_PILLAR_BURST is set.
Definition at line 643 of file yampi_desert_cave.c.
scYampiDesertCaveBurstCrystalRoomPillar
DEFINE_BURST_PILLAR(scYampiDesertCaveBurstCrystalRoomPillar, FLAG_YAMPI_DESERT_CAVE_CRYSTAL_ROOM_PILLAR_BURST, ACTOR_CRYSTAL_ROOM_BURST_PILLAR)
Burst on the pillar in Crystal's room breaks it for good. The pillar is taken
away and FLAG_YAMPI_DESERT_CAVE_CRYSTAL_ROOM_PILLAR_BURST is set.
Definition at line 649 of file yampi_desert_cave.c.
scYampiDesertCaveStartMovingPillar
void scYampiDesertCaveStartMovingPillar(Sint32 unused, Sint32 id)
Move takes a pillar: the metatiles it stood on open, as the room has them without it.
References fdActorGetById(), fdMapGridCopyMetatileAttributes(), MainRoutineStateWork and Sint32.
Definition at line 655 of file yampi_desert_cave.c.
scYampiDesertCaveFinishMovingPillar
void scYampiDesertCaveFinishMovingPillar(Sint32 unused, Sint32 id)
Move sets a pillar down: where it opens the way it stays for good, and the metatiles under it close again.
References fdActorGetById(), fdMapGridCopyMetatileAttributes(), fdScriptSetFlag(), MainRoutineStateWork and Sint32.
Definition at line 685 of file yampi_desert_cave.c.
scYampiDesertCavePoundStake
void scYampiDesertCavePoundStake(Sint32 mode, Sint32 count)
Pound on the wooden stake in Crystal's room hammers it into the ground and opens the way past it.
References fdMapGridCopyMetatileAttributes(), fdPoundSinkTarget(), Sint32 and YampiDesertCaveCrystalStakes.
Definition at line 779 of file yampi_desert_cave.c.
scYampiDesertCaveMoveSandRipple
void scYampiDesertCaveMoveSandRipple(void)
Moves the ripple along its path, a row of YampiDesertCaveRipplePath for every
RIPPLE_STEPS_PER_POINT steps of its counter, which counts on while the player
has control, whether the party walks or stands.
References fdActorGetById(), fdActorSetPosFX(), fdScriptGetFlag(), scFieldGameFlagGetByte(), Sint32, syGameFlagSetByte() and YampiDesertCaveRipplePath.
Referenced by scInit() and scYampiDesertCaveScoopDjinni().
Definition at line 790 of file yampi_desert_cave.c.
scYampiDesertCaveScoopDjinni
void scYampiDesertCaveScoopDjinni(Sint32 mode)
Scoop cast right beside the ripple racing through the sand of Crystal's room
stops it and digs up Crystal, the Venus Djinni, who drops to the ground. The
ripple is stopped as the ground is dug (SCOOP_STAGE_DUG) and Crystal set down
as she comes up (SCOOP_STAGE_DUG_UP).
References fdActorGetById(), fdActorSetPosFX(), fdScriptClearFlag(), scYampiDesertCaveMoveSandRipple(), Sint32, syCloseEvent(), syGameFlagGetByte(), sySynch() and YampiDesertCaveRipplePath.
Definition at line 813 of file yampi_desert_cave.c.
scYampiDesertCaveMeetGuardianOfFire
void scYampiDesertCaveMeetGuardianOfFire(void)
Stepping up to Valukar in his chamber (metatiles (11, 11) to (13, 11)), the screen glows warm as he says "I am the guardian of fire. If you want my power, prove yourself in my crucible of flame.", then he comes at Felix and his battle begins, one the party cannot run from.
References fdActorGetById(), fdActorSetDestination(), fdActorStartRepeatedMotion(), fdPaletteFadeApplySource(), fdPaletteFadeSetTarget(), fdPaletteFadeStartInterpolation(), fdRequestBattleFromEncounterTable(), fdScriptEndLastingPsynergy(), fdScriptStart(), fdScriptWait(), MainRoutineStateWork, ResourceIdLavaCaveBackdrop, scScriptMessageShowCentered() and Sint32.
Definition at lines 869 and 1087 of file yampi_desert_cave.c.
scYampiDesertCaveDigUpMythrilSilver
void scYampiDesertCaveDigUpMythrilSilver(Sint32 mode)
Scoop at the west end of a passage in the part of the inner cave below Valukar's chamber (metatile (5, 38)) digs up the Mythril Silver: "Felix got some Mythril Silver."
References fdScriptDigUpTreasure() and Sint32.
Definition at line 903 of file yampi_desert_cave.c.
scGetCues
const CUE *scGetCues(void)
References MainRoutineStateWork, YampiDesertCaveCrystalCues, YampiDesertCaveCues and YampiDesertCaveGuardianCues.
Definition at line 910 of file yampi_desert_cave.c.
scInit
Sint32 scInit(void)
Sets up Yampi Desert Cave's three rooms as each one loads: the first room's palette cycle and Retreat destination, the third room's background priorities, and in each room the objects its flags place.
References fdActorDisableById(), fdActorGetById(), fdActorSetPosFX(), fdActorSetSpritePriority(), fdActorSetWideSprite(), fdEffectStartBlankOverlay(), fdMapGridCopyMetatileAttributes(), fdScriptGetFlag(), fdScriptSetFlag(), MainRoutineStateWork, scFieldGameFlagGetByte(), scPaletteSetColorsFade(), scPillarPlace(), scYampiDesertCaveMoveSandRipple(), scYampiDesertCaveSetLogMetatiles(), Sint32, syGameFlagSetByte(), sySetEvent(), TeleportCircleColors, TeleportCirclePaletteSlots, TeleportCircleShimmerColors, TeleportCircleShimmerSlots, YampiDesertCaveCrystalStakes and YampiDesertCaveRipplePath.
Definition at line 926 of file yampi_desert_cave.c.
scPrepareMap
Sint32 scPrepareMap(void)
References Sint32.
Definition at line 1079 of file yampi_desert_cave.c.
Variables in detail
YampiDesertCaveSettle
extern Uint32 YampiDesertCaveSettle[]
Uint32 YampiDesertCaveSettle[]
A pushed pillar or stake stands still where it was placed.
Referenced by YampiDesertCaveCrystalPlacements and YampiDesertCaveGuardianPlacements.
Definition at lines 169 and 1180 of file yampi_desert_cave.c.
PaletteCycleBright
Uint16 PaletteCycleBright
The Teleport circles' shimmer (shared/teleport_shimmer.c).
Referenced by fdPaletteCycleFade(), scTeleportStartFastShimmer() and scTeleportStartShimmer().
Definition at line 172 of file yampi_desert_cave.c.
PaletteCycleTimer
Uint16 PaletteCycleTimer
Referenced by fdPaletteCycleFade(), scTeleportStartFastShimmer() and scTeleportStartShimmer().
Definition at line 174 of file yampi_desert_cave.c.
PaletteCycleDelay
Uint16 PaletteCycleDelay
Referenced by fdPaletteCycleFade(), scTeleportStartFastShimmer() and scTeleportStartShimmer().
Definition at line 175 of file yampi_desert_cave.c.
YampiDesertCavePlacements
extern ACTOR_PLACE YampiDesertCavePlacements[]
ACTOR_PLACE YampiDesertCavePlacements[]
The entrance: three logs and the pillar Burst breaks.
Referenced by scGetActorPlacements().
Definition at lines 376 and 1186 of file yampi_desert_cave.c.
YampiDesertCaveGuardianPlacements
extern ACTOR_PLACE YampiDesertCaveGuardianPlacements[]
ACTOR_PLACE YampiDesertCaveGuardianPlacements[]
Valukar's room: the pillar Move pushes, and Valukar until he is beaten.
References Sint32 and YampiDesertCaveSettle.
Referenced by scGetActorPlacements().
Definition at lines 377 and 1202 of file yampi_desert_cave.c.
YampiDesertCaveCrystalPlacements
extern ACTOR_PLACE YampiDesertCaveCrystalPlacements[]
ACTOR_PLACE YampiDesertCaveCrystalPlacements[]
Crystal's room, in YAMPI_DESERT_CAVE_CRYSTAL_ACTOR_ID order.
References Sint32 and YampiDesertCaveSettle.
Referenced by scGetActorPlacements().
Definition at lines 378 and 1225 of file yampi_desert_cave.c.
YampiDesertCaveCrystalStakes
extern Uint16 YampiDesertCaveCrystalStakes[]
Uint16 YampiDesertCaveCrystalStakes[]
The stake Pound sinks in Crystal's room: its actor, its kind and the flag set
once it is sunk, as fdPoundSinkTarget reads them.
Referenced by scInit() and scYampiDesertCavePoundStake().
Definition at lines 379 and 1321 of file yampi_desert_cave.c.
YampiDesertCaveCues
extern CUE YampiDesertCaveCues[]
Referenced by scGetCues().
Definition at line 380 of file yampi_desert_cave.c.
YampiDesertCaveGuardianCues
extern CUE YampiDesertCaveGuardianCues[]
Referenced by scGetCues().
Definition at line 381 of file yampi_desert_cave.c.
YampiDesertCaveCrystalCues
extern CUE YampiDesertCaveCrystalCues[]
Referenced by scGetCues().
Definition at line 382 of file yampi_desert_cave.c.
YampiDesertCaveRipplePath
extern Sint16 YampiDesertCaveRipplePath[]
Sint16 YampiDesertCaveRipplePath[]
The ripple's path, a column and a row in half metatiles (8 pixels) for each
RIPPLE_STEPS_PER_POINT steps: it shows at four places in turn, and between them lies at the
origin, out of sight.
Referenced by scInit(), scYampiDesertCaveMoveSandRipple() and scYampiDesertCaveScoopDjinni().
Definition at lines 785 and 1097 of file yampi_desert_cave.c.
SceneExits
Uint32 SceneExits[]
Referenced by scGetExits().
Definition at line 1107 of file yampi_desert_cave.c.