Alchemy

imil_fuchin_falls.c

The Djinni's ice room by Imil and Fuchin Falls, in seven maps: the ice room, then Fuchin Falls' four platform rooms, the room of the Ki inscription and the dragon statue's room.

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

The Djinni's ice room by Imil and Fuchin Falls, in seven maps: the ice room, then Fuchin Falls' four platform rooms, the room of the Ki inscription and the dragon statue's room.

Flags 0x301 to 0x315 belong to the cave and hold the platforms' stops: 0x301 to 0x303 the first room's, 0x304 to 0x307 the second's, 0x308 to 0x312 the third's and 0x313 to 0x315 the fourth's.

Functions

Imil_RecruitDjinni

static void Imil_RecruitDjinni(void)

Talking to the Djinni in the ice room adds it to the party.

Used by gImilFuchinFalls_DjinniRoomEvents.

Line 105

Fuchin_StartDjinnBattle

static void Fuchin_StartDjinnBattle(void)

Talking to the Djinni in the second platform room starts its battle.

Used by gImilFuchinFalls_SecondRoomEvents.

Line 110

ImilFuchinFalls_GetExits

const u32 *ImilFuchinFalls_GetExits(void)

Returns the exit connections shared by these rooms.

Line 144

Fuchin_FinishPlatformMove

static inline void Fuchin_FinishPlatformMove(void (*rebuildPlatforms)(void))

Lets the platform settle before rebuilding its room's collision cells.

Used by Fuchin_SecondRoom_MoveFirstPlatformEast, Fuchin_ThirdRoom_MoveFirstPlatformEastFromMiddle, Fuchin_ThirdRoom_MoveFirstPlatformEastFromWestEnd, Fuchin_ThirdRoom_MoveFirstPlatformWest, Fuchin_ThirdRoom_MoveFirstPlatformWestIfClear, Fuchin_ThirdRoom_MoveFourthPlatformNorth, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromNorthEnd, Fuchin_ThirdRoom_MoveThirdPlatformNorthFromSouthEnd, Fuchin_ThirdRoom_MoveThirdPlatformSouthFromNorthEnd, Fuchin_ThirdRoom_MoveThirdPlatformSouthFromUpperStop.

Line 173

Fuchin_ClearFourthPlatformStops

static void Fuchin_ClearFourthPlatformStops(void)

Clears all saved intermediate stops for the fourth platform.

Used by Fuchin_ThirdRoom_MoveFourthPlatformSouthFromLastStop, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromLowerStop, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromMiddle, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromNorthEnd, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromUpperStop.

Line 547

Fuchin_AnimateFirstPlatform

static void Fuchin_AnimateFirstPlatform(void)

Advances the first platform through its two rolling animations.

Used by gImilFuchinFalls_FirstRoomEvents, gImilFuchinFalls_FourthRoomEvents, gImilFuchinFalls_SecondRoomEvents, gImilFuchinFalls_ThirdRoomEvents.

Line 664

Fuchin_AnimateSecondPlatform

static void Fuchin_AnimateSecondPlatform(void)

Advances the second platform through its two rolling animations.

Used by gImilFuchinFalls_FirstRoomEvents, gImilFuchinFalls_FourthRoomEvents, gImilFuchinFalls_SecondRoomEvents, gImilFuchinFalls_ThirdRoomEvents.

Line 670

Fuchin_AnimateThirdPlatform

static void Fuchin_AnimateThirdPlatform(void)

Advances the third platform through its two rolling animations.

Used by gImilFuchinFalls_FirstRoomEvents, gImilFuchinFalls_FourthRoomEvents, gImilFuchinFalls_SecondRoomEvents, gImilFuchinFalls_ThirdRoomEvents.

Line 676

Fuchin_AnimateFourthPlatform

static void Fuchin_AnimateFourthPlatform(void)

Advances the fourth platform through its two rolling animations.

Used by gImilFuchinFalls_ThirdRoomEvents.

Line 682

Fuchin_CreateForegroundActor

static struct FieldActor *Fuchin_CreateForegroundActor(s32 x, s32 y, s32 z, s32 resourceId)

Creates a stationary foreground actor with its palette and priority set.

Used by ImilFuchinFalls_PrepareRoom.

Line 688

Imil_LeaveDjinnRoom

static void Imil_LeaveDjinnRoom(void)

Faces the leader south and leaves the Imil Djinn room.

Used by gImilFuchinFalls_DjinniRoomEvents.

Line 731

Imil_MoveAcrossIce

static void Imil_MoveAcrossIce(void)

Starts sliding the selected actor in the held direction.

Used by gImilFuchinFalls_DjinniRoomEvents.

Line 744

Fuchin_PlacePlatformAtCell

static void Fuchin_PlacePlatformAtCell(s32 id, s32 column, s32 row)

Centers a platform on its cell and gives it underfoot priority.

Used by Fuchin_RebuildFirstRoomPlatforms, Fuchin_RebuildFourthRoomPlatforms, Fuchin_RebuildSecondRoomPlatforms, Fuchin_RebuildThirdRoomPlatforms.

Line 747

Fuchin_RebuildFirstRoomPlatforms

static void Fuchin_RebuildFirstRoomPlatforms(void)

Restores platform positions and collision cells in the first puzzle room.

Used by Fuchin_FirstRoom_MoveFirstPlatformEast, Fuchin_FirstRoom_MoveFirstPlatformWest, Fuchin_FirstRoom_MoveSecondPlatformNorth, Fuchin_FirstRoom_MoveSecondPlatformSouth, Fuchin_FirstRoom_MoveThirdPlatformNorth, Fuchin_FirstRoom_MoveThirdPlatformSouth, ImilFuchinFalls_RebuildPlatformRoom.

Line 760

Fuchin_RebuildSecondRoomPlatforms

static void Fuchin_RebuildSecondRoomPlatforms(void)

Restores platform positions and collision cells in the second puzzle room.

Used by Fuchin_SecondRoom_MoveFirstPlatformEast, Fuchin_SecondRoom_MoveFirstPlatformToEastEnd, Fuchin_SecondRoom_MoveFirstPlatformToWestEnd, Fuchin_SecondRoom_MoveSecondPlatformNorth, Fuchin_SecondRoom_MoveSecondPlatformSouth, Fuchin_SecondRoom_MoveThirdPlatformNorth, Fuchin_SecondRoom_MoveThirdPlatformSouth, Fuchin_SecondRoom_NudgeFirstPlatformWest, ImilFuchinFalls_RebuildPlatformRoom.

Line 817

Fuchin_RebuildThirdRoomPlatforms

static void Fuchin_RebuildThirdRoomPlatforms(void)

Restores the interacting platform stops and collision cells in the third room.

Used by Fuchin_ThirdRoom_MoveFirstPlatformEastFromMiddle, Fuchin_ThirdRoom_MoveFirstPlatformEastFromWestEnd, Fuchin_ThirdRoom_MoveFirstPlatformWest, Fuchin_ThirdRoom_MoveFirstPlatformWestIfClear, Fuchin_ThirdRoom_MoveFourthPlatformNorth, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromLastStop, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromLowerStop, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromMiddle, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromNorthEnd, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromUpperStop, Fuchin_ThirdRoom_MoveSecondPlatformEast, Fuchin_ThirdRoom_MoveSecondPlatformWest, Fuchin_ThirdRoom_MoveThirdPlatformNorthFromLowerStop, Fuchin_ThirdRoom_MoveThirdPlatformNorthFromMiddle, Fuchin_ThirdRoom_MoveThirdPlatformNorthFromSouthEnd, Fuchin_ThirdRoom_MoveThirdPlatformSouthFromLowerStop, Fuchin_ThirdRoom_MoveThirdPlatformSouthFromMiddle, Fuchin_ThirdRoom_MoveThirdPlatformSouthFromNorthEnd, Fuchin_ThirdRoom_MoveThirdPlatformSouthFromUpperStop, Fuchin_ThirdRoom_NudgeFourthPlatformNorth, Fuchin_ThirdRoom_NudgeThirdPlatformNorth, ImilFuchinFalls_RebuildPlatformRoom.

Line 902

Fuchin_RebuildFourthRoomPlatforms

static void Fuchin_RebuildFourthRoomPlatforms(void)

Restores both halves of the fourth puzzle room from its saved platform stops.

Used by Fuchin_FourthRoom_MoveFirstPlatformNorth, Fuchin_FourthRoom_MoveFirstPlatformSouth, Fuchin_FourthRoom_MoveSecondPlatformEast, Fuchin_FourthRoom_MoveSecondPlatformWest, Fuchin_FourthRoom_MoveThirdPlatformEast, Fuchin_FourthRoom_MoveThirdPlatformWest, ImilFuchinFalls_RebuildPlatformRoom.

Line 1009

Fuchin_FollowLeaderWithLight

static void Fuchin_FollowLeaderWithLight(void)

Attaches the active cave light to the party leader.

Used by gImilFuchinFalls_DragonRoomEvents.

Line 1074

Fuchin_StopLightFollowingLeader

static void Fuchin_StopLightFollowingLeader(void)

Detaches the active cave light from the party leader.

Used by gImilFuchinFalls_DragonRoomEvents.

Line 1083

ImilFuchinFalls_Initialize

s32 ImilFuchinFalls_Initialize(void)

Entering the Djinni's ice room the first time, the leader walks toward the Djinni; otherwise each room restores its platforms, eye and lighting.

Line 1093

Imil_WalkTowardDjinni

static void Imil_WalkTowardDjinni(void)

Shows the Imil Djinni and walks the leader toward it.

Used by ImilFuchinFalls_Initialize.

Line 1106

ImilFuchinFalls_PrepareRoom

static void ImilFuchinFalls_PrepareRoom(void)

Restores room props and the cave light for this entrance.

Used by ImilFuchinFalls_Initialize.

Line 1119

ImilFuchinFalls_RebuildPlatformRoom

static void ImilFuchinFalls_RebuildPlatformRoom(void)

Restores the collision templates for the current platform room.

Used by ImilFuchinFalls_PrepareRoom.

Line 1173

ImilFuchinFalls_HopOnTrigger

static void ImilFuchinFalls_HopOnTrigger(void)

Hops across a platform edge when its current stop permits it.

Used by gImilFuchinFalls_SecondRoomEvents, gImilFuchinFalls_ThirdRoomEvents.

Line 1195

Fuchin_HopNorth

static void Fuchin_HopNorth(void)

Hops the leader one gap north.

Used by gImilFuchinFalls_ThirdRoomEvents.

Line 1212

Fuchin_HopWest

static void Fuchin_HopWest(void)

Hops the leader one gap west.

Used by gImilFuchinFalls_ThirdRoomEvents.

Line 1215

ImilFuchinFalls_HopBy

static void ImilFuchinFalls_HopBy(s32 dx, s32 dz)

Jumps the leader by a pixel offset while using the hopping animations.

Used by Fuchin_HopNorth, Fuchin_HopWest, ImilFuchinFalls_HopOnTrigger.

Line 1218

ImilFuchinFalls_PlaceDragonsEye

static void ImilFuchinFalls_PlaceDragonsEye(void)

Creates the collectible eye and uploads its item icon.

Used by ImilFuchinFalls_PrepareRoom.

Line 1230

Fuchin_CollectDragonsEye

static void Fuchin_CollectDragonsEye(void)

Gives the eye to the party and removes its displayed actor.

Used by gImilFuchinFalls_ThirdRoomEvents.

Line 1254

Fuchin_UpdateDustMotion

static void Fuchin_UpdateDustMotion(union FieldObject *raw)

Applies the dust velocity and scale change for one frame.

Used by ImilFuchinFalls_SpawnDust.

Line 1272

Fuchin_SetDustPalette

static s32 Fuchin_SetDustPalette(struct ScriptInterpreter *interpreter)

Selects the dust palette when its object script finishes looping.

Used by gImilFuchinFalls_DustScript0, gImilFuchinFalls_DustScript1, gImilFuchinFalls_DustScript2.

Line 1283

ImilFuchinFalls_SpawnDust

void ImilFuchinFalls_SpawnDust(s32 x, s32 y, s32 z, s32 velocityX, s32 velocityY, s32 velocityZ, u32 flags, const struct EffectOptions *extra)

Creates scripted cave dust with the requested velocity, palette and scale.

Used by ImilFuchinFalls_BlowCaveMouthDust.

Line 1290

ImilFuchinFalls_BlowCaveMouthDust

static void ImilFuchinFalls_BlowCaveMouthDust(void)

Emits cave-mouth dust every fourth frame while the dragon awakens.

Used by Fuchin_LightDragonWithEye.

Line 1343

Fuchin_LightDragonWithEye

static void Fuchin_LightDragonWithEye(void)

Inserts the eye, lights the dragon room and reveals its hidden path.

Used by gImilFuchinFalls_DragonRoomEvents.

Line 1368

Fuchin_ReadDragonFlameInscription

static void Fuchin_ReadDragonFlameInscription(void)

Reads the inscription describing the dragon flame.

Used by gImilFuchinFalls_FirstRoomEvents.

Line 1416

Fuchin_ReadKiInscription

static void Fuchin_ReadKiInscription(void)

Reads the inscription about the secret power of Ki.

Used by gImilFuchinFalls_KiRoomEvents.

Line 1423

Fuchin_ReadShadowInscription

static void Fuchin_ReadShadowInscription(void)

Reads the inscription about light revealing shadows.

Used by gImilFuchinFalls_DragonRoomEvents.

Line 1430

Fuchin_SearchDragonStatue

static void Fuchin_SearchDragonStatue(void)

Describes the dragon eyes or offers to insert the carried eye.

Used by gImilFuchinFalls_DragonRoomEvents.

Line 1437

Fuchin_EndRevealLighting

static void Fuchin_EndRevealLighting(void)

Restores the dark cave lighting when Reveal expires.

Used by gImilFuchinFalls_DragonRoomEvents.

Line 1452

Imil_TurnSkaterTowardHeldDirection

static void Imil_TurnSkaterTowardHeldDirection(union FieldObject *object)

Turns the sliding actor gradually toward the held direction.

Used by Imil_SlideActorAcrossIce.

Line 1471

Imil_SlideActorAcrossIce

static void Imil_SlideActorAcrossIce(void)

Slides along the ice until terrain or a collision boundary ends the move.

Used by Imil_MoveAcrossIce.

Line 1501

Also, functions without a comment: ImilFuchinFalls_GetEntrances, ImilFuchinFalls_GetRegions, ImilFuchinFalls_GetPlacements, Fuchin_FirstRoom_MoveFirstPlatformEast, Fuchin_FirstRoom_MoveFirstPlatformWest, Fuchin_FirstRoom_MoveSecondPlatformSouth, Fuchin_FirstRoom_MoveSecondPlatformNorth, Fuchin_FirstRoom_MoveThirdPlatformSouth, Fuchin_FirstRoom_MoveThirdPlatformNorth, Fuchin_SecondRoom_MoveFirstPlatformToEastEnd, Fuchin_SecondRoom_MoveFirstPlatformToWestEnd, Fuchin_SecondRoom_NudgeFirstPlatformWest, Fuchin_SecondRoom_MoveFirstPlatformEast, Fuchin_SecondRoom_MoveSecondPlatformSouth, Fuchin_SecondRoom_MoveSecondPlatformNorth, Fuchin_SecondRoom_MoveThirdPlatformSouth, Fuchin_SecondRoom_MoveThirdPlatformNorth, Fuchin_ThirdRoom_MoveFirstPlatformWest, Fuchin_ThirdRoom_MoveFirstPlatformEastFromMiddle, Fuchin_ThirdRoom_MoveFirstPlatformWestIfClear, Fuchin_ThirdRoom_MoveFirstPlatformEastFromWestEnd, Fuchin_ThirdRoom_MoveSecondPlatformWest, Fuchin_ThirdRoom_MoveSecondPlatformEast, Fuchin_ThirdRoom_MoveThirdPlatformNorthFromSouthEnd, Fuchin_ThirdRoom_MoveThirdPlatformSouthFromNorthEnd, Fuchin_ThirdRoom_NudgeThirdPlatformNorth, Fuchin_ThirdRoom_MoveThirdPlatformSouthFromUpperStop, Fuchin_ThirdRoom_MoveThirdPlatformNorthFromMiddle, Fuchin_ThirdRoom_MoveThirdPlatformSouthFromMiddle, Fuchin_ThirdRoom_MoveThirdPlatformNorthFromLowerStop, Fuchin_ThirdRoom_MoveThirdPlatformSouthFromLowerStop, Fuchin_ThirdRoom_MoveFourthPlatformNorth, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromNorthEnd, Fuchin_ThirdRoom_NudgeFourthPlatformNorth, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromUpperStop, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromMiddle, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromLowerStop, Fuchin_ThirdRoom_MoveFourthPlatformSouthFromLastStop, Fuchin_FourthRoom_MoveFirstPlatformSouth, Fuchin_FourthRoom_MoveFirstPlatformNorth, Fuchin_FourthRoom_MoveSecondPlatformWest, Fuchin_FourthRoom_MoveSecondPlatformEast, Fuchin_FourthRoom_MoveThirdPlatformEast, Fuchin_FourthRoom_MoveThirdPlatformWest, ImilFuchinFalls_GetEvents.

Structures

CaveDustOptions

struct CaveDustOptions

EffectOptions cut after its scales: the caller's frame holds only these 24 bytes.

FieldDeclared as
prioritys32 priority
palettes32 palette
startScaleXs32 startScaleX
startScaleYs32 startScaleY
targetScaleXs32 targetScaleX
targetScaleYs32 targetScaleY

Used by ImilFuchinFalls_BlowCaveMouthDust.

Line 82

Enumerations

ImilFuchinFallsActor

enum ImilFuchinFallsActor

Value=
ACTOR_IMIL_DJINNI8in the ice room
ACTOR_FIRST_PLATFORM8The platforms, in each platform room
ACTOR_SECOND_PLATFORM9
ACTOR_THIRD_PLATFORM10
ACTOR_FOURTH_PLATFORM11
ACTOR_FUCHIN_DJINNI11in the second platform room

Line 53

Globals, without a comment: gImilFuchinFalls_TrackLeader, gImilFuchinFalls_KeyHeadings, gImilFuchinFalls_SlideHeadings, gImilFuchinFalls_DragonsEye, gImilFuchinFalls_NoEntrances, gImilFuchinFalls_DjinniRoomEntrances, gImilFuchinFalls_FirstRoomEntrances, gImilFuchinFalls_SecondRoomEntrances, gImilFuchinFalls_ThirdRoomEntrances, gImilFuchinFalls_FourthRoomEntrances, gImilFuchinFalls_KiRoomEntrances, gImilFuchinFalls_DragonRoomEntrances, gImilFuchinFalls_Exits, gImilFuchinFalls_NoPlacements, gImilFuchinFalls_DjinniRoomPlacements, gImilFuchinFalls_FirstRoomPlacements, gImilFuchinFalls_SecondRoomPlacements, gImilFuchinFalls_ThirdRoomPlacements, gImilFuchinFalls_FourthRoomPlacements, gImilFuchinFalls_DragonRoomPlacements, gImilFuchinFalls_NoEvents, gImilFuchinFalls_DjinniRoomEvents, gImilFuchinFalls_FirstRoomEvents, gImilFuchinFalls_SecondRoomEvents, gImilFuchinFalls_ThirdRoomEvents, gImilFuchinFalls_FourthRoomEvents, gImilFuchinFalls_KiRoomEvents, gImilFuchinFalls_DragonRoomEvents, gImilFuchinFalls_DustScript0, gImilFuchinFalls_DustScript1, gImilFuchinFalls_DustScript2.

On this page