Skip to Content
The Alchemy Project

src/scene/jupiter_lighthouse_cracked_floor.c

Rooms of Jupiter Lighthouse just below its aerie, on one map. More…

Macros

NameDescription
#defineOWN_fdMapGridGetMetatileBehaviorThis file declares fdMapGridGetMetatileBehavior its own way, below.
#defineFLAG_DOOR_BUTTON_HELD FLAG_SCENE_TEMP(0x00)Set while the leader stands on the button by the door, which holds it open.
#defineEFFECT_SET_MODE fdActorSelectAnimation
#defineEFFECT_SET_SCRIPT fdActorStartScript
#defineMETATILE_PUSH_SLOT_ENTRY syOAMAddSpriteAtDepthClamped

Enumerations

NameDescription
enumanonymous enum { ACTOR_SHORTCUT_PILLAR }The pillar the party pushes onto the button by the door, after the four winged statues in ActorPlacements.
enumanonymous enum { DOOR_BUTTON_METATILE_X, DOOR_BUTTON_METATILE_Z }The button's metatile, which the pillar is moved onto.
enumanonymous enum { CUE_DOOR_BUTTON, CUE_OFF_DOOR_BUTTON }The step cues of the button: its metatile, and the three metatiles round it that the leader steps off it onto.
enumanonymous enum { METATILE_BEHAVIOR_SINGLE_CRACKED_TILE }The metatile behavior of the single cracked tile in the hall below, which takes the next one up as it cracks; the room's own are METATILE_BEHAVIOR_CRACKED_TILE.
enumJUPITER_LIGHTHOUSE_CRACKED_FLOOR_WAY { WAY_STATUE_HALL_UP_TO_CRACKED_TILES, WAY_CRACKED_TILES_DOWN_ … }The ways between rooms of this map: stairs up from the hall of the four winged statues, where the cracked tiles drop the party, to the room of cracked tiles above it, and stairs up again from that room's west corridor, by the stone door, to the room whose south passage leads to the aerie's west; and a doorway from the statue hall's south passage into the room of the stairs down to the left tower.
enumanonymous enum { DOOR_OPEN_AT_ONCE, DOOR_GRINDS_OPEN }How scJupiterLighthouseOpenDoor opens the door: at once, as the room is set up, or grinding open with a sound.

Functions

NameDescription
Sint32fdMapGridGetMetatileBehavior ()Declared without its parameters, and read back as a whole Sint32, as these rooms call it; the field defines it taking three Sint32 values and returning a Uint8.
voidscJupiterLighthouseOpenDoor (Sint32 how)Opens the door, at once or grinding open through a tick between shut and open.
voidscJupiterLighthouseCheckPillarOnButton (void)The shortcut pillar moved onto the button holds the door open for good.
voidscCrackedTilePlaceLanding (Sint32 x, Sint32 z, Sint32 effect)Unused here, where there is no cracked floor to fall through: in the rooms with one, it puts the leader who has fallen through on the metatile the flag bytes saved, offset by (dx, dz), and starts the screen transition.
voidscJupiterLighthouseStepOffButton (void)Stepping off the button closes the door, unless the shortcut pillar now holds it.
voidscJupiterLighthouseFinishMovingBlock (void)The grey block in the pit west of the beam's row, Moved one metatile east to metatile (10, 32), rises out of the pit and hovers there for good in line with the others, a step for Felix on the way to the Potion's chest.
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.
voidscJupiterLighthouseCloseDoor (void)Closes the door with a thud.
voidscJupiterLighthouseStepOnCrackedTile (Sint32 metatileBehavior)A cracked tile of the room under a grounded leader: as it gives way the party falls to the hall below.
voidscJupiterLighthouseStepOnSingleCrackedTile (Sint32 metatileBehavior)The single cracked tile of the hall below under a grounded leader: as it gives way the party falls into the left tower's lower rooms.
voidscJupiterLighthouseStepOnButton (void)Stepping on the button opens the door.
const CUE *scGetCues (void)The scene's cues: the rooms of names' for any entrance above ENTRANCE_NAMES_ABOVE, else the debug room's.
static inline voidscPaletteCycleSetTick (Sint32 value)Restarts the palette cycle at the given tick.
Sint32scInit (void)Sets up the rooms as the party enters: the window in, the door as the pillar or the button leaves it, and the cracked tiles of the room entered: the room of cracked tiles by its stairs, or else the hall below, with the landing of a fall from above.
Sint32scPrepareMap (void)Sets the scene's arrival flags and loads the lighthouse's palettes; the pillar goes back unless the party stays in place.
voidsyGameFlagSetByte (Sint32 flag, Sint32 value)Sets the whole byte flags is in.
voidscFieldEffectSpawn (Sint32 x, Sint32 y, Sint32 z, Sint32 velocityX, Sint32 velocityY, Sint32 velocityZ, Uint32 flags, const EFFECT_OPTIONS *options)Spawns a field effect at x, y, z moving at the velocity given, its type, scale, palette, priority, script, rotation, spin and update chosen by the EFFECT_USE_ flags from the options.
voidscLightSpritesSetPriority (Uint16 value)Sets the priority the lit actors' sprites are drawn at.
voidscCrackedTileCrack (METATILE_TARGET *state, METATILE_TARGET_ENTRY *entry)Cracks the tile under the leader, swapping in its cracked picture.

Variables

NameDescription
Sint32WhirlwindRidingThe state of the code every Jupiter Lighthouse room's overlay keeps its own copy of: a whirlwind's ride (shared/whirlwind_*.c), the palette cycle (shared/palette_cycle_step.c), the lit actors' sprites (shared/light_sprites_*.c) and the cracked tiles (shared/cracked_tile_*.c).
Uint16PaletteCycleColors [16]A copy of the room's cycling palette, BG palette CYCLE_PALETTE, which the cycle takes its colours from (scJupiterLighthouseLoadPalettes).
Uint16PaletteCycleUnlitPalette [2]Palette 13's first two colors; it is copied whole, with the unlit colors after them.
Uint16PaletteCycleUnlitColors [14]
Sint16LightSpriteTileThe glows drawn over the symbol blocks (scLightSpritesDraw): the VRAM cache entry of their tiles, how many actors carry one and which, their sprites, the large mode, the priority (-1 for each actor's own) and the picture row.
Sint16LightSpriteCount
LIGHT_OAMLightSpriteOams [16]
Sint16LightSpritesLarge
Sint16LightSpritePriority
METATILE_TARGETCrackedTilesThe metatiles scCrackedTileStep watches, and the metatile it copies over the one the leader steps on.
extern Sint32PaletteCyclePausesInScripts
extern Sint32PaletteCycleTickThe palette cycle's tick, -1 before it starts, and whether scripts hold it (fdPaletteCycleStep).
extern Sint32WhirlwindEndScript []
Uint32SceneExits []The room has no exits of its own.
ACTOR_PLACEActorPlacements []The room's people: the party's four rows, then PSYNERGY_TEST_ACTOR_ID's.
CUESceneCues []The room's scripts: talking to its people, Mind Read on them, the metatiles examined, and the field Psynergy each spot answers.
const Sint32 *FieldEffectDurationScripts []The field effects' three scripts by how long an effect lasts: short, medium and long.

Description

Rooms of Jupiter Lighthouse just below its aerie, on one map. Their stairs lead up to the aerie (later to the beacon's floor) and down to the left tower's lower rooms and the upper hall. Standing on the button in the room of cracked tiles holds a stone door open; the pillar beside it, moved onto it (scJupiterLighthouseCheckPillarOnButton), keeps it open, a shortcut through the tower. The room's cracked tiles give way under a second step (scJupiterLighthouseStepOnCrackedTile), dropping the party into the hall of the four winged statues below, where a single cracked tile in a ring of studs (scJupiterLighthouseStepOnSingleCrackedTile) drops it into the left tower's lower rooms.

Macros in detail

OWN_fdMapGridGetMetatileBehavior

#define OWN_fdMapGridGetMetatileBehavior

This file declares fdMapGridGetMetatileBehavior its own way, below.

Definition at line 13 of file jupiter_lighthouse_cracked_floor.c.

FLAG_DOOR_BUTTON_HELD

#define FLAG_DOOR_BUTTON_HELD FLAG_SCENE_TEMP(0x00)

Set while the leader stands on the button by the door, which holds it open.

Referenced by scInit(), scJupiterLighthouseStepOffButton() and scJupiterLighthouseStepOnButton().

Definition at line 32 of file jupiter_lighthouse_cracked_floor.c.

EFFECT_SET_MODE

#define EFFECT_SET_MODE fdActorSelectAnimation

Referenced by EFFECT_SPAWN.

Definition at line 487 of file jupiter_lighthouse_cracked_floor.c.

EFFECT_SET_SCRIPT

#define EFFECT_SET_SCRIPT fdActorStartScript

Referenced by EFFECT_SPAWN.

Definition at line 488 of file jupiter_lighthouse_cracked_floor.c.

METATILE_PUSH_SLOT_ENTRY

#define METATILE_PUSH_SLOT_ENTRY syOAMAddSpriteAtDepthClamped

Referenced by scCrackedTileUpdate().

Definition at line 491 of file jupiter_lighthouse_cracked_floor.c.

Enumerations in detail

anonymous enum

enum { ACTOR_SHORTCUT_PILLAR }

The pillar the party pushes onto the button by the door, after the four winged statues in ActorPlacements.

EnumeratorValueDescription
ACTOR_SHORTCUT_PILLARACTOR_FIRST_PLACED + 4

Definition at line 36 of file jupiter_lighthouse_cracked_floor.c.

anonymous enum

enum { DOOR_BUTTON_METATILE_X, DOOR_BUTTON_METATILE_Z }

The button's metatile, which the pillar is moved onto.

EnumeratorValueDescription
DOOR_BUTTON_METATILE_X4
DOOR_BUTTON_METATILE_Z37

Definition at line 42 of file jupiter_lighthouse_cracked_floor.c.

anonymous enum

enum { CUE_DOOR_BUTTON, CUE_OFF_DOOR_BUTTON }

The step cues of the button: its metatile, and the three metatiles round it that the leader steps off it onto.

EnumeratorValueDescription
CUE_DOOR_BUTTON20
CUE_OFF_DOOR_BUTTON21

Definition at line 50 of file jupiter_lighthouse_cracked_floor.c.

anonymous enum

enum { METATILE_BEHAVIOR_SINGLE_CRACKED_TILE }

The metatile behavior of the single cracked tile in the hall below, which takes the next one up as it cracks; the room's own are METATILE_BEHAVIOR_CRACKED_TILE.

EnumeratorValueDescription
METATILE_BEHAVIOR_SINGLE_CRACKED_TILE43

Definition at line 59 of file jupiter_lighthouse_cracked_floor.c.

JUPITER_LIGHTHOUSE_CRACKED_FLOOR_WAY

enum JUPITER_LIGHTHOUSE_CRACKED_FLOOR_WAY

The ways between rooms of this map: stairs up from the hall of the four winged statues, where the cracked tiles drop the party, to the room of cracked tiles above it, and stairs up again from that room's west corridor, by the stone door, to the room whose south passage leads to the aerie's west; and a doorway from the statue hall's south passage into the room of the stairs down to the left tower. A way's exit, the metatile that takes it and the entrance at its mouth share its number, so the way back is the entrance the exit leads to.

EnumeratorValueDescription
WAY_STATUE_HALL_UP_TO_CRACKED_TILES4
WAY_CRACKED_TILES_DOWN_TO_STATUE_HALL
WAY_CRACKED_TILES_UP_TO_AERIE_WEST_ROOM
WAY_AERIE_WEST_ROOM_DOWN_TO_CRACKED_TILES
WAY_STATUE_HALL_TO_LEFT_TOWER_STAIRS11
WAY_LEFT_TOWER_STAIRS_TO_STATUE_HALL

Definition at line 72 of file jupiter_lighthouse_cracked_floor.c.

anonymous enum

enum { DOOR_OPEN_AT_ONCE, DOOR_GRINDS_OPEN }

How scJupiterLighthouseOpenDoor opens the door: at once, as the room is set up, or grinding open with a sound.

EnumeratorValueDescription
DOOR_OPEN_AT_ONCE
DOOR_GRINDS_OPEN

Definition at line 84 of file jupiter_lighthouse_cracked_floor.c.

Functions in detail

scJupiterLighthouseOpenDoor

void scJupiterLighthouseOpenDoor(Sint32 how)

Opens the door, at once or grinding open through a tick between shut and open.

References fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatilesLayered(), fdScriptPlaySound(), Sint32 and sySynch().

Referenced by scInit(), scJupiterLighthouseCheckPillarOnButton() and scJupiterLighthouseStepOnButton().

Definition at lines 90 and 158 of file jupiter_lighthouse_cracked_floor.c.

scJupiterLighthouseCheckPillarOnButton

void scJupiterLighthouseCheckPillarOnButton(void)

The shortcut pillar moved onto the button holds the door open for good.

References fdActorGet(), fdScriptGetFlag(), fdScriptSetFlag() and scJupiterLighthouseOpenDoor().

Referenced by scJupiterLighthouseFinishMovingBlock(), scJupiterLighthouseMoveButtonPillar() and scJupiterLighthouseStepOffButton().

Definition at lines 91 and 181 of file jupiter_lighthouse_cracked_floor.c.

scJupiterLighthouseStepOffButton

void scJupiterLighthouseStepOffButton(void)

Stepping off the button closes the door, unless the shortcut pillar now holds it.

References fdScriptClearFlag(), fdScriptGetFlag(), scJupiterLighthouseCheckPillarOnButton() and scJupiterLighthouseCloseDoor().

Referenced by SceneCues.

Definition at lines 108 and 206 of file jupiter_lighthouse_cracked_floor.c.

scGetEntrances

const SCENE_ENTRANCE *scGetEntrances(void)

References SceneEntrances.

Definition at line 111 of file jupiter_lighthouse_cracked_floor.c.

scGetExitRegions

const SCENE_REGION *scGetExitRegions(void)

Definition at line 116 of file jupiter_lighthouse_cracked_floor.c.

scGetExits

const Uint32 *scGetExits(void)

References SceneExits.

Definition at line 121 of file jupiter_lighthouse_cracked_floor.c.

scGetActorPlacements

const ACTOR_PLACE *scGetActorPlacements(void)

References ActorPlacements.

Definition at line 126 of file jupiter_lighthouse_cracked_floor.c.

scJupiterLighthouseCloseDoor

void scJupiterLighthouseCloseDoor(void)

Closes the door with a thud.

References fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatilesLayered(), fdScriptPlaySound() and sySynch().

Referenced by scJupiterLighthouseStepOffButton().

Definition at lines 132 and 171 of file jupiter_lighthouse_cracked_floor.c.

scJupiterLighthouseStepOnCrackedTile

void scJupiterLighthouseStepOnCrackedTile(Sint32 metatileBehavior)

A cracked tile of the room under a grounded leader: as it gives way the party falls to the hall below.

References fdActorGet(), MainRoutineStateWork, scCrackedTileStep(), scFieldScriptSetExitRequest() and Sint32.

Referenced by SceneCues.

Definition at line 139 of file jupiter_lighthouse_cracked_floor.c.

scJupiterLighthouseStepOnSingleCrackedTile

void scJupiterLighthouseStepOnSingleCrackedTile(Sint32 metatileBehavior)

The single cracked tile of the hall below under a grounded leader: as it gives way the party falls into the left tower's lower rooms.

References fdActorGet(), MainRoutineStateWork, scCrackedTileStep(), scFieldScriptSetExitRequest() and Sint32.

Referenced by SceneCues.

Definition at line 148 of file jupiter_lighthouse_cracked_floor.c.

scJupiterLighthouseStepOnButton

void scJupiterLighthouseStepOnButton(void)

Stepping on the button opens the door.

References fdScriptGetFlag(), fdScriptSetFlag() and scJupiterLighthouseOpenDoor().

Referenced by SceneCues.

Definition at line 195 of file jupiter_lighthouse_cracked_floor.c.

scGetCues

const CUE *scGetCues(void)

References SceneCues.

Definition at line 218 of file jupiter_lighthouse_cracked_floor.c.

scPaletteCycleSetTick

static inline void scPaletteCycleSetTick(Sint32 value)

Restarts the palette cycle at the given tick.

References PaletteCycleTick and Sint32.

Referenced by scJupiterLighthouseLoadPalettes() and scTrialRoadStartPaletteCycle().

Definition at line 226 of file jupiter_lighthouse_cracked_floor.c.

scInit

Sint32 scInit(void)

Sets up the rooms as the party enters: the window in, the door as the pillar or the button leaves it, and the cracked tiles of the room entered: the room of cracked tiles by its stairs, or else the hall below, with the landing of a fall from above. Returns 0.

References fdScriptGetFlag(), MainRoutineStateWork, scCrackedTileFind(), scCrackedTilePlaceLanding(), scJupiterLighthouseOpenDoor() and Sint32.

Definition at line 235 of file jupiter_lighthouse_cracked_floor.c.

scPrepareMap

Sint32 scPrepareMap(void)

Sets the scene's arrival flags and loads the lighthouse's palettes; the pillar goes back unless the party stays in place. Returns 0.

References fdScriptClearFlag(), fdScriptGetFlag(), scJupiterLighthouseLoadPalettes(), scSetArrivalFlags() and Sint32.

Definition at line 280 of file jupiter_lighthouse_cracked_floor.c.

scLightSpritesSetPriority

void scLightSpritesSetPriority(Uint16 value)

Sets the priority the lit actors' sprites are drawn at.

References LightSpritePriority.

Referenced by scInit().

Definition at line 326 of file jupiter_lighthouse_cracked_floor.c.

Variables in detail

WhirlwindRiding

Sint32 WhirlwindRiding

References Sint32.

Referenced by scInit(), scJupiterLighthouseRaiseUpperWhirlwind(), scJupiterLighthouseRaiseWhirlwind(), scJupiterLighthouseRideUpperWhirlwind(), scJupiterLighthouseRideWhirlwind() and scWhirlwindUpdate().

Definition at line 93 of file jupiter_lighthouse_cracked_floor.c.

PaletteCycleColors

Uint16 PaletteCycleColors[16]

Referenced by fdPaletteCycleFade(), fdPaletteCycleStep(), scJupiterLighthouseLoadPalettes() and scPaletteSetColorsFade().

Definition at line 94 of file jupiter_lighthouse_cracked_floor.c.

PaletteCycleUnlitPalette

Uint16 PaletteCycleUnlitPalette[2]

Palette 13's first two colors; it is copied whole, with the unlit colors after them.

Referenced by scJupiterLighthouseLoadPalettes().

Definition at line 97 of file jupiter_lighthouse_cracked_floor.c.

PaletteCycleUnlitColors

Uint16 PaletteCycleUnlitColors[14]

Referenced by scJupiterLighthouseLoadPalettes().

Definition at line 98 of file jupiter_lighthouse_cracked_floor.c.

LightSpriteTile

Sint16 LightSpriteTile

Referenced by scAnemosInnerSanctumDullahanStartLightSprites(), scLightSpritesDraw(), scLightSpritesInitChannelPieces(), scLightSpritesInitEnergyBlockGlow() and scLightSpritesInitPathGlows().

Definition at line 99 of file jupiter_lighthouse_cracked_floor.c.

LightSpriteCount

Sint16 LightSpriteCount

Referenced by scAnemosInnerSanctumDullahanStartLightSprites(), scLightSpritesAdd(), scLightSpritesAddCounted(), scLightSpritesDraw(), scLightSpritesInitChannelPieces(), scLightSpritesInitEnergyBlockGlow() and scLightSpritesInitPathGlows().

Definition at line 100 of file jupiter_lighthouse_cracked_floor.c.

LightSpriteOams

LIGHT_OAM LightSpriteOams[16]

Referenced by scLightSpritesDraw().

Definition at line 102 of file jupiter_lighthouse_cracked_floor.c.

LightSpritesLarge

Sint16 LightSpritesLarge

Referenced by scAnemosInnerSanctumDullahanStartLightSprites(), scLightSpritesDraw(), scLightSpritesInitChannelPieces(), scLightSpritesInitEnergyBlockGlow() and scLightSpritesInitPathGlows().

Definition at line 103 of file jupiter_lighthouse_cracked_floor.c.

LightSpritePriority

Sint16 LightSpritePriority

Referenced by scAnemosInnerSanctumDullahanSetLightPriority(), scAnemosInnerSanctumDullahanStartLightSprites(), scLightSpritesDraw(), scLightSpritesInitChannelPieces(), scLightSpritesInitEnergyBlockGlow(), scLightSpritesInitPathGlows() and scLightSpritesSetPriority().

Definition at line 104 of file jupiter_lighthouse_cracked_floor.c.

CrackedTiles

METATILE_TARGET CrackedTiles

The metatiles scCrackedTileStep watches, and the metatile it copies over the one the leader steps on.

Referenced by scCrackedTileFind(), scCrackedTilePlaceLanding(), scCrackedTileStep() and scCrackedTileUpdate().

Definition at line 107 of file jupiter_lighthouse_cracked_floor.c.

PaletteCyclePausesInScripts

extern Sint32 PaletteCyclePausesInScripts

Sint32 PaletteCyclePausesInScripts

References Sint32.

Referenced by fdPaletteCycleStep(), scJupiterLighthouseLoadPalettes() and scPaletteCycleSetPausesInScripts().

Definition at lines 131 and 466 of file jupiter_lighthouse_cracked_floor.c.

PaletteCycleTick

extern Sint32 PaletteCycleTick

Sint32 PaletteCycleTick

References Sint32.

Referenced by fdPaletteCycleStep() and scPaletteCycleSetTick().

Definition at lines 223 and 464 of file jupiter_lighthouse_cracked_floor.c.

WhirlwindEndScript

extern Sint32 WhirlwindEndScript[]

Sint32 WhirlwindEndScript[]

References Sint32.

Referenced by scWhirlwindUpdate().

Definition at lines 303 and 468 of file jupiter_lighthouse_cracked_floor.c.

SceneExits

Uint32 SceneExits[]

Referenced by scGetExits().

Definition at line 337 of file jupiter_lighthouse_cracked_floor.c.

ActorPlacements

ACTOR_PLACE ActorPlacements[]

Referenced by scGetActorPlacements().

Definition at line 382 of file jupiter_lighthouse_cracked_floor.c.

SceneCues

CUE SceneCues[]

References scJupiterLighthouseFinishMovingBlock(), scJupiterLighthouseStepOffButton(), scJupiterLighthouseStepOnButton(), scJupiterLighthouseStepOnCrackedTile() and scJupiterLighthouseStepOnSingleCrackedTile().

Referenced by scGetCues().

Definition at line 406 of file jupiter_lighthouse_cracked_floor.c.

FieldEffectDurationScripts

const Sint32 *FieldEffectDurationScripts[]

extern const Sint32 *FieldEffectDurationScripts[]

References FieldEffectLongScript, FieldEffectMediumScript, FieldEffectShortScript and Sint32.

Referenced by fdEffectSpawnResident(), scFieldEffectSpawn() and scFieldEffectSpawnLocal().

Definition at lines 475 and 485 of file jupiter_lighthouse_cracked_floor.c.