21#include "text/msg_ids.h"
162 gift = MsgValeThisIsMyFarewellGift;
407 const s32 *partyScript;
728 switch (cycleFrame) {
745 if (origin !=
NULL) {
764 SC_CALL(Scene_TurnTowardTarget),
814 {0,
CONDITION_ALWAYS, 120, 0, 100,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
815 {1,
CONDITION_ALWAYS, 96, 0, 222,
FACING_NORTH, 0, 4, 4, 244, 292, 0},
816 {2,
CONDITION_ALWAYS, 337, 0, 199,
FACING_NORTH, 0, 252, 4, 548, 236, 0},
817 {3,
CONDITION_ALWAYS, 656, 0, 244,
FACING_NORTH, 0, 556, 4, 900, 276, 0},
818 {4,
CONDITION_ALWAYS, 159, 0, 525,
FACING_NORTH, 0, 4, 324, 332, 564, 0},
819 {5,
CONDITION_ALWAYS, 528, 0, 486,
FACING_NORTH, 0, 348, 284, 612, 516, 0},
820 {6,
CONDITION_ALWAYS, 816, 0, 522,
FACING_NORTH, 0, 628, 284, 884, 548, 0},
821 {7,
CONDITION_ALWAYS, 463, 0, 851,
FACING_NORTH, 0, 324, 604, 588, 884, 0},
822 {8,
CONDITION_ALWAYS, 769, 0, 857,
FACING_NORTH, 0, 580, 628, 852, 884, 0},
Ability numbers, named from the English release.
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
static void Event_TalkToItemShopkeeper(void)
Opens the item shop from across the counter, or talks about the curse.
static void Event_TalkToWeaponShopkeeper(void)
Opens the weapon shop from across the counter; otherwise discusses Kolima.
static void Event_TalkToArmorShopkeeper(void)
Opens the armor shop across the counter, or asks about seeing the ocean.
Calls through a function pointer, by argument count.
void(*) SchedulerCallback(void)
struct FieldActor * Camera_GetEventObject(void)
The event command "get view centre": returns the camera object.
static s32 FieldScheduler_AddCallback(SchedulerCallback callback, s32 priority)
Registers a main-image scheduler callback.
FacingObject, the view of an object that turns to face a target.
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_FaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_ActorSetAnimationAndWait(s32 actor, 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_MessageShowCentered(s32 message, s32 flags)
s32 Engine_PartyGiveItem(s32 item, s32 flags)
#define SPEAKER_PORTRAIT_RIGHT
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
static void Camera_SetSpeed(s32 speed, s32 acceleration)
s32 Engine_TaskRemoveCallback(void(*callback)(void))
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
void Engine_EventCloseScreen(void)
static void Actor_RunActionScriptAndWait(s32 actor, const s32 *script)
Runs a script, waiting at most 300 frames for its final command.
#define SPEAKER_WINDOW_BELOW
static void Actor_WalkTo(s32 actor, s32 x, s32 z)
void Engine_EventWaitForScreen(void)
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
s32 Engine_EventAskYesNo(s32 speaker, s32 flags)
static void Event_ShowTwoMessagesAndWait(s32 speaker, s32 x, s32 y, s32 arg, s32 extra, s32 otherSpeaker, s32 otherX, s32 otherY, s32 otherArg, s32 otherExtra, s32 flags)
void Engine_EventOpenScreen(void)
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_ActorStop(s32 actor)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
static void Event_ShowMessage(s32 speaker, s32 flags)
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_ShopOpen(s32 shop, s32 keeper)
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_ActorFaceEachOther(s32 actor, s32 other, s32 frames)
void Engine_EventWait(s32 frames)
static struct FieldActor * Actor_Get(s32 actor)
@ ACTOR_PRIORITY_AUTOMATIC
The sprite takes its priority from the map cell under it.
#define SCENE_TRANSITION(style, variant)
The scene table formats: entrances, exits, placements and events, and the macros that write them.
#define SCENE_EXITS(scene)
#define FIND_MESSAGE(message)
#define SCENE_EXIT(exit, scene, entrance)
@ TALK_FACE_PARTY_AND_BACK
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
#define FACING_IS_NORTH(facing)
#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_SetTargetAndCallback(s32 object, s32 target, const s32 *actions)
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_GARET_CAME_HOME
Back from Kalay, Garet surprised his family at home.
#define FLAG_REACHED_KALAY
Set whenever Kalay is entered; Vale's villagers then talk of the party's journey.
#define FLAG_VALE_FAREWELL_HERB_RECEIVED
The item shopkeeper gave Isaac a Herb as a farewell gift.
#define FLAG_VALE_INTERIORS_JAR_2_COINS
#define FLAG_VALE_STORM
The prologue's stormy night: lightning over Vale, the rockslide and the monsters loose in the village...
#define FLAG_VALE_INTERIORS_JAR_SMOKE_BOMB
#define FLAG_VALE_INTERIORS_JAR_6_COINS
#define FLAG_VALE_INTERIORS_JAR_3_COINS
#define FLAG_VALE_INTERIORS_BARREL_ANTIDOTE
volatile u32 gFrameCount
Frames WaitFrames has finished.
FieldBlendWork, the field's colour blend work.
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
The main-image routines scene overlays import.
void SceneEvents_UpdateInView(struct ScenePlacement *entry)
Item numbers, named from the English release.
void Map_ClearLayerEntryFlag(u32 channelIndex)
Resumes tile animation channel channelIndex by clearing its paused byte.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#define SC_LABEL(n)
Branch destination.
#define SC_SET(w, v)
Write a work value.
#define SC_LOOP(n, to)
Repeat up to n times.
#define SC_POS(x, y, z)
Set position.
#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.
The work pointers in the gWorkSlot table, by name.
#define Ram_SceneMapStateOffset
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_EventSetMessage()
void Engine_EventShowMessage()
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
s32 startTransition
SCENE_TRANSITION(style, variant).
s32 transitionFrames
frames
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 motionFlags
ActorMotionFlag bits; zero is free flight in 3D, and 3 is set on creation.
union FieldCoordinate x
16.16 fixed-point pixels
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
s32 scaleY
16.16 fixed point, 0x10000 full size
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 storm's lightning work: the colours it flashes between and their difference, the countdown to the...
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...
The prefix that command handlers read from a field object's 0x70-byte slot.
The integer types, TRUE, UNUSED and the fixed-address macros.
s32 fixed
16.16 fixed-point pixels
@ ACTOR_GARETS_GRANDFATHER
Garet's grandfather, the mayor (sprite 0x75, whom the Great Healer calls Mayor in sanctum....
static void ValeInteriors_GiveFarewellHerb(void)
After the party has left Vale, the item shopkeeper gives Isaac a Herb as a farewell gift,...
static void Event_AskToScareVisitors(void)
A villager asks Isaac to help scare Kraden's visitors.
s32 gValeInteriors_PartyLeavesScript[]
const struct SceneEntrance * ValeInteriors_GetEntrances(void)
struct ScenePlacement gValeInteriors_Placements[]
u32 gValeInteriors_Exits[]
static void Event_LeaveByDoor7(void)
static void Event_GaretComesHome(void)
Back from Kalay, Garet comes home: his grandfather dozes, his parents argue over whether to look for ...
struct ScenePlacement gValeInteriors_PlacementsAfterKalay[]
s32 gValeInteriors_DriftingSpriteScript[]
s32 gValeInteriors_FatherPacingScript[]
static void ValeInteriors_SpawnDriftingSprite(void)
Sends a sprite drifting up from Garet's sleeping grandfather, one of the three at frames 10,...
static void Event_AskAboutKradensStudies(void)
A villager asks whether Isaac knew why Kraden came to Vale.
const struct SceneRegion * ValeInteriors_GetRegions(void)
static void ValeInteriors_PlayRepeatedAnimationAndWait(s32 actorId, s32 animation)
Starts the repeated motion before waiting for the requested animation.
static void Event_LeaveByDoor5(void)
static void Event_AskAboutCulpritsPowers(void)
A villager tells of the culprits' strange powers and asks about them.
const struct SceneEvent * ValeInteriors_GetEvents(void)
Selects the events for the current visit to Vale: the stormy night's (FLAG_VALE_STORM),...
u32 gValeInteriors_StormExits[]
s32 gValeInteriors_FaceTargetScript[]
static void Event_LeaveByDoor6(void)
const struct ScenePlacement * ValeInteriors_GetPlacements(void)
Selects the placements for the day the story begins, after the party has left Vale (FLAG_PARTY_LEFT_V...
static void Event_LeaveByDoor2(void)
const u32 * ValeInteriors_GetExits(void)
On the stormy night, the doors lead out into the storm.
static void Event_WorryAboutTravelersHealth(void)
Garet's mother hopes the travelers did not get sick on the way.
static void ValeInteriors_FamilyNods(void)
Garet's grandparents and father nod.
s32 ValeInteriors_Initialize(void)
Arriving in a house: on the stormy night the residents are gone and lightning flashes outside; back f...
static void Event_AskAboutDora(void)
Back from Kalay, Garet's father asks whether Isaac heard them talking about Dora.
static void Event_LeaveByDoor8(void)
struct SceneEntrance gValeInteriors_Entrances[]
struct ScenePlacement gValeInteriors_PlacementsAfterLeaving[]
static void Event_LeaveByDoor4(void)
struct SceneEvent gValeInteriors_EventsAfterLeaving[]
static void Event_LeaveByDoor1(void)
struct SceneEvent gValeInteriors_Events[]
static void Event_LeaveByDoor3(void)
static s32 ValeInteriors_AdvanceDriftingSprite(struct ScriptInterpreter *interpreter)
Moves and grows a sprite drifting up from Garet's sleeping grandfather.
static void ValeInteriors_RequestWindowExit(s32 exitId)
Leaves a house through its door: the exit sound plays and the screen closes, stopping the lightning f...
struct SceneEvent gValeInteriors_StormEvents[]
struct SceneEvent gValeInteriors_EventsAfterKalay[]
@ ACTOR_JENNAS_GRANDMOTHER
Jenna's grandmother.
@ ACTOR_GARETS_MOTHER
Garet's mother. "As mothers, Dora and I will always worry about you.".
@ ACTOR_WEAPON_SHOPKEEPER
@ ACTOR_FIRST_DRIFTING_SPRITE
Three sprites drifting up from Garet's sleeping grandfather.
@ ACTOR_GARETS_FATHER
Garet's father.
@ ACTOR_GARETS_GRANDMOTHER
Garet's grandmother. "Grandma! What's the matter? Are you choking?".
void FieldFx_ResumeLightning(void)
Restarts the lightning: the next flash in 128 frames, repeating.
void FieldFx_StartLightning(void)
Starts the storm's lightning (FieldFx_UpdateLightning): builds the dark (0x10003) and lit (0x10005) p...
void FieldFx_StopLightning(void)
Stops the lightning: no flash for 0x7fff frames, and none after.
void FieldFx_LastLightning(void)
One last flash of lightning in 12 frames, then no more.