src/scene/northern_reaches.c
The Northern Reaches, the icy sea where a great wall of ice blocks the ship's way north to Prox. More…
#include "field/field_sprite.h"#include "graphics/palette_buffers.h"#include "field/field.h"#include "game/game.h"#include "field/field_engine_script.h"#include "field/script_inline.h"#include "scene/scene.h"#include "text/msg_ids.h"#include "field/actor_script.h"#include "shared/ship_drop_shadow.c"
Structures
| Name | Description | |
|---|---|---|
struct | ICE_SHARD | One of the ice wall's shards: its place and speed in 16.16 pixels, as a PARTICLE has them, and how many ticks it has flown, counted unsigned. |
struct | EXPLOSION_SPARK | One of the sparks the Magma Ball's explosion throws over the wall: the link the sprite list threads it by, its sprite, and its age in ticks, negative while it waits to appear. |
struct | ICE_WALL_STATE | The shattering's state: the shards' sprite sheet, and each shard's sprite and motion. |
Macros
| Name | Description | |
|---|---|---|
#define | FLAG_ICE_WALL_SHATTERED 0x90e | The Magma Ball has shattered the ice wall. |
#define | FLAG_SAFE_DISTANCE_TOLD 0x90d | Piers has said the ship is at a safe distance. |
#define | FLAG_ICE_WALL_SIGHTED FLAG_SCENE_TEMP(0x00) | The crew has called Kraden to see the ice wall, for this visit. |
#define | FLAG_ICE_WALL_DISCUSSED 0x90c | The crew has talked the ice wall over. |
#define | ICE_SHARD_COUNT 54 | The wall breaks into 54 shards, nine columns of six, and the explosion's sparks (EXPLOSION_SPARK_COUNT) fly about it. |
#define | ICE_SHARD_TICKS 60 | How long a shard flies, in ticks. |
#define | SHEET_BUFFER_SIZE 4096 | The buffer a sprite sheet is unpacked into. |
#define | ACTOR_SHRINK_BY (actor, step) | Shrinks an actor evenly by step, as the ship sails off into the distance. |
#define | MAGMA_BALL_GROW_TICKS 16 | The Magma Ball grows from half its size to full, a thirty-second a tick, over its first MAGMA_BALL_GROW_TICKS ticks of flight. |
#define | SHIP_SHRINK_STEPS 20 | The ship's last shrink as it sails off: SHIP_SHRINK_STEPS steps of seven ticks. |
Enumerations
| Name | Description | |
|---|---|---|
enum | anonymous enum { METATILE_UNDER_ICE_WALL, METATILE_BETWEEN_ICE_BLOCKS, METATI … } | The metatiles of the sea before the ice wall that start its scripts: a row close under the wall, (90, 11) to (96, 11); the gap between the two blocks of ice, (92, 13) and (93, 13); and a row further south, (89, 15) to (91, 15). |
enum | anonymous enum { ENTRANCE_BELOW_ICE_WALL, ENTRANCE_ICE_WALL_GONE, ENTRANCE_AB … } | Ways in that no exit reaches. |
enum | NORTHERN_REACHES_ACTOR_ID { ACTOR_SHIP, ACTOR_MAGMA_BALL_SHOT, ACTOR_CANNON_SMOKE, ACTOR … } | The Northern Reaches, by the rows of ActorPlacements; the rows for Jenna, Sheba and Piers go to their party slots. |
Functions
| Name | Description | |
|---|---|---|
void | scNorthernReachesShatterIceWall (FIXED *blast, FIXED *pos, void (*callback)(void)) | The Magma Ball's explosion over the ice wall: sparks fly, the screen fades to white, callback draws the wall gone and its shards fly apart from pos. |
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 | scNorthernReachesClearIceWall (void) | Draws the ice wall gone, as the Magma Ball leaves it and on every later visit. |
void | scNorthernReachesSightIceWall (void) | The ship sails up to the ice wall, metatiles (90, 11) to (96, 11), before it carries the cannon: Jenna calls "Kraden, come look at this... |
void | scNorthernReachesDiscussIceWall (void) | The ship, carrying the cannon, sails north toward the ice wall, metatiles (89, 15) to (91, 15): the view turns to the wall, and Kraden says to use the cannon they got in Loho and to take the ship between the two blocks of ice before it for shelter. |
void | scNorthernReachesFireMagmaBall (void) | The ship, carrying the cannon, comes between the two blocks of ice before the ice wall, metatile (92, 13) or (93, 13). |
const CUE * | scGetCues (void) | The scene's cues: the rooms of names' for any entrance above ENTRANCE_NAMES_ABOVE, else the debug room's. |
Sint32 | scInit (void) | Opens the room through the window transition, and in the debug room draws the cat 1.7 times its size. |
Sint32 | scPrepareMap (void) | Once Briggs is caught the pool has dried up: its colours take the dry ground's. |
Variables
| Name | Description | |
|---|---|---|
extern Sint32 | NorthernReachesShipAtRest [] | The ship at rest on the sea, without its shadow, on the middle layer. |
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 Northern Reaches, the icy sea where a great wall of ice blocks the ship's way north to Prox.
Sailing up to the wall before the ship carries the cannon from Loho, the crew calls Kraden to see it. With the cannon aboard, Kraden says to use it and to take the ship between the two blocks of ice before the wall for shelter. There, Felix fires the Magma Ball, the wall bursts in fire and is gone, and the ship sails off north.
Macros in detail
FLAG_ICE_WALL_SHATTERED
#define FLAG_ICE_WALL_SHATTERED 0x90e
The Magma Ball has shattered the ice wall.
Referenced by scNorthernReachesFireMagmaBall() and scPrepareMap().
Definition at line 21 of file northern_reaches.c.
FLAG_SAFE_DISTANCE_TOLD
#define FLAG_SAFE_DISTANCE_TOLD 0x90d
Piers has said the ship is at a safe distance.
Referenced by scNorthernReachesFireMagmaBall().
Definition at line 24 of file northern_reaches.c.
FLAG_ICE_WALL_SIGHTED
#define FLAG_ICE_WALL_SIGHTED FLAG_SCENE_TEMP(0x00)
The crew has called Kraden to see the ice wall, for this visit.
Referenced by scNorthernReachesSightIceWall().
Definition at line 27 of file northern_reaches.c.
FLAG_ICE_WALL_DISCUSSED
#define FLAG_ICE_WALL_DISCUSSED 0x90c
The crew has talked the ice wall over.
Referenced by scNorthernReachesDiscussIceWall().
Definition at line 30 of file northern_reaches.c.
ICE_SHARD_COUNT
#define ICE_SHARD_COUNT 54
The wall breaks into 54 shards, nine columns of six, and the explosion's
sparks (EXPLOSION_SPARK_COUNT) fly about it.
Referenced by scNorthernReachesShatterIceWall().
Definition at line 97 of file northern_reaches.c.
ICE_SHARD_TICKS
#define ICE_SHARD_TICKS 60
How long a shard flies, in ticks.
Referenced by scNorthernReachesShatterIceWall().
Definition at line 99 of file northern_reaches.c.
SHEET_BUFFER_SIZE
#define SHEET_BUFFER_SIZE 4096
The buffer a sprite sheet is unpacked into.
Referenced by scNorthernReachesShatterIceWall().
Definition at line 101 of file northern_reaches.c.
ACTOR_SHRINK_BY
#define ACTOR_SHRINK_BY(actor, step)
Shrinks an actor evenly by step, as the ship sails off into the distance.
Referenced by scNorthernReachesFireMagmaBall().
Definition at line 200 of file northern_reaches.c.
MAGMA_BALL_GROW_TICKS
#define MAGMA_BALL_GROW_TICKS 16
The Magma Ball grows from half its size to full, a thirty-second a tick, over
its first MAGMA_BALL_GROW_TICKS ticks of flight.
Referenced by scNorthernReachesFireMagmaBall().
Definition at line 209 of file northern_reaches.c.
SHIP_SHRINK_STEPS
#define SHIP_SHRINK_STEPS 20
The ship's last shrink as it sails off: SHIP_SHRINK_STEPS steps of seven
ticks.
Referenced by scNorthernReachesFireMagmaBall().
Definition at line 212 of file northern_reaches.c.
Enumerations in detail
anonymous enum
enum { METATILE_UNDER_ICE_WALL, METATILE_BETWEEN_ICE_BLOCKS, METATILE_SOUTH_OF_ICE_WALL }
The metatiles of the sea before the ice wall that start its scripts: a row close under the wall, (90, 11) to (96, 11); the gap between the two blocks of ice, (92, 13) and (93, 13); and a row further south, (89, 15) to (91, 15).
| Enumerator | Value | Description |
|---|---|---|
METATILE_UNDER_ICE_WALL | 22 | |
METATILE_BETWEEN_ICE_BLOCKS | 21 | |
METATILE_SOUTH_OF_ICE_WALL | 20 |
Definition at line 35 of file northern_reaches.c.
anonymous enum
enum { ENTRANCE_BELOW_ICE_WALL, ENTRANCE_ICE_WALL_GONE, ENTRANCE_ABOARD_SHIP_WITH_CANNON }
Ways in that no exit reaches.
| Enumerator | Value | Description |
|---|---|---|
ENTRANCE_BELOW_ICE_WALL | 2 | Unused: the party below the ice wall, which still stands. |
ENTRANCE_ICE_WALL_GONE | 3 | Unused: the party below the ice wall, drawn already gone. |
ENTRANCE_ABOARD_SHIP_WITH_CANNON | 90 | Unused: loads the cannon aboard, hands the ship to the player and enters again by the north way in. |
Definition at line 43 of file northern_reaches.c.
NORTHERN_REACHES_ACTOR_ID
enum NORTHERN_REACHES_ACTOR_ID
The Northern Reaches, by the rows of ActorPlacements; the rows for Jenna,
Sheba and Piers go to their party slots.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_SHIP | ACTOR_FIRST_PLACED | the ship, placed blank; sails north once the wall is gone |
ACTOR_MAGMA_BALL_SHOT | the Magma Ball fired at the ice wall | |
ACTOR_CANNON_SMOKE | a puff of smoke at the bow as the cannon | |
ACTOR_KRADEN | fires |
Definition at line 56 of file northern_reaches.c.
Functions in detail
scNorthernReachesShatterIceWall
void scNorthernReachesShatterIceWall(FIXED *blast, FIXED *pos, void (*callback)(void))
The Magma Ball's explosion over the ice wall: sparks fly, the screen fades to
white, callback draws the wall gone and its shards fly apart from pos.
The caller passes where the ball struck as blast, but nothing reads it: the
sparks burst at random over a fixed stretch of the screen, 52 to 179 pixels
across and 16 to 79 down, wherever the ball landed.
References fdBattleEffectStepVector3(), fdEffectSpriteDrawAtWorldPos(), fdEffectSpriteInit(), fdPaletteFadeSetTarget(), fdPaletteFadeStartInterpolation(), fdScriptPlaySound(), FieldExplosionPalette, scFieldScriptWait(), Sint32, syDecompressTaggedLZ(), syDMAXCopy(), syHeapAllocate(), syHeapAllocateEWRAM(), syHeapRelease(), syHeapSlotAllocate(), syHeapSlotRelease(), syOAMAddSpriteAtDepthClamped(), syRandom(), syResourceGetTableEntry(), sySynch(), syVRAMCacheFindFreeEntry(), syVRAMCacheFreeEntry() and syVRAMCacheLoad().
Referenced by scNorthernReachesFireMagmaBall().
Definition at lines 66 and 412 of file northern_reaches.c.
scGetEntrances
const SCENE_ENTRANCE *scGetEntrances(void)
References SceneEntrances.
Definition at line 114 of file northern_reaches.c.
scGetExitRegions
const SCENE_REGION *scGetExitRegions(void)
Definition at line 119 of file northern_reaches.c.
scGetExits
const Uint32 *scGetExits(void)
References SceneExits.
Definition at line 124 of file northern_reaches.c.
scGetActorPlacements
const ACTOR_PLACE *scGetActorPlacements(void)
References ActorPlacements.
Definition at line 129 of file northern_reaches.c.
scNorthernReachesClearIceWall
void scNorthernReachesClearIceWall(void)
Draws the ice wall gone, as the Magma Ball leaves it and on every later visit.
References fdMapGridCopyMetatileAttributes() and fdMapGridCopyMetatilesLayered().
Referenced by scNorthernReachesFireMagmaBall() and scPrepareMap().
Definition at line 136 of file northern_reaches.c.
scNorthernReachesSightIceWall
void scNorthernReachesSightIceWall(void)
The ship sails up to the ice wall, metatiles (90, 11) to (96, 11), before it carries the cannon: Jenna calls "Kraden, come look at this... There's a huge ice wall blocking our path," and Kraden says they will go no farther unless they do something about it. Once a visit.
References fdActorFaceDirectionAndWait(), fdActorGet(), fdScriptEnd(), fdScriptGetFlag(), fdScriptSetFlag(), fdScriptStart(), scFieldActorWaitForMove(), scFieldScriptEndLastingPsynergy(), scFieldScriptSetMessageId(), scFieldScriptShowMessageThenWait(), scFieldScriptWait() and Sint32.
Referenced by SceneCues.
Definition at line 147 of file northern_reaches.c.
scNorthernReachesDiscussIceWall
void scNorthernReachesDiscussIceWall(void)
The ship, carrying the cannon, sails north toward the ice wall, metatiles (89, 15) to (91, 15): the view turns to the wall, and Kraden says to use the cannon they got in Loho and to take the ship between the two blocks of ice before it for shelter. Only once.
References fdActorGet(), fdCameraWaitForArrival(), fdScriptEnd(), fdScriptGetFlag(), fdScriptSetFlag(), fdScriptStart(), scFieldActorWaitForMove(), scFieldScriptEndLastingPsynergy(), scFieldScriptSetMessageId(), scFieldScriptShowMessageThenWait(), scFieldScriptWait() and Sint32.
Referenced by SceneCues.
Definition at line 169 of file northern_reaches.c.
scNorthernReachesFireMagmaBall
void scNorthernReachesFireMagmaBall(void)
The ship, carrying the cannon, comes between the two blocks of ice before the ice wall, metatile (92, 13) or (93, 13). Piers says they should be safe firing from here, and Kraden asks Felix to aim at the wall and fire when ready. With a Yes the ship jolts back as the cannon fires, the Magma Ball flies into the wall, which bursts in flames and white light and is gone, and after the crew's cheers the ship sails off north. With a No it pulls back to try again.
References fdActorFaceDirectionAndWait(), fdActorGet(), fdActorMoveToAndWait(), fdActorSetAnimation(), fdActorSetDestinationOffset(), fdActorSetSpriteColorMode(), fdActorSetSpriteFlags(), fdActorWalkBy(), fdActorWalkTo(), fdCameraWaitForArrival(), fdPaletteFadeApplyTarget(), fdScriptEnd(), fdScriptGetFlag(), fdScriptOpenMessage(), fdScriptPlaySound(), fdScriptSetFlag(), fdScriptStart(), fdScriptStartScreenTransition(), fdScriptWaitTransitionTicks(), scFieldActorWaitForMove(), scFieldActorWaitForMoveById(), scFieldScriptAskYesNoWithActorAnimation(), scFieldScriptEndLastingPsynergy(), scFieldScriptSetExitRequest(), scFieldScriptSetMessageId(), scFieldScriptShowMessageThenWait(), scFieldScriptWait(), scNorthernReachesClearIceWall(), scNorthernReachesShatterIceWall(), scScriptCameraFollowActor(), Sint32 and sySynch().
Referenced by SceneCues.
Definition at line 221 of file northern_reaches.c.
scGetCues
const CUE *scGetCues(void)
References SceneCues.
Definition at line 373 of file northern_reaches.c.
scInit
Sint32 scInit(void)
References fdActorGet(), fdRisingParticlesStart(), fdScriptSetDestination(), fdScriptSetFlag(), MainRoutineStateWork and Sint32.
Definition at line 378 of file northern_reaches.c.
scPrepareMap
Sint32 scPrepareMap(void)
References fdScriptGetFlag(), MainRoutineStateWork, scNorthernReachesClearIceWall() and Sint32.
Definition at line 398 of file northern_reaches.c.
Variables in detail
NorthernReachesShipAtRest
extern Sint32 NorthernReachesShipAtRest[]
Sint32 NorthernReachesShipAtRest[]
The ship at rest on the sea, without its shadow, on the middle layer.
References scShipDropShadow() and Sint32.
Referenced by ActorPlacements.
Definition at lines 70 and 548 of file northern_reaches.c.
SceneEntrances
SCENE_ENTRANCE SceneEntrances[]
Referenced by scGetEntrances().
Definition at line 554 of file northern_reaches.c.
SceneExits
Uint32 SceneExits[]
Referenced by scGetExits().
Definition at line 577 of file northern_reaches.c.
ActorPlacements
ACTOR_PLACE ActorPlacements[]
References NorthernReachesShipAtRest and Sint32.
Referenced by scGetActorPlacements().
Definition at line 590 of file northern_reaches.c.
SceneCues
CUE SceneCues[]
References scNorthernReachesDiscussIceWall(), scNorthernReachesFireMagmaBall() and scNorthernReachesSightIceWall().
Referenced by scGetCues().
Definition at line 657 of file northern_reaches.c.