25#include "text/msg_ids.h"
230 cardinalFacing = ((leader->
facing + 0x2000) & ~0x3fff);
336 coinLabel = MSGNO(MsgYourCoins);
340#if LANGUAGE == LANGUAGE_JAPANESE
341 coinLabel += MSGNO(MsgCoins) - MSGNO(MsgYourCoins);
345#if LANGUAGE == LANGUAGE_JAPANESE
530 ((
u8 *)actor->sprite)[9] |= 12;
531 ((
u8 *)actor->sprite)[38] = 0;
533 actor->sprite->rotation = 0xc000;
536 ((
u8 *)actor->sprite)[9] |= 12;
537 ((
u8 *)actor->sprite)[21] |= 12;
554 s32 otherBlockColumn;
660 actor->
timer = pixelX;
665 actor->
work = pixelZ;
684 ((
u8 *)actor->sprite)[9] |= 12;
685 ((
u8 *)actor->sprite)[21] |= 12;
823 ((
u8 *)actor->sprite)[9] |= 12;
824 ((
u8 *)actor->sprite)[38] = 0;
825 actor->sprite->rotation = 0xc000;
888 {0,
CONDITION_ALWAYS, 128, 0, 128,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
893 {0,
CONDITION_ALWAYS, 248, 0, 1368,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
894 {1,
CONDITION_ALWAYS, 288, 0, 1464,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
895 {2,
CONDITION_ALWAYS, 72, 0, 1304,
FACING_EAST, 0, -1, -1, -1, -1, 0},
896 {3,
CONDITION_ALWAYS, 304, 0, 1416,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
897 {4,
CONDITION_ALWAYS, 296, 0, 1048,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
902 {0,
CONDITION_ALWAYS, 392, 0, 296,
FACING_WEST, 0, -1, -1, -1, -1, 0},
903 {1,
CONDITION_ALWAYS, 408, 0, 296,
FACING_WEST, 0, 0, 0, 448, 432, 0},
904 {2,
CONDITION_ALWAYS, 24, 0, 232,
FACING_EAST, 0, 0, 0, 448, 432, 0},
905 {3,
CONDITION_ALWAYS, 240, 0, 216,
FACING_SOUTH, 0, 0, 0, 448, 432, 0},
910 {0,
CONDITION_ALWAYS, 96, 0, 248,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
911 {1,
CONDITION_ALWAYS, 96, 0, 248,
FACING_NORTH, 0, 32, 32, 272, 272, 0},
912 {2,
CONDITION_ALWAYS, 384, 0, 248,
FACING_NORTH, 0, 320, 32, 560, 272, 0},
Ability numbers, named from the English release.
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
Calls through a function pointer, by argument count.
The engine calls the debug menus import, and their palette swatch tiles.
void Djinn_JoinParty(s32 slot, s32 element, s32 djinn)
A Djinni joins the party: djinn (0 to 19) of element goes to the member with the fewest Djinn,...
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
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)
static void Map_AnimateCells(const u16 *steps, s32 destX, s32 destY)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
static void Event_ShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
static void Actor_SetBuiltinAction(s32 actor, s32 action)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
s32 Engine_PartyGiveItem(s32 item, s32 flags)
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
#define MAP_CELL_STEP(srcX, srcY, width, height, frames)
static void Actor_FaceActor(s32 actor, s32 target, s32 frames)
static void Actor_WalkTo(s32 actor, s32 x, s32 z)
void Engine_EventWaitForScreen(void)
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
static void Actor_WalkByAndWait(s32 actor, s32 dx, s32 dz)
s32 Engine_EventAskYesNo(s32 speaker, s32 flags)
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)
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
static void Event_ShowMessage(s32 speaker, s32 flags)
static void Event_PlayCue(s32 cue)
void Engine_ActorSetChildValue(s32 actor, s32 value)
#define MAP_CELL_STEPS_END
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
static void Actor_WalkBy(s32 actor, s32 dx, s32 dz)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
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_EventWait(s32 frames)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
static struct FieldActor * Actor_Get(s32 actor)
@ ACTOR_PRIORITY_UNDERFOOT
The depth sort treats it as 320 pixels higher on the screen.
#define SCENE_TRANSITION(style, variant)
@ ACTOR_FACES_MOTION
turns toward its velocity, 1/16 turn a frame
The scene table formats: entrances, exits, placements and events, and the macros that write them.
#define SCENE_EXITS(scene)
#define IF_FLAG_SET(flag)
#define SCENE_EXIT(exit, scene, entrance)
@ TALK_FACE_PARTY_AND_BACK
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
#define TOUCH_WALKING_INTO(facing)
#define FIND_COINS(coins)
The scene service layer: one typed inline for each engine service a scene calls by its own name,...
static void FieldMotion_LaunchFromFocusedObject(s32 actor, s32 dx, s32 dz, s32 facing)
Game flags, named where their meaning is shown.
#define FLAG_SHOW_LOCATION_NAME
#define FLAG_COLOSSO_OVER
the Colosso finals have been fought
#define FLAG_TOLBI_SHIP_REACHED_TOLBI
The ship reached Tolbi. "The ship has arrived safely".
#define FLAG_KALAY_DOCKS_GARET_SAW_KARAGOL
#define FLAG_TOLBI_DOCKS_CONFRONTATION_SEEN
The passengers confronted the tour guides and their bodyguard.
#define FLAG_KALAY_DOCKS_TICKET_BOUGHT
#define FLAG_KALAY_DOCKS_CARRYING_MESSAGE
The father on the Kalay docks asked the party to take a message to his daughter in Tolbi,...
#define FLAG_KEEP_PARTY_POSITION
#define FLAG_TOLBI_DOCKS_PASSENGER_MET_PARTY
A passenger on the Tolbi docks walked up to the party as it arrived.
#define FLAG_KALAY_DOCKS_WENT_ASHORE
off the ship after boarding
#define FLAG_KALAY_DOCKS_TICKET_HANDED_OVER
the party may board
#define FLAG_TOLBI_DOCKS_MESSAGE_DELIVERED
#define FLAG_KALAY_COLOSSO_TOUR_LEFT
the tour group has left town
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
The screen blend's globals and the graphics routines.
s32 Inventory_Discard(s32 owner, s32 slot)
Removes one item as Inventory_Remove does, and puts a rare item back into circulation (its counter go...
s32 Inventory_Find(s32 owner, s32 itemId)
Returns the first slot holding itemId (any quantity, equipped or not), or -1.
s32 PartyInventory_FindOwner(s32 itemId)
Returns who carries itemId, asking the selected character first, or -1.
Item numbers, named from the English release.
@ ACTOR_FIRST_BLOCK
the blocks that open the two passages
@ ACTOR_TOUR_GUIDE
in the inn's dining room
struct SceneEvent gKalayTolbiDocks_TolbiEvents[]
struct ScenePlacement gKalayTolbiDocks_TicketOfficePlacementsStranded[]
static void KalayTolbiDocks_TalkToDockWorker(void)
The dock worker explains the tickets: hand one over to board, give it to the gatekeeper,...
struct ScenePlacement gKalayTolbiDocks_TicketOfficePlacements[]
static void KalayTolbiDocks_AskAboutRoughCrossing(void)
A passenger at Tolbi has heard the party was attacked by a monster on the crossing,...
struct SceneEvent gKalayTolbiDocks_KalayEvents[]
const struct SceneRegion * KalayTolbiDocks_GetRegions(void)
struct SceneEvent gKalayTolbiDocks_TicketOfficeEventsStranded[]
const struct SceneEvent * KalayTolbiDocks_GetEvents(void)
Selects dialogue and interactions for the current port and voyage state.
static void KalayTolbiDocks_TalkToGatekeeper(void)
The gatekeeper at the gangway.
struct SceneEvent gKalayTolbiDocks_TicketOfficeEvents[]
static void KalayTolbiDocks_AskAboutSeasickTourists(void)
A man at Tolbi asks whether the upset tourists got seasick.
u32 gKalayTolbiDocks_Exits[]
static void KalayTolbiDocks_UpdateBlockCells(void)
After either block is moved, the pier's cells under both are rebuilt.
static void KalayTolbiDocks_PassengersConfrontTourGuide(void)
Stepping onto the stranded Tolbi docks, the party watches the tour guide tell an angry passenger his ...
struct SceneEvent gKalayTolbiDocks_TicketOfficeEventsShipGone[]
static void KalayTolbiDocks_PrepareTolbiDocks(void)
On the Tolbi docks the two blocks settle into the pier's cells.
const u32 * KalayTolbiDocks_GetExits(void)
The docks list no numbered exits.
static void KalayTolbiDocks_TalkToTicketSeller(void)
The ticket seller offers tickets for the four of them at 600 coins, with the party's coins shown besi...
struct SceneEvent gKalayTolbiDocks_TolbiEventsStranded[]
static void KalayTolbiDocks_PrepareTicketOffice(void)
The ticket office opens with a window transition and no location name.
static void KalayTolbiDocks_OpenDoorAndLeave(void)
Walking north into the docks' door, the door opens and the leader walks through it to the town.
struct ScenePlacement gKalayTolbiDocks_NoPlacements[]
KalayTolbiDocksActor
The three maps share actor numbers; each is named on the map it is proved.
@ ACTOR_ANGRY_PASSENGER
Tolbi docks, once the tour's passengers are stranded there.
@ ACTOR_ARRIVALS_GREETER
hears of the party's scary trip
@ ACTOR_WORRIED_FATHER
his daughter waits on the Tolbi docks
@ ACTOR_TICKET_SELLER
Ticket office.
@ ACTOR_BODYGUARD
hired by the tour guides
@ ACTOR_STRANDED_PASSENGER
@ ACTOR_GATEKEEPER
takes the tickets at the gangway
u16 gKalayTolbiDocks_KalayDoorCells[]
static void KalayTolbiDocks_TalkToWorriedFather(void)
The father asks whether the party is taking the ship.
struct SceneEntrance gKalayTolbiDocks_NoEntrances[]
struct SceneEvent gKalayTolbiDocks_NoEvents[]
static void KalayTolbiDocks_PassengerGreetsArrivals(void)
Stepping off the ship at Tolbi, the leader walks a few steps and a passenger hurries over to stand be...
struct ScenePlacement gKalayTolbiDocks_TicketOfficePlacementsShipGone[]
struct ScenePlacement gKalayTolbiDocks_KalayPlacements[]
struct ScenePlacement gKalayTolbiDocks_TolbiPlacementsStranded[]
s32 KalayTolbiDocks_Initialize(void)
Prepares whichever of the three maps is entered.
struct ScenePlacement gKalayTolbiDocks_TolbiPlacements[]
u16 gKalayTolbiDocks_TolbiDoorCells[]
const struct ScenePlacement * KalayTolbiDocks_GetPlacements(void)
Each map has its people before the ship sails, once it has gone and not come back (flag 0x93e),...
static void KalayTolbiDocks_GaretSeesTheKaragol(void)
Garet runs to the edge of the Kalay docks and marvels at the sea.
static void KalayTolbiDocks_PrepareKalayDocks(void)
On the first arrival at the Kalay docks, Garet runs to see the Karagol.
static void KalayTolbiDocks_AskAboutTolbiCrossing(void)
A man on the Kalay docks asks whether the party wants to go to Tolbi.
s32 gKalayTolbiDocks_BodyguardSpinScript[]
const struct SceneEntrance * KalayTolbiDocks_GetEntrances(void)
Selects the entrance positions for the departure, arrival or ticket office.
static void KalayTolbiDocks_SettleBlock(s32 actorId)
Stops a dock block's idle motion and sets its sprite priority.
static void KalayTolbiDocks_RecruitVenusDjinni(void)
Adds the Venus Djinni waiting at the Kalay docks.
static void KalayTolbiDocks_RemindBoardShip(void)
Spoken to on the shore after boarding, the gatekeeper asks the party to board the ship when it is fin...
struct ScenePlacement gKalayTolbiDocks_KalayPlacementsShipGone[]
struct SceneEntrance gKalayTolbiDocks_KalayEntrances[]
struct SceneEntrance gKalayTolbiDocks_TicketOfficeEntrances[]
static void KalayTolbiDocks_TalkToWaitingDaughter(void)
The daughter at Tolbi looks for her parents among the passengers.
struct SceneEvent gKalayTolbiDocks_KalayEventsShipGone[]
struct SceneEntrance gKalayTolbiDocks_TolbiEntrances[]
The reel game's title lettering.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#define SC_LOOP(n, to)
Repeat up to n times.
#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...
s32 Party_AdjustCoins(s32 amount)
Adds amount to the party's coins, kept between 0 and 999999, and returns the new total.
Scene numbers, named after their places.
char SceneId_KalayTolbiDocks2
char SceneId_KalayTolbiDocks3
char SceneId_KalayTolbiDocks1
Song and sound effect ids, indices into gSound_SongTable.
void Engine_ActorSetAnimation()
struct EventWork * gEventWork
void Engine_EventRequestExit()
void Engine_EventEnd(void)
void Engine_EventBegin(void)
void Engine_EventSetMessage()
void Engine_EventShowMessage()
s32 startTransition
SCENE_TRANSITION(style, variant).
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...
u8 steeringFlags
ActorSteeringFlag bits.
u8 motionFlags
ActorMotionFlag bits; zero is free flight in 3D, and 3 is set on creation.
union FieldCoordinate x
16.16 fixed-point pixels
u8 paused
nonzero skips its script and motion, not its update
u8 priorityFlags
ActorPriorityFlag bits, read by the scrolling camera.
union FieldCoordinate z
16.16 fixed-point pixels
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...
The game's state: play time, coins, the scene and the leader's position, the active party and the opt...
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,...
A scene's exit region: the box that, while its condition holds, takes the party leader out through it...
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
Values that differ by patch level or language, chosen once for their code.
#define TICKET_COUNTER_WIDTH
#define TICKET_COUNTER_WINDOW_X
void UiText_DrawNumberInWindow(s32 value, s32 width, struct UiWindow *window, s32 x, s32 y)
Draws a number (width as UiText_FormatNumber) into a window's tilemap at pixel (x,...
void UiText_DrawCharacterAtOffset(s32 message, const struct UiWindow *window, u32 offsetX, u32 offsetY)
Decodes a message and draws it as tiles in a window at pixel (offsetX, offsetY) of its interior.
The integer types, TRUE, UNUSED and the fixed-address macros.
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels
The patch levels: our groups of the measured changes from the Japanese release.
void UiWork_PushValueSlot(u32 value, u32 kind)
Adds a message argument of kind (MSG_ARG_) with value to the first free place of the argument table; ...
void UiWork_Finalize(struct UiWindow *window, s32 instant)
Closes a window: clears its contents and remembers its last rectangle.
struct UiWindow * UiWindow_Create(s32 x, s32 y, s32 width, s32 height, s32 attrs)
Opens a window at tile (x, y) of width by height tiles in the first free window slot,...