Skip to Content
The Alchemy Project

src/scene/jupiter_lighthouse_entrance.c

The sandy grounds before Jupiter Lighthouse, reached from the world map at their south edge. More…

Macros

NameDescription
#defineOWN_fdMapGridGetMetatileBehaviorThis unit declares its own form of fdMapGridGetMetatileBehavior, below.
#defineMINT_SPOT_X 280Where the Mint lies under the weeds below the west end of the front wall: metatile (17, 27).
#defineMINT_SPOT_Z 440
#defineEFFECT_SET_MODE fdActorSelectAnimation
#defineEFFECT_SET_SCRIPT fdActorStartScript
#defineMETATILE_PUSH_SLOT_ENTRY syOAMAddSpriteAtDepthClamped

Enumerations

NameDescription
enumanonymous enum { METATILE_WEEDS_NORTH_OF_THE_TELEPORTER, METATILE_WEEDS_SOUTH … }The grounds' map metatiles that answer Cyclone: the weeds round the teleporter pad and under the front wall, the pad itself, and the weeds over the Mint.

Functions

NameDescription
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.
voidscJupiterLighthouseScatterWeedsSouthOfTheTeleporter (void)Cyclone cast in the weeds just south of the teleporter pad in the west dead end (metatiles (5, 22) to (8, 23)) scatters those within two metatiles of Felix.
voidscJupiterLighthouseScatterWeedsBelowTheStairs (void)Cyclone cast in the weeds below the stairs in the middle of the lighthouse's front (metatiles (21, 26) to (25, 28)) scatters those within two metatiles of Felix.
voidscJupiterLighthouseScatterEastWeeds (void)Cyclone cast in the weeds under the east part of the lighthouse's front (metatiles (30, 26) to (34, 28)) scatters those within two metatiles of Felix.
voidscJupiterLighthouseScatterWeedsOverMint (void)Cyclone cast standing on metatile (17, 27), in the weeds under the west end of the lighthouse's front wall, scatters them and, until it is found, uncovers a Mint under Felix's feet: he jumps a metatile west off it, and its green leaf lies in the cleared sand.
voidscJupiterLighthouseTeleportToBasement (void)Cyclone on the purple teleporter pad in the west dead end, metatile (7, 21): the whirlwind lifts Felix up off the screen, and he drops onto the near teleporter in the cave beneath the lighthouse.
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.
voidscJupiterLighthouseScatterWeedsNorthOfTheTeleporter (void)Cyclone cast in the weeds just north of the teleporter pad in the west dead end (metatiles (9, 19), (6, 20) and (7, 20)) scatters those within two metatiles of Felix.
voidscJupiterLighthouseScatterWestWeeds (void)Cyclone cast in the weeds under the west end of the lighthouse's front wall (metatiles (15, 25) to (17, 27)) scatters those within two metatiles of Felix.
const CUE *scGetCues (void)The scene's cues: the rooms of names' for any entrance above ENTRANCE_NAMES_ABOVE, else the debug room's.
Sint32scInit (void)Sets up the grounds as the party enters: the fade in, the teleporter's ring when the party arrives by it, and Contigo's shops as where a defeat returns to.
Sint32scPrepareMap (void)Sets the scene's arrival flags before the map is built.
voidsyGameFlagSetByte (Sint32 flag, Sint32 value)Sets the whole byte flags is in.
static inline voidscPaletteCycleSetTick (Sint32 value)Sets the palette cycle's tick (PaletteCycleTick).
Sint32fdMapGridGetMetatileBehavior (Sint32 x, Sint32 z, Sint32 layer)The ROM's callers here are compiled against this form, which returns an Sint32 where the definition returns a Uint8.
voidscLightSpritesSetPriority (Sint32 value)Unused: sets the priority the lit actors' sprites are drawn at; nothing in the entrance calls it.
voidscCrackedTileCrack ()Cracks the tile under the leader, swapping in its cracked picture.
voidscCrackedTileFall ()A cracked tile gives way under Felix, who drops through it.

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 colours; it is copied whole, with the unlit colours 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
Uint32LightSpriteActors [16]
LIGHT_OAMLightSpriteOams [16]
Sint16LightSpritesLarge
Sint16LightSpritePriority
METATILE_TARGETCrackedTilesThe cracked floors' metatiles, found by shared/cracked_tile_find.c.
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

The sandy grounds before Jupiter Lighthouse, reached from the world map at their south edge. The lighthouse's front wall runs across the north, with a door at each end (metatiles (11, 16) and (27, 16)) that leads into the ground floor once its gates are opened from within.

The way round to the west ends in a dead end with a purple teleporter pad among weeds, metatile (7, 21): Cyclone on it lifts the party away to the basement beneath the lighthouse (scJupiterLighthouseTeleportToBasement). Weeds also grow in three patches along the path under the front wall, and Cyclone there uncovers a Mint (scJupiterLighthouseScatterWeedsOverMint).

Macros in detail

OWN_fdMapGridGetMetatileBehavior

#define OWN_fdMapGridGetMetatileBehavior

This unit declares its own form of fdMapGridGetMetatileBehavior, below.

Definition at line 13 of file jupiter_lighthouse_entrance.c.

MINT_SPOT_X

#define MINT_SPOT_X 280

Where the Mint lies under the weeds below the west end of the front wall: metatile (17, 27).

Referenced by scJupiterLighthouseScatterWeedsOverMint().

Definition at line 128 of file jupiter_lighthouse_entrance.c.

MINT_SPOT_Z

#define MINT_SPOT_Z 440

Referenced by scJupiterLighthouseScatterWeedsOverMint().

Definition at line 129 of file jupiter_lighthouse_entrance.c.

EFFECT_SET_MODE

#define EFFECT_SET_MODE fdActorSelectAnimation

Referenced by EFFECT_SPAWN.

Definition at line 330 of file jupiter_lighthouse_entrance.c.

EFFECT_SET_SCRIPT

#define EFFECT_SET_SCRIPT fdActorStartScript

Referenced by EFFECT_SPAWN.

Definition at line 331 of file jupiter_lighthouse_entrance.c.

METATILE_PUSH_SLOT_ENTRY

#define METATILE_PUSH_SLOT_ENTRY syOAMAddSpriteAtDepthClamped

Referenced by scCrackedTileUpdate().

Definition at line 334 of file jupiter_lighthouse_entrance.c.

Enumerations in detail

anonymous enum

enum { METATILE_WEEDS_NORTH_OF_THE_TELEPORTER, METATILE_WEEDS_SOUTH_OF_THE_TELEPORTER, METATILE_WEST_WEEDS, METATILE_WEEDS_BELOW_THE_STAIRS, … }

The grounds' map metatiles that answer Cyclone: the weeds round the teleporter pad and under the front wall, the pad itself, and the weeds over the Mint.

EnumeratorValueDescription
METATILE_WEEDS_NORTH_OF_THE_TELEPORTER30
METATILE_WEEDS_SOUTH_OF_THE_TELEPORTER
METATILE_WEST_WEEDS
METATILE_WEEDS_BELOW_THE_STAIRS
METATILE_EAST_WEEDS
METATILE_TELEPORTER
METATILE_WEEDS_OVER_MINT

Definition at line 55 of file jupiter_lighthouse_entrance.c.

Functions in detail

scJupiterLighthouseScatterWeedsSouthOfTheTeleporter

void scJupiterLighthouseScatterWeedsSouthOfTheTeleporter(void)

Cyclone cast in the weeds just south of the teleporter pad in the west dead end (metatiles (5, 22) to (8, 23)) scatters those within two metatiles of Felix.

References scFieldTileCopiesCopyTouchedMetatiles().

Referenced by SceneCues.

Definition at lines 46 and 97 of file jupiter_lighthouse_entrance.c.

scJupiterLighthouseScatterWeedsBelowTheStairs

void scJupiterLighthouseScatterWeedsBelowTheStairs(void)

Cyclone cast in the weeds below the stairs in the middle of the lighthouse's front (metatiles (21, 26) to (25, 28)) scatters those within two metatiles of Felix.

References scFieldTileCopiesCopyTouchedMetatiles().

Referenced by SceneCues.

Definition at lines 47 and 113 of file jupiter_lighthouse_entrance.c.

scJupiterLighthouseScatterEastWeeds

void scJupiterLighthouseScatterEastWeeds(void)

Cyclone cast in the weeds under the east part of the lighthouse's front (metatiles (30, 26) to (34, 28)) scatters those within two metatiles of Felix.

References scFieldTileCopiesCopyTouchedMetatiles().

Referenced by SceneCues.

Definition at lines 48 and 121 of file jupiter_lighthouse_entrance.c.

scJupiterLighthouseScatterWeedsOverMint

void scJupiterLighthouseScatterWeedsOverMint(void)

Cyclone cast standing on metatile (17, 27), in the weeds under the west end of the lighthouse's front wall, scatters them and, until it is found, uncovers a Mint under Felix's feet: he jumps a metatile west off it, and its green leaf lies in the cleared sand.

References fdActorGet(), fdActorSetAttachedEffect(), fdActorSetDestinationOffset(), fdScriptEnd(), fdScriptGetFlag(), fdScriptStart(), MainRoutineStateWork, scFieldActorWaitForMoveById(), scFieldScriptEndLastingPsynergy() and scFieldTileCopiesCopyTouchedMetatiles().

Referenced by SceneCues.

Definition at lines 49 and 135 of file jupiter_lighthouse_entrance.c.

scJupiterLighthouseTeleportToBasement

void scJupiterLighthouseTeleportToBasement(void)

Cyclone on the purple teleporter pad in the west dead end, metatile (7, 21): the whirlwind lifts Felix up off the screen, and he drops onto the near teleporter in the cave beneath the lighthouse.

References syImportScriptSetExitRequest().

Referenced by SceneCues.

Definition at lines 50 and 165 of file jupiter_lighthouse_entrance.c.

scGetEntrances

const SCENE_ENTRANCE *scGetEntrances(void)

References SceneEntrances.

Definition at line 66 of file jupiter_lighthouse_entrance.c.

scGetExitRegions

const SCENE_REGION *scGetExitRegions(void)

Definition at line 71 of file jupiter_lighthouse_entrance.c.

scGetExits

const Uint32 *scGetExits(void)

References SceneExits.

Definition at line 76 of file jupiter_lighthouse_entrance.c.

scGetActorPlacements

const ACTOR_PLACE *scGetActorPlacements(void)

References ActorPlacements.

Definition at line 81 of file jupiter_lighthouse_entrance.c.

scJupiterLighthouseScatterWeedsNorthOfTheTeleporter

void scJupiterLighthouseScatterWeedsNorthOfTheTeleporter(void)

Cyclone cast in the weeds just north of the teleporter pad in the west dead end (metatiles (9, 19), (6, 20) and (7, 20)) scatters those within two metatiles of Felix.

References scFieldTileCopiesCopyTouchedMetatiles().

Referenced by SceneCues.

Definition at line 89 of file jupiter_lighthouse_entrance.c.

scJupiterLighthouseScatterWestWeeds

void scJupiterLighthouseScatterWestWeeds(void)

Cyclone cast in the weeds under the west end of the lighthouse's front wall (metatiles (15, 25) to (17, 27)) scatters those within two metatiles of Felix.

References scFieldTileCopiesCopyTouchedMetatiles().

Referenced by SceneCues.

Definition at line 105 of file jupiter_lighthouse_entrance.c.

scGetCues

const CUE *scGetCues(void)

References SceneCues.

Definition at line 171 of file jupiter_lighthouse_entrance.c.

scInit

Sint32 scInit(void)

Sets up the grounds as the party enters: the fade in, the teleporter's ring when the party arrives by it, and Contigo's shops as where a defeat returns to. Returns 0.

References fdActorAppearInWhirlwind(), fdScriptGetFlag(), MainRoutineStateWork and Sint32.

Definition at line 179 of file jupiter_lighthouse_entrance.c.

scPrepareMap

Sint32 scPrepareMap(void)

Sets the scene's arrival flags before the map is built. Returns 0.

References scSetArrivalFlags() and Sint32.

Definition at line 197 of file jupiter_lighthouse_entrance.c.

scPaletteCycleSetTick

static inline void scPaletteCycleSetTick(Sint32 value)

Sets the palette cycle's tick (PaletteCycleTick).

References PaletteCycleTick and Sint32.

Referenced by scJupiterLighthouseLoadPalettes() and scTrialRoadStartPaletteCycle().

Definition at line 214 of file jupiter_lighthouse_entrance.c.

scLightSpritesSetPriority

void scLightSpritesSetPriority(Sint32 value)

Unused: sets the priority the lit actors' sprites are drawn at; nothing in the entrance calls it.

References LightSpritePriority and Sint32.

Referenced by scInit().

Definition at line 244 of file jupiter_lighthouse_entrance.c.

Variables in detail

WhirlwindRiding

Sint32 WhirlwindRiding

References Sint32.

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

Definition at line 25 of file jupiter_lighthouse_entrance.c.

PaletteCycleColors

Uint16 PaletteCycleColors[16]

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

Definition at line 26 of file jupiter_lighthouse_entrance.c.

PaletteCycleUnlitPalette

Uint16 PaletteCycleUnlitPalette[2]

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

Referenced by scJupiterLighthouseLoadPalettes().

Definition at line 29 of file jupiter_lighthouse_entrance.c.

PaletteCycleUnlitColors

Uint16 PaletteCycleUnlitColors[14]

Referenced by scJupiterLighthouseLoadPalettes().

Definition at line 30 of file jupiter_lighthouse_entrance.c.

LightSpriteTile

Sint16 LightSpriteTile

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

Definition at line 31 of file jupiter_lighthouse_entrance.c.

LightSpriteCount

Sint16 LightSpriteCount

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

Definition at line 32 of file jupiter_lighthouse_entrance.c.

LightSpriteActors

Uint32 LightSpriteActors[16]

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

Definition at line 33 of file jupiter_lighthouse_entrance.c.

LightSpriteOams

LIGHT_OAM LightSpriteOams[16]

Referenced by scLightSpritesDraw().

Definition at line 34 of file jupiter_lighthouse_entrance.c.

LightSpritesLarge

Sint16 LightSpritesLarge

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

Definition at line 35 of file jupiter_lighthouse_entrance.c.

LightSpritePriority

Sint16 LightSpritePriority

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

Definition at line 36 of file jupiter_lighthouse_entrance.c.

CrackedTiles

METATILE_TARGET CrackedTiles

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

Definition at line 37 of file jupiter_lighthouse_entrance.c.

PaletteCyclePausesInScripts

extern Sint32 PaletteCyclePausesInScripts

Sint32 PaletteCyclePausesInScripts

References Sint32.

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

Definition at lines 205 and 311 of file jupiter_lighthouse_entrance.c.

PaletteCycleTick

extern Sint32 PaletteCycleTick

Sint32 PaletteCycleTick

References Sint32.

Referenced by fdPaletteCycleStep() and scPaletteCycleSetTick().

Definition at lines 211 and 309 of file jupiter_lighthouse_entrance.c.

WhirlwindEndScript

extern Sint32 WhirlwindEndScript[]

Sint32 WhirlwindEndScript[]

References Sint32.

Referenced by scWhirlwindUpdate().

Definition at lines 225 and 313 of file jupiter_lighthouse_entrance.c.

SceneExits

Uint32 SceneExits[]

Referenced by scGetExits().

Definition at line 255 of file jupiter_lighthouse_entrance.c.

ActorPlacements

ACTOR_PLACE ActorPlacements[]

Referenced by scGetActorPlacements().

Definition at line 271 of file jupiter_lighthouse_entrance.c.

SceneCues

CUE SceneCues[]

References scJupiterLighthouseScatterEastWeeds(), scJupiterLighthouseScatterWeedsBelowTheStairs(), scJupiterLighthouseScatterWeedsNorthOfTheTeleporter(), scJupiterLighthouseScatterWeedsOverMint(), scJupiterLighthouseScatterWeedsSouthOfTheTeleporter(), scJupiterLighthouseScatterWestWeeds() and scJupiterLighthouseTeleportToBasement().

Referenced by scGetCues().

Definition at line 280 of file jupiter_lighthouse_entrance.c.

FieldEffectDurationScripts

const Sint32 *FieldEffectDurationScripts[]

extern const Sint32 *FieldEffectDurationScripts[]

References FieldEffectLongScript, FieldEffectMediumScript, FieldEffectShortScript and Sint32.

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

Definition at lines 320 and 328 of file jupiter_lighthouse_entrance.c.