35#include "text/msg_ids.h"
112 actor->
timer = completed;
141 actor->
work = nextTimer;
259 relativeFacing = (leader->
facing + 0xfffff000) << 16;
260 if (relativeFacing > 0x60000000) {
271 *message = *message + 1;
294 relativeFacing = (leader->
facing - 0x2000) << 16;
295 if (relativeFacing > 0x80000000) {
312 relativeFacing = (leader->
facing - 0x6001) << 16;
313 if (relativeFacing <= 0x7ffe0000) {
330 relativeFacing = (leader->
facing - 0x2000) << 16;
331 if (relativeFacing > 0xC0000000) {
358 trigger = &
event->touchedTrigger;
478 }
while (last->
timer == 0);
589 message = MsgKalayShortOnePerson;
656 message = MsgKalayDecideEnteringColosso;
892 flags |= *priorityFlags;
893 *priorityFlags = flags;
903 flags &= *priorityFlags;
904 *priorityFlags = flags;
967 sprite->
state = found;
1057 if (resumedScene != 0) {
1058 effectWork = workSlots[9];
1061 if (trackingValue != 0) {
1066 effectWork->
actor = actor;
1070 if (trackingValue != 0) {
1085 effectWork = workSlots[9];
1088 if (trackingValue != 0) {
1096 if (trackingValue != 0) {
1232 actor->
timer = actorId;
1234 actor->
work = (random * 5) >> 12;
1328 if (actor !=
NULL) {
1477 const s32 *motionActions;
1479 const s32 *exitActions;
1530 motionPhase = random * 5;
1533 *(
u16 *)leaderPhase = motionPhase >> 12;
1566 *(
u16 *)leaderPhase = (random * 5) >> 12;
1570 *(
u16 *)leaderPhase = (random * 5) >> 12;
1574 *(
u16 *)leaderPhase = (random * 5) >> 12;
1713 object->facing = southFacing;
1774 s32 stoppedVelocity;
1778 direction = (leader->
facing >> 12);
1779 leaderX = leader->
x.
part.pixel;
1782 SceneActor_FindActorAtCell((leaderX + (probeStep >> 16)) >> 4,
1783 (leader->
z.
part.pixel + (
s16)probeStep) >> 4);
1784 if (block !=
NULL) {
1785 stoppedVelocity = 0;
1787 target = &destination;
1790 block->
z.
fixed + (moveStep << 16));
1793 pushSpeed =
PIXELS(1) / 5;
1796 block->
speed = pushSpeed;
1799 leader->
speed = pushSpeed;
1819 s32 firstPassageOpen;
1830 if (firstPassageOpen != 0) {
1831 }
else if ((firstBlock->
x.
fixed >> 19) > 29) {
1890 }
else if ((secondBlock->
x.
fixed >> 19) > 87) {
1947 s32 remainingFrames;
1951 lifetime = &particle->
timer;
1952 remainingFrames = *lifetime;
1953 if (remainingFrames == 0) {
1955 }
else if (remainingFrames == 1) {
1971 s32 nextLifetime = *(
u16 *)lifetime;
1973 *(
u16 *)lifetime = nextLifetime;
1987 if ((
u32)(firstEmitter->
x.
part.pixel - 381) <= 12 &&
1988 firstEmitter->
z.
part.pixel > 777) {
1989 firstEmitter->sprite->image.priority =
2025 (((((
u32)(random << 3) >> 16) << 16) + height) +
PIXELS(16)), depth);
2026 if (particle != 0) {
2028 (attributeMask = 0);
2029 spriteBytes = (
u8 *)particle->sprite;
2030 attributeMask -= 13;
2031 spriteBytes[9] = ((spriteBytes[9] & attributeMask) | 8);
2035 particle->
velocityX = ((((
u32)(random << 1) >> 16) - 1) << 16);
2038 ((((
u32)(((random << 1) + random) << 1) >> 16) - 3) << 16);
2090#define TILE_STEP(dx, dz) (((u32)(dx) << 16) | ((dz) & 0xffff))
2092#define TILE_STEP(dx, dz) (((dx) << 16) | ((dz) & 0xffff))
2254 {0,
CONDITION_ALWAYS, 168, 0, 168,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2259 {0,
CONDITION_ALWAYS, 224, 0, 280,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2260 {1,
CONDITION_ALWAYS, 72, 0, 200,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2261 {2,
CONDITION_ALWAYS, 408, 0, 184,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2262 {3,
CONDITION_ALWAYS, 408, 0, 216,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2263 {4,
CONDITION_ALWAYS, 408, 0, 408,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2264 {5,
CONDITION_ALWAYS, 328, 0, 440,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2265 {6,
CONDITION_ALWAYS, 120, 0, 264,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2266 {7,
CONDITION_ALWAYS, 312, 0, 264,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2267 {8,
CONDITION_ALWAYS, 152, 0, 440,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2268 {9,
CONDITION_ALWAYS, 224, 0, 464,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
2269 {10,
CONDITION_ALWAYS, 56, 0, 272,
FACING_EAST, 0, -1, -1, -1, -1, 0},
2270 {11,
CONDITION_ALWAYS, 224, 0, 88,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2271 {12,
CONDITION_ALWAYS, 296, 0, 408,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2272 {13,
CONDITION_ALWAYS, 152, 0, 232,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2273 {14,
CONDITION_ALWAYS, 440, 0, 88,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2278 {0,
CONDITION_ALWAYS, 168, 0, 168,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2279 {1,
CONDITION_ALWAYS, 192, 0, 280,
FACING_NORTH, 0, 0, 0, 400, 352, 0},
2280 {2,
CONDITION_ALWAYS, 192, 0, 232,
FACING_SOUTH, 0, 0, 0, 400, 352, 0},
2285 {0,
CONDITION_ALWAYS, 168, 0, 168,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2286 {1,
CONDITION_ALWAYS, 248, 0, 152,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2287 {2,
CONDITION_ALWAYS, 424, 0, 520,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
2288 {10,
CONDITION_ALWAYS, 440, 0, 540,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
2293 {0,
CONDITION_ALWAYS, 168, 0, 168,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2294 {1,
CONDITION_ALWAYS, 296, 0, 104,
FACING_SOUTH, 0, 100, 50, 440, 445, 0},
2295 {2,
CONDITION_ALWAYS, 280, 0, 392,
FACING_NORTH, 0, 100, 50, 440, 445, 0},
2300 {0,
CONDITION_ALWAYS, 168, 0, 168,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2301 {1,
CONDITION_ALWAYS, 296, 0, 456,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2302 {2,
CONDITION_ALWAYS, 632, 0, 456,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2303 {3,
CONDITION_ALWAYS, 152, 0, 72,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2304 {4,
CONDITION_ALWAYS, 568, 0, 152,
FACING_SOUTH, 0, 390, 0, 630, 220, 0},
2305 {5,
CONDITION_ALWAYS, 472, 0, 72,
FACING_SOUTH, 0, 390, 0, 630, 220, 0},
2310 {0,
CONDITION_ALWAYS, 168, 0, 168,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2311 {1,
CONDITION_ALWAYS, 408, 0, 632,
FACING_SOUTH, 0, 85, 400, 465, 880, 0},
2312 {2,
CONDITION_ALWAYS, 296, 0, 488,
FACING_SOUTH, 0, 85, 400, 465, 880, 0},
2313 {3,
CONDITION_ALWAYS, 744, 0, 488,
FACING_SOUTH, 0, 595, 400, 930, 880, 0},
2314 {4,
CONDITION_ALWAYS, 856, 0, 856,
FACING_NORTH, 0, 595, 400, 930, 880, 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).
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 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.
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 engine call layer: one typed inline for each of the thirteen main-image routines below that the s...
static s32 FieldScheduler_AddCallback(SchedulerCallback callback, s32 priority)
Registers a main-image scheduler callback.
static s32 FieldObject_CheckMovementCollision(struct FieldActor *actor, struct FieldPosition *position)
void BattleFx_StartFadeOverlay(void *object)
Starts the fade overlay on object (the party leader when NULL): loads its solid tiles,...
void Object_Destroy(struct DispatchObject *work)
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
void Engine_ObjectSetPosition(struct FieldActor *object, s32 fixed_x, s32 fixed_y, s32 fixed_z)
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 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_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)
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
void Engine_ItemLoadIcon(s32 item)
s32 Engine_MathSin(s32 angle)
#define MAP_CELL_STEP(srcX, srcY, width, height, frames)
void Engine_ItemShowFound(s32 item, s32 height)
static void Actor_SetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ActorSetSpeed(s32 actor, s32 speed, s32 acceleration)
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.
static void Map_CopyCellsTo(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
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)
static void Actor_SetActionScript(s32 actor, const s32 *script)
The engine encodes either a built-in action or an action-script address.
void * Engine_HeapAllocate(s32 slot, s32 size)
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_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_MapAnimateCells(const u16 *steps, s32 destX, s32 destY)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
s32 Engine_MathCos(s32 angle)
static s32 Event_AskYesNo(s32 speaker, s32 flags)
static void Actor_CenterAndWalk(s32 actor, s32 priority, s32 dz)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_MapRedraw(void)
void Engine_ShopOpen(s32 shop, s32 keeper)
static s32 Random_Next(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_ActorFaceEachOther(s32 actor, s32 other, s32 frames)
void Engine_EventWait(s32 frames)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
static struct FieldActor * Actor_Get(s32 actor)
Field objects and actors, and the scene transition styles.
@ 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 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 EVENT_TOUCH_WALKING
#define TOUCH_WALKING_INTO(facing)
#define FIND_COINS(coins)
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_KALAY_TOWN_NUT_CAUGHT
the Nut circling in the town
#define FLAG_SCENE_TEMP_03
#define FLAG_REACHED_KALAY
Set whenever Kalay is entered; Vale's villagers then talk of the party's journey.
#define FLAG_LUNPA_TRADE_REOPENED
#define FLAG_LUNPA_HEARD_OF_PRISONER
#define FLAG_SCENE_TEMP_00
#define FLAG_SCENE_TEMP_02
#define FLAG_IVAN_REPORTED_TO_LAYANA
that Hammet is still in Lunpa
#define FLAG_KEEP_PARTY_POSITION
#define FLAG_SCENE_TEMP_01
#define FLAG_KALAY_HEARD_OF_COLOSSO_TOUR
The inn's guests told the party about the Colosso tour to Tolbi.
#define FLAG_KALAY_COLOSSO_TOUR_LEFT
the tour group has left town
#define FLAG_LAYANA_SCOLDED_LUNPA_VISIT
volatile u32 gFrameCount
Frames WaitFrames has finished.
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.
The heap's work slots and HeapState.
The main-image routines scene overlays import.
Item numbers, named from the English release.
const u32 * Kalay_GetExits(void)
The numbered exits of all six maps.
struct ScenePlacement gKalay_NoPlacements[]
static void Kalay_PushTunnelBlock(void)
In the tunnel, walking into a block pushes it one tile when there is room.
struct SceneEntrance gKalay_PalaceGateEntrances[]
static void Kalay_RecruitDjinn(void)
Talking to the Mars Djinni in the tunnel adds it to the party.
s32 gKalay_TunnelParticleScript[]
s32 gKalay_TourGroupLeaveScript[]
static void Kalay_HammetReturnsToPalace(void)
Arriving through the cave's entrance 10, Hammet comes home by Bunza's wagon with the party.
s32 gKalay_TileStepByFacing[]
struct MapCellAnim gKalay_DoorCells[]
s32 gKalay_GuidePaceScript[]
s32 gKalay_SecondGuideStopScript[]
static void Kalay_StartTrackingLeader(void)
Touching trigger 11 in the tunnel makes the fade overlay follow the leader.
static void Kalay_WatchTourGroupDeparture(void)
Leaving town (triggers 9 and 10) after hearing of the Colosso tour, the party watches the tour group ...
static s32 Kalay_UpdateTouristFidget(struct ScriptInterpreter *interpreter)
While the tour waits, a tourist now and then nods, shakes his head or turns.
static void Kalay_CatchCaveNut(void)
Catch pulls in the Nut floating in the cave.
static void Kalay_FreezeFrostTarget(void)
Frost on the target sinks it into the floor, clearing its cells.
static void Kalay_UpdateNutOrbit(void)
The town Nut circles its spot and rocks as it goes.
struct SceneEntrance gKalay_CaveEntrances[]
static void Kalay_UpdateTunnelEmitters(void)
Particles stream from each block while its passage is closed.
struct SceneEvent gKalay_TownEvents[]
static void Kalay_TalkAboutLeavingHome(void)
A man tells why he moved to Kalay: he left Tolbi, afraid of Babi.
struct SceneEvent gKalay_NoEvents[]
static void Kalay_UpdateTunnelPassages(void)
Once a block is pushed far enough west, its passage opens step by step and the frost target appears f...
struct SceneEntrance gKalay_TownEntrances[]
#define TILE_STEP(dx, dz)
struct SceneEntrance gKalay_Entrances5[]
static void Kalay_TalkToItemMerchant(void)
Across the counter, the leader facing east, the item shop opens; from elsewhere the merchant praises ...
static void Kalay_StartTouristFidgeting(s32 actorId)
A tourist starts fidgeting after a random pause.
static void Kalay_CatchTownNut(void)
Catch pulls in the Nut circling in the town.
static void Kalay_StartGuidesPacing(void)
The guides speed up and start pacing in turn.
static void Kalay_StopTrackingLeader(void)
Touching trigger 10 in the tunnel stops the fade overlay following the leader.
static void Kalay_TalkToArmorMerchant(void)
Across the counter, the leader facing west to north, the armor shop opens; from elsewhere the merchan...
static __inline__ void Kalay_ClearScriptDone(struct FieldActor *actor)
Clears the flag a guide's script sets when it is done.
static void Kalay_DisableLeaderAutomaticPriority(void)
Trigger 18 in the tunnel: the leader's depth priority stays fixed.
static void Kalay_SpawnTunnelParticle(s32 x, s32 height, s32 z)
Creates a short-lived particle with random position and velocity offsets.
const struct SceneRegion * Kalay_GetRegions(void)
struct SceneEvent gKalay_CaveEvents[]
static void Kalay_StartWindowTransition(void)
The fifth map opens with a window transition.
struct SceneEntrance gKalay_NoEntrances[]
KalayActor
Kalay's maps share actor numbers; each is named on the map it is proved.
@ ACTOR_PALACE_GUARD
Hammet's palace gate.
@ ACTOR_SECOND_PALACE_GUARD
@ ACTOR_CAVE_GUARD
The cave by the palace's secret passage.
@ ACTOR_FIRST_BLOCK
the blocks that open the two passages
@ ACTOR_LATE_TOURIST
the one the tour guides are missing
@ ACTOR_HEAD_GUIDE
the Colosso tour's guides
s32 Kalay_Initialize(void)
Every map of Kalay sets flag 0x87a, then prepares its own people and cells.
static void Kalay_StartTouristsFidgeting(void)
All eight tourists start fidgeting.
static void Kalay_PreparePalaceGate(void)
The palace flags as in the town; walking up to the gate the first time, Ivan introduces himself to th...
struct SceneEvent gKalay_TunnelEvents[]
struct SceneEntrance gKalay_TunnelEntrances[]
const struct SceneEvent * Kalay_GetEvents(void)
The conversations, exits and Psynergy targets of each map.
static void Kalay_TalkToWeaponMerchant(void)
Across the counter, the leader facing north, the weapon shop opens; from elsewhere the merchant grumb...
struct SceneEvent gKalay_Events5[]
u16 gKalay_DoorCellSteps[]
static void Kalay_PrepareTunnel(void)
The tunnel: the fade overlay follows the leader unless he came in by entrance 4; pushed blocks,...
static __inline__ void Kalay_AnimatePalaceDoor(void)
The palace door opens in two frames.
s32 gKalay_HeadGuideStopScript[]
s32 gKalay_TouristFidgetScript[]
@ KALAY_CALLBACK_PRIORITY
static void Kalay_AlternateGuidesPacing(void)
Each guide paces in turn, starting when the other finishes.
static void Kalay_AskAboutCaveAccess(void)
Spoken to from any side but the north, the cave guard asks whether the party wants to go into the cav...
static void Kalay_PrepareTown(void)
Once Lunpa's trade has reopened, Hammet's palace flags (0x321 and 0x912 to 0x915) are set.
s32 gKalay_PartyGatherScript[]
struct SceneEvent gKalay_Events4[]
static void Kalay_UpdateTunnelParticle(struct ScriptInterpreter *interpreter)
const struct ScenePlacement * Kalay_GetPlacements(void)
The people of the town, palace gate, cave and tunnel.
s32 gKalay_SecondGuideReturnScript[]
static void Kalay_PrepareCave(void)
The cave's Nut floats until caught, the guard turns after flag 0x915, and arriving through entrance 1...
s32 gKalay_HeadGuideReturnScript[]
static void Kalay_OpenDoorAndExit(void)
Walking north into a house door, everyone stops, the door opens and the leader walks in.
struct ScenePlacement gKalay_TunnelPlacements[]
s32 gKalay_TourGroupWalkScript[]
const struct SceneEntrance * Kalay_GetEntrances(void)
static void Kalay_EnableLeaderAutomaticPriority(void)
Trigger 19 in the tunnel: the leader's depth priority follows his position.
struct SceneEntrance gKalay_Entrances4[]
struct ScenePlacement gKalay_TourGroupPlacements[]
struct SceneEvent gKalay_PalaceGateEvents[]
struct ScenePlacement gKalay_PalaceGatePlacements[]
static void Kalay_EnterPalace(void)
Walking north into the palace door, it opens and the leader walks in.
static void Kalay_TalkAboutLayana(void)
In the tunnel, a man asks whether Layana was too hard on the party.
s32 gKalay_PartyFidgetScript[]
s32 gKalay_FrostGrowScript[]
static void Kalay_SearchWell(void)
Searching the town well: the party peers in, and it is very clean.
KalayTunnelFlag
The tunnel's own flags, kept while the party is there.
@ FLAG_TUNNEL_OVERLAY_FOLLOWS_LEADER
the fade overlay
@ FLAG_TUNNEL_SECOND_PARTICLES_SOUNDED
@ FLAG_TUNNEL_FROST_TARGET_FROZEN
@ FLAG_TUNNEL_FIRST_PARTICLES_SOUNDED
Each block's particles have started their sound.
@ FLAG_TUNNEL_SECOND_PASSAGE_OPEN
@ FLAG_TUNNEL_FIRST_PASSAGE_OPEN
struct ScenePlacement gKalay_CavePlacements[]
s32 gKalay_GuideCountScript[]
static void Kalay_IvanMeetsPalaceGuards(void)
At the palace gate the guards turn the party away until they recognize Ivan, tanned and grown,...
struct ScenePlacement gKalay_TownPlacements[]
Small statement macros both games use for positions, velocities and bounds.
#define SET_POSITION(p, px, py, pz)
Sets the position or the velocity of a particle, a piece of debris or an object in one statement.
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_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.
#define SC_MOVE_BY(x, y, z)
Move by a relative offset.
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...
The fade overlay, the weather particles and the actor effect work.
struct FadeOverlayWork * gActorEffectWork
static s32 Scene_LookAboutRandomly(struct ScriptInterpreter *interpreter)
An object script call, each frame: when the actor's countdown (work) runs out, it turns by a random a...
void FieldObject_WaitForMove(void *fieldObject)
Waits a frame at a time until a field object has arrived at its target, at most 600 frames.
The views of an orbiting scene object's sprite.
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...
The view a scene overlay takes of an effect; most fields are still unnamed.
void Audio_PlayCueFromEventWork(void)
Starts the current scene's field music, chosen by Scene_ResolveInteractionResult.
Scene numbers, named after their places.
s32 Scheduler_RemoveCallback(SchedulerCallback callback)
Unschedules the task running callback: clears its routine and gives it order 0x7fff,...
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()
void Scene_FloatNut(s32 id)
Draws actor id as the Nut's icon and starts it floating, 32 pixels up unless the party returns to whe...
#define offsetof(type, member)
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
u16 rotation
1/65536 turns
A field object as the object dispatcher's far calls take it.
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
The fade overlay draws one mark on each side of its tracked actor.
struct FieldActor * actor
the actor tracked; null draws nothing
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 speed
speed limit, 16.16 fixed-point pixels per frame
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
s32 velocityX
16.16 fixed-point pixels per frame
union FieldCoordinate y
16.16 fixed-point pixels
u8 priorityFlags
ActorPriorityFlag bits, read by the scrolling camera.
s32 velocityY
16.16 fixed-point pixels per frame
union FieldCoordinate z
16.16 fixed-point pixels
s32 acceleration
Added toward the target each frame, or taken off the speed when there is none, in 16....
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.
s32 velocityZ
16.16 fixed-point pixels per frame
u8 terrainId
The map layer (0 to 3) its ground height is read from, which the scrolling camera updates from the ce...
u8 frozen
Nonzero skips steering, terrain, gravity and floating; its velocity still moves it (ScriptMotionObjec...
s32 z
16.16 fixed-point pixels
Cell replacement: procedure and destination cells.
u16 y
destination cell row
u16 x
destination cell column
A floating Nut's sprite, seen as the attribute bits, palette and state its scenes set.
u8 state
AnimationObject's count of layers; the Nut's scenes zero it.
u8 palette
AnimationObject's slot: the VRAM cache entry the Nut's icon is loaded into.
u8 flags09Mode
priority; the Nut's scenes set 1
u8 flags05Bit5
full colour; the Nut's scenes clear it
u8 flags09High
palette; the Nut's scenes set 0
A floating Nut's actor: its position, the spot it sways around and how far through the sway it is,...
s32 orbitCenterY
16.16 fixed-point pixels
s32 y
16.16 fixed-point pixels
OrbitingSceneObjectSprite * sprite
s32 orbitCenterZ
16.16 fixed-point pixels
u8 visible
FieldActor's frozen, which skips steering, terrain, gravity and floating; the Nut's scenes set it.
u8 mode
FieldActor's motionFlags; the Nut's scenes zero it.
s32 x
16.16 fixed-point pixels
s32 orbitAngle
1/65536 turns; advanced by 0x400 plus two random steps each frame.
u8 active
FieldActor.retainSpriteCache: the Nut's scenes keep its sprite's VRAM cache entry.
s32 z
16.16 fixed-point pixels
s32 orbitCenterX
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,...
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.
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels
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,...