37#include "text/msg_ids.h"
246 if (hideDoorLayers != 0) {
442 if (rewardTaken != 0) {
447 if (curseLifted != 0) {
638 actor->
z.
part.pixel);
644 actor->
z.
part.pixel);
651 actor->
z.
part.pixel);
841 actor->
z.
part.pixel);
1016 s32 advanceAlternateReply;
1023 advanceAlternateReply = 0;
1057 advanceAlternateReply = 1;
1060 advanceAlternateReply = 0;
1063 if (advanceAlternateReply != 0) {
1100 advanceAlternateReply = 1;
1103 advanceAlternateReply = 0;
1107 if (advanceAlternateReply != 0) {
1111 advanceAlternateReply = 1;
1114 advanceAlternateReply = 0;
1118 if (advanceAlternateReply != 0) {
1151 advanceAlternateReply = 1;
1154 advanceAlternateReply = 0;
1160 if (advanceAlternateReply != 0) {
1208 advanceAlternateReply = 1;
1211 advanceAlternateReply = 0;
1215 if (advanceAlternateReply != 0) {
1343 SC_CALL(Scene_TurnTowardTarget),
1362 {0,
CONDITION_ALWAYS, 256, 0, 808,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
1363 {1,
CONDITION_ALWAYS, 256, 0, 808,
FACING_NORTH, 0, 32, 496, 480, 856, 0},
1364 {2,
CONDITION_ALWAYS, 120, 0, 792,
FACING_EAST, 0, 32, 496, 480, 856, 0},
1365 {3,
CONDITION_ALWAYS, 392, 0, 792,
FACING_WEST, 0, 32, 496, 480, 856, 0},
1366 {4,
CONDITION_ALWAYS, 232, 0, 712,
FACING_EAST, 0, 32, 496, 480, 856, 0},
1367 {5,
CONDITION_ALWAYS, 280, 0, 712,
FACING_WEST, 0, 32, 496, 480, 856, 0},
1368 {6,
CONDITION_ALWAYS, 152, 0, 632,
FACING_WEST, 0, 32, 496, 480, 856, 0},
1369 {7,
CONDITION_ALWAYS, 104, 0, 552,
FACING_EAST, 0, 32, 496, 480, 856, 0},
1370 {8,
CONDITION_ALWAYS, 408, 0, 552,
FACING_WEST, 0, 32, 496, 480, 856, 0},
1371 {9,
CONDITION_ALWAYS, 256, 0, 632,
FACING_SOUTH, 0, 32, 496, 480, 856, 0},
1372 {10,
CONDITION_ALWAYS, 152, 0, 376,
FACING_WEST, 0, 56, 304, 360, 464, 0},
1373 {11,
CONDITION_ALWAYS, 264, 0, 376,
FACING_EAST, 0, 56, 304, 360, 464, 0},
1374 {12,
CONDITION_ALWAYS, 104, 0, 376,
FACING_SOUTH, 0, 56, 304, 360, 464, 0},
1375 {13,
CONDITION_ALWAYS, 312, 0, 376,
FACING_SOUTH, 0, 56, 304, 360, 464, 0},
1376 {14,
CONDITION_ALWAYS, 696, 0, 96,
FACING_WEST, 0, 592, 0, 832, 160, 0},
1377 {15,
CONDITION_ALWAYS, 680, 0, 72,
FACING_WEST, 0, 592, 0, 832, 160, 0},
1378 {16,
CONDITION_ALWAYS, 952, 0, 72,
FACING_EAST, 0, 800, 0, 1040, 160, 0},
1379 {17,
CONDITION_ALWAYS, 936, 0, 96,
FACING_EAST, 0, 800, 0, 1040, 160, 0},
1380 {18,
CONDITION_ALWAYS, 88, 0, 200,
FACING_NORTH, 0, 0, 16, 240, 240, 0},
1381 {19,
CONDITION_ALWAYS, 360, 0, 200,
FACING_NORTH, 0, 208, 16, 448, 240, 0},
1382 {20,
CONDITION_ALWAYS, 536, 0, 112,
FACING_EAST, 0, 400, 0, 640, 160, 0},
1383 {21,
CONDITION_ALWAYS, 536, 0, 88,
FACING_EAST, 0, 400, 0, 640, 160, 0},
1384 {22,
CONDITION_ALWAYS, 520, 0, 312,
FACING_WEST, 0, 400, 208, 640, 368, 0},
1385 {23,
CONDITION_ALWAYS, 520, 0, 296,
FACING_WEST, 0, 400, 208, 640, 368, 0},
1386 {24,
CONDITION_ALWAYS, 728, 0, 264,
FACING_EAST, 0, 592, 192, 832, 352, 0},
1387 {25,
CONDITION_ALWAYS, 904, 0, 264,
FACING_WEST, 0, 792, 192, 1032, 352, 0},
1388 {26,
CONDITION_ALWAYS, 744, 0, 424,
FACING_EAST, 0, 592, 352, 832, 512, 0},
1389 {27,
CONDITION_ALWAYS, 888, 0, 424,
FACING_WEST, 0, 792, 352, 1032, 512, 0},
1390 {28,
CONDITION_ALWAYS, 600, 0, 760,
FACING_EAST, 0, 512, 560, 752, 816, 0},
1391 {29,
CONDITION_ALWAYS, 896, 0, 728,
FACING_NORTH, 0, 776, 560, 1016, 768,
Ability numbers, named from the English release.
void Object_RefreshSelectorById(u32 objectId)
Waits, at most 300 frames, for an actor's script to reach its end (command 0x10).
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
const struct ScenePlacement * Scene_GetPlacements(void)
const struct SceneEntrance * Scene_GetEntrances(void)
const struct SceneEvent * Scene_GetEvents(void)
const u32 * Scene_GetExits(void)
Both scenes share one exit table.
const struct SceneRegion * Scene_GetRegions(void)
s32 Scene_Initialize(void)
Sets up whichever scene is being entered and runs its arrival events.
Calls through a function pointer, by argument count.
Character numbers, with each character's Japanese name.
The engine calls the debug menus import, and their palette swatch tiles.
FacingObject, the view of an object that turns to face a target.
void FieldScene_PrepareActors(struct ScenePlacement *entry)
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)
#define SPEAKER_WINDOW_ABOVE
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)
void Engine_EventShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
#define SPEAKER_PORTRAIT_RIGHT
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)
static void Actor_MoveToAndWait(s32 actor, s32 x, s32 z)
static void Actor_SetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_EventCloseScreen(void)
void Engine_ObjectDispatchRelease(struct FieldActor *object)
void Engine_ActorSetDestination(s32 actor, s32 x, s32 z)
void Engine_ActorWalkToAndWait(s32 actor, s32 x, s32 z)
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)
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)
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_ActorStop(s32 actor)
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)
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
struct FieldActor * Engine_EventGetViewCenter(void)
static void Actor_CenterAndWalk(s32 actor, s32 priority, s32 dz)
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_EventWait(s32 frames)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
@ TRANSITION_BACKDROP_FADE
#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 PLACEMENT_SHARE_PREVIOUS_SPRITE
#define TOUCH_FACING(facing)
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_MCCOY_PALACE_BARREL_SMOKE_BOMB
#define FLAG_SHOW_LOCATION_NAME
#define FLAG_SCENE_TEMP_12
#define FLAG_SCENE_TEMP_13
#define FLAG_MCCOY_PALACE_REWARD_TAKEN
#define FLAG_IN_PARTY(character)
Flags 0 to 7: the character with that id (character_ids.h) is in the party (Party_AddActiveOwner).
#define FLAG_MCCOY_PALACE_PARTY_REWARDED
The escort has seen the party off after McCoy's reward.
#define FLAG_MCCOY_PALACE_VISITED
set on every entry to the palace
#define FLAG_MCCOY_PALACE_BARREL_ELIXIR
#define FLAG_MCCOY_PALACE_ADMITTED
The gate guards have let the party into the palace.
#define FLAG_SCENE_TEMP_00
#define FLAG_SCENE_TEMP_02
#define FLAG_SCENE_TEMP_11
#define FLAG_MCCOY_PALACE_JOB_REFUSED
The party refused McCoy's job at the first audience.
#define FLAG_MCCOY_PALACE_BARRICADE_HINT
After McCoy turned the party away, his escort let slip that the barricade may not need a key.
#define FLAG_KEEP_PARTY_POSITION
#define FLAG_KOLIMA_CURSE_LIFTED
#define FLAG_SCENE_TEMP_10
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.
Item numbers, named from the English release.
static void Event_TalkToStartledResident(void)
A resident of the outer rooms, startled the first time, asks whether the party sneaked in in search o...
void Map_SetLayerEntryFlag(u32 channelIndex)
Pauses tile animation channel channelIndex by setting its paused byte.
void Map_ClearLayerEntryFlag(u32 channelIndex)
Resumes tile animation channel channelIndex by clearing its paused byte.
struct ScenePlacement gMcCoyPalacePlacements[]
static void Event_EscortAsksPartyToChoose(void)
Leaving the reward room without a reward: the escort walks the leader back.
static void Event_WalkThroughDoor(void)
Walking through one of the palace's doors: it opens with a sound, the leader walks through and the ne...
static void Event_McCoyRewardsParty(void)
Brought in after lifting Kolima's curse: McCoy thanks the party and sends them to choose a reward.
struct ScenePlacement gMcCoyPalacePlacementsOther[]
static void Event_SearchPotionChest(void)
Searching the second reward chest: a Potion, while no reward is taken.
struct SceneEntrance gMcCoyPalaceEntrances[]
static void Event_EscortHintsAtBarricade(void)
At the front door after the audience: McCoy's escort is sorry the party was rejected,...
struct SceneEvent gMcCoyPalaceEvents[]
static void Event_SearchPsyCrystalChest(void)
Searching the third reward chest: a Psy Crystal, while no reward is taken.
static void Event_TalkToRewardKeeper(void)
The keeper of McCoy's treasures: while the party chooses, only one item; after, the reward was the gr...
static void McCoyPalace_ShowUnavailableChest(s32 chestFlag)
Searching a reward chest after the reward: the chosen one is empty, the others locked.
@ ACTOR_PSY_CRYSTAL_CHEST
@ ACTOR_WATER_OF_LIFE_CHEST
@ ACTOR_STARTLED_RESIDENT
static void Event_TalkToAdmirer(void)
The admirer praises the party the first time, then warns of the holy tree.
static void McCoyPalace_ShowChestEmpty(void)
The chest is empty. "Isaac checked the chest... but it was empty.".
static void Event_EscortSeesPartyOff(void)
Leaving the reward room with a reward: the escort leaves.
s32 gPalace_PacingActions[]
static void Event_ReadAdmirersThoughts(void)
Mind Read on the admirer shows two thoughts.
static void Event_SearchVialChest(void)
Searching the first reward chest: a Vial, while no reward is taken.
static void Event_PresentRewardChests(void)
In the reward room: the escort shows the four chests and the keeper explains that only one may be cho...
static void McCoyPalace_FaceCompanionsForDiscussion(void)
Garet, Ivan and Mia turn to talk among themselves.
static __inline__ void McCoyPalace_OpenRewardChestRow(void)
The cells before the chest row can be walked on.
static __inline__ void McCoyPalace_PrepareCompanionApproach(void)
Garet, Ivan and Mia get ready to walk up to McCoy.
static __inline__ void McCoyPalace_PositionRewardChests(void)
The four reward chests stand in a row.
s32 gPalace_FacingActions[]
static void McCoyPalace_ClaimReward(s32 chestActorId, s32 itemId, s32 chestFlag)
The chest opens and gives its item; with no room for it, the chest closes again and the reward is sti...
static void Event_SearchWaterOfLifeChest(void)
Searching the fourth reward chest: a Water of Life, while no reward is taken.
struct SceneEvent gMcCoyPalaceEventsOther[]
static void Event_AskAboutGoingToKolima(void)
Asks about going to Kolima. "Oh, are you willing to go to Kolima Forest?".
static void McCoyPalace_ShowChestLocked(void)
The chest is locked. "The treasure chest is locked.".
static void Event_AudienceWithMcCoy(void)
The first audience: the escort announces the party and McCoy asks them to lift Kolima's curse.
static void Event_TalkToKolimaWatcher(void)
The watcher saw the party go to Kolima.
static void Event_ReadRewardKeepersThoughts(void)
static void McCoyPalace_FaceCompanionsForAudience(void)
Garet, Ivan and Mia face McCoy again.
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.
s32 BattleFx_PlayCueAndStartEmitterOnTarget(s32 actor, s32 target, s32 itemId)
If actor target exists, plays SE_124, gives it animation 4 and, 12 frames later, shows itemId in fron...
Scene numbers, named after their places.
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()
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
s32 startTransition
SCENE_TRANSITION(style, variant).
s16 touchedTrigger
the step event a touch or exit event answers
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,...
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
union FieldCoordinate z
16.16 fixed-point pixels
s32 scaleX
16.16 fixed point, 0x10000 full size
s32 scaleY
16.16 fixed point, 0x10000 full size
The talkFacing bytes of placement rows 6 to 9: actors 14 to 17.
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 system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
The integer types, TRUE, UNUSED and the fixed-address macros.
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels