src/scene/trial_road.c
Trial Road, the mountain path above the Shaman Village where Moapa tests the party before he will hand over the Hover Jade. More…
#include "item_ids.h"#include "macros.h"#include "field/actor_script.h"#include "field/call.h"#include "field/field_engine.h"#include "game/game.h"#include "scene/ground_effects.h"#include "scene/scene.h"#include "field/field_effect.h"#include "window/window.h"#include "text/msg_ids.h"#include "scene/trial_road.h"#include "shared/actor_set_sprite_priority.c"#include "../field/field_effect_move.c"#include "shared/field_effect_spawn.c"#include "shared/field_effect_advance_motion_priority.c"#include "shared/pillar_restore_raised.c"#include "shared/leader_check_crumbling_step.c"#include "shared/pillar_take_out_of_play.c"#include "shared/pillar_restore.c"#include "shared/actor_take_place_of.c"#include "shared/actor_set_metatile_shape.c"#include "shared/leader_set_metatile_shape.c"#include "shared/field_effect_duration_scripts.c"#include "shared/dust_scatter_script.c"#include "shared/dust_burst_script.c"
Structures
| Name | Description | |
|---|---|---|
struct | EFFECT_SPR_BITS | The sprite's priority bits, read as the byte that holds them. |
struct | EFFECT_SPR_ATTR | A sprite's attribute 2, as the byte bits view reaches it. |
struct | TRIAL_ROAD_REPLAY | The rival's state in SceneStateWork. |
struct | TRIAL_ROAD_SPR | One queued sprite: the three words syOAMAddSpriteAtDepth adds to OAM. |
struct | TRIAL_ROAD_LINK_STATE | The heap slot scTrialRoadShowRaceMap takes for the race map of both parties and the rival's recorded path. |
struct | TRIAL_ROAD_FOUNTAIN | One of the fountain stage's fountains: the vent its water rises from, and the platform the leader rides on top of it. |
struct | TRIAL_ROAD_FOUNTAINS_STATE | The fountain stage's state, kept in the inventory snapshot's spare room. |
Macros
| Name | Description | |
|---|---|---|
#define | MAD_PLANT_TRIAL_ROAD 4 | Trial Road's Mad Plant, the last of the five hidden in weeds: its FLAG_MAD_PLANT and its column of ENCOUNTER_ZONE_MAD_PLANTS. |
#define | FLAG_TRIAL_ROAD_PEAK_PILLAR_PLACED 0x9fc | Set once the summit's stone pillar has been moved one metatile east, into column 8 of the map, where it stays. |
#define | FLAG_LEADER_ON_PILLARS FLAG_SCENE_TEMP(0x08) | Set while Felix stands up on the pillar stage's upper ledge or a pillar's top (scTrialRoadCheckLeaderOnPillars). |
#define | FLAG_GIVE_UP_ASKED FLAG_SCENE_TEMP(0x81) | Set once the give-up button has asked; stepping off it clears it. |
#define | FLAG_STAGE_DOOR_OPEN FLAG_SCENE_TEMP(0x82) | Set once both blue chests hold their items and the leader's door opens. |
#define | FLAG_STAGE_CHESTS_OPENED FLAG_SCENE_TEMP(0x84) | Set once Felix has stood on the switch at the top of the stage and the blue chests have opened (scTrialRoadOpenChests). |
#define | FLAG_INNER_CHEST_OPEN FLAG_SCENE_TEMP(0x85) | Set while the inner blue chest stands open for an item. |
#define | FLAG_OUTER_CHEST_OPEN FLAG_SCENE_TEMP(0x86) | Set while the outer blue chest stands open for an item: it opens only when Moapa reached the door first. |
#define | FLAG_SUMMIT_DOORWAY_SHUT FLAG_SCENE_TEMP(0x83) | Set once the doorway Felix came out of at the summit has shut behind him (scTrialRoadShutSummitDoorway). |
#define | FLAG_CAVE_ROCK_LIFTED FLAG_SCENE_TEMP(0x89) | Set once Lift has raised the rock at the summit cave's mouth. |
#define | FLAG_GASP_FLED FLAG_SCENE_TEMP(0x88) | Set once Gasp has stopped mirroring Felix and hopped away to where he can be talked to. |
#define | FLAG_LINK_PLAYER FLAG_SCENE_TEMP(0xf8) | The link race's flags, which no code in the game sets, as nothing chooses RIVAL_LINKED: the byte of flags from FLAG_LINK_PLAYER holds this player's number in the link, so the rival follows the other player's record; while FLAG_LINKED_RIVAL_HALTS is set, a rival whose record has its top byte set stops 12 pixels beside the course's corner, 16 pixels north of it with the far side's timer if FLAG_LINKED_RIVAL_ON_FAR_SIDE is set and 16 south with the near side's if not. |
#define | FLAG_LINKED_RIVAL_HALTS FLAG_SCENE_TEMP(0x11) | |
#define | FLAG_LINKED_RIVAL_ON_FAR_SIDE FLAG_SCENE_TEMP(0x12) | |
#define | FLAG_PILLAR_STAGE_WEEDS_BLOWN_AWAY FLAG_AREA_TEMP(0x07) | Set once Whirlwind has blown away the weeds on the pillar stage's pillar C, on the Pound stage's pillar B, and on the sand stage's cliff. |
#define | FLAG_POUND_STAGE_WEEDS_BLOWN_AWAY FLAG_AREA_TEMP(0x39) | |
#define | FLAG_SAND_STAGE_WEEDS_BLOWN_AWAY FLAG_AREA_TEMP(0x74) | |
#define | FLAG_INNER_WEST_STAKE_RAISED FLAG_AREA_TEMP(0x35) | Set while the Pound stage's inner west stake stands raised and the west one sunk; clear the other way round. |
#define | FLAG_EAST_STAKE_RAISED FLAG_AREA_TEMP(0x37) | Set while the Pound stage's east stake stands raised and the inner east one sunk; clear the other way round. |
#define | FLAG_RIVAL_FIRST_AT_DOOR_BASE FLAG_AREA_TEMP(0x81) | The four stages' flags, from FLAG_AREA_TEMP(0x81): each set once Moapa reached that stage's door before Felix. |
#define | FLAG_WEST_CRUMBLING_PILLAR_STEPPED_ON FLAG_AREA_TEMP(0x42) | Each cracked pillar of the crumbling stage: set once Felix has first stepped on it and it has flashed, and once it has crumbled away. |
#define | FLAG_WEST_CRUMBLING_PILLAR_CRUMBLED FLAG_AREA_TEMP(0x43) | |
#define | FLAG_EAST_CRUMBLING_PILLAR_STEPPED_ON FLAG_AREA_TEMP(0x44) | |
#define | FLAG_EAST_CRUMBLING_PILLAR_CRUMBLED FLAG_AREA_TEMP(0x45) | |
#define | FLAG_PARTY_FIRST_AT_PEAK FLAG_AREA_TEMP(0x85) | Set once Felix climbs to the summit ahead of Moapa. |
#define | FLAG_STAGE_ORDER_DEALT FLAG_AREA_TEMP(0x80) | Set once the stages' order has been dealt from the leader's name. |
#define | ACTOR_KRADEN (ACTOR_MOAPA + 1) | Kraden, at the summit (TrialRoadSummitPlacements), after Moapa. |
#define | ACTOR_PEAK_PILLAR (ACTOR_KRADEN + 1) | The pillar at the summit (TrialRoadSummitPlacements), after Kraden. |
#define | ENTRANCE_IS_LEFT_PATH (entrance) ((entrance) & 1) | Whether a stage entrance is on the left path: the left path's are odd, the right path's even. |
#define | FLAG_PUDDLE_MELTED_BASE (FLAG_SCENE_TEMP(0x14) - ACTOR_PILLAR_C) | The torch stage's pillars C to F are frozen puddles, pillars of ice, though only C and F stand on the stage (D and E are placed at the origin); each one's flag, FLAG_SCENE_TEMP(0x14) to FLAG_SCENE_TEMP(0x17), is set once a torch has melted it to a puddle. |
#define | FLAG_WEEDS_BLOWN_AWAY_BASE (FLAG_AREA_TEMP(0x27) - ACTOR_WEEDS_A) | The weeds pillar stage's two clumps of weeds; each one's flag, FLAG_AREA_TEMP(0x27) and FLAG_AREA_TEMP(0x28), is set once Whirlwind has blown it away. |
#define | FLAG_LOG_IN_WATER_BASE (FLAG_SCENE_TEMP(0x53) - ACTOR_UPPER_LOG) | The log stage's logs' flags, FLAG_SCENE_TEMP(0x53) to FLAG_SCENE_TEMP(0x55), set once each has rolled off the edge into the water. |
#define | FLAG_VENT_UNCOVERED_BASE (FLAG_AREA_TEMP(0x63) - ACTOR_WEST_VENT) | The fountain stage's vents' flags, FLAG_AREA_TEMP(0x63) to FLAG_AREA_TEMP(0x65), set once each has been uncovered. |
#define | PUSH_BLOCKED (object) *(Uint8 *)&object->sceneCount | A piece Felix cannot push: a pillar weeds hold down, a frozen puddle, a stake, or a log (logs roll by their own scripts). |
#define | PILLAR_TOP_HEIGHT (top) *(Uint8 *)&top->sceneByte | The height in pixels of a pillar's top (scTrialRoadAddPillarTop) above the pillar: PILLAR_HEIGHT standing, -PILLAR_HEIGHT lowered. |
#define | FOUNTAIN_PERIOD 240 | A fountain rises and falls once each FOUNTAIN_PERIOD ticks, rising at FOUNTAIN_RISE_AT and falling at FOUNTAIN_FALL_AT. |
#define | FOUNTAIN_RISE_AT 120 | |
#define | FOUNTAIN_FALL_AT 150 | |
#define | PILLAR_HEIGHT 16 | How far a pillar's top stands above it; once the pillar is lowered, its top is as far below it. |
#define | RIVAL_PATH_LENGTH 7200 | The halfwords of the rival's recorded path: x, z pairs, the last pair 0, 0. |
#define | RACE_MAP_PICTURE_BYTES (RACE_MAP_TILE_COUNT * TILE_SIZE_4BPP) | The bytes of the race map's tiles. |
#define | RACE_MAP_PALETTE 14 | The sprite palette the race map loads and draws with. |
#define | RACE_MAP_STAGE_SPACING 36 | The pixels between one stage's picture and the next, down the display. |
#define | SUMMIT_PURPLE_PALETTE 5 | The background palette of the summit's purples, and its colours as the cycle loads them (scTrialRoadStartPaletteCycle). |
#define | DEFINE_TRIAL_ROAD_OPEN_DOOR ( | Defines a function that opens a stage's door at the top: on the left path (side 0) the door at column leftX, on the right the one at rightX, redrawn open from the spare metatiles, with the upper layer's at upperLeftX or upperRightX and the ground of the metatile at column groundLeftX or groundRightX of row 127. |
#define | DEFINE_TRIAL_ROAD_ON_FOOT (name, onFoot) | Defines a push or Move cue's script that, while the leader is on foot, calls onFoot with the pushed actor. |
#define | EFFECT_SET_MODE fdActorSelectAnimation | |
#define | EFFECT_SET_SCRIPT fdActorStartScript | |
#define | DEFINE_TRIAL_ROAD_SET_POOL_TILES (name, groundX, upperX) | Defines a function that sets the three tiles in Gasp's pools, at metatiles (10, 11), (18, 7) and (18, 15), to the metatile at column groundX of row 30, and the upper layer's to the one at upperX. |
#define | FOUNTAIN_COUNT 16 | The fountains the fountain stage's state has room for. |
#define | FOUNTAIN_SPRITE_COUNT 80 | The sprites the fountains' columns may queue in a tick. |
#define | FOUNTAIN_DEPTH_OFFSET 58 | A fountain's sprites sort at their screen row plus this many depth slots, four behind an actor's sprite at the same place (field_sprite_draw.c adds 62), so the leader riding a fountain is drawn in front of its water. |
#define | TRIAL_ROAD_FOUNTAINS | The fountain stage's fountains, kept in the inventory snapshot's spare bytes. |
#define | NORTH_FOUNTAIN_HEIGHT 64 | How far the fountain stage's northern three fountains rise, and its southern two. |
#define | SOUTH_FOUNTAIN_HEIGHT 32 | |
#define | RIVAL_CHESTS_RECORDINGS 8 | Where Moapa's runs at the blue chests start in TrialRoadRivalRecordings, after the eight stages'. |
#define | SET_LAYER (column, start) | Points layer at the copy of the room that starts column metatiles east in the map, and sets start to that column: its offset, its metatiles and shapes from that column on, and its place for the view. |
#define | DEAL_STAGE_ORDER () | Clears the race's state and deals the stage order from the sum of the leader's name's letters, with scPrepareMap's locals. |
#define | CHARGE_AT_MOAPA () | The party nods and charges at Moapa and his knights, who charge back, side by side in pairs a tick apart: the battle at the summit begins. |
#define | FOUNTAIN_TILES_BYTES 2048 | The bytes of the fountains' tiles (FieldGeyserTiles), once decompressed. |
#define | DUST_RING_PIECES 17 | The clouds of dust scMagmaRockInsideSpawnDustRing throws out in a ring. |
#define | RIVAL_MAX_TURN (TRIG_TURN / 16) | The most the rival turns in a tick: a sixteenth of a turn. |
#define | MARKER (left, right, which, tileAdd) | Where an actor's marker stands on the race map: its place in metatiles, moved by left or right on the entrance's side, and raised by the stage it has reached. |
Enumerations
| Name | Description | |
|---|---|---|
enum | TRIAL_ROAD_METATILE { METATILE_LEFT_PATH_STAIRS_DOWN, METATILE_RIGHT_PATH_STAIRS_D … } | The map metatiles the cue tables answer, by the behaviour the map gives them. |
enum | TRIAL_ROAD_STAGE_ACTOR_ID { ACTOR_MOAPA, ACTOR_LEFT_INNER_CHEST, ACTOR_LEFT_OUTER_CHEST, … } | The actors every stage room places first, numbering the rows of each stage's table: Moapa, the four blue chests (two on the left path, two on the right, inner and outer) and Moapa's two knights. |
enum | TRIAL_ROAD_LOG_STAGE_ACTOR_ID { ACTOR_UPPER_LOG, ACTOR_LOWER_LOG, ACTOR_EAST_LOG } | The log stage's three logs (TrialRoadLogStagePlacements): the upper and lower logs lie north to south and roll east or west, and the east log lies across them and rolls north or south. |
enum | TRIAL_ROAD_POUND_STAGE_ACTOR_ID { ACTOR_WEST_STAKE, ACTOR_INNER_WEST_STAKE, ACTOR_INNER_EAST_S … } | The Pound stage's four cone-shaped stakes (TrialRoadPoundStagePlacements), west to east at metatiles (13, 26), (15, 26), (17, 26) and (19, 26), in two pairs: driving one down raises its partner. |
enum | TRIAL_ROAD_CRUMBLING_STAGE_ACTOR_ID { ACTOR_WEST_CRUMBLING_PILLAR, ACTOR_EAST_CRUMBLING_PILLAR } | The crumbling stage's two pillars (TrialRoadCrumblingStagePlacements). |
enum | TRIAL_ROAD_PILLAR_ACTOR_ID { ACTOR_PILLAR_A, ACTOR_PILLAR_B, ACTOR_PILLAR_C, ACTOR_PILLAR … } | The stone pillars most stages stand from ACTOR_FIRST_STAGE_PIECE: five in the pillar and weeds pillar stages, three in the Pound stage, and in the torch stage two followed by its pillars of ice; the log and fountain stages have one, the block. |
enum | TRIAL_ROAD_TORCH_STAGE_ACTOR_ID { ACTOR_WEST_TORCH, ACTOR_EAST_TORCH } | The torch stage's two torches burning on stands, after its six pillars (TrialRoadTorchStagePlacements): pushed next to a frozen puddle, a torch melts it. |
enum | anonymous enum { ACTOR_WEEDS_A, ACTOR_WEEDS_B } | The weeds after the pillars: on pillar C in the pillar stage, on pillars A and B in the weeds pillar stage. |
enum | anonymous enum { ACTOR_POUND_STAGE_WEEDS } | The weeds on pillar B in the Pound stage, after its four stakes. |
enum | anonymous enum { ACTOR_SAND_STAGE_WEEDS } | The weeds on the sand stage's cliff, after its two tightrope posts. |
enum | anonymous enum { ACTOR_GASP } | Gasp, alone in his room (TrialRoadGaspPlacements). |
enum | anonymous enum { ACTOR_CAVE_ROCK } | The round boulder on the ledge of the cave beyond the summit, which Lift raises (TrialRoadCavePlacements). |
enum | anonymous enum { TRIAL_ROAD_CAVE_TO_EAST_PASSAGE, TRIAL_ROAD_CAVE_TO_WEST_CAV … } | The two parts of the cave beyond the summit, each way between them leading in by the entrance on its far side: the west cave, where the summit's passage comes in and the boulder sits on its ledge, and the east passage north to Gasp's pool. |
enum | anonymous enum { TRIAL_ROAD_CAVE_WEST_CAVE_FROM_EAST_PASSAGE, TRIAL_ROAD_CAVE … } | The entrances, one for each way above. |
enum | TRIAL_ROAD_FOUNTAIN_STAGE_ACTOR_ID { ACTOR_WEST_VENT, ACTOR_MIDDLE_VENT, ACTOR_EAST_VENT, ACTOR_S … } | The fountain stage's five vents (TrialRoadFountainStagePlacements): three in a row west to east, and two south of them. |
enum | TRIAL_ROAD_ENTRANCE { TRIAL_ROAD_STAGE_FOOT_LEFT, TRIAL_ROAD_STAGE_FOOT_RIGHT, TRI … } | The stage room's entrances. |
enum | anonymous enum { ACTOR_WEST_POST, ACTOR_EAST_POST } | The sand stage's two tightrope posts (TrialRoadSandStagePlacements). |
enum | TRIAL_ROAD_RIVAL_ACTIVITY { RIVAL_REPLAY, RIVAL_RECORD, RIVAL_LINKED, RIVAL_MIRROR, RIVA … } | What the rival does each tick (scTrialRoadMoveRival). |
enum | TRIAL_ROAD_RACE_MAP_TILE { RACE_MAP_TILE_STAGE, RACE_MAP_TILE_STAGE_FOOT, RACE_MAP_TILE … } | The tiles of the race map's picture (TrialRoadRaceMapPicture): a stage of the road in blue, 16 by 32 pixels with a 16 by 8 foot below it, and the two players' 16 by 16 markers, "1P" and "2P". |
enum | anonymous enum { LOG_LIES_NORTH_SOUTH, LOG_LIES_EAST_WEST } | Which way a log lies: the upper and lower logs north to south, rolling east or west, and the east log east to west, rolling north or south. |
enum | anonymous enum { PALETTE_CYCLE_LOAD, PALETTE_CYCLE_LOAD_AND_RUN, PALETTE_CYCL … } | How scTrialRoadStartPaletteCycle starts the summit's colour cycle: loading the palette's colours, loading them and starting the cycle's event, or keeping the colours already loaded. |
enum | anonymous enum { RIVAL_ONE_CHEST_OPEN, RIVAL_ONE_CHEST_CLOSE, RIVAL_ONE_CHEST … } | Moapa's ticks at the chests (TRIAL_ROAD_STATE.rivalTimer): with one chest to fill he opens it at RIVAL_ONE_CHEST_OPEN, closes it and opens his door; with two, he opens both at RIVAL_TWO_CHESTS_OPEN, turns north, closes the outer, turns north again, closes the inner and opens his door. |
Functions
| Name | Description | |
|---|---|---|
void | scTrialRoadFightGasp (void) | Talking to Gasp starts his battle. |
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. |
Sint32 | scTrialRoadSettleOnGround (ACTOR *actor) | The script of each clump of weeds: it sits on the ground at the foot of its pillar or cliff, drawn half again as tall as its picture. |
const ACTOR_PLACE * | scGetActorPlacements (void) | The scene's actor placements: a room of names for its entrance, else the debug room's. |
Sint32 | scTrialRoadRivalIsAhead (Sint32 fallback) | Whether Moapa is ahead in the race: by the stages each has cleared, then by who reached the switch at the top of this stage first; on a tie, fallback. |
Bool | scTrialRoadOfferToGiveUp (void) | Stepping on the give-up button at the top of a stage during the race (metatile (12, 8) on the left path, (20, 8) on the right) asks "Do you want to give up?". |
void | scTrialRoadTakeStairs (Sint32 direction) | Walking down the stairs at the foot of a stage, or through the open door at its top. |
Sint32 | scTrialRoadIsMirrored (void) | Whether the leader took the right path, on which the road is mirrored. |
void | scTrialRoadSetJumpMetatileUnder (Sint32 id) | Lets Felix jump onto the top of the pillar standing at the actor's metatile (MAP_METATILE_JUMP). |
void | scTrialRoadClearJumpMetatileUnder (Sint32 id) | Stops Felix jumping onto the metatile the actor is leaving. |
void | scTrialRoadAddPillarTop (Sint32 id) | Puts an invisible top on the pillar for Felix to stand on. |
void | scTrialRoadSetPillarTopLift (Sint32 id, Sint32 value) | Sets how many pixels above the pillar its top stands. |
void | scTrialRoadOpenVentMetatile (Sint32 id) | Lets Felix walk into the vent where the actor stands, now that it is dug out. |
void | scTrialRoadCheckLeaderOnPillars (void) | Keeps note, each tick, of whether Felix is up on the pillar stage's upper ledge or a pillar's top, 32 pixels up (FLAG_LEADER_ON_PILLARS). |
void | scTrialRoadCheckStakesCovered (Sint32 unused, Sint32 id) | After Move or a push, notes each stake whose partner has a pillar standing on it: stepping on that stake can no longer raise the partner (scTrialRoadStepOntoStake). |
void | scTrialRoadPoundStake (Sint32 id, Sint32 phase, Sint32 frame) | Pound on a raised stake in the Pound stage squashes it into the ground and pops its partner up (TrialRoadPoundPartners); Felix, standing where the partner rises, is thrown up onto it. |
void | scTrialRoadStepOntoStake (Sint32 id, Sint32 other, Sint32 flag, Sint32 side) | Stepping onto a raised stake in the Pound stage sinks it slowly under Felix's weight while its partner grows out of the ground, unless a pillar stands on the partner. |
void | scTrialRoadPushLog (Sint32 id, Sint32 dx, Sint32 dz, Sint32 lies) | Felix leans on a log in the log stage and it rolls, up to six metatiles, until the block or a wall stops it. |
void | scTrialRoadUncoverVent (Sint32 id, Sint32 phase, Sint32 frame) | Scoop over one of the fountain stage's three buried vents, at metatiles (13, 23), (16, 23) and (19, 23), digs it out: the vent shows in the ground, Felix can step onto it, and its fountain rises and falls with the others. |
void | scLeaderCheckCrumblingStep (const Uint16 *table) | Stepping onto a crumbling pillar of an (actor, flag) list, as scCrumblingPillarStep: the first time it flashes and cracks, the second time it gives way under the leader with a shake, dust and a thump. |
void | scTrialRoadCrumblePillar (const void *data, Sint32 id) | A cracked pillar in the crumbling stage shakes, crumbles and falls away, as Magma Rock's do. |
void | scTrialRoadClearGiveUpAsked (void) | Stepping off the give-up button lets it ask again next time Felix steps on it. |
void | scTrialRoadBlowAwayPillarStageWeeds (void) | Whirlwind on the weeds at the foot of the pillar stage's overgrown pillar, at metatile (15, 24), blows it away, and the pillar can then be pushed. |
void | scTrialRoadJumpAcrossGap (void) | Walking south off the pillar stage's upper ledge, beside the vine, jumps Felix across the gap when the pillar beneath has been pushed into it (row 23 of the map); otherwise he hops down to the ground in a puff of dust. |
void | scTrialRoadJumpMeltedPuddle (void) | Walking north or south into a melted puddle in the torch stage jumps Felix across it; a frozen one stops him. |
void | scTrialRoadStepOntoWestStake (void) | Stepping onto the west stake sinks it and raises the inner west one. |
void | scTrialRoadStepOntoInnerWestStake (void) | Stepping onto the inner west stake sinks it and raises the west one. |
void | scTrialRoadStepOntoInnerEastStake (void) | Stepping onto the inner east stake sinks it and raises the east one. |
void | scTrialRoadStepOntoEastStake (void) | Stepping onto the east stake sinks it and raises the inner east one. |
void | scTrialRoadLandOnPillar (void) | Walking into a pillar or stake in the Pound stage: from a raised top Felix jumps onto it, and from the ground he pushes it, if it can be pushed. |
void | scTrialRoadCheckCrumblingPillars (void) | Hopping onto one of the crumbling stage's two cracked pillars, from the east or the west: the first time it flashes, and the second time it crumbles under Felix and drops him to the ground. |
void | scTrialRoadPushUpperLogWest (void) | Walking west into the upper log rolls it west. |
void | scTrialRoadPushUpperLogEast (void) | Walking east into the upper log rolls it east. |
void | scTrialRoadPushLowerLogWest (void) | Walking west into the lower log rolls it west. |
void | scTrialRoadPushLowerLogEast (void) | Walking east into the lower log rolls it east. |
void | scTrialRoadPushEastLogNorth (void) | Walking north into the east log rolls it north. |
void | scTrialRoadPushEastLogSouth (void) | Walking south into the east log rolls it south. |
void | scTrialRoadPushEastLogSouthOrClimbDown (void) | Pressing south at the north end of the east log's track: if Felix is climbing there he climbs down, and on foot he rolls the east log south. |
void | scTrialRoadStartSand (void) | Sand at the sand stage lets Felix, sunk into the ground, go up the stream that would otherwise carry him back. |
void | scTrialRoadEndSand (void) | When Felix rises out of the sand at the sand stage, he walks on the ground level again. |
void | scTrialRoadBlowAwaySandStageWeeds (void) | Whirlwind on the weeds on the sand stage's cliff blows it away and uncovers the vine behind it, metatile (19, 21), which Felix can then climb. |
void | scTrialRoadDriftWithStream (void) | Walking in the sand stage's stream carries Felix south a pixel a tick, throwing up spray, unless he is crossing the tightrope above it. |
void | scTrialRoadLiftCaveRock (void) | Lift on the rock in the cave beyond the summit raises it out of the way to Gasp's pool. |
void | scTrialRoadScatterWeeds (void) | Cyclone on the clumps of weeds around Gasp's pool scatters the ones it touches. |
void | scTrialRoadScatterWeedsHidingMadPlant (void) | Cyclone on the left-hand weeds by the entrance of Gasp's pool, metatile (4, 9), scatters them, and the Mad Plant hiding there leaps out and attacks. |
void | scTrialRoadRevealPoolTiles (void) | Reveal anywhere in Gasp's pool room shows the hidden tiles in the pools, at metatiles (10, 11), (18, 7) and (18, 15). |
void | scTrialRoadHidePoolTiles (void) | When Reveal wears off in Gasp's pool room, the tiles in the pools are hidden again. |
void | scTrialRoadChallengeMoapa (void) | At the summit during the race, stepping onto the top of the peak, metatile (13, 16) on the left path or (18, 16) on the right, either side of the round tile in the middle of the top, brings on Moapa: he speaks according to who arrived first, and the battle with him and his knights begins, chosen by how many doors he reached first. |
void | scTrialRoadIdle (void) | Does nothing. |
void | scTrialRoadReachPeakFirst (void) | The party gathers at the summit first, and Moapa and his knights arrive after them: "You were quite swift! |
void | scTrialRoadReachPeakSecond (void) | Moapa and his knights are already waiting when the party reaches the summit: "You may have been slow, but you made it through Trial Road". |
void | scTrialRoadLowerStake (Sint32 id) | Sinks a stake into the ground, so that Felix walks over it. |
void | scTrialRoadRaiseStake (Sint32 id) | Raises a stake out of the ground, solid, its top 16 pixels up. |
void | scTrialRoadBlockLogs (void) | Makes the three logs solid where they lie, and lets Felix jump east across a log that has fallen into the water. |
void | scTrialRoadStartFountains (Sint32 unused, Sint32 shape) | Starts the fountains' state and their event. |
void | scTrialRoadStepPaletteCycle (void) | Each tick: turns the summit's five purples over by one every four ticks and writes the first four of them to SUMMIT_PURPLE_PALETTE's colours 2 to 5; it pauses while a Psynergy other than Hover, Reveal or the menu is up. |
void | scTrialRoadShutSummitDoorway (Sint32 sound) | Felix comes out of the last stage's doorway at the summit during the race and steps on the metatile in front of it, metatile (13, 19) on the left path or (18, 19) on the right: with the sound of a door, the dark doorway behind him shuts, a closed green door like the other path's, and on the upper layer its metatile, (77, 18) or (82, 18), takes the walking rules of the one beside it. |
void | scTrialRoadPlaceMoapaAtPeak (void) | Places Moapa and his two knights at the summit, waiting for the party. |
void | scTrialRoadBeatMoapa (void) | After the party beats Moapa at the summit, he admits their strength and gives them the Hover Jade for the Shaman's Rod, and the party goes back to the Shaman Village to rest. |
void | scTrialRoadLoseToMoapa (void) | After the party loses to Moapa at the summit: "You've lost. |
void | scTrialRoadShowTraps (void) | While Moapa explains the trial, the camera tours a stage: its traps, the four doors, a knight showing how the switch opens the blue chests and how filling them opens the door, and the give-up button. |
void | scTrialRoadSetUpCave (void) | The cave beyond the summit needs no setting up. |
void | scTrialRoadSetUpPoolRoom (void) | Readies Gasp's pool room, unless Gasp has joined the party: he floats over the water until he first hops away, and stands on the ground after; each tick he mirrors Felix (scTrialRoadGaspFlees). |
Sint32 | scTrialRoadRivalIsWaiting (void) | Whether Moapa's party is waiting. |
void | scTrialRoadPlayRivalRecording (Sint32 resource) | Plays Moapa's recording from the given resource. |
void | scTrialRoadDealStageOrder (Uint32 seed) | Deals the Trial Road's stage order from a seed: shuffles 0 to 7 into the eight slots at the start of the stage state, again until both the even and the odd slots hold at least one of the four values in TrialRoadKeyStages; the random state is restored after. |
void | scTrialRoadShowRaceMap (Sint32 leaderId, Sint32 rivalId) | Shows the race map for both sides. |
void | scTrialRoadOpenLeaderDoor (Sint32 side, Sint32 stage) | Opens the door at the top of Felix's stage: the door at metatile (23, 3) on the left path, (9, 3) on the right, is redrawn open and its doorway leads on. |
void | scDustScatter (Sint32 spread) | Eight clouds of dust puff up in a row across the leader's feet; with spread set they fly out all round. |
void | fdLeaderSetMetatileShapeAt (Sint32 offset, Sint32 layer) | Sets the shape of the metatile under the leader level steps above its ground. |
void | scMagmaRockInsideSpawnDustRing (void) | Clouds of dust burst out in a ring round the leader as something lands with a thump: Magma Rock's routine, kept here under its name for the crumbling pillars' shared code. |
void | fdActorSetMetatileShape (Sint32 level, Sint32 layer, Sint32 id) | Gives the metatile of layer under an actor the shape of the ground there, level steps of 8 pixels (METATILE_HEIGHT_STEPS) higher, or lower when negative, as a crumbling pillar sinks 4. |
void | scTrialRoadDriftDust (FIELD_OBJECT *object) | The dust's motion each tick, as scEffectAdvanceMotionAtLeaderPriority's: it drifts, slows, grows and spins, drawn at the leader's sprite priority. |
void | scTrialRoadMoveRival (void) | Moves the Trial Road rival as its activity says: RIVAL_MIRROR follows the leader's position mirrored across the course; RIVAL_LINKED places the rival and its partner from the linked player's record; RIVAL_REPLAY replays the recorded path; RIVAL_RECORD records the actor's position. |
void | scTrialRoadSetUpPillarStage (void) | Readies the pillar stage: the middle pillar cannot be pushed until Whirlwind blows its weeds off, and Felix can jump between the pillars' tops. |
void | scTrialRoadSetUpTorchStage (void) | Readies the torch stage: its pillars of ice cannot be pushed, and those already melted stay puddles. |
void | scTrialRoadSetUpWeedsPillarStage (void) | Readies the weeds stage: its two overgrown pillars cannot be pushed until Whirlwind blows their weeds off. |
void | scTrialRoadSetUpPoundStage (void) | Readies the Pound stage: its four stakes cannot be pushed, one of each pair stands raised, and the overgrown pillar cannot be pushed until Whirlwind blows its weeds off. |
void | scTrialRoadSetUpCrumblingStage (void) | Readies the crumbling stage: the cracked pillars already crumbled stay gone. |
void | scTrialRoadSetUpLogStage (void) | Readies the log stage: the logs roll by their own scripts rather than sliding like blocks, their metatiles are walls (scTrialRoadBlockLogs), and Felix can jump onto the block. |
void | scTrialRoadSetUpFountainStage (void) | Readies the fountain stage: its five vents' fountains rise and fall together, the northern three buried until Scoop digs them out; Felix rides a risen fountain as a step up, and can jump onto the block. |
void | scTrialRoadSetUpSandStage (void) | Readies the sand stage: its tightrope between two posts, and the vine on the cliff, climbable once Whirlwind has blown its weeds away. |
void | scTrialRoadUpdateFountains (void) | Moves the fountains each tick: at its rise phase a fountain starts up 4 pixels a tick, at its fall phase down 8, until it reaches its high or low height; its phase runs round its period while the field engine handles no request. |
DEFINE_TRIAL_ROAD_OPEN_DOOR( | scTrialRoadOpenRivalDoor , 28, 62, 1, 4, 38, 0) | Opens the door at the top of Moapa's stage, beside Felix's: metatile (28, 3) when Felix took the left path, (4, 3) when he took the right. |
void | scTrialRoadOpenChests (void) | Standing on the switch in front of the door at the top of a stage (metatile (22, 9) on the left path, (10, 9) on the right) opens the blue chest beside the door, and the second chest too when Moapa got there first ("it will take twice the weight to open the doors"). |
void | scTrialRoadPutItemInChest (Sint32 item, Sint32 owner, Sint32 slot) | Choosing a piece of equipment for an open blue chest puts it inside, and the message names its owner and the item ("Felix put ...'s ... in the chest."). |
void | scTrialRoadExamineChest (Sint32 id) | Searching a blue chest before the switch has opened it says "The chest won't open. |
void | scTrialRoadStepOffSwitch (void) | Walking around the switch once the chests have opened does nothing. |
Sint32 | scTrialRoadFollowPillar (ACTOR *actor) | Keeps an invisible pillar top on its pillar, so many pixels above it. |
DEFINE_TRIAL_ROAD_ON_FOOT( | TrialRoadClearJumpUnderPushedPillar , scTrialRoadClearJumpMetatileUnder) | As a pillar starts to slide, Felix can no longer jump onto the place it is leaving. |
DEFINE_TRIAL_ROAD_ON_FOOT( | TrialRoadSetJumpUnderPushedPillar , scTrialRoadSetJumpMetatileUnder) | Once a pushed or Moved pillar stops, Felix can jump onto its top where it stands. |
void | scTrialRoadJumpForward (void) | Walking off the edge of a ledge or pillar top toward another one jumps Felix across, when there is somewhere to land. |
void | scTrialRoadClearJumpUnderTorchStagePillar (Sint32 unused, Sint32 id) | As one of the torch stage's two stone pillars starts to slide, Felix can no longer jump onto the place it is leaving. |
void | scTrialRoadMeltIceBesideTorch (Sint32 unused, Sint32 id) | Pushing a torch up to one of the torch stage's two pillars of ice, pillar C in column 13 of the map or F in column 19, melts it to a puddle Felix can jump across (columns 15 and 17 would be D's and E's, which are not on the stage). |
void | scTrialRoadFreezePuddle (Sint32 unused, Sint32 id) | Frost on a melted puddle in the torch stage freezes it into a pillar of ice again, which Felix can stand on. |
void | scTrialRoadBlowAwayWeeds (Sint32 unused, Sint32 id) | Whirlwind on the weeds at the foot of one of the two overgrown pillars in the weeds stage blows it away, and the pillar can then be pushed or Moved. |
void | scTrialRoadBlowAwayPoundStageWeeds (void) | Whirlwind on the weeds at the foot of the Pound stage's middle pillar, at metatile (16, 28), blows it away, and the pillar can then be pushed. |
void | scTrialRoadPoundWestStake (Sint32 phase, Sint32 frame) | Pound on the west stake, metatile (13, 26), drives it down and raises the inner west stake. |
void | scTrialRoadPoundInnerWestStake (Sint32 phase, Sint32 frame) | Pound on the inner west stake, metatile (15, 26), drives it down and raises the west stake. |
void | scTrialRoadPoundInnerEastStake (Sint32 phase, Sint32 frame) | Pound on the inner east stake, metatile (17, 26), drives it down and raises the east stake. |
void | scTrialRoadPoundEastStake (Sint32 phase, Sint32 frame) | Pound on the east stake, metatile (19, 26), drives it down and raises the inner east stake. |
void | scTrialRoadCrumbleWestPillar (Sint32 stage) | Burst on the crumbling stage's west cracked pillar crumbles it away. |
void | scTrialRoadCrumbleEastPillar (Sint32 stage) | Burst on the crumbling stage's east cracked pillar crumbles it away. |
void | scTrialRoadBlockLogMetatiles (Sint32 id, Sint32 lies) | Makes a log solid where it lies: its own metatile and the two beside it along its length (METATILE_BEHAVIOR_WALL on the ground and the upper level). |
Sint32 | scTrialRoadIsLogBlocked (Sint32 x, Sint32 z) | Whether a log rolling into the metatile is stopped there by the block or a wall. |
void | scTrialRoadUncoverWestVent (Sint32 phase, Sint32 frame) | Scoop over the west vent digs it out. |
void | scTrialRoadUncoverMiddleVent (Sint32 phase, Sint32 frame) | Scoop over the middle vent digs it out. |
void | scTrialRoadUncoverEastVent (Sint32 phase, Sint32 frame) | Scoop over the east vent digs it out. |
void | scTrialRoadStandOnBlock (void) | Stepping onto the fountain stage's block from above leaves Felix standing on its top, 32 pixels up, rather than inside it. |
Sint32 | scTrialRoadReturnTrue (void) | Unused: always 1. |
void | scTrialRoadSetSummitPillar (Sint32 unused, Sint32 id) | Moving or pushing the summit's stone pillar, at metatile (7, 20), one metatile east into column 8 settles it there for good. |
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 | scMagmaRockInsideRestoreCrumblingPillars (const Uint16 *table) | Puts the crumbling pillars of a list back where their flags left them: one whose second flag is set has fallen and is put away; the others stand on their metatiles raised 32 pixels, gaps to jump onto, in animation 0 once their first flag is set, as the first step on one leaves it. |
TRIAL_ROAD_FOUNTAIN * | scTrialRoadAddFountain ( Sint32 slot, Sint32 id, Sint32 timer, Sint32 low, Sint32 high) | Sets up one fountain on its vent, with its timer and height. |
void | scTrialRoadGaspFlees (void) | Gasp moves opposite to Felix about the hidden tile at metatile (18, 15): whatever way Felix steps, Gasp steps the other. |
void | scTrialRoadSetPaletteCycleRunning (Sint32 value) | Starts or stops the summit's colour cycle. |
static inline void | scPaletteCycleSetTick (Sint32 value) | Sets the colour cycle's tick counter, as the Jupiter and Mars Lighthouse rooms' palette cycles, which this one copies, do. |
void | scTrialRoadStartPaletteCycle (Sint32 mode) | Starts the summit's colour cycle as mode says. |
void | scTrialRoadLeaveMoapaWaiting (void) | Felix got to the summit first, so Moapa is not placed yet; he arrives when Felix walks up (scTrialRoadReachPeakFirst). |
void | scTrialRoadSetUpPeak (void) | Readies the summit: after the battle, Moapa's surrender or his scorn; during the race, Moapa and his knights waiting at the top if they got there first, or nobody yet. |
extern void (* | TrialRoadStageSetUps [])(void) | Each stage pattern's set-up, by the pattern's low three bits. |
Sint32 | scInit (void) | Sets up the room being entered: in the race a stage's puzzle by its pattern, while Moapa explains the rules the course he tours, Gasp's pool room, and the summit. |
void | scTrialRoadCopyMetatilesBackward (Sint32 srcX, Sint32 srcY, Sint32 width, Sint32 height, Sint32 destX, Sint32 destY) | Copies a rectangle of map metatiles and their shapes, last row first, so that overlapping rectangles copy whole. |
void | scTrialRoadUpdateRival (void) | Each tick of the race, moves Moapa's party on by its recording, and opens his door when he reaches it. |
void | scTrialRoadStartRival (Sint32 mirrored) | Starts Moapa's party on its recording, mirrored when the leader went right. |
Sint32 | scPrepareMap (void) | Readies the map before the room is drawn. |
Sint32 | scTrialRoadGetStage (Sint32 side) | The stage a side of the race has reached: 0 the leader's, 1 Moapa's. |
Sint32 | scTrialRoadMirrorX (Sint32 x) | A pixel x on the mirrored road, the right path's, when the leader took it. |
Sint32 | scTrialRoadMirrorMetatileX (Sint32 x) | A metatile x, in pixels, on the mirrored road when the leader took it. |
Sint32 | scTrialRoadMirrorOffset (Sint32 x) | An x offset of so many 8-pixel steps, in pixels, turned round on the mirrored road. |
Sint32 | scTrialRoadMirrorAngle (Sint32 angle) | An angle on the mirrored road, turned round when it is. |
void | scTrialRoadPlaceActor (Sint32 id, Sint32 x, Sint32 z, Sint32 angle) | Places an actor at a pixel position and facing, mirrored when the leader took the right path. |
static inline void | scTrialRoadGatherAtPeak (void) | The camera pans to the summit, and the party walks up to its near side and turns to face the far one, where Moapa stands or will land. |
void | scTrialRoadDrawFountains (void) | Queues the fountains' sprites each tick: each risen fountain's column of water, in 16-pixel segments up from its vent, and its spout bobbing on top. |
static __inline__ void * | scTrialRoadAllocateTileBuffer (Sint32 size) | A buffer in EWRAM to decompress the fountains' tiles into. |
void | scTrialRoadStepOnTrap (const Uint16 *table) | Unused: Magma Rock's trap floor, kept in this overlay: a cracked pillar stepped on flashes the first time and gives way under Felix the second, with Moapa's actor standing in for the trap's picture. |
void | scStringWriteU32AsHex (Uint8 *text, Uint32 value) | Unused: writes value as eight hexadecimal digits (TrialRoadHexDigits) and a terminating null. |
void | scTrialRoadStopRival (void) | Stops Moapa's party where it stands, as at the end of its recording. |
void | scTrialRoadWaitForRival (void) | Waits until Moapa's party has finished its recording. |
static inline void * | scTrialRoadLinkAllocatePicture (void) | The picture's buffer in EWRAM, the size syVRAMCacheLoad copies. |
void | scTrialRoadDrawRaceMap (void) | Draws the race map each tick, once scTrialRoadShowRaceMap starts it: the display slides in from both sides of the screen, and out while a menu or a Psynergy is open. |
void | scTrialRoadNoOperation (void) | Unused: does nothing. |
Variables
Description
Trial Road, the mountain path above the Shaman Village where Moapa tests the party before he will hand over the Hover Jade. Felix races Moapa and his two knights up four stages, by the left path or the right. Each stage is one of eight puzzle rooms (logs to roll, stakes to Pound, weeds to blow away, frozen puddles, crumbling pillars, fountains, a sand stream), dealt in an order that depends on the letters of the leader's name. At the top of each stage the switch in front of the door opens the blue chests beside it, and the door opens once each open chest holds a piece of the party's equipment: one chest, or two when Moapa got there first. A button at the top offers to give up. Moapa's party waits at the summit, or arrives after the party, and fights them for the Jade. Long after, Hover on the summit's purple tile reaches a cave whose rock Lift raises, and beyond it a pool with weeds hiding a Mad Plant, a hidden tile Reveal shows, an Elixir chest and Gasp the Djinni, who moves opposite to Felix.
Macros in detail
MAD_PLANT_TRIAL_ROAD
#define MAD_PLANT_TRIAL_ROAD 4
Trial Road's Mad Plant, the last of the five hidden in weeds: its
FLAG_MAD_PLANT and its column of ENCOUNTER_ZONE_MAD_PLANTS.
Referenced by scTrialRoadScatterWeedsHidingMadPlant().
Definition at line 93 of file trial_road.c.
FLAG_TRIAL_ROAD_PEAK_PILLAR_PLACED
#define FLAG_TRIAL_ROAD_PEAK_PILLAR_PLACED 0x9fc
Set once the summit's stone pillar has been moved one metatile east, into column 8 of the map, where it stays.
Referenced by scTrialRoadSetSummitPillar() and scTrialRoadSetUpPeak().
Definition at line 96 of file trial_road.c.
FLAG_LEADER_ON_PILLARS
#define FLAG_LEADER_ON_PILLARS FLAG_SCENE_TEMP(0x08)
Set while Felix stands up on the pillar stage's upper ledge or a pillar's top
(scTrialRoadCheckLeaderOnPillars).
Referenced by scTrialRoadCheckLeaderOnPillars().
Definition at line 100 of file trial_road.c.
FLAG_GIVE_UP_ASKED
#define FLAG_GIVE_UP_ASKED FLAG_SCENE_TEMP(0x81)
Set once the give-up button has asked; stepping off it clears it.
Referenced by scTrialRoadClearGiveUpAsked() and scTrialRoadOfferToGiveUp().
Definition at line 102 of file trial_road.c.
FLAG_STAGE_DOOR_OPEN
#define FLAG_STAGE_DOOR_OPEN FLAG_SCENE_TEMP(0x82)
Set once both blue chests hold their items and the leader's door opens.
Referenced by scPrepareMap() and scTrialRoadPutItemInChest().
Definition at line 104 of file trial_road.c.
FLAG_STAGE_CHESTS_OPENED
#define FLAG_STAGE_CHESTS_OPENED FLAG_SCENE_TEMP(0x84)
Set once Felix has stood on the switch at the top of the stage and the blue
chests have opened (scTrialRoadOpenChests).
Referenced by scPrepareMap(), scTrialRoadOpenChests() and scTrialRoadRivalIsAhead().
Definition at line 107 of file trial_road.c.
FLAG_INNER_CHEST_OPEN
#define FLAG_INNER_CHEST_OPEN FLAG_SCENE_TEMP(0x85)
Set while the inner blue chest stands open for an item.
Referenced by scTrialRoadExamineChest(), scTrialRoadOpenChests() and scTrialRoadPutItemInChest().
Definition at line 109 of file trial_road.c.
FLAG_OUTER_CHEST_OPEN
#define FLAG_OUTER_CHEST_OPEN FLAG_SCENE_TEMP(0x86)
Set while the outer blue chest stands open for an item: it opens only when Moapa reached the door first.
Referenced by scTrialRoadExamineChest(), scTrialRoadOpenChests() and scTrialRoadPutItemInChest().
Definition at line 112 of file trial_road.c.
FLAG_SUMMIT_DOORWAY_SHUT
#define FLAG_SUMMIT_DOORWAY_SHUT FLAG_SCENE_TEMP(0x83)
Set once the doorway Felix came out of at the summit has shut behind him
(scTrialRoadShutSummitDoorway).
Referenced by scTrialRoadSetUpPeak() and scTrialRoadShutSummitDoorway().
Definition at line 115 of file trial_road.c.
FLAG_CAVE_ROCK_LIFTED
#define FLAG_CAVE_ROCK_LIFTED FLAG_SCENE_TEMP(0x89)
Set once Lift has raised the rock at the summit cave's mouth.
Referenced by scTrialRoadLiftCaveRock().
Definition at line 117 of file trial_road.c.
FLAG_GASP_FLED
#define FLAG_GASP_FLED FLAG_SCENE_TEMP(0x88)
Set once Gasp has stopped mirroring Felix and hopped away to where he can be talked to.
Referenced by scTrialRoadGaspFlees() and scTrialRoadSetUpPoolRoom().
Definition at line 120 of file trial_road.c.
FLAG_LINK_PLAYER
#define FLAG_LINK_PLAYER FLAG_SCENE_TEMP(0xf8)
The link race's flags, which no code in the game sets, as nothing chooses
RIVAL_LINKED: the byte of flags from FLAG_LINK_PLAYER holds this player's
number in the link, so the rival follows the other player's record; while
FLAG_LINKED_RIVAL_HALTS is set, a rival whose record has its top byte set
stops 12 pixels beside the course's corner, 16 pixels north of it with the
far side's timer if FLAG_LINKED_RIVAL_ON_FAR_SIDE is set and 16 south with
the near side's if not.
Referenced by scTrialRoadMoveRival().
Definition at line 128 of file trial_road.c.
FLAG_LINKED_RIVAL_HALTS
#define FLAG_LINKED_RIVAL_HALTS FLAG_SCENE_TEMP(0x11)
Referenced by scTrialRoadMoveRival().
Definition at line 129 of file trial_road.c.
FLAG_LINKED_RIVAL_ON_FAR_SIDE
#define FLAG_LINKED_RIVAL_ON_FAR_SIDE FLAG_SCENE_TEMP(0x12)
Referenced by scTrialRoadMoveRival().
Definition at line 130 of file trial_road.c.
FLAG_PILLAR_STAGE_WEEDS_BLOWN_AWAY
#define FLAG_PILLAR_STAGE_WEEDS_BLOWN_AWAY FLAG_AREA_TEMP(0x07)
Set once Whirlwind has blown away the weeds on the pillar stage's pillar C, on the Pound stage's pillar B, and on the sand stage's cliff.
Referenced by scTrialRoadBlowAwayPillarStageWeeds() and scTrialRoadSetUpPillarStage().
Definition at line 133 of file trial_road.c.
FLAG_POUND_STAGE_WEEDS_BLOWN_AWAY
#define FLAG_POUND_STAGE_WEEDS_BLOWN_AWAY FLAG_AREA_TEMP(0x39)
Referenced by scTrialRoadBlowAwayPoundStageWeeds() and scTrialRoadSetUpPoundStage().
Definition at line 134 of file trial_road.c.
FLAG_SAND_STAGE_WEEDS_BLOWN_AWAY
#define FLAG_SAND_STAGE_WEEDS_BLOWN_AWAY FLAG_AREA_TEMP(0x74)
Referenced by scTrialRoadBlowAwaySandStageWeeds() and scTrialRoadSetUpSandStage().
Definition at line 135 of file trial_road.c.
FLAG_INNER_WEST_STAKE_RAISED
#define FLAG_INNER_WEST_STAKE_RAISED FLAG_AREA_TEMP(0x35)
Set while the Pound stage's inner west stake stands raised and the west one sunk; clear the other way round.
Referenced by scTrialRoadPoundStake(), scTrialRoadSetUpPoundStage(), scTrialRoadStepOntoInnerWestStake() and scTrialRoadStepOntoWestStake().
Definition at line 138 of file trial_road.c.
FLAG_EAST_STAKE_RAISED
#define FLAG_EAST_STAKE_RAISED FLAG_AREA_TEMP(0x37)
Set while the Pound stage's east stake stands raised and the inner east one sunk; clear the other way round.
Referenced by scTrialRoadPoundStake(), scTrialRoadSetUpPoundStage(), scTrialRoadStepOntoEastStake() and scTrialRoadStepOntoInnerEastStake().
Definition at line 141 of file trial_road.c.
FLAG_RIVAL_FIRST_AT_DOOR_BASE
#define FLAG_RIVAL_FIRST_AT_DOOR_BASE FLAG_AREA_TEMP(0x81)
The four stages' flags, from FLAG_AREA_TEMP(0x81): each set once Moapa
reached that stage's door before Felix.
Referenced by scTrialRoadChallengeMoapa() and scTrialRoadOpenChests().
Definition at line 144 of file trial_road.c.
FLAG_WEST_CRUMBLING_PILLAR_STEPPED_ON
#define FLAG_WEST_CRUMBLING_PILLAR_STEPPED_ON FLAG_AREA_TEMP(0x42)
Each cracked pillar of the crumbling stage: set once Felix has first stepped on it and it has flashed, and once it has crumbled away.
Definition at line 147 of file trial_road.c.
FLAG_WEST_CRUMBLING_PILLAR_CRUMBLED
#define FLAG_WEST_CRUMBLING_PILLAR_CRUMBLED FLAG_AREA_TEMP(0x43)
Definition at line 148 of file trial_road.c.
FLAG_EAST_CRUMBLING_PILLAR_STEPPED_ON
#define FLAG_EAST_CRUMBLING_PILLAR_STEPPED_ON FLAG_AREA_TEMP(0x44)
Definition at line 149 of file trial_road.c.
FLAG_EAST_CRUMBLING_PILLAR_CRUMBLED
#define FLAG_EAST_CRUMBLING_PILLAR_CRUMBLED FLAG_AREA_TEMP(0x45)
Definition at line 150 of file trial_road.c.
FLAG_PARTY_FIRST_AT_PEAK
#define FLAG_PARTY_FIRST_AT_PEAK FLAG_AREA_TEMP(0x85)
Set once Felix climbs to the summit ahead of Moapa.
Referenced by scPrepareMap(), scTrialRoadChallengeMoapa(), scTrialRoadSetUpPeak() and scTrialRoadTakeStairs().
Definition at line 152 of file trial_road.c.
FLAG_STAGE_ORDER_DEALT
#define FLAG_STAGE_ORDER_DEALT FLAG_AREA_TEMP(0x80)
Set once the stages' order has been dealt from the leader's name.
Referenced by scPrepareMap().
Definition at line 154 of file trial_road.c.
ACTOR_KRADEN
#define ACTOR_KRADEN (ACTOR_MOAPA + 1)
Kraden, at the summit (TrialRoadSummitPlacements), after Moapa.
Referenced by AttekaInletHarborCues, IdejimaCuesWake, scAlhafraManorBriggsEscapes(), scAncientLemuriaHeadForTheDock(), scAncientLemuriaMeetTheLemurians(), scAttekaInletAskKradenToSetSail(), scAttekaInletKradenAsksToSetSail(), scChampaCliffCavesObabaMournsSalamander(), scChampaMeetAlex(), scContigoReturnToNewHome(), scContigoTheReunion(), scDailaMeetAlex(), scEasternAlhafraAskIfFinished(), scEasternAlhafraAskToHelpWithMast(), scEasternAlhafraBriggsStealsShip(), scEasternAlhafraMayorFindsShipGone(), scEasternAlhafraOverhearWorkers(), scEasternAlhafraShipBriggsIsCaught(), scEasternAlhafraShipMayorArrives(), scEasternAlhafraWorkersTellMayor(), SceneCues, scGabombaCatacombsGabombaBestowsPower(), scGabombaStatueChamberAkafubuOffersToHelp(), scGabombaStatueChamberWhereIsTheOrb(), scGabombaStatueFocusEnergies(), scGabombaStatueKradenNoticesTiming(), scGabombaStatueSawEnergyFlow(), scGabombaStatueSeeHowItWorks(), scGabombaStatueWatchTheChargesStick(), scGaiaRockInsideReadSandTablet(), scGarohFollowWerewolfIntoCave(), scGarohMahaTellsTheLegend(), scGarohWerewolfRunsPast(), scGarohWerewolvesRevealThemselves(), scGondowanCliffsTurnBackToHelpPiers(), scIdejimaBreakAwayFromGondowan(), scIdejimaCatchUpWithFelix(), scIdejimaFindFelixAndSheba(), scIdejimaLayDownTheOthers(), scIdejimaRideTheTidalWave(), scIdejimaWakeKraden(), scIdejimaWonderWhereAlexHasGone(), scInit(), scIzumoRoomsRecognizeTheHeroes(), scJupiterLighthouseCastTheJupiterStar(), scJupiterLighthouseIsaacAndIvanFall(), scJupiterLighthouseKarstAndAgatioRetreat(), scJupiterLighthousePartyArrivesAtTheFight(), scJupiterLighthousePlaceTheHurt(), scJupiterLighthouseTalkAfterTheFight() and 48 more.
Definition at line 175 of file trial_road.c.
ACTOR_PEAK_PILLAR
#define ACTOR_PEAK_PILLAR (ACTOR_KRADEN + 1)
The pillar at the summit (TrialRoadSummitPlacements), after Kraden.
Referenced by scTrialRoadSetUpPeak().
Definition at line 249 of file trial_road.c.
ENTRANCE_IS_LEFT_PATH
#define ENTRANCE_IS_LEFT_PATH(entrance) ((entrance) & 1)
Whether a stage entrance is on the left path: the left path's are odd, the right path's even.
Referenced by scPrepareMap() and scTrialRoadMoveRival().
Definition at line 317 of file trial_road.c.
FLAG_PUDDLE_MELTED_BASE
#define FLAG_PUDDLE_MELTED_BASE (FLAG_SCENE_TEMP(0x14) - ACTOR_PILLAR_C)
The torch stage's pillars C to F are frozen puddles, pillars of ice, though
only C and F stand on the stage (D and E are placed at the origin); each
one's flag, FLAG_SCENE_TEMP(0x14) to FLAG_SCENE_TEMP(0x17), is set once a
torch has melted it to a puddle.
Referenced by scTrialRoadFreezePuddle(), scTrialRoadJumpMeltedPuddle(), scTrialRoadMeltIceBesideTorch() and scTrialRoadSetUpTorchStage().
Definition at line 330 of file trial_road.c.
FLAG_WEEDS_BLOWN_AWAY_BASE
#define FLAG_WEEDS_BLOWN_AWAY_BASE (FLAG_AREA_TEMP(0x27) - ACTOR_WEEDS_A)
The weeds pillar stage's two clumps of weeds; each one's flag,
FLAG_AREA_TEMP(0x27) and FLAG_AREA_TEMP(0x28), is set once Whirlwind has
blown it away.
Referenced by scTrialRoadBlowAwayWeeds() and scTrialRoadSetUpWeedsPillarStage().
Definition at line 334 of file trial_road.c.
FLAG_LOG_IN_WATER_BASE
#define FLAG_LOG_IN_WATER_BASE (FLAG_SCENE_TEMP(0x53) - ACTOR_UPPER_LOG)
The log stage's logs' flags, FLAG_SCENE_TEMP(0x53) to FLAG_SCENE_TEMP(0x55),
set once each has rolled off the edge into the water.
Referenced by scTrialRoadBlockLogs() and scTrialRoadPushLog().
Definition at line 338 of file trial_road.c.
FLAG_VENT_UNCOVERED_BASE
#define FLAG_VENT_UNCOVERED_BASE (FLAG_AREA_TEMP(0x63) - ACTOR_WEST_VENT)
The fountain stage's vents' flags, FLAG_AREA_TEMP(0x63) to
FLAG_AREA_TEMP(0x65), set once each has been uncovered.
Referenced by scTrialRoadSetUpFountainStage() and scTrialRoadUncoverVent().
Definition at line 341 of file trial_road.c.
PUSH_BLOCKED
#define PUSH_BLOCKED(object) *(Uint8 *)&object->sceneCount
A piece Felix cannot push: a pillar weeds hold down, a frozen puddle, a
stake, or a log (logs roll by their own scripts). fdLeaderCanPushObjectAhead
refuses a target with this byte set.
Referenced by scTrialRoadBlowAwayPillarStageWeeds(), scTrialRoadBlowAwayPoundStageWeeds(), scTrialRoadBlowAwayWeeds(), scTrialRoadSetUpPillarStage(), scTrialRoadSetUpPoundStage(), scTrialRoadSetUpTorchStage() and scTrialRoadSetUpWeedsPillarStage().
Definition at line 346 of file trial_road.c.
PILLAR_TOP_HEIGHT
#define PILLAR_TOP_HEIGHT(top) *(Uint8 *)&top->sceneByte
The height in pixels of a pillar's top (scTrialRoadAddPillarTop) above the
pillar: PILLAR_HEIGHT standing, -PILLAR_HEIGHT lowered.
Referenced by scTrialRoadAddPillarTop(), scTrialRoadCheckStakesCovered(), scTrialRoadFollowPillar(), scTrialRoadSetPillarTopLift() and scTrialRoadStepOntoStake().
Definition at line 349 of file trial_road.c.
FOUNTAIN_PERIOD
#define FOUNTAIN_PERIOD 240
A fountain rises and falls once each FOUNTAIN_PERIOD ticks, rising at
FOUNTAIN_RISE_AT and falling at FOUNTAIN_FALL_AT.
Referenced by scTrialRoadSetUpFountainStage().
Definition at line 353 of file trial_road.c.
FOUNTAIN_RISE_AT
#define FOUNTAIN_RISE_AT 120
Referenced by scTrialRoadSetUpFountainStage().
Definition at line 354 of file trial_road.c.
FOUNTAIN_FALL_AT
#define FOUNTAIN_FALL_AT 150
Referenced by scTrialRoadSetUpFountainStage().
Definition at line 355 of file trial_road.c.
PILLAR_HEIGHT
#define PILLAR_HEIGHT 16
How far a pillar's top stands above it; once the pillar is lowered, its top is as far below it.
Referenced by scTrialRoadAddPillarTop(), scTrialRoadFreezePuddle(), scTrialRoadLowerStake(), scTrialRoadMeltIceBesideTorch(), scTrialRoadRaiseStake() and scTrialRoadSetUpTorchStage().
Definition at line 359 of file trial_road.c.
RIVAL_PATH_LENGTH
#define RIVAL_PATH_LENGTH 7200
The halfwords of the rival's recorded path: x, z pairs, the last pair 0, 0.
Referenced by scTrialRoadMoveRival().
Definition at line 542 of file trial_road.c.
RACE_MAP_PICTURE_BYTES
#define RACE_MAP_PICTURE_BYTES (RACE_MAP_TILE_COUNT * TILE_SIZE_4BPP)
The bytes of the race map's tiles.
Referenced by scTrialRoadDrawRaceMap(), scTrialRoadLinkAllocatePicture() and scTrialRoadShowRaceMap().
Definition at line 557 of file trial_road.c.
RACE_MAP_PALETTE
#define RACE_MAP_PALETTE 14
The sprite palette the race map loads and draws with.
Referenced by scTrialRoadDrawRaceMap().
Definition at line 559 of file trial_road.c.
RACE_MAP_STAGE_SPACING
#define RACE_MAP_STAGE_SPACING 36
The pixels between one stage's picture and the next, down the display.
Referenced by scTrialRoadDrawRaceMap().
Definition at line 561 of file trial_road.c.
SUMMIT_PURPLE_PALETTE
#define SUMMIT_PURPLE_PALETTE 5
The background palette of the summit's purples, and its colours as the cycle
loads them (scTrialRoadStartPaletteCycle).
Referenced by scTrialRoadStartPaletteCycle() and scTrialRoadStepPaletteCycle().
Definition at line 663 of file trial_road.c.
DEFINE_TRIAL_ROAD_OPEN_DOOR
#define DEFINE_TRIAL_ROAD_OPEN_DOOR(
Defines a function that opens a stage's door at the top: on the left path (side 0) the door at column leftX, on the right the one at rightX, redrawn open from the spare metatiles, with the upper layer's at upperLeftX or upperRightX and the ground of the metatile at column groundLeftX or groundRightX of row 127. On the last stage, 3, the door's own picture in row 3 is redrawn too.
Definition at line 712 of file trial_road.c.
DEFINE_TRIAL_ROAD_ON_FOOT
#define DEFINE_TRIAL_ROAD_ON_FOOT(name, onFoot)
Defines a push or Move cue's script that, while the leader is on foot, calls onFoot with the pushed actor.
Definition at line 1006 of file trial_road.c.
EFFECT_SET_MODE
#define EFFECT_SET_MODE fdActorSelectAnimation
Referenced by EFFECT_SPAWN.
Definition at line 1734 of file trial_road.c.
EFFECT_SET_SCRIPT
#define EFFECT_SET_SCRIPT fdActorStartScript
Referenced by EFFECT_SPAWN.
Definition at line 1735 of file trial_road.c.
DEFINE_TRIAL_ROAD_SET_POOL_TILES
#define DEFINE_TRIAL_ROAD_SET_POOL_TILES(name, groundX, upperX)
Defines a function that sets the three tiles in Gasp's pools, at metatiles (10, 11), (18, 7) and (18, 15), to the metatile at column groundX of row 30, and the upper layer's to the one at upperX.
Definition at line 1817 of file trial_road.c.
FOUNTAIN_COUNT
#define FOUNTAIN_COUNT 16
The fountains the fountain stage's state has room for.
Referenced by scTrialRoadDrawFountains() and scTrialRoadUpdateFountains().
Definition at line 2098 of file trial_road.c.
FOUNTAIN_SPRITE_COUNT
#define FOUNTAIN_SPRITE_COUNT 80
The sprites the fountains' columns may queue in a tick.
Referenced by scTrialRoadDrawFountains() and scTrialRoadStartFountains().
Definition at line 2100 of file trial_road.c.
FOUNTAIN_DEPTH_OFFSET
#define FOUNTAIN_DEPTH_OFFSET 58
A fountain's sprites sort at their screen row plus this many depth slots,
four behind an actor's sprite at the same place (field_sprite_draw.c adds
62), so the leader riding a fountain is drawn in front of its water.
Referenced by scTrialRoadDrawFountains().
Definition at line 2104 of file trial_road.c.
TRIAL_ROAD_FOUNTAINS
#define TRIAL_ROAD_FOUNTAINS
The fountain stage's fountains, kept in the inventory snapshot's spare bytes.
Referenced by scTrialRoadAddFountain(), scTrialRoadDrawFountains(), scTrialRoadStartFountains() and scTrialRoadUpdateFountains().
Definition at line 2117 of file trial_road.c.
NORTH_FOUNTAIN_HEIGHT
#define NORTH_FOUNTAIN_HEIGHT 64
How far the fountain stage's northern three fountains rise, and its southern two.
Referenced by scTrialRoadSetUpFountainStage().
Definition at line 2126 of file trial_road.c.
SOUTH_FOUNTAIN_HEIGHT
#define SOUTH_FOUNTAIN_HEIGHT 32
Referenced by scTrialRoadSetUpFountainStage().
Definition at line 2127 of file trial_road.c.
RIVAL_CHESTS_RECORDINGS
#define RIVAL_CHESTS_RECORDINGS 8
Where Moapa's runs at the blue chests start in TrialRoadRivalRecordings,
after the eight stages'.
Referenced by scTrialRoadUpdateRival().
Definition at line 2490 of file trial_road.c.
SET_LAYER
#define SET_LAYER(column, start)
Points layer at the copy of the room that starts column metatiles east in
the map, and sets start to that column: its offset, its metatiles and shapes
from that column on, and its place for the view.
Referenced by scPrepareMap().
Definition at line 2605 of file trial_road.c.
DEAL_STAGE_ORDER
#define DEAL_STAGE_ORDER()
Clears the race's state and deals the stage order from the sum of the
leader's name's letters, with scPrepareMap's locals.
Referenced by scPrepareMap().
Definition at line 2616 of file trial_road.c.
CHARGE_AT_MOAPA
#define CHARGE_AT_MOAPA()
The party nods and charges at Moapa and his knights, who charge back, side by side in pairs a tick apart: the battle at the summit begins.
Referenced by scTrialRoadReachPeakFirst() and scTrialRoadReachPeakSecond().
Definition at line 3044 of file trial_road.c.
FOUNTAIN_TILES_BYTES
#define FOUNTAIN_TILES_BYTES 2048
The bytes of the fountains' tiles (FieldGeyserTiles), once decompressed.
Referenced by scTrialRoadStartFountains().
Definition at line 3659 of file trial_road.c.
DUST_RING_PIECES
#define DUST_RING_PIECES 17
The clouds of dust scMagmaRockInsideSpawnDustRing throws out in a ring.
Referenced by scMagmaRockInsideSpawnDustRing().
Definition at line 3980 of file trial_road.c.
RIVAL_MAX_TURN
#define RIVAL_MAX_TURN (TRIG_TURN / 16)
The most the rival turns in a tick: a sixteenth of a turn.
Referenced by scTrialRoadMoveRival().
Definition at line 4073 of file trial_road.c.
MARKER
#define MARKER(left, right, which, tileAdd)
Where an actor's marker stands on the race map: its place in metatiles, moved
by left or right on the entrance's side, and raised by the stage it has
reached.
Referenced by scTrialRoadDrawRaceMap().
Definition at line 4276 of file trial_road.c.
Enumerations in detail
TRIAL_ROAD_METATILE
enum TRIAL_ROAD_METATILE
The map metatiles the cue tables answer, by the behaviour the map gives them. The race's tick, the same in every stage: the stairs at the foot of each path and the door at its top, the give-up buttons and the switches before the doors (west and east of the map's middle), each with the ring of metatiles around it that steps off it.
| Enumerator | Value | Description |
|---|---|---|
METATILE_LEFT_PATH_STAIRS_DOWN | 1 | |
METATILE_RIGHT_PATH_STAIRS_DOWN | 2 | |
METATILE_LEFT_PATH_DOOR | 3 | |
METATILE_RIGHT_PATH_DOOR | 4 | |
METATILE_AROUND_WEST_GIVE_UP_BUTTON | 10 | |
METATILE_WEST_GIVE_UP_BUTTON | 11 | |
METATILE_AROUND_EAST_GIVE_UP_BUTTON | 20 | |
METATILE_EAST_GIVE_UP_BUTTON | 21 | |
METATILE_AROUND_WEST_SWITCH | 30 | |
METATILE_WEST_SWITCH | 31 | |
METATILE_AROUND_EAST_SWITCH | 40 | |
METATILE_EAST_SWITCH | 41 | |
METATILE_PILLAR_STAGE_GAP | 51 | The pillar stage: the south |
METATILE_PILLAR_STAGE_LEDGE | 52 | edge of the upper ledge, over the gap a pillar can be pushed into, and the edge beside it. |
METATILE_ICE_PILLAR_SIDE | 33 | The torch stage: north and south of each pillar of ice. |
METATILE_WEEDS_STAGE_LEDGE | 33 | The weeds stage's ledge, jumped from southward. |
METATILE_WEST_STAKE | 50 | The Pound stage's four stakes, and the ground the pillars stand on. |
METATILE_INNER_WEST_STAKE | 51 | |
METATILE_INNER_EAST_STAKE | 52 | |
METATILE_EAST_STAKE | 53 | |
METATILE_STAKE_GROUND | 60 | |
METATILE_CRUMBLING_STAGE_LEDGE | 33 | The crumbling stage: its ledge, the metatiles beside the cracked pillars, and the pillars themselves. |
METATILE_BESIDE_CRUMBLING_PILLAR | 34 | |
METATILE_WEST_CRUMBLING_PILLAR | 50 | |
METATILE_EAST_CRUMBLING_PILLAR | 51 | |
METATILE_LOG_STAGE_LEDGE | 33 | The log stage: its ledge over the water, the rows the upper and lower logs roll along, and the two ends of the east log's track. |
METATILE_UPPER_LOG_ROWS | 50 | |
METATILE_LOWER_LOG_ROWS | 51 | |
METATILE_EAST_LOG_NORTH_END | 52 | |
METATILE_EAST_LOG_SOUTH_END | 53 | |
METATILE_BLOCK_TRACK | 33 | The fountain stage: the column the block can stand in, and the three buried vents. |
METATILE_WEST_VENT | 50 | |
METATILE_MIDDLE_VENT | 51 | |
METATILE_EAST_VENT | 52 | |
METATILE_STREAM | 50 | The sand stage's stream. |
METATILE_WEEDS | 33 | Gasp's pool: the weeds, and the |
METATILE_WEEDS_HIDING_MAD_PLANT | 34 | clump hiding the Mad Plant. |
METATILE_SUMMIT_DOORWAY | 33 | The summit: in front of each doorway from the stages, and the metatiles that bring on Moapa. |
METATILE_LEFT_PATH_SUMMIT | 40 | |
METATILE_RIGHT_PATH_SUMMIT | 41 |
Definition at line 32 of file trial_road.c.
TRIAL_ROAD_STAGE_ACTOR_ID
enum TRIAL_ROAD_STAGE_ACTOR_ID
The actors every stage room places first, numbering the rows of each stage's
table: Moapa, the four blue chests (two on the left path, two on the right,
inner and outer) and Moapa's two knights. A stage's own puzzle pieces follow
from ACTOR_FIRST_STAGE_PIECE.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_MOAPA | ACTOR_FIRST_PLACED | |
ACTOR_LEFT_INNER_CHEST | ||
ACTOR_LEFT_OUTER_CHEST | ||
ACTOR_RIGHT_INNER_CHEST | ||
ACTOR_RIGHT_OUTER_CHEST | ||
ACTOR_LEFT_KNIGHT | ||
ACTOR_RIGHT_KNIGHT | ||
ACTOR_FIRST_STAGE_PIECE |
Definition at line 162 of file trial_road.c.
TRIAL_ROAD_LOG_STAGE_ACTOR_ID
enum TRIAL_ROAD_LOG_STAGE_ACTOR_ID
The log stage's three logs (TrialRoadLogStagePlacements): the upper and lower
logs lie north to south and roll east or west, and the east log lies across
them and rolls north or south.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_UPPER_LOG | ACTOR_FIRST_STAGE_PIECE + 1 | |
ACTOR_LOWER_LOG | ||
ACTOR_EAST_LOG |
Definition at line 180 of file trial_road.c.
TRIAL_ROAD_POUND_STAGE_ACTOR_ID
enum TRIAL_ROAD_POUND_STAGE_ACTOR_ID
The Pound stage's four cone-shaped stakes (TrialRoadPoundStagePlacements),
west to east at metatiles (13, 26), (15, 26), (17, 26) and (19, 26), in two
pairs: driving one down raises its partner.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_WEST_STAKE | ACTOR_FIRST_STAGE_PIECE + 3 | |
ACTOR_INNER_WEST_STAKE | ||
ACTOR_INNER_EAST_STAKE | ||
ACTOR_EAST_STAKE |
Definition at line 190 of file trial_road.c.
TRIAL_ROAD_CRUMBLING_STAGE_ACTOR_ID
enum TRIAL_ROAD_CRUMBLING_STAGE_ACTOR_ID
The crumbling stage's two pillars (TrialRoadCrumblingStagePlacements).
| Enumerator | Value | Description |
|---|---|---|
ACTOR_WEST_CRUMBLING_PILLAR | ACTOR_FIRST_STAGE_PIECE | |
ACTOR_EAST_CRUMBLING_PILLAR |
Definition at line 199 of file trial_road.c.
TRIAL_ROAD_PILLAR_ACTOR_ID
enum TRIAL_ROAD_PILLAR_ACTOR_ID
The stone pillars most stages stand from ACTOR_FIRST_STAGE_PIECE: five in the
pillar and weeds pillar stages, three in the Pound stage, and in the torch
stage two followed by its pillars of ice; the log and fountain stages have
one, the block.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_PILLAR_A | ACTOR_FIRST_STAGE_PIECE | |
ACTOR_PILLAR_B | ||
ACTOR_PILLAR_C | ||
ACTOR_PILLAR_D | ||
ACTOR_PILLAR_E | ||
ACTOR_PILLAR_F |
Definition at line 209 of file trial_road.c.
TRIAL_ROAD_TORCH_STAGE_ACTOR_ID
enum TRIAL_ROAD_TORCH_STAGE_ACTOR_ID
The torch stage's two torches burning on stands, after its six pillars
(TrialRoadTorchStagePlacements): pushed next to a frozen puddle, a torch
melts it.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_WEST_TORCH | ACTOR_FIRST_STAGE_PIECE + 6 | |
ACTOR_EAST_TORCH |
Definition at line 222 of file trial_road.c.
anonymous enum
enum { ACTOR_WEEDS_A, ACTOR_WEEDS_B }
The weeds after the pillars: on pillar C in the pillar stage, on pillars A and B in the weeds pillar stage.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_WEEDS_A | ACTOR_FIRST_STAGE_PIECE + 5 | |
ACTOR_WEEDS_B |
Definition at line 230 of file trial_road.c.
anonymous enum
enum { ACTOR_POUND_STAGE_WEEDS }
The weeds on pillar B in the Pound stage, after its four stakes.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_POUND_STAGE_WEEDS | ACTOR_EAST_STAKE + 1 |
Definition at line 237 of file trial_road.c.
anonymous enum
enum { ACTOR_SAND_STAGE_WEEDS }
The weeds on the sand stage's cliff, after its two tightrope posts.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_SAND_STAGE_WEEDS | ACTOR_FIRST_STAGE_PIECE + 2 |
Definition at line 243 of file trial_road.c.
anonymous enum
enum { ACTOR_GASP }
Gasp, alone in his room (TrialRoadGaspPlacements).
| Enumerator | Value | Description |
|---|---|---|
ACTOR_GASP | ACTOR_FIRST_PLACED |
Definition at line 252 of file trial_road.c.
anonymous enum
enum { ACTOR_CAVE_ROCK }
The round boulder on the ledge of the cave beyond the summit, which Lift
raises (TrialRoadCavePlacements).
| Enumerator | Value | Description |
|---|---|---|
ACTOR_CAVE_ROCK | ACTOR_FIRST_PLACED |
Definition at line 259 of file trial_road.c.
anonymous enum
enum { TRIAL_ROAD_CAVE_TO_EAST_PASSAGE, TRIAL_ROAD_CAVE_TO_WEST_CAVE }
The two parts of the cave beyond the summit, each way between them leading in by the entrance on its far side: the west cave, where the summit's passage comes in and the boulder sits on its ledge, and the east passage north to Gasp's pool.
| Enumerator | Value | Description |
|---|---|---|
TRIAL_ROAD_CAVE_TO_EAST_PASSAGE | 1 | |
TRIAL_ROAD_CAVE_TO_WEST_CAVE | 2 |
Definition at line 268 of file trial_road.c.
anonymous enum
enum { TRIAL_ROAD_CAVE_WEST_CAVE_FROM_EAST_PASSAGE, TRIAL_ROAD_CAVE_EAST_PASSAGE_FROM_WEST_CAVE }
The entrances, one for each way above.
| Enumerator | Value | Description |
|---|---|---|
TRIAL_ROAD_CAVE_WEST_CAVE_FROM_EAST_PASSAGE | 1 | |
TRIAL_ROAD_CAVE_EAST_PASSAGE_FROM_WEST_CAVE | 2 |
Definition at line 275 of file trial_road.c.
TRIAL_ROAD_FOUNTAIN_STAGE_ACTOR_ID
enum TRIAL_ROAD_FOUNTAIN_STAGE_ACTOR_ID
The fountain stage's five vents (TrialRoadFountainStagePlacements): three in
a row west to east, and two south of them.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_WEST_VENT | ACTOR_FIRST_STAGE_PIECE + 1 | |
ACTOR_MIDDLE_VENT | ||
ACTOR_EAST_VENT | ||
ACTOR_SOUTHWEST_VENT | ||
ACTOR_SOUTHEAST_VENT |
Definition at line 283 of file trial_road.c.
TRIAL_ROAD_ENTRANCE
enum TRIAL_ROAD_ENTRANCE
The stage room's entrances. Every stage is the same room redrawn: the stairs
down at a stage's foot lead in at the top of the stage below, and the door at
its top in at the foot of the next. The Shaman Village enters the first stage
by its left or right path, at
TRIAL_ROAD_STAGES_FROM_SHAMAN_VILLAGE_TRIAL_GROUNDS_WEST or _EAST, and the
summit returns to the last stage the same way, at
TRIAL_ROAD_STAGES_FROM_TRIAL_ROAD_SUMMIT_WEST or _EAST; each goes on to the
stage entrance of its last digit. While Moapa explains the trial's rules
(scShamanVillageExplainTrialRules), the village sends the party in at
TRIAL_ROAD_STAGES_FOR_TRIAL_RULES, which deals a course for
TRIAL_ROAD_RULES_COURSE to show. The summit is entered again after the battle
with Moapa, won or lost.
| Enumerator | Value | Description |
|---|---|---|
TRIAL_ROAD_STAGE_FOOT_LEFT | 1 | |
TRIAL_ROAD_STAGE_FOOT_RIGHT | 2 | |
TRIAL_ROAD_STAGE_TOP_LEFT | 3 | |
TRIAL_ROAD_STAGE_TOP_RIGHT | 4 | |
TRIAL_ROAD_SUMMIT_AFTER_WIN | 4 | |
TRIAL_ROAD_SUMMIT_AFTER_DEFEAT | 5 | |
TRIAL_ROAD_RULES_COURSE | 55 |
Definition at line 304 of file trial_road.c.
anonymous enum
enum { ACTOR_WEST_POST, ACTOR_EAST_POST }
The sand stage's two tightrope posts (TrialRoadSandStagePlacements).
| Enumerator | Value | Description |
|---|---|---|
ACTOR_WEST_POST | ACTOR_FIRST_STAGE_PIECE | |
ACTOR_EAST_POST |
Definition at line 320 of file trial_road.c.
TRIAL_ROAD_RIVAL_ACTIVITY
enum TRIAL_ROAD_RIVAL_ACTIVITY
What the rival does each tick (scTrialRoadMoveRival).
| Enumerator | Value | Description |
|---|---|---|
RIVAL_REPLAY | 1 | walks the recorded path |
RIVAL_RECORD | 2 | records the actor's path |
RIVAL_LINKED | 3 | Unused: stands where the linked player's record puts it |
RIVAL_MIRROR | 4 | follows the leader mirrored across the course |
RIVAL_WAITING | 9 | the path is done |
Definition at line 514 of file trial_road.c.
TRIAL_ROAD_RACE_MAP_TILE
enum TRIAL_ROAD_RACE_MAP_TILE
The tiles of the race map's picture (TrialRoadRaceMapPicture): a stage of the
road in blue, 16 by 32 pixels with a 16 by 8 foot below it, and the two
players' 16 by 16 markers, "1P" and "2P".
| Enumerator | Value | Description |
|---|---|---|
RACE_MAP_TILE_STAGE | 0 | |
RACE_MAP_TILE_STAGE_FOOT | 8 | |
RACE_MAP_TILE_1P | 10 | |
RACE_MAP_TILE_2P | 14 | |
RACE_MAP_TILE_COUNT | 18 |
Definition at line 547 of file trial_road.c.
anonymous enum
enum { LOG_LIES_NORTH_SOUTH, LOG_LIES_EAST_WEST }
Which way a log lies: the upper and lower logs north to south, rolling east or west, and the east log east to west, rolling north or south.
| Enumerator | Value | Description |
|---|---|---|
LOG_LIES_NORTH_SOUTH | 0 | |
LOG_LIES_EAST_WEST | 1 |
Definition at line 1421 of file trial_road.c.
anonymous enum
enum { PALETTE_CYCLE_LOAD, PALETTE_CYCLE_LOAD_AND_RUN, PALETTE_CYCLE_KEEP_COLORS }
How scTrialRoadStartPaletteCycle starts the summit's colour cycle: loading
the palette's colours, loading them and starting the cycle's event, or
keeping the colours already loaded.
| Enumerator | Value | Description |
|---|---|---|
PALETTE_CYCLE_LOAD | 0 | |
PALETTE_CYCLE_LOAD_AND_RUN | 1 | |
PALETTE_CYCLE_KEEP_COLORS | 2 |
Definition at line 2327 of file trial_road.c.
anonymous enum
enum { RIVAL_ONE_CHEST_OPEN, RIVAL_ONE_CHEST_CLOSE, RIVAL_ONE_CHEST_DOOR, RIVAL_TWO_CHESTS_OPEN, … }
Moapa's ticks at the chests (TRIAL_ROAD_STATE.rivalTimer): with one chest to
fill he opens it at RIVAL_ONE_CHEST_OPEN, closes it and opens his door; with
two, he opens both at RIVAL_TWO_CHESTS_OPEN, turns north, closes the outer,
turns north again, closes the inner and opens his door.
| Enumerator | Value | Description |
|---|---|---|
RIVAL_ONE_CHEST_OPEN | 1 | |
RIVAL_ONE_CHEST_CLOSE | 50 | |
RIVAL_ONE_CHEST_DOOR | 70 | |
RIVAL_TWO_CHESTS_OPEN | 601 | |
RIVAL_TWO_CHESTS_TURN | 653 | |
RIVAL_TWO_CHESTS_OUTER_CLOSE | 655 | |
RIVAL_TWO_CHESTS_TURN_AGAIN | 708 | |
RIVAL_TWO_CHESTS_INNER_CLOSE | 710 | |
RIVAL_TWO_CHESTS_DOOR | 730 |
Definition at line 2475 of file trial_road.c.
Functions in detail
scTrialRoadFightGasp
void scTrialRoadFightGasp(void)
Talking to Gasp starts his battle.
References fdRequestDjinnBattle().
Definition at line 362 of file trial_road.c.
scGetEntrances
const SCENE_ENTRANCE *scGetEntrances(void)
References SceneEntrances.
Definition at line 367 of file trial_road.c.
scGetExitRegions
const SCENE_REGION *scGetExitRegions(void)
Definition at line 372 of file trial_road.c.
scGetExits
const Uint32 *scGetExits(void)
References SceneExits.
Definition at line 377 of file trial_road.c.
scTrialRoadSettleOnGround
Sint32 scTrialRoadSettleOnGround(ACTOR *actor)
The script of each clump of weeds: it sits on the ground at the foot of its pillar or cliff, drawn half again as tall as its picture.
References fdMapGetTerrainHeight() and Sint32.
Referenced by TrialRoadSettleScript.
Definition at line 390 of file trial_road.c.
scGetActorPlacements
const ACTOR_PLACE *scGetActorPlacements(void)
References MainRoutineStateWork, Sint32, TrialRoadCavePlacements, TrialRoadGaspPlacements, TrialRoadPlacements, TrialRoadStagesPlacements and TrialRoadSummitPlacements.
Definition at line 403 of file trial_road.c.
scTrialRoadRivalIsAhead
Sint32 scTrialRoadRivalIsAhead(Sint32 fallback)
Whether Moapa is ahead in the race: by the stages each has cleared, then by who reached the switch at the top of this stage first; on a tie, fallback.
References fdScriptGetFlag() and Sint32.
Referenced by scTrialRoadOpenChests(), scTrialRoadTakeStairs() and scTrialRoadUpdateRival().
Definition at line 420 of file trial_road.c.
scTrialRoadOfferToGiveUp
Bool scTrialRoadOfferToGiveUp(void)
Stepping on the give-up button at the top of a stage during the race (metatile (12, 8) on the left path, (20, 8) on the right) asks "Do you want to give up?". Felix walks onto the button's middle and faces south; answering Yes, he leans back with a drop of sweat, gets the party's equipment back and is sent down to the Shaman Village's trial grounds.
References fdActorFaceDirection(), fdActorGetById(), fdActorSetAnimation(), fdActorWalkToAndWait(), fdScriptAskYesNoWithActorAnimation(), fdScriptEndLastingPsynergy(), fdScriptGetFlag(), fdScriptPlaySound(), fdScriptSetFlag(), fdScriptStart(), fdScriptWait(), gmInventorySnapshotRestore(), MainRoutineStateWork, mnFieldMessageShow(), scFieldActorShowEmote(), Sint32 and syImportScriptSetExitRequest().
Referenced by scTrialRoadTakeStairs().
Definition at lines 435 and 746 of file trial_road.c.
scTrialRoadTakeStairs
void scTrialRoadTakeStairs(Sint32 direction)
Walking down the stairs at the foot of a stage, or through the open door at its top. Down from the first stage during the race, Felix is asked whether he gives up, and stays if he does not; up through the fourth door, he climbs to the summit.
References fdActorWalkByAndWait(), fdExitStartStairsUp(), fdScriptGetFlag(), fdScriptPlaySound(), fdScriptSetFlag(), MainRoutineStateWork, scTrialRoadOfferToGiveUp(), scTrialRoadRivalIsAhead(), Sint32 and syImportScriptSetExitRequest().
Definition at line 441 of file trial_road.c.
scTrialRoadIsMirrored
Sint32 scTrialRoadIsMirrored(void)
Whether the leader took the right path, on which the road is mirrored.
References Sint32.
Referenced by scTrialRoadMirrorAngle(), scTrialRoadMirrorMetatileX(), scTrialRoadMirrorOffset() and scTrialRoadMirrorX().
Definition at lines 589 and 2950 of file trial_road.c.
scTrialRoadSetJumpMetatileUnder
void scTrialRoadSetJumpMetatileUnder(Sint32 id)
Lets Felix jump onto the top of the pillar standing at the actor's metatile
(MAP_METATILE_JUMP).
References fdActorGetById() and Sint32.
Referenced by scTrialRoadMeltIceBesideTorch(), scTrialRoadSetUpFountainStage(), scTrialRoadSetUpLogStage(), scTrialRoadSetUpPillarStage(), scTrialRoadSetUpPoundStage(), scTrialRoadSetUpTorchStage() and scTrialRoadSetUpWeedsPillarStage().
Definition at lines 590 and 914 of file trial_road.c.
scTrialRoadClearJumpMetatileUnder
void scTrialRoadClearJumpMetatileUnder(Sint32 id)
Stops Felix jumping onto the metatile the actor is leaving.
References fdActorGetById() and Sint32.
Referenced by scTrialRoadClearJumpUnderTorchStagePillar().
Definition at lines 591 and 933 of file trial_road.c.
scTrialRoadAddPillarTop
void scTrialRoadAddPillarTop(Sint32 id)
Puts an invisible top on the pillar for Felix to stand on.
References fdActorGetById(), fdActorSetSpriteFlags(), fdActorStartScript(), scFieldActorCreate(), Sint32 and TrialRoadPillarTopScript.
Referenced by scTrialRoadSetUpFountainStage(), scTrialRoadSetUpLogStage(), scTrialRoadSetUpPeak(), scTrialRoadSetUpPillarStage(), scTrialRoadSetUpPoundStage(), scTrialRoadSetUpTorchStage() and scTrialRoadSetUpWeedsPillarStage().
Definition at lines 592 and 966 of file trial_road.c.
scTrialRoadSetPillarTopLift
void scTrialRoadSetPillarTopLift(Sint32 id, Sint32 value)
Sets how many pixels above the pillar its top stands.
References fdActorGetById() and Sint32.
Referenced by scTrialRoadFreezePuddle(), scTrialRoadLowerStake(), scTrialRoadMeltIceBesideTorch(), scTrialRoadRaiseStake(), scTrialRoadSetUpTorchStage() and scTrialRoadStepOntoStake().
Definition at lines 593 and 992 of file trial_road.c.
scTrialRoadOpenVentMetatile
void scTrialRoadOpenVentMetatile(Sint32 id)
Lets Felix walk into the vent where the actor stands, now that it is dug out.
References fdActorGetById(), fdMapGridCopyMetatilesLayered() and Sint32.
Referenced by scTrialRoadSetUpFountainStage() and scTrialRoadUncoverVent().
Definition at lines 594 and 1042 of file trial_road.c.
scTrialRoadCheckLeaderOnPillars
void scTrialRoadCheckLeaderOnPillars(void)
Keeps note, each tick, of whether Felix is up on the pillar stage's upper
ledge or a pillar's top, 32 pixels up (FLAG_LEADER_ON_PILLARS).
References fdActorGetById(), fdScriptClearFlag(), fdScriptSetFlag() and MainRoutineStateWork.
Referenced by scTrialRoadSetUpPillarStage().
Definition at lines 595 and 1057 of file trial_road.c.
scTrialRoadCheckStakesCovered
void scTrialRoadCheckStakesCovered(Sint32 unused, Sint32 id)
void scTrialRoadCheckStakesCovered(Sint32 unused, Sint32 pushedId)
After Move or a push, notes each stake whose partner has a pillar standing on
it: stepping on that stake can no longer raise the partner
(scTrialRoadStepOntoStake).
References fdActorGetById(), Sint32 and TrialRoadPoundPartners.
Referenced by scTrialRoadLandOnPillar().
Definition at lines 596 and 1203 of file trial_road.c.
scTrialRoadPoundStake
void scTrialRoadPoundStake(Sint32 id, Sint32 phase, Sint32 frame)
Pound on a raised stake in the Pound stage squashes it into the ground and
pops its partner up (TrialRoadPoundPartners); Felix, standing where the
partner rises, is thrown up onto it.
References fdActorGetById(), fdScriptClearFlag(), fdScriptSetFlag(), MainRoutineStateWork, scTrialRoadLowerStake(), scTrialRoadRaiseStake(), Sint32 and TrialRoadPoundPartners.
Referenced by scTrialRoadPoundEastStake(), scTrialRoadPoundInnerEastStake(), scTrialRoadPoundInnerWestStake() and scTrialRoadPoundWestStake().
Definition at lines 597 and 1233 of file trial_road.c.
scTrialRoadStepOntoStake
void scTrialRoadStepOntoStake(Sint32 id, Sint32 other, Sint32 flag, Sint32 side)
Stepping onto a raised stake in the Pound stage sinks it slowly under Felix's weight while its partner grows out of the ground, unless a pillar stands on the partner.
References fdActorGetById(), fdScriptClearFlag(), fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptPlaySound(), fdScriptSetFlag(), fdScriptStart(), scTrialRoadLowerStake(), scTrialRoadRaiseStake(), scTrialRoadSetPillarTopLift(), Sint32 and sySynch().
Referenced by scTrialRoadStepOntoEastStake(), scTrialRoadStepOntoInnerEastStake(), scTrialRoadStepOntoInnerWestStake() and scTrialRoadStepOntoWestStake().
Definition at lines 598 and 1313 of file trial_road.c.
scTrialRoadPushLog
void scTrialRoadPushLog(Sint32 id, Sint32 dx, Sint32 dz, Sint32 lies)
Felix leans on a log in the log stage and it rolls, up to six metatiles, until the block or a wall stops it. Rolled east past column 17 of the map, it rolls on to the edge and falls into the water, where it stays and Felix can jump across it.
References fdActorGetById(), fdActorSelectAnimation(), fdActorSetAnimationById(), fdActorSetDestinationOffsetById(), fdActorSetMoveTarget(), fdActorWaitForMove(), fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptStart(), fdScriptWait(), MainRoutineStateWork, scTrialRoadBlockLogs(), scTrialRoadIsLogBlocked(), Sint32, syGameFlagSet() and sySoundPlay().
Referenced by scTrialRoadPushEastLogNorth(), scTrialRoadPushEastLogSouth(), scTrialRoadPushEastLogSouthOrClimbDown(), scTrialRoadPushLowerLogEast(), scTrialRoadPushLowerLogWest(), scTrialRoadPushUpperLogEast() and scTrialRoadPushUpperLogWest().
Definition at lines 602 and 1501 of file trial_road.c.
scTrialRoadUncoverVent
void scTrialRoadUncoverVent(Sint32 id, Sint32 phase, Sint32 frame)
Scoop over one of the fountain stage's three buried vents, at metatiles (13, 23), (16, 23) and (19, 23), digs it out: the vent shows in the ground, Felix can step onto it, and its fountain rises and falls with the others.
References fdActorGetById(), fdMapGetTerrainHeight(), fdScriptSetFlag(), scTrialRoadOpenVentMetatile() and Sint32.
Referenced by scTrialRoadUncoverEastVent(), scTrialRoadUncoverMiddleVent() and scTrialRoadUncoverWestVent().
Definition at lines 603 and 1649 of file trial_road.c.
scTrialRoadCrumblePillar
void scTrialRoadCrumblePillar(const void *data, Sint32 id)
A cracked pillar in the crumbling stage shakes, crumbles and falls away, as Magma Rock's do.
References fdActorGetById(), fdActorSelectAnimation(), fdActorSetMetatileShape(), fdActorSetPosAndResetMotion(), fdScriptEnd(), fdScriptGetFlag(), fdScriptPlaySound(), fdScriptSetFlag(), fdScriptStart(), scDustScatter(), scMagmaRockInsideSpawnDustRing(), Sint32 and sySynch().
Referenced by scTrialRoadCrumbleEastPillar() and scTrialRoadCrumbleWestPillar().
Definition at lines 605 and 3743 of file trial_road.c.
scTrialRoadClearGiveUpAsked
void scTrialRoadClearGiveUpAsked(void)
Stepping off the give-up button lets it ask again next time Felix steps on it.
References syGameFlagClear().
Definition at lines 606 and 794 of file trial_road.c.
scTrialRoadBlowAwayPillarStageWeeds
void scTrialRoadBlowAwayPillarStageWeeds(void)
Whirlwind on the weeds at the foot of the pillar stage's overgrown pillar, at metatile (15, 24), blows it away, and the pillar can then be pushed.
References fdActorGetById() and fdScriptSetFlag().
Definition at lines 607 and 1028 of file trial_road.c.
scTrialRoadJumpAcrossGap
void scTrialRoadJumpAcrossGap(void)
Walking south off the pillar stage's upper ledge, beside the vine, jumps Felix across the gap when the pillar beneath has been pushed into it (row 23 of the map); otherwise he hops down to the ground in a puff of dust.
References fdActorGetById(), fdActorJumpDownLedge(), fdTryJumpForward() and MainRoutineStateWork.
Definition at lines 608 and 1070 of file trial_road.c.
scTrialRoadJumpMeltedPuddle
void scTrialRoadJumpMeltedPuddle(void)
Walking north or south into a melted puddle in the torch stage jumps Felix across it; a frozen one stops him.
References fdFindNearbyTalkTarget(), fdScriptGetFlag(), fdTryJumpForward() and MainRoutineStateWork.
Definition at lines 609 and 1132 of file trial_road.c.
scTrialRoadStepOntoWestStake
void scTrialRoadStepOntoWestStake(void)
Stepping onto the west stake sinks it and raises the inner west one.
References scTrialRoadStepOntoStake().
Definition at lines 610 and 1347 of file trial_road.c.
scTrialRoadStepOntoInnerWestStake
void scTrialRoadStepOntoInnerWestStake(void)
Stepping onto the inner west stake sinks it and raises the west one.
References scTrialRoadStepOntoStake().
Definition at lines 611 and 1356 of file trial_road.c.
scTrialRoadStepOntoInnerEastStake
void scTrialRoadStepOntoInnerEastStake(void)
Stepping onto the inner east stake sinks it and raises the east one.
References scTrialRoadStepOntoStake().
Definition at lines 612 and 1365 of file trial_road.c.
scTrialRoadStepOntoEastStake
void scTrialRoadStepOntoEastStake(void)
Stepping onto the east stake sinks it and raises the inner east one.
References scTrialRoadStepOntoStake().
Definition at lines 613 and 1372 of file trial_road.c.
scTrialRoadLandOnPillar
void scTrialRoadLandOnPillar(void)
Walking into a pillar or stake in the Pound stage: from a raised top Felix jumps onto it, and from the ground he pushes it, if it can be pushed.
References fdActorGetById(), fdLeaderCanPushObjectAhead(), fdLeaderPushObjectAhead(), fdTryJumpForward(), MainRoutineStateWork and scTrialRoadCheckStakesCovered().
Definition at lines 614 and 1380 of file trial_road.c.
scTrialRoadCheckCrumblingPillars
void scTrialRoadCheckCrumblingPillars(void)
Hopping onto one of the crumbling stage's two cracked pillars, from the east or the west: the first time it flashes, and the second time it crumbles under Felix and drops him to the ground.
References scLeaderCheckCrumblingStep() and TrialRoadCrumblingPillars.
Definition at lines 615 and 1398 of file trial_road.c.
scTrialRoadPushUpperLogWest
void scTrialRoadPushUpperLogWest(void)
Walking west into the upper log rolls it west.
References scTrialRoadPushLog().
Definition at lines 616 and 1599 of file trial_road.c.
scTrialRoadPushUpperLogEast
void scTrialRoadPushUpperLogEast(void)
Walking east into the upper log rolls it east.
References scTrialRoadPushLog().
Definition at lines 617 and 1605 of file trial_road.c.
scTrialRoadPushLowerLogWest
void scTrialRoadPushLowerLogWest(void)
Walking west into the lower log rolls it west.
References scTrialRoadPushLog().
Definition at lines 618 and 1611 of file trial_road.c.
scTrialRoadPushLowerLogEast
void scTrialRoadPushLowerLogEast(void)
Walking east into the lower log rolls it east.
References scTrialRoadPushLog().
Definition at lines 619 and 1617 of file trial_road.c.
scTrialRoadPushEastLogNorth
void scTrialRoadPushEastLogNorth(void)
Walking north into the east log rolls it north.
References scTrialRoadPushLog().
Definition at lines 620 and 1623 of file trial_road.c.
scTrialRoadPushEastLogSouth
void scTrialRoadPushEastLogSouth(void)
Walking south into the east log rolls it south.
References scTrialRoadPushLog().
Definition at lines 621 and 1629 of file trial_road.c.
scTrialRoadPushEastLogSouthOrClimbDown
void scTrialRoadPushEastLogSouthOrClimbDown(void)
Pressing south at the north end of the east log's track: if Felix is climbing there he climbs down, and on foot he rolls the east log south.
References fdClimbDown(), MainRoutineStateWork and scTrialRoadPushLog().
Definition at lines 622 and 1636 of file trial_road.c.
scTrialRoadStartSand
void scTrialRoadStartSand(void)
Sand at the sand stage lets Felix, sunk into the ground, go up the stream that would otherwise carry him back. The game moves him onto the map's upper level for as long as he stays sunk.
References fdActorGetById() and MainRoutineStateWork.
Definition at lines 623 and 1704 of file trial_road.c.
scTrialRoadEndSand
void scTrialRoadEndSand(void)
When Felix rises out of the sand at the sand stage, he walks on the ground level again.
References fdActorGetById() and MainRoutineStateWork.
Definition at lines 624 and 1712 of file trial_road.c.
scTrialRoadBlowAwaySandStageWeeds
void scTrialRoadBlowAwaySandStageWeeds(void)
Whirlwind on the weeds on the sand stage's cliff blows it away and uncovers the vine behind it, metatile (19, 21), which Felix can then climb.
References fdMapGridCopyMetatileAttributes() and fdScriptSetFlag().
Definition at lines 625 and 1720 of file trial_road.c.
scTrialRoadDriftWithStream
void scTrialRoadDriftWithStream(void)
Walking in the sand stage's stream carries Felix south a pixel a tick, throwing up spray, unless he is crossing the tightrope above it.
References fdActorGetById(), MainRoutineStateWork, scEffectAdvanceMotionAtLeaderPriority(), scFieldEffectSpawn(), Sint32, syRandom() and TickCount.
Definition at lines 626 and 1745 of file trial_road.c.
scTrialRoadLiftCaveRock
void scTrialRoadLiftCaveRock(void)
Lift on the rock in the cave beyond the summit raises it out of the way to Gasp's pool.
References syGameFlagSet().
Definition at lines 627 and 1778 of file trial_road.c.
scTrialRoadScatterWeeds
void scTrialRoadScatterWeeds(void)
Cyclone on the clumps of weeds around Gasp's pool scatters the ones it touches.
References scTrialRoadFieldCycloneCopyTouchedMetatiles().
Definition at lines 628 and 1785 of file trial_road.c.
scTrialRoadScatterWeedsHidingMadPlant
void scTrialRoadScatterWeedsHidingMadPlant(void)
Cyclone on the left-hand weeds by the entrance of Gasp's pool, metatile (4, 9), scatters them, and the Mad Plant hiding there leaps out and attacks.
References fdRequestBattleFromEncounterTable(), fdScriptGetFlag(), MainRoutineStateWork, scTrialRoadFieldCycloneCopyTouchedMetatiles() and syImportMadPlantLeapAtLeader().
Definition at lines 629 and 1793 of file trial_road.c.
scTrialRoadRevealPoolTiles
void scTrialRoadRevealPoolTiles(void)
DEFINE_TRIAL_ROAD_SET_POOL_TILES(scTrialRoadRevealPoolTiles, 33, 35)
Reveal anywhere in Gasp's pool room shows the hidden tiles in the pools, at metatiles (10, 11), (18, 7) and (18, 15).
Definition at lines 630 and 1830 of file trial_road.c.
scTrialRoadHidePoolTiles
void scTrialRoadHidePoolTiles(void)
DEFINE_TRIAL_ROAD_SET_POOL_TILES(scTrialRoadHidePoolTiles, 34, 36)
When Reveal wears off in Gasp's pool room, the tiles in the pools are hidden again.
Definition at lines 631 and 1834 of file trial_road.c.
scTrialRoadChallengeMoapa
void scTrialRoadChallengeMoapa(void)
At the summit during the race, stepping onto the top of the peak, metatile (13, 16) on the left path or (18, 16) on the right, either side of the round tile in the middle of the top, brings on Moapa: he speaks according to who arrived first, and the battle with him and his knights begins, chosen by how many doors he reached first. (The doorways below, metatiles (13, 19) and (18, 19), are the two dark openings in the cliff under the top.)
References fdRequestBattleFromEncounterTable(), fdScriptGetFlag(), fdScriptSetAfterBattleDestination(), fdScriptSetDefeatDestination(), scTrialRoadReachPeakFirst(), scTrialRoadReachPeakSecond() and Sint32.
Definition at lines 632 and 1869 of file trial_road.c.
scTrialRoadIdle
void scTrialRoadIdle(void)
Does nothing.
Referenced by scTrialRoadOpenChests().
Definition at lines 650 and 4051 of file trial_road.c.
scTrialRoadReachPeakFirst
void scTrialRoadReachPeakFirst(void)
The party gathers at the summit first, and Moapa and his knights arrive after them: "You were quite swift! You may prove a challenge yet!"
References fdActorFaceDirection(), fdActorGetById(), fdActorPlaceOnActor(), fdActorRunRepeatedMotion(), fdActorSelectAnimation(), fdActorSetAnimationAndWait(), fdActorSetMoveTarget(), fdActorWaitForMoveById(), fdActorWalkTo(), fdScriptPlaySound(), fdScriptSetMessageId(), fdScriptShowMessage(), scFieldActorSetMoveTargetFX(), scFieldActorShowEmote(), scFieldActorWaitForMove(), scTrialRoadGatherAtPeak(), scTrialRoadMirrorAngle(), scTrialRoadMirrorMetatileX(), scTrialRoadPlaceActor(), Sint32 and sySynch().
Referenced by scTrialRoadChallengeMoapa().
Definition at lines 653 and 3072 of file trial_road.c.
scTrialRoadReachPeakSecond
void scTrialRoadReachPeakSecond(void)
Moapa and his knights are already waiting when the party reaches the summit: "You may have been slow, but you made it through Trial Road".
References fdActorRunRepeatedMotion(), fdActorSetAnimationAndWait(), fdScriptSetMessageId(), fdScriptShowMessage(), scFieldActorShowEmote(), scTrialRoadGatherAtPeak() and Sint32.
Referenced by scTrialRoadChallengeMoapa().
Definition at lines 654 and 3148 of file trial_road.c.
scTrialRoadLowerStake
void scTrialRoadLowerStake(Sint32 id)
Sinks a stake into the ground, so that Felix walks over it.
References fdActorGetById(), fdActorSelectAnimation(), scTrialRoadSetPillarTopLift() and Sint32.
Referenced by scTrialRoadPoundStake(), scTrialRoadSetUpPoundStage() and scTrialRoadStepOntoStake().
Definition at lines 655 and 1161 of file trial_road.c.
scTrialRoadRaiseStake
void scTrialRoadRaiseStake(Sint32 id)
Raises a stake out of the ground, solid, its top 16 pixels up.
References fdActorGetById(), fdActorSelectAnimation(), scTrialRoadSetPillarTopLift() and Sint32.
Referenced by scTrialRoadPoundStake(), scTrialRoadSetUpPoundStage() and scTrialRoadStepOntoStake().
Definition at lines 656 and 1175 of file trial_road.c.
scTrialRoadBlockLogs
void scTrialRoadBlockLogs(void)
Makes the three logs solid where they lie, and lets Felix jump east across a log that has fallen into the water.
References fdMapGridCopyMetatileAttributes(), fdScriptGetFlag() and scTrialRoadBlockLogMetatiles().
Referenced by scTrialRoadPushLog() and scTrialRoadSetUpLogStage().
Definition at lines 657 and 1465 of file trial_road.c.
scTrialRoadStartFountains
void scTrialRoadStartFountains(Sint32 unused, Sint32 shape)
Starts the fountains' state and their event.
References fdActorGetById(), fdPartyGetLeaderActor(), fdScriptGetFlag(), FieldGeyserTiles, scTrialRoadAllocateTileBuffer(), scTrialRoadDrawFountains(), scTrialRoadUpdateFountains(), Sint32, syDecompressTaggedLZ(), syHeapAllocateEWRAM(), syHeapRelease(), sySetEvent(), syVRAMCacheFindFreeEntry(), syVRAMCacheLoad() and syWordsClear().
Referenced by scTrialRoadSetUpFountainStage().
Definition at lines 658 and 3668 of file trial_road.c.
scTrialRoadStepPaletteCycle
void scTrialRoadStepPaletteCycle(void)
Each tick: turns the summit's five purples over by one every four ticks and
writes the first four of them to SUMMIT_PURPLE_PALETTE's colours 2 to 5; it
pauses while a Psynergy other than Hover, Reveal or the menu is up.
References Sint32, syDMAXCopy(), TrialRoadPaletteCycleColors, TrialRoadPaletteCycleRunning and TrialRoadPaletteCycleTick.
Referenced by scTrialRoadStartPaletteCycle().
Definition at lines 666 and 2283 of file trial_road.c.
scTrialRoadShutSummitDoorway
void scTrialRoadShutSummitDoorway(Sint32 sound)
Felix comes out of the last stage's doorway at the summit during the race and steps on the metatile in front of it, metatile (13, 19) on the left path or (18, 19) on the right: with the sound of a door, the dark doorway behind him shuts, a closed green door like the other path's, and on the upper layer its metatile, (77, 18) or (82, 18), takes the walking rules of the one beside it. Coming back to the summit while the race is on, the door is shut again, without the sound.
References fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatilesLayered(), fdScriptGetFlag(), fdScriptPlaySound(), fdScriptSetFlag() and Sint32.
Referenced by scTrialRoadSetUpPeak().
Definition at lines 667 and 1843 of file trial_road.c.
scTrialRoadPlaceMoapaAtPeak
void scTrialRoadPlaceMoapaAtPeak(void)
Places Moapa and his two knights at the summit, waiting for the party.
References scTrialRoadPlaceActor().
Referenced by scTrialRoadSetUpPeak().
Definition at lines 668 and 3005 of file trial_road.c.
scTrialRoadBeatMoapa
void scTrialRoadBeatMoapa(void)
After the party beats Moapa at the summit, he admits their strength and gives them the Hover Jade for the Shaman's Rod, and the party goes back to the Shaman Village to rest.
References fdActorFaceActor(), fdActorFaceDirection(), fdActorFaceDirectionAndWait(), fdActorFaceEachOther(), fdActorGetById(), fdActorRunRepeatedMotion(), fdActorSetAnimation(), fdActorSetAnimationAndWait(), fdActorStartRepeatedMotion(), fdActorWaitForMoveById(), fdActorWalkTo(), fdActorWalkToAndWait(), fdScriptEndLastingPsynergy(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), fdScriptStartScreenTransition(), fdScriptWait(), fdScriptWaitTransitionTicks(), gmPartyGiveItem(), gmPartyInventoryDiscard(), scFieldActorShowEmote(), scTrialRoadMirrorAngle(), scTrialRoadMirrorMetatileX(), scTrialRoadPlaceActor(), Sint32 and sySynch().
Referenced by scTrialRoadSetUpPeak().
Definition at lines 669 and 3169 of file trial_road.c.
scTrialRoadLoseToMoapa
void scTrialRoadLoseToMoapa(void)
After the party loses to Moapa at the summit: "You've lost. Now leave Shaman village."
References fdActorGetById(), fdActorSetAnimation(), fdActorSetAnimationAndWait(), fdActorSetSpriteFlags(), fdActorStartRepeatedMotion(), fdScriptEndLastingPsynergy(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), fdScriptStartScreenTransition(), fdScriptWait(), fdScriptWaitTransitionTicks(), scFieldActorSetSpriteRotationById(), scTrialRoadPlaceActor(), Sint32 and sySynch().
Referenced by scTrialRoadSetUpPeak().
Definition at lines 670 and 3265 of file trial_road.c.
scTrialRoadShowTraps
void scTrialRoadShowTraps(void)
While Moapa explains the trial, the camera tours a stage: its traps, the four doors, a knight showing how the switch opens the blue chests and how filling them opens the door, and the give-up button.
References fdActorFaceDirection(), fdActorFaceDirectionById(), fdActorGetById(), fdActorSetAnimationAndWait(), fdActorSetAnimationById(), fdActorSetDestinationOffset(), fdActorSetMovementTypeById(), fdActorWaitForMoveById(), fdActorWaitForScriptEndById(), fdActorWalkByAndWait(), fdActorWalkByAndWaitById(), fdActorWalkToAndWait(), fdActorWalkToAndWaitById(), fdCameraWaitForArrival(), fdMapCopyMetatileAttributeRect(), fdMapGridCopyMetatilesLayered(), fdScriptEndLastingPsynergy(), fdScriptSetMessageId(), fdScriptShowMessageAndWait(), fdScriptStart(), fdScriptStartScreenTransition(), fdScriptWait(), MainRoutineStateWork, Sint32, syImportScriptSetExitRequest(), sySoundPlay(), TrialRoadLeftKnightEntersScript, TrialRoadLeftKnightLeavesScript, TrialRoadLeftKnightToChestScript, TrialRoadRightKnightEntersScript, TrialRoadRightKnightLeavesScript and TrialRoadRightKnightToChestsScript.
Referenced by scInit().
Definition at lines 671 and 3308 of file trial_road.c.
scTrialRoadSetUpCave
void scTrialRoadSetUpCave(void)
The cave beyond the summit needs no setting up.
Referenced by scInit().
Definition at lines 672 and 2192 of file trial_road.c.
scTrialRoadSetUpPoolRoom
void scTrialRoadSetUpPoolRoom(void)
Readies Gasp's pool room, unless Gasp has joined the party: he floats over
the water until he first hops away, and stands on the ground after; each tick
he mirrors Felix (scTrialRoadGaspFlees).
References fdActorGetById(), fdScriptGetFlag(), scTrialRoadGaspFlees(), Sint32 and sySetEvent().
Referenced by scInit().
Definition at lines 673 and 2243 of file trial_road.c.
scTrialRoadRivalIsWaiting
Sint32 scTrialRoadRivalIsWaiting(void)
Whether Moapa's party is waiting.
References Sint32.
Referenced by scTrialRoadUpdateRival().
Definition at lines 675 and 4468 of file trial_road.c.
scTrialRoadPlayRivalRecording
void scTrialRoadPlayRivalRecording(Sint32 resource)
Plays Moapa's recording from the given resource.
References scTrialRoadMoveRival() and Sint32.
Referenced by scPrepareMap() and scTrialRoadUpdateRival().
Definition at lines 676 and 4456 of file trial_road.c.
scTrialRoadDealStageOrder
void scTrialRoadDealStageOrder(Uint32 seed)
Deals the Trial Road's stage order from a seed: shuffles 0 to 7 into the
eight slots at the start of the stage state, again until both the even and
the odd slots hold at least one of the four values in TrialRoadKeyStages; the
random state is restored after.
References RandWork, Sint32 and TrialRoadKeyStages.
Definition at lines 677 and 2902 of file trial_road.c.
scTrialRoadShowRaceMap
void scTrialRoadShowRaceMap(Sint32 leaderId, Sint32 rivalId)
Shows the race map for both sides.
References fdActorGetById(), MainRoutineStateWork, scTrialRoadDrawRaceMap(), Sint32, syDecompressTaggedLZ(), syHeapAllocateEWRAM(), syHeapRelease(), syHeapSlotAllocateEWRAM(), sySetEvent(), syVRAMCacheFindFreeEntry(), syVRAMCacheLoad() and TrialRoadRaceMapPicture.
Referenced by scPrepareMap().
Definition at lines 678 and 4410 of file trial_road.c.
scTrialRoadOpenLeaderDoor
void scTrialRoadOpenLeaderDoor(Sint32 side, Sint32 stage)
DEFINE_TRIAL_ROAD_OPEN_DOOR(scTrialRoadOpenLeaderDoor, 23, 57, 0, 9, 43, 1)
Opens the door at the top of Felix's stage: the door at metatile (23, 3) on the left path, (9, 3) on the right, is redrawn open and its doorway leads on.
References Sint32.
Referenced by scPrepareMap() and scTrialRoadPutItemInChest().
Definition at lines 679 and 735 of file trial_road.c.
scDustScatter
void scDustScatter(Sint32 spread)
Eight clouds of dust puff up in a row across the leader's feet; with spread set they fly out all round.
References DustScatterScript, fdActorGetById(), fdActorSelectAnimation(), fdActorSetSpriteFlags(), fdActorStartScript(), fdSpriteShareVRAMCacheEntry(), MainRoutineStateWork, scTrialRoadDriftDust(), Sint32, syCos(), syImportActorCreate() and sySin().
Referenced by scCrumblingPillarCollapse(), scCrumblingPillarStep(), scCrumblingPillarStepWithStandIn(), scLeaderCheckCrumblingStep(), scMagmaRockCrumblePillar(), scMagmaRockInsideCrumblePillar(), scMagmaRockInsideStepOnTrap(), scMagmaRockStepOnCrumblingPillar(), scMagmaRockStepOnTrap(), scTrialRoadCrumblePillar() and scTrialRoadStepOnTrap().
Definition at lines 686 and 3928 of file trial_road.c.
scMagmaRockInsideSpawnDustRing
void scMagmaRockInsideSpawnDustRing(void)
Clouds of dust burst out in a ring round the leader as something lands with a thump: Magma Rock's routine, kept here under its name for the crumbling pillars' shared code.
References DustBurstScript, fdActorGetById(), fdActorSelectAnimation(), fdActorSetSpriteFlags(), fdActorStartScript(), fdSpriteShareVRAMCacheEntry(), MainRoutineStateWork, scTrialRoadDriftDust(), syCos(), syImportActorCreate() and sySin().
Referenced by scLeaderCheckCrumblingStep(), scMagmaRockInsideCrumblePillar(), scMagmaRockInsideStepOnTrap(), scTrialRoadCrumblePillar() and scTrialRoadStepOnTrap().
Definition at lines 688 and 3985 of file trial_road.c.
scTrialRoadDriftDust
void scTrialRoadDriftDust(FIELD_OBJECT *object)
The dust's motion each tick, as scEffectAdvanceMotionAtLeaderPriority's: it
drifts, slows, grows and spins, drawn at the leader's sprite priority.
References fdActorGetById(), MainRoutineStateWork and Sint32.
Referenced by scDustScatter() and scMagmaRockInsideSpawnDustRing().
Definition at lines 690 and 3889 of file trial_road.c.
scTrialRoadMoveRival
void scTrialRoadMoveRival(void)
Moves the Trial Road rival as its activity says: RIVAL_MIRROR follows the
leader's position mirrored across the course; RIVAL_LINKED places the rival
and its partner from the linked player's record; RIVAL_REPLAY replays the
recorded path; RIVAL_RECORD records the actor's position. A mirrored or
replayed place keeps its x between z 256 and 560; north and south of that, x
is turned about the room's middle (528 pixels wide), always when mirroring
and on the right path when replaying; then the rival stands 304 pixels (19
metatiles) east of it from the left path, or west from the right. The band is
the arena, from below its north wall down the passage to the foot: its
pattern is the same way round on either path, so Moapa runs it in a copy of
the arena beside the leader's. The top and the foot north and south of it are
mirrored between the paths: as the race starts, Moapa stands at the foot's
other stairs, beside the leader.
References fdActorGetById(), fdActorSelectAnimation(), fdActorSetMoveTarget(), fdActorStartIdle(), LinkPeerSignatures, LinkStatusWork, MainRoutineStateWork, Sint32, syAtan(), syDecompressTaggedLZ(), syGameFlagGet(), syGameFlagGetByte() and syResourceGetTableEntry().
Referenced by scTrialRoadPlayRivalRecording() and scTrialRoadStartRival().
Definition at lines 695 and 4088 of file trial_road.c.
scTrialRoadSetUpPillarStage
void scTrialRoadSetUpPillarStage(void)
Readies the pillar stage: the middle pillar cannot be pushed until Whirlwind blows its weeds off, and Felix can jump between the pillars' tops.
References fdActorGetById(), fdScriptGetFlag(), scTrialRoadAddPillarTop(), scTrialRoadCheckLeaderOnPillars(), scTrialRoadSetJumpMetatileUnder() and sySetEvent().
Definition at lines 696 and 1925 of file trial_road.c.
scTrialRoadSetUpTorchStage
void scTrialRoadSetUpTorchStage(void)
Readies the torch stage: its pillars of ice cannot be pushed, and those already melted stay puddles.
References fdActorGetById(), fdActorSetAnimation(), fdScriptGetFlag(), scTrialRoadAddPillarTop(), scTrialRoadSetJumpMetatileUnder() and scTrialRoadSetPillarTopLift().
Definition at lines 697 and 1945 of file trial_road.c.
scTrialRoadSetUpWeedsPillarStage
void scTrialRoadSetUpWeedsPillarStage(void)
Readies the weeds stage: its two overgrown pillars cannot be pushed until Whirlwind blows their weeds off.
References fdActorGetById(), fdScriptGetFlag(), scTrialRoadAddPillarTop() and scTrialRoadSetJumpMetatileUnder().
Definition at lines 698 and 1983 of file trial_road.c.
scTrialRoadSetUpPoundStage
void scTrialRoadSetUpPoundStage(void)
Readies the Pound stage: its four stakes cannot be pushed, one of each pair stands raised, and the overgrown pillar cannot be pushed until Whirlwind blows its weeds off.
References fdActorGetById(), fdScriptGetFlag(), scTrialRoadAddPillarTop(), scTrialRoadLowerStake(), scTrialRoadRaiseStake() and scTrialRoadSetJumpMetatileUnder().
Definition at lines 699 and 2008 of file trial_road.c.
scTrialRoadSetUpCrumblingStage
void scTrialRoadSetUpCrumblingStage(void)
Readies the crumbling stage: the cracked pillars already crumbled stay gone.
References scMagmaRockInsideRestoreCrumblingPillars() and TrialRoadCrumblingPillars.
Definition at lines 700 and 2053 of file trial_road.c.
scTrialRoadSetUpLogStage
void scTrialRoadSetUpLogStage(void)
Readies the log stage: the logs roll by their own scripts rather than sliding
like blocks, their metatiles are walls (scTrialRoadBlockLogs), and Felix can
jump onto the block.
References fdActorGetById(), fdMapGridCopyMetatileAttributes(), scTrialRoadAddPillarTop(), scTrialRoadBlockLogs() and scTrialRoadSetJumpMetatileUnder().
Definition at lines 701 and 2061 of file trial_road.c.
scTrialRoadSetUpFountainStage
void scTrialRoadSetUpFountainStage(void)
Readies the fountain stage: its five vents' fountains rise and fall together, the northern three buried until Scoop digs them out; Felix rides a risen fountain as a step up, and can jump onto the block.
References fdScriptGetFlag(), scTrialRoadAddFountain(), scTrialRoadAddPillarTop(), scTrialRoadOpenVentMetatile(), scTrialRoadSetJumpMetatileUnder() and scTrialRoadStartFountains().
Definition at lines 702 and 2132 of file trial_road.c.
scTrialRoadSetUpSandStage
void scTrialRoadSetUpSandStage(void)
Readies the sand stage: its tightrope between two posts, and the vine on the cliff, climbable once Whirlwind has blown its weeds away.
References fdMapGridCopyMetatileAttributes(), fdScriptGetFlag(), fdTightropeInit() and fdTightropePlace().
Definition at lines 703 and 2181 of file trial_road.c.
scTrialRoadUpdateFountains
void scTrialRoadUpdateFountains(void)
Moves the fountains each tick: at its rise phase a fountain starts up 4 pixels a tick, at its fall phase down 8, until it reaches its high or low height; its phase runs round its period while the field engine handles no request. Its metatile's collision height follows it; while it is up the metatile is water to wade in, and while it also stands still a gap to jump onto; its top bobs on the water.
References fdActorGetById(), Sint32, syGameFlagGet(), sySin() and sySoundPlay().
Referenced by scTrialRoadStartFountains().
Definition at lines 704 and 3466 of file trial_road.c.
scTrialRoadOpenRivalDoor
DEFINE_TRIAL_ROAD_OPEN_DOOR(scTrialRoadOpenRivalDoor, 28, 62, 1, 4, 38, 0)
void scTrialRoadOpenRivalDoor(Sint32 mirrored, Sint32 stage)
Opens the door at the top of Moapa's stage, beside Felix's: metatile (28, 3) when Felix took the left path, (4, 3) when he took the right.
References Sint32.
Referenced by scPrepareMap() and scTrialRoadUpdateRival().
Definition at lines 739 and 2469 of file trial_road.c.
scTrialRoadOpenChests
void scTrialRoadOpenChests(void)
Standing on the switch in front of the door at the top of a stage (metatile (22, 9) on the left path, (10, 9) on the right) opens the blue chest beside the door, and the second chest too when Moapa got there first ("it will take twice the weight to open the doors").
References fdActorGetById(), fdActorSetAnimation(), fdActorWalkToAndWait(), fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptPlaySound(), fdScriptSetFlag(), fdScriptStart(), MainRoutineStateWork, scTrialRoadIdle(), scTrialRoadRivalIsAhead() and Sint32.
Definition at line 803 of file trial_road.c.
scTrialRoadPutItemInChest
void scTrialRoadPutItemInChest(Sint32 item, Sint32 owner, Sint32 slot)
Choosing a piece of equipment for an open blue chest puts it inside, and the message names its owner and the item ("Felix put ...'s ... in the chest."). The chest shuts, and once every open chest is shut the door beside them opens. The item is taken from its owner's inventory.
References fdActorSetAnimationAndWait(), fdFindNearbyTalkTarget(), fdPartyGetLeaderActor(), fdScriptClearFlag(), fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptGetFlag(), fdScriptPlaySound(), fdScriptSetFlag(), fdScriptStart(), gmInventoryClearSlot(), mnFieldMessageShow(), mnMessageArgumentPush(), scTrialRoadOpenLeaderDoor() and Sint32.
Definition at line 847 of file trial_road.c.
scTrialRoadExamineChest
void scTrialRoadExamineChest(Sint32 id)
Searching a blue chest before the switch has opened it says "The chest won't open. There's something keeping it shut tight." Once it stands open, Felix is asked "Place this item in the chest?", and Yes opens the item menu.
References fdScriptAskYesNoWithActorAnimation(), fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptGetFlag(), fdScriptStart(), MainRoutineStateWork, mnFieldMessageShow() and Sint32.
Definition at line 878 of file trial_road.c.
scTrialRoadStepOffSwitch
void scTrialRoadStepOffSwitch(void)
Walking around the switch once the chests have opened does nothing.
Definition at line 908 of file trial_road.c.
scTrialRoadFollowPillar
Sint32 scTrialRoadFollowPillar(ACTOR *actor)
Keeps an invisible pillar top on its pillar, so many pixels above it.
References Sint32.
Referenced by TrialRoadPillarTopScript.
Definition at line 951 of file trial_road.c.
TrialRoadClearJumpUnderPushedPillar
DEFINE_TRIAL_ROAD_ON_FOOT(TrialRoadClearJumpUnderPushedPillar, scTrialRoadClearJumpMetatileUnder)
As a pillar starts to slide, Felix can no longer jump onto the place it is leaving.
Definition at line 1018 of file trial_road.c.
TrialRoadSetJumpUnderPushedPillar
DEFINE_TRIAL_ROAD_ON_FOOT(TrialRoadSetJumpUnderPushedPillar, scTrialRoadSetJumpMetatileUnder)
Once a pushed or Moved pillar stops, Felix can jump onto its top where it stands.
Definition at line 1023 of file trial_road.c.
scTrialRoadJumpForward
void scTrialRoadJumpForward(void)
Walking off the edge of a ledge or pillar top toward another one jumps Felix across, when there is somewhere to land.
References fdTryJumpForward().
Definition at line 1036 of file trial_road.c.
scTrialRoadClearJumpUnderTorchStagePillar
void scTrialRoadClearJumpUnderTorchStagePillar(Sint32 unused, Sint32 id)
As one of the torch stage's two stone pillars starts to slide, Felix can no longer jump onto the place it is leaving.
References scTrialRoadClearJumpMetatileUnder() and Sint32.
Definition at line 1081 of file trial_road.c.
scTrialRoadMeltIceBesideTorch
void scTrialRoadMeltIceBesideTorch(Sint32 unused, Sint32 id)
Pushing a torch up to one of the torch stage's two pillars of ice, pillar C in column 13 of the map or F in column 19, melts it to a puddle Felix can jump across (columns 15 and 17 would be D's and E's, which are not on the stage). A stone pillar pushed in the torch stage can be jumped onto where it stops.
References fdActorGetById(), fdActorSetAnimation(), fdActorSetSpriteColorMode(), fdScriptGetFlag(), fdScriptSetFlag(), scTrialRoadSetJumpMetatileUnder(), scTrialRoadSetPillarTopLift() and Sint32.
Definition at line 1092 of file trial_road.c.
scTrialRoadFreezePuddle
void scTrialRoadFreezePuddle(Sint32 unused, Sint32 id)
Frost on a melted puddle in the torch stage freezes it into a pillar of ice again, which Felix can stand on.
References fdActorGetById(), fdScriptClearFlag(), scTrialRoadSetPillarTopLift() and Sint32.
Definition at line 1142 of file trial_road.c.
scTrialRoadBlowAwayWeeds
void scTrialRoadBlowAwayWeeds(Sint32 unused, Sint32 id)
Whirlwind on the weeds at the foot of one of the two overgrown pillars in the weeds stage blows it away, and the pillar can then be pushed or Moved.
References fdActorGetById(), fdScriptSetFlag() and Sint32.
Definition at line 1154 of file trial_road.c.
scTrialRoadBlowAwayPoundStageWeeds
void scTrialRoadBlowAwayPoundStageWeeds(void)
Whirlwind on the weeds at the foot of the Pound stage's middle pillar, at metatile (16, 28), blows it away, and the pillar can then be pushed.
References fdActorGetById() and fdScriptSetFlag().
Definition at line 1190 of file trial_road.c.
scTrialRoadPoundWestStake
void scTrialRoadPoundWestStake(Sint32 phase, Sint32 frame)
Pound on the west stake, metatile (13, 26), drives it down and raises the inner west stake.
References scTrialRoadPoundStake() and Sint32.
Definition at line 1284 of file trial_road.c.
scTrialRoadPoundInnerWestStake
void scTrialRoadPoundInnerWestStake(Sint32 phase, Sint32 frame)
Pound on the inner west stake, metatile (15, 26), drives it down and raises the west stake.
References scTrialRoadPoundStake() and Sint32.
Definition at line 1291 of file trial_road.c.
scTrialRoadPoundInnerEastStake
void scTrialRoadPoundInnerEastStake(Sint32 phase, Sint32 frame)
Pound on the inner east stake, metatile (17, 26), drives it down and raises the east stake.
References scTrialRoadPoundStake() and Sint32.
Definition at line 1298 of file trial_road.c.
scTrialRoadPoundEastStake
void scTrialRoadPoundEastStake(Sint32 phase, Sint32 frame)
Pound on the east stake, metatile (19, 26), drives it down and raises the inner east stake.
References scTrialRoadPoundStake() and Sint32.
Definition at line 1305 of file trial_road.c.
scTrialRoadCrumbleWestPillar
void scTrialRoadCrumbleWestPillar(Sint32 stage)
Burst on the crumbling stage's west cracked pillar crumbles it away.
References scTrialRoadCrumblePillar(), Sint32 and TrialRoadCrumblingPillars.
Definition at line 1404 of file trial_road.c.
scTrialRoadCrumbleEastPillar
void scTrialRoadCrumbleEastPillar(Sint32 stage)
Burst on the crumbling stage's east cracked pillar crumbles it away.
References scTrialRoadCrumblePillar(), Sint32 and TrialRoadCrumblingPillars.
Definition at line 1412 of file trial_road.c.
scTrialRoadBlockLogMetatiles
void scTrialRoadBlockLogMetatiles(Sint32 id, Sint32 lies)
Makes a log solid where it lies: its own metatile and the two beside it along
its length (METATILE_BEHAVIOR_WALL on the ground and the upper level).
References fdActorGetById() and Sint32.
Referenced by scTrialRoadBlockLogs().
Definition at line 1429 of file trial_road.c.
scTrialRoadIsLogBlocked
Sint32 scTrialRoadIsLogBlocked(Sint32 x, Sint32 z)
Whether a log rolling into the metatile is stopped there by the block or a wall.
References fdActorGetById() and Sint32.
Referenced by scTrialRoadPushLog().
Definition at line 1480 of file trial_road.c.
scTrialRoadUncoverWestVent
void scTrialRoadUncoverWestVent(Sint32 phase, Sint32 frame)
Scoop over the west vent digs it out.
References scTrialRoadUncoverVent() and Sint32.
Definition at line 1667 of file trial_road.c.
scTrialRoadUncoverMiddleVent
void scTrialRoadUncoverMiddleVent(Sint32 phase, Sint32 frame)
Scoop over the middle vent digs it out.
References scTrialRoadUncoverVent() and Sint32.
Definition at line 1673 of file trial_road.c.
scTrialRoadUncoverEastVent
void scTrialRoadUncoverEastVent(Sint32 phase, Sint32 frame)
Scoop over the east vent digs it out.
References scTrialRoadUncoverVent() and Sint32.
Definition at line 1679 of file trial_road.c.
scTrialRoadStandOnBlock
void scTrialRoadStandOnBlock(void)
Stepping onto the fountain stage's block from above leaves Felix standing on its top, 32 pixels up, rather than inside it.
References fdActorGetById() and MainRoutineStateWork.
Definition at line 1686 of file trial_road.c.
scTrialRoadReturnTrue
Sint32 scTrialRoadReturnTrue(void)
Unused: always 1.
References Sint32.
Definition at line 1809 of file trial_road.c.
scTrialRoadSetSummitPillar
void scTrialRoadSetSummitPillar(Sint32 unused, Sint32 id)
Moving or pushing the summit's stone pillar, at metatile (7, 20), one metatile east into column 8 settles it there for good.
References fdActorGetById(), fdScriptSetFlag() and Sint32.
Definition at line 1890 of file trial_road.c.
scGetCues
const CUE *scGetCues(void)
References MainRoutineStateWork, Sint32, TrialRoadCaveCues, TrialRoadCues, TrialRoadGaspCues, TrialRoadStagesCues and TrialRoadSummitCues.
Definition at line 1908 of file trial_road.c.
scTrialRoadAddFountain
TRIAL_ROAD_FOUNTAIN *scTrialRoadAddFountain( Sint32 slot, Sint32 id, Sint32 timer, Sint32 low, Sint32 high)
Sets up one fountain on its vent, with its timer and height.
References fdActorGetById(), fdActorSetSpriteFlags(), fdScriptGetFlag(), Sint32 and syImportActorCreate().
Referenced by scTrialRoadSetUpFountainStage().
Definition at lines 2121 and 3690 of file trial_road.c.
scTrialRoadGaspFlees
void scTrialRoadGaspFlees(void)
Gasp moves opposite to Felix about the hidden tile at metatile (18, 15): whatever way Felix steps, Gasp steps the other. Once Felix stands on that tile, Gasp cries out and hops away to metatile (21, 16), there to be talked to.
References fdActorGetById(), fdActorSetMoveTarget(), fdActorSetScript(), fdScriptGetFlag(), fdScriptPlaySound(), fdScriptSetFlag(), MainRoutineStateWork, Sint32 and TrialRoadGaspHopScript.
Referenced by scTrialRoadSetUpPoolRoom().
Definition at line 2200 of file trial_road.c.
scTrialRoadSetPaletteCycleRunning
void scTrialRoadSetPaletteCycleRunning(Sint32 value)
Starts or stops the summit's colour cycle.
References Sint32 and TrialRoadPaletteCycleRunning.
Definition at line 2266 of file trial_road.c.
scPaletteCycleSetTick
static inline void scPaletteCycleSetTick(Sint32 value)
Sets the colour cycle's tick counter, as the Jupiter and Mars Lighthouse rooms' palette cycles, which this one copies, do.
References Sint32 and TrialRoadPaletteCycleTick.
Referenced by scJupiterLighthouseLoadPalettes() and scTrialRoadStartPaletteCycle().
Definition at line 2275 of file trial_road.c.
scTrialRoadStartPaletteCycle
void scTrialRoadStartPaletteCycle(Sint32 mode)
Starts the summit's colour cycle as mode says. On the summit the purple stripes along the pale stone channels that run down the cliff face, and the round purple Hover pad at their foot, shimmer: their five shades of purple turn over every four ticks, so the light seems to pulse along the channels and ripple in the pad's rings.
References scPaletteCycleSetTick(), scTrialRoadStepPaletteCycle(), Sint32, sySetEvent(), syWordsCopy(), TrialRoadPaletteCycleColors and TrialRoadPaletteCycleRunning.
Referenced by scTrialRoadSetUpPeak().
Definition at line 2339 of file trial_road.c.
scTrialRoadLeaveMoapaWaiting
void scTrialRoadLeaveMoapaWaiting(void)
Felix got to the summit first, so Moapa is not placed yet; he arrives when
Felix walks up (scTrialRoadReachPeakFirst).
Referenced by scTrialRoadSetUpPeak().
Definition at lines 2353 and 3000 of file trial_road.c.
scTrialRoadSetUpPeak
void scTrialRoadSetUpPeak(void)
Readies the summit: after the battle, Moapa's surrender or his scorn; during the race, Moapa and his knights waiting at the top if they got there first, or nobody yet.
References fdActorGetById(), fdScriptGetFlag(), gmInventorySnapshotRestore(), MainRoutineStateWork, scTrialRoadAddPillarTop(), scTrialRoadBeatMoapa(), scTrialRoadLeaveMoapaWaiting(), scTrialRoadLoseToMoapa(), scTrialRoadPlaceMoapaAtPeak(), scTrialRoadShutSummitDoorway(), scTrialRoadStartPaletteCycle(), Sint32 and syImportScriptSetExitRequest().
Referenced by scInit().
Definition at line 2358 of file trial_road.c.
TrialRoadStageSetUps
extern void (*TrialRoadStageSetUps[])(void)
Each stage pattern's set-up, by the pattern's low three bits.
Referenced by scInit().
Definition at line 2392 of file trial_road.c.
scInit
Sint32 scInit(void)
Sets up the room being entered: in the race a stage's puzzle by its pattern, while Moapa explains the rules the course he tours, Gasp's pool room, and the summit.
References fdActorGetById(), fdScriptSetFlag(), MainRoutineStateWork, scTrialRoadSetUpCave(), scTrialRoadSetUpPeak(), scTrialRoadSetUpPoolRoom(), scTrialRoadShowTraps(), Sint32, TrialRoadStageSetUps() and Value0().
Definition at line 2397 of file trial_road.c.
scTrialRoadCopyMetatilesBackward
void scTrialRoadCopyMetatilesBackward(Sint32 srcX, Sint32 srcY, Sint32 width, Sint32 height, Sint32 destX, Sint32 destY)
Copies a rectangle of map metatiles and their shapes, last row first, so that overlapping rectangles copy whole.
References MapShapeGrid and Sint32.
Referenced by scPrepareMap().
Definition at line 2435 of file trial_road.c.
scTrialRoadUpdateRival
void scTrialRoadUpdateRival(void)
Each tick of the race, moves Moapa's party on by its recording, and opens his door when he reaches it.
References fdActorGetById(), fdActorSetAnimationById(), scTrialRoadOpenRivalDoor(), scTrialRoadPlayRivalRecording(), scTrialRoadRivalIsAhead(), scTrialRoadRivalIsWaiting(), Sint32, syGameFlagGet(), sySoundPlay() and TrialRoadRivalRecordings.
Referenced by scPrepareMap().
Definition at line 2494 of file trial_road.c.
scTrialRoadStartRival
void scTrialRoadStartRival(Sint32 mirrored)
Starts Moapa's party on its recording, mirrored when the leader went right.
References fdScriptGetFlag(), scTrialRoadMoveRival(), Sint32 and sySetEvent().
Referenced by scPrepareMap().
Definition at lines 2600 and 4441 of file trial_road.c.
scPrepareMap
Sint32 scPrepareMap(void)
Readies the map before the room is drawn. Coming into the stages from the village or the summit, the stage order is dealt (once) and the race set at the foot or the top of the road; then the stage room is redrawn for the leader's path and its stage's pattern, its doors opened as far as each side has come, and the race map and Moapa's party started. During the race the summit shows the other path's doorway shut.
References fdActorGetById(), fdActorSetSpriteColor(), fdMapCopyRawMetatilesRect(), fdMapGetTerrainHeight(), fdMapGridCenterOnFollowedPoint(), fdMapGridCopyMetatilesLayered(), fdScriptSetDestination(), MainRoutineStateWork, scTrialRoadCopyMetatilesBackward(), scTrialRoadOpenLeaderDoor(), scTrialRoadOpenRivalDoor(), scTrialRoadPlayRivalRecording(), scTrialRoadShowRaceMap(), scTrialRoadStartRival(), scTrialRoadUpdateRival(), Sint32, syGameFlagGet(), syGameFlagSet(), sySetEvent(), TrialRoadRivalRecordings, TrialRoadRulesTreasureStages, TrialRoadStageMapMetatiles and TrialRoadTreasureStages.
Definition at line 2630 of file trial_road.c.
scTrialRoadGetStage
Sint32 scTrialRoadGetStage(Sint32 side)
The stage a side of the race has reached: 0 the leader's, 1 Moapa's.
References Sint32.
Definition at line 2941 of file trial_road.c.
scTrialRoadMirrorX
Sint32 scTrialRoadMirrorX(Sint32 x)
A pixel x on the mirrored road, the right path's, when the leader took it.
References scTrialRoadIsMirrored() and Sint32.
Referenced by scTrialRoadPlaceActor().
Definition at line 2956 of file trial_road.c.
scTrialRoadMirrorMetatileX
Sint32 scTrialRoadMirrorMetatileX(Sint32 x)
A metatile x, in pixels, on the mirrored road when the leader took it.
References scTrialRoadIsMirrored() and Sint32.
Referenced by scTrialRoadBeatMoapa(), scTrialRoadGatherAtPeak() and scTrialRoadReachPeakFirst().
Definition at line 2964 of file trial_road.c.
scTrialRoadMirrorOffset
Sint32 scTrialRoadMirrorOffset(Sint32 x)
An x offset of so many 8-pixel steps, in pixels, turned round on the mirrored road.
References scTrialRoadIsMirrored() and Sint32.
Definition at line 2973 of file trial_road.c.
scTrialRoadMirrorAngle
Sint32 scTrialRoadMirrorAngle(Sint32 angle)
An angle on the mirrored road, turned round when it is.
References scTrialRoadIsMirrored() and Sint32.
Referenced by scTrialRoadBeatMoapa(), scTrialRoadGatherAtPeak(), scTrialRoadPlaceActor() and scTrialRoadReachPeakFirst().
Definition at line 2981 of file trial_road.c.
scTrialRoadPlaceActor
void scTrialRoadPlaceActor(Sint32 id, Sint32 x, Sint32 z, Sint32 angle)
Places an actor at a pixel position and facing, mirrored when the leader took the right path.
References fdActorSetPosAndFacing(), scTrialRoadMirrorAngle(), scTrialRoadMirrorX() and Sint32.
Referenced by scTrialRoadBeatMoapa(), scTrialRoadLoseToMoapa(), scTrialRoadPlaceMoapaAtPeak() and scTrialRoadReachPeakFirst().
Definition at line 2990 of file trial_road.c.
scTrialRoadGatherAtPeak
static inline void scTrialRoadGatherAtPeak(void)
The camera pans to the summit, and the party walks up to its near side and turns to face the far one, where Moapa stands or will land.
References fdActorFaceDirection(), fdActorPlaceOnActor(), fdActorWaitForMoveById(), fdActorWalkTo(), fdCameraWaitForArrival(), fdScriptEndLastingPsynergy(), fdScriptStart(), scTrialRoadMirrorAngle() and scTrialRoadMirrorMetatileX().
Referenced by scTrialRoadReachPeakFirst() and scTrialRoadReachPeakSecond().
Definition at line 3014 of file trial_road.c.
scTrialRoadDrawFountains
void scTrialRoadDrawFountains(void)
Queues the fountains' sprites each tick: each risen fountain's column of water, in 16-pixel segments up from its vent, and its spout bobbing on top.
References fdActorGetById(), fdMapStateView(), Sint32, syOAMAddSpriteAtDepth(), sySin(), TickCount and VramCacheEntries.
Referenced by scTrialRoadStartFountains().
Definition at line 3565 of file trial_road.c.
scTrialRoadAllocateTileBuffer
static __inline__ void *scTrialRoadAllocateTileBuffer(Sint32 size)
A buffer in EWRAM to decompress the fountains' tiles into.
References Sint32 and syHeapAllocateEWRAM().
Referenced by scTrialRoadStartFountains().
Definition at line 3662 of file trial_road.c.
scTrialRoadStepOnTrap
void scTrialRoadStepOnTrap(const Uint16 *table)
Unused: Magma Rock's trap floor, kept in this overlay: a cracked pillar
stepped on flashes the first time and gives way under Felix the second, with
Moapa's actor standing in for the trap's picture. The crumbling stage uses
scLeaderCheckCrumblingStep instead.
References fdActorCopyGraphics(), fdActorFindAtMetatile(), fdActorGetById(), fdActorSelectAnimation(), fdActorSetPosAndResetMotion(), fdActorSetSpriteColor(), fdLeaderSetMetatileShapeAt(), fdScriptEnd(), fdScriptStart(), fdTryJumpForward(), MainRoutineStateWork, scActorTakePlaceOf(), scDustScatter(), scMagmaRockInsideSpawnDustRing(), Sint32, syGameFlagGet(), syGameFlagSet(), sySoundPlay() and sySynch().
Definition at line 3794 of file trial_road.c.
scStringWriteU32AsHex
void scStringWriteU32AsHex(Uint8 *text, Uint32 value)
Unused: writes value as eight hexadecimal digits (TrialRoadHexDigits) and a
terminating null.
References Sint32 and TrialRoadHexDigits.
Definition at line 4034 of file trial_road.c.
scTrialRoadStopRival
void scTrialRoadStopRival(void)
Stops Moapa's party where it stands, as at the end of its recording.
Definition at line 4056 of file trial_road.c.
scTrialRoadWaitForRival
void scTrialRoadWaitForRival(void)
Waits until Moapa's party has finished its recording.
References sySynch().
Definition at line 4062 of file trial_road.c.
scTrialRoadLinkAllocatePicture
static inline void *scTrialRoadLinkAllocatePicture(void)
The picture's buffer in EWRAM, the size syVRAMCacheLoad copies.
References syHeapAllocateEWRAM().
Referenced by scTrialRoadDrawRaceMap().
Definition at line 4268 of file trial_road.c.
scTrialRoadDrawRaceMap
void scTrialRoadDrawRaceMap(void)
Draws the race map each tick, once scTrialRoadShowRaceMap starts it: the
display slides in from both sides of the screen, and out while a menu or a
Psynergy is open. Each side shows the road's stages one above the other, and
on eleven ticks of sixteen a marker shows where each party is: "1P" for the
leader's, "2P" for Moapa's.
References fdActorLookup(), scTrialRoadLinkAllocatePicture(), Sint32, syDecompressTaggedLZ(), syDMAXCopy(), syGameFlagGet(), syHeapRelease(), syOAMAddSpriteAtDepth(), syVRAMCacheLoad(), syVRAMCacheReleaseVRAM(), TickCount, TrialRoadRaceMapPalette, TrialRoadRaceMapPicture and VramCacheEntries.
Referenced by scTrialRoadShowRaceMap().
Definition at line 4311 of file trial_road.c.
scTrialRoadNoOperation
void scTrialRoadNoOperation(void)
Unused: does nothing.
Definition at line 4476 of file trial_road.c.
Variables in detail
TrialRoadPlacements
extern ACTOR_PLACE TrialRoadPlacements[]
Referenced by scGetActorPlacements().
Definition at line 382 of file trial_road.c.
TrialRoadCavePlacements
extern ACTOR_PLACE TrialRoadCavePlacements[]
Referenced by scGetActorPlacements().
Definition at line 383 of file trial_road.c.
TrialRoadGaspPlacements
extern ACTOR_PLACE TrialRoadGaspPlacements[]
Referenced by scGetActorPlacements().
Definition at line 384 of file trial_road.c.
TrialRoadSummitPlacements
extern ACTOR_PLACE TrialRoadSummitPlacements[]
Referenced by scGetActorPlacements().
Definition at line 385 of file trial_road.c.
TrialRoadStagesPlacements
extern Sint32 TrialRoadStagesPlacements[]
Referenced by scGetActorPlacements().
Definition at line 386 of file trial_road.c.
TrialRoadPillarStagePlacements
extern ACTOR_PLACE TrialRoadPillarStagePlacements[]
Definition at line 633 of file trial_road.c.
TrialRoadTorchStagePlacements
extern ACTOR_PLACE TrialRoadTorchStagePlacements[]
Definition at line 634 of file trial_road.c.
TrialRoadWeedsPillarStagePlacements
extern ACTOR_PLACE TrialRoadWeedsPillarStagePlacements[]
Definition at line 635 of file trial_road.c.
TrialRoadPoundStagePlacements
extern ACTOR_PLACE TrialRoadPoundStagePlacements[]
Definition at line 636 of file trial_road.c.
TrialRoadCrumblingStagePlacements
extern ACTOR_PLACE TrialRoadCrumblingStagePlacements[]
Definition at line 637 of file trial_road.c.
TrialRoadLogStagePlacements
extern ACTOR_PLACE TrialRoadLogStagePlacements[]
Definition at line 638 of file trial_road.c.
TrialRoadFountainStagePlacements
extern ACTOR_PLACE TrialRoadFountainStagePlacements[]
Definition at line 639 of file trial_road.c.
TrialRoadSandStagePlacements
extern ACTOR_PLACE TrialRoadSandStagePlacements[]
Definition at line 640 of file trial_road.c.
TrialRoadPillarStageCues
extern CUE TrialRoadPillarStageCues[]
Definition at line 641 of file trial_road.c.
TrialRoadTorchStageCues
extern CUE TrialRoadTorchStageCues[]
Definition at line 642 of file trial_road.c.
TrialRoadWeedsPillarStageCues
extern CUE TrialRoadWeedsPillarStageCues[]
Definition at line 643 of file trial_road.c.
TrialRoadPoundStageCues
extern CUE TrialRoadPoundStageCues[]
Definition at line 644 of file trial_road.c.
TrialRoadCrumblingStageCues
extern CUE TrialRoadCrumblingStageCues[]
Definition at line 645 of file trial_road.c.
TrialRoadLogStageCues
extern CUE TrialRoadLogStageCues[]
Definition at line 646 of file trial_road.c.
TrialRoadFountainStageCues
extern CUE TrialRoadFountainStageCues[]
Definition at line 647 of file trial_road.c.
TrialRoadSandStageCues
extern CUE TrialRoadSandStageCues[]
Definition at line 648 of file trial_road.c.
TrialRoadCrumblingPillars
extern Sint16 TrialRoadCrumblingPillars[]
Referenced by scTrialRoadCheckCrumblingPillars(), scTrialRoadCrumbleEastPillar(), scTrialRoadCrumbleWestPillar() and scTrialRoadSetUpCrumblingStage().
Definition at line 651 of file trial_road.c.
TrialRoadGaspHopScript
extern Uint32 TrialRoadGaspHopScript[]
Referenced by scTrialRoadGaspFlees().
Definition at line 659 of file trial_road.c.
TrialRoadPaletteCycleColors
Uint16 TrialRoadPaletteCycleColors[16]
Referenced by scTrialRoadStartPaletteCycle() and scTrialRoadStepPaletteCycle().
Definition at line 664 of file trial_road.c.
TrialRoadRivalRecordings
extern Uint32 TrialRoadRivalRecordings[]
Referenced by scPrepareMap() and scTrialRoadUpdateRival().
Definition at line 674 of file trial_road.c.
TrialRoadLeftKnightEntersScript
extern Uint32 TrialRoadLeftKnightEntersScript[]
Referenced by scTrialRoadShowTraps().
Definition at line 680 of file trial_road.c.
TrialRoadRightKnightEntersScript
extern Uint32 TrialRoadRightKnightEntersScript[]
Referenced by scTrialRoadShowTraps().
Definition at line 681 of file trial_road.c.
TrialRoadLeftKnightToChestScript
extern Uint32 TrialRoadLeftKnightToChestScript[]
Referenced by scTrialRoadShowTraps().
Definition at line 682 of file trial_road.c.
TrialRoadRightKnightToChestsScript
extern Uint32 TrialRoadRightKnightToChestsScript[]
Referenced by scTrialRoadShowTraps().
Definition at line 683 of file trial_road.c.
TrialRoadRightKnightLeavesScript
extern Uint32 TrialRoadRightKnightLeavesScript[]
Referenced by scTrialRoadShowTraps().
Definition at line 684 of file trial_road.c.
TrialRoadRaceMapPalette
extern const Uint16 TrialRoadRaceMapPalette[]
The race map's colours.
Referenced by scTrialRoadDrawRaceMap().
Definition at line 693 of file trial_road.c.
TrialRoadPillarTopScript
extern Sint32 TrialRoadPillarTopScript[]
Sint32 TrialRoadPillarTopScript[]
References scTrialRoadFollowPillar() and Sint32.
Referenced by scTrialRoadAddPillarTop().
Definition at lines 963 and 4485 of file trial_road.c.
TrialRoadPoundPartners
extern Sint8 TrialRoadPoundPartners[4]
Sint8 TrialRoadPoundPartners[4]
The stake each of the pound stage's four stakes raises when it is pounded down: they go in pairs.
Referenced by scTrialRoadCheckStakesCovered() and scTrialRoadPoundStake().
Definition at lines 1198 and 4490 of file trial_road.c.
TrialRoadCues
extern CUE TrialRoadCues[]
Referenced by scGetCues().
Definition at line 1902 of file trial_road.c.
TrialRoadCaveCues
extern CUE TrialRoadCaveCues[]
Referenced by scGetCues().
Definition at line 1903 of file trial_road.c.
TrialRoadGaspCues
extern CUE TrialRoadGaspCues[]
Referenced by scGetCues().
Definition at line 1904 of file trial_road.c.
TrialRoadSummitCues
extern CUE TrialRoadSummitCues[]
Referenced by scGetCues().
Definition at line 1905 of file trial_road.c.
TrialRoadStagesCues
extern Sint32 TrialRoadStagesCues[]
Referenced by scGetCues().
Definition at line 1906 of file trial_road.c.
TrialRoadPaletteCycleRunning
extern Sint32 TrialRoadPaletteCycleRunning
Whether the summit's colour cycle runs.
Referenced by scTrialRoadSetPaletteCycleRunning(), scTrialRoadStartPaletteCycle() and scTrialRoadStepPaletteCycle().
Definition at line 2238 of file trial_road.c.
TrialRoadPaletteCycleTick
extern Sint32 TrialRoadPaletteCycleTick
Referenced by scPaletteCycleSetTick() and scTrialRoadStepPaletteCycle().
Definition at line 2271 of file trial_road.c.
TrialRoadStageMapMetatiles
extern Sint16 TrialRoadStageMapMetatiles[][2]
Referenced by scPrepareMap().
Definition at line 2596 of file trial_road.c.
TrialRoadRulesTreasureStages
extern Sint8 TrialRoadRulesTreasureStages[]
Referenced by scPrepareMap().
Definition at line 2597 of file trial_road.c.
TrialRoadTreasureStages
extern Sint8 TrialRoadTreasureStages[]
Referenced by scPrepareMap().
Definition at line 2598 of file trial_road.c.
TrialRoadKeyStages
extern Sint8 TrialRoadKeyStages[]
Referenced by scTrialRoadDealStageOrder().
Definition at line 2896 of file trial_road.c.
TrialRoadLeftKnightLeavesScript
extern Uint32 TrialRoadLeftKnightLeavesScript[]
Referenced by scTrialRoadShowTraps().
Definition at line 3303 of file trial_road.c.
TrialRoadHexDigits
extern Uint32 TrialRoadHexDigits[]
Referenced by scStringWriteU32AsHex().
Definition at line 4030 of file trial_road.c.
TrialRoadRaceMapPicture
extern const Uint8 TrialRoadRaceMapPicture[]
The race map's picture, tagged LZ.
Referenced by scTrialRoadDrawRaceMap() and scTrialRoadShowRaceMap().
Definition at line 4265 of file trial_road.c.
TrialRoadSettleScript
Sint32 TrialRoadSettleScript[]
References scTrialRoadSettleOnGround() and Sint32.
Definition at line 4480 of file trial_road.c.