33#include "text/msg_ids.h"
45#define FLAG_TOLBI_SHIP_ROWER_CHOSEN 0x300
46#define FLAG_TOLBI_SHIP_MONSTERS_ABOARD 0x301
49#define FLAG_TOLBI_SHIP_KRAKEN_ABOARD 0x302
91#define SPEAKER(actor, window) ((window) << 12 | (actor))
140 s32 secondSeatFlags);
161 s16 verticalMotionDirection;
168 actor->
y.
fixed = descendingY;
169 if (descendingY < 0) {
170 verticalMotionDirection = 0;
171 actor->
work = verticalMotionDirection;
176 actor->
y.
fixed = ascendingY;
177 if (ascendingY >
PIXELS(8)) {
178 verticalMotionDirection = 1;
179 actor->
work = verticalMotionDirection;
195 }
else if (choice == 9) {
206 s32 frame = *counter + 1;
209 if ((
u8)frame > 80) {
219 if (remaining != 0) {
260 if (leader->
paused == 0) {
267 if (leader->
paused == 0) {
279 if (leader->
paused == 0) {
358#define TOLBI_SHIP_TALK_FACING(bytes, row) \
359 ((bytes)[(row) * sizeof(struct ScenePlacement) + \
360 offsetof(struct ScenePlacement, talkFacing)])
461#undef TOLBI_SHIP_TALK_FACING
621 leader->
z.
part.pixel);
939 actor =
work->placedActors;
942 actorX = current->
x.
part.pixel;
943 actorZ = current->
z.
part.pixel;
944 if (left < actorX && right > actorX && top < actorZ && bottom > actorZ)
970 direction = (((leader->
facing + 0x4000) & 0xf000) >> 12);
972 (((leader->
facing + 0x4000) & 0xf000) >> 12)) != 0) {
976 direction = (((leader->
facing + -0x4000) & 0xf000) >> 12);
978 (((leader->
facing + -0x4000) & 0xf000) >> 12)) != 0) {
982 direction = (((leader->
facing + 0x8000) & 0xf000) >> 12);
986 if (leaderPosition != 0) {
996 (offset << 16) >> 16);
1266 leader->
z.
part.pixel);
1286 if ((
u16)(leader->
facing - 0x2000) > 0xc000) {
1414 actor12Speaker =
SPEAKER(12, 8);
1597 actor12Speech = 0x100c;
1624 actor11Speech = 0x400b;
1672 actor8Speech = 0x8008;
2323 for (actorId = 28; actorId <= 35; actorId++) {
2647 const s32 *entryScript;
2689 halfStep =
PIXELS(1) / 2;
2760 if (leftSeat != 0) {
2800 object->motionFlags = set;
2801 object->retainSpriteCache = 1;
2802 sprite =
object->sprite;
2803 sprite->
count = set;
2925 selected =
flags & 0x1111;
2926 if ((
flags & 0x10000000) != 0)
2928 if ((
flags & 0x01000000) != 0)
3130 }
while (slot <= 7);
3153 for (slot = arg; slot <= opt; slot++) {
3195 }
else if (arg == 2) {
3199 }
else if (arg == 3) {
3213 if (alternate == 0) {
3230 for (i = 0; i <= 8; i++, flag++,
id++) {
3269 const s32 *rowerScript;
3270 const s32 *entryScript;
3331 message = MsgTolbiShipMonstersBelowdecks;
3465 const s32 *rowerScript;
3466 const s32 *entryScript;
3641 remaining = *
timer - 1;
3643 if (remaining == 70)
3647 if (((
u32)(((value << 4) - value) << 3) >> 16) == 0) {
3678 const s32 *progressB;
3679 const s32 *progressC;
3680 const s32 *progressA;
3728 if (reaction == 1) {
3730 }
else if (reaction == 2) {
3747 if (reaction == 0 &&
3752 if (reaction == 0) {
3754 }
else if (reaction == 1) {
3756 }
else if (reaction == 2) {
3874 s32 secondSeatFlags) {
3875 s32 firstPassenger = 0;
3876 s32 secondPassenger = 0;
3879 for (i = 0; i <= 8; i++) {
3880 s32 flag = firstSeatFlags + i;
3888 for (i = 0; i <= 8; i++) {
3889 s32 flag = secondSeatFlags + i;
3903#define TURN_STEP(dx, dz) (((dx) << 16) | ((dz) & 0xffff))
4034 {1,
CONDITION_ALWAYS, 152, 0, 584,
FACING_NORTH, 0, 30, 380, 270, 620, 0},
4035 {2,
CONDITION_ALWAYS, 160, 0, 552,
FACING_EAST, 0, 30, 380, 270, 620, 0},
4036 {3,
CONDITION_ALWAYS, 120, 0, 136,
FACING_WEST, 0, 25, 80, 265, 350, 0},
4037 {4,
CONDITION_ALWAYS, 408, 0, 136,
FACING_WEST, 0, 315, 80, 555, 410, 0},
4038 {5,
CONDITION_ALWAYS, 440, 0, 728,
FACING_NORTH, 0, 315, 500, 555, 765, 0},
4039 {10,
CONDITION_ALWAYS, 440, 0, 728,
FACING_NORTH, 0, 315, 500, 555, 765, 0},
4040 {11,
CONDITION_ALWAYS, 152, 0, 584,
FACING_NORTH, 0, 30, 380, 270, 620, 0},
4041 {12,
CONDITION_ALWAYS, 440, 0, 342,
FACING_NORTH, 0, 315, 80, 555, 410, 0},
4042 {13,
CONDITION_ALWAYS, 440, 0, 728,
FACING_NORTH, 0, 315, 500, 555, 765, 0},
4043 {14,
CONDITION_ALWAYS, 440, 0, 728,
FACING_NORTH, 0, 315, 500, 555, 765, 0},
4044 {15,
CONDITION_ALWAYS, 408, 0, 136,
FACING_WEST, 0, 315, 80, 555, 410, 0},
4045 {16,
CONDITION_ALWAYS, 408, 0, 136,
FACING_WEST, 0, 315, 80, 555, 410, 0},
4046 {17,
CONDITION_ALWAYS, 408, 0, 136,
FACING_WEST, 0, 315, 80, 555, 410, 0},
4047 {18,
CONDITION_ALWAYS, 408, 0, 136,
FACING_WEST, 0, 315, 80, 555, 410, 0},
4048 {19,
CONDITION_ALWAYS, 408, 0, 136,
FACING_WEST, 0, 315, 80, 555, 410, 0},
4049 {20,
CONDITION_ALWAYS, 408, 0, 136,
FACING_WEST, 0, 315, 80, 555, 410, 0},
4050 {21,
CONDITION_ALWAYS, 408, 0, 136,
FACING_WEST, 0, 305, 60, 565, 430, 0},
4051 {22,
CONDITION_ALWAYS, 444, 0, 632,
FACING_NORTH, 0, 315, 500, 555, 765, 0},
4052 {23,
CONDITION_ALWAYS, 408, 0, 136,
FACING_WEST, 0, 315, 80, 555, 410, 0},
4053 {24,
CONDITION_ALWAYS, 408, 0, 136,
FACING_WEST, 0, 315, 80, 555, 410, 0},
4054 {30,
CONDITION_ALWAYS, 166, 0, 570,
FACING_NORTH, 0, 30, 380, 270, 620, 0},
Ability numbers, named from the English release.
void ObjectGroup_SetChildValue(struct FieldActor *actor, s32 param)
Sets the param byte of every animated part of an actor's sprite.
void Object_RefreshSelectorById(u32 objectId)
Waits, at most 300 frames, for an actor's script to reach its end (command 0x10).
void ObjectMotion_WaitForAnimationChange(u32 objectId)
Waits, at most 90 frames, for an actor's animation to change.
void Object_SetActionById(u32 objectId, s32 steps)
Sets the animation timer steps of each of an actor's sprites (AnimationObjects_SetActiveTimerSteps).
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
The task scheduler: tasks, their order and the scheduler's state.
struct FieldActor * Camera_GetEventObject(void)
The event command "get view centre": returns the camera object.
The engine calls the debug menus import, and their palette swatch tiles.
static s32 FieldScheduler_AddCallback(SchedulerCallback callback, s32 priority)
Registers a main-image scheduler callback.
static s32 FieldObject_CheckMovementCollision(struct FieldActor *actor, struct FieldPosition *position)
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
#define SPEAKER_PORTRAIT_LEFT
static s32 Event_OpenMessage(s32 speaker, s32 flags)
static void Actor_SetDestination(s32 actor, s32 x, s32 z)
static void Actor_FaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_ActorSetAnimationAndWait(s32 actor, s32 animation)
void Engine_SanctumOpen(s32 priest)
void Object_SetMode(struct FieldActor *object, s32 animation)
#define SPEAKER_WINDOW_ABOVE
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
static void Event_ShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
void Engine_EventShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
void Engine_CameraSetSpeed(s32 speed, s32 acceleration)
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
static void Camera_SetSpeed(s32 speed, s32 acceleration)
void Engine_CameraMoveTo(s32 fixed_x, s32 fixed_y, s32 fixed_z, s32 pan)
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
void Engine_ItemLoadIcon(s32 item)
static void Actor_MoveToAndWait(s32 actor, s32 x, s32 z)
void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_EventCloseScreen(void)
void Engine_ActorSetDestination(s32 actor, s32 x, s32 z)
static void Actor_RunActionScriptAndWait(s32 actor, const s32 *script)
Runs a script, waiting at most 300 frames for its final command.
void Engine_ActorWalkToAndWait(s32 actor, s32 x, s32 z)
static void Actor_FaceActor(s32 actor, s32 target, s32 frames)
void Engine_HeapRelease(s32 slot)
s32 Engine_VramLoad(s32 block, s32 size, const void *data)
static void Actor_WalkTo(s32 actor, s32 x, s32 z)
void Engine_EventWaitForScreen(void)
void Engine_ActorDestroy(s32 actor)
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
s32 Engine_EventAskYesNo(s32 speaker, s32 flags)
void Engine_ObjectSetScript(struct FieldActor *object, const s32 *script)
void Engine_EventOpenScreen(void)
s32 Engine_EventOpenMessage(s32 speaker, s32 flags)
void Engine_GameFlagSet(s32 flag)
void Engine_GameFlagClear(s32 flag)
void Engine_CameraWaitForMove(void)
static void Actor_SetActionScript(s32 actor, const s32 *script)
The engine encodes either a built-in action or an action-script address.
void Engine_ActorWaitForMove(s32 actor)
void * Engine_HeapAllocate(s32 slot, s32 size)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
void Engine_ActorWalkTo(s32 actor, s32 x, s32 z)
static void Event_ShowMessage(s32 speaker, s32 flags)
void Engine_ActorSetAttachedEffect(s32 actor, s32 effect)
static void Event_PlayCue(s32 cue)
void Engine_ActorSetChildValue(s32 actor, s32 value)
static void Map_SetShake(s32 horizontal, s32 vertical, s32 decay)
Sets shake amplitudes in fixed-point pixels and the per-frame decay factor.
static void Actor_SetChildValue(s32 actor, s32 value)
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_MapRedraw(void)
static void Camera_MoveTo(s32 fixed_x, s32 fixed_y, s32 fixed_z, s32 pan)
static void Actor_SetPosition(s32 actor, s32 fixed_x, s32 fixed_z)
void Engine_ActorSetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ActorFaceEachOther(s32 actor, s32 other, s32 frames)
void Engine_EventWait(s32 frames)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
@ ACTOR_PRIORITY_AUTOMATIC
The sprite takes its priority from the map cell under it.
#define ACTOR_NO_TARGET
A target coordinate that is not set: the object has no target.
#define SCENE_TRANSITION(style, variant)
@ ACTOR_FACES_MOTION
turns toward its velocity, 1/16 turn a frame
The field's runtime work: map cells, scene records and regions, map markers and FieldWork.
The scene table formats: entrances, exits, placements and events, and the macros that write them.
#define SCENE_EXITS(scene)
#define SCENE_EXIT(exit, scene, entrance)
@ TALK_FACE_PARTY_AND_BACK
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
#define USE_ITEM_ON_ACTOR(item)
#define PLACEMENT_SHARE_PREVIOUS_SPRITE
#define FIND_COINS(coins)
The scene service layer: one typed inline for each engine service a scene calls by its own name,...
static void FieldObject_SetPosition(struct FieldActor *object, s32 fixed_x, s32 fixed_y, s32 fixed_z)
16.16 fixed-point constants, sine and cosine, and the library division.
#define Q16_ONE
One in the engine's signed 16.16 fixed-point format.
Game flags, named where their meaning is shown.
#define FLAG_TOLBI_SHIP_CAPTAIN_DECIDED_TO_SAIL
The party has heard that the captain decided to sail.
#define FLAG_SHOW_LOCATION_NAME
#define FLAG_TOLBI_SHIP_REACHED_TOLBI
The ship reached Tolbi. "The ship has arrived safely".
#define FLAG_KEEP_MUSIC
The next scene keeps the music that is playing; scene.c clears FLAG_KEEP_MUSIC as it does,...
#define FLAG_TOLBI_SHIP_ROWING
the oars are moving
#define FLAG_TOLBI_SHIP_FOURTH_SEAT_ROWERS
#define FLAG_TOLBI_SHIP_SECOND_ATTACK_REPELLED
#define FLAG_TOLBI_SHIP_ANCHOR_CHARM_FOUND
#define FLAG_TOLBI_SHIP_SECOND_SEAT_ROWERS
#define FLAG_TOLBI_SHIP_THIRD_ATTACK_REPELLED
#define FLAG_TOLBI_SHIP_FIRST_SEAT_ROWERS
The passengers chosen to row: a group of nine flags for each empty seat, one flag for each passenger,...
#define FLAG_TOLBI_SHIP_FIRST_ATTACK_REPELLED
The monster attacks fought off.
#define FLAG_RETREAT_BLOCKED
Retreat is blocked, from Psynergy or an item.
#define FLAG_SCENE_TEMP_00
#define FLAG_TOLBI_SHIP_AT_ISLAND
at anchor off the island
#define FLAG_TOLBI_SHIP_KRAKEN_DEFEATED
#define FLAG_KEEP_PARTY_POSITION
#define FLAG_TOLBI_SHIP_ANCHOR_CHARM_RETURNED
The party gave back the captain's Anchor Charm and agreed to protect the ship.
#define FLAG_TOLBI_SHIP_WARRIORS_SEEK_CAPTAIN
#define FLAG_TOLBI_SHIP_MONSTERS_SIGHTED
The ship's place plays music 29, the monsters' theme, instead of 41.
#define FLAG_TOLBI_SHIP_SAILING_WITHOUT_REPLACEMENT
The ship has set sail without its replacement.
#define FLAG_TOLBI_SHIP_THIRD_SEAT_ROWERS
#define FLAG_KALAY_COLOSSO_TOUR_LEFT
the tour group has left town
#define FLAG_TOLBI_SHIP_CREW_WONDERED_AT_DELAY
The crew have wondered what became of the replacement ship.
GameState, the game's state: play time, coins, the scene and the leader's position,...
#define Battle_SetStart(mode)
Sets the battle start type.
struct GameState gGameState
The screen blend's globals and the graphics routines.
The main-image routines scene overlays import.
s32 PartyInventory_Discard(s32 itemId)
Discards one itemId from whoever carries it first, as Inventory_Discard does; always returns 0.
gOverflowItem, an item slot the spoils code uses when items are handed out.
Item numbers, named from the English release.
Small statement macros both games use for positions, velocities and bounds.
#define SET_VELOCITY(p, vx, vy, vz)
The reel game's title lettering.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#define SC_SET(w, v)
Write a work value.
#define SC_LOOP(n, to)
Repeat up to n times.
#define SC_SYNC
Wait for arrival.
#define SC_MOVE(x, y, z)
Move toward the target.
#define SC_WAIT(n)
Wait n frames.
#define SC_TOP
Script start.
#define SC_END
Return to the main script.
void Battle_ResetEffectCounter(void)
Clears the field's busy flag and, while Reveal is active, ends it: Reveal used with ACT_PACKED runs i...
void Event_CallWithLastActiveObjectId(struct ScenePlacement *table)
Spawns the actors of a placement table after the last actor in use.
void Ui_SetMessageVoiceFromActor(s32 actor)
Sets the voice of the messages that follow to that of actor's sprite, at the rate the message speed o...
void Field_RequestBattleFromEncounterTable(s32 zoneNo, s32 slotNo)
Sets up a battle with enemy group slot of encounter table zone.
void Event_SetNextDestination(s32 scene, s32 entrance)
Sets the scene and entrance that the field goes to next (gGameState.nextScene and nextEntrance).
void Audio_PlayCueFromEventWork(void)
Starts the current scene's field music, chosen by Scene_ResolveInteractionResult.
Scene numbers, named after their places.
char SceneId_TolbiShipInteriors
The field object script interpreter and the operands its commands read.
Song and sound effect ids, indices into gSound_SongTable.
void Engine_ActorSetAnimation()
struct EventWork * gEventWork
void Engine_EventRequestExit()
void Engine_ActorSetPosition(u32 actor, s32 x, s32 z)
void Engine_EventEnd(void)
void Engine_AudioPlayCue()
void Engine_EventBegin(void)
void Engine_ActorShowEmote()
void Engine_EventSetMessage()
void Engine_EventShowMessage()
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
struct AnimationSpritePart shadow
struct AnimationSpritePart image
u8 flags
bits: 1 outlined in ObjectSystemWork's edge and fill colours | 0 shadow drawn (set when created)
u8 slot
VRAM cache entry holding its tiles.
u8 count
layers in use, up to the last one present
u16 fullColor
256 colours; set for both parts when created
u16 priority
2 when created
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
s32 startTransition
SCENE_TRANSITION(style, variant).
u16 unk172
FieldWork's menu request; scenes set it to 1.
u16 message
the next message, advanced as each window opens
A field actor: a person or thing on the field with a position, motion toward a target,...
s16 timer
The parameter its action script reads (a follow distance or an angle to face), the player's frames to...
s32 targetX
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
u8 steeringFlags
ActorSteeringFlag bits.
u8 motionFlags
ActorMotionFlag bits; zero is free flight in 3D, and 3 is set on creation.
u8 riseCounter
not read by the engine; scene code's own counter
union FieldCoordinate x
16.16 fixed-point pixels
s32 targetZ
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
u8 paused
nonzero skips its script and motion, not its update
union FieldCoordinate y
16.16 fixed-point pixels
u8 priorityFlags
ActorPriorityFlag bits, read by the scrolling camera.
union FieldCoordinate z
16.16 fixed-point pixels
s32 targetY
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
s32 scaleX
16.16 fixed point, 0x10000 full size
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
s32 riseBaseY
Zeroed by FieldObject_Create and not read by the engine; scene code keeps a resting height,...
u16 work
The side of the player's next footprint (2 after a stop), or scene scratch.
u8 collisionFlags
bits: 7 refuses to move into a solid object | 4 nearer for Psynergy targets | 3 never a talk or Psyne...
u8 riseEnabled
not read by the engine; scene code's own state
s32 z
16.16 fixed-point pixels
A scene entrance: where and facing which way the party arrives, and the camera's bounds there (-1 for...
A scene event: its kind and detail, the trigger it answers, its condition and its value (a message or...
An actor a scene places: its sprite, the condition for placing it, how it behaves,...
u8 talkFacing
enum ActorTalkFacing; 3 follows the leader afterwards
A scene's exit region: the box that, while its condition holds, takes the party leader out through it...
The prefix that command handlers read from a field object's 0x70-byte slot.
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
#define FLAG_TOLBI_SHIP_KRAKEN_ABOARD
"There's a huge sea monster on the ship!": the deck shakes until the Kraken is defeated (set in tolbi...
#define SPEAKER(actor, window)
A speaker: the actor, and in the top four bits where the message window opens beside them (4,...
static void TolbiShipInteriors_WatchWarriorsStormOff(void)
Once the party has heard of the delay at Kalay: Ouranos threatens to go ashore if the ship doesn't sa...
static void TolbiShipInteriors_TalkToWaitingPassenger8(void)
A passenger in the hold while the ship waits.
static void TolbiShipInteriors_RunSceneCommand(s32 step, u32 arg, u32 opt)
Reuses the voyage's actor, camera, transition and selection operations.
const struct SceneRegion * TolbiShipInteriors_GetRegions(void)
static void TolbiShipInteriors_EndThirdAttack(void)
Restores two replacement rowers after the next monster attack.
static void TolbiShipInteriors_ReadRower21Mind(void)
Mind Read on rower 21: there are so many monsters at sea.
struct SceneEvent gTolbiShipInteriors_RowingDeckEventsMonstersAboard[]
The rowing deck while monsters are aboard: talking to one (actors 36 to 38) fights it.
static void TolbiShipInteriors_RejoinParty(s32 rowerId)
Walks the rower back to the leader and hides its separate scene actor.
struct SceneEntrance gTolbiShipInteriors_EntrancesOther[]
The other scenes have no entrances.
static void TolbiShipInteriors_CallActorEighteenToRow(void)
Calls a replacement rower back to the rowing deck.
static void TolbiShipInteriors_Say(s32 speaker)
s32 gTolbiShipInteriors_FollowersRejoinMidDeck[]
The same, in the middle of the rowing deck.
struct ScenePlacement gTolbiShipInteriors_HoldPlacementsEmpty[]
The hold before the party hears of the delay at Kalay.
static void TolbiShipInteriors_DismissReplacementRowers(void)
Returns the replacement rowers to their seats and exchanges their selections.
static void TolbiShipInteriors_ReadRower24Mind(void)
The same for rower 24.
static void TolbiShipInteriors_TalkToRower20(void)
The same for rower 20.
static void TolbiShipInteriors_TalkToRower22(void)
The same as rower 18, for rower 22.
s32 gTolbiShipInteriors_TurnSteps[]
static void TolbiShipInteriors_ShakeWhileKrakenAboard(void)
Plays the intermittent voyage cue and restores its effect after ten frames.
static struct FieldActor * TolbiShipInteriors_PlaceAnchorCharm(void)
Creates the visible anchor charm once a visit (FLAG_SCENE_TEMP_00 records it) and retains it for depa...
struct SceneEvent gTolbiShipInteriors_RowingDeckEventsKrakenAboard[]
The rowing deck while the Kraken rocks the ship.
struct FieldActor * gTolbiShipInteriors_AnchorObject
The Anchor Charm's object, once placed this visit.
static void TolbiShipInteriors_TalkToRower18(void)
A passenger at the oars, by the round they were chosen in: Kaja's men are worried,...
static void TolbiShipInteriors_AnnounceDeparture(void)
Announces departure after a replacement rower has joined the crew.
struct SceneEvent gTolbiShipInteriors_CabinEventsAtIsland[]
The cabin while the ship waits off the island.
static void TolbiShipInteriors_NoticeShipRocking(void)
The party notices the ship rocking and discusses the rowers' progress.
struct ScenePlacement gTolbiShipInteriors_PartyFollowerPlacements[]
The party's followers, placed for a scene.
static void TolbiShipInteriors_HideSelectedPassenger(s32 actorId, s32 firstFlag)
Hides the passenger whose selection flag is set in this seat's flag group.
static void TolbiShipInteriors_TalkToCaptainsCabinActor10(void)
Once the warriors want to see the captain, actor 10 asks whether the party wants to join them in forc...
s32 TolbiShipInteriors_ApplyEntryState(void)
Restores the room or plays the event selected by this entrance.
const u32 * TolbiShipInteriors_GetExits(void)
static void TolbiShipInteriors_SwapRowerSelections(s32 firstSeatFlags, s32 secondSeatFlags)
Exchanges the chosen passengers between two rowing seats.
struct SceneEvent gTolbiShipInteriors_EventsOther[]
The side room, and the cutscenes.
static s32 TolbiShipInteriors_Bob(struct ScriptInterpreter *interpreter)
Bobs the actor between the floor and 8 pixels up by a random amount each frame.
static void TolbiShipInteriors_TalkToRower23(void)
The same for rower 23.
static void TolbiShipInteriors_ReactToMonsterAttack(void)
The crew checks on the party after the monster fight, then resumes rowing.
static void TolbiShipInteriors_ShowCabinBeforeKraken(void)
Plays the short cabin exchange before returning to the voyage.
static void TolbiShipInteriors_ShowRowing(void)
Restores the rowing deck for the current set of selected passengers.
static s32 TolbiShipInteriors_LookAround(struct ScriptInterpreter *interpreter)
Now and then (two chances in 64) turns the actor to face south-southeast or south-southwest.
static void TolbiShipInteriors_PlaceFoundActors(s32 gated)
Puts each recruited rower at its seat and hides the original occupant.
struct SceneEvent gTolbiShipInteriors_RowingDeckEvents[]
static s32 TolbiShipInteriors_HasArrived(struct FieldActor *actor)
Counts down the actor's walking time in riseBaseY.
const struct SceneEvent * TolbiShipInteriors_SelectEvents(void)
Chooses the room's interactions for the current stage of the voyage.
static void TolbiShipInteriors_AskPassenger14ToRow(void)
The same for passenger 14.
static void TolbiShipInteriors_SetUpRowingDeck(void)
Restores the rowing deck and introduces a newly recruited replacement.
static s32 TolbiShipInteriors_GetChosenOarsman(void)
Returns the passenger chosen to row at the open seat, which the attacks fought off number.
s32 gTolbiShipInteriors_LieFlatScript[]
Lies flat on the floor of the hold.
static void TolbiShipInteriors_MoveCameraAndWait(s32 x, s32 y, s32 z, u32 flags)
Moves the camera, optionally waits or redraws, then honors the packed delay.
static void TolbiShipInteriors_AskForReplacementOarsmen(void)
The crew explains the missing replacements and asks the party to find rowers.
s32 gTolbiShipInteriors_FollowersRejoinByStairs[]
The party's followers walk into the leader by the rowing deck's stairs.
static void TolbiShipInteriors_AnnounceTurn(void)
Announces the ship's next turn and returns control to the rowing deck.
static void TolbiShipInteriors_StepBesideLeader(s32 passengerId)
The chosen oarsman steps out beside the leader, on the leader's right if that spot is free,...
s32 gTolbiShipInteriors_ShakeTimer
Frames left of the Kraken's current jolt; at 0 another may start.
#define TURN_STEP(dx, dz)
The step beside the leader for each of the 16 facings: the high 16 bits are x, the low 16 bits z.
s32 gTolbiShipInteriors_LookAroundScript[]
A passenger glances about at random.
static void TolbiShipInteriors_AskPassenger10ToRow(void)
The same for passenger 10.
struct ScenePlacement gTolbiShipInteriors_PlacementsNone[]
#define TOLBI_SHIP_TALK_FACING(bytes, row)
A byte view keeps the native address arithmetic; direct row-field writes choose different bases and r...
s32 gTolbiShipInteriors_FollowersRejoinBySeats[]
The same, by the first row of seats.
static struct FieldActor * TolbiShipInteriors_FindActorNear(s32 x, s32 z)
Finds a placed actor within twelve pixels of the requested floor position.
s32 gTolbiShipInteriors_Shiver[]
Squashes and stretches the actor over and over: a shiver.
static void TolbiShipInteriors_AskAboutMonsters(void)
Asks the crew about the monsters before returning belowdecks.
static void TolbiShipInteriors_SetUpCabin(void)
Restores the cabin's actors after the anchor and departure conversations.
static void TolbiShipInteriors_EndSecondAttack(void)
Restores one replacement rower after the next monster attack.
const struct ScenePlacement * TolbiShipInteriors_SelectPlacements(void)
Picks the placements for the room entered and the voyage's stage.
static void TolbiShipInteriors_AskPassenger9ToRow(void)
The same for passenger 9, written out in full.
struct ScenePlacement gTolbiShipInteriors_FirstAttackMonsters[]
The monsters of each attack, beside the seats.
struct ScenePlacement gTolbiShipInteriors_HoldPlacements[]
The hold while the ship waits at Kalay, and after it reaches Tolbi.
static void TolbiShipInteriors_AskPassenger13ToRow(void)
The same for passenger 13.
static void TolbiShipInteriors_WatchCrewWonderAtDelay(void)
Once the warriors have gone to the captain, the three crewmen wonder what could have happened to the ...
static void TolbiShipInteriors_ReadRower18Mind(void)
Mind Read on a rower, by the round they were chosen in.
struct SceneEvent gTolbiShipInteriors_HoldEventsChoosingRowers[]
The hold at sea: talking to a passenger asks them to row.
u32 gTolbiShipInteriors_Exits[]
const struct SceneEntrance * TolbiShipInteriors_SelectEntrances(void)
static s32 TolbiShipInteriors_FindFirstSetFlag(u32 group, s32 alternate)
Finds the selected passenger or rowing-deck actor for a seat's flag group.
struct SceneEvent gTolbiShipInteriors_CabinEvents[]
The cabin, from the wait at Kalay until the ship reaches Tolbi.
static void TolbiShipInteriors_AskToRow(s32 speaker, s32 question, s32 seatFlag)
Asks a passenger to row.
static void TolbiShipInteriors_StartFirstAttack(void)
Stages the first monster encounter with the original rowers.
struct ScenePlacement gTolbiShipInteriors_CabinPlacementsWarriors[]
The cabin once the warriors have come to see the captain, with the party's followers.
struct ScenePlacement gTolbiShipInteriors_CabinPlacements[]
s32 gTolbiShipInteriors_StepIntoAisle[]
A rower steps into the aisle.
static void TolbiShipInteriors_ReturnLuckyAnchor(void)
Returns the captain's lucky anchor and agrees to protect the ship.
struct ScenePlacement gTolbiShipInteriors_HoldPlacementsAtSea[]
The hold at sea, once the passengers row.
s32 gTolbiShipInteriors_LeaveCabin[]
Those gathered in the cabin walk out.
static void TolbiShipInteriors_TalkToCaptain(void)
The captain, by the voyage's stage: too late to hire mercenaries, then his bad luck at losing his luc...
static void TolbiShipInteriors_StartThirdAttack(void)
Stages the next monster encounter with two replacement rowers.
#define FLAG_TOLBI_SHIP_ROWER_CHOSEN
a passenger follows the party
static void TolbiShipInteriors_SetUpHold(void)
Restores the passenger hold after recruitment and departure events.
struct ScenePlacement gTolbiShipInteriors_RowingDeckPlacements[]
The rowing deck: the crew (actors 8 and 9), the oarsmen at the seats (10 to 17), the passengers who m...
static void TolbiShipInteriors_TalkToRower21(void)
Rower 21 asks how many monsters are out there.
static void TolbiShipInteriors_AskPassenger15ToRow(void)
The same for passenger 15.
struct SceneEntrance gTolbiShipInteriors_Entrances[]
The hold (entrances 1, 2, 11 and 30), a side room (3), the rowing deck (4, 12 and 15 to 24 but 22) an...
ShipSceneCommand
Operations shared by the cabin, passenger hold and rowing-deck events.
@ SHIP_PLACE_FOLLOWERS_AND_MONSTERS
@ SHIP_RESTORE_ROWING_DECK_POSES
@ SHIP_FACE_PARTY_EAST_AND_WEST
@ SHIP_HIDE_ACTORS_13_AND_14
@ SHIP_START_ROWING_ANIMATION
@ SHIP_CLEAR_ROWING_SELECTIONS
@ SHIP_SETUP_CAPTAINS_CABIN
@ SHIP_SETUP_MONSTER_ENCOUNTER
@ SHIP_SETUP_RECRUITMENT_DECK
@ SHIP_START_MIRRORED_ROWING_ANIMATION
@ SHIP_SET_SELECTED_ROWER_POSE
@ SHIP_SETUP_ROWING_PARTY
@ SHIP_HIDE_PARTY_FOLLOWERS
@ SHIP_RESTORE_ROWER_POSE
@ SHIP_HIDE_ACTORS_28_TO_35
@ SHIP_RESTORE_ACTOR_12_SCRIPT
@ SHIP_PLAY_PARTY_ANIMATION
@ SHIP_SETUP_PASSENGER_HOLD
s32 gTolbiShipInteriors_LeaveByStairs[]
A rower walks up the stairs and is freed.
static void TolbiShipInteriors_CastOff(void)
Raises the anchor charm and announces the ship's first departure.
static void TolbiShipInteriors_TalkToRower24(void)
The same for rower 24.
TolbiShipInteriorsActor
The warriors bound for Colosso in the hold while the ship waits at Kalay (gTolbiShipInteriors_HoldPla...
static void TolbiShipInteriors_CallActorSixteenToRow(void)
Calls the first passenger to the rowing deck.
static void TolbiShipInteriors_InstallRowingDeckActors(u32 action)
Restores each replacement rower or the original occupant of that seat.
s32 gTolbiShipInteriors_AnchorCharmPulse[]
The Anchor Charm swells and shrinks twice as the captain raises it.
static void TolbiShipInteriors_AskPassenger12ToRow(void)
The same for passenger 12, written out in full rather than through TolbiShipInteriors_AskToRow.
s32 gTolbiShipInteriors_LeaveHold[]
The warriors walk out of the hold.
static void TolbiShipInteriors_PlaceActor(s32 actorId, s32 x, s32 z, s32 facing)
Places an actor at pixel coordinates and sets its initial heading.
struct SceneEvent gTolbiShipInteriors_RowingDeckEventsArrived[]
The rowing deck once the ship has reached Tolbi.
static void TolbiShipInteriors_WaitThenAdvance(struct FieldActor *actor)
Counts the frames of a pause in riseCounter and moves the pacing actor to its next step after 80 fram...
s32 gTolbiShipInteriors_MonsterBob[]
A monster in the hold bobs in place.
static void TolbiShipInteriors_ReadRower20Mind(void)
The same for rower 20.
static void TolbiShipInteriors_ReachIsland(void)
Rests the rowers at the island and plays the selected passengers' responses.
struct ScenePlacement gTolbiShipInteriors_ThirdAttackMonsters[]
static s32 TolbiShipInteriors_ResetActor(struct ScriptInterpreter *interpreter)
An action-script call: stands the actor still at the origin, with no velocity and no target.
static void TolbiShipInteriors_TalkToRower19(void)
The same for rower 19.
static void TolbiShipInteriors_PoseSceneActor(s32 id)
Applies the seated pose and rowing action assigned to this rower.
static void TolbiShipInteriors_TalkToPriest(void)
The travelling priest.
static void TolbiShipInteriors_TalkToRower25(void)
As rower 21, for rower 25.
static s32 TolbiShipInteriors_LayFlat(struct ScriptInterpreter *interpreter)
An action-script call: lays the actor flat on the floor, drawn underfoot at priority 1 with its parts...
static void TolbiShipInteriors_ReadRower25Mind(void)
As rower 21, for rower 25.
static void TolbiShipInteriors_TalkToCaptainsCabinActor12(void)
Actor 12 in the captain's cabin asks whether the party came to ask the captain to set sail.
static void TolbiShipInteriors_TalkToWaitingPassenger10(void)
Another waiting passenger, once the party has agreed to protect the ship, asks whether it will row.
static s32 TolbiShipInteriors_IsSpotFree(s32 bucket)
Returns 1 when the spot next to the leader in the given sixteenth of a turn holds no actor and no wal...
static void TolbiShipInteriors_AskPassenger8ToRow(void)
Passenger 8 under sail, when an oar needs a rower.
#define FLAG_TOLBI_SHIP_MONSTERS_ABOARD
the hold's stairs are barred
struct SceneEvent gTolbiShipInteriors_CabinEventsArrived[]
The cabin once the ship has reached Tolbi.
static void TolbiShipInteriors_WatchPacer(union FieldObject *fieldObject)
The update of the actor who watches the pacing crewman: turns north-northeast at the first signal,...
static void TolbiShipInteriors_AskPassenger16ToRow(void)
The same for passenger 16.
static void TolbiShipInteriors_DiscussLaunchingWithoutAnchor(void)
The passengers pressure the captain to launch despite the missing anchor.
static void TolbiShipInteriors_Turn(s32 actorId, u16 facing)
Turns an actor to a facing over 10 frames.
static void TolbiShipInteriors_IntroduceReplacementOarsman(s32 seat)
Introduces the selected passenger and leads them to the open rowing seat.
static void TolbiShipInteriors_PaceCabin(union FieldObject *fieldObject)
The update of a crewman who paces between two spots in the cabin, looking about at each,...
struct SceneEvent gTolbiShipInteriors_HoldEvents[]
The hold while the ship waits at Kalay, and after it reaches Tolbi.
struct ScenePlacement gTolbiShipInteriors_SecondAttackMonsters[]
static void TolbiShipInteriors_EndFirstAttack(void)
Restores the original rowers after the first monster attack.
static void TolbiShipInteriors_ReadRower23Mind(void)
The same for rower 23.
static void TolbiShipInteriors_AskPassenger11ToRow(void)
The same for passenger 11, who is too seasick to talk once the ship is at anchor.
struct SceneEvent gTolbiShipInteriors_HoldEventsAtIsland[]
The hold while the ship waits off the island.
static void TolbiShipInteriors_ReportMonstersBelowdecks(void)
Gathers the party after the crew reports monsters belowdecks.
struct ScenePlacement gTolbiShipInteriors_CabinPlacementsArrived[]
The cabin once the ship has reached Tolbi.
static void TolbiShipInteriors_ReadRower22Mind(void)
As rower 18, for rower 22.
static void TolbiShipInteriors_TurnBackFromStairs(void)
While the monsters are aboard, the leader is walked back from the stairs.
static void TolbiShipInteriors_StartSecondAttack(void)
Stages the next monster encounter with one replacement rower.
static void TolbiShipInteriors_HideSelectedPassengers(void)
Hides the four passengers who are already filling rowing seats.
static void TolbiShipInteriors_ReadRower19Mind(void)
The same for rower 19.
static void TolbiShipInteriors_FightMonstersInHold(void)
Talking to one of the monsters in the hold (actors 36 to 38) starts the battle with them: group 62,...
static void TolbiShipInteriors_SetSeatActorCollision(void)
Sets collision bit 3 on the eight actors surrounding the rowing seats.
The integer types, TRUE, UNUSED and the fixed-address macros.
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.
void UiText_ShowCenteredMessage(s32 message, s32 mode, s32 yOffset)
Shows a message centred on the screen (yOffset tiles lower) and waits until it is typed out,...