Skip to Content
The Alchemy Project

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…

Structures

NameDescription
structEFFECT_SPR_BITSThe sprite's priority bits, read as the byte that holds them.
structEFFECT_SPR_ATTRA sprite's attribute 2, as the byte bits view reaches it.
structTRIAL_ROAD_REPLAYThe rival's state in SceneStateWork.
structTRIAL_ROAD_SPROne queued sprite: the three words syOAMAddSpriteAtDepth adds to OAM.
structTRIAL_ROAD_LINK_STATEThe heap slot scTrialRoadShowRaceMap takes for the race map of both parties and the rival's recorded path.
structTRIAL_ROAD_FOUNTAINOne of the fountain stage's fountains: the vent its water rises from, and the platform the leader rides on top of it.
structTRIAL_ROAD_FOUNTAINS_STATEThe fountain stage's state, kept in the inventory snapshot's spare room.

Macros

NameDescription
#defineMAD_PLANT_TRIAL_ROAD 4Trial Road's Mad Plant, the last of the five hidden in weeds: its FLAG_MAD_PLANT and its column of ENCOUNTER_ZONE_MAD_PLANTS.
#defineFLAG_TRIAL_ROAD_PEAK_PILLAR_PLACED 0x9fcSet once the summit's stone pillar has been moved one metatile east, into column 8 of the map, where it stays.
#defineFLAG_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).
#defineFLAG_GIVE_UP_ASKED FLAG_SCENE_TEMP(0x81)Set once the give-up button has asked; stepping off it clears it.
#defineFLAG_STAGE_DOOR_OPEN FLAG_SCENE_TEMP(0x82)Set once both blue chests hold their items and the leader's door opens.
#defineFLAG_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).
#defineFLAG_INNER_CHEST_OPEN FLAG_SCENE_TEMP(0x85)Set while the inner blue chest stands open for an item.
#defineFLAG_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.
#defineFLAG_SUMMIT_DOORWAY_SHUT FLAG_SCENE_TEMP(0x83)Set once the doorway Felix came out of at the summit has shut behind him (scTrialRoadShutSummitDoorway).
#defineFLAG_CAVE_ROCK_LIFTED FLAG_SCENE_TEMP(0x89)Set once Lift has raised the rock at the summit cave's mouth.
#defineFLAG_GASP_FLED FLAG_SCENE_TEMP(0x88)Set once Gasp has stopped mirroring Felix and hopped away to where he can be talked to.
#defineFLAG_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.
#defineFLAG_LINKED_RIVAL_HALTS FLAG_SCENE_TEMP(0x11)
#defineFLAG_LINKED_RIVAL_ON_FAR_SIDE FLAG_SCENE_TEMP(0x12)
#defineFLAG_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.
#defineFLAG_POUND_STAGE_WEEDS_BLOWN_AWAY FLAG_AREA_TEMP(0x39)
#defineFLAG_SAND_STAGE_WEEDS_BLOWN_AWAY FLAG_AREA_TEMP(0x74)
#defineFLAG_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.
#defineFLAG_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.
#defineFLAG_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.
#defineFLAG_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.
#defineFLAG_WEST_CRUMBLING_PILLAR_CRUMBLED FLAG_AREA_TEMP(0x43)
#defineFLAG_EAST_CRUMBLING_PILLAR_STEPPED_ON FLAG_AREA_TEMP(0x44)
#defineFLAG_EAST_CRUMBLING_PILLAR_CRUMBLED FLAG_AREA_TEMP(0x45)
#defineFLAG_PARTY_FIRST_AT_PEAK FLAG_AREA_TEMP(0x85)Set once Felix climbs to the summit ahead of Moapa.
#defineFLAG_STAGE_ORDER_DEALT FLAG_AREA_TEMP(0x80)Set once the stages' order has been dealt from the leader's name.
#defineACTOR_KRADEN (ACTOR_MOAPA + 1)Kraden, at the summit (TrialRoadSummitPlacements), after Moapa.
#defineACTOR_PEAK_PILLAR (ACTOR_KRADEN + 1)The pillar at the summit (TrialRoadSummitPlacements), after Kraden.
#defineENTRANCE_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.
#defineFLAG_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.
#defineFLAG_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.
#defineFLAG_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.
#defineFLAG_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.
#definePUSH_BLOCKED (object) *(Uint8 *)&object->sceneCountA piece Felix cannot push: a pillar weeds hold down, a frozen puddle, a stake, or a log (logs roll by their own scripts).
#definePILLAR_TOP_HEIGHT (top) *(Uint8 *)&top->sceneByteThe height in pixels of a pillar's top (scTrialRoadAddPillarTop) above the pillar: PILLAR_HEIGHT standing, -PILLAR_HEIGHT lowered.
#defineFOUNTAIN_PERIOD 240A fountain rises and falls once each FOUNTAIN_PERIOD ticks, rising at FOUNTAIN_RISE_AT and falling at FOUNTAIN_FALL_AT.
#defineFOUNTAIN_RISE_AT 120
#defineFOUNTAIN_FALL_AT 150
#definePILLAR_HEIGHT 16How far a pillar's top stands above it; once the pillar is lowered, its top is as far below it.
#defineRIVAL_PATH_LENGTH 7200The halfwords of the rival's recorded path: x, z pairs, the last pair 0, 0.
#defineRACE_MAP_PICTURE_BYTES (RACE_MAP_TILE_COUNT * TILE_SIZE_4BPP)The bytes of the race map's tiles.
#defineRACE_MAP_PALETTE 14The sprite palette the race map loads and draws with.
#defineRACE_MAP_STAGE_SPACING 36The pixels between one stage's picture and the next, down the display.
#defineSUMMIT_PURPLE_PALETTE 5The background palette of the summit's purples, and its colours as the cycle loads them (scTrialRoadStartPaletteCycle).
#defineDEFINE_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.
#defineDEFINE_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.
#defineEFFECT_SET_MODE fdActorSelectAnimation
#defineEFFECT_SET_SCRIPT fdActorStartScript
#defineDEFINE_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.
#defineFOUNTAIN_COUNT 16The fountains the fountain stage's state has room for.
#defineFOUNTAIN_SPRITE_COUNT 80The sprites the fountains' columns may queue in a tick.
#defineFOUNTAIN_DEPTH_OFFSET 58A 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.
#defineTRIAL_ROAD_FOUNTAINSThe fountain stage's fountains, kept in the inventory snapshot's spare bytes.
#defineNORTH_FOUNTAIN_HEIGHT 64How far the fountain stage's northern three fountains rise, and its southern two.
#defineSOUTH_FOUNTAIN_HEIGHT 32
#defineRIVAL_CHESTS_RECORDINGS 8Where Moapa's runs at the blue chests start in TrialRoadRivalRecordings, after the eight stages'.
#defineSET_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.
#defineDEAL_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.
#defineCHARGE_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.
#defineFOUNTAIN_TILES_BYTES 2048The bytes of the fountains' tiles (FieldGeyserTiles), once decompressed.
#defineDUST_RING_PIECES 17The clouds of dust scMagmaRockInsideSpawnDustRing throws out in a ring.
#defineRIVAL_MAX_TURN (TRIG_TURN / 16)The most the rival turns in a tick: a sixteenth of a turn.
#defineMARKER (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

NameDescription
enumTRIAL_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.
enumTRIAL_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.
enumTRIAL_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.
enumTRIAL_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.
enumTRIAL_ROAD_CRUMBLING_STAGE_ACTOR_ID { ACTOR_WEST_CRUMBLING_PILLAR, ACTOR_EAST_CRUMBLING_PILLAR }The crumbling stage's two pillars (TrialRoadCrumblingStagePlacements).
enumTRIAL_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.
enumTRIAL_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.
enumanonymous 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.
enumanonymous enum { ACTOR_POUND_STAGE_WEEDS }The weeds on pillar B in the Pound stage, after its four stakes.
enumanonymous enum { ACTOR_SAND_STAGE_WEEDS }The weeds on the sand stage's cliff, after its two tightrope posts.
enumanonymous enum { ACTOR_GASP }Gasp, alone in his room (TrialRoadGaspPlacements).
enumanonymous enum { ACTOR_CAVE_ROCK }The round boulder on the ledge of the cave beyond the summit, which Lift raises (TrialRoadCavePlacements).
enumanonymous 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.
enumanonymous enum { TRIAL_ROAD_CAVE_WEST_CAVE_FROM_EAST_PASSAGE, TRIAL_ROAD_CAVE … }The entrances, one for each way above.
enumTRIAL_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.
enumTRIAL_ROAD_ENTRANCE { TRIAL_ROAD_STAGE_FOOT_LEFT, TRIAL_ROAD_STAGE_FOOT_RIGHT, TRI … }The stage room's entrances.
enumanonymous enum { ACTOR_WEST_POST, ACTOR_EAST_POST }The sand stage's two tightrope posts (TrialRoadSandStagePlacements).
enumTRIAL_ROAD_RIVAL_ACTIVITY { RIVAL_REPLAY, RIVAL_RECORD, RIVAL_LINKED, RIVAL_MIRROR, RIVA … }What the rival does each tick (scTrialRoadMoveRival).
enumTRIAL_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".
enumanonymous 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.
enumanonymous 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.
enumanonymous 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

NameDescription
voidscTrialRoadFightGasp (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.
Sint32scTrialRoadSettleOnGround (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.
Sint32scTrialRoadRivalIsAhead (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.
BoolscTrialRoadOfferToGiveUp (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?".
voidscTrialRoadTakeStairs (Sint32 direction)Walking down the stairs at the foot of a stage, or through the open door at its top.
Sint32scTrialRoadIsMirrored (void)Whether the leader took the right path, on which the road is mirrored.
voidscTrialRoadSetJumpMetatileUnder (Sint32 id)Lets Felix jump onto the top of the pillar standing at the actor's metatile (MAP_METATILE_JUMP).
voidscTrialRoadClearJumpMetatileUnder (Sint32 id)Stops Felix jumping onto the metatile the actor is leaving.
voidscTrialRoadAddPillarTop (Sint32 id)Puts an invisible top on the pillar for Felix to stand on.
voidscTrialRoadSetPillarTopLift (Sint32 id, Sint32 value)Sets how many pixels above the pillar its top stands.
voidscTrialRoadOpenVentMetatile (Sint32 id)Lets Felix walk into the vent where the actor stands, now that it is dug out.
voidscTrialRoadCheckLeaderOnPillars (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).
voidscTrialRoadCheckStakesCovered (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).
voidscTrialRoadPoundStake (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.
voidscTrialRoadStepOntoStake (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.
voidscTrialRoadPushLog (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.
voidscTrialRoadUncoverVent (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.
voidscLeaderCheckCrumblingStep (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.
voidscTrialRoadCrumblePillar (const void *data, Sint32 id)A cracked pillar in the crumbling stage shakes, crumbles and falls away, as Magma Rock's do.
voidscTrialRoadClearGiveUpAsked (void)Stepping off the give-up button lets it ask again next time Felix steps on it.
voidscTrialRoadBlowAwayPillarStageWeeds (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.
voidscTrialRoadJumpAcrossGap (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.
voidscTrialRoadJumpMeltedPuddle (void)Walking north or south into a melted puddle in the torch stage jumps Felix across it; a frozen one stops him.
voidscTrialRoadStepOntoWestStake (void)Stepping onto the west stake sinks it and raises the inner west one.
voidscTrialRoadStepOntoInnerWestStake (void)Stepping onto the inner west stake sinks it and raises the west one.
voidscTrialRoadStepOntoInnerEastStake (void)Stepping onto the inner east stake sinks it and raises the east one.
voidscTrialRoadStepOntoEastStake (void)Stepping onto the east stake sinks it and raises the inner east one.
voidscTrialRoadLandOnPillar (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.
voidscTrialRoadCheckCrumblingPillars (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.
voidscTrialRoadPushUpperLogWest (void)Walking west into the upper log rolls it west.
voidscTrialRoadPushUpperLogEast (void)Walking east into the upper log rolls it east.
voidscTrialRoadPushLowerLogWest (void)Walking west into the lower log rolls it west.
voidscTrialRoadPushLowerLogEast (void)Walking east into the lower log rolls it east.
voidscTrialRoadPushEastLogNorth (void)Walking north into the east log rolls it north.
voidscTrialRoadPushEastLogSouth (void)Walking south into the east log rolls it south.
voidscTrialRoadPushEastLogSouthOrClimbDown (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.
voidscTrialRoadStartSand (void)Sand at the sand stage lets Felix, sunk into the ground, go up the stream that would otherwise carry him back.
voidscTrialRoadEndSand (void)When Felix rises out of the sand at the sand stage, he walks on the ground level again.
voidscTrialRoadBlowAwaySandStageWeeds (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.
voidscTrialRoadDriftWithStream (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.
voidscTrialRoadLiftCaveRock (void)Lift on the rock in the cave beyond the summit raises it out of the way to Gasp's pool.
voidscTrialRoadScatterWeeds (void)Cyclone on the clumps of weeds around Gasp's pool scatters the ones it touches.
voidscTrialRoadScatterWeedsHidingMadPlant (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.
voidscTrialRoadRevealPoolTiles (void)Reveal anywhere in Gasp's pool room shows the hidden tiles in the pools, at metatiles (10, 11), (18, 7) and (18, 15).
voidscTrialRoadHidePoolTiles (void)When Reveal wears off in Gasp's pool room, the tiles in the pools are hidden again.
voidscTrialRoadChallengeMoapa (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.
voidscTrialRoadIdle (void)Does nothing.
voidscTrialRoadReachPeakFirst (void)The party gathers at the summit first, and Moapa and his knights arrive after them: "You were quite swift!
voidscTrialRoadReachPeakSecond (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".
voidscTrialRoadLowerStake (Sint32 id)Sinks a stake into the ground, so that Felix walks over it.
voidscTrialRoadRaiseStake (Sint32 id)Raises a stake out of the ground, solid, its top 16 pixels up.
voidscTrialRoadBlockLogs (void)Makes the three logs solid where they lie, and lets Felix jump east across a log that has fallen into the water.
voidscTrialRoadStartFountains (Sint32 unused, Sint32 shape)Starts the fountains' state and their event.
voidscTrialRoadStepPaletteCycle (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.
voidscTrialRoadShutSummitDoorway (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.
voidscTrialRoadPlaceMoapaAtPeak (void)Places Moapa and his two knights at the summit, waiting for the party.
voidscTrialRoadBeatMoapa (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.
voidscTrialRoadLoseToMoapa (void)After the party loses to Moapa at the summit: "You've lost.
voidscTrialRoadShowTraps (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.
voidscTrialRoadSetUpCave (void)The cave beyond the summit needs no setting up.
voidscTrialRoadSetUpPoolRoom (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).
Sint32scTrialRoadRivalIsWaiting (void)Whether Moapa's party is waiting.
voidscTrialRoadPlayRivalRecording (Sint32 resource)Plays Moapa's recording from the given resource.
voidscTrialRoadDealStageOrder (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.
voidscTrialRoadShowRaceMap (Sint32 leaderId, Sint32 rivalId)Shows the race map for both sides.
voidscTrialRoadOpenLeaderDoor (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.
voidscDustScatter (Sint32 spread)Eight clouds of dust puff up in a row across the leader's feet; with spread set they fly out all round.
voidfdLeaderSetMetatileShapeAt (Sint32 offset, Sint32 layer)Sets the shape of the metatile under the leader level steps above its ground.
voidscMagmaRockInsideSpawnDustRing (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.
voidfdActorSetMetatileShape (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.
voidscTrialRoadDriftDust (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.
voidscTrialRoadMoveRival (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.
voidscTrialRoadSetUpPillarStage (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.
voidscTrialRoadSetUpTorchStage (void)Readies the torch stage: its pillars of ice cannot be pushed, and those already melted stay puddles.
voidscTrialRoadSetUpWeedsPillarStage (void)Readies the weeds stage: its two overgrown pillars cannot be pushed until Whirlwind blows their weeds off.
voidscTrialRoadSetUpPoundStage (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.
voidscTrialRoadSetUpCrumblingStage (void)Readies the crumbling stage: the cracked pillars already crumbled stay gone.
voidscTrialRoadSetUpLogStage (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.
voidscTrialRoadSetUpFountainStage (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.
voidscTrialRoadSetUpSandStage (void)Readies the sand stage: its tightrope between two posts, and the vine on the cliff, climbable once Whirlwind has blown its weeds away.
voidscTrialRoadUpdateFountains (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.
voidscTrialRoadOpenChests (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").
voidscTrialRoadPutItemInChest (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.").
voidscTrialRoadExamineChest (Sint32 id)Searching a blue chest before the switch has opened it says "The chest won't open.
voidscTrialRoadStepOffSwitch (void)Walking around the switch once the chests have opened does nothing.
Sint32scTrialRoadFollowPillar (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.
voidscTrialRoadJumpForward (void)Walking off the edge of a ledge or pillar top toward another one jumps Felix across, when there is somewhere to land.
voidscTrialRoadClearJumpUnderTorchStagePillar (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.
voidscTrialRoadMeltIceBesideTorch (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).
voidscTrialRoadFreezePuddle (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.
voidscTrialRoadBlowAwayWeeds (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.
voidscTrialRoadBlowAwayPoundStageWeeds (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.
voidscTrialRoadPoundWestStake (Sint32 phase, Sint32 frame)Pound on the west stake, metatile (13, 26), drives it down and raises the inner west stake.
voidscTrialRoadPoundInnerWestStake (Sint32 phase, Sint32 frame)Pound on the inner west stake, metatile (15, 26), drives it down and raises the west stake.
voidscTrialRoadPoundInnerEastStake (Sint32 phase, Sint32 frame)Pound on the inner east stake, metatile (17, 26), drives it down and raises the east stake.
voidscTrialRoadPoundEastStake (Sint32 phase, Sint32 frame)Pound on the east stake, metatile (19, 26), drives it down and raises the inner east stake.
voidscTrialRoadCrumbleWestPillar (Sint32 stage)Burst on the crumbling stage's west cracked pillar crumbles it away.
voidscTrialRoadCrumbleEastPillar (Sint32 stage)Burst on the crumbling stage's east cracked pillar crumbles it away.
voidscTrialRoadBlockLogMetatiles (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).
Sint32scTrialRoadIsLogBlocked (Sint32 x, Sint32 z)Whether a log rolling into the metatile is stopped there by the block or a wall.
voidscTrialRoadUncoverWestVent (Sint32 phase, Sint32 frame)Scoop over the west vent digs it out.
voidscTrialRoadUncoverMiddleVent (Sint32 phase, Sint32 frame)Scoop over the middle vent digs it out.
voidscTrialRoadUncoverEastVent (Sint32 phase, Sint32 frame)Scoop over the east vent digs it out.
voidscTrialRoadStandOnBlock (void)Stepping onto the fountain stage's block from above leaves Felix standing on its top, 32 pixels up, rather than inside it.
Sint32scTrialRoadReturnTrue (void)Unused: always 1.
voidscTrialRoadSetSummitPillar (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.
voidscMagmaRockInsideRestoreCrumblingPillars (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.
voidscTrialRoadGaspFlees (void)Gasp moves opposite to Felix about the hidden tile at metatile (18, 15): whatever way Felix steps, Gasp steps the other.
voidscTrialRoadSetPaletteCycleRunning (Sint32 value)Starts or stops the summit's colour cycle.
static inline voidscPaletteCycleSetTick (Sint32 value)Sets the colour cycle's tick counter, as the Jupiter and Mars Lighthouse rooms' palette cycles, which this one copies, do.
voidscTrialRoadStartPaletteCycle (Sint32 mode)Starts the summit's colour cycle as mode says.
voidscTrialRoadLeaveMoapaWaiting (void)Felix got to the summit first, so Moapa is not placed yet; he arrives when Felix walks up (scTrialRoadReachPeakFirst).
voidscTrialRoadSetUpPeak (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.
Sint32scInit (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.
voidscTrialRoadCopyMetatilesBackward (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.
voidscTrialRoadUpdateRival (void)Each tick of the race, moves Moapa's party on by its recording, and opens his door when he reaches it.
voidscTrialRoadStartRival (Sint32 mirrored)Starts Moapa's party on its recording, mirrored when the leader went right.
Sint32scPrepareMap (void)Readies the map before the room is drawn.
Sint32scTrialRoadGetStage (Sint32 side)The stage a side of the race has reached: 0 the leader's, 1 Moapa's.
Sint32scTrialRoadMirrorX (Sint32 x)A pixel x on the mirrored road, the right path's, when the leader took it.
Sint32scTrialRoadMirrorMetatileX (Sint32 x)A metatile x, in pixels, on the mirrored road when the leader took it.
Sint32scTrialRoadMirrorOffset (Sint32 x)An x offset of so many 8-pixel steps, in pixels, turned round on the mirrored road.
Sint32scTrialRoadMirrorAngle (Sint32 angle)An angle on the mirrored road, turned round when it is.
voidscTrialRoadPlaceActor (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 voidscTrialRoadGatherAtPeak (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.
voidscTrialRoadDrawFountains (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.
voidscTrialRoadStepOnTrap (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.
voidscStringWriteU32AsHex (Uint8 *text, Uint32 value)Unused: writes value as eight hexadecimal digits (TrialRoadHexDigits) and a terminating null.
voidscTrialRoadStopRival (void)Stops Moapa's party where it stands, as at the end of its recording.
voidscTrialRoadWaitForRival (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.
voidscTrialRoadDrawRaceMap (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.
voidscTrialRoadNoOperation (void)Unused: does nothing.

Variables

NameDescription
extern ACTOR_PLACETrialRoadPlacements []
extern ACTOR_PLACETrialRoadCavePlacements []
extern ACTOR_PLACETrialRoadGaspPlacements []
extern ACTOR_PLACETrialRoadSummitPlacements []
extern Sint32TrialRoadStagesPlacements []
extern ACTOR_PLACETrialRoadPillarStagePlacements []
extern ACTOR_PLACETrialRoadTorchStagePlacements []
extern ACTOR_PLACETrialRoadWeedsPillarStagePlacements []
extern ACTOR_PLACETrialRoadPoundStagePlacements []
extern ACTOR_PLACETrialRoadCrumblingStagePlacements []
extern ACTOR_PLACETrialRoadLogStagePlacements []
extern ACTOR_PLACETrialRoadFountainStagePlacements []
extern ACTOR_PLACETrialRoadSandStagePlacements []
extern CUETrialRoadPillarStageCues []
extern CUETrialRoadTorchStageCues []
extern CUETrialRoadWeedsPillarStageCues []
extern CUETrialRoadPoundStageCues []
extern CUETrialRoadCrumblingStageCues []
extern CUETrialRoadLogStageCues []
extern CUETrialRoadFountainStageCues []
extern CUETrialRoadSandStageCues []
extern Sint16TrialRoadCrumblingPillars []
extern Uint32TrialRoadGaspHopScript []
Uint16TrialRoadPaletteCycleColors [16]
extern Uint32TrialRoadRivalRecordings []
extern Uint32TrialRoadLeftKnightEntersScript []
extern Uint32TrialRoadRightKnightEntersScript []
extern Uint32TrialRoadLeftKnightToChestScript []
extern Uint32TrialRoadRightKnightToChestsScript []
extern Uint32TrialRoadRightKnightLeavesScript []
extern const Uint16TrialRoadRaceMapPalette []The race map's colours.
extern Sint32TrialRoadPillarTopScript []
extern Sint8TrialRoadPoundPartners [4]The stake each of the pound stage's four stakes raises when it is pounded down: they go in pairs.
extern const Sint32 *FieldEffectDurationScripts []The field effects' three scripts by how long an effect lasts: short, medium and long.
extern CUETrialRoadCues []
extern CUETrialRoadCaveCues []
extern CUETrialRoadGaspCues []
extern CUETrialRoadSummitCues []
extern Sint32TrialRoadStagesCues []
extern Sint32TrialRoadPaletteCycleRunningWhether the summit's colour cycle runs.
extern Sint32TrialRoadPaletteCycleTick
extern Sint16TrialRoadStageMapMetatiles [][2]
extern Sint8TrialRoadRulesTreasureStages []
extern Sint8TrialRoadTreasureStages []
extern Sint8TrialRoadKeyStages []
extern Uint32TrialRoadLeftKnightLeavesScript []
extern Uint32DustScatterScript []It lasts 33 ticks, then stops and is gone.
extern Uint32DustBurstScript []It lasts 44 ticks, then stops and is gone.
extern Uint32TrialRoadHexDigits []
extern const Uint8TrialRoadRaceMapPicture []The race map's picture, tagged LZ.
Sint32TrialRoadSettleScript []

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.

#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.

EnumeratorValueDescription
METATILE_LEFT_PATH_STAIRS_DOWN1
METATILE_RIGHT_PATH_STAIRS_DOWN2
METATILE_LEFT_PATH_DOOR3
METATILE_RIGHT_PATH_DOOR4
METATILE_AROUND_WEST_GIVE_UP_BUTTON10
METATILE_WEST_GIVE_UP_BUTTON11
METATILE_AROUND_EAST_GIVE_UP_BUTTON20
METATILE_EAST_GIVE_UP_BUTTON21
METATILE_AROUND_WEST_SWITCH30
METATILE_WEST_SWITCH31
METATILE_AROUND_EAST_SWITCH40
METATILE_EAST_SWITCH41
METATILE_PILLAR_STAGE_GAP51The pillar stage: the south
METATILE_PILLAR_STAGE_LEDGE52edge of the upper ledge, over the gap a pillar can be pushed into, and the edge beside it.
METATILE_ICE_PILLAR_SIDE33The torch stage: north and south of each pillar of ice.
METATILE_WEEDS_STAGE_LEDGE33The weeds stage's ledge, jumped from southward.
METATILE_WEST_STAKE50The Pound stage's four stakes, and the ground the pillars stand on.
METATILE_INNER_WEST_STAKE51
METATILE_INNER_EAST_STAKE52
METATILE_EAST_STAKE53
METATILE_STAKE_GROUND60
METATILE_CRUMBLING_STAGE_LEDGE33The crumbling stage: its ledge, the metatiles beside the cracked pillars, and the pillars themselves.
METATILE_BESIDE_CRUMBLING_PILLAR34
METATILE_WEST_CRUMBLING_PILLAR50
METATILE_EAST_CRUMBLING_PILLAR51
METATILE_LOG_STAGE_LEDGE33The 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_ROWS50
METATILE_LOWER_LOG_ROWS51
METATILE_EAST_LOG_NORTH_END52
METATILE_EAST_LOG_SOUTH_END53
METATILE_BLOCK_TRACK33The fountain stage: the column the block can stand in, and the three buried vents.
METATILE_WEST_VENT50
METATILE_MIDDLE_VENT51
METATILE_EAST_VENT52
METATILE_STREAM50The sand stage's stream.
METATILE_WEEDS33Gasp's pool: the weeds, and the
METATILE_WEEDS_HIDING_MAD_PLANT34clump hiding the Mad Plant.
METATILE_SUMMIT_DOORWAY33The summit: in front of each doorway from the stages, and the metatiles that bring on Moapa.
METATILE_LEFT_PATH_SUMMIT40
METATILE_RIGHT_PATH_SUMMIT41

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.

EnumeratorValueDescription
ACTOR_MOAPAACTOR_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.

EnumeratorValueDescription
ACTOR_UPPER_LOGACTOR_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.

EnumeratorValueDescription
ACTOR_WEST_STAKEACTOR_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).

EnumeratorValueDescription
ACTOR_WEST_CRUMBLING_PILLARACTOR_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.

EnumeratorValueDescription
ACTOR_PILLAR_AACTOR_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.

EnumeratorValueDescription
ACTOR_WEST_TORCHACTOR_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.

EnumeratorValueDescription
ACTOR_WEEDS_AACTOR_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.

EnumeratorValueDescription
ACTOR_POUND_STAGE_WEEDSACTOR_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.

EnumeratorValueDescription
ACTOR_SAND_STAGE_WEEDSACTOR_FIRST_STAGE_PIECE + 2

Definition at line 243 of file trial_road.c.

anonymous enum

enum { ACTOR_GASP }

Gasp, alone in his room (TrialRoadGaspPlacements).

EnumeratorValueDescription
ACTOR_GASPACTOR_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).

EnumeratorValueDescription
ACTOR_CAVE_ROCKACTOR_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.

EnumeratorValueDescription
TRIAL_ROAD_CAVE_TO_EAST_PASSAGE1
TRIAL_ROAD_CAVE_TO_WEST_CAVE2

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.

EnumeratorValueDescription
TRIAL_ROAD_CAVE_WEST_CAVE_FROM_EAST_PASSAGE1
TRIAL_ROAD_CAVE_EAST_PASSAGE_FROM_WEST_CAVE2

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.

EnumeratorValueDescription
ACTOR_WEST_VENTACTOR_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.

EnumeratorValueDescription
TRIAL_ROAD_STAGE_FOOT_LEFT1
TRIAL_ROAD_STAGE_FOOT_RIGHT2
TRIAL_ROAD_STAGE_TOP_LEFT3
TRIAL_ROAD_STAGE_TOP_RIGHT4
TRIAL_ROAD_SUMMIT_AFTER_WIN4
TRIAL_ROAD_SUMMIT_AFTER_DEFEAT5
TRIAL_ROAD_RULES_COURSE55

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).

EnumeratorValueDescription
ACTOR_WEST_POSTACTOR_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).

EnumeratorValueDescription
RIVAL_REPLAY1walks the recorded path
RIVAL_RECORD2records the actor's path
RIVAL_LINKED3Unused: stands where the linked player's record puts it
RIVAL_MIRROR4follows the leader mirrored across the course
RIVAL_WAITING9the 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".

EnumeratorValueDescription
RACE_MAP_TILE_STAGE0
RACE_MAP_TILE_STAGE_FOOT8
RACE_MAP_TILE_1P10
RACE_MAP_TILE_2P14
RACE_MAP_TILE_COUNT18

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.

EnumeratorValueDescription
LOG_LIES_NORTH_SOUTH0
LOG_LIES_EAST_WEST1

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.

EnumeratorValueDescription
PALETTE_CYCLE_LOAD0
PALETTE_CYCLE_LOAD_AND_RUN1
PALETTE_CYCLE_KEEP_COLORS2

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.

EnumeratorValueDescription
RIVAL_ONE_CHEST_OPEN1
RIVAL_ONE_CHEST_CLOSE50
RIVAL_ONE_CHEST_DOOR70
RIVAL_TWO_CHESTS_OPEN601
RIVAL_TWO_CHESTS_TURN653
RIVAL_TWO_CHESTS_OUTER_CLOSE655
RIVAL_TWO_CHESTS_TURN_AGAIN708
RIVAL_TWO_CHESTS_INNER_CLOSE710
RIVAL_TWO_CHESTS_DOOR730

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.

On this page

StructuresMacrosEnumerationsFunctionsVariablesDescriptionMacros in detailMAD_PLANT_TRIAL_ROADFLAG_TRIAL_ROAD_PEAK_PILLAR_PLACEDFLAG_LEADER_ON_PILLARSFLAG_GIVE_UP_ASKEDFLAG_STAGE_DOOR_OPENFLAG_STAGE_CHESTS_OPENEDFLAG_INNER_CHEST_OPENFLAG_OUTER_CHEST_OPENFLAG_SUMMIT_DOORWAY_SHUTFLAG_CAVE_ROCK_LIFTEDFLAG_GASP_FLEDFLAG_LINK_PLAYERFLAG_LINKED_RIVAL_HALTSFLAG_LINKED_RIVAL_ON_FAR_SIDEFLAG_PILLAR_STAGE_WEEDS_BLOWN_AWAYFLAG_POUND_STAGE_WEEDS_BLOWN_AWAYFLAG_SAND_STAGE_WEEDS_BLOWN_AWAYFLAG_INNER_WEST_STAKE_RAISEDFLAG_EAST_STAKE_RAISEDFLAG_RIVAL_FIRST_AT_DOOR_BASEFLAG_WEST_CRUMBLING_PILLAR_STEPPED_ONFLAG_WEST_CRUMBLING_PILLAR_CRUMBLEDFLAG_EAST_CRUMBLING_PILLAR_STEPPED_ONFLAG_EAST_CRUMBLING_PILLAR_CRUMBLEDFLAG_PARTY_FIRST_AT_PEAKFLAG_STAGE_ORDER_DEALTACTOR_KRADENACTOR_PEAK_PILLARENTRANCE_IS_LEFT_PATHFLAG_PUDDLE_MELTED_BASEFLAG_WEEDS_BLOWN_AWAY_BASEFLAG_LOG_IN_WATER_BASEFLAG_VENT_UNCOVERED_BASEPUSH_BLOCKEDPILLAR_TOP_HEIGHTFOUNTAIN_PERIODFOUNTAIN_RISE_ATFOUNTAIN_FALL_ATPILLAR_HEIGHTRIVAL_PATH_LENGTHRACE_MAP_PICTURE_BYTESRACE_MAP_PALETTERACE_MAP_STAGE_SPACINGSUMMIT_PURPLE_PALETTEDEFINE_TRIAL_ROAD_OPEN_DOORDEFINE_TRIAL_ROAD_ON_FOOTEFFECT_SET_MODEEFFECT_SET_SCRIPTDEFINE_TRIAL_ROAD_SET_POOL_TILESFOUNTAIN_COUNTFOUNTAIN_SPRITE_COUNTFOUNTAIN_DEPTH_OFFSETTRIAL_ROAD_FOUNTAINSNORTH_FOUNTAIN_HEIGHTSOUTH_FOUNTAIN_HEIGHTRIVAL_CHESTS_RECORDINGSSET_LAYERDEAL_STAGE_ORDERCHARGE_AT_MOAPAFOUNTAIN_TILES_BYTESDUST_RING_PIECESRIVAL_MAX_TURNMARKEREnumerations in detailTRIAL_ROAD_METATILETRIAL_ROAD_STAGE_ACTOR_IDTRIAL_ROAD_LOG_STAGE_ACTOR_IDTRIAL_ROAD_POUND_STAGE_ACTOR_IDTRIAL_ROAD_CRUMBLING_STAGE_ACTOR_IDTRIAL_ROAD_PILLAR_ACTOR_IDTRIAL_ROAD_TORCH_STAGE_ACTOR_IDanonymous enumanonymous enumanonymous enumanonymous enumanonymous enumanonymous enumanonymous enumTRIAL_ROAD_FOUNTAIN_STAGE_ACTOR_IDTRIAL_ROAD_ENTRANCEanonymous enumTRIAL_ROAD_RIVAL_ACTIVITYTRIAL_ROAD_RACE_MAP_TILEanonymous enumanonymous enumanonymous enumFunctions in detailscTrialRoadFightGaspscGetEntrancesscGetExitRegionsscGetExitsscTrialRoadSettleOnGroundscGetActorPlacementsscTrialRoadRivalIsAheadscTrialRoadOfferToGiveUpscTrialRoadTakeStairsscTrialRoadIsMirroredscTrialRoadSetJumpMetatileUnderscTrialRoadClearJumpMetatileUnderscTrialRoadAddPillarTopscTrialRoadSetPillarTopLiftscTrialRoadOpenVentMetatilescTrialRoadCheckLeaderOnPillarsscTrialRoadCheckStakesCoveredscTrialRoadPoundStakescTrialRoadStepOntoStakescTrialRoadPushLogscTrialRoadUncoverVentscTrialRoadCrumblePillarscTrialRoadClearGiveUpAskedscTrialRoadBlowAwayPillarStageWeedsscTrialRoadJumpAcrossGapscTrialRoadJumpMeltedPuddlescTrialRoadStepOntoWestStakescTrialRoadStepOntoInnerWestStakescTrialRoadStepOntoInnerEastStakescTrialRoadStepOntoEastStakescTrialRoadLandOnPillarscTrialRoadCheckCrumblingPillarsscTrialRoadPushUpperLogWestscTrialRoadPushUpperLogEastscTrialRoadPushLowerLogWestscTrialRoadPushLowerLogEastscTrialRoadPushEastLogNorthscTrialRoadPushEastLogSouthscTrialRoadPushEastLogSouthOrClimbDownscTrialRoadStartSandscTrialRoadEndSandscTrialRoadBlowAwaySandStageWeedsscTrialRoadDriftWithStreamscTrialRoadLiftCaveRockscTrialRoadScatterWeedsscTrialRoadScatterWeedsHidingMadPlantscTrialRoadRevealPoolTilesscTrialRoadHidePoolTilesscTrialRoadChallengeMoapascTrialRoadIdlescTrialRoadReachPeakFirstscTrialRoadReachPeakSecondscTrialRoadLowerStakescTrialRoadRaiseStakescTrialRoadBlockLogsscTrialRoadStartFountainsscTrialRoadStepPaletteCyclescTrialRoadShutSummitDoorwayscTrialRoadPlaceMoapaAtPeakscTrialRoadBeatMoapascTrialRoadLoseToMoapascTrialRoadShowTrapsscTrialRoadSetUpCavescTrialRoadSetUpPoolRoomscTrialRoadRivalIsWaitingscTrialRoadPlayRivalRecordingscTrialRoadDealStageOrderscTrialRoadShowRaceMapscTrialRoadOpenLeaderDoorscDustScatterscMagmaRockInsideSpawnDustRingscTrialRoadDriftDustscTrialRoadMoveRivalscTrialRoadSetUpPillarStagescTrialRoadSetUpTorchStagescTrialRoadSetUpWeedsPillarStagescTrialRoadSetUpPoundStagescTrialRoadSetUpCrumblingStagescTrialRoadSetUpLogStagescTrialRoadSetUpFountainStagescTrialRoadSetUpSandStagescTrialRoadUpdateFountainsscTrialRoadOpenRivalDoorscTrialRoadOpenChestsscTrialRoadPutItemInChestscTrialRoadExamineChestscTrialRoadStepOffSwitchscTrialRoadFollowPillarTrialRoadClearJumpUnderPushedPillarTrialRoadSetJumpUnderPushedPillarscTrialRoadJumpForwardscTrialRoadClearJumpUnderTorchStagePillarscTrialRoadMeltIceBesideTorchscTrialRoadFreezePuddlescTrialRoadBlowAwayWeedsscTrialRoadBlowAwayPoundStageWeedsscTrialRoadPoundWestStakescTrialRoadPoundInnerWestStakescTrialRoadPoundInnerEastStakescTrialRoadPoundEastStakescTrialRoadCrumbleWestPillarscTrialRoadCrumbleEastPillarscTrialRoadBlockLogMetatilesscTrialRoadIsLogBlockedscTrialRoadUncoverWestVentscTrialRoadUncoverMiddleVentscTrialRoadUncoverEastVentscTrialRoadStandOnBlockscTrialRoadReturnTruescTrialRoadSetSummitPillarscGetCuesscTrialRoadAddFountainscTrialRoadGaspFleesscTrialRoadSetPaletteCycleRunningscPaletteCycleSetTickscTrialRoadStartPaletteCyclescTrialRoadLeaveMoapaWaitingscTrialRoadSetUpPeakTrialRoadStageSetUpsscInitscTrialRoadCopyMetatilesBackwardscTrialRoadUpdateRivalscTrialRoadStartRivalscPrepareMapscTrialRoadGetStagescTrialRoadMirrorXscTrialRoadMirrorMetatileXscTrialRoadMirrorOffsetscTrialRoadMirrorAnglescTrialRoadPlaceActorscTrialRoadGatherAtPeakscTrialRoadDrawFountainsscTrialRoadAllocateTileBufferscTrialRoadStepOnTrapscStringWriteU32AsHexscTrialRoadStopRivalscTrialRoadWaitForRivalscTrialRoadLinkAllocatePicturescTrialRoadDrawRaceMapscTrialRoadNoOperationVariables in detailTrialRoadPlacementsTrialRoadCavePlacementsTrialRoadGaspPlacementsTrialRoadSummitPlacementsTrialRoadStagesPlacementsTrialRoadPillarStagePlacementsTrialRoadTorchStagePlacementsTrialRoadWeedsPillarStagePlacementsTrialRoadPoundStagePlacementsTrialRoadCrumblingStagePlacementsTrialRoadLogStagePlacementsTrialRoadFountainStagePlacementsTrialRoadSandStagePlacementsTrialRoadPillarStageCuesTrialRoadTorchStageCuesTrialRoadWeedsPillarStageCuesTrialRoadPoundStageCuesTrialRoadCrumblingStageCuesTrialRoadLogStageCuesTrialRoadFountainStageCuesTrialRoadSandStageCuesTrialRoadCrumblingPillarsTrialRoadGaspHopScriptTrialRoadPaletteCycleColorsTrialRoadRivalRecordingsTrialRoadLeftKnightEntersScriptTrialRoadRightKnightEntersScriptTrialRoadLeftKnightToChestScriptTrialRoadRightKnightToChestsScriptTrialRoadRightKnightLeavesScriptTrialRoadRaceMapPaletteTrialRoadPillarTopScriptTrialRoadPoundPartnersTrialRoadCuesTrialRoadCaveCuesTrialRoadGaspCuesTrialRoadSummitCuesTrialRoadStagesCuesTrialRoadPaletteCycleRunningTrialRoadPaletteCycleTickTrialRoadStageMapMetatilesTrialRoadRulesTreasureStagesTrialRoadTreasureStagesTrialRoadKeyStagesTrialRoadLeftKnightLeavesScriptTrialRoadHexDigitsTrialRoadRaceMapPictureTrialRoadSettleScript