30#include "text/msg_ids.h"
40#define FLAG_LAMA_TEMPLE_PSYNERGY_STONE 0x350
42#define SCENE_ALPINE_CROSSING ((s32)&SceneId_AlpineCrossingLamaTemple1)
43#define SCENE_LAMA_TEMPLE ((s32)&SceneId_AlpineCrossingLamaTemple2)
115#define SEARCH_FACING(facing) (EVENT_SEARCH | EVENT_TOUCH_FACING | (facing))
125 object->actor.sprite->image.priority = 3;
126 object->actor.sprite->shadow.priority = 3;
484 if ((leader->
z.
fixed >> 20) == 13) {
972 {0,
CONDITION_ALWAYS, 496, 0, 216,
FACING_WEST, 0, -1, -1, -1, -1, 0},
973 {1,
CONDITION_ALWAYS, 216, 0, 520,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
974 {2,
CONDITION_ALWAYS, 136, 0, 168,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
975 {3,
CONDITION_ALWAYS, 144, 0, 200,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
976 {5,
CONDITION_ALWAYS, 232, 0, 352,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
981 {0,
CONDITION_ALWAYS, 496, 0, 216,
FACING_WEST, 0, -1, -1, -1, -1, 0},
982 {1,
CONDITION_ALWAYS, 496, 0, 216,
FACING_WEST, 0, 16, 32, 520, 416, 0},
983 {2,
CONDITION_ALWAYS, 384, 0, 72,
FACING_SOUTH, 0, 16, 32, 520, 416, 0},
984 {3,
CONDITION_ALWAYS, 40, 0, 280,
FACING_EAST, 0, 16, 32, 520, 416, 0},
985 {4,
CONDITION_ALWAYS, 88, 0, 248,
FACING_SOUTH, 0, 16, 32, 520, 416, 0},
986 {5,
CONDITION_ALWAYS, 216, 0, 248,
FACING_SOUTH, 0, 16, 32, 520, 416, 0},
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.
static void LamaTemple_ReadWallWriting(void)
Searching the temple wall reads its writing, the hint toward Reveal.
static s32 Actor_DrawBehindScenery(struct ScriptInterpreter *interpreter)
Draws the actor behind the background, on sprite priority 3 with automatic priority off.
@ TEMPLE_ENTRANCE_FAREWELL
@ TEMPLE_ENTRANCE_FROM_HAMAS_ROOM
static void LamaTemple_RunHamasFarewell(void)
Hama's farewell, once the party has freed Hsu: she thanks the Adepts, Garet and Mia squabble over who...
struct ScenePlacement gLamaTemple_Placements[]
static void AlpineCrossing_LiftBoulder(void)
Lift on the boulder: it floats, and Hama and Feizhi pull Hsu free in two heaves of two tugs each,...
static void AlpineCrossing_GrowSprout(void)
Growth grows the sprout into a vine the party can climb: the two cells above it take the climbable at...
struct SceneEvent gAlpineCrossing_Events[]
s32 gAlpineCrossing_WorkerPlacementScript[]
The first worker's placement script: draw him behind the background.
static void LamaTemple_TalkToChiMonk(void)
The monk who praises Master Hama as the greatest master of Chi.
#define SCENE_LAMA_TEMPLE
u32 gAlpineCrossingLamaTemple_Exits[]
static void LamaTemple_TalkToHealer(void)
The traveling healer offers the sanctum's services when spoken to across his counter,...
u16 gLamaTemple_DoorOpenCells[]
The door of Hama's room sliding open, and shut again.
static s32 Leader_FaceFeizhi(union FieldObject *object)
static void AlpineCrossing_FeizhiArrives(void)
When the party steps onto the road by the rockslide, once Feizhi has set out after Hsu,...
struct SceneEntrance gLamaTemple_Entrances[]
static void LamaTemple_TalkToMeditatingMonk(void)
The meditating monk explains meditation.
LamaTempleActor
Lama Temple's actors.
#define FLAG_LAMA_TEMPLE_PSYNERGY_STONE
the temple's Psynergy Stone
s32 gAlpineCrossing_LeaderPath[]
The party leader follows Feizhi most of the way.
static void AlpineCrossing_RevealPath(void)
Reveal shows the path hidden at (5, 13): the revealed cells, kept at (5, 28), are copied there with t...
struct SceneEntrance gAlpineCrossing_Entrances[]
const struct ScenePlacement * Scene_GetPlacements(void)
@ CROSSING_ENTRANCE_FROM_LAMA_TEMPLE
const struct SceneEntrance * Scene_GetEntrances(void)
static void AlpineCrossing_HamaReachesHsu(void)
Master Hama, kneeling by Hsu, asks if he is hurt; he is unhurt but cannot move, and none of them know...
static void AlpineCrossing_HidePath(void)
When Reveal's light ends, the plain cells kept at (6, 28) cover the path again.
static void AlpineCrossing_TalkToFeizhi(void)
Feizhi, before Xian hears of the accident, asks whether she should return to Xian; either way she dec...
#define SCENE_ALPINE_CROSSING
s32 gAlpineCrossing_HsuStruggle[]
Hsu, pinned under the boulder, struggles now and then.
@ TRIGGER_TEMPLE_WALL_WRITING
static void LamaTemple_RevealPassage(void)
Reveal shows the passage behind the false wall: the cell's original attributes (saved at (21,...
s32 gAlpineCrossing_FeizhiPath[]
Feizhi's run down the path toward Hsu, walking, then standing.
const struct SceneEvent * Scene_GetEvents(void)
static void LamaTemple_TalkToEastwardMonk(void)
The eastward monk asks whether the party came from the east, across Lamakan Desert,...
static void LamaTemple_ShowFalseWall(void)
Puts the false wall back when Reveal's light ends (and on entry): the wall's cell blocks the way agai...
static void AlpineCrossing_ReadSignpost(void)
Searching the signpost. "North: Altin Mine. West: Lama Temple.".
const u32 * Scene_GetExits(void)
Both scenes share one exit table.
AlpineCrossingActor
Alpine Crossing's actors.
const struct SceneRegion * Scene_GetRegions(void)
@ CROSSING_EXIT_TO_FAREWELL
struct ScenePlacement gAlpineCrossing_Placements[]
struct SceneEvent gLamaTemple_Events[]
static s32 Pillar_SortAgainstLeader(union FieldObject *object)
#define SEARCH_FACING(facing)
A search made while facing the given way.
s32 Scene_Initialize(void)
Sets up whichever scene is being entered and runs its arrival events.
static void AlpineCrossing_FreezePuddle(void)
Frost freezes the puddle into a pillar the party can climb: it stops blocking movement and moving,...
static void LamaTemple_EnterHamasRoom(void)
Walking north into the door of Hama's room slides it open and walks the party leader through,...
u16 gLamaTemple_DoorCloseCells[]
static void AlpineCrossing_PrepareFrost(void)
As Frost reaches the puddle, a leader standing north of it sees the pillar rise in front of the backg...
Calls through a function pointer, by argument count.
The engine calls the debug menus import, and their palette swatch tiles.
Field effects, their scripts and the flags that spawn them.
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_FaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_ActorSetAnimationAndWait(s32 actor, s32 animation)
void Engine_SanctumOpen(s32 priest)
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)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
void Engine_MessageShowCentered(s32 message, s32 flags)
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
void Engine_CameraMoveToActor(s32 actor, s32 pan)
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
#define MAP_CELL_STEP(srcX, srcY, width, height, frames)
static void Actor_SetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames)
static void Map_CopyCellsTo(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
static void Event_SkipMessages(s32 count)
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)
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_ActorStop(s32 actor)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
static void Event_PlayCue(s32 cue)
void Engine_MapObjectSetPosition(s32 object, s32 fixed_x, s32 fixed_z)
#define MAP_CELL_STEPS_END
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
static s32 Event_AskYesNo(s32 speaker, s32 flags)
static void MapObject_SetPosition(s32 object, s32 fixed_x, s32 fixed_z)
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)
@ TRANSITION_BACKDROP_FADE
@ ACTOR_PRIORITY_UNDERFOOT
The depth sort treats it as 320 pixels higher on the screen.
@ ACTOR_PRIORITY_AUTOMATIC
The sprite takes its priority from the map cell under it.
#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 PSYNERGY_PHASE_ON_ACTOR(ability, phase)
A Psynergy event on an actor at one phase of the cast, as PSYNERGY_IN_AREA is for an area.
#define SCENE_EXITS(scene)
#define PSYNERGY_IN_AREA(ability, phase)
#define IF_FLAG_SET(flag)
#define FIND_PSYNERGY_STONE
#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 FACING_IS_NORTH(facing)
Game flags, named where their meaning is shown.
#define FLAG_SHOW_LOCATION_NAME
#define FLAG_XIAN_HEARD_HSU_TRAPPED
#define FLAG_LAMA_TEMPLE_WATER_OF_LIFE
the temple's chest
#define FLAG_SCENE_TEMP_00
#define FLAG_HSU_RESCUED_WITHOUT_PARTY
Hsu was freed without the party: set with FLAG_HSU_RESCUED when the party comes back from Lama Temple...
#define FLAG_HAMA_REACHED_HSU
Hama has reached Hsu and spoken with him and Feizhi.
#define FLAG_KEEP_PARTY_POSITION
#define FLAG_ALPINE_CROSSING_POWER_BREAD
the crossing's chest
#define FLAG_SCENE_TEMP_01
#define FLAG_FEIZHI_WENT_TO_HSU
#define FLAG_FEIZHI_SAW_ROCKSLIDE
Feizhi has found the road blocked and run ahead to look for Hsu.
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.
s32 ArcTan2(s32 x, s32 y)
Returns the angle of the vector (x, y), in 1/65536 turns, measured from the y axis: 0 along +y,...
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_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 BattleFx_PlayQueuedSound(void)
Plays the sound BattleFx_SetQueuedSoundAndPlay remembered, if any.
void BattleFx_SetQueuedSoundAndPlay(s32 soundId)
Plays SE_298, then soundId (SE_289 for -1), and remembers soundId for BattleFx_PlayQueuedSound in the...
Scene numbers, named after their places.
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_EventBegin(void)
void Engine_EventSetMessage()
void Engine_EventShowMessage()
s32 startTransition
SCENE_TRANSITION(style, variant).
A field actor: a person or thing on the field with a position, motion toward a target,...
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
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 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.
u8 collisionFlags
bits: 7 refuses to move into a solid object | 4 nearer for Psynergy targets | 3 never a talk or Psyne...
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 system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
The integer types, TRUE, UNUSED and the fixed-address macros.
s32 fixed
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.