Alchemy

tret_tree_interiors.c

Inside Tret, the great tree: cracked floors that give way under the leader on the second step, and Tret's face, which attacks the party.

games/tbs/src/scene/tret_tree_interiors.c on GitHub

Inside Tret, the great tree: cracked floors that give way under the leader on the second step, and Tret's face, which attacks the party.

Functions

Scene_GetEntrances

const struct SceneEntrance *Scene_GetEntrances(void)

Returns the interior entrance and landing positions.

Line 88

Scene_GetRegions

const struct SceneRegion *Scene_GetRegions(void)

Returns the upper exit regions for the tree interior.

Line 93

Scene_GetPlacements

const struct ScenePlacement *Scene_GetPlacements(void)

Returns the staged party and Tret actors.

Line 100

TretTreeInteriors_StepOnCrackedFloor

static void TretTreeInteriors_StepOnCrackedFloor(s32 floorFlag, s32 sourceColumn, s32 sourceRow, s32 entrance)

Stepping on a cracked floor tile: the first step cracks it further and sets its temporary flag; the next step breaks it, and the leader spins and falls through, to land at the given entrance.

Used by Event_FloorGivesWayToLowerMiddleCenter, Event_FloorGivesWayToLowerMiddleEast, Event_FloorGivesWayToLowerMiddleNorth, Event_FloorGivesWayToLowerMiddleNortheast, Event_FloorGivesWayToLowerMiddleNorthwest, Event_FloorGivesWayToLowerMiddleSouth, Event_FloorGivesWayToLowerMiddleSoutheast, Event_FloorGivesWayToLowerMiddleSouthwest, Event_FloorGivesWayToLowerMiddleWestA, Event_FloorGivesWayToLowerMiddleWestB, Event_FloorGivesWayToUpperMiddleNortheast, Event_FloorGivesWayToUpperMiddleNorthwest, Event_FloorGivesWayToUpperMiddleSouthLower, Event_FloorGivesWayToUpperMiddleSouthUpper, Event_FloorGivesWayToUpperMiddleSoutheastLower, Event_FloorGivesWayToUpperMiddleSouthwestLower, Event_FloorGivesWayToUpperMiddleSouthwestUpper, Event_FloorGivesWayToUpperMiddleWestLower, Event_FloorGivesWayToUpperMiddleWestUpper, Event_FloorGivesWayToUpperRightNortheast, Event_FloorGivesWayToUpperRightNorthwest.

Line 107

Event_FloorGivesWayToLowerMiddleWestB

static void Event_FloorGivesWayToLowerMiddleWestB(void)

A second cracked floor over the same lower middle west landing.

Used by gTretTreeInteriorsEvents.

Line 226

Event_ResetFloorLatchWhenClear

static void Event_ResetFloorLatchWhenClear(void)

Walking off a cracked floor tile lets the next step on it count again.

Used by gTretTreeInteriorsEvents.

Line 243

Scene_GetEvents

const struct SceneEvent *Scene_GetEvents(void)

Returns the floor, story, Reveal and search event bindings.

Line 249

Event_FightTret

static void Event_FightTret(void)

Walking up to Tret (touch trigger 40, until FLAG_TRET_DEFEATED): he roars, the party gathers in front of him, and he scorns them before the battle with him starts. "Hm... HROOOM!!!" and "You hoped to find my kindly self?" The battle returns to entrance 19.

Used by gTretTreeInteriorsEvents.

Line 257

TretTreeInteriors_PlayPostBattleConversation

static void TretTreeInteriors_PlayPostBattleConversation(void)

After the battle: a passage opens beside Tret, who comes to, thanks the party and says good-bye. "Oh... Mmmmm..." Garet and Ivan stop him and he asks whether they need something; answering no earns the leader a scolding. Tret learns he turned the people of Kolima into trees, tries to free them in a swirl of sparks but cannot, and the party resolve to heal him. Sets FLAG_TRET_DEFEATED.

Used by TretTreeInteriors_ApplyPostBattleState.

Line 341

TretTreeInteriors_ApplyPostBattleState

static void TretTreeInteriors_ApplyPostBattleState(s32 playRecoveryScene)

Restores the post-battle map and optionally plays its conversation.

Used by TretTreeInteriors_EnterRoom.

Line 547

TretTreeInteriors_EnterRoom

s32 TretTreeInteriors_EnterRoom(void)

Restores the room, tint and entry fall before continuing its story event.

Line 570

TretPalette_SaveSceneColors

static void TretPalette_SaveSceneColors(void)

Saves background palettes 0 to 13 as the base for Tret's scene tint.

Used by TretTreeInteriors_EnterRoom.

Line 653

TretPalette_UpdateSceneTint

static void TretPalette_UpdateSceneTint(void)

Tints background colours 16 to 78 every thirty-two frames, leaving palette 4's last colour alone. Each later palette receives a weaker tint.

Used by Event_CastReveal, TretTreeInteriors_EnterRoom, TretTreeInteriors_PlayPostBattleConversation.

Line 660

TretTreeInteriors_PlayGesture

static void TretTreeInteriors_PlayGesture(s32 gesture)

Plays a Tret animation sequence with its original pauses.

Used by Event_FightTret, TretTreeInteriors_EnterRoom, TretTreeInteriors_PlayPostBattleConversation.

Line 729

TretTreeInteriors_UpdateSwirlSpark

static void TretTreeInteriors_UpdateSwirlSpark(union FieldObject *fieldObject)

Moves a fading spark outward from its saved origin, then releases it.

Used by TretTreeInteriors_SpawnSwirlSparks.

Line 802

TretTreeInteriors_SpawnSwirlSparks

static void TretTreeInteriors_SpawnSwirlSparks(void)

Emits five shrinking waves of fading sparks from the saved origin.

Used by TretTreeInteriors_PlayPostBattleConversation.

Line 833

TretTreeInteriors_ApplyFlaggedMapPatches

static void TretTreeInteriors_ApplyFlaggedMapPatches(void)

Restores each enabled single-cell patch whose puzzle flag is set.

Used by TretTreeInteriors_EnterRoom.

Line 892

Event_CastReveal

static void Event_CastReveal(void)

Stops the scene tint while Reveal is active.

Used by gTretTreeBranch_Events, gTretTreeInteriorsEvents.

Line 907

TretTreeInteriors_RunLandingDustScene

static void TretTreeInteriors_RunLandingDustScene(void)

Drops the leader into the room with a ring of landing particles.

Used by TretTreeInteriors_EnterRoom.

Line 914

Also, functions without a comment: Scene_GetExits, Event_FloorGivesWayToUpperMiddleNorthwest, Event_FloorGivesWayToUpperMiddleNortheast, Event_FloorGivesWayToUpperMiddleWestUpper, Event_FloorGivesWayToUpperMiddleWestLower, Event_FloorGivesWayToUpperMiddleSouthwestUpper, Event_FloorGivesWayToUpperMiddleSouthUpper, Event_FloorGivesWayToUpperMiddleSouthwestLower, Event_FloorGivesWayToUpperMiddleSouthLower, Event_FloorGivesWayToUpperMiddleSoutheastLower, Event_FloorGivesWayToUpperRightNorthwest, Event_FloorGivesWayToUpperRightNortheast, Event_FloorGivesWayToLowerMiddleCenter, Event_FloorGivesWayToLowerMiddleNorthwest, Event_FloorGivesWayToLowerMiddleNorth, Event_FloorGivesWayToLowerMiddleNortheast, Event_FloorGivesWayToLowerMiddleWestA, Event_FloorGivesWayToLowerMiddleEast, Event_FloorGivesWayToLowerMiddleSouthwest, Event_FloorGivesWayToLowerMiddleSouth, Event_FloorGivesWayToLowerMiddleSoutheast.

Macros

SPEAKER

#define SPEAKER(actor) (SPEAKER_WINDOW_BELOW | (actor))

The speaker of a message; every speaker in this scene has SPEAKER_WINDOW_BELOW.

Used by Event_FightTret, TolbiShipDeck_ArriveAtTolbi, TolbiShipDeck_MonstersBoard, TolbiShipDeck_ReturnFromIsland, TolbiShipDeck_SightSeaMonsters, TolbiShipDeck_WatchCrewDecideToSail, TolbiShipInteriors_WatchWarriorsStormOff, TretTreeInteriors_PlayPostBattleConversation.

Line 56

Also, macros without a comment: FLOOR_FALL_SPIN_FRAMES, SWIRL_SPARK_LAST_FRAME, SWIRL_SPARK_SHRINK_LAST_FRAME, TRET_TINT_COLOR_COUNT, TRET_TINT_CHANNEL_MAX, TRET_TINT_END.

Globals, without a comment: sSparkOrigin, sSparkFrame, sLastFloorEntrance, gEffectScript0, gEffectScript1, gEffectScript2, gTretTreeInteriors_MapPatches, gEffectScripts, gTretTreeInteriors_TableActions0, gTretTreeInteriors_TableActions1, gTretTreeInteriors_TableActions2, gTretTreeInteriors_TableActions3, gTretTreeInteriors_ActionTable1, gTretTreeInteriors_ActionTable2, gTretTreeInteriors_TintSteps, gTretTreeInteriorsEntrances, gTretTreeInteriorsRegions, gTretTreeInteriorsExits, gTretTreeInteriorsPlacements, gTretTreeInteriorsEvents, gTretTreeInteriors_TintIndex.

On this page