tolbi_ship_mast.c
The mast of the ship across the Karagol Sea, where the lookout announces the course, the approaching monsters and land, and an Anchor Charm can be found.
games/tbs/src/scene/tolbi_ship_mast.c on GitHub
The mast of the ship across the Karagol Sea, where the lookout announces the course, the approaching monsters and land, and an Anchor Charm can be found.
Functions
TolbiShipMast_RandomizeLookoutFacing
static s32 TolbiShipMast_RandomizeLookoutFacing(struct ScriptInterpreter *interpreter)
A random sample of 6 or 9 turns the lookout to either side of north.
Used by gTolbiShipMast_LookoutActions.
TolbiShipMast_GrowActorScale
static void TolbiShipMast_GrowActorScale(union FieldObject *fieldObject)
Grows both axes by the same amount until the actor reaches full scale.
Used by TolbiShipMast_RunAvastScene.
TolbiShipMast_SwayActor
static s32 TolbiShipMast_SwayActor(struct ScriptInterpreter *interpreter)
Randomly reverses horizontal drift and vertical bobbing at their limits.
Used by gTolbiShipMast_DriftActions.
TolbiShipMast_ShrinkAndStopActor
static s32 TolbiShipMast_ShrinkAndStopActor(struct ScriptInterpreter *interpreter)
Shrinks both axes; once small enough, clears the actor's position and speed.
Used by gTolbiShipMast_EnsembleWalk10, gTolbiShipMast_EnsembleWalk11, gTolbiShipMast_EnsembleWalk12, gTolbiShipMast_EnsembleWalk13, gTolbiShipMast_EnsembleWalk14, gTolbiShipMast_EnsembleWalk15, gTolbiShipMast_EnsembleWalk9.
TolbiShipMast_GetEntrances
const struct SceneEntrance *TolbiShipMast_GetEntrances(void)
Returns the entrances from the ship's deck and scripted sequences.
TolbiShipMast_GetRegions
const struct SceneRegion *TolbiShipMast_GetRegions(void)
Returns the ladder's three-dimensional activation region.
TolbiShipMast_GetExits
const u32 *TolbiShipMast_GetExits(void)
Returns exits to the deck and the continuing ship scenes.
TolbiShipMast_GetPlacements
const struct ScenePlacement *TolbiShipMast_GetPlacements(void)
Returns the lookout's initial placement table.
TolbiShipMast_GetEvents
const struct SceneEvent *TolbiShipMast_GetEvents(void)
Returns the ladder, lookout dialogue and Anchor Charm search events.
TolbiShipMast_ClimbDownLadder
static void TolbiShipMast_ClimbDownLadder(void)
Touching the ladder starts the descent.
Used by gTolbiShipMast_Events.
TolbiShipMast_FindAnchorCharm
static void TolbiShipMast_FindAnchorCharm(void)
Gives the Anchor Charm once either discovery flag permits the search.
Used by gTolbiShipMast_Events.
TolbiShipMast_Initialize
s32 TolbiShipMast_Initialize(void)
Starts the ship sway when allowed, then runs this entrance's mast sequence.
TolbiShipMast_SetupHiddenLeaderLookout
static void TolbiShipMast_SetupHiddenLeaderLookout(void)
Frames the lookout with the leader moved out of view, then announces course.
Used by TolbiShipMast_Initialize.
TolbiShipMast_SetupVisibleLeaderLookout
static void TolbiShipMast_SetupVisibleLeaderLookout(void)
Keeps the leader visible for the course announcement.
Used by TolbiShipMast_Initialize.
TolbiShipMast_AnnounceClearCourse
static void TolbiShipMast_AnnounceClearCourse(void)
The lookout scans both sides, announces a clear course and leaves by exit 10.
Used by TolbiShipMast_SetupHiddenLeaderLookout, TolbiShipMast_SetupVisibleLeaderLookout.
TolbiShipMast_RunAvastScene
static void TolbiShipMast_RunAvastScene(void)
Stages four approaching actors and the lookout's reaction. "Avast!"
Used by TolbiShipMast_Initialize.
TolbiShipMast_StopDriftingActor
static inline void TolbiShipMast_StopDriftingActor(struct FieldActor *actor)
Clears the movement left by a drifting script before its staged approach.
Used by TolbiShipMast_ShowMonsters.
TolbiShipMast_InitializeDriftingGroup
static inline void TolbiShipMast_InitializeDriftingGroup(void)
Gives each of the seven approaching actors its own random drift and bob.
Used by TolbiShipMast_AnnounceLand, TolbiShipMast_RunLandingSequence, TolbiShipMast_ShowMonsters.
TolbiShipMast_PrepareGroupDeparture
static inline void TolbiShipMast_PrepareGroupDeparture(void)
Stops the drifting actions and gives the group its departure walking speed.
Used by TolbiShipMast_AnnounceLand, TolbiShipMast_RunLandingSequence.
TolbiShipMast_ShowMonsters
static void TolbiShipMast_ShowMonsters(void)
Repeats actor 9's approach before the lookout reports monsters.
Used by TolbiShipMast_Initialize.
TolbiShipMast_InitializeDriftingActor
static void TolbiShipMast_InitializeDriftingActor(s32 actorId)
Initializes a drifting actor, retaining the random draws' original order.
Used by TolbiShipMast_InitializeDriftingGroup, TolbiShipMast_ShowMonsters.
TolbiShipMast_RunLandingSequence
static void TolbiShipMast_RunLandingSequence(void)
Moves the drifting group aside, then stages the two landing actors.
Used by TolbiShipMast_Initialize.
TolbiShipMast_AnnounceLand
static void TolbiShipMast_AnnounceLand(void)
Walks the seven actors away, then the lookout announces land.
Used by TolbiShipMast_Initialize.
TolbiShipMast_UpdateSway
static void TolbiShipMast_UpdateSway(void)
Adds horizontal and vertical sway to the camera origin each frame.
Used by TolbiShipMast_Initialize.
TolbiShipMast_GetRowingBalance
static s32 TolbiShipMast_GetRowingBalance(void)
How evenly the chosen passengers row: the values of those at the west seats (the first and third filled) less those at the east seats.
Used by TolbiShipMast_AnnounceLand.
TolbiShipMast_GetSeatRowValue
static s32 TolbiShipMast_GetSeatRowValue(u32 seat)
The rowing value of the passenger chosen for a seat, or 0 while it is empty.
Used by TolbiShipMast_GetRowingBalance.
Also, functions without a comment: TolbiShipMast_FollowCameraAndRotate.
Globals
gTolbiShipMast_PassengerRowValues
u32 gTolbiShipMast_PassengerRowValues[]
Each passenger's rowing value, in the order of their actors in the hold from 8.
Used by TolbiShipMast_GetSeatRowValue.
Also, globals without a comment: gTolbiShipMast_DriftY, gTolbiShipMast_DriftX, gTolbiShipMast_SwayY, gTolbiShipMast_SwayUnused, gTolbiShipMast_CameraCenter, gTolbiShipMast_CameraOrigin, gTolbiShipMast_SwayX, gTolbiShipMast_FollowCameraActions, gTolbiShipMast_LookoutActions, gTolbiShipMast_DriftActions, gTolbiShipMast_WaveActions, gTolbiShipMast_EnsembleWalk9, gTolbiShipMast_EnsembleWalk10, gTolbiShipMast_EnsembleWalk11, gTolbiShipMast_EnsembleWalk12, gTolbiShipMast_EnsembleWalk13, gTolbiShipMast_EnsembleWalk14, gTolbiShipMast_EnsembleWalk15, gTolbiShipMast_Entrances, gTolbiShipMast_Regions, gTolbiShipMast_Exits, gTolbiShipMast_Placements, gTolbiShipMast_StagingObjects, gTolbiShipMast_EnsembleObjects, gTolbiShipMast_LandingObjects, gTolbiShipMast_Events.