Skip to Content
The Alchemy Project

src/scene/tree_rooms.c

Tret Tree's rooms (SceneIdTreeRooms): the hollow inside of Tret, the holy tree of Kolima Forest, where the party come to face his wrathful side. More…

Macros

NameDescription
#defineTREE_ROOMS_SPEAKER (actorId) (SPEAKER_WINDOW_BELOW | (actorId))The speaker of a message.
#defineLEAF_FALL_SPIN_TICKS 30How long Isaac spins as he drops through a broken leaf.
#defineSWIRL_SPARK_LAST_TICK 79A spark Tret sends out spirals away from his face for 80 ticks, shrinking over the first 40.
#defineSWIRL_SPARK_SHRINK_LAST_TICK 39
#defineTRET_TINT_COLOR_COUNT (4 * PALETTE_COLORS - 1)The light's slow swell inside Tret (scTretPaletteUpdateMapTint) covers background palettes 1 to 4 but palette 4's last colour.
#defineTRET_TINT_CHANNEL_MAX 31
#defineTRET_TINT_END 99The red step that ends TreeRoomsTintSteps, where the swell starts over.
#defineFALL_ENTRANCE_STEPThe fall from the fifth floor's centre leaf goes down a floor at a time through entrances ten apart: TREE_ROOMS_FROM_FIFTH_FLOOR_CENTER_LEAF on the fourth floor, then TREE_ROOMS_FALL_THROUGH_A to _C, then TREE_ROOMS_FALL_LANDING in Tret's room.
#defineFLAG_TRET_TREE_SECOND_FLOOR_LEAF_A_TORN FLAG_SCENE_TEMP(0x00)Second floor, the west of the pair in the north of the web, metatile (49, 6).
#defineFLAG_TRET_TREE_SECOND_FLOOR_LEAF_B_TORN FLAG_SCENE_TEMP(0x01)Second floor, the east of the pair in the north, metatile (51, 6); starts torn.
#defineFLAG_TRET_TREE_SECOND_FLOOR_LEAF_C_TORN FLAG_SCENE_TEMP(0x02)Second floor, the upper of the two down the west side, metatile (46, 8).
#defineFLAG_TRET_TREE_SECOND_FLOOR_LEAF_D_TORN FLAG_SCENE_TEMP(0x03)Second floor, the lower of the two down the west side, metatile (46, 10).
#defineFLAG_TRET_TREE_SECOND_FLOOR_LEAF_E_TORN FLAG_SCENE_TEMP(0x04)Second floor, the west of the pair in the middle, metatile (47, 12).
#defineFLAG_TRET_TREE_SECOND_FLOOR_LEAF_F_TORN FLAG_SCENE_TEMP(0x05)Second floor, the east of the pair in the middle, metatile (49, 12).
#defineFLAG_TRET_TREE_SECOND_FLOOR_LEAF_G_TORN FLAG_SCENE_TEMP(0x06)Second floor, the west of the row along the south, metatile (48, 14).
#defineFLAG_TRET_TREE_SECOND_FLOOR_LEAF_H_TORN FLAG_SCENE_TEMP(0x07)Second floor, the middle of the row along the south, metatile (50, 14).
#defineFLAG_TRET_TREE_SECOND_FLOOR_LEAF_I_TORN FLAG_SCENE_TEMP(0x08)Second floor, the east of the row along the south, metatile (52, 14).
#defineFLAG_TRET_TREE_THIRD_FLOOR_WEST_LEAF_TORN FLAG_SCENE_TEMP(0x09)Third floor, the leaf on the west web, metatile (7, 23).
#defineFLAG_TRET_TREE_THIRD_FLOOR_EAST_LEAF_TORN FLAG_SCENE_TEMP(0x0a)Third floor, the leaf on the east web, metatile (13, 24).
#defineFLAG_TRET_TREE_FIFTH_FLOOR_CENTER_LEAF_TORN FLAG_SCENE_TEMP(0x0b)Fifth floor, the centre leaf, the way down to Tret, metatile (50, 26).
#defineFLAG_TRET_TREE_FIFTH_FLOOR_NORTHWEST_LEAF_TORN FLAG_SCENE_TEMP(0x0c)Fifth floor, metatile (48, 24).
#defineFLAG_TRET_TREE_FIFTH_FLOOR_NORTH_LEAF_TORN FLAG_SCENE_TEMP(0x0d)Fifth floor, metatile (50, 24); starts torn.
#defineFLAG_TRET_TREE_FIFTH_FLOOR_NORTHEAST_LEAF_TORN FLAG_SCENE_TEMP(0x0e)Fifth floor, metatile (52, 24).
#defineFLAG_TRET_TREE_FIFTH_FLOOR_WEST_LEAF_TORN FLAG_SCENE_TEMP(0x0f)Fifth floor, metatile (48, 26); starts torn.
#defineFLAG_TRET_TREE_FIFTH_FLOOR_EAST_LEAF_TORN FLAG_SCENE_TEMP(0x10)Fifth floor, metatile (52, 26).
#defineFLAG_TRET_TREE_FIFTH_FLOOR_SOUTHWEST_LEAF_TORN FLAG_SCENE_TEMP(0x11)Fifth floor, metatile (48, 28).
#defineFLAG_TRET_TREE_FIFTH_FLOOR_SOUTH_LEAF_TORN FLAG_SCENE_TEMP(0x12)Fifth floor, metatile (50, 28).
#defineFLAG_TRET_TREE_FIFTH_FLOOR_SOUTHEAST_LEAF_TORN FLAG_SCENE_TEMP(0x13)Fifth floor, metatile (52, 28); starts torn.
#defineFLAG_TRET_TREE_FIFTH_FLOOR_FAR_SOUTHEAST_LEAF_TORN FLAG_SCENE_TEMP(0x14)Fifth floor, the east end of the south row, metatile (54, 28).

Enumerations

NameDescription
enumanonymous enum { MAP_PATCH_FLAG, MAP_PATCH_REDRAWN, MAP_PATCH_SOURCE_X, MAP_P … }The columns of a row of TreeRoomsMapPatches, six halfwords, whose rows run on until a flag of -1.
enumanonymous enum { ACTOR_TRET, ACTOR_SECOND_TRET }Tret's face in the north wall of his room (SPRITE_TRET), the first actor placed after the party, and a second Tret actor (SPRITE_TRET_GENTLE) placed at the same spot.
enumTREE_ROOMS_METATILE_BEHAVIOR { METATILE_BEHAVIOR_TREE_ROOMS_BEFORE_TRET, METATILE_BEHAVIOR_ … }The metatiles Tret Tree's examine and step cues answer besides the doors, the vines and the leaves.
enumTREE_ROOMS_FACE_CHANGE { TRET_FACE_CHANGE_CLOSE_EYES, TRET_FACE_CHANGE_OPEN_EYES, TRE … }The face changes scTreeRoomsChangeFace plays on Tret.

Functions

NameDescription
static voidscTretPaletteSaveMapColors (void)Saves background palettes 0 to 13, the rooms' own colours, which the light's slow swell inside Tret brightens (scTretPaletteUpdateMapTint).
static voidscTretPaletteUpdateMapTint (void)The light inside Tret Tree slowly swells and fades: over a few seconds the walls and floors grow a little brighter and warmer, then sink back, again and again.
static voidscTreeRoomsChangeFace (Sint32 change)Changes Tret's face in the north wall of his room (opening or closing his eyes, blinking, looking aside), six ticks to a picture, and waits twelve ticks after it.
static voidscTreeRoomsSpawnSwirlSparks (void)Sends out the sparks from Tret's face as he tries to free the people of Kolima: five waves, ten ticks apart, of six, five, four, three and two sparks, each wave with a shimmering sound.
static voidscTreeRoomsApplyFlaggedMapPatches (void)Tears again each leaf that was torn before a battle, so that the webs look as the party left them.
static voidscTreeRoomsLandFromFall (void)Isaac lands in Tret's room at the end of the fall from the fifth floor's centre leaf: he drops into the middle of the room, south of Tret's face, and hits the floor with a thump in a ring of white dust as the screen shakes, staggering back in surprise.
const SCENE_ENTRANCE *scGetEntrances (void)Returns the scene's entrances, where the leaves' falls land among them.
const SCENE_EXIT_REGION *scGetExitRegions (void)Returns the tops of the three vines that climb to the room above: from the entrance room to the second floor, from the third floor to the fourth, and, once Tret is beaten, from Tret's room to the entrance room.
const Uint32 *scGetExits (void)Both scenes share one exit table.
const ACTOR_PLACE *scGetActorPlacements (void)Returns the party's other slots (Garet, Ivan and, once she has joined, Mia), placed for the scripts, and the two Tret actors.
static voidscTreeRoomsStepOnLeaf (Sint32 leafFlag, Sint32 srcColumn, Sint32 srcRow, Sint32 entrance)Isaac landing on a leaf on one of Tret Tree's webs tears it the first time.
static voidscTreeRoomsStepOnSecondFloorLeafA (void)
static voidscTreeRoomsStepOnSecondFloorLeafB (void)
static voidscTreeRoomsStepOnSecondFloorLeafC (void)The leaf Isaac can jump to from the floor by the west door.
static voidscTreeRoomsStepOnSecondFloorLeafD (void)
static voidscTreeRoomsStepOnSecondFloorLeafE (void)
static voidscTreeRoomsStepOnSecondFloorLeafF (void)
static voidscTreeRoomsStepOnSecondFloorLeafG (void)
static voidscTreeRoomsStepOnSecondFloorLeafH (void)
static voidscTreeRoomsStepOnSecondFloorLeafI (void)
static voidscTreeRoomsStepOnThirdFloorWestLeaf (void)West of the Healing Ring's chest.
static voidscTreeRoomsStepOnThirdFloorEastLeaf (void)East of the Healing Ring's chest, below the vine to the fourth floor.
static voidscTreeRoomsStepOnFifthFloorCenterLeaf (void)The way to Tret: the fall goes on through every room below it (scInit) into Tret's room.
static voidscTreeRoomsStepOnFifthFloorNorthwestLeaf (void)
static voidscTreeRoomsStepOnFifthFloorNorthLeaf (void)
static voidscTreeRoomsStepOnFifthFloorNortheastLeaf (void)West of the Nut's chest.
static voidscTreeRoomsStepOnFifthFloorWestLeaf (void)
static voidscTreeRoomsStepOnFifthFloorEastLeaf (void)
static voidscTreeRoomsStepOnFifthFloorSouthwestLeaf (void)Its fall lands not straight below but where the west leaf's does, two metatiles further north (metatile (28, 26)).
static voidscTreeRoomsStepOnFifthFloorSouthLeaf (void)
static voidscTreeRoomsStepOnFifthFloorSoutheastLeaf (void)
static voidscTreeRoomsStepOnFifthFloorFarSoutheastLeaf (void)Below the Nut's chest.
static voidscTreeRoomsJumpOffLeaf (void)Walking while Isaac stands on a leaf in Tret Tree makes him jump two metatiles that way, over the web to the next leaf, wherever there is room to land (fdTryJumpForward).
const CUE *scGetCues (void)Returns the doors, the vines, the leaves, Tret, Reveal, the chests and the Psynergy Stone.
static voidscTreeRoomsFightTret (void)Walking up to Tret's face in the north wall of the lowest room in Tret Tree (metatiles (9, 5) to (11, 5)) starts the battle with him.
static voidscTreeRoomsPlayPostBattleConversation (void)After the battle with Tret, the view slides down the middle of his room as a vine grows up out of the floor, and Tret comes to himself ("Oh...
static voidscTreeRoomsApplyPostBattleState (Sint32 playRecoveryEvent)Sets Tret's room and the entrance room for whether Tret is beaten, after playing the conversation that follows the battle when playRecoveryEvent asks for it.
Sint32scInit (void)Entering any of Tret Tree's rooms: once Tret is beaten his face is gone from the lowest room, the light's slow swell starts, leaves torn before a battle are torn again, and four leaves start torn.
static voidscTreeRoomsUpdateSwirlSpark (ACTOR *spark)One of the sparks that swirl out from Tret's face as he tries to free the people of Kolima: it spirals outward from his face, shrinking as it goes, and is put away after 80 ticks.
static voidscTreeRoomsCastReveal (void)Casting Reveal anywhere inside Tret Tree stops the light's slow swell and fade, leaving the rooms' colours as they are, until Isaac next goes through a door, up or down a vine or through a leaf into another room.

Variables

NameDescription
extern Sint16TreeRoomsMapPatches []The leaves torn again after a battle.
extern Sint32TreeRoomsLeaderGathersActions []The party gather in front of Tret before the battle (scTreeRoomsFightTret), each walking to a place of their own.
extern Sint32TreeRoomsGaretGathersActions []
extern Sint32TreeRoomsIvanGathersActions []
extern Sint32TreeRoomsMiaGathersActions []
extern Sint32TreeRoomsFaceSinksActions []Tret's face sinks into the wall at the end of the conversation after the battle.
extern Sint32TreeRoomsWalkBackToLeaderScript []Garet, Ivan and Mia walk back into Isaac at the end of the conversation after the battle, and are put away.
extern Uint32TreeRoomsTintSteps []The tint's steps of red, green and blue, three to an entry: a ramp from 0 up to 4 and back.
extern SCENE_ENTRANCETreeRoomsEntrances []
extern SCENE_EXIT_REGIONTreeRoomsRegions []
extern Uint32TreeRoomsExits []
extern ACTOR_PLACETreeRoomsActorPlacements []
extern CUETreeRoomsCues []
extern Sint32TreeRoomsTintIndexWhere in TreeRoomsTintSteps the tint is, a random number of entries on each time.
static FIELD_POSSparkOriginWhere the sparks spring from, the tick of their 121-tick cycle, and the halfword of the scene's local state that keeps the entrance of the leaf Isaac last landed on, -1 once he jumps off.
static Sint32SparkTick
static Sint16 *LastLeaf
const Sint32 *FieldEffectDurationScripts []The resident copy of the scripts EFFECT_SCRIPT_MASK picks, by enum EFFECT_DURATION.

Description

Tret Tree's rooms (SceneIdTreeRooms): the hollow inside of Tret, the holy tree of Kolima Forest, where the party come to face his wrathful side. Six rooms are stacked inside the trunk. Doors in the four upper floors lead out onto his branches (SceneIdTretTreeBranch, tret_tree_branch.c), where vines climb from one floor's door to the next.

The party come in from Kolima Forest (kolima_forest_tree.c) by the door at the south end of the entrance room (metatile (30, 16)), a maze of root walls with a round hole in the middle of its floor (metatile (30, 9)). A vine near its north wall (metatile (26, 4)) climbs to the second floor.

The floors above are spider webs stretched over holes, with yellow leaves lying on them. Isaac crosses a web by jumping two metatiles at a time from leaf to leaf (scTreeRoomsJumpOffLeaf). The first time he lands on a leaf it tears. The next time it breaks, and he falls through into the room below, straight under the leaf (scTreeRoomsStepOnLeaf). Four leaves are torn from the start.

The second floor's web holds nine leaves, and its west and east doors lead out onto the branches. Its leaves drop Isaac into the entrance room.

The third floor, entered from the branches by its south or east door, has a leaf on a web either side of the Healing Ring's chest, a Psynergy Stone by its north wall and a vine up to the fourth floor. Its leaves drop him to the second floor. A third web, in the south-west, has only a small spider on it.

The fourth floor is bare, with a hole in the middle of its floor, the top of the vine from the third floor, a west door and a south door.

The fifth floor, the highest, is one great web of ten leaves beside the Nut's chest, entered by its west or east door. Its leaves drop him to the fourth floor.

The leaf in the middle of the fifth floor's web is the way to Tret. It drops Isaac through the holes in the fourth, third and second floors and the entrance room, in turn, into Tret's room under the entrance room, where his face looks out of the north wall (scTreeRoomsLandFromFall).

Walking up to the face starts the battle with Tret (scTreeRoomsFightTret). Afterwards he comes to himself, finds he turned the people of Kolima into trees, fails to free them and sinks away, and a vine grows in the middle of his room (scTreeRoomsPlayPostBattleConversation). From then on that vine joins his room and the hole in the entrance room's floor. FLAG_TRET_DEFEATED records the battle won and the conversation over. In Kolima Forest it lets Hermes' Water heal Tret and lift the curse.

The light inside the tree slowly swells and fades (scTretPaletteUpdateMapTint), and casting Reveal stops it.

Each leaf has a temporary flag of its own, set when it tears (FLAG_TRET_TREE_SECOND_FLOOR_LEAF_A_TORN and the others). The metatiles of a leaf carry the number of the entrance its fall lands at, so the step cues name them by those entrances. A torn leaf is redrawn after a battle (FLAG_KEEP_PARTY_POSITION) from TreeRoomsMapPatches.

Macros in detail

TREE_ROOMS_SPEAKER

#define TREE_ROOMS_SPEAKER(actorId) (SPEAKER_WINDOW_BELOW | (actorId))

The speaker of a message. Every speaker in this scene has SPEAKER_WINDOW_BELOW.

Referenced by scTreeRoomsFightTret() and scTreeRoomsPlayPostBattleConversation().

Definition at line 111 of file tree_rooms.c.

LEAF_FALL_SPIN_TICKS

#define LEAF_FALL_SPIN_TICKS 30

How long Isaac spins as he drops through a broken leaf.

Referenced by scTreeRoomsStepOnLeaf().

Definition at line 134 of file tree_rooms.c.

SWIRL_SPARK_LAST_TICK

#define SWIRL_SPARK_LAST_TICK 79

A spark Tret sends out spirals away from his face for 80 ticks, shrinking over the first 40.

Referenced by scTreeRoomsUpdateSwirlSpark().

Definition at line 137 of file tree_rooms.c.

SWIRL_SPARK_SHRINK_LAST_TICK

#define SWIRL_SPARK_SHRINK_LAST_TICK 39

Referenced by scTreeRoomsUpdateSwirlSpark().

Definition at line 138 of file tree_rooms.c.

TRET_TINT_COLOR_COUNT

#define TRET_TINT_COLOR_COUNT (4 * PALETTE_COLORS - 1)

The light's slow swell inside Tret (scTretPaletteUpdateMapTint) covers background palettes 1 to 4 but palette 4's last colour.

Referenced by scTretPaletteUpdateMapTint().

Definition at line 141 of file tree_rooms.c.

TRET_TINT_CHANNEL_MAX

#define TRET_TINT_CHANNEL_MAX 31

Referenced by scTretPaletteUpdateMapTint().

Definition at line 142 of file tree_rooms.c.

TRET_TINT_END

#define TRET_TINT_END 99

The red step that ends TreeRoomsTintSteps, where the swell starts over.

Referenced by scTretPaletteUpdateMapTint().

Definition at line 144 of file tree_rooms.c.

FALL_ENTRANCE_STEP

#define FALL_ENTRANCE_STEP

The fall from the fifth floor's centre leaf goes down a floor at a time through entrances ten apart: TREE_ROOMS_FROM_FIFTH_FLOOR_CENTER_LEAF on the fourth floor, then TREE_ROOMS_FALL_THROUGH_A to _C, then TREE_ROOMS_FALL_LANDING in Tret's room.

Referenced by scInit().

Definition at line 150 of file tree_rooms.c.

FLAG_TRET_TREE_SECOND_FLOOR_LEAF_A_TORN

#define FLAG_TRET_TREE_SECOND_FLOOR_LEAF_A_TORN FLAG_SCENE_TEMP(0x00)

Second floor, the west of the pair in the north of the web, metatile (49, 6).

Referenced by scTreeRoomsStepOnSecondFloorLeafA() and TreeRoomsMapPatches.

Definition at line 196 of file tree_rooms.c.

FLAG_TRET_TREE_SECOND_FLOOR_LEAF_B_TORN

#define FLAG_TRET_TREE_SECOND_FLOOR_LEAF_B_TORN FLAG_SCENE_TEMP(0x01)

Second floor, the east of the pair in the north, metatile (51, 6); starts torn.

Referenced by scInit(), scTreeRoomsStepOnSecondFloorLeafB() and TreeRoomsMapPatches.

Definition at line 199 of file tree_rooms.c.

FLAG_TRET_TREE_SECOND_FLOOR_LEAF_C_TORN

#define FLAG_TRET_TREE_SECOND_FLOOR_LEAF_C_TORN FLAG_SCENE_TEMP(0x02)

Second floor, the upper of the two down the west side, metatile (46, 8).

Referenced by scTreeRoomsStepOnSecondFloorLeafC() and TreeRoomsMapPatches.

Definition at line 201 of file tree_rooms.c.

FLAG_TRET_TREE_SECOND_FLOOR_LEAF_D_TORN

#define FLAG_TRET_TREE_SECOND_FLOOR_LEAF_D_TORN FLAG_SCENE_TEMP(0x03)

Second floor, the lower of the two down the west side, metatile (46, 10).

Referenced by scTreeRoomsStepOnSecondFloorLeafD() and TreeRoomsMapPatches.

Definition at line 203 of file tree_rooms.c.

FLAG_TRET_TREE_SECOND_FLOOR_LEAF_E_TORN

#define FLAG_TRET_TREE_SECOND_FLOOR_LEAF_E_TORN FLAG_SCENE_TEMP(0x04)

Second floor, the west of the pair in the middle, metatile (47, 12).

Referenced by scTreeRoomsStepOnSecondFloorLeafE() and TreeRoomsMapPatches.

Definition at line 205 of file tree_rooms.c.

FLAG_TRET_TREE_SECOND_FLOOR_LEAF_F_TORN

#define FLAG_TRET_TREE_SECOND_FLOOR_LEAF_F_TORN FLAG_SCENE_TEMP(0x05)

Second floor, the east of the pair in the middle, metatile (49, 12).

Referenced by scTreeRoomsStepOnSecondFloorLeafF() and TreeRoomsMapPatches.

Definition at line 207 of file tree_rooms.c.

FLAG_TRET_TREE_SECOND_FLOOR_LEAF_G_TORN

#define FLAG_TRET_TREE_SECOND_FLOOR_LEAF_G_TORN FLAG_SCENE_TEMP(0x06)

Second floor, the west of the row along the south, metatile (48, 14).

Referenced by scTreeRoomsStepOnSecondFloorLeafG() and TreeRoomsMapPatches.

Definition at line 209 of file tree_rooms.c.

FLAG_TRET_TREE_SECOND_FLOOR_LEAF_H_TORN

#define FLAG_TRET_TREE_SECOND_FLOOR_LEAF_H_TORN FLAG_SCENE_TEMP(0x07)

Second floor, the middle of the row along the south, metatile (50, 14).

Referenced by scTreeRoomsStepOnSecondFloorLeafH() and TreeRoomsMapPatches.

Definition at line 211 of file tree_rooms.c.

FLAG_TRET_TREE_SECOND_FLOOR_LEAF_I_TORN

#define FLAG_TRET_TREE_SECOND_FLOOR_LEAF_I_TORN FLAG_SCENE_TEMP(0x08)

Second floor, the east of the row along the south, metatile (52, 14).

Referenced by scTreeRoomsStepOnSecondFloorLeafI() and TreeRoomsMapPatches.

Definition at line 213 of file tree_rooms.c.

FLAG_TRET_TREE_THIRD_FLOOR_WEST_LEAF_TORN

#define FLAG_TRET_TREE_THIRD_FLOOR_WEST_LEAF_TORN FLAG_SCENE_TEMP(0x09)

Third floor, the leaf on the west web, metatile (7, 23).

Referenced by scTreeRoomsStepOnThirdFloorWestLeaf() and TreeRoomsMapPatches.

Definition at line 215 of file tree_rooms.c.

FLAG_TRET_TREE_THIRD_FLOOR_EAST_LEAF_TORN

#define FLAG_TRET_TREE_THIRD_FLOOR_EAST_LEAF_TORN FLAG_SCENE_TEMP(0x0a)

Third floor, the leaf on the east web, metatile (13, 24).

Referenced by scTreeRoomsStepOnThirdFloorEastLeaf() and TreeRoomsMapPatches.

Definition at line 217 of file tree_rooms.c.

FLAG_TRET_TREE_FIFTH_FLOOR_CENTER_LEAF_TORN

#define FLAG_TRET_TREE_FIFTH_FLOOR_CENTER_LEAF_TORN FLAG_SCENE_TEMP(0x0b)

Fifth floor, the centre leaf, the way down to Tret, metatile (50, 26).

Referenced by scTreeRoomsStepOnFifthFloorCenterLeaf() and TreeRoomsMapPatches.

Definition at line 219 of file tree_rooms.c.

FLAG_TRET_TREE_FIFTH_FLOOR_NORTHWEST_LEAF_TORN

#define FLAG_TRET_TREE_FIFTH_FLOOR_NORTHWEST_LEAF_TORN FLAG_SCENE_TEMP(0x0c)

Fifth floor, metatile (48, 24).

Referenced by scTreeRoomsStepOnFifthFloorNorthwestLeaf() and TreeRoomsMapPatches.

Definition at line 221 of file tree_rooms.c.

FLAG_TRET_TREE_FIFTH_FLOOR_NORTH_LEAF_TORN

#define FLAG_TRET_TREE_FIFTH_FLOOR_NORTH_LEAF_TORN FLAG_SCENE_TEMP(0x0d)

Fifth floor, metatile (50, 24); starts torn.

Referenced by scInit(), scTreeRoomsStepOnFifthFloorNorthLeaf() and TreeRoomsMapPatches.

Definition at line 223 of file tree_rooms.c.

FLAG_TRET_TREE_FIFTH_FLOOR_NORTHEAST_LEAF_TORN

#define FLAG_TRET_TREE_FIFTH_FLOOR_NORTHEAST_LEAF_TORN FLAG_SCENE_TEMP(0x0e)

Fifth floor, metatile (52, 24).

Referenced by scTreeRoomsStepOnFifthFloorNortheastLeaf() and TreeRoomsMapPatches.

Definition at line 225 of file tree_rooms.c.

FLAG_TRET_TREE_FIFTH_FLOOR_WEST_LEAF_TORN

#define FLAG_TRET_TREE_FIFTH_FLOOR_WEST_LEAF_TORN FLAG_SCENE_TEMP(0x0f)

Fifth floor, metatile (48, 26); starts torn.

Referenced by scInit(), scTreeRoomsStepOnFifthFloorWestLeaf() and TreeRoomsMapPatches.

Definition at line 227 of file tree_rooms.c.

FLAG_TRET_TREE_FIFTH_FLOOR_EAST_LEAF_TORN

#define FLAG_TRET_TREE_FIFTH_FLOOR_EAST_LEAF_TORN FLAG_SCENE_TEMP(0x10)

Fifth floor, metatile (52, 26).

Referenced by scTreeRoomsStepOnFifthFloorEastLeaf() and TreeRoomsMapPatches.

Definition at line 229 of file tree_rooms.c.

FLAG_TRET_TREE_FIFTH_FLOOR_SOUTHWEST_LEAF_TORN

#define FLAG_TRET_TREE_FIFTH_FLOOR_SOUTHWEST_LEAF_TORN FLAG_SCENE_TEMP(0x11)

Fifth floor, metatile (48, 28).

Referenced by scTreeRoomsStepOnFifthFloorSouthwestLeaf() and TreeRoomsMapPatches.

Definition at line 231 of file tree_rooms.c.

FLAG_TRET_TREE_FIFTH_FLOOR_SOUTH_LEAF_TORN

#define FLAG_TRET_TREE_FIFTH_FLOOR_SOUTH_LEAF_TORN FLAG_SCENE_TEMP(0x12)

Fifth floor, metatile (50, 28).

Referenced by scTreeRoomsStepOnFifthFloorSouthLeaf() and TreeRoomsMapPatches.

Definition at line 233 of file tree_rooms.c.

FLAG_TRET_TREE_FIFTH_FLOOR_SOUTHEAST_LEAF_TORN

#define FLAG_TRET_TREE_FIFTH_FLOOR_SOUTHEAST_LEAF_TORN FLAG_SCENE_TEMP(0x13)

Fifth floor, metatile (52, 28); starts torn.

Referenced by scInit(), scTreeRoomsStepOnFifthFloorSoutheastLeaf() and TreeRoomsMapPatches.

Definition at line 235 of file tree_rooms.c.

FLAG_TRET_TREE_FIFTH_FLOOR_FAR_SOUTHEAST_LEAF_TORN

#define FLAG_TRET_TREE_FIFTH_FLOOR_FAR_SOUTHEAST_LEAF_TORN FLAG_SCENE_TEMP(0x14)

Fifth floor, the east end of the south row, metatile (54, 28).

Referenced by scTreeRoomsStepOnFifthFloorFarSoutheastLeaf() and TreeRoomsMapPatches.

Definition at line 237 of file tree_rooms.c.

Enumerations in detail

anonymous enum

enum { MAP_PATCH_FLAG, MAP_PATCH_REDRAWN, MAP_PATCH_SOURCE_X, MAP_PATCH_SOURCE_Y, … }

The columns of a row of TreeRoomsMapPatches, six halfwords, whose rows run on until a flag of -1.

EnumeratorValueDescription
MAP_PATCH_FLAG
MAP_PATCH_REDRAWN
MAP_PATCH_SOURCE_X
MAP_PATCH_SOURCE_Y
MAP_PATCH_DESTINATION_X
MAP_PATCH_DESTINATION_Y
MAP_PATCH_ROW_LENGTH

Definition at line 72 of file tree_rooms.c.

anonymous enum

enum { ACTOR_TRET, ACTOR_SECOND_TRET }

Tret's face in the north wall of his room (SPRITE_TRET), the first actor placed after the party, and a second Tret actor (SPRITE_TRET_GENTLE) placed at the same spot.

Both speak Tret's lines. The face scorns the party before the battle; the second roars before it and speaks every line after it.

EnumeratorValueDescription
ACTOR_TRETACTOR_FIRST_PLACED
ACTOR_SECOND_TRETKept hidden (SPRITE_COLOR_HIDDEN): only a speaker.

Definition at line 103 of file tree_rooms.c.

TREE_ROOMS_METATILE_BEHAVIOR

enum TREE_ROOMS_METATILE_BEHAVIOR

The metatiles Tret Tree's examine and step cues answer besides the doors, the vines and the leaves. The doors' metatiles and the tops of the vines that lead down carry the numbers of their exits, and each leaf's metatile the number of the entrance its fall lands at.

EnumeratorValueDescription
METATILE_BEHAVIOR_TREE_ROOMS_BEFORE_TRET40The row in front of Tret's face in the lowest room, (9, 5) to (11, 5).
METATILE_BEHAVIOR_TREE_ROOMS_HEALING_RING_CHEST100The Healing Ring's chest on the third floor, between its webs (10, 24).
METATILE_BEHAVIOR_TREE_ROOMS_NUT_CHEST101The Nut's chest on the fifth floor, east of its web (54, 25).
METATILE_BEHAVIOR_TREE_ROOMS_PSYNERGY_STONE102The Psynergy Stone by the third floor's north wall (9, 21).

Definition at line 117 of file tree_rooms.c.

TREE_ROOMS_FACE_CHANGE

enum TREE_ROOMS_FACE_CHANGE

The face changes scTreeRoomsChangeFace plays on Tret. Each starts from the face with its eyes open, and the wrathful ones are on his wrathful face.

EnumeratorValueDescription
TRET_FACE_CHANGE_CLOSE_EYES0
TRET_FACE_CHANGE_OPEN_EYES1
TRET_FACE_CHANGE_LOOK_LEFT2
TRET_FACE_CHANGE_LOOK_RIGHT3
TRET_FACE_CHANGE_BLINK4Twice.
TRET_FACE_CHANGE_HALF_CLOSE_EYES5
TRET_FACE_CHANGE_WRATHFUL_CLOSE_EYES7
TRET_FACE_CHANGE_WRATHFUL_OPEN_EYES8
TRET_FACE_CHANGE_WRATHFUL_LOOK_RIGHT9
TRET_FACE_CHANGE_WRATHFUL_LOOK_LEFT10
TRET_FACE_CHANGE_WRATHFUL_BLINK11Twice.
TRET_FACE_CHANGE_WRATHFUL_STARE12As TRET_FACE_CHANGE_WRATHFUL_OPEN_EYES.

Definition at line 158 of file tree_rooms.c.

Functions in detail

scTretPaletteSaveMapColors

static void scTretPaletteSaveMapColors(void)

Saves background palettes 0 to 13, the rooms' own colours, which the light's slow swell inside Tret brightens (scTretPaletteUpdateMapTint).

References syDMAXCopy().

Referenced by scInit().

Definition at lines 153 and 994 of file tree_rooms.c.

scTretPaletteUpdateMapTint

static void scTretPaletteUpdateMapTint(void)

The light inside Tret Tree slowly swells and fades: over a few seconds the walls and floors grow a little brighter and warmer, then sink back, again and again. It pauses while Psynergy is being cast, and stops for good once Reveal is cast (scTreeRoomsCastReveal). Every 32 ticks it adds the next red, green and blue step of TreeRoomsTintSteps, a ramp from 0 up to 4 and back, to the saved colours of background palettes 1 to 4, skipping a random few steps each time; each later palette takes a weaker step.

References Sint32, state, syRandomNext(), TickCount, TreeRoomsTintIndex and TreeRoomsTintSteps.

Referenced by scInit(), scTreeRoomsCastReveal() and scTreeRoomsPlayPostBattleConversation().

Definition at lines 154 and 1009 of file tree_rooms.c.

scTreeRoomsChangeFace

static void scTreeRoomsChangeFace(Sint32 change)

Changes Tret's face in the north wall of his room (opening or closing his eyes, blinking, looking aside), six ticks to a picture, and waits twelve ticks after it.

References fdActorSetAnimation(), Sint32 and sySynch().

Referenced by scInit(), scTreeRoomsFightTret() and scTreeRoomsPlayPostBattleConversation().

Definition at lines 176 and 1086 of file tree_rooms.c.

scTreeRoomsSpawnSwirlSparks

static void scTreeRoomsSpawnSwirlSparks(void)

Sends out the sparks from Tret's face as he tries to free the people of Kolima: five waves, ten ticks apart, of six, five, four, three and two sparks, each wave with a shimmering sound.

References fdActorSelectAnimation(), fdActorSetSpriteFlags(), fdSpriteShareVRAMCacheEntry(), scFieldActorCreate(), scTreeRoomsUpdateSwirlSpark(), Sint32, SparkOrigin, SparkTick and sySoundPlay().

Referenced by scTreeRoomsPlayPostBattleConversation().

Definition at lines 177 and 1200 of file tree_rooms.c.

scTreeRoomsApplyFlaggedMapPatches

static void scTreeRoomsApplyFlaggedMapPatches(void)

Tears again each leaf that was torn before a battle, so that the webs look as the party left them.

References fdMapGridCopyMetatilesTo(), gmFlagGet(), Sint32 and TreeRoomsMapPatches.

Referenced by scInit().

Definition at lines 178 and 1255 of file tree_rooms.c.

scTreeRoomsLandFromFall

static void scTreeRoomsLandFromFall(void)

Isaac lands in Tret's room at the end of the fall from the fifth floor's centre leaf: he drops into the middle of the room, south of Tret's face, and hits the floor with a thump in a ring of white dust as the screen shakes, staggering back in surprise.

References fdActorGet(), fdActorSetAnimation(), fdActorSetAttachedEffect(), fdMapGridCenterOnFollowedPoint(), fdMapGridWaitForShakeToSettle(), fdScriptEnd(), fdScriptStart(), fdScriptStartScreenTransition(), fdScriptWait(), fdScriptWaitTransitionTicks(), scFieldEffectAdvanceMotion(), Sint32, syCos(), sySin(), sySoundPlay() and sySynch().

Referenced by scInit().

Definition at lines 179 and 1288 of file tree_rooms.c.

scGetEntrances

const SCENE_ENTRANCE *scGetEntrances(void)

Returns the scene's entrances, where the leaves' falls land among them.

References TreeRoomsEntrances.

Definition at line 240 of file tree_rooms.c.

scGetExitRegions

const SCENE_EXIT_REGION *scGetExitRegions(void)

Returns the tops of the three vines that climb to the room above: from the entrance room to the second floor, from the third floor to the fourth, and, once Tret is beaten, from Tret's room to the entrance room. Climbing to between 28 and 36 pixels up one of them takes Isaac through.

References TreeRoomsRegions.

Definition at line 249 of file tree_rooms.c.

scGetExits

const Uint32 *scGetExits(void)

References TreeRoomsExits.

Definition at line 254 of file tree_rooms.c.

scGetActorPlacements

const ACTOR_PLACE *scGetActorPlacements(void)

Returns the party's other slots (Garet, Ivan and, once she has joined, Mia), placed for the scripts, and the two Tret actors.

References TreeRoomsActorPlacements.

Definition at line 261 of file tree_rooms.c.

scTreeRoomsStepOnLeaf

static void scTreeRoomsStepOnLeaf(Sint32 leafFlag, Sint32 srcColumn, Sint32 srcRow, Sint32 entrance)

Isaac landing on a leaf on one of Tret Tree's webs tears it the first time. The next time the leaf breaks: he starts in surprise, spins as he drops through the web, leaving a hole where the leaf lay, and falls into the room below, landing straight under the leaf. The torn leaf and the hole are pictures kept on a spare row of the map (srcColumn on srcRow, and the row below it), copied over the leaf's metatile in the map's upper layer. entrance is where the fall lands. LastLeaf keeps a landing from counting again while he stands on the leaf, until he jumps off it (scTreeRoomsJumpOffLeaf). FLAG_ARRIVE_FALLING has him drop into the room below, except from the fifth floor's centre leaf, whose fall goes on down through the rooms (scInit).

References fdActorGet(), fdActorSetAnimation(), fdActorSetAttachedEffect(), fdActorSetSpriteFlags(), fdActorSetSpritePriority(), fdMapGridCopyMetatiles(), fdScriptSetDestination(), fdScriptStart(), fdScriptWait(), gmFlagGet(), gmFlagSet(), LastLeaf, MainRoutineStateWork, Sint32, sySoundPlay() and sySynch().

Referenced by scTreeRoomsStepOnFifthFloorCenterLeaf(), scTreeRoomsStepOnFifthFloorEastLeaf(), scTreeRoomsStepOnFifthFloorFarSoutheastLeaf(), scTreeRoomsStepOnFifthFloorNortheastLeaf(), scTreeRoomsStepOnFifthFloorNorthLeaf(), scTreeRoomsStepOnFifthFloorNorthwestLeaf(), scTreeRoomsStepOnFifthFloorSoutheastLeaf(), scTreeRoomsStepOnFifthFloorSouthLeaf(), scTreeRoomsStepOnFifthFloorSouthwestLeaf(), scTreeRoomsStepOnFifthFloorWestLeaf(), scTreeRoomsStepOnSecondFloorLeafA(), scTreeRoomsStepOnSecondFloorLeafB(), scTreeRoomsStepOnSecondFloorLeafC(), scTreeRoomsStepOnSecondFloorLeafD(), scTreeRoomsStepOnSecondFloorLeafE(), scTreeRoomsStepOnSecondFloorLeafF(), scTreeRoomsStepOnSecondFloorLeafG(), scTreeRoomsStepOnSecondFloorLeafH(), scTreeRoomsStepOnSecondFloorLeafI(), scTreeRoomsStepOnThirdFloorEastLeaf() and scTreeRoomsStepOnThirdFloorWestLeaf().

Definition at line 277 of file tree_rooms.c.

scTreeRoomsStepOnSecondFloorLeafA

static void scTreeRoomsStepOnSecondFloorLeafA(void)

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 337 of file tree_rooms.c.

scTreeRoomsStepOnSecondFloorLeafB

static void scTreeRoomsStepOnSecondFloorLeafB(void)

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 345 of file tree_rooms.c.

scTreeRoomsStepOnSecondFloorLeafC

static void scTreeRoomsStepOnSecondFloorLeafC(void)

The leaf Isaac can jump to from the floor by the west door.

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 354 of file tree_rooms.c.

scTreeRoomsStepOnSecondFloorLeafD

static void scTreeRoomsStepOnSecondFloorLeafD(void)

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 362 of file tree_rooms.c.

scTreeRoomsStepOnSecondFloorLeafE

static void scTreeRoomsStepOnSecondFloorLeafE(void)

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 370 of file tree_rooms.c.

scTreeRoomsStepOnSecondFloorLeafF

static void scTreeRoomsStepOnSecondFloorLeafF(void)

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 378 of file tree_rooms.c.

scTreeRoomsStepOnSecondFloorLeafG

static void scTreeRoomsStepOnSecondFloorLeafG(void)

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 386 of file tree_rooms.c.

scTreeRoomsStepOnSecondFloorLeafH

static void scTreeRoomsStepOnSecondFloorLeafH(void)

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 394 of file tree_rooms.c.

scTreeRoomsStepOnSecondFloorLeafI

static void scTreeRoomsStepOnSecondFloorLeafI(void)

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 402 of file tree_rooms.c.

scTreeRoomsStepOnThirdFloorWestLeaf

static void scTreeRoomsStepOnThirdFloorWestLeaf(void)

West of the Healing Ring's chest.

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 411 of file tree_rooms.c.

scTreeRoomsStepOnThirdFloorEastLeaf

static void scTreeRoomsStepOnThirdFloorEastLeaf(void)

East of the Healing Ring's chest, below the vine to the fourth floor.

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 420 of file tree_rooms.c.

scTreeRoomsStepOnFifthFloorCenterLeaf

static void scTreeRoomsStepOnFifthFloorCenterLeaf(void)

The way to Tret: the fall goes on through every room below it (scInit) into Tret's room.

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 430 of file tree_rooms.c.

scTreeRoomsStepOnFifthFloorNorthwestLeaf

static void scTreeRoomsStepOnFifthFloorNorthwestLeaf(void)

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 438 of file tree_rooms.c.

scTreeRoomsStepOnFifthFloorNorthLeaf

static void scTreeRoomsStepOnFifthFloorNorthLeaf(void)

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 446 of file tree_rooms.c.

scTreeRoomsStepOnFifthFloorNortheastLeaf

static void scTreeRoomsStepOnFifthFloorNortheastLeaf(void)

West of the Nut's chest.

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 455 of file tree_rooms.c.

scTreeRoomsStepOnFifthFloorWestLeaf

static void scTreeRoomsStepOnFifthFloorWestLeaf(void)

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 463 of file tree_rooms.c.

scTreeRoomsStepOnFifthFloorEastLeaf

static void scTreeRoomsStepOnFifthFloorEastLeaf(void)

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 471 of file tree_rooms.c.

scTreeRoomsStepOnFifthFloorSouthwestLeaf

static void scTreeRoomsStepOnFifthFloorSouthwestLeaf(void)

Its fall lands not straight below but where the west leaf's does, two metatiles further north (metatile (28, 26)).

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 481 of file tree_rooms.c.

scTreeRoomsStepOnFifthFloorSouthLeaf

static void scTreeRoomsStepOnFifthFloorSouthLeaf(void)

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 489 of file tree_rooms.c.

scTreeRoomsStepOnFifthFloorSoutheastLeaf

static void scTreeRoomsStepOnFifthFloorSoutheastLeaf(void)

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 497 of file tree_rooms.c.

scTreeRoomsStepOnFifthFloorFarSoutheastLeaf

static void scTreeRoomsStepOnFifthFloorFarSoutheastLeaf(void)

Below the Nut's chest.

References scTreeRoomsStepOnLeaf().

Referenced by TreeRoomsCues.

Definition at line 506 of file tree_rooms.c.

scTreeRoomsJumpOffLeaf

static void scTreeRoomsJumpOffLeaf(void)

Walking while Isaac stands on a leaf in Tret Tree makes him jump two metatiles that way, over the web to the next leaf, wherever there is room to land (fdTryJumpForward). Once he has jumped, LastLeaf is cleared, so that the leaf he lands on counts as a fresh landing.

References fdTryJumpForward() and LastLeaf.

Referenced by TreeRoomsCues.

Definition at line 518 of file tree_rooms.c.

scGetCues

const CUE *scGetCues(void)

Returns the doors, the vines, the leaves, Tret, Reveal, the chests and the Psynergy Stone.

References TreeRoomsCues.

Definition at line 526 of file tree_rooms.c.

scTreeRoomsFightTret

static void scTreeRoomsFightTret(void)

Walking up to Tret's face in the north wall of the lowest room in Tret Tree (metatiles (9, 5) to (11, 5)) starts the battle with him. He roars "Hm HROOOM!!!", Garet, Ivan and Mia, once she has joined, gather beside Isaac before him, and his face turns wrathful: "You hoped to find my kindly self?" The party start back, and he swears they will all become trees before the screen breaks into bars for the battle. It runs only while FLAG_TRET_DEFEATED is clear. The battle returns to TREE_ROOMS_AFTER_FIGHT_TRET, where the setup plays scTreeRoomsPlayPostBattleConversation.

References fdActorFaceDirection(), fdActorGet(), fdActorRunRepeatedMotion(), fdActorRunScriptAndWait(), fdActorSetAnimation(), fdActorSetAttachedEffect(), fdActorSetScript(), fdActorSetSpritePriority(), fdActorShowEmote(), fdActorStartRepeatedMotion(), fdRequestBattleFromEncounterTable(), fdScriptEnd(), fdScriptSetAfterBattleDestination(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptShowMessageThenWait(), fdScriptStart(), fdScriptWait(), gmFlagGet(), scFieldScriptShowMessageThenWait(), scPlaceAtLeader(), scTreeRoomsChangeFace(), Sint32, sySoundPlay(), TreeRoomsGaretGathersActions, TreeRoomsIvanGathersActions, TreeRoomsLeaderGathersActions and TreeRoomsMiaGathersActions.

Referenced by TreeRoomsCues.

Definition at line 539 of file tree_rooms.c.

scTreeRoomsPlayPostBattleConversation

static void scTreeRoomsPlayPostBattleConversation(void)

After the battle with Tret, the view slides down the middle of his room as a vine grows up out of the floor, and Tret comes to himself ("Oh... Mmmmm..."). He thanks the party and says good-bye, but Garet and Ivan will not let him die while they still need his help. Learning that he turned the people of Kolima into trees, he tries to free them: the room turns purple and sparks swirl out from his face, but his power no longer reaches Kolima. His face sinks into the wall, and the party resolve to heal him. Only then is FLAG_TRET_DEFEATED set and the light's slow swell started again (scTretPaletteUpdateMapTint). Answering "Do you need something?" with no makes Garet and Ivan scold Isaac.

References fdActorFaceDirection(), fdActorGet(), fdActorRunRepeatedMotion(), fdActorRunScriptAndWait(), fdActorSetAnimation(), fdActorSetAnimationAndWait(), fdActorSetAttachedEffect(), fdActorSetScript(), fdActorSetSpritePriority(), fdActorShowEmote(), fdActorStartRepeatedMotion(), fdCameraWaitForMove(), fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatiles(), fdPaletteFadeApplySource(), fdPaletteFadeApplyTarget(), fdPaletteFadeStartInterpolation(), fdScriptAskYesNoWithActorAnimation(), fdScriptEnd(), fdScriptOpenMessage(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptShowMessageThenWait(), fdScriptStart(), fdScriptStartScreenTransition(), fdScriptWait(), fdScriptWaitTransitionTicks(), gmFlagGet(), gmFlagSet(), gmPartyInventoryFindMember(), scFieldScriptShowMessageThenWait(), scTreeRoomsChangeFace(), scTreeRoomsSpawnSwirlSparks(), scTretPaletteUpdateMapTint(), Sint32, SparkOrigin, SparkTick, syCloseEvent(), sySetTickEvent(), sySoundPlay(), sySynch(), TreeRoomsFaceSinksActions and TreeRoomsWalkBackToLeaderScript.

Referenced by scTreeRoomsApplyPostBattleState().

Definition at line 630 of file tree_rooms.c.

scTreeRoomsApplyPostBattleState

static void scTreeRoomsApplyPostBattleState(Sint32 playRecoveryEvent)

Sets Tret's room and the entrance room for whether Tret is beaten, after playing the conversation that follows the battle when playRecoveryEvent asks for it. Before, the middle of Tret's room (metatile (10, 8)) is bare floor and the hole in the entrance room's floor is a bare hole. After, the vine stands in Tret's room and can be climbed, and its top shows in the hole in the entrance room (metatile (30, 9)), where stepping on it takes Isaac down to Tret's room. The vine's metatiles take their climbing from the vine near the entrance room's north wall (metatile (26, 3)), and the hole's metatiles take the exit down to Tret from the spare metatile at (0, 0).

References fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatiles(), gmFlagGet(), scTreeRoomsPlayPostBattleConversation(), Sint32 and sySynch().

Referenced by scInit().

Definition at line 871 of file tree_rooms.c.

scInit

Sint32 scInit(void)

Entering any of Tret Tree's rooms: once Tret is beaten his face is gone from the lowest room, the light's slow swell starts, leaves torn before a battle are torn again, and four leaves start torn. Arriving by a fall from the fifth floor's centre leaf, Isaac drops in from above and on through the hole in the floor, a room at a time, until he lands before Tret (scTreeRoomsLandFromFall). Back from the battle with Tret, the conversation after it plays. The setup also saves the rooms' colours for the swell (scTretPaletteSaveMapColors) and sets the map's first layer to scroll at nine tenths of the pace of the view, offset to the room.

References fdActorGet(), fdActorSetAnimation(), fdActorSetAttachedEffect(), fdActorSetSpriteColorById(), fdActorSetSpriteFlags(), fdActorSetSpritePriority(), fdScriptGetFlag(), fdScriptSetDestination(), fdScriptStartScreenTransition(), fdScriptWait(), gmFlagGet(), gmFlagSet(), LastLeaf, MainRoutineStateWork, SceneLocalState, scTreeRoomsApplyFlaggedMapPatches(), scTreeRoomsApplyPostBattleState(), scTreeRoomsChangeFace(), scTreeRoomsLandFromFall(), scTretPaletteSaveMapColors(), scTretPaletteUpdateMapTint(), Sint32, state, syMulFX(), sySetTickEvent(), sySoundPlay() and sySynch().

Definition at line 900 of file tree_rooms.c.

scTreeRoomsUpdateSwirlSpark

static void scTreeRoomsUpdateSwirlSpark(ACTOR *spark)

One of the sparks that swirl out from Tret's face as he tries to free the people of Kolima: it spirals outward from his face, shrinking as it goes, and is put away after 80 ticks.

References fdActorRelease(), Sint32, syVectorAddPolarOffset() and syVRAMCacheFreeEntry().

Referenced by scTreeRoomsSpawnSwirlSparks().

Definition at line 1163 of file tree_rooms.c.

scTreeRoomsCastReveal

static void scTreeRoomsCastReveal(void)

Casting Reveal anywhere inside Tret Tree stops the light's slow swell and fade, leaving the rooms' colours as they are, until Isaac next goes through a door, up or down a vine or through a leaf into another room.

References scTretPaletteUpdateMapTint() and syCloseEvent().

Referenced by TreeRoomsCues.

Definition at line 1277 of file tree_rooms.c.

Variables in detail

TreeRoomsMapPatches

extern Sint16 TreeRoomsMapPatches[]

Sint16 TreeRoomsMapPatches[]

The leaves torn again after a battle. Each row is the leaf's flag, whether it is redrawn (0 for the four the map draws torn), the torn picture's metatile x/y on the spare row and the leaf's metatile x/y in the map's upper layer.

Referenced by scTreeRoomsApplyFlaggedMapPatches().

Definition at lines 68 and 1356 of file tree_rooms.c.

TreeRoomsLeaderGathersActions

extern Sint32 TreeRoomsLeaderGathersActions[]

Sint32 TreeRoomsLeaderGathersActions[]

The party gather in front of Tret before the battle (scTreeRoomsFightTret), each walking to a place of their own.

References Sint32.

Referenced by scTreeRoomsFightTret().

Definition at lines 83 and 1389 of file tree_rooms.c.

TreeRoomsGaretGathersActions

extern Sint32 TreeRoomsGaretGathersActions[]

Sint32 TreeRoomsGaretGathersActions[]

References Sint32.

Referenced by scTreeRoomsFightTret().

Definition at lines 84 and 1397 of file tree_rooms.c.

TreeRoomsIvanGathersActions

extern Sint32 TreeRoomsIvanGathersActions[]

Sint32 TreeRoomsIvanGathersActions[]

References Sint32.

Referenced by scTreeRoomsFightTret().

Definition at lines 85 and 1405 of file tree_rooms.c.

TreeRoomsMiaGathersActions

extern Sint32 TreeRoomsMiaGathersActions[]

Sint32 TreeRoomsMiaGathersActions[]

References Sint32.

Referenced by scTreeRoomsFightTret().

Definition at lines 86 and 1413 of file tree_rooms.c.

TreeRoomsFaceSinksActions

extern Sint32 TreeRoomsFaceSinksActions[]

Sint32 TreeRoomsFaceSinksActions[]

Tret's face sinks into the wall at the end of the conversation after the battle. Eight times it rises 80 pixels for 4 ticks and drops back 78, a sixteenth smaller each time, and then it is put away.

References Sint32.

Referenced by scTreeRoomsPlayPostBattleConversation().

Definition at lines 87 and 1424 of file tree_rooms.c.

TreeRoomsWalkBackToLeaderScript

extern Sint32 TreeRoomsWalkBackToLeaderScript[]

Sint32 TreeRoomsWalkBackToLeaderScript[]

Garet, Ivan and Mia walk back into Isaac at the end of the conversation after the battle, and are put away.

References Sint32.

Referenced by scTreeRoomsPlayPostBattleConversation().

Definition at lines 88 and 1440 of file tree_rooms.c.

TreeRoomsTintSteps

extern Uint32 TreeRoomsTintSteps[]

Uint32 TreeRoomsTintSteps[]

The tint's steps of red, green and blue, three to an entry: a ramp from 0 up to 4 and back.

Referenced by scTretPaletteUpdateMapTint().

Definition at lines 89 and 1450 of file tree_rooms.c.

TreeRoomsEntrances

extern SCENE_ENTRANCE TreeRoomsEntrances[]

SCENE_ENTRANCE TreeRoomsEntrances[]

Referenced by scGetEntrances().

Definition at lines 90 and 1508 of file tree_rooms.c.

TreeRoomsRegions

extern SCENE_EXIT_REGION TreeRoomsRegions[]

SCENE_EXIT_REGION TreeRoomsRegions[]

Referenced by scGetExitRegions().

Definition at lines 91 and 1594 of file tree_rooms.c.

TreeRoomsExits

extern Uint32 TreeRoomsExits[]

Uint32 TreeRoomsExits[]

Referenced by scGetExits().

Definition at lines 92 and 1605 of file tree_rooms.c.

TreeRoomsActorPlacements

extern ACTOR_PLACE TreeRoomsActorPlacements[]

ACTOR_PLACE TreeRoomsActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 93 and 1651 of file tree_rooms.c.

TreeRoomsCues

extern CUE TreeRoomsCues[]

CUE TreeRoomsCues[]

References scTreeRoomsCastReveal(), scTreeRoomsFightTret(), scTreeRoomsJumpOffLeaf(), scTreeRoomsStepOnFifthFloorCenterLeaf(), scTreeRoomsStepOnFifthFloorEastLeaf(), scTreeRoomsStepOnFifthFloorFarSoutheastLeaf(), scTreeRoomsStepOnFifthFloorNortheastLeaf(), scTreeRoomsStepOnFifthFloorNorthLeaf(), scTreeRoomsStepOnFifthFloorNorthwestLeaf(), scTreeRoomsStepOnFifthFloorSoutheastLeaf(), scTreeRoomsStepOnFifthFloorSouthLeaf(), scTreeRoomsStepOnFifthFloorSouthwestLeaf(), scTreeRoomsStepOnFifthFloorWestLeaf(), scTreeRoomsStepOnSecondFloorLeafA(), scTreeRoomsStepOnSecondFloorLeafB(), scTreeRoomsStepOnSecondFloorLeafC(), scTreeRoomsStepOnSecondFloorLeafD(), scTreeRoomsStepOnSecondFloorLeafE(), scTreeRoomsStepOnSecondFloorLeafF(), scTreeRoomsStepOnSecondFloorLeafG(), scTreeRoomsStepOnSecondFloorLeafH(), scTreeRoomsStepOnSecondFloorLeafI(), scTreeRoomsStepOnThirdFloorEastLeaf() and scTreeRoomsStepOnThirdFloorWestLeaf().

Referenced by scGetCues().

Definition at lines 94 and 1666 of file tree_rooms.c.

TreeRoomsTintIndex

extern Sint32 TreeRoomsTintIndex

Sint32 TreeRoomsTintIndex

Where in TreeRoomsTintSteps the tint is, a random number of entries on each time.

References Sint32.

Referenced by scTretPaletteUpdateMapTint().

Definition at lines 95 and 1849 of file tree_rooms.c.

SparkOrigin

static FIELD_POS SparkOrigin

Where the sparks spring from, the tick of their 121-tick cycle, and the halfword of the scene's local state that keeps the entrance of the leaf Isaac last landed on, -1 once he jumps off.

Referenced by scTreeRoomsPlayPostBattleConversation() and scTreeRoomsSpawnSwirlSparks().

Definition at line 184 of file tree_rooms.c.

SparkTick

static Sint32 SparkTick

References Sint32.

Referenced by scTreeRoomsPlayPostBattleConversation() and scTreeRoomsSpawnSwirlSparks().

Definition at line 185 of file tree_rooms.c.

LastLeaf

static Sint16 *LastLeaf

Referenced by scInit(), scTreeRoomsJumpOffLeaf() and scTreeRoomsStepOnLeaf().

Definition at line 186 of file tree_rooms.c.

FieldEffectDurationScripts

const Sint32 *FieldEffectDurationScripts[]

References FieldEffectLongScript, FieldEffectMediumScript, FieldEffectShortScript and Sint32.

Definition at line 1381 of file tree_rooms.c.

On this page

MacrosEnumerationsFunctionsVariablesDescriptionMacros in detailTREE_ROOMS_SPEAKERLEAF_FALL_SPIN_TICKSSWIRL_SPARK_LAST_TICKSWIRL_SPARK_SHRINK_LAST_TICKTRET_TINT_COLOR_COUNTTRET_TINT_CHANNEL_MAXTRET_TINT_ENDFALL_ENTRANCE_STEPFLAG_TRET_TREE_SECOND_FLOOR_LEAF_A_TORNFLAG_TRET_TREE_SECOND_FLOOR_LEAF_B_TORNFLAG_TRET_TREE_SECOND_FLOOR_LEAF_C_TORNFLAG_TRET_TREE_SECOND_FLOOR_LEAF_D_TORNFLAG_TRET_TREE_SECOND_FLOOR_LEAF_E_TORNFLAG_TRET_TREE_SECOND_FLOOR_LEAF_F_TORNFLAG_TRET_TREE_SECOND_FLOOR_LEAF_G_TORNFLAG_TRET_TREE_SECOND_FLOOR_LEAF_H_TORNFLAG_TRET_TREE_SECOND_FLOOR_LEAF_I_TORNFLAG_TRET_TREE_THIRD_FLOOR_WEST_LEAF_TORNFLAG_TRET_TREE_THIRD_FLOOR_EAST_LEAF_TORNFLAG_TRET_TREE_FIFTH_FLOOR_CENTER_LEAF_TORNFLAG_TRET_TREE_FIFTH_FLOOR_NORTHWEST_LEAF_TORNFLAG_TRET_TREE_FIFTH_FLOOR_NORTH_LEAF_TORNFLAG_TRET_TREE_FIFTH_FLOOR_NORTHEAST_LEAF_TORNFLAG_TRET_TREE_FIFTH_FLOOR_WEST_LEAF_TORNFLAG_TRET_TREE_FIFTH_FLOOR_EAST_LEAF_TORNFLAG_TRET_TREE_FIFTH_FLOOR_SOUTHWEST_LEAF_TORNFLAG_TRET_TREE_FIFTH_FLOOR_SOUTH_LEAF_TORNFLAG_TRET_TREE_FIFTH_FLOOR_SOUTHEAST_LEAF_TORNFLAG_TRET_TREE_FIFTH_FLOOR_FAR_SOUTHEAST_LEAF_TORNEnumerations in detailanonymous enumanonymous enumTREE_ROOMS_METATILE_BEHAVIORTREE_ROOMS_FACE_CHANGEFunctions in detailscTretPaletteSaveMapColorsscTretPaletteUpdateMapTintscTreeRoomsChangeFacescTreeRoomsSpawnSwirlSparksscTreeRoomsApplyFlaggedMapPatchesscTreeRoomsLandFromFallscGetEntrancesscGetExitRegionsscGetExitsscGetActorPlacementsscTreeRoomsStepOnLeafscTreeRoomsStepOnSecondFloorLeafAscTreeRoomsStepOnSecondFloorLeafBscTreeRoomsStepOnSecondFloorLeafCscTreeRoomsStepOnSecondFloorLeafDscTreeRoomsStepOnSecondFloorLeafEscTreeRoomsStepOnSecondFloorLeafFscTreeRoomsStepOnSecondFloorLeafGscTreeRoomsStepOnSecondFloorLeafHscTreeRoomsStepOnSecondFloorLeafIscTreeRoomsStepOnThirdFloorWestLeafscTreeRoomsStepOnThirdFloorEastLeafscTreeRoomsStepOnFifthFloorCenterLeafscTreeRoomsStepOnFifthFloorNorthwestLeafscTreeRoomsStepOnFifthFloorNorthLeafscTreeRoomsStepOnFifthFloorNortheastLeafscTreeRoomsStepOnFifthFloorWestLeafscTreeRoomsStepOnFifthFloorEastLeafscTreeRoomsStepOnFifthFloorSouthwestLeafscTreeRoomsStepOnFifthFloorSouthLeafscTreeRoomsStepOnFifthFloorSoutheastLeafscTreeRoomsStepOnFifthFloorFarSoutheastLeafscTreeRoomsJumpOffLeafscGetCuesscTreeRoomsFightTretscTreeRoomsPlayPostBattleConversationscTreeRoomsApplyPostBattleStatescInitscTreeRoomsUpdateSwirlSparkscTreeRoomsCastRevealVariables in detailTreeRoomsMapPatchesTreeRoomsLeaderGathersActionsTreeRoomsGaretGathersActionsTreeRoomsIvanGathersActionsTreeRoomsMiaGathersActionsTreeRoomsFaceSinksActionsTreeRoomsWalkBackToLeaderScriptTreeRoomsTintStepsTreeRoomsEntrancesTreeRoomsRegionsTreeRoomsExitsTreeRoomsActorPlacementsTreeRoomsCuesTreeRoomsTintIndexSparkOriginSparkTickLastLeafFieldEffectDurationScripts