src/scene/lemuria_spring.c
The Spring of Lemuria, up in the middle of the town past the man who offers the test of luck. More…
#include "item_ids.h"#include "game/game.h"#include "macros.h"#include "field/script_inline.h"#include "field/field_engine_script.h"#include "scene/scene.h"#include "window/window.h"#include "edition.h"#include "field/call.h"#include "field/field_engine.h"#include "text/msg_ids.h"
Macros
| Name | Description | |
|---|---|---|
#define | LEMURIA_SPRING_COIN_TRAIL (n) (ACTOR_LEMURIA_SPRING_COIN_SHADOW - (n)) | The actor that draws toss->trail[n] of a tossed coin or medal, n from 1. |
#define | LEMURIA_SPRING_MEDAL_TRAIL (n) (ACTOR_LEMURIA_SPRING_MEDAL_SHADOW - (n)) | |
#define | FLAG_LEMURIA_SPRING_TARGET_SHOWN FLAG_SCENE_TEMP(0x00) | Set once the spring's water has faded to show the target at its bottom, for the rest of the visit. |
#define | LEMURIA_SPRING_CENTER_X toFIXED(120) | The middle of the target, which the target pulls the tossed token toward. |
#define | LEMURIA_SPRING_CENTER_Z toFIXED(71) | |
#define | SPEED_KEPT_SCALE 256 | How much of its speed a token on the water keeps each tick, in 256ths: while the target pulls it, and once it drifts free. |
#define | PULLED_SPEED_KEPT 253 | |
#define | DRIFT_SPEED_KEPT 220 | |
#define | CRAB_TURN_PAUSE_TICKS 30 | The ticks the second crab waits at each end of its way. |
#define | TURTLE_SWIM_TURN (TRIG_TURN / 1024) | A turtle's slowest swim round its loop, a 1024th of a turn a tick. |
#define | PRIZE_ECLIPSE (-1) | scLemuriaSpringGivePrize's item for the summon Eclipse. |
#define | MEDAL_PRIZE_COUNT 15 | The items a Lucky Medal can win, and how many more of them each ring out from the middle allows. |
#define | MEDAL_PRIZES_PER_RING 3 | |
#define | WATER_SHIFT_PIXELS 16 | How far the water sinks before it fades. |
#define | COIN_WINDOW_WIDTH FRENCH_OR(19, 17) | French draws the coin window two tiles wider, its numbers 16 pixels further right; Japanese draws them 16 pixels further left, each followed by its counter word. |
#define | COIN_NUMBER_X BY_LANGUAGE(56, 72, 72, 72, 88, 72) | |
#define | TOSS_WINDOW_X JAPANESE_OR(22, 20) | The toss prompt's window: two tiles narrower in Japanese, against the right edge. |
#define | TOSS_WINDOW_WIDTH JAPANESE_OR(7, 9) | |
#define | WEIGHT (i) ((Sint8)MainRoutineStateWork.prizeWeights[i]) | The weight of prize i in the draw of what a toss wins. |
Enumerations
| Name | Description | |
|---|---|---|
enum | LEMURIA_SPRING_ACTOR_ID { ACTOR_LEMURIA_SPRING_COIN_SHADOW, ACTOR_LEMURIA_SPRING_COIN, … } | The spring's actors, as The Broken Seal numbers Tolbi's spring, by the rows of ActorPlacements. |
enum | SPRING_TOSS_KIND { SPRING_TOSS_COIN, SPRING_TOSS_MEDAL } | What the party tosses, as the menu lists them. |
enum | LEMURIA_SPRING_ANIMATION { ANIM_TOKEN_TUMBLE, ANIM_TOKEN_FLOAT, ANIM_TOKEN_REST, ANIM_T … } | Animations of the spring's sprites, as The Broken Seal names Tolbi's. |
enum | LEMURIA_SPRING_METATILE_BEHAVIOR { METATILE_BEHAVIOR_LEMURIA_SPRING_RIM, METATILE_BEHAVIOR_LEMU … } | What searching answers at Lemuria's spring. |
enum | SPRING_TOSS_RESULT { TOSS_RING_MIDDLE, TOSS_RING_SECOND, TOSS_RING_THIRD, TOSS_RI … } | Where a tossed token comes to rest: the target's four rings, the middle first, then none. |
enum | LEMURIA_SPRING_OBSTACLE { OBSTACLE_CRAB_A, OBSTACLE_CRAB_B, OBSTACLE_TURTLE_A, OBSTACL … } | The crabs and turtles in the spring, by their slots in LemuriaSpringObstacles. |
enum | anonymous enum { CRAB_HEADING_EAST, CRAB_HEADING_WEST } | Which way a crab scuttles (its SPRING_OBSTACLE.heading). |
Functions
| Name | Description | |
|---|---|---|
Sint32 | scLemuriaSpringRunSpringGame (void) | The toss: the party picks a coin or a Lucky Medal, throws it, and what lands in the spring's rings wins its prize, as in Tolbi's spring game. |
Sint32 | scLemuriaSpringRunToss () | Tosses the chosen coin or medal and waits for it to come to rest; returns the ring it rests in. |
void | scLemuriaSpringGivePrize (Sint32 item) | A medal's prize comes up out of the spring as at Tolbi's: a roar, the leader turns to the spring, and the prize is brought up to him, an item, or, for the first medal to land in the middle (FLAG_LEMURIA_SPRING_ECLIPSE_WON), the summon Eclipse, read from a tablet. |
void | scLemuriaSpringSetSpriteStorageKind (Sint32 actor, Sint32 active) | Sets how actor id keeps its sprites (ACTOR.spriteStorageKind). |
BSS_DATA | ALIGNED (16) | The crabs and turtles in the toss's way, as the toss moves them. |
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. |
void | scLemuriaSpringDrinkFromSpring (void) | Felix checks the rim of the spring, any of its edges round the pool, before the target has been shown this visit: "Felix and the others drank of the spring. |
void | scLemuriaSpringDrainSpring (void) | The spring's water, the overhead layer, sinks 16 pixels, a pixel every four ticks, then fades away in eight steps to show the target at the bottom of the spring, as Tolbi's does. |
void | scLemuriaSpringTossCoinOrMedal (void) | Felix checks the water from the step at the south of the spring, between the two signs, metatile (7, 8) or (7, 10): he turns his back to the spring to toss a coin or a Lucky Medal into it. |
const CUE * | scGetCues (void) | The scene's cues: the rooms of names' for any entrance above ENTRANCE_NAMES_ABOVE, else the debug room's. |
void | scLemuriaSpringInitTossSimulation (void) | Puts the crabs and turtles where they start, the token out of sight west of the spring, and starts the event that moves them. |
Sint32 | scInit (void) | Starts the scene: the water blended over the target, the slabs at the signs' feet drawn underfoot; arriving from Lemuria, the toss is set up, and the water stays faded once the target has been shown. |
Sint32 | scPrepareMap (void) | Once Briggs is caught the pool has dried up: its colours take the dry ground's. |
static inline void | scLemuriaSpringShowPrizePicture (Sint32 srcColumn, Sint32 srcRow) | Draws one picture of the prize being brought up in the middle of the spring, with SE_CAST, and holds it 8 ticks. |
void | scLemuriaSpringSetActorAppearance ( Sint32 id, Sint32 *pos, Sint32 facing, Sint32 colorMode, Sint32 step) | Sets an actor of the toss where the simulation has it: its position, facing, colour mode and animation step. |
void | scLemuriaSpringUpdateTossSimulation (void) | An event: moves the tossed coin or medal a tick, its trail and shadow behind it, and the crabs and turtles that swim in the spring. |
Variables
| Name | Description | |
|---|---|---|
extern Uint16 | LemuriaSpringCoinPrizes [] | The coins a coin wins by where it lands, the middle first; 0 for a miss. |
extern Uint32 | LemuriaSpringMedalPrizes [MEDAL_PRIZE_COUNT] | The items a medal can win, drawn by the weights in MainRoutineStateWork: the middle ring draws from the first three, each ring further out from three more. |
extern Uint8 | LemuriaSpringCrabColorModes [] | The crabs' colour modes, by speed. |
extern Uint8 | LemuriaSpringTurtleColorModes [] | The turtles' colour modes, by speed. |
extern Uint8 | LemuriaSpringObstacleStartX [] | Where each obstacle starts, across. |
extern Uint8 | LemuriaSpringObstacleStartZ [] | Where each obstacle starts, down. |
extern Uint16 | LemuriaSpringObstacleHeadings [] | The way each obstacle starts heading: the crabs east or west, the turtles by their angle round their loops. |
SPRING_TOSS_MOTION | LemuriaSpringToss | |
Sint32 | LemuriaSpringTossKind | |
SPRING_OBSTACLE | LemuriaSpringObstacles [OBSTACLE_COUNT] | The crabs and turtles in the toss's way, as the toss moves them. |
Sint32 | LemuriaSpringTossTick | |
Sint32 | LemuriaSpringTossEnded | |
Sint32 | LemuriaSpringTossResult | |
extern Uint16 | LemuriaSpringAlphaSteps [] | The blend weights the spring fades in through, eight steps from 10/9 to 0/16 (first target over second, in sixteenths). |
extern Uint8 | MsgLemuriaSpringWhatWillYouThrow [], MsgLemuriaSpringCoins[], MsgLemuriaSpringToss[], MsgLemuriaSpringYouWonCoin[] | The Japanese catalog does not name these yet. |
SCENE_ENTRANCE | SceneEntrances [] | Besides the party's return to the pier after the ship is stolen, four unused spots about the mast: below the huge block, on the dock by its crate, on the deck, and at the top of the sail's east pole. |
Uint32 | SceneExits [] | The room has no exits of its own. |
ACTOR_PLACE | ActorPlacements [] | The room's people: the party's four rows, then PSYNERGY_TEST_ACTOR_ID's. |
CUE | SceneCues [] | The room's scripts: talking to its people, Mind Read on them, the metatiles examined, and the field Psynergy each spot answers. |
Description
The Spring of Lemuria, up in the middle of the town past the man who offers the test of luck. The party drinks from it to restore its HP and PP, and from the step between its two signs tosses coins or Lucky Medals into it, past the turtles and crabs that swim there, as in Tolbi's spring game: what lands in its rings wins coins or items, and the first medal in the middle wins the summon Eclipse.
Macros in detail
LEMURIA_SPRING_COIN_TRAIL
#define LEMURIA_SPRING_COIN_TRAIL(n) (ACTOR_LEMURIA_SPRING_COIN_SHADOW - (n))
The actor that draws toss->trail[n] of a tossed coin or medal, n from 1.
Referenced by scLemuriaSpringRunToss() and scLemuriaSpringUpdateTossSimulation().
Definition at line 67 of file lemuria_spring.c.
LEMURIA_SPRING_MEDAL_TRAIL
#define LEMURIA_SPRING_MEDAL_TRAIL(n) (ACTOR_LEMURIA_SPRING_MEDAL_SHADOW - (n))
Referenced by scLemuriaSpringRunToss() and scLemuriaSpringUpdateTossSimulation().
Definition at line 68 of file lemuria_spring.c.
FLAG_LEMURIA_SPRING_TARGET_SHOWN
#define FLAG_LEMURIA_SPRING_TARGET_SHOWN FLAG_SCENE_TEMP(0x00)
Set once the spring's water has faded to show the target at its bottom, for the rest of the visit.
Referenced by SceneCues, scInit() and scLemuriaSpringTossCoinOrMedal().
Definition at line 108 of file lemuria_spring.c.
LEMURIA_SPRING_CENTER_X
#define LEMURIA_SPRING_CENTER_X toFIXED(120)
The middle of the target, which the target pulls the tossed token toward.
Referenced by scLemuriaSpringUpdateTossSimulation().
Definition at line 111 of file lemuria_spring.c.
LEMURIA_SPRING_CENTER_Z
#define LEMURIA_SPRING_CENTER_Z toFIXED(71)
Referenced by scLemuriaSpringUpdateTossSimulation().
Definition at line 112 of file lemuria_spring.c.
SPEED_KEPT_SCALE
#define SPEED_KEPT_SCALE 256
How much of its speed a token on the water keeps each tick, in 256ths: while the target pulls it, and once it drifts free.
Referenced by scLemuriaSpringUpdateTossSimulation().
Definition at line 127 of file lemuria_spring.c.
PULLED_SPEED_KEPT
#define PULLED_SPEED_KEPT 253
Referenced by scLemuriaSpringUpdateTossSimulation().
Definition at line 128 of file lemuria_spring.c.
DRIFT_SPEED_KEPT
#define DRIFT_SPEED_KEPT 220
Referenced by scLemuriaSpringUpdateTossSimulation().
Definition at line 129 of file lemuria_spring.c.
CRAB_TURN_PAUSE_TICKS
#define CRAB_TURN_PAUSE_TICKS 30
The ticks the second crab waits at each end of its way.
Referenced by scLemuriaSpringUpdateTossSimulation().
Definition at line 150 of file lemuria_spring.c.
TURTLE_SWIM_TURN
#define TURTLE_SWIM_TURN (TRIG_TURN / 1024)
A turtle's slowest swim round its loop, a 1024th of a turn a tick.
Referenced by scLemuriaSpringUpdateTossSimulation().
Definition at line 152 of file lemuria_spring.c.
PRIZE_ECLIPSE
#define PRIZE_ECLIPSE (-1)
scLemuriaSpringGivePrize's item for the summon Eclipse.
Referenced by scLemuriaSpringGivePrize() and scLemuriaSpringRunSpringGame().
Definition at line 155 of file lemuria_spring.c.
MEDAL_PRIZE_COUNT
#define MEDAL_PRIZE_COUNT 15
The items a Lucky Medal can win, and how many more of them each ring out from the middle allows.
Referenced by LemuriaSpringMedalPrizes and scLemuriaSpringRunSpringGame().
Definition at line 159 of file lemuria_spring.c.
MEDAL_PRIZES_PER_RING
#define MEDAL_PRIZES_PER_RING 3
Referenced by scLemuriaSpringRunSpringGame().
Definition at line 160 of file lemuria_spring.c.
WATER_SHIFT_PIXELS
#define WATER_SHIFT_PIXELS 16
How far the water sinks before it fades.
Referenced by scLemuriaSpringDrainSpring().
Definition at line 163 of file lemuria_spring.c.
COIN_WINDOW_WIDTH
#define COIN_WINDOW_WIDTH FRENCH_OR(19, 17)
French draws the coin window two tiles wider, its numbers 16 pixels further right; Japanese draws them 16 pixels further left, each followed by its counter word.
Referenced by fdSuperLuckyDiceRun() and scLemuriaSpringRunSpringGame().
Definition at line 324 of file lemuria_spring.c.
COIN_NUMBER_X
#define COIN_NUMBER_X BY_LANGUAGE(56, 72, 72, 72, 88, 72)
Referenced by scLemuriaSpringRunSpringGame().
Definition at line 325 of file lemuria_spring.c.
TOSS_WINDOW_X
#define TOSS_WINDOW_X JAPANESE_OR(22, 20)
The toss prompt's window: two tiles narrower in Japanese, against the right edge.
Referenced by scLemuriaSpringRunSpringGame().
Definition at line 329 of file lemuria_spring.c.
TOSS_WINDOW_WIDTH
#define TOSS_WINDOW_WIDTH JAPANESE_OR(7, 9)
Referenced by scLemuriaSpringRunSpringGame().
Definition at line 330 of file lemuria_spring.c.
WEIGHT
#define WEIGHT(i) ((Sint8)MainRoutineStateWork.prizeWeights[i])
The weight of prize i in the draw of what a toss wins.
Referenced by scLemuriaSpringRunSpringGame().
Definition at line 333 of file lemuria_spring.c.
Enumerations in detail
LEMURIA_SPRING_ACTOR_ID
enum LEMURIA_SPRING_ACTOR_ID
The spring's actors, as The Broken Seal numbers Tolbi's spring, by the rows
of ActorPlacements.
The toss draws the coin or the medal with its shadow and three trailing
copies, which LEMURIA_SPRING_COIN_TRAIL and LEMURIA_SPRING_MEDAL_TRAIL
number.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_LEMURIA_SPRING_COIN_SHADOW | ACTOR_FIRST_PLACED + 3 | |
ACTOR_LEMURIA_SPRING_COIN | The coin the party tosses | |
ACTOR_LEMURIA_SPRING_MEDAL_SHADOW | ACTOR_LEMURIA_SPRING_COIN + 4 | (SPRITE_SPRING_COIN). |
ACTOR_LEMURIA_SPRING_MEDAL | The Lucky Medal the party tosses (SPRITE_SPRING_LUCKY_MEDAL). | |
ACTOR_LEMURIA_SPRING_CRAB_A | The four obstacles that move in the spring during a toss: two crabs, then two turtles. | |
ACTOR_LEMURIA_SPRING_CRAB_B | ||
ACTOR_LEMURIA_SPRING_TURTLE_A | ||
ACTOR_LEMURIA_SPRING_TURTLE_B | ||
ACTOR_LEMURIA_SPRING_MEDAL_SIGN | East of the spring. | |
ACTOR_LEMURIA_SPRING_COIN_SIGN | West of the spring. | |
ACTOR_LEMURIA_SPRING_EAST_SIGN_SLAB | The grey slabs at the | |
ACTOR_LEMURIA_SPRING_WEST_SIGN_SLAB | foot of each sign: the signs' sprite in its second picture, drawn underfoot (scInit). | |
ACTOR_LEMURIA_SPRING_VISITOR_FACING_AWAY | "If you face away from the spring, toss in a coin..." | |
ACTOR_LEMURIA_SPRING_MAN_WITH_PACK | Unused: a man carrying a pack, placed at the map's corner, where no cue answers him; Tolbi's spring places him to ask for a medal. | |
ACTOR_LEMURIA_SPRING_VISITOR_REMEMBERING_OUTSIDER | "I remember an outsider who came..." | |
ACTOR_LEMURIA_SPRING_SUMMON_TABLET | The stone tablet that brings Eclipse to the leader the first time a medal lands in the middle of the target (scLemuriaSpringGivePrize). |
Definition at line 26 of file lemuria_spring.c.
SPRING_TOSS_KIND
enum SPRING_TOSS_KIND
What the party tosses, as the menu lists them.
| Enumerator | Value | Description |
|---|---|---|
SPRING_TOSS_COIN | ||
SPRING_TOSS_MEDAL |
Definition at line 71 of file lemuria_spring.c.
LEMURIA_SPRING_ANIMATION
enum LEMURIA_SPRING_ANIMATION
Animations of the spring's sprites, as The Broken Seal names Tolbi's. The
coin's and the Lucky Medal's sprite sheets (spring_coin.png,
spring_lucky_medal.png) are drawn alike.
| Enumerator | Value | Description |
|---|---|---|
ANIM_TOKEN_TUMBLE | 0 | turning over once as it is tossed |
ANIM_TOKEN_FLOAT | 1 | turning on the water as it drifts |
ANIM_TOKEN_REST | 2 | lying still |
ANIM_TOKEN_SHADOW | 3 | a grey spot on the ground below it |
ANIM_TOKEN_GLINT | 4 | a twinkle, as each of the three marks trailing a flying token |
ANIM_CRAB_SCUTTLE | 1 | stepping sideways (crab.png) |
ANIM_CRAB_RAISE_CLAWS | 3 | snapping its raised claws (crab.png) |
ANIM_TURTLE_SWIM | 2 | paddling (turtle.png) |
ANIM_TURTLE_HIDE | 3 | head and flippers drawn in (turtle.png) |
ANIM_SIGN_SLAB | 2 | the signpost sheet's second picture, a grey slab (signpost.png) |
Definition at line 80 of file lemuria_spring.c.
LEMURIA_SPRING_METATILE_BEHAVIOR
enum LEMURIA_SPRING_METATILE_BEHAVIOR
What searching answers at Lemuria's spring.
| Enumerator | Value | Description |
|---|---|---|
METATILE_BEHAVIOR_LEMURIA_SPRING_RIM | 25 | The spring's rim: the party drinks from it while its target is hidden. |
METATILE_BEHAVIOR_LEMURIA_SPRING_WATER | 80 | The water before the spring's steps: searched to toss a coin or medal. |
Definition at line 97 of file lemuria_spring.c.
SPRING_TOSS_RESULT
enum SPRING_TOSS_RESULT
Where a tossed token comes to rest: the target's four rings, the middle first, then none.
| Enumerator | Value | Description |
|---|---|---|
TOSS_RING_MIDDLE | ||
TOSS_RING_SECOND | ||
TOSS_RING_THIRD | ||
TOSS_RING_OUTER | ||
TOSS_RING_MISSED |
Definition at line 116 of file lemuria_spring.c.
LEMURIA_SPRING_OBSTACLE
enum LEMURIA_SPRING_OBSTACLE
The crabs and turtles in the spring, by their slots in
LemuriaSpringObstacles.
| Enumerator | Value | Description |
|---|---|---|
OBSTACLE_CRAB_A | ||
OBSTACLE_CRAB_B | ||
OBSTACLE_TURTLE_A | ||
OBSTACLE_TURTLE_B | ||
OBSTACLE_COUNT |
Definition at line 133 of file lemuria_spring.c.
anonymous enum
enum { CRAB_HEADING_EAST, CRAB_HEADING_WEST }
Which way a crab scuttles (its SPRING_OBSTACLE.heading).
| Enumerator | Value | Description |
|---|---|---|
CRAB_HEADING_EAST | ||
CRAB_HEADING_WEST |
Definition at line 143 of file lemuria_spring.c.
Functions in detail
scLemuriaSpringRunSpringGame
Sint32 scLemuriaSpringRunSpringGame(void)
The toss: the party picks a coin or a Lucky Medal, throws it, and what lands in the spring's rings wins its prize, as in Tolbi's spring game.
References fdScriptAskYesNoWithActorAnimation(), fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptGetFlag(), fdScriptOpenMessage(), fdScriptPlaySound(), fdScriptSetFlag(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), gmPartyAdjustCoins(), gmPartyInventoryCountFreeSlots(), gmPartyInventoryCountItem(), gmPartyInventoryRemove(), LemuriaSpringCoinPrizes, LemuriaSpringMedalPrizes, MainRoutineStateWork, mnMessageArgumentPush(), mnMessageCloseFinishedWindows(), mnSelectCoinsOrMedals(), mnTextDrawMessageAsTiles(), mnTextDrawNumberInWindow(), mnWindowClose(), mnWindowCreate(), MsgLemuriaSpringWhatWillYouThrow, PerWork, result, scFieldScriptWait(), scLemuriaSpringGivePrize(), scLemuriaSpringRunToss(), Sint32 and sySynch().
Referenced by scLemuriaSpringTossCoinOrMedal().
Definition at lines 165 and 337 of file lemuria_spring.c.
scLemuriaSpringRunToss
Sint32 scLemuriaSpringRunToss()
Sint32 scLemuriaSpringRunToss(Sint32 tossKind)
Tosses the chosen coin or medal and waits for it to come to rest; returns the ring it rests in.
References fdActorGet(), fdActorSelectAnimation(), fdActorSetAnimation(), fdScriptPlaySound(), LemuriaSpringToss, LemuriaSpringTossEnded, LemuriaSpringTossKind, LemuriaSpringTossResult, LemuriaSpringTossTick, MainRoutineStateWork, scLemuriaSpringSetSpriteStorageKind(), Sint32 and sySynch().
Referenced by scLemuriaSpringRunSpringGame().
Definition at lines 170 and 1366 of file lemuria_spring.c.
scLemuriaSpringGivePrize
void scLemuriaSpringGivePrize(Sint32 item)
A medal's prize comes up out of the spring as at Tolbi's: a roar, the leader
turns to the spring, and the prize is brought up to him, an item, or, for the
first medal to land in the middle (FLAG_LEMURIA_SPRING_ECLIPSE_WON), the
summon Eclipse, read from a tablet.
What rises is the pictures: each is 3 by 8 metatiles copied over the spring's middle from spare metatiles of the map, one every 8 ticks, in order as it comes and back in reverse as it goes.
References Call2(), fdActorFaceDirection(), fdActorGet(), fdActorPlaceOnActor(), fdItemDisplayShowItem(), fdMapGridCopyMetatilesTo(), fdScriptEnd(), fdScriptPlaySound(), fdScriptStart(), fdSummonTabletPlayRunes(), gmPartyGiveItem(), gmSummonLearn(), MainRoutineStateWork, mnSummonShowLearnedMessage(), scFieldActorSetAnimation(), scFieldScriptEndLastingPsynergy(), scFieldScriptWait(), scLemuriaSpringShowPrizePicture() and Sint32.
Referenced by scLemuriaSpringRunSpringGame().
Definition at lines 172 and 609 of file lemuria_spring.c.
scLemuriaSpringSetSpriteStorageKind
void scLemuriaSpringSetSpriteStorageKind(Sint32 actor, Sint32 active)
void scLemuriaSpringSetSpriteStorageKind(Sint32 id, Sint32 kind)
Sets how actor id keeps its sprites (ACTOR.spriteStorageKind).
References fdActorGetById() and Sint32.
Referenced by scLemuriaSpringRunToss() and scLemuriaSpringUpdateTossSimulation().
Definition at lines 181 and 719 of file lemuria_spring.c.
scGetEntrances
const SCENE_ENTRANCE *scGetEntrances(void)
References SceneEntrances.
Definition at line 192 of file lemuria_spring.c.
scGetExitRegions
const SCENE_REGION *scGetExitRegions(void)
Definition at line 197 of file lemuria_spring.c.
scGetExits
const Uint32 *scGetExits(void)
References SceneExits.
Definition at line 202 of file lemuria_spring.c.
scGetActorPlacements
const ACTOR_PLACE *scGetActorPlacements(void)
References ActorPlacements.
Definition at line 207 of file lemuria_spring.c.
scLemuriaSpringDrinkFromSpring
void scLemuriaSpringDrinkFromSpring(void)
Felix checks the rim of the spring, any of its edges round the pool, before the target has been shown this visit: "Felix and the others drank of the spring. Their HP and PP were fully replenished!"
References fdScriptPlaySound(), gmPartyRestoreHpPp(), mnMessageShowCentered() and Sint32.
Referenced by SceneCues.
Definition at line 215 of file lemuria_spring.c.
scLemuriaSpringDrainSpring
void scLemuriaSpringDrainSpring(void)
The spring's water, the overhead layer, sinks 16 pixels, a pixel every four ticks, then fades away in eight steps to show the target at the bottom of the spring, as Tolbi's does.
References fdScriptPlaySound(), LemuriaSpringAlphaSteps, Sint32 and sySynch().
Referenced by scLemuriaSpringTossCoinOrMedal().
Definition at line 228 of file lemuria_spring.c.
scLemuriaSpringTossCoinOrMedal
void scLemuriaSpringTossCoinOrMedal(void)
Felix checks the water from the step at the south of the spring, between the two signs, metatile (7, 8) or (7, 10): he turns his back to the spring to toss a coin or a Lucky Medal into it. The first time each visit, the spring's water first fades to show the target of rings at its bottom.
References fdActorFaceDirection(), fdActorWalkToAndWait(), fdScriptEnd(), fdScriptGetFlag(), fdScriptSetFlag(), fdScriptStart(), MainRoutineStateWork, scFieldScriptEndLastingPsynergy(), scLemuriaSpringDrainSpring(), scLemuriaSpringRunSpringGame() and Sint32.
Referenced by SceneCues.
Definition at line 254 of file lemuria_spring.c.
scGetCues
const CUE *scGetCues(void)
References SceneCues.
Definition at line 271 of file lemuria_spring.c.
scLemuriaSpringInitTossSimulation
void scLemuriaSpringInitTossSimulation(void)
Puts the crabs and turtles where they start, the token out of sight west of the spring, and starts the event that moves them.
References fdActorGet(), fdActorSelectAnimation(), LemuriaSpringObstacleHeadings, LemuriaSpringObstacles, LemuriaSpringObstacleStartX, LemuriaSpringObstacleStartZ, LemuriaSpringToss, scLemuriaSpringUpdateTossSimulation(), Sint32 and sySetTickEvent().
Referenced by scInit().
Definition at lines 276 and 1328 of file lemuria_spring.c.
scInit
Sint32 scInit(void)
Starts the scene: the water blended over the target, the slabs at the signs' feet drawn underfoot; arriving from Lemuria, the toss is set up, and the water stays faded once the target has been shown.
References fdActorGet(), fdActorSetAnimation(), fdScriptGetFlag(), fdScriptStartScreenTransition(), MainRoutineStateWork, scLemuriaSpringInitTossSimulation() and Sint32.
Definition at line 281 of file lemuria_spring.c.
scPrepareMap
Sint32 scPrepareMap(void)
References Sint32.
Definition at line 312 of file lemuria_spring.c.
scLemuriaSpringShowPrizePicture
static inline void scLemuriaSpringShowPrizePicture(Sint32 srcColumn, Sint32 srcRow)
Draws one picture of the prize being brought up in the middle of the spring,
with SE_CAST, and holds it 8 ticks.
References fdMapGridCopyMetatilesTo(), fdScriptPlaySound(), scFieldScriptWait() and Sint32.
Referenced by scLemuriaSpringGivePrize().
Definition at line 593 of file lemuria_spring.c.
scLemuriaSpringSetActorAppearance
void scLemuriaSpringSetActorAppearance( Sint32 id, Sint32 *pos, Sint32 facing, Sint32 colorMode, Sint32 step)
Sets an actor of the toss where the simulation has it: its position, facing, colour mode and animation step.
References fdActorGet(), fdActorSetAnimationSpeed() and Sint32.
Referenced by scLemuriaSpringUpdateTossSimulation().
Definition at line 682 of file lemuria_spring.c.
scLemuriaSpringUpdateTossSimulation
void scLemuriaSpringUpdateTossSimulation(void)
An event: moves the tossed coin or medal a tick, its trail and shadow behind it, and the crabs and turtles that swim in the spring.
References fdActorGetById(), fdActorSelectAnimation(), fdScriptPlaySound(), LemuriaSpringCrabColorModes, LemuriaSpringObstacles, LemuriaSpringToss, LemuriaSpringTossEnded, LemuriaSpringTossKind, LemuriaSpringTossResult, LemuriaSpringTurtleColorModes, scLemuriaSpringSetActorAppearance(), scLemuriaSpringSetSpriteStorageKind(), Sint32, syCos(), sySin() and sySquartIWRAM().
Referenced by scLemuriaSpringInitTossSimulation().
Definition at lines 732 and 1324 of file lemuria_spring.c.
Variables in detail
LemuriaSpringCoinPrizes
extern Uint16 LemuriaSpringCoinPrizes[]
Uint16 LemuriaSpringCoinPrizes[]
The coins a coin wins by where it lands, the middle first; 0 for a miss.
Referenced by scLemuriaSpringRunSpringGame().
Definition at lines 167 and 1685 of file lemuria_spring.c.
LemuriaSpringMedalPrizes
extern Uint32 LemuriaSpringMedalPrizes[MEDAL_PRIZE_COUNT]
Uint32 LemuriaSpringMedalPrizes[MEDAL_PRIZE_COUNT]
The items a medal can win, drawn by the weights in MainRoutineStateWork: the middle ring draws
from the first three, each ring further out from three more.
Referenced by scLemuriaSpringRunSpringGame().
Definition at lines 168 and 1676 of file lemuria_spring.c.
LemuriaSpringCrabColorModes
extern Uint8 LemuriaSpringCrabColorModes[]
Uint8 LemuriaSpringCrabColorModes[]
The crabs' colour modes, by speed.
Referenced by scLemuriaSpringUpdateTossSimulation().
Definition at lines 174 and 1690 of file lemuria_spring.c.
LemuriaSpringTurtleColorModes
extern Uint8 LemuriaSpringTurtleColorModes[]
Uint8 LemuriaSpringTurtleColorModes[]
The turtles' colour modes, by speed.
Referenced by scLemuriaSpringUpdateTossSimulation().
Definition at lines 175 and 1695 of file lemuria_spring.c.
LemuriaSpringObstacleStartX
extern Uint8 LemuriaSpringObstacleStartX[]
Uint8 LemuriaSpringObstacleStartX[]
Where each obstacle starts, across.
Referenced by scLemuriaSpringInitTossSimulation().
Definition at lines 176 and 1700 of file lemuria_spring.c.
LemuriaSpringObstacleStartZ
extern Uint8 LemuriaSpringObstacleStartZ[]
Uint8 LemuriaSpringObstacleStartZ[]
Where each obstacle starts, down.
Referenced by scLemuriaSpringInitTossSimulation().
Definition at lines 177 and 1705 of file lemuria_spring.c.
LemuriaSpringObstacleHeadings
extern Uint16 LemuriaSpringObstacleHeadings[]
Uint16 LemuriaSpringObstacleHeadings[]
The way each obstacle starts heading: the crabs east or west, the turtles by their angle round their loops.
Referenced by scLemuriaSpringInitTossSimulation().
Definition at lines 179 and 1711 of file lemuria_spring.c.
LemuriaSpringToss
SPRING_TOSS_MOTION LemuriaSpringToss
Referenced by scLemuriaSpringInitTossSimulation(), scLemuriaSpringRunToss() and scLemuriaSpringUpdateTossSimulation().
Definition at line 183 of file lemuria_spring.c.
LemuriaSpringTossKind
Sint32 LemuriaSpringTossKind
References Sint32.
Referenced by scLemuriaSpringRunToss() and scLemuriaSpringUpdateTossSimulation().
Definition at line 184 of file lemuria_spring.c.
LemuriaSpringObstacles
SPRING_OBSTACLE LemuriaSpringObstacles[OBSTACLE_COUNT]
The crabs and turtles in the toss's way, as the toss moves them.
Referenced by scLemuriaSpringInitTossSimulation() and scLemuriaSpringUpdateTossSimulation().
Definition at line 186 of file lemuria_spring.c.
LemuriaSpringTossTick
Sint32 LemuriaSpringTossTick
References Sint32.
Referenced by scLemuriaSpringRunToss().
Definition at line 188 of file lemuria_spring.c.
LemuriaSpringTossEnded
Sint32 LemuriaSpringTossEnded
References Sint32.
Referenced by scLemuriaSpringRunToss() and scLemuriaSpringUpdateTossSimulation().
Definition at line 189 of file lemuria_spring.c.
LemuriaSpringTossResult
Sint32 LemuriaSpringTossResult
References Sint32.
Referenced by scLemuriaSpringRunToss() and scLemuriaSpringUpdateTossSimulation().
Definition at line 190 of file lemuria_spring.c.
LemuriaSpringAlphaSteps
extern Uint16 LemuriaSpringAlphaSteps[]
Uint16 LemuriaSpringAlphaSteps[]
The blend weights the spring fades in through, eight steps from 10/9 to 0/16 (first target over second, in sixteenths).
Referenced by scLemuriaSpringDrainSpring().
Definition at lines 223 and 1649 of file lemuria_spring.c.
MsgLemuriaSpringWhatWillYouThrow
extern Uint8 MsgLemuriaSpringWhatWillYouThrow[], MsgLemuriaSpringCoins[], MsgLemuriaSpringToss[], MsgLemuriaSpringYouWonCoin[]
The Japanese catalog does not name these yet.
Referenced by scLemuriaSpringRunSpringGame().
Definition at line 318 of file lemuria_spring.c.
SceneEntrances
SCENE_ENTRANCE SceneEntrances[]
Referenced by scGetEntrances().
Definition at line 1430 of file lemuria_spring.c.
SceneExits
Uint32 SceneExits[]
Referenced by scGetExits().
Definition at line 1435 of file lemuria_spring.c.
ActorPlacements
ACTOR_PLACE ActorPlacements[]
Referenced by scGetActorPlacements().
Definition at line 1444 of file lemuria_spring.c.
SceneCues
CUE SceneCues[]
References scLemuriaSpringDrinkFromSpring() and scLemuriaSpringTossCoinOrMedal().
Referenced by scGetCues().
Definition at line 1655 of file lemuria_spring.c.