Alchemy

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.

Line 76

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.

Line 95

TolbiShipMast_SwayActor

static s32 TolbiShipMast_SwayActor(struct ScriptInterpreter *interpreter)

Randomly reverses horizontal drift and vertical bobbing at their limits.

Used by gTolbiShipMast_DriftActions.

Line 104

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.

Line 148

TolbiShipMast_GetEntrances

const struct SceneEntrance *TolbiShipMast_GetEntrances(void)

Returns the entrances from the ship's deck and scripted sequences.

Line 169

TolbiShipMast_GetRegions

const struct SceneRegion *TolbiShipMast_GetRegions(void)

Returns the ladder's three-dimensional activation region.

Line 174

TolbiShipMast_GetExits

const u32 *TolbiShipMast_GetExits(void)

Returns exits to the deck and the continuing ship scenes.

Line 179

TolbiShipMast_GetPlacements

const struct ScenePlacement *TolbiShipMast_GetPlacements(void)

Returns the lookout's initial placement table.

Line 182

TolbiShipMast_GetEvents

const struct SceneEvent *TolbiShipMast_GetEvents(void)

Returns the ladder, lookout dialogue and Anchor Charm search events.

Line 187

TolbiShipMast_ClimbDownLadder

static void TolbiShipMast_ClimbDownLadder(void)

Touching the ladder starts the descent.

Used by gTolbiShipMast_Events.

Line 192

TolbiShipMast_FindAnchorCharm

static void TolbiShipMast_FindAnchorCharm(void)

Gives the Anchor Charm once either discovery flag permits the search.

Used by gTolbiShipMast_Events.

Line 195

TolbiShipMast_Initialize

s32 TolbiShipMast_Initialize(void)

Starts the ship sway when allowed, then runs this entrance's mast sequence.

Line 207

TolbiShipMast_SetupHiddenLeaderLookout

static void TolbiShipMast_SetupHiddenLeaderLookout(void)

Frames the lookout with the leader moved out of view, then announces course.

Used by TolbiShipMast_Initialize.

Line 270

TolbiShipMast_SetupVisibleLeaderLookout

static void TolbiShipMast_SetupVisibleLeaderLookout(void)

Keeps the leader visible for the course announcement.

Used by TolbiShipMast_Initialize.

Line 284

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.

Line 301

TolbiShipMast_RunAvastScene

static void TolbiShipMast_RunAvastScene(void)

Stages four approaching actors and the lookout's reaction. "Avast!"

Used by TolbiShipMast_Initialize.

Line 323

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.

Line 408

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.

Line 417

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.

Line 428

TolbiShipMast_ShowMonsters

static void TolbiShipMast_ShowMonsters(void)

Repeats actor 9's approach before the lookout reports monsters.

Used by TolbiShipMast_Initialize.

Line 446

TolbiShipMast_InitializeDriftingActor

static void TolbiShipMast_InitializeDriftingActor(s32 actorId)

Initializes a drifting actor, retaining the random draws' original order.

Used by TolbiShipMast_InitializeDriftingGroup, TolbiShipMast_ShowMonsters.

Line 533

TolbiShipMast_RunLandingSequence

static void TolbiShipMast_RunLandingSequence(void)

Moves the drifting group aside, then stages the two landing actors.

Used by TolbiShipMast_Initialize.

Line 556

TolbiShipMast_AnnounceLand

static void TolbiShipMast_AnnounceLand(void)

Walks the seven actors away, then the lookout announces land.

Used by TolbiShipMast_Initialize.

Line 657

TolbiShipMast_UpdateSway

static void TolbiShipMast_UpdateSway(void)

Adds horizontal and vertical sway to the camera origin each frame.

Used by TolbiShipMast_Initialize.

Line 706

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.

Line 724

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.

Line 736

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.

Line 952

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.

On this page