19#define FIELD_STAGED_ACTOR_IMPORTS
41#include "text/msg_ids.h"
128#if TBS_PATCH_LEVEL == 1
129#define MOGALL_FOREST_EAST_ACTOR_CONDITION FLAG_THIRD_AREA_EAST_APE_OUT
131#define MOGALL_FOREST_EAST_ACTOR_CONDITION CONDITION_ALWAYS
135#define MOGALL_FOREST_EAST_SHARED_SPRITE_CONDITION CONDITION_ALWAYS
137#define MOGALL_FOREST_EAST_SHARED_SPRITE_CONDITION FLAG_THIRD_AREA_EAST_APE_OUT
159 if (collision == 0) {
170 jumpMotionFlags = 0x7e;
175 (
s16)((
u32)position->
z >> 16));
225 struct Vector3 *emissionVelocity;
233 effectOptions = &options;
235 for (directionIndex = 0; directionIndex <= 16; directionIndex++) {
236 emissionVelocity = &velocity;
238 emissionVelocity->
y = 0;
240 x = emissionVelocity->
x;
241 emissionVelocity->
z =
z;
243 emissionVelocity->
x =
x;
315 if (StagedActor_FindClearPosition(&probe) != 0) {
316 SceneActor_MoveAndRedraw(probe);
524 s32 destinationColumn;
531 if (StagedActor_FindClearPosition(&probe) != 0) {
532 SceneActor_MoveAndRedraw(probe);
536 destinationColumn = 35;
553 destinationColumn = 34;
587 if (column == 36 && row == 24) {
740 if (StagedActor_FindClearPosition(&probe) != 0) {
741 SceneActor_MoveAndRedraw(probe);
788 savedMotionFlags = *motionFlags;
816 *motionFlags = savedMotionFlags;
833 if (column == 45 && row == 6) {
854 column = obstacle->
x.
fixed;
861 if ((obstacle->
z.
fixed >> 20) == 27) {
889 (creature->
z.
fixed + jumpSpeed), 0, 0, 0, 1, 0);
899 leaderX = leaderForX->
x.
part.pixel;
1085 struct Vector3 *emissionVelocity;
1121 for (directionIndex = 0; directionIndex <= 16; directionIndex++) {
1122 emissionVelocity = &velocity;
1124 emissionVelocity->
y = 0;
1126 x = emissionVelocity->
x;
1127 emissionVelocity->
z =
z;
1129 emissionVelocity->
x =
x;
1130 Effect_Spawn(actor->
x.
fixed, 0, actor->
z.
fixed,
x, emissionVelocity->
y,
z,
1249 FieldScene_RedrawActorFootprint(8);
1305 FieldScene_RedrawActorFootprint(9);
1379 FieldScene_RedrawActorFootprint(10);
1380 FieldScene_RedrawActorFootprint(12);
1458#define DIRECTION_STEP(dx, dz) (((u32)(dx) << 16) | ((dz) & 0xffff))
1471 207, 205, 228, 229, 298, 297,
1542 { 1,
CONDITION_ALWAYS, 136, 0, 24,
FACING_SOUTH, 0, 0, 0, 272, 224, 0 },
1543 { 2,
CONDITION_ALWAYS, 24, 0, 128,
FACING_EAST, 0, 0, 0, 272, 224, 0 },
1544 { 3,
CONDITION_ALWAYS, 248, 0, 128,
FACING_WEST, 0, 0, 0, 272, 224, 0 },
1545 { 4,
CONDITION_ALWAYS, 136, 0, 200,
FACING_NORTH, 0, 0, 0, 272, 224, 0 },
1546 { 5,
CONDITION_ALWAYS, 72, 0, 264,
FACING_SOUTH, 0, 0, 240, 272, 464, 0 },
1547 { 6,
CONDITION_ALWAYS, 200, 0, 440,
FACING_NORTH, 0, 0, 240, 272, 464, 0 },
1548 { 7,
CONDITION_ALWAYS, 416, 0, 264,
FACING_SOUTH, 0, 288, 240, 672, 624, 0 },
1549 { 8,
CONDITION_ALWAYS, 560, 0, 264,
FACING_SOUTH, 0, 288, 240, 672, 624, 0 },
1550 { 9,
CONDITION_ALWAYS, 648, 0, 344,
FACING_WEST, 0, 288, 240, 672, 624, 0 },
1555 { 0,
CONDITION_ALWAYS, 120, 0, 149,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
1556 { 1,
CONDITION_ALWAYS, 24, 0, 128,
FACING_EAST, 0, 0, 0, 272, 224, 0 },
1557 { 2,
CONDITION_ALWAYS, 248, 0, 128,
FACING_WEST, 0, 0, 0, 272, 224, 0 },
1558 { 3,
CONDITION_ALWAYS, 424, 0, 24,
FACING_SOUTH, 0, 288, 0, 560, 224, 0 },
1559 { 4,
CONDITION_ALWAYS, 312, 0, 136,
FACING_EAST, 0, 288, 0, 560, 224, 0 },
1560 { 5,
CONDITION_ALWAYS, 536, 0, 120,
FACING_WEST, 0, 288, 0, 560, 224, 0 },
1561 { 6,
CONDITION_ALWAYS, 424, 0, 200,
FACING_NORTH, 0, 288, 0, 560, 224, 0 },
1562 { 7,
CONDITION_ALWAYS, 744, 0, 24,
FACING_SOUTH, 0, 576, 0, 848, 224, 0 },
1563 { 8,
CONDITION_ALWAYS, 744, 0, 200,
FACING_NORTH, 0, 576, 0, 848, 224, 0 },
1564 { 9,
CONDITION_ALWAYS, 24, 0, 368,
FACING_EAST, 0, 0, 240, 272, 464, 0 },
1565 { 10,
CONDITION_ALWAYS, 488, 0, 264,
FACING_SOUTH, 0, 288, 240, 736, 624, 0 },
1566 { 11,
CONDITION_ALWAYS, 312, 0, 528,
FACING_EAST, 0, 288, 240, 736, 624, 0 },
1567 { 12,
CONDITION_ALWAYS, 360, 0, 600,
FACING_NORTH, 0, 288, 240, 736, 624, 0 },
1572 { 0,
CONDITION_ALWAYS, 172, 0, 160,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
1573 { 1,
CONDITION_ALWAYS, 24, 0, 128,
FACING_EAST, 0, 0, 0, 272, 224, 0 },
1574 { 2,
CONDITION_ALWAYS, 248, 0, 128,
FACING_WEST, 0, 0, 0, 272, 224, 0 },
1575 { 3,
CONDITION_ALWAYS, 424, 0, 24,
FACING_SOUTH, 0, 288, 0, 560, 224, 0 },
1576 { 4,
CONDITION_ALWAYS, 312, 0, 160,
FACING_EAST, 0, 288, 0, 560, 224, 0 },
1577 { 5,
CONDITION_ALWAYS, 536, 0, 160,
FACING_WEST, 0, 288, 0, 560, 224, 0 },
1578 { 6,
CONDITION_ALWAYS, 424, 0, 200,
FACING_NORTH, 0, 288, 0, 560, 224, 0 },
1579 { 7,
CONDITION_ALWAYS, 824, 0, 136,
FACING_WEST, 0, 576, 0, 848, 224, 0 },
1580 { 8,
CONDITION_ALWAYS, 728, 0, 264,
FACING_SOUTH, 0, 400, 240, 848, 640, 0 },
1581 { 9,
CONDITION_ALWAYS, 824, 0, 512,
FACING_WEST, 0, 400, 240, 848, 640, 0 },
1582 { 10,
CONDITION_ALWAYS, 824, 0, 608,
FACING_WEST, 0, 400, 240, 848, 640, 0 },
1583 { 11,
CONDITION_ALWAYS, 736, 0, 616,
FACING_NORTH, 0, 400, 240, 848, 640, 0 },
1584 { 12,
CONDITION_ALWAYS, 264, 0, 264,
FACING_SOUTH, 0, 0, 240, 384, 496, 0 },
1585 { 13,
CONDITION_ALWAYS, 136, 0, 472,
FACING_NORTH, 0, 0, 240, 384, 496, 0 },
1586 { 15,
CONDITION_ALWAYS, 136, 0, 432,
FACING_NORTH, 0, 0, 240, 384, 496, 0 },
1591 { 1,
CONDITION_ALWAYS, 312, 0, 128,
FACING_EAST, 0, 288, 0, 560, 224, 0 },
1592 { 2,
CONDITION_ALWAYS, 248, 0, 368,
FACING_WEST, 0, 0, 240, 272, 464, 0 },
1593 { 3,
CONDITION_ALWAYS, 424, 0, 440,
FACING_NORTH, 0, 288, 240, 560, 464, 0 },
1594 { 4,
CONDITION_ALWAYS, 712, 0, 264,
FACING_SOUTH, 0, 576, 240, 848, 464, 0 },
1595 { 5,
CONDITION_ALWAYS, 136, 0, 680,
FACING_NORTH, 0, 0, 480, 272, 704, 0 },
1596 { 6,
CONDITION_ALWAYS, 312, 0, 552,
FACING_EAST, 0, 288, 480, 560, 704, 0 },
1597 { 7,
CONDITION_ALWAYS, 312, 0, 648,
FACING_EAST, 0, 288, 480, 560, 704, 0 },
1598 { 8,
CONDITION_ALWAYS, 648, 0, 680,
FACING_NORTH, 0, 576, 480, 848, 704, 0 },
1599 { 9,
CONDITION_ALWAYS, 536, 0, 128,
FACING_WEST, 0, 288, 0, 560, 224, 0 },
1600 { 10,
CONDITION_ALWAYS, 24, 0, 368,
FACING_EAST, 0, 0, 240, 272, 464, 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.
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
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[]
Calls through a function pointer, by argument count.
The engine calls the debug menus import, and their palette swatch tiles.
Djinn numbers, named from the English release.
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
static UNUSED void * OverlayObject_CreateConfiguredObject(s32 x, s32 y, s32 z, s32 type)
A still effect in palette 15, at sprite priority 1, drawn under the actors.
The engine call layer: one typed inline for each of the thirteen main-image routines below that the s...
static s32 FieldObject_CheckMovementCollision(struct FieldActor *actor, struct FieldPosition *position)
Field effects, their scripts and the flags that spawn them.
@ EFFECT_USE_PRIORITY
options.priority, as the sprite's priority
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
void Engine_ActorFaceActor(s32 actor, s32 target, s32 frames)
static void Actor_FaceDirection(s32 actor, s32 facing, s32 frames)
void Object_SetMode(struct FieldActor *object, s32 animation)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
void Engine_MessageShowCentered(s32 message, s32 flags)
s32 Engine_PartyGiveItem(s32 item, s32 flags)
void Engine_CameraSetSpeed(s32 speed, s32 acceleration)
void Engine_CameraMoveToActor(s32 actor, s32 pan)
void Engine_ActorMoveToAndWait(s32 actor, s32 x, s32 z)
static void Actor_MoveToAndWait(s32 actor, s32 x, s32 z)
s32 Engine_MathSin(s32 angle)
void Engine_ItemShowFound(s32 item, s32 height)
void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames)
static void Actor_FaceActor(s32 actor, s32 target, s32 frames)
void Engine_EventWaitForScreen(void)
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
void Engine_EventOpenScreen(void)
void Engine_MapWaitWorkValuesBelow256(void)
void Engine_GameFlagSet(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)
void Engine_CameraFollowActor(s32 actor, s32 keep_position)
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
void Engine_ActorWalkTo(s32 actor, s32 x, s32 z)
void Engine_ActorSetAttachedEffect(s32 actor, s32 effect)
void Engine_ActorSetChildValue(s32 actor, s32 value)
static void Map_SetShake(s32 horizontal, s32 vertical, s32 decay)
Sets shake amplitudes in fixed-point pixels and the per-frame decay factor.
static void Actor_SetChildValue(s32 actor, s32 value)
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
s32 Engine_MathCos(s32 angle)
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_ActorSetDestinationOffset(s32 actor, s32 dx, s32 dz)
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.
@ ACTOR_PRIORITY_UNDERFOOT
The depth sort treats it as 320 pixels higher on the screen.
#define SCENE_TRANSITION(style, variant)
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 FIND_PSYNERGY_STONE
#define SCENE_EXIT(exit, scene, entrance)
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
#define TOUCH_WALKING_INTO(facing)
#define PLACEMENT_SHARE_PREVIOUS_SPRITE
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_DJINNI_0
the flag of Djinni 0, set once it is caught
#define FLAG_MOGALL_FOREST_KILLER_APE_BEATEN
#define FLAG_SCENE_TEMP_00
#define FLAG_KEEP_PARTY_POSITION
#define FLAG_NYUNPA_ENLIGHTENED
Nyunpa is enlightened, beyond words: he has passed away.
#define FLAG_NYUNPA_TAUGHT_FORCE
the power the monks call Ki
#define FLAG_MOGALL_FOREST_FIRST_APE_SEEN
an ape hides on arrival
#define FLAG_MOGALL_FOREST_LED_TO_KILLER_APE
The last guiding ape has led the party to the Killer Ape's hiding place.
GameState, the game's state: play time, coins, the scene and the leader's position,...
#define Battle_SetStart(mode)
Sets the battle start type.
struct GameState gGameState
The work slots of gWorkSlot, read through their own names.
The screen blend's globals and the graphics routines.
The main-image routines scene overlays import.
Item numbers, named from the English release.
Declares nothing of its own: it only includes edition.h and types.h.
The reel game's title lettering.
struct ScenePlacement gMogallForestPlacements3[]
static void MogallForest_SecondArea_SouthApeHidesAgain(void)
Force on the south hiding place the first time: the ape bolts to another hiding place nearby.
static void MogallForest_SecondArea_SouthApeShowsWay(void)
Force on its new hiding place: the ape points the way and hops off west.
static void MogallForest_ThirdArea_JumpWest(void)
Walking west into trigger 25: the leader jumps onto the second river log, which bobs under the weight...
static void MogallForest_ThirdArea_PushLog(void)
Pushing a log in the third area (walking into trigger 20): each river log rolls into the water at its...
static void MogallForest_FirstArea_ApeAttacks(void)
Force on the hostile ape's hiding place: it comes out angry, leaps at the leader and the battle with ...
static s32 MogallForest_ClearActorSpriteFlags(struct ScriptInterpreter *interpreter)
Clears the actor sprite flags when its script requests it.
static void MogallForest_ApeLeadsToKillerApe(void)
Touching trigger 22 in the third area, once: the ape appears again, turns to the party and leads it s...
const struct ScenePlacement * MogallForest_GetPlacements(void)
static void MogallForest_UpdateObstacleFootprint(s32 column, s32 row)
Marks the obstacle cell and clears the cells it could have moved from.
struct SceneEvent gMogallForestEvents3[]
struct ScenePlacement gMogallForestPlacementsOther[]
static void MogallForest_SecondArea_PushLog(void)
Pushing a log in the second area (walking into trigger 20): the log at row 23 changes the ground besi...
@ FLAG_SECOND_AREA_LOG_ROLLED
@ FLAG_SECOND_AREA_NORTH_APE_OUT
@ FLAG_SECOND_AREA_EAST_APE_OUT
@ FLAG_THIRD_AREA_EAST_APE_OUT
@ FLAG_FIRST_AREA_EAST_APE_OUT
@ FLAG_THIRD_AREA_CENTRAL_APE_OUT
@ FLAG_THIRD_AREA_FIRST_LOG_ROLLED
@ FLAG_SECOND_AREA_SOUTH_APE_OUT
@ FLAG_THIRD_AREA_EAST_APE_MOVED
@ FLAG_THIRD_AREA_WEST_APE_OUT
@ FLAG_THIRD_AREA_SECOND_LOG_ROLLED
@ FLAG_FIRST_AREA_NORTH_APE_OUT
@ FLAG_FIRST_AREA_LOG_ROLLED
@ FLAG_THIRD_AREA_HOSTILE_APE_OUT
@ FLAG_SECOND_AREA_SOUTH_APE_MOVED
@ FLAG_FIRST_AREA_HOSTILE_APE_OUT
static void MogallForest_ReadBrokenSign(void)
Searching the sign (trigger 27).
struct SceneEntrance gMogallForestEntrances2[]
@ FLAG_SOUTH_OBSTACLE_SETTLED
MogallForest1Actor
The first area.
@ ACTOR_FIRST_AREA_RIVER_LOG
@ ACTOR_FIRST_AREA_NORTH_APE
@ ACTOR_FIRST_AREA_NORTH_HIDEOUT
@ ACTOR_FIRST_AREA_EAST_HIDEOUT
@ ACTOR_NUT
a Nut floating over the river, caught with Catch
@ ACTOR_FIRST_AREA_EAST_APE
@ ACTOR_FIRST_AREA_HOSTILE_HIDEOUT
@ ACTOR_FIRST_AREA_HOSTILE_APE
#define MOGALL_FOREST_EAST_ACTOR_CONDITION
static void MogallForest_FirstArea_JumpNorth(void)
Walking north into trigger 25: the leader jumps north across the log.
#define MOGALL_FOREST_EAST_SHARED_SPRITE_CONDITION
struct SceneEvent gMogallForestEvents2[]
MogallForest3Actor
The third area.
@ ACTOR_THIRD_AREA_WEST_HIDEOUT
@ ACTOR_THIRD_AREA_WEST_APE
@ ACTOR_THIRD_AREA_EAST_HIDEOUT
@ ACTOR_THIRD_AREA_HOSTILE_HIDEOUT
@ ACTOR_THIRD_AREA_NORTH_OBSTACLE
@ ACTOR_THIRD_AREA_HOSTILE_APE
@ ACTOR_THIRD_AREA_EAST_APE
later the Killer Ape
@ ACTOR_THIRD_AREA_RIVER_LOG_2
@ ACTOR_THIRD_AREA_SOUTH_OBSTACLE
@ ACTOR_THIRD_AREA_RIVER_LOG_1
@ ACTOR_THIRD_AREA_CENTRAL_HIDEOUT
@ ACTOR_THIRD_AREA_CENTRAL_APE
struct SceneEntrance gMogallForestEntrances1[]
static void MogallForest_HopActorTo(s32 actorId, s32 targetX, s32 targetZ, s32 verticalSpeed)
Hops an actor to a pixel destination with the requested vertical speed.
MogallForest2Actor
The second area.
@ ACTOR_SECOND_AREA_EAST_APE
@ ACTOR_SECOND_AREA_SOUTH_APE
@ ACTOR_SECOND_AREA_NORTH_HIDEOUT
@ ACTOR_SECOND_AREA_EAST_HIDEOUT
@ ACTOR_SECOND_AREA_NORTH_APE
@ ACTOR_SECOND_AREA_OBSTACLE
sprite 0x125, moved with Move
@ ACTOR_QUARTZ
Venus Djinni 2.
@ ACTOR_SECOND_AREA_RIVER_LOG
@ ACTOR_SECOND_AREA_SOUTH_HIDEOUT
const u32 * MogallForest_GetExits(void)
The exits, shared by the three areas.
struct SceneEvent gMogallForestEventsOther[]
static void MogallForest_SecondArea_EastApeShowsWay(void)
Force on the east hiding place in the second area: the ape points the way and hops off east.
static void MogallForest_ThirdArea_EastApeHidesAgain(void)
Force on the east hiding place the first time: the ape bolts to another hiding place to the south.
s32 gMogallForest_ActorScript[]
static void MogallForest_StartDjinnBattle(void)
Talking to Quartz in the second area: the Djinni battle (Djinni 2).
static void MogallForest_FirstArea_NorthApeShowsWay(void)
Force on the north hiding place in the first area: the ape comes out, points the way and hops off sou...
static void MogallForest_FirstArea_PushLog(void)
Pushing a log in the first area (walking into trigger 20): the river log pushed to row 26 rolls into ...
static void MogallForest_ThirdArea_ApeAttacks(void)
Force on the third area's hostile hiding place: the ape leaps at the leader and the battle with the A...
s32 gMogallForestPlacements1_1[]
const struct SceneEvent * MogallForest_GetEvents(void)
struct SceneEntrance gMogallForestEntrances3[]
u32 gMogallForest_Exits[]
static void MogallForest_ThirdArea_UpdateSouthObstacle(void)
Move on the south obstacle: on row 27 it sinks into place and stays.
static void MogallForest_ThirdArea_UpdateNorthObstacle(void)
Move on the third area's north obstacle: at (45, 6) it sinks into place.
static s32 MogallForest_TryJumpLeaderTo(struct FieldPosition *position)
Jumps the leader to an unobstructed fixed-point position and restores motion.
static void MogallForest_ApeComesOut(s32 actorId, s32 drawParameter)
The camera goes to the ape's hiding place, which bursts in a ring of puffs, and the ape shows itself.
static void MogallForest_ThirdArea_WestApeShowsWay(void)
Force on the west hiding place: the ape points the way and hops off west.
static void MogallForest_SecondArea_NorthApeShowsWay(void)
Force on the north hiding place in the second area: the ape points the way and hops off south.
struct ScenePlacement gMogallForestPlacements1[]
static void MogallForest_CatchNut(void)
Catch on the Nut floating over the river: it is caught and found.
static void MogallForest_FirstArea_EastApeShowsWay(void)
Force on the east hiding place in the first area: the ape comes out, points the way and hops off east...
s32 gMogallForestPlacements2_0[]
struct ScenePlacement gMogallForestPlacements2[]
struct SceneEntrance gMogallForestEntrancesOther[]
static s32 MogallForest_CopyTimerToChild(struct ScriptInterpreter *interpreter)
Script command: the actor shows the part its timer names.
const struct SceneEntrance * MogallForest_GetEntrances(void)
struct SceneEvent gMogallForestEvents1[]
static void MogallForest_ApePointsTheWay(s32 guideId)
The ape turns to the leader, hops and gestures down the way to go.
const struct SceneRegion * MogallForest_GetRegions(void)
static void MogallForest_FirstArea_JumpSouth(void)
Walking south into trigger 26: the leader jumps onto the log, which bobs under the weight.
s32 MogallForest_Initialize(void)
On entering an area: the first time, an ape peeks out and hides (the first area); apes already out st...
static void MogallForest_ThirdArea_EastApeShowsWay(void)
Force on its new hiding place: the ape points the way and hops off south.
static void MogallForest_SecondArea_UpdateMovableObstacle(void)
Move on the second area's obstacle: its footprint follows it, and at (36, 24) it sinks two pixels int...
static void MogallForest_SpawnPuffRing(s32 id)
Scatters a complete ring of rising puffs around an actor.
static void MogallForest_ThirdArea_CentralApeShowsWay(void)
Force on the central hiding place: the ape points the way and hops off south.
static void MogallForest_KillerApeAttacks(void)
Touching trigger 23 until it is beaten: the hiding place shakes twice and out comes the Killer Ape,...
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_WAIT(n)
Wait n frames.
#define SC_TOP
Script start.
#define SC_END
Return to the main script.
static s32 StagedActor_FillGridAttributeRectangle(u32 layer, s32 x, s32 z, u32 width, u32 height, s32 value)
Sets the collision code of a width by height rectangle of cells, from cell (x, z),...
void Field_RequestBattleFromEncounterTable(s32 zoneNo, s32 slotNo)
Sets up a battle with enemy group slot of encounter table zone.
void Event_SetNextDestination(s32 scene, s32 entrance)
Sets the scene and entrance that the field goes to next (gGameState.nextScene and nextEntrance).
void Field_RequestDjinnBattle(s32 flag, s32 no)
Sets up the battle with Djinni number no.
Scene numbers, named after their places.
char SceneId_MogallForest3
char SceneId_MogallForest1
char SceneId_MogallForest2
The field object script interpreter and the operands its commands read.
Declares nothing of its own: it only includes types.h.
Song and sound effect ids, indices into gSound_SongTable.
#define SE_JUMP
An actor jumps: ObjectMotion_Launch plays the high jump above 5 pixels a frame.
void Engine_ActorSetAnimation()
struct EventWork * gEventWork
void Engine_ActorSetPosition(u32 actor, s32 x, s32 z)
void Engine_EventEnd(void)
void Engine_AudioPlayCue()
void Engine_EventBegin(void)
void Engine_ActorShowEmote()
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...
The pushable actors' movement probes and footprint bounds.
The options of a spawned field effect, each used when its EFFECT_USE_ flag (or EFFECT_SCALE_TO_TARGET...
s32 priority
the sprite's priority
s32 startTransition
SCENE_TRANSITION(style, variant).
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
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
s32 targetZ
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
s32 bounce
The share of its falling speed kept as it bounces on landing, 16.16 fixed point (0x4000 when created)...
union FieldCoordinate y
16.16 fixed-point pixels
u8 priorityFlags
ActorPriorityFlag bits, read by the scrolling camera.
s32 terrainHeight
16.16 fixed-point pixels
s32 velocityY
16.16 fixed-point pixels per frame
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
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
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...
s32 z
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.
Where a large thing ahead of the leader would roll to: its footprint, its actor, that position,...
struct FieldPosition position
16.16 pixels while moving; converted to cells by footprint redraws.
s32 actorSlot
the large thing's actor number, 8 to 65
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
Vector3, a three-coordinate vector.