Skip to Content
The Alchemy Project

src/scene/sea_of_time.c

The Sea of Time, the purple sea the Lemurian ship must cross to reach Lemuria, in two scenes: the great sea of swirls the ship sails into from the world map, and the last stretch before Lemuria, where Poseidon waits. More…

Macros

NameDescription
#defineSceneStateWork ((Uint32 *)SceneStateWork)The scene's view of SceneStateWork (system/globals.h): its words.
#defineEFFECT_SET_MODE fdActorSelectAnimation
#defineEFFECT_SET_SCRIPT fdActorStartScript
#defineEFFECT_SPRITE_PRIORITY
#defineFLAG_WAVES_RUNNING FLAG_SCENE_TEMP(0x00)Set while the waves run, from the stars over a trunk until the sea's patterns come back; meanwhile the channels carry nothing and no laps are counted.
#defineFLAG_SWEPT_BACK_ONCE 0x8ddSet the first time a channel sweeps the ship out of the sea, which puts the party back aboard the Lemurian ship; later sweeps land on the world map.
#defineSWIRL_SQUARE (coordinate) ((coordinate) >> 21)The 32-pixel square, two metatiles across, that a 16.16 coordinate lies in, and a square's corner: a swirl's eye is one such square, and its ring the eight round it.
#defineSWIRL_SQUARE_CORNER (square) ((square) << 21)
#defineSWIRL_SQUARE_ORIGIN (coordinate)
#defineCURRENT_HOLD_DISTANCE 46How far, in pixels, the ship may drift from a swirl's eye before the ring's current pulls it back in.
#defineCURRENT_SPRAY_REACH 10How far either side of the ship its spray is thrown, in pixels: by a swirl's ring, and by a channel or rough water.
#defineCHANNEL_SPRAY_REACH 12
#defineQUARTER_TURNS (n) ((n) << 14)n quarter turns as an angle, DEGtoANG(90) apiece.
#defineSEA_PALETTE 3The sea's background palette, whose colours 1 to SEA_COLORS the waves tint and the sea's tick callback turns round; the next palette's turn as the water flows.
#defineSEA_COLORS 14
#defineFLOW_PALETTE (SEA_PALETTE + 1)
#defineWAVE_RED 11The colour the waves tint the sea's colours toward, a step a channel at a time.
#defineWAVE_GREEN 6
#defineWAVE_BLUE 23
#defineWAVE_COLOR_STEP_TICKS 360The ticks between the sea's colour steps while the waves run.
#definePULSE_COLOR BG_PLTT_COLOR(0, 15)The background colour whose red pulses while no waves run, between PULSE_RED_MIN and full: colour 15 of background palette 0.
#definePULSE_RED_MIN 18
#defineRIPPLE_SHIFT 15The ripple's sine shifted down to a swing of two pixels each way.
#definePUFF_SHOWER_TICKS 360The shower of water over Poseidon: PUFF_SHOWER_TICKS long, a puff every 16 ticks, from PUFF_SHOWER_FASTER every 8 and from PUFF_SHOWER_FASTEST every other tick, each somewhere in a PUFF_SPREAD-pixel square; BIG_PUFFS larger ones follow, one a tick.
#definePUFF_SHOWER_FASTER 120
#definePUFF_SHOWER_FASTEST 240
#definePUFF_SPREAD 32
#defineBIG_PUFFS 16
#defineLAP_METATILES 8The lap squares round each trunk, in order round it.
#defineLAP_STEP_TICKS 50The ticks the ship may take from one lap square to the next before its count starts again.
#defineLAP_STEPS_BEFORE_SPARKLES 3The squares round after which stars rise about the trunk, somewhere in a SPARKLE_SPREAD-pixel square.
#defineSPARKLE_SPREAD 32
#defineWAVE_TICKS 120The ticks the waves run.
#defineSTEP_TOWARD (channel, target, changed)Steps one of a colour's channels a unit toward its target, setting changed if it moved: the sea's colours fade a step at a time this way, toward the waves' colour and back to the colours saved on arrival.
#defineSTEP_SEA_TOWARD_WAVES (palette, i, changed)One step of the sea's colours (SEA_PALETTE from colour 1) toward the waves' colour, every channel of each a unit nearer.
#defineSTEP_SEA_TOWARD_SAVED_COLORS (palette, saved, i, j, changed)One step of the sea's colours back toward those saved on arrival (SeaOfTimeSavedColors, the sea's from colour 1 on).
#defineENCOUNTER_SLOT_POSEIDON 6Poseidon's battle, in the story battles' encounter table.
#definePOSEIDON_ANIMATION_POINT_TRIDENT 1Poseidon swinging his trident down to point it at the ship, in his sprite sheet's numbering.
#defineDEFINE_GRIND_ROCK (name, rock, flag)Defines what Grind on a rock does: the rock is ground away (scSeaOfTimeRemoveRock) and its flag set, so it is gone for good.
#defineDEFINE_LEAVE_BY_EXIT (name, exit)Defines a step cue that leaves the scene by exit, the screen closing.
#defineROCK_RISE_TICKS 10The ticks a rock takes to grow to its height out of the sea.

Enumerations

NameDescription
enumanonymous enum { ACTOR_SHIP, ACTOR_ROCK_A, ACTOR_ROCK_B, ACTOR_ROCK_C, ACTOR_ … }The Lemurian ship the party sails, and the rocks that rise in the last stretch.
enumanonymous enum { FLAG_ROCK_A_CLEARED, FLAG_ROCK_B_CLEARED, FLAG_ROCK_C_CLEARE … }Set as Grind clears each rock; a cleared rock is not placed again.
enumSEA_OF_TIME_METATILE_BEHAVIOR { METATILE_BEHAVIOR_SWIRL_RING_SOUTH, METATILE_BEHAVIOR_SWIRL_ … }The kinds of water the ship sails over.
enumSEA_OF_TIME_RAISED_CUE { RAISED_START_WAVES, RAISED_STOP_WAVES }The raised cues of the waves: the laps round a trunk are done, and the waves are over.
enumanonymous enum { CUE_TO_WORLD_MAP, CUE_BACK_NORTH, CUE_BEFORE_POSEIDON }The last stretch's step cues: in the north part, metatiles (20, 18) to (23, 20), where the ship meets Poseidon; in the south part, the way off its west edge to the world map and the way off its east edge back north.
enumanonymous enum { NORTH_PART_LAST_ENTRANCE, ENTRANCE_FROM_SOUTH_PART, ENTRANCE … }The last stretch's north part is reached by entrances 1 to NORTH_PART_LAST_ENTRANCE; the last is where the ship waits after Poseidon's battle.

Functions

NameDescription
voidscSetActorSpritePriority (ACTOR *actor, Sint32 priority)Fixes the priority of the actor's sprite and its shadow, which then no longer follows the map metatile under it (clears ACTOR_PRIORITY_AUTOMATIC).
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.
Sint32scMapMetatileGetAttributes (Uint32 layer, Sint32 x, Sint32 y)Returns a metatile's collision code and attributes as a halfword.
Sint32scMapMetatileSetAttributes (Uint32 layer, Sint32 x, Sint32 y, Sint32 value)Replaces a metatile's collision code and attributes on a layer, or in the metatile buffer for a layer past the overhead one, and returns the old value.
Sint32scPosFlatDistance (FIXED *a, FIXED *b)The distance between two positions across the ground (x and z), in whole pixels.
voidscSeaOfTimeRemoveRock (Sint32 x, Sint32 z, Sint32 actor)A rock Grind has broken is gone from the sea, and the ship can sail over its 2 by 2 metatiles.
voidscSeaOfTimePlaceRock (Sint32 x, Sint32 z, Sint32 actor)Puts a rock in the last stretch, which the ship cannot sail through.
static inline Sint32scSeaOfTimeCos (Sint32 angle)syCos, through an inline as the swirl's turn calls it.
voidscSeaOfTimeTimeWaves (void)While the waves run, ends them WAVE_TICKS after the sea has gone still, and keeps the tick it went still, the swirls' pace and the tick count in case the scene is left and entered again.
voidscSeaOfTimeRideCurrent (void)The Lemurian ship sails into the ring of current round a swirl's eye, and the current carries it round the eye, clockwise or counterclockwise as the swirl turns, with a rushing sound and white spray thrown up on both sides.
voidscSeaOfTimeCountLaps (void)The Lemurian ship sails round one of the trunks, the little volcanoes in the great sea, and keeps going the same way round.
BSS_DATAALIGNED (16)The sea's horizontal offset for each screen line as it ripples sideways (scSeaOfTimeAnimateSea).
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.
voidscSeaOfTimeCircleSwirl (void)The Lemurian ship sails into the dark eye of a swirl, and the swirl pulls it into the very middle and spins it round there, clockwise or counterclockwise as the swirl turns, until the player steers it out.
voidscSeaOfTimeFollowChannel (void)The Lemurian ship sails onto a channel, a straight strip of striped rushing water, and is carried fast along it to its end, east, south, west or north, spray flying from both sides.
voidscSeaOfTimeStartWaves (void)The waves start once the ship has circled a trunk enough times: with a rising sound, the stripes and swirls in the water fade over a few seconds until the sea lies flat, and the channels stop carrying the ship.
voidscSeaOfTimeStopWaves (void)The waves stop: with a higher sound the stripes and swirls come back into the water over a few seconds, and the channels carry the ship again.
voidscSeaOfTimePushBackInRoughWater (void)The Lemurian ship sails into the rough water of the great sea's north, the band along the north edge at metatiles (46, 1) to (61, 3) or the one at (18, 8) to (35, 9), and the water pushes it back south a little, spray flying from both sides, every time it tries.
voidscSeaOfTimeSweptBack (void)A channel runs the Lemurian ship off the edge of the great sea, at metatiles (16, 63), (32, 63) or (48, 63) in the south or (62, 16) in the east, and the screen fades.
voidscSeaOfTimeUpdateWater (ACTOR *actor)Each tick Poseidon stands over the sea, water splashes up at his feet, every other tick somewhere across his width.
voidscSeaOfTimeFacePoseidon (void)The Lemurian ship sails up the last stretch to metatiles (20, 18) to (23, 20), and Poseidon is met: the ship sails north on its own as the camera rises, the music stops, the water goes flat and its patterns slowly return, a shower of water bursts over the sea, faster and faster, and Poseidon rises out of it.
DEFINE_GRIND_ROCK(scSeaOfTimeGrindRockA , ACTOR_ROCK_A, FLAG_ROCK_A_CLEARED)Felix casts Grind on one of the rocks that rose in the last stretch's north part after Poseidon's battle, the one on metatiles (10, 11) to (11, 12), and it is gone for good.
DEFINE_GRIND_ROCK(scSeaOfTimeGrindRockB , ACTOR_ROCK_B, FLAG_ROCK_B_CLEARED)As scSeaOfTimeGrindRockA, for the rock on metatiles (18, 8) to (19, 9).
DEFINE_GRIND_ROCK(scSeaOfTimeGrindRockC , ACTOR_ROCK_C, FLAG_ROCK_C_CLEARED)Unused: Grind on a third rock, ACTOR_ROCK_C, which no arrival raises or places, so its cue is never met.
DEFINE_GRIND_ROCK(scSeaOfTimeGrindRockD , ACTOR_ROCK_D, FLAG_ROCK_D_CLEARED)As scSeaOfTimeGrindRockA, for the rock on metatiles (23, 13) to (24, 14).
DEFINE_GRIND_ROCK(scSeaOfTimeGrindRockE , ACTOR_ROCK_E, FLAG_ROCK_E_CLEARED)As scSeaOfTimeGrindRockA, for the rock on metatiles (29, 9) to (30, 10).
DEFINE_GRIND_ROCK(scSeaOfTimeGrindSouthRock , ACTOR_ROCK_A, FLAG_ROCK_SOUTH_CLEARED)Felix casts Grind on the rock in the last stretch's south part, on metatiles (44, 42) to (45, 43), and it is gone for good.
DEFINE_LEAVE_BY_EXIT(scSeaOfTimeLeaveForWorldMap , SEA_OF_TIME_POSEIDON_TO_WORLD_MAP_NORTHEAST)The Lemurian ship sails off the west edge of the last stretch's south part, metatiles (1, 45) to (3, 50), and the screen fades to the world map.
DEFINE_LEAVE_BY_EXIT(scSeaOfTimeReturnNorth , EXIT_BACK_NORTH)The Lemurian ship sails off the east edge of the last stretch's south part, metatiles (55, 44) and (55, 45), and the screen fades to its north part.
const CUE *scGetCues (void)The scene's cues: the rooms of names' for any entrance above ENTRANCE_NAMES_ABOVE, else the debug room's.
voidscSeaOfTimeAnimateSea (void)Each tick, keeps the Sea of Time moving: the swirls turn and the channels' stripes flow as their colours are cycled, one colour's red pulses (fading out as the waves start and back as they stop), and the whole sea ripples sideways line by line.
voidscSeaOfTimeRaiseRock (Sint32 x, Sint32 z, Sint32 actor)A rock rises out of the sea: the camera goes to it, the screen shakes with a clatter, water splashes and the rock grows up out of the splash.
voidscSeaOfTimeOpen (void)After Poseidon's battle, back in the last stretch, Poseidon stands over the sea.
Sint32scInit (void)Sets up the sea.
Sint32scPrepareMap (void)Once Briggs is caught the pool has dried up: its colours take the dry ground's.

Variables

NameDescription
extern volatile Uint32SeaOfTimeLastSwirlStepTick
extern Uint32SeaOfTimeSwirlStepTicks
extern ACTOR_PLACESeaOfTimePoseidonPlacements []
extern Uint32SeaOfTimeLastLapTick
extern CUESeaOfTimeSwirlsCues []
extern CUESeaOfTimeNorthPartCues []
extern CUESeaOfTimeSouthPartCues []
extern Sint16SeaOfTimeRedPulseStep [1]The step the sea's red pulse takes each time it brightens or dims.
extern Uint32FieldEffectShortScript []
extern Uint32FieldEffectMediumScript []The flash about the Tomegathericon: held 45 ticks, then put away and freed.
extern Uint32FieldEffectLongScript []
extern Sint32SeaOfTimeShipRests []
Uint16SeaOfTimeRippleLines [DISPLAY_HEIGHT]The sea's horizontal offset for each screen line as it ripples sideways (scSeaOfTimeAnimateSea).
extern ACTOR_PLACESeaOfTimeSwirlsPlacements []
extern Uint16SeaOfTimeLapCount
extern Sint16SeaOfTimeLapTurn
extern Uint16SeaOfTimeLastLapMetatileThe ship's laps round a trunk: the last step cue it crossed, the steps counted, the way it turns and the tick of its last step; then the tick the swirls' colours last turned a step, and the ticks between their steps (1 as the sea flows, WAVE_COLOR_STEP_TICKS while the waves run).
extern SPOTSSeaOfTimeLapSpotsWhere the sparkles rise round each trunk as the ship's laps add up, in 16.16 pixels.
extern Uint8SeaOfTimeLapsNeeded []The steps round each trunk the ship must sail before the waves start.
SAVED_COLSeaOfTimeSavedColors
const Sint32 *FieldEffectDurationScripts []The field effects' three scripts by how long an effect lasts: short, medium and long.
Uint32SceneExits []The room has no exits of its own.

Description

The Sea of Time, the purple sea the Lemurian ship must cross to reach Lemuria, in two scenes: the great sea of swirls the ship sails into from the world map, and the last stretch before Lemuria, where Poseidon waits.

The great sea is full of swirls, each a ring of current round a dark eye that turns the ship round and round, and of rapids, straight channels of striped water that carry the ship along. Some run off the edge of the sea and sweep the ship out of it: the first time back aboard the Lemurian ship, where the party talks over how to find the way, later straight out to the world map. The way is in Yepp's songs, which the children of Yallam sing: pass so many swirls, then sail round a trunk, one of the little volcanoes in the sea, two or three times the same way round until stars rise about it. Then come the waves: the sea's patterns go still, and until the waves stop the channels carry nothing. Bands of rough water in the north turn the ship back south. The sea's north-west corner leads to the last stretch, where Poseidon rises from the sea. Once he is beaten, four rocks rise out of the water for Grind, and the way north to Lemuria is open.

Macros in detail

SceneStateWork

#define SceneStateWork ((Uint32 *)SceneStateWork)

The scene's view of SceneStateWork (system/globals.h): its words.

Referenced by scContigoOfferLuckyDice(), scContigoOfferSuperLuckyDice(), scContigoReportCoinChange(), scGabombaStatueDrawRaisedBlocks(), scGabombaStatueFindBrokenMetatile(), scGabombaStatueIsMetatileTaken(), scGabombaStatueLayChannel(), scGabombaStatueLayPath(), scGabombaStatueLoadBlockPictures(), scGabombaStatueMoveCharge(), scGabombaStatuePoundBlock(), scGabombaStatuePressLeftArrowPanel(), scGabombaStatuePressRightArrowPanel(), scGabombaStatueRaiseBlocks(), scGabombaStatueRedrawChannel(), scGabombaStatueReleaseLeftArrowPanel(), scGabombaStatueReleaseRightArrowPanel(), scGabombaStatueSetBlockAnimation(), scGabombaStatueSetBlocksRaised(), scGabombaStatueSetUpChannelPuzzle(), scGabombaStatueTurnBlockPiece(), scGabombaStatueTurnBlocks(), scGabombaStatueWritePiece(), scGaiaRockInsideStartPlatforms(), scGaiaRockInsideSwayPlatforms(), scInit(), scIsletsDriftIcebergs(), scIsletsInitEastTundaria(), scIsletsStepDownOntoIceberg(), scSeaOfTimeTimeWaves(), scTaopoSwampResetMud(), scTaopoSwampRiseOnBubble(), scTaopoSwampSaveFirmGround(), scTaopoSwampSinkInMud(), scTaopoSwampStepOnFirmGround(), scTrialRoadMoveRival(), scTrialRoadPlayRivalRecording(), scTrialRoadRivalIsWaiting(), scTrialRoadStartRival(), scTrialRoadStopRival() and scTrialRoadWaitForRival().

Definition at line 32 of file sea_of_time.c.

EFFECT_SET_MODE

#define EFFECT_SET_MODE fdActorSelectAnimation

Referenced by EFFECT_SPAWN.

Definition at line 60 of file sea_of_time.c.

EFFECT_SET_SCRIPT

#define EFFECT_SET_SCRIPT fdActorStartScript

Referenced by EFFECT_SPAWN.

Definition at line 61 of file sea_of_time.c.

EFFECT_SPRITE_PRIORITY

#define EFFECT_SPRITE_PRIORITY

Definition at line 62 of file sea_of_time.c.

FLAG_WAVES_RUNNING

#define FLAG_WAVES_RUNNING FLAG_SCENE_TEMP(0x00)

Set while the waves run, from the stars over a trunk until the sea's patterns come back; meanwhile the channels carry nothing and no laps are counted.

Referenced by scInit(), scSeaOfTimeAnimateSea(), scSeaOfTimeOpen(), scSeaOfTimeStartWaves(), scSeaOfTimeStopWaves() and SeaOfTimeSwirlsCues.

Definition at line 142 of file sea_of_time.c.

FLAG_SWEPT_BACK_ONCE

#define FLAG_SWEPT_BACK_ONCE 0x8dd

Set the first time a channel sweeps the ship out of the sea, which puts the party back aboard the Lemurian ship; later sweeps land on the world map. Facing Poseidon sets it too.

Referenced by scSeaOfTimeFacePoseidon() and scSeaOfTimeSweptBack().

Definition at line 146 of file sea_of_time.c.

SWIRL_SQUARE

#define SWIRL_SQUARE(coordinate) ((coordinate) >> 21)

The 32-pixel square, two metatiles across, that a 16.16 coordinate lies in, and a square's corner: a swirl's eye is one such square, and its ring the eight round it.

Referenced by scSeaOfTimeRideCurrent().

Definition at line 221 of file sea_of_time.c.

SWIRL_SQUARE_CORNER

#define SWIRL_SQUARE_CORNER(square) ((square) << 21)

Referenced by scSeaOfTimeRideCurrent().

Definition at line 222 of file sea_of_time.c.

SWIRL_SQUARE_ORIGIN

#define SWIRL_SQUARE_ORIGIN(coordinate)

Referenced by scSeaOfTimeCircleSwirl().

Definition at line 223 of file sea_of_time.c.

CURRENT_HOLD_DISTANCE

#define CURRENT_HOLD_DISTANCE 46

How far, in pixels, the ship may drift from a swirl's eye before the ring's current pulls it back in.

Referenced by scSeaOfTimeRideCurrent().

Definition at line 227 of file sea_of_time.c.

CURRENT_SPRAY_REACH

#define CURRENT_SPRAY_REACH 10

How far either side of the ship its spray is thrown, in pixels: by a swirl's ring, and by a channel or rough water.

Referenced by scSeaOfTimeRideCurrent().

Definition at line 230 of file sea_of_time.c.

CHANNEL_SPRAY_REACH

#define CHANNEL_SPRAY_REACH 12

Referenced by scSeaOfTimeFollowChannel() and scSeaOfTimePushBackInRoughWater().

Definition at line 231 of file sea_of_time.c.

QUARTER_TURNS

#define QUARTER_TURNS(n) ((n) << 14)

n quarter turns as an angle, DEGtoANG(90) apiece.

Referenced by scSeaOfTimeFollowChannel().

Definition at line 233 of file sea_of_time.c.

SEA_PALETTE

#define SEA_PALETTE 3

The sea's background palette, whose colours 1 to SEA_COLORS the waves tint and the sea's tick callback turns round; the next palette's turn as the water flows.

Referenced by scInit(), scSeaOfTimeAnimateSea() and scSeaOfTimeFacePoseidon().

Definition at line 238 of file sea_of_time.c.

SEA_COLORS

#define SEA_COLORS 14

Referenced by scInit(), scSeaOfTimeAnimateSea() and scSeaOfTimeFacePoseidon().

Definition at line 239 of file sea_of_time.c.

FLOW_PALETTE

#define FLOW_PALETTE (SEA_PALETTE + 1)

Referenced by scSeaOfTimeAnimateSea().

Definition at line 240 of file sea_of_time.c.

WAVE_RED

#define WAVE_RED 11

The colour the waves tint the sea's colours toward, a step a channel at a time.

Referenced by scInit() and scSeaOfTimeFacePoseidon().

Definition at line 243 of file sea_of_time.c.

WAVE_GREEN

#define WAVE_GREEN 6

Referenced by scInit() and scSeaOfTimeFacePoseidon().

Definition at line 244 of file sea_of_time.c.

WAVE_BLUE

#define WAVE_BLUE 23

Referenced by scInit() and scSeaOfTimeFacePoseidon().

Definition at line 245 of file sea_of_time.c.

WAVE_COLOR_STEP_TICKS

#define WAVE_COLOR_STEP_TICKS 360

The ticks between the sea's colour steps while the waves run.

Referenced by scSeaOfTimeStartWaves().

Definition at line 247 of file sea_of_time.c.

PULSE_COLOR

#define PULSE_COLOR BG_PLTT_COLOR(0, 15)

The background colour whose red pulses while no waves run, between PULSE_RED_MIN and full: colour 15 of background palette 0.

Referenced by scInit() and scSeaOfTimeAnimateSea().

Definition at line 250 of file sea_of_time.c.

PULSE_RED_MIN

#define PULSE_RED_MIN 18

Referenced by scSeaOfTimeAnimateSea().

Definition at line 251 of file sea_of_time.c.

RIPPLE_SHIFT

#define RIPPLE_SHIFT 15

The ripple's sine shifted down to a swing of two pixels each way.

Referenced by scSeaOfTimeAnimateSea().

Definition at line 253 of file sea_of_time.c.

PUFF_SHOWER_TICKS

#define PUFF_SHOWER_TICKS 360

The shower of water over Poseidon: PUFF_SHOWER_TICKS long, a puff every 16 ticks, from PUFF_SHOWER_FASTER every 8 and from PUFF_SHOWER_FASTEST every other tick, each somewhere in a PUFF_SPREAD-pixel square; BIG_PUFFS larger ones follow, one a tick.

Referenced by scSeaOfTimeFacePoseidon() and scSeaOfTimeOpen().

Definition at line 258 of file sea_of_time.c.

PUFF_SHOWER_FASTER

#define PUFF_SHOWER_FASTER 120

Referenced by scSeaOfTimeFacePoseidon() and scSeaOfTimeOpen().

Definition at line 259 of file sea_of_time.c.

PUFF_SHOWER_FASTEST

#define PUFF_SHOWER_FASTEST 240

Referenced by scSeaOfTimeFacePoseidon() and scSeaOfTimeOpen().

Definition at line 260 of file sea_of_time.c.

PUFF_SPREAD

#define PUFF_SPREAD 32

Referenced by scSeaOfTimeFacePoseidon() and scSeaOfTimeOpen().

Definition at line 261 of file sea_of_time.c.

BIG_PUFFS

#define BIG_PUFFS 16

Referenced by scSeaOfTimeFacePoseidon() and scSeaOfTimeOpen().

Definition at line 262 of file sea_of_time.c.

LAP_METATILES

#define LAP_METATILES 8

The lap squares round each trunk, in order round it.

Referenced by scSeaOfTimeCountLaps() and SeaOfTimeLapsNeeded.

Definition at line 651 of file sea_of_time.c.

LAP_STEP_TICKS

#define LAP_STEP_TICKS 50

The ticks the ship may take from one lap square to the next before its count starts again.

Referenced by scSeaOfTimeCountLaps().

Definition at line 654 of file sea_of_time.c.

LAP_STEPS_BEFORE_SPARKLES

#define LAP_STEPS_BEFORE_SPARKLES 3

The squares round after which stars rise about the trunk, somewhere in a SPARKLE_SPREAD-pixel square.

Referenced by scSeaOfTimeCountLaps().

Definition at line 657 of file sea_of_time.c.

SPARKLE_SPREAD

#define SPARKLE_SPREAD 32

Referenced by scSeaOfTimeCountLaps().

Definition at line 658 of file sea_of_time.c.

WAVE_TICKS

#define WAVE_TICKS 120

The ticks the waves run.

Referenced by scSeaOfTimeTimeWaves().

Definition at line 772 of file sea_of_time.c.

STEP_TOWARD

#define STEP_TOWARD(channel, target, changed)

Steps one of a colour's channels a unit toward its target, setting changed if it moved: the sea's colours fade a step at a time this way, toward the waves' colour and back to the colours saved on arrival.

Definition at line 791 of file sea_of_time.c.

STEP_SEA_TOWARD_WAVES

#define STEP_SEA_TOWARD_WAVES(palette, i, changed)

One step of the sea's colours (SEA_PALETTE from colour 1) toward the waves' colour, every channel of each a unit nearer.

Referenced by scSeaOfTimeOpen() and scSeaOfTimeStartWaves().

Definition at line 807 of file sea_of_time.c.

STEP_SEA_TOWARD_SAVED_COLORS

#define STEP_SEA_TOWARD_SAVED_COLORS(palette, saved, i, j, changed)

One step of the sea's colours back toward those saved on arrival (SeaOfTimeSavedColors, the sea's from colour 1 on).

Referenced by scSeaOfTimeFacePoseidon() and scSeaOfTimeStopWaves().

Definition at line 823 of file sea_of_time.c.

ENCOUNTER_SLOT_POSEIDON

#define ENCOUNTER_SLOT_POSEIDON 6

Poseidon's battle, in the story battles' encounter table.

Referenced by scSeaOfTimeFacePoseidon().

Definition at line 1057 of file sea_of_time.c.

POSEIDON_ANIMATION_POINT_TRIDENT

#define POSEIDON_ANIMATION_POINT_TRIDENT 1

Poseidon swinging his trident down to point it at the ship, in his sprite sheet's numbering.

Referenced by scSeaOfTimeFacePoseidon().

Definition at line 1060 of file sea_of_time.c.

DEFINE_GRIND_ROCK

#define DEFINE_GRIND_ROCK(name, rock, flag)

Defines what Grind on a rock does: the rock is ground away (scSeaOfTimeRemoveRock) and its flag set, so it is gone for good.

Definition at line 1199 of file sea_of_time.c.

DEFINE_LEAVE_BY_EXIT

#define DEFINE_LEAVE_BY_EXIT(name, exit)

Defines a step cue that leaves the scene by exit, the screen closing.

Definition at line 1238 of file sea_of_time.c.

ROCK_RISE_TICKS

#define ROCK_RISE_TICKS 10

The ticks a rock takes to grow to its height out of the sea.

Referenced by scSeaOfTimeRaiseRock().

Definition at line 1378 of file sea_of_time.c.

Enumerations in detail

anonymous enum

enum { ACTOR_SHIP, ACTOR_ROCK_A, ACTOR_ROCK_B, ACTOR_ROCK_C, … }

The Lemurian ship the party sails, and the rocks that rise in the last stretch. The ship's row places it blank, and it wears the ship's sprite sheet (SPRITE_WINGED_SHIP) on the water.

EnumeratorValueDescription
ACTOR_SHIPACTOR_FIRST_PLACED
ACTOR_ROCK_AThe grey rocks that rise out of the last stretch's north part once Poseidon is beaten, for Grind to clear: A on metatiles (10, 11) to (11, 12), B on (18, 8) to (19, 9), D on (23, 13) to (24, 14) and E on (29, 9) to (30, 10). Rock C is never placed. In the south part, rock A's row stands for one more rock, on (44, 42) to (45, 43), under its own flag.
ACTOR_ROCK_B
ACTOR_ROCK_C
ACTOR_ROCK_D
ACTOR_ROCK_E

Definition at line 114 of file sea_of_time.c.

anonymous enum

enum { FLAG_ROCK_A_CLEARED, FLAG_ROCK_B_CLEARED, FLAG_ROCK_C_CLEARED, FLAG_ROCK_D_CLEARED, … }

Set as Grind clears each rock; a cleared rock is not placed again.

EnumeratorValueDescription
FLAG_ROCK_A_CLEARED0xa90
FLAG_ROCK_B_CLEARED
FLAG_ROCK_C_CLEARED
FLAG_ROCK_D_CLEARED
FLAG_ROCK_E_CLEARED
FLAG_ROCK_SOUTH_CLEARED

Definition at line 130 of file sea_of_time.c.

SEA_OF_TIME_METATILE_BEHAVIOR

enum SEA_OF_TIME_METATILE_BEHAVIOR

The kinds of water the ship sails over. A swirl is six metatiles square: a ring of eight 2 by 2 squares of current, each named for where it lies on the ring, round a 2 by 2 eye that turns clockwise or counterclockwise. Rough water turns the ship back; a channel carries it straight on, east, south, west or north; the metatiles at the sea's edge where the channels run out sweep it out of the sea; and the eight 2 by 2 lap squares round each trunk, numbered in order round it from METATILE_BEHAVIOR_LAP_FIRST, count its laps. The sea's metatiles sit on its own layer, which the map keeps 64 columns east of the ground's; the metatiles named below are the ground's.

EnumeratorValueDescription
METATILE_BEHAVIOR_SWIRL_RING_SOUTH30
METATILE_BEHAVIOR_SWIRL_RING_SOUTHEAST
METATILE_BEHAVIOR_SWIRL_RING_EAST
METATILE_BEHAVIOR_SWIRL_RING_NORTHEAST
METATILE_BEHAVIOR_SWIRL_RING_NORTH
METATILE_BEHAVIOR_SWIRL_RING_NORTHWEST
METATILE_BEHAVIOR_SWIRL_RING_WEST
METATILE_BEHAVIOR_SWIRL_RING_SOUTHWEST
METATILE_BEHAVIOR_SWIRL_COUNTERCLOCKWISE40
METATILE_BEHAVIOR_SWIRL_CLOCKWISE
METATILE_BEHAVIOR_ROUGH_WATER44
METATILE_BEHAVIOR_CHANNEL_EAST
METATILE_BEHAVIOR_CHANNEL_SOUTH
METATILE_BEHAVIOR_CHANNEL_WEST
METATILE_BEHAVIOR_CHANNEL_NORTH
METATILE_BEHAVIOR_SWEPT_BACK
METATILE_BEHAVIOR_LAP_FIRST

Definition at line 157 of file sea_of_time.c.

SEA_OF_TIME_RAISED_CUE

enum SEA_OF_TIME_RAISED_CUE

The raised cues of the waves: the laps round a trunk are done, and the waves are over.

EnumeratorValueDescription
RAISED_START_WAVES200
RAISED_STOP_WAVES

Definition at line 180 of file sea_of_time.c.

anonymous enum

enum { CUE_TO_WORLD_MAP, CUE_BACK_NORTH, CUE_BEFORE_POSEIDON }

The last stretch's step cues: in the north part, metatiles (20, 18) to (23, 20), where the ship meets Poseidon; in the south part, the way off its west edge to the world map and the way off its east edge back north.

EnumeratorValueDescription
CUE_TO_WORLD_MAP1
CUE_BACK_NORTH2
CUE_BEFORE_POSEIDON5

Definition at line 189 of file sea_of_time.c.

anonymous enum

enum { NORTH_PART_LAST_ENTRANCE, ENTRANCE_FROM_SOUTH_PART, ENTRANCE_AFTER_POSEIDON, ENTRANCE_FROM_NORTH_PART, … }

The last stretch's north part is reached by entrances 1 to NORTH_PART_LAST_ENTRANCE; the last is where the ship waits after Poseidon's battle. The north part's way down to the south part, at its west edge, is its exit 2, arriving by entrance 6, and the south part's way back north is its exit 5, arriving by entrance 2.

EnumeratorValueDescription
NORTH_PART_LAST_ENTRANCE4
ENTRANCE_FROM_SOUTH_PART2
ENTRANCE_AFTER_POSEIDON4
ENTRANCE_FROM_NORTH_PART6
EXIT_TO_SOUTH_PART2
EXIT_BACK_NORTH5

Definition at line 201 of file sea_of_time.c.

Functions in detail

scSeaOfTimeRemoveRock

void scSeaOfTimeRemoveRock(Sint32 x, Sint32 z, Sint32 actor)

A rock Grind has broken is gone from the sea, and the ship can sail over its 2 by 2 metatiles.

References scMapMetatileSetAttributes() and Sint32.

Definition at lines 48 and 1185 of file sea_of_time.c.

scSeaOfTimePlaceRock

void scSeaOfTimePlaceRock(Sint32 x, Sint32 z, Sint32 actor)

Puts a rock in the last stretch, which the ship cannot sail through. x and z count half metatiles of 8 pixels, from the map's top left, and the rock covers the 2 by 2 metatiles round that point.

References fdActorGetById(), fdActorSetPosFX(), scMapMetatileSetAttributes() and Sint32.

Referenced by scInit() and scSeaOfTimeRaiseRock().

Definition at lines 49 and 1383 of file sea_of_time.c.

scSeaOfTimeCos

static inline Sint32 scSeaOfTimeCos(Sint32 angle)

syCos, through an inline as the swirl's turn calls it.

References Sint32 and syCos().

Referenced by scSeaOfTimeCircleSwirl() and scSeaOfTimeRideCurrent().

Definition at line 52 of file sea_of_time.c.

scSeaOfTimeTimeWaves

void scSeaOfTimeTimeWaves(void)

While the waves run, ends them WAVE_TICKS after the sea has gone still, and keeps the tick it went still, the swirls' pace and the tick count in case the scene is left and entered again.

References SeaOfTimeLastSwirlStepTick, SeaOfTimeSwirlStepTicks and TickCount.

Referenced by scInit(), scSeaOfTimeStartWaves() and scSeaOfTimeStopWaves().

Definition at lines 68 and 777 of file sea_of_time.c.

scSeaOfTimeRideCurrent

void scSeaOfTimeRideCurrent(void)

The Lemurian ship sails into the ring of current round a swirl's eye, and the current carries it round the eye, clockwise or counterclockwise as the swirl turns, with a rushing sound and white spray thrown up on both sides. A ship that drifts too far out is pulled back toward the eye.

Each ring metatile's name says where it lies about the eye, so the eye is one 32-pixel square (SWIRL_SQUARE) the other way.

References fdActorGetById(), fdScriptPlaySound(), scFieldEffectSpawn(), scMapMetatileGetAttributes(), scPosFlatDistance(), scSeaOfTimeCos(), Sint32, syCos(), sySin() and TickCount.

Referenced by SeaOfTimeNorthPartCues and SeaOfTimeSwirlsCues.

Definition at lines 75 and 325 of file sea_of_time.c.

scSeaOfTimeCountLaps

void scSeaOfTimeCountLaps(void)

The Lemurian ship sails round one of the trunks, the little volcanoes in the great sea, and keeps going the same way round. Soon stars rise glittering about the trunk, and after two laps or three, as the trunk needs, the waves start. Turning back or dawdling starts the count again.

Each of the trunk's eight lap squares counts one step when the ship enters it from the one before, within LAP_STEP_TICKS; the trunks, numbered on the ground layer, need SeaOfTimeLapsNeeded steps. The trunk on metatiles (4, 8) to (9, 13), by the way to the last stretch, is one of them.

References fdActorGetById(), fdScriptPlaySound(), scFieldEffectSpawn(), scMapMetatileGetAttributes(), SeaOfTimeLapCount, SeaOfTimeLapsNeeded, SeaOfTimeLapSpots, SeaOfTimeLapTurn, SeaOfTimeLastLapMetatile, SeaOfTimeLastLapTick, Sint32, syRandom() and TickCount.

Referenced by SeaOfTimeSwirlsCues.

Definition at lines 77 and 669 of file sea_of_time.c.

scGetEntrances

const SCENE_ENTRANCE *scGetEntrances(void)

References SceneEntrances.

Definition at line 94 of file sea_of_time.c.

scGetExitRegions

const SCENE_REGION *scGetExitRegions(void)

Definition at line 99 of file sea_of_time.c.

scGetExits

const Uint32 *scGetExits(void)

References SceneExits.

Definition at line 104 of file sea_of_time.c.

scGetActorPlacements

const ACTOR_PLACE *scGetActorPlacements(void)

References MainRoutineStateWork, SeaOfTimePoseidonPlacements and SeaOfTimeSwirlsPlacements.

Definition at line 211 of file sea_of_time.c.

scSeaOfTimeCircleSwirl

void scSeaOfTimeCircleSwirl(void)

The Lemurian ship sails into the dark eye of a swirl, and the swirl pulls it into the very middle and spins it round there, clockwise or counterclockwise as the swirl turns, until the player steers it out. Each eye is 2 by 2 metatiles, such as metatiles (48, 6) to (49, 7).

References fdActorGetById(), scMapMetatileGetAttributes(), scPosFlatDistance(), scSeaOfTimeCos(), Sint32 and sySin().

Referenced by SeaOfTimeNorthPartCues and SeaOfTimeSwirlsCues.

Definition at line 268 of file sea_of_time.c.

scSeaOfTimeFollowChannel

void scSeaOfTimeFollowChannel(void)

The Lemurian ship sails onto a channel, a straight strip of striped rushing water, and is carried fast along it to its end, east, south, west or north, spray flying from both sides. Some channels run off the edge of the sea, where it is swept out. While the waves run, the channels carry nothing.

References fdActorGetById(), fdActorHasArrived(), fdActorSetMoveTarget(), fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptStart(), scFieldEffectSpawn(), scMapMetatileGetAttributes(), Sint32, syCos(), sySin(), sySoundPlay(), sySynch() and TickCount.

Referenced by SeaOfTimeNorthPartCues, SeaOfTimeSouthPartCues and SeaOfTimeSwirlsCues.

Definition at line 510 of file sea_of_time.c.

scSeaOfTimeStartWaves

void scSeaOfTimeStartWaves(void)

The waves start once the ship has circled a trunk enough times: with a rising sound, the stripes and swirls in the water fade over a few seconds until the sea lies flat, and the channels stop carrying the ship. They last two seconds once the sea is still.

The sea's colours step toward one colour (WAVE_RED, WAVE_GREEN, WAVE_BLUE) every 10 ticks, and its colour cycle slows to a step every WAVE_COLOR_STEP_TICKS; scSeaOfTimeTimeWaves ends them.

References fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptPlaySound(), fdScriptSetFlag(), fdScriptStart(), scSeaOfTimeTimeWaves(), SeaOfTimeLastSwirlStepTick, SeaOfTimeSwirlStepTicks, Sint32, sySetEvent(), sySynch() and TickCount.

Referenced by SeaOfTimeSwirlsCues.

Definition at line 850 of file sea_of_time.c.

scSeaOfTimeStopWaves

void scSeaOfTimeStopWaves(void)

The waves stop: with a higher sound the stripes and swirls come back into the water over a few seconds, and the channels carry the ship again.

The sea's colours step back to the ones saved on arrival every 10 ticks.

References fdScriptClearFlag(), fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptStart(), scSeaOfTimeTimeWaves(), SeaOfTimeSwirlStepTicks, Sint32, syCloseEvent(), sySoundPlay() and sySynch().

Referenced by SeaOfTimeSwirlsCues.

Definition at line 881 of file sea_of_time.c.

scSeaOfTimePushBackInRoughWater

void scSeaOfTimePushBackInRoughWater(void)

The Lemurian ship sails into the rough water of the great sea's north, the band along the north edge at metatiles (46, 1) to (61, 3) or the one at (18, 8) to (35, 9), and the water pushes it back south a little, spray flying from both sides, every time it tries.

References fdActorGetById(), fdActorHasArrived(), fdActorSetMoveTarget(), fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptStart(), scFieldEffectSpawn(), Sint32, syCos(), sySin(), sySynch() and TickCount.

Referenced by SeaOfTimeSwirlsCues.

Definition at line 911 of file sea_of_time.c.

scSeaOfTimeSweptBack

void scSeaOfTimeSweptBack(void)

A channel runs the Lemurian ship off the edge of the great sea, at metatiles (16, 63), (32, 63) or (48, 63) in the south or (62, 16) in the east, and the screen fades. The first time the party finds itself back aboard the ship, talking over how to find the way; after that the ship comes out on the world map.

References fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptFinishScreenTransition(), fdScriptGetFlag(), fdScriptSetFlag(), fdScriptStart(), fdScriptWaitTransitionTicks() and syImportScriptSetExitRequest().

Referenced by SeaOfTimeSwirlsCues.

Definition at line 1010 of file sea_of_time.c.

scSeaOfTimeUpdateWater

void scSeaOfTimeUpdateWater(ACTOR *actor)

Each tick Poseidon stands over the sea, water splashes up at his feet, every other tick somewhere across his width.

References scFieldEffectSpawn(), Sint32, syRandom() and TickCount.

Referenced by scSeaOfTimeFacePoseidon() and scSeaOfTimeOpen().

Definition at line 1031 of file sea_of_time.c.

scSeaOfTimeFacePoseidon

void scSeaOfTimeFacePoseidon(void)

The Lemurian ship sails up the last stretch to metatiles (20, 18) to (23, 20), and Poseidon is met: the ship sails north on its own as the camera rises, the music stops, the water goes flat and its patterns slowly return, a shower of water bursts over the sea, faster and faster, and Poseidon rises out of it. His battle starts at once, with no running away, and after it the ship is back here, at ENTRANCE_AFTER_POSEIDON.

References fdActorGetById(), fdActorSelectAnimation(), fdActorWaitForMoveById(), fdActorWalkTo(), fdCameraWaitForArrival(), fdMapGridCopyMetatileTilesIndicesRect(), fdRequestBattleFromEncounterTable(), fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptSetAfterBattleDestination(), fdScriptStart(), fdScriptWait(), MainRoutineStateWork, scFieldEffectSpawn(), scSeaOfTimeUpdateWater(), Sint32, syDMAXCopy(), syGameFlagSet(), syImportActorCreate(), syRandom(), sySoundPlay() and sySynch().

Referenced by SeaOfTimeNorthPartCues.

Definition at line 1068 of file sea_of_time.c.

scSeaOfTimeGrindRockA

DEFINE_GRIND_ROCK(scSeaOfTimeGrindRockA, ACTOR_ROCK_A, FLAG_ROCK_A_CLEARED)

Felix casts Grind on one of the rocks that rose in the last stretch's north part after Poseidon's battle, the one on metatiles (10, 11) to (11, 12), and it is gone for good. The other rocks, on (18, 8), (23, 13) and (29, 9), have scripts of their own, made the same way.

Referenced by SeaOfTimeNorthPartCues.

Definition at line 1216 of file sea_of_time.c.

scSeaOfTimeGrindRockB

DEFINE_GRIND_ROCK(scSeaOfTimeGrindRockB, ACTOR_ROCK_B, FLAG_ROCK_B_CLEARED)

As scSeaOfTimeGrindRockA, for the rock on metatiles (18, 8) to (19, 9).

Referenced by SeaOfTimeNorthPartCues.

Definition at line 1219 of file sea_of_time.c.

scSeaOfTimeGrindRockC

DEFINE_GRIND_ROCK(scSeaOfTimeGrindRockC, ACTOR_ROCK_C, FLAG_ROCK_C_CLEARED)

Unused: Grind on a third rock, ACTOR_ROCK_C, which no arrival raises or places, so its cue is never met.

Referenced by SeaOfTimeNorthPartCues.

Definition at line 1223 of file sea_of_time.c.

scSeaOfTimeGrindRockD

DEFINE_GRIND_ROCK(scSeaOfTimeGrindRockD, ACTOR_ROCK_D, FLAG_ROCK_D_CLEARED)

As scSeaOfTimeGrindRockA, for the rock on metatiles (23, 13) to (24, 14).

Referenced by SeaOfTimeNorthPartCues.

Definition at line 1226 of file sea_of_time.c.

scSeaOfTimeGrindRockE

DEFINE_GRIND_ROCK(scSeaOfTimeGrindRockE, ACTOR_ROCK_E, FLAG_ROCK_E_CLEARED)

As scSeaOfTimeGrindRockA, for the rock on metatiles (29, 9) to (30, 10).

Referenced by SeaOfTimeNorthPartCues.

Definition at line 1229 of file sea_of_time.c.

scSeaOfTimeGrindSouthRock

DEFINE_GRIND_ROCK(scSeaOfTimeGrindSouthRock, ACTOR_ROCK_A, FLAG_ROCK_SOUTH_CLEARED)

Felix casts Grind on the rock in the last stretch's south part, on metatiles (44, 42) to (45, 43), and it is gone for good.

Referenced by SeaOfTimeSouthPartCues.

Definition at line 1233 of file sea_of_time.c.

scSeaOfTimeLeaveForWorldMap

DEFINE_LEAVE_BY_EXIT(scSeaOfTimeLeaveForWorldMap, SEA_OF_TIME_POSEIDON_TO_WORLD_MAP_NORTHEAST)

The Lemurian ship sails off the west edge of the last stretch's south part, metatiles (1, 45) to (3, 50), and the screen fades to the world map.

Referenced by SeaOfTimeSouthPartCues.

Definition at line 1251 of file sea_of_time.c.

scSeaOfTimeReturnNorth

DEFINE_LEAVE_BY_EXIT(scSeaOfTimeReturnNorth, EXIT_BACK_NORTH)

The Lemurian ship sails off the east edge of the last stretch's south part, metatiles (55, 44) and (55, 45), and the screen fades to its north part.

Referenced by SeaOfTimeSouthPartCues.

Definition at line 1256 of file sea_of_time.c.

scGetCues

const CUE *scGetCues(void)

References MainRoutineStateWork, SeaOfTimeNorthPartCues, SeaOfTimeSouthPartCues and SeaOfTimeSwirlsCues.

Definition at line 1258 of file sea_of_time.c.

scSeaOfTimeAnimateSea

void scSeaOfTimeAnimateSea(void)

Each tick, keeps the Sea of Time moving: the swirls turn and the channels' stripes flow as their colours are cycled, one colour's red pulses (fading out as the waves start and back as they stop), and the whole sea ripples sideways line by line.

The swirls' colours turn a step at the pace SeaOfTimeSwirlStepTicks sets and the channels' every other tick.

References fdMapGridGetLayer(), fdPaletteFadeSetTarget(), SeaOfTimeLastSwirlStepTick, SeaOfTimeRedPulseStep, SeaOfTimeRippleLines, SeaOfTimeSavedColors, SeaOfTimeSwirlStepTicks, Sint32, syDMAXCopy(), syGameFlagGet(), sySin() and TickCount.

Referenced by scInit() and scSeaOfTimeOpen().

Definition at line 1274 of file sea_of_time.c.

scSeaOfTimeRaiseRock

void scSeaOfTimeRaiseRock(Sint32 x, Sint32 z, Sint32 actor)

A rock rises out of the sea: the camera goes to it, the screen shakes with a clatter, water splashes and the rock grows up out of the splash.

References fdActorGetById(), fdCameraMoveToFX(), fdCameraWaitForArrival(), fdScriptPlaySound(), fdScriptWait(), scFieldEffectSpawn(), scSeaOfTimePlaceRock() and Sint32.

Referenced by scSeaOfTimeOpen().

Definition at line 1403 of file sea_of_time.c.

scSeaOfTimeOpen

void scSeaOfTimeOpen(void)

After Poseidon's battle, back in the last stretch, Poseidon stands over the sea. Four rocks rise out of the water one by one, a shower of water bursts over him until he is gone, the sea's patterns fade away for good, the music comes back, and the way north to Lemuria is open.

References fdActorRelease(), fdCameraWaitForArrival(), fdMapGridCopyMetatilesTo(), fdMapGridWaitForShakeToSettle(), fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptPlaySound(), fdScriptSetFlag(), fdScriptStart(), fdScriptStartScreenTransition(), fdScriptWait(), fdScriptWaitTransitionTicks(), gmPlayMusic(), scFieldActorCreate(), scFieldEffectSpawn(), scSeaOfTimeAnimateSea(), scSeaOfTimeRaiseRock(), scSeaOfTimeUpdateWater(), SeaOfTimeSwirlStepTicks, Sint32, syCloseEvent(), syRandom(), sySetEvent(), sySynch() and TickCount.

Referenced by scInit().

Definition at line 1446 of file sea_of_time.c.

scInit

Sint32 scInit(void)

Sets up the sea. In the great sea, the sea's colours are saved, and if the waves were running when the party left, they are still running. In the last stretch's north part, once Poseidon is beaten, the rocks Grind has not broken are back and the pulsing red is gone; on the arrival from his battle, the sea opens (scSeaOfTimeOpen). In its south part the south rock is placed until it is broken.

References fdPaletteFadeSetTarget(), MainRoutineStateWork, scSeaOfTimeAnimateSea(), scSeaOfTimeOpen(), scSeaOfTimePlaceRock(), scSeaOfTimeTimeWaves(), SeaOfTimeLastSwirlStepTick, SeaOfTimeSavedColors, SeaOfTimeSwirlStepTicks, Sint32, syDMAXCopy(), syGameFlagGet(), sySetEvent() and TickCount.

Definition at line 1566 of file sea_of_time.c.

scPrepareMap

Sint32 scPrepareMap(void)

References fdPaletteFadeSetSource() and Sint32.

Definition at line 1650 of file sea_of_time.c.

Variables in detail

SeaOfTimeLastSwirlStepTick

extern volatile Uint32 SeaOfTimeLastSwirlStepTick

volatile Uint32 SeaOfTimeLastSwirlStepTick

Referenced by scInit(), scSeaOfTimeAnimateSea(), scSeaOfTimeStartWaves() and scSeaOfTimeTimeWaves().

Definition at lines 29 and 1813 of file sea_of_time.c.

SeaOfTimeSwirlStepTicks

extern Uint32 SeaOfTimeSwirlStepTicks

Uint32 SeaOfTimeSwirlStepTicks

Referenced by scInit(), scSeaOfTimeAnimateSea(), scSeaOfTimeOpen(), scSeaOfTimeStartWaves(), scSeaOfTimeStopWaves() and scSeaOfTimeTimeWaves().

Definition at lines 30 and 1814 of file sea_of_time.c.

SeaOfTimePoseidonPlacements

extern ACTOR_PLACE SeaOfTimePoseidonPlacements[]

ACTOR_PLACE SeaOfTimePoseidonPlacements[]

References SeaOfTimeShipRests and Sint32.

Referenced by scGetActorPlacements().

Definition at lines 65 and 1747 of file sea_of_time.c.

SeaOfTimeLastLapTick

extern Uint32 SeaOfTimeLastLapTick

Uint32 SeaOfTimeLastLapTick

Referenced by scSeaOfTimeCountLaps().

Definition at lines 66 and 1812 of file sea_of_time.c.

SeaOfTimeSwirlsCues

extern CUE SeaOfTimeSwirlsCues[]

CUE SeaOfTimeSwirlsCues[]

References scSeaOfTimeCircleSwirl(), scSeaOfTimeCountLaps(), scSeaOfTimeFollowChannel(), scSeaOfTimePushBackInRoughWater(), scSeaOfTimeRideCurrent(), scSeaOfTimeStartWaves(), scSeaOfTimeStopWaves() and scSeaOfTimeSweptBack().

Referenced by scGetCues().

Definition at lines 70 and 1816 of file sea_of_time.c.

SeaOfTimeNorthPartCues

extern CUE SeaOfTimeNorthPartCues[]

CUE SeaOfTimeNorthPartCues[]

References scSeaOfTimeCircleSwirl(), scSeaOfTimeFacePoseidon(), scSeaOfTimeFollowChannel(), scSeaOfTimeGrindRockA(), scSeaOfTimeGrindRockB(), scSeaOfTimeGrindRockC(), scSeaOfTimeGrindRockD(), scSeaOfTimeGrindRockE() and scSeaOfTimeRideCurrent().

Referenced by scGetCues().

Definition at lines 72 and 1904 of file sea_of_time.c.

SeaOfTimeSouthPartCues

extern CUE SeaOfTimeSouthPartCues[]

CUE SeaOfTimeSouthPartCues[]

References scSeaOfTimeFollowChannel(), scSeaOfTimeGrindSouthRock(), scSeaOfTimeLeaveForWorldMap() and scSeaOfTimeReturnNorth().

Referenced by scGetCues().

Definition at lines 73 and 1963 of file sea_of_time.c.

SeaOfTimeRedPulseStep

extern Sint16 SeaOfTimeRedPulseStep[1]

Sint16 SeaOfTimeRedPulseStep[]

The step the sea's red pulse takes each time it brightens or dims.

Referenced by scSeaOfTimeAnimateSea().

Definition at lines 74 and 1989 of file sea_of_time.c.

SeaOfTimeShipRests

extern Sint32 SeaOfTimeShipRests[]

Sint32 SeaOfTimeShipRests[]

References scShipDropShadow() and Sint32.

Referenced by SeaOfTimePoseidonPlacements and SeaOfTimeSwirlsPlacements.

Definition at lines 82 and 1685 of file sea_of_time.c.

SeaOfTimeRippleLines

Uint16 SeaOfTimeRippleLines[DISPLAY_HEIGHT]

The sea's horizontal offset for each screen line as it ripples sideways (scSeaOfTimeAnimateSea).

Referenced by scSeaOfTimeAnimateSea().

Definition at line 86 of file sea_of_time.c.

SeaOfTimeSwirlsPlacements

extern ACTOR_PLACE SeaOfTimeSwirlsPlacements[]

ACTOR_PLACE SeaOfTimeSwirlsPlacements[]

References SeaOfTimeShipRests and Sint32.

Referenced by scGetActorPlacements().

Definition at lines 109 and 1734 of file sea_of_time.c.

SeaOfTimeLapCount

extern Uint16 SeaOfTimeLapCount

Uint16 SeaOfTimeLapCount

Referenced by scSeaOfTimeCountLaps().

Definition at lines 644 and 1810 of file sea_of_time.c.

SeaOfTimeLapTurn

extern Sint16 SeaOfTimeLapTurn

Sint16 SeaOfTimeLapTurn

Referenced by scSeaOfTimeCountLaps().

Definition at lines 645 and 1811 of file sea_of_time.c.

SeaOfTimeLastLapMetatile

extern Uint16 SeaOfTimeLastLapMetatile

Uint16 SeaOfTimeLastLapMetatile

The ship's laps round a trunk: the last step cue it crossed, the steps counted, the way it turns and the tick of its last step; then the tick the swirls' colours last turned a step, and the ticks between their steps (1 as the sea flows, WAVE_COLOR_STEP_TICKS while the waves run).

Referenced by scSeaOfTimeCountLaps().

Definition at lines 646 and 1809 of file sea_of_time.c.

SeaOfTimeLapSpots

extern SPOTS SeaOfTimeLapSpots

SPOTS SeaOfTimeLapSpots

Where the sparkles rise round each trunk as the ship's laps add up, in 16.16 pixels.

Referenced by scSeaOfTimeCountLaps().

Definition at lines 647 and 1669 of file sea_of_time.c.

SeaOfTimeLapsNeeded

extern Uint8 SeaOfTimeLapsNeeded[]

Uint8 SeaOfTimeLapsNeeded[]

The steps round each trunk the ship must sail before the waves start.

Referenced by scSeaOfTimeCountLaps().

Definition at lines 648 and 1663 of file sea_of_time.c.

SeaOfTimeSavedColors

SAVED_COL SeaOfTimeSavedColors

Referenced by scInit() and scSeaOfTimeAnimateSea().

Definition at line 875 of file sea_of_time.c.

FieldEffectDurationScripts

const Sint32 *FieldEffectDurationScripts[]

References FieldEffectLongScript, FieldEffectMediumScript, FieldEffectShortScript and Sint32.

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

Definition at line 1679 of file sea_of_time.c.

SceneExits

Uint32 SceneExits[]

Referenced by scGetExits().

Definition at line 1692 of file sea_of_time.c.

On this page

MacrosEnumerationsFunctionsVariablesDescriptionMacros in detailSceneStateWorkEFFECT_SET_MODEEFFECT_SET_SCRIPTEFFECT_SPRITE_PRIORITYFLAG_WAVES_RUNNINGFLAG_SWEPT_BACK_ONCESWIRL_SQUARESWIRL_SQUARE_CORNERSWIRL_SQUARE_ORIGINCURRENT_HOLD_DISTANCECURRENT_SPRAY_REACHCHANNEL_SPRAY_REACHQUARTER_TURNSSEA_PALETTESEA_COLORSFLOW_PALETTEWAVE_REDWAVE_GREENWAVE_BLUEWAVE_COLOR_STEP_TICKSPULSE_COLORPULSE_RED_MINRIPPLE_SHIFTPUFF_SHOWER_TICKSPUFF_SHOWER_FASTERPUFF_SHOWER_FASTESTPUFF_SPREADBIG_PUFFSLAP_METATILESLAP_STEP_TICKSLAP_STEPS_BEFORE_SPARKLESSPARKLE_SPREADWAVE_TICKSSTEP_TOWARDSTEP_SEA_TOWARD_WAVESSTEP_SEA_TOWARD_SAVED_COLORSENCOUNTER_SLOT_POSEIDONPOSEIDON_ANIMATION_POINT_TRIDENTDEFINE_GRIND_ROCKDEFINE_LEAVE_BY_EXITROCK_RISE_TICKSEnumerations in detailanonymous enumanonymous enumSEA_OF_TIME_METATILE_BEHAVIORSEA_OF_TIME_RAISED_CUEanonymous enumanonymous enumFunctions in detailscSeaOfTimeRemoveRockscSeaOfTimePlaceRockscSeaOfTimeCosscSeaOfTimeTimeWavesscSeaOfTimeRideCurrentscSeaOfTimeCountLapsscGetEntrancesscGetExitRegionsscGetExitsscGetActorPlacementsscSeaOfTimeCircleSwirlscSeaOfTimeFollowChannelscSeaOfTimeStartWavesscSeaOfTimeStopWavesscSeaOfTimePushBackInRoughWaterscSeaOfTimeSweptBackscSeaOfTimeUpdateWaterscSeaOfTimeFacePoseidonscSeaOfTimeGrindRockAscSeaOfTimeGrindRockBscSeaOfTimeGrindRockCscSeaOfTimeGrindRockDscSeaOfTimeGrindRockEscSeaOfTimeGrindSouthRockscSeaOfTimeLeaveForWorldMapscSeaOfTimeReturnNorthscGetCuesscSeaOfTimeAnimateSeascSeaOfTimeRaiseRockscSeaOfTimeOpenscInitscPrepareMapVariables in detailSeaOfTimeLastSwirlStepTickSeaOfTimeSwirlStepTicksSeaOfTimePoseidonPlacementsSeaOfTimeLastLapTickSeaOfTimeSwirlsCuesSeaOfTimeNorthPartCuesSeaOfTimeSouthPartCuesSeaOfTimeRedPulseStepSeaOfTimeShipRestsSeaOfTimeRippleLinesSeaOfTimeSwirlsPlacementsSeaOfTimeLapCountSeaOfTimeLapTurnSeaOfTimeLastLapMetatileSeaOfTimeLapSpotsSeaOfTimeLapsNeededSeaOfTimeSavedColorsFieldEffectDurationScriptsSceneExits