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.
Fuchin_StartDjinnBattle
static void Fuchin_StartDjinnBattle(void)
Talking to the Djinni in the second platform room starts its battle.
Used by gImilFuchinFalls_SecondRoomEvents.
ImilFuchinFalls_GetExits
const u32 *ImilFuchinFalls_GetExits(void)
Returns the exit connections shared by these rooms.
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.
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.
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.
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.
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.
Fuchin_AnimateFourthPlatform
static void Fuchin_AnimateFourthPlatform(void)
Advances the fourth platform through its two rolling animations.
Used by gImilFuchinFalls_ThirdRoomEvents.
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.
Imil_LeaveDjinnRoom
static void Imil_LeaveDjinnRoom(void)
Faces the leader south and leaves the Imil Djinn room.
Used by gImilFuchinFalls_DjinniRoomEvents.
Imil_MoveAcrossIce
static void Imil_MoveAcrossIce(void)
Starts sliding the selected actor in the held direction.
Used by gImilFuchinFalls_DjinniRoomEvents.
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.
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.
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.
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.
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.
Fuchin_FollowLeaderWithLight
static void Fuchin_FollowLeaderWithLight(void)
Attaches the active cave light to the party leader.
Used by gImilFuchinFalls_DragonRoomEvents.
Fuchin_StopLightFollowingLeader
static void Fuchin_StopLightFollowingLeader(void)
Detaches the active cave light from the party leader.
Used by gImilFuchinFalls_DragonRoomEvents.
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.
Imil_WalkTowardDjinni
static void Imil_WalkTowardDjinni(void)
Shows the Imil Djinni and walks the leader toward it.
Used by ImilFuchinFalls_Initialize.
ImilFuchinFalls_PrepareRoom
static void ImilFuchinFalls_PrepareRoom(void)
Restores room props and the cave light for this entrance.
Used by ImilFuchinFalls_Initialize.
ImilFuchinFalls_RebuildPlatformRoom
static void ImilFuchinFalls_RebuildPlatformRoom(void)
Restores the collision templates for the current platform room.
Used by ImilFuchinFalls_PrepareRoom.
ImilFuchinFalls_HopOnTrigger
static void ImilFuchinFalls_HopOnTrigger(void)
Hops across a platform edge when its current stop permits it.
Used by gImilFuchinFalls_SecondRoomEvents, gImilFuchinFalls_ThirdRoomEvents.
Fuchin_HopNorth
static void Fuchin_HopNorth(void)
Hops the leader one gap north.
Used by gImilFuchinFalls_ThirdRoomEvents.
Fuchin_HopWest
static void Fuchin_HopWest(void)
Hops the leader one gap west.
Used by gImilFuchinFalls_ThirdRoomEvents.
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.
ImilFuchinFalls_PlaceDragonsEye
static void ImilFuchinFalls_PlaceDragonsEye(void)
Creates the collectible eye and uploads its item icon.
Used by ImilFuchinFalls_PrepareRoom.
Fuchin_CollectDragonsEye
static void Fuchin_CollectDragonsEye(void)
Gives the eye to the party and removes its displayed actor.
Used by gImilFuchinFalls_ThirdRoomEvents.
Fuchin_UpdateDustMotion
static void Fuchin_UpdateDustMotion(union FieldObject *raw)
Applies the dust velocity and scale change for one frame.
Used by ImilFuchinFalls_SpawnDust.
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.
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.
ImilFuchinFalls_BlowCaveMouthDust
static void ImilFuchinFalls_BlowCaveMouthDust(void)
Emits cave-mouth dust every fourth frame while the dragon awakens.
Used by Fuchin_LightDragonWithEye.
Fuchin_LightDragonWithEye
static void Fuchin_LightDragonWithEye(void)
Inserts the eye, lights the dragon room and reveals its hidden path.
Used by gImilFuchinFalls_DragonRoomEvents.
Fuchin_ReadDragonFlameInscription
static void Fuchin_ReadDragonFlameInscription(void)
Reads the inscription describing the dragon flame.
Used by gImilFuchinFalls_FirstRoomEvents.
Fuchin_ReadKiInscription
static void Fuchin_ReadKiInscription(void)
Reads the inscription about the secret power of Ki.
Used by gImilFuchinFalls_KiRoomEvents.
Fuchin_ReadShadowInscription
static void Fuchin_ReadShadowInscription(void)
Reads the inscription about light revealing shadows.
Used by gImilFuchinFalls_DragonRoomEvents.
Fuchin_SearchDragonStatue
static void Fuchin_SearchDragonStatue(void)
Describes the dragon eyes or offers to insert the carried eye.
Used by gImilFuchinFalls_DragonRoomEvents.
Fuchin_EndRevealLighting
static void Fuchin_EndRevealLighting(void)
Restores the dark cave lighting when Reveal expires.
Used by gImilFuchinFalls_DragonRoomEvents.
Imil_TurnSkaterTowardHeldDirection
static void Imil_TurnSkaterTowardHeldDirection(union FieldObject *object)
Turns the sliding actor gradually toward the held direction.
Used by Imil_SlideActorAcrossIce.
Imil_SlideActorAcrossIce
static void Imil_SlideActorAcrossIce(void)
Slides along the ice until terrain or a collision boundary ends the move.
Used by Imil_MoveAcrossIce.
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.
| Field | Declared as | |
|---|---|---|
priority | s32 priority | |
palette | s32 palette | |
startScaleX | s32 startScaleX | |
startScaleY | s32 startScaleY | |
targetScaleX | s32 targetScaleX | |
targetScaleY | s32 targetScaleY |
Used by ImilFuchinFalls_BlowCaveMouthDust.
Enumerations
ImilFuchinFallsActor
enum ImilFuchinFallsActor
| Value | = | |
|---|---|---|
ACTOR_IMIL_DJINNI | 8 | in the ice room |
ACTOR_FIRST_PLATFORM | 8 | The platforms, in each platform room |
ACTOR_SECOND_PLATFORM | 9 | |
ACTOR_THIRD_PLATFORM | 10 | |
ACTOR_FOURTH_PLATFORM | 11 | |
ACTOR_FUCHIN_DJINNI | 11 | in the second platform room |
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.