27#include "text/msg_ids.h"
43#define SECOND_OBJECT 9
44#define SECOND_OBJECT_MOVED 10
190 leader->
z.
part.pixel);
206 firstMessage = MsgKaragolDoYouWishCrossInto;
231 MESSAGE_SET(MsgKaragolWarriorsHaveBeenFightingWhile);
268 if ((actor->
x.
fixed >> 20) <= 30) {
280 StagedActor_AdvancePair();
297 s32 destinationCellX = 107;
298 s32 destinationCellZ = 17;
313 fieldObject->
actor.sprite->rotation -= 0x400;
319 s32 framesRemaining = 40;
321 while (framesRemaining != 0) {
324 if (actor->
y.
fixed <= heightLimit) {
335 struct Vector3 particleVelocity;
341 for (stepIndex = 0; stepIndex < 9; stepIndex++) {
343 actor->sprite->rotation -= 0x100;
360 for (stepIndex = 0; stepIndex < 17; stepIndex++) {
361 angle = stepIndex << 12;
363 particleVelocity.
y = 0;
365 particleVelocity.
x -= particleVelocity.
x / 4;
366 particleVelocity.
z -= particleVelocity.
z / 2;
368 particleVelocity.
x, particleVelocity.
y, particleVelocity.
z, 0,
376 actor->sprite->rotation = 0x1000;
435#define DIRECTION_STEP(dx, dz) (((u32)(dx) << 16) | ((dz) & 0xffff))
448 207, 205, 228, 229, 298, 297,
467 { 0,
CONDITION_ALWAYS, 120, 0, 152,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
472 { 1,
CONDITION_ALWAYS, 152, 0, 120,
FACING_SOUTH, 0, 32, 32, 272, 480, 0 },
473 { 2,
CONDITION_ALWAYS, 152, 0, 440,
FACING_NORTH, 0, 32, 32, 272, 480, 0 },
478 { 1,
CONDITION_ALWAYS, 728, 0, 312,
FACING_NORTH, 0, 96, 48, 768, 432, 0 },
479 { 2,
CONDITION_ALWAYS, 168, 0, 408,
FACING_NORTH, 0, 96, 48, 768, 432, 0 },
480 { 3,
CONDITION_ALWAYS, 168, 0, 520,
FACING_SOUTH, 0, 112, 464, 576, 704, 0 },
481 { 4,
CONDITION_ALWAYS, 504, 0, 664,
FACING_NORTH, 0, 112, 464, 576, 704, 0 },
486 { 1,
CONDITION_ALWAYS, 792, 0, 456,
FACING_NORTH, 0, 240, 48, 864, 464, 0 },
487 { 2,
CONDITION_ALWAYS, 360, 0, 152,
FACING_SOUTH, 0, 240, 48, 864, 464, 0 },
488 { 3,
CONDITION_ALWAYS, 344, 0, 440,
FACING_NORTH, 0, 240, 48, 864, 464, 0 },
489 { 4,
CONDITION_ALWAYS, 344, 0, 584,
FACING_SOUTH, 0, 48, 432, 408, 896, 0 },
490 { 5,
CONDITION_ALWAYS, 136, 0, 504,
FACING_SOUTH, 0, 48, 432, 408, 896, 0 },
491 { 6,
CONDITION_ALWAYS, 216, 0, 888,
FACING_NORTH, 0, 48, 432, 408, 896, 0 },
Ability numbers, named from the English release.
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.
s32 gStagedActor_DirectionSteps[]
Pixel step by direction: X in the upper halfword, Z in the lower.
s32 gStagedActor_FootprintBounds[]
#define DIRECTION_STEP(dx, dz)
Pixel step by direction: X in the upper halfword, Z in the lower.
u32 gStagedActor_FootprintKinds[]
const s32 * gEffectScripts[]
static void Event_CheckAhead(void)
Checks the blocked direction before allowing another movement step.
The engine calls the debug menus import, and their palette swatch tiles.
Scene commands: the all-caps macros the scene scripts are written in.
#define OBJ_DIR(no, d, t)
#define OBJ_POS_SET(no, x, z)
#define MESSAGE_OPEN(no, f)
#define OBJ_WALK(no, x, z)
#define MESSAGE_PUT(no, f)
#define OBJ_FACE(no, to, t)
#define OBJ_SPEED(no, s, a)
void Map_WaitForShakeToSettle(void)
Waits until both shake amplitudes are below 1/256 pixel, with a 300-frame limit for a shake whose dec...
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)
s32 Engine_LeaderCheckAhead(void)
static void Actor_SetDestination(s32 actor, s32 x, s32 z)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
s32 Engine_MathSin(s32 angle)
void Engine_ActorSetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_EventCloseScreen(void)
void Engine_ActorSetDestination(s32 actor, s32 x, s32 z)
static void Actor_FaceActor(s32 actor, s32 target, s32 frames)
void Engine_EventWaitForScreen(void)
void Engine_GameFlagSet(s32 flag)
void Engine_ActorWaitForMove(s32 actor)
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
static void Event_ShowMessage(s32 speaker, s32 flags)
static void Map_SetShake(s32 horizontal, s32 vertical, s32 decay)
Sets shake amplitudes in fixed-point pixels and the per-frame decay factor.
s32 Engine_GameFlagIsSet(s32 flag)
s32 Engine_MathCos(s32 angle)
static void Actor_SetPosition(s32 actor, s32 fixed_x, s32 fixed_z)
void Engine_ActorSetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ActorFaceEachOther(s32 actor, s32 other, s32 frames)
static struct FieldActor * Actor_Get(s32 actor)
Field objects and actors, and the scene transition styles.
@ ACTOR_FOLLOWS_TERRAIN
moves with the ground height under it
@ ACTOR_FALLS
falls by its gravity and bounces
#define ACTOR_NO_TARGET
A target coordinate that is not set: the object has no target.
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)
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_SCENE_TEMP_05
#define FLAG_COLOSSO_OVER
the Colosso finals have been fought
#define FLAG_GONDOWAN_CAVE_SECOND_OBJECT_MOVED
#define FLAG_BABI_SPOKE_AFTER_COLOSSO
Babi and Iodem have spoken with the party after Colosso.
#define FLAG_RETREAT_BLOCKED
Retreat is blocked, from Psynergy or an item.
#define FLAG_IODEM_AT_BABI_LIGHTHOUSE
Set with it: Iodem has come to Babi Lighthouse, and from then on he no longer leaves the party in Suh...
#define FLAG_IODEM_FOLLOWING_PARTY
#define FLAG_SCENE_TEMP_04
#define FLAG_GONDOWAN_CAVE_FIRST_LEAP_COMPLETE
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
The work slots of gWorkSlot, read through their own names.
struct ScenePlacement gGondowanCavePlacements3[]
static void Event_LiftObject(void)
Lift on the third room's actor 11 also takes away actor 12 beside it.
struct ScenePlacement gGondowanCavePlacements1WithIodem[]
static void Event_LeaveThroughEntrance(void)
Leaving the third room by its first exit (trigger 1).
static UNUSED void GondowanCave_UnusedSceneCallback(void)
static void GondowanCave_RunSpinningLeap(s32 actorId)
The object spins in place, leaps and lands with a shake and a ring of dust, then comes to rest a litt...
static void Event_PushSecondObject(void)
Pushing the second object (trigger 50): it moves a step, then may have reached its place.
struct ScenePlacement gGondowanCavePlacementsOther[]
struct SceneEntrance gGondowanCaveEntrances1[]
struct SceneEvent gGondowanCaveEvents2[]
struct SceneEvent gGondowanCaveEvents1[]
#define SECOND_OBJECT_MOVED
static void Event_IodemAsksWhyTurningBack(void)
Walking back (trigger 10) with Iodem in the party: he steps out and asks why Isaac is going back.
static void Event_IodemRejoins(void)
Talking to Iodem where he waits, or walking up to him (trigger 11): he joins the party again.
struct SceneEvent gGondowanCaveEventsOther[]
struct SceneEntrance gGondowanCaveEntrances2[]
struct SceneEntrance gGondowanCaveEntrancesOther[]
struct SceneEvent gGondowanCaveEvents3[]
Temporary flag 0x205 ends Move on the second object.
static void Event_ReadSoldierMind(void)
Mind Read on the second soldier: once flag 0x950 is set and until Iodem waits here,...
struct SceneEntrance gGondowanCaveEntrances3[]
static void GondowanCave_WaitForDescent(struct FieldActor *actor, s32 heightLimit)
Waits at most forty frames for the actor to descend to the height limit.
static void Event_MoveSecondObject(void)
Move on the second object, and after each push: past column 42 it drops into its place for good.
struct ScenePlacement gGondowanCavePlacements2[]
static void Event_SoldierAsksAboutCrossing(void)
Talking to the first soldier, who asks whether the party will cross into Gondowan.
struct SceneEvent gGondowanCaveEvents1WithIodem[]
static void GondowanCave_PlaceMovedSecondObject(s32 animation)
Hides the second object and shows the one that stands in for it in its place.
struct ScenePlacement gGondowanCavePlacements1[]
static UNUSED void GondowanCave_UnusedActorCallback(void)
static void GondowanCave_RotateLeapingObject(union FieldObject *fieldObject)
Rotates the sprite during the airborne part of the leap.
static void Event_MoveFirstObject(void)
Move on the first object: from column 30 or less it spins and leaps across, freeing the cell where it...
The screen blend's globals and the graphics routines.
The main-image routines scene overlays import.
Item numbers, named from the English release.
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_POS(x, y, z)
Set position.
#define SC_WAIT(n)
Wait n frames.
#define SC_TOP
Script start.
Scene numbers, named after their places.
char SceneId_GondowanCave2
char SceneId_GondowanCave1
char SceneId_GondowanCave3
char SceneId_TolbiInteriors
Song and sound effect ids, indices into gSound_SongTable.
struct EventWork * gEventWork
void Engine_EventRequestExit()
void Engine_ActorSetPosition(u32 actor, s32 x, s32 z)
void Engine_AudioPlayCue()
The pushable actors' movement probes and footprint bounds.
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
s16 touchedTrigger
the step event a touch or exit event answers
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,...
s32 targetX
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
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
s32 gravity
Taken off the vertical velocity each frame while it is above the ground, in 16.16 fixed-point pixels ...
union FieldCoordinate z
16.16 fixed-point pixels
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
u8 terrainId
The map layer (0 to 3) its ground height is read from, which the scrolling camera updates from the ce...
s16 savedScene
where a defeat returns to without a defeat point
s16 savedEntrance
where a defeat returns to without a defeat point
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...
Three coordinates, x, y and z: a position, a velocity or a direction.
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
An object on the field, read as an actor or as an effect.