43#include "text/msg_ids.h"
698 actor->sprite->image.priority = 1;
1204 if (trigger == 17) {
1242 if (actor !=
NULL) {
1243 sprite = actor->sprite;
1244 sprite->
flags = clear;
1245 sprite->
count = clear;
1280 object->
x +=
object->velocity.x;
1281 object->y +=
object->velocity.y;
1282 object->z +=
object->velocity.z;
1283 object->scaleX +=
object->scaleRateX;
1284 object->scaleY +=
object->scaleRateY;
1323 if ((flags & 0xffff0000) == 0 || extra == 0)
1355 if (framePhase != 0)
1382 for (pass = 0; pass < 4; pass++) {
1467 transition->
step = 1;
1489 if (direction == -1) {
1495 if (direction > 0x1000)
1497 if (direction < -0x1000)
1498 direction = -0x1000;
1519 if (((
u32)heading << 16) == 0xffff0000) {
1535 if (nextCollision == 255 ||
1560 if (nextCollision == 255) {
1570 actor->speed =
PIXELS(2);
1571 actor->acceleration =
PIXELS(1) / 10;
1574 if (nextCollision != startCollision) {
1579 actor->speed =
PIXELS(2);
1580 actor->acceleration =
PIXELS(1);
1621 { 0,
CONDITION_ALWAYS, 256, 0, 600,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
1626 { 0,
CONDITION_ALWAYS, 172, 0, 149,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
1627 { 1,
CONDITION_ALWAYS, 264, 0, 289,
FACING_NORTH, 0, 135, 62, 376, 328, 0 },
1632 { 0,
CONDITION_ALWAYS, 248, 0, 600,
FACING_SOUTH, 0, 64, 64, 416, 656, 0 },
1633 { 1,
CONDITION_ALWAYS, 248, 0, 632,
FACING_NORTH, 0, 64, 368, 416, 656, 0 },
1634 { 2,
CONDITION_ALWAYS, 376, 0, 488,
FACING_SOUTH, 0, 64, 368, 416, 656, 0 },
1635 { 3,
CONDITION_ALWAYS, 120, 0, 488,
FACING_SOUTH, 0, 64, 368, 416, 656, 0 },
1636 { 4,
CONDITION_ALWAYS, 232, 0, 408,
FACING_SOUTH, 0, 64, 368, 416, 656, 0 },
1637 { 5,
CONDITION_ALWAYS, 232, 0, 344,
FACING_NORTH, 0, 64, 48, 416, 376, 0 },
1638 { 6,
CONDITION_ALWAYS, 376, 0, 152,
FACING_NORTH, 0, 64, 48, 416, 376, 0 },
1639 { 7,
CONDITION_ALWAYS, 120, 0, 200,
FACING_SOUTH, 0, 64, 48, 416, 376, 0 },
1640 { 8,
CONDITION_ALWAYS, 248, 0, 104,
FACING_SOUTH, 0, 64, 48, 416, 376, 0 },
1645 { 1,
CONDITION_ALWAYS, 248, 0, 120,
FACING_SOUTH, 0, 96, 64, 416, 480, 0 },
1646 { 2,
CONDITION_ALWAYS, 152, 0, 200,
FACING_NORTH, 0, 96, 64, 416, 480, 0 },
1651 { 1,
CONDITION_ALWAYS, 248, 0, 104,
FACING_SOUTH, 0, 128, 64, 368, 256, 0 },
1652 { 2,
CONDITION_ALWAYS, 184, 0, 328,
FACING_SOUTH, 0, 96, 256, 416, 656, 0 },
1653 { 3,
CONDITION_ALWAYS, 152, 0, 432,
FACING_SOUTH, 0, 96, 256, 416, 656, 0 },
1654 { 4,
CONDITION_ALWAYS, 184, 0, 552,
FACING_SOUTH, 0, 96, 256, 416, 656, 0 },
1655 { 5,
CONDITION_ALWAYS, 280, 0, 616,
FACING_NORTH, 0, 96, 256, 416, 656, 0 },
1660 { 1,
CONDITION_ALWAYS, 328, 0, 72,
FACING_SOUTH, 0, 64, 16, 416, 416, 0 },
1661 { 2,
CONDITION_ALWAYS, 248, 0, 392,
FACING_NORTH, 0, 64, 16, 416, 416, 0 },
1662 { 3,
CONDITION_ALWAYS, 248, 0, 472,
FACING_SOUTH, 0, 64, 416, 416, 800, 0 },
1663 { 4,
CONDITION_ALWAYS, 344, 0, 632,
FACING_NORTH, 0, 64, 416, 416, 800, 0 },
1668 { 1,
CONDITION_ALWAYS, 264, 0, 232,
FACING_NORTH, 0, 128, 16, 384, 256, 0 },
1669 { 2,
CONDITION_ALWAYS, 248, 0, 472,
FACING_SOUTH, 0, 64, 256, 416, 720, 0 },
1670 { 3,
CONDITION_ALWAYS, 216, 0, 664,
FACING_NORTH, 0, 64, 256, 416, 720, 0 },
1671 { 4,
CONDITION_ALWAYS, 280, 0, 664,
FACING_NORTH, 0, 64, 256, 416, 720, 0 },
1676 { 1,
CONDITION_ALWAYS, 280, 0, 120,
FACING_SOUTH, 0, 64, 0, 416, 344, 0 },
1677 { 2,
CONDITION_ALWAYS, 216, 0, 120,
FACING_SOUTH, 0, 64, 0, 416, 344, 0 },
1678 { 3,
CONDITION_ALWAYS, 104, 0, 280,
FACING_SOUTH, 0, 64, 0, 416, 344, 0 },
1679 { 4,
CONDITION_ALWAYS, 200, 0, 344,
FACING_NORTH, 0, 64, 16, 416, 344, 0 },
1680 { 5,
CONDITION_ALWAYS, 248, 0, 312,
FACING_NORTH, 0, 64, 16, 416, 344, 0 },
1681 { 6,
CONDITION_ALWAYS, 296, 0, 344,
FACING_NORTH, 0, 64, 16, 416, 344, 0 },
1682 { 7,
CONDITION_ALWAYS, 200, 0, 440,
FACING_SOUTH, 0, 32, 344, 432, 736, 0 },
1683 { 8,
CONDITION_ALWAYS, 248, 0, 440,
FACING_SOUTH, 0, 32, 344, 432, 736, 0 },
1684 { 9,
CONDITION_ALWAYS, 296, 0, 424,
FACING_SOUTH, 0, 32, 344, 432, 736, 0 },
1685 { 10,
CONDITION_ALWAYS, 376, 0, 472,
FACING_SOUTH, 0, 32, 344, 432, 736, 0 },
1686 { 11,
CONDITION_ALWAYS, 248, 0, 536,
FACING_NORTH, 0, 32, 344, 432, 736, 0 },
1687 { 12,
CONDITION_ALWAYS, 120, 0, 696,
FACING_SOUTH, 0, 32, 344, 432, 752, 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.
Which units are in a battle, and the Djinn recovery list.
Calls through a function pointer, by argument count.
The engine calls the debug menus import, and their palette swatch tiles.
The display transition's frames, windows and state.
Djinn numbers, named from the English release.
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,...
static s32 FieldScheduler_AddCallback(SchedulerCallback callback, s32 priority)
Registers a main-image scheduler callback.
void BattleFx_StartFadeOverlay(void *object)
Starts the fade overlay on object (the party leader when NULL): loads its solid tiles,...
void ObjectDispatch_SetAnimationSpeed(struct DispatchObject *rawObject, s32 value)
Sets the animation speed (timer step) of all of an object's sprites.
Field effects, their scripts and the flags that spawn them.
@ EFFECT_USE_PALETTE
options.palette, as its group child value
@ EFFECT_SCRIPT_MASK
Picks one of gEffectScripts; the object's mode is this plus 1.
@ EFFECT_USE_START_SCALE
options.startScaleX and startScaleY
@ EFFECT_SCALE_TO_TARGET
Grows from the start scale, or full size, to the target scale over the script's repeat count.
@ 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_ObjectSetPosition(struct FieldActor *object, s32 fixed_x, s32 fixed_y, s32 fixed_z)
void Object_SetMode(struct FieldActor *object, s32 animation)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
struct FieldActor * Engine_ActorLookup(s32 actor)
void Engine_MessageShowCentered(s32 message, s32 flags)
s32 Engine_PartyGiveItem(s32 item, s32 flags)
s32 Engine_TaskRemoveCallback(void(*callback)(void))
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
void Engine_ItemLoadIcon(s32 item)
static void Actor_MoveToAndWait(s32 actor, s32 x, s32 z)
void Engine_EventCloseScreen(void)
void Engine_ObjectDispatchRelease(struct FieldActor *object)
static void Map_CopyCellsTo(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
void Engine_HeapRelease(s32 slot)
static void ColorBuffer_ApplyTarget(s32 value, s32 mode)
s32 Engine_VramLoad(s32 block, s32 size, const void *data)
void Engine_EventWaitForScreen(void)
void Engine_ObjectSetScript(struct FieldActor *object, const s32 *script)
void Engine_EventOpenScreen(void)
void Engine_GameFlagSet(s32 flag)
void Engine_GameFlagClear(s32 flag)
void Engine_ActorWaitForMove(s32 actor)
void * Engine_HeapAllocate(s32 slot, s32 size)
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
static void Actor_SetChildValue(s32 actor, s32 value)
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_RunRisingObjectSequence(struct FieldActor *object, s32 mode)
static struct FieldActor * Object_Create(s32 type, s32 fixed_x, s32 fixed_y, s32 fixed_z)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_ColorBufferInterpolate(s32 frames)
void Engine_ActorSetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ColorBufferApplyTarget(s32 value, s32 mode)
void Engine_ColorBufferApplySource(s32 value, s32 mode)
static struct FieldActor * Actor_Get(s32 actor)
static void ColorBuffer_ApplySource(s32 value, s32 mode)
@ 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 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 PSYNERGY_IN_AREA(ability, phase)
#define IF_FLAG_SET(flag)
#define SCENE_EXIT(exit, scene, entrance)
#define EVENT_SCRIPT(script)
#define TOUCH_WALKING_INTO(facing)
The scene service layer: one typed inline for each engine service a scene calls by its own name,...
static void FieldVector_AddPolarOffset(s32 radius, s32 heading, struct FieldPosition *probe)
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_FUCHIN_FALLS_DRAGONS_EYE_SET
The Dragon's Eye is set in the dragon statue, which opened the hidden path.
#define FLAG_RETREAT_BLOCKED
Retreat is blocked, from Psynergy or an item.
#define FLAG_KEEP_PARTY_POSITION
#define FLAG_FUCHIN_FALLS_ORB_OF_FORCE_FOUND
The Orb of Force's chest in Fuchin Falls has been opened.
volatile u32 gFrameCount
Frames WaitFrames has finished.
BattleFxScene, the work of a battle or field Psynergy effect scene, and its arc objects.
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
Font glyphs and their palettes.
The screen blend's globals and the graphics routines.
struct ScenePlacement gImilFuchinFalls_ThirdRoomPlacements[]
static void Fuchin_HopWest(void)
Hops the leader one gap west.
static void Fuchin_ThirdRoom_MoveFourthPlatformNorth(void)
struct SceneEvent gImilFuchinFalls_ThirdRoomEvents[]
static void Fuchin_FourthRoom_MoveFirstPlatformNorth(void)
s32 gImilFuchinFalls_TrackLeader
static void Fuchin_ThirdRoom_MoveFirstPlatformWestIfClear(void)
static void Fuchin_EndRevealLighting(void)
Restores the dark cave lighting when Reveal expires.
static void Fuchin_FirstRoom_MoveSecondPlatformNorth(void)
s16 gImilFuchinFalls_KeyHeadings[]
static void Fuchin_SecondRoom_MoveThirdPlatformNorth(void)
struct ScenePlacement gImilFuchinFalls_DragonRoomPlacements[]
static void Fuchin_ReadDragonFlameInscription(void)
Reads the inscription describing the dragon flame.
struct ScenePlacement gImilFuchinFalls_DjinniRoomPlacements[]
static void Fuchin_ThirdRoom_MoveSecondPlatformWest(void)
static struct FieldActor * Fuchin_CreateForegroundActor(s32 x, s32 y, s32 z, s32 resourceId)
Creates a stationary foreground actor with its palette and priority set.
struct SceneEntrance gImilFuchinFalls_DjinniRoomEntrances[]
struct SceneEntrance gImilFuchinFalls_ThirdRoomEntrances[]
static void Fuchin_FourthRoom_MoveThirdPlatformEast(void)
static void Fuchin_RebuildFourthRoomPlatforms(void)
Restores both halves of the fourth puzzle room from its saved platform stops.
static void Fuchin_FourthRoom_MoveFirstPlatformSouth(void)
static void Imil_LeaveDjinnRoom(void)
Faces the leader south and leaves the Imil Djinn room.
static void Fuchin_FinishPlatformMove(void(*rebuildPlatforms)(void))
Lets the platform settle before rebuilding its room's collision cells.
struct SceneEntrance gImilFuchinFalls_SecondRoomEntrances[]
static void ImilFuchinFalls_PrepareRoom(void)
Restores room props and the cave light for this entrance.
static void Fuchin_FirstRoom_MoveThirdPlatformNorth(void)
static void Fuchin_ThirdRoom_MoveThirdPlatformNorthFromSouthEnd(void)
struct ScenePlacement gImilFuchinFalls_FourthRoomPlacements[]
struct SceneEntrance gImilFuchinFalls_FourthRoomEntrances[]
static void Fuchin_ThirdRoom_NudgeThirdPlatformNorth(void)
struct ScenePlacement gImilFuchinFalls_SecondRoomPlacements[]
static void Fuchin_ThirdRoom_MoveThirdPlatformSouthFromLowerStop(void)
s32 * gImilFuchinFalls_DustScripts[]
s16 gImilFuchinFalls_SlideHeadings[]
static void Fuchin_StartDjinnBattle(void)
Talking to the Djinni in the second platform room starts its battle.
static void Imil_MoveAcrossIce(void)
Starts sliding the selected actor in the held direction.
s32 gImilFuchinFalls_DustScript2[]
static void Fuchin_FourthRoom_MoveThirdPlatformWest(void)
static void Fuchin_AnimateThirdPlatform(void)
Advances the third platform through its two rolling animations.
struct SceneEvent gImilFuchinFalls_KiRoomEvents[]
struct SceneEntrance gImilFuchinFalls_DragonRoomEntrances[]
static void Fuchin_SecondRoom_NudgeFirstPlatformWest(void)
static void ImilFuchinFalls_HopOnTrigger(void)
Hops across a platform edge when its current stop permits it.
static void Fuchin_RebuildFirstRoomPlatforms(void)
Restores platform positions and collision cells in the first puzzle room.
static void Fuchin_SecondRoom_MoveFirstPlatformToWestEnd(void)
static void ImilFuchinFalls_RebuildPlatformRoom(void)
Restores the collision templates for the current platform room.
static void Fuchin_ThirdRoom_MoveFirstPlatformEastFromMiddle(void)
static void Fuchin_PlacePlatformAtCell(s32 id, s32 column, s32 row)
Centers a platform on its cell and gives it underfoot priority.
struct SceneEvent gImilFuchinFalls_DragonRoomEvents[]
static void Fuchin_SecondRoom_MoveFirstPlatformToEastEnd(void)
static void Fuchin_FirstRoom_MoveSecondPlatformSouth(void)
static void Fuchin_UpdateDustMotion(union FieldObject *raw)
Applies the dust velocity and scale change for one frame.
static void Fuchin_SearchDragonStatue(void)
Describes the dragon eyes or offers to insert the carried eye.
static void Imil_RecruitDjinni(void)
Talking to the Djinni in the ice room adds it to the party.
static void Fuchin_ReadShadowInscription(void)
Reads the inscription about light revealing shadows.
u32 gImilFuchinFalls_Exits[]
static void Fuchin_AnimateFourthPlatform(void)
Advances the fourth platform through its two rolling animations.
static void ImilFuchinFalls_BlowCaveMouthDust(void)
Emits cave-mouth dust every fourth frame while the dragon awakens.
static void Fuchin_ClearFourthPlatformStops(void)
Clears all saved intermediate stops for the fourth platform.
struct SceneEntrance gImilFuchinFalls_NoEntrances[]
static void Fuchin_ThirdRoom_MoveFourthPlatformSouthFromNorthEnd(void)
struct SceneEvent gImilFuchinFalls_SecondRoomEvents[]
struct SceneEvent gImilFuchinFalls_DjinniRoomEvents[]
const struct SceneEntrance * ImilFuchinFalls_GetEntrances(void)
static void Fuchin_StopLightFollowingLeader(void)
Detaches the active cave light from the party leader.
static void Fuchin_ThirdRoom_MoveFourthPlatformSouthFromLastStop(void)
static void Fuchin_ThirdRoom_MoveThirdPlatformSouthFromMiddle(void)
static void Fuchin_ReadKiInscription(void)
Reads the inscription about the secret power of Ki.
s32 gImilFuchinFalls_DustScript1[]
static void Fuchin_SecondRoom_MoveThirdPlatformSouth(void)
s32 ImilFuchinFalls_Initialize(void)
Entering the Djinni's ice room the first time, the leader walks toward the Djinni; otherwise each roo...
struct SceneEvent gImilFuchinFalls_NoEvents[]
static void Fuchin_RebuildThirdRoomPlatforms(void)
Restores the interacting platform stops and collision cells in the third room.
static void Fuchin_SecondRoom_MoveFirstPlatformEast(void)
static void Fuchin_ThirdRoom_MoveFirstPlatformWest(void)
struct FieldActor * gImilFuchinFalls_DragonsEye
const struct ScenePlacement * ImilFuchinFalls_GetPlacements(void)
static void Fuchin_FourthRoom_MoveSecondPlatformEast(void)
static void Fuchin_SecondRoom_MoveSecondPlatformSouth(void)
static void Fuchin_ThirdRoom_MoveThirdPlatformNorthFromMiddle(void)
static void Fuchin_RebuildSecondRoomPlatforms(void)
Restores platform positions and collision cells in the second puzzle room.
struct SceneEvent gImilFuchinFalls_FirstRoomEvents[]
static void Imil_TurnSkaterTowardHeldDirection(union FieldObject *object)
Turns the sliding actor gradually toward the held direction.
static void Imil_SlideActorAcrossIce(void)
Slides along the ice until terrain or a collision boundary ends the move.
static s32 Fuchin_SetDustPalette(struct ScriptInterpreter *interpreter)
Selects the dust palette when its object script finishes looping.
s32 gImilFuchinFalls_DustScript0[]
static void Fuchin_ThirdRoom_MoveThirdPlatformSouthFromNorthEnd(void)
void ImilFuchinFalls_SpawnDust(s32 x, s32 y, s32 z, s32 velocityX, s32 velocityY, s32 velocityZ, u32 flags, const struct EffectOptions *extra)
Creates scripted cave dust with the requested velocity, palette and scale.
static void Fuchin_ThirdRoom_NudgeFourthPlatformNorth(void)
static void Fuchin_ThirdRoom_MoveFirstPlatformEastFromWestEnd(void)
static void Fuchin_FourthRoom_MoveSecondPlatformWest(void)
static void ImilFuchinFalls_HopBy(s32 dx, s32 dz)
Jumps the leader by a pixel offset while using the hopping animations.
static void Fuchin_HopNorth(void)
Hops the leader one gap north.
const u32 * ImilFuchinFalls_GetExits(void)
Returns the exit connections shared by these rooms.
static void ImilFuchinFalls_PlaceDragonsEye(void)
Creates the collectible eye and uploads its item icon.
struct SceneEvent gImilFuchinFalls_FourthRoomEvents[]
static void Fuchin_FirstRoom_MoveFirstPlatformWest(void)
static void Fuchin_ThirdRoom_MoveFourthPlatformSouthFromMiddle(void)
struct SceneEntrance gImilFuchinFalls_FirstRoomEntrances[]
static void Fuchin_ThirdRoom_MoveFourthPlatformSouthFromLowerStop(void)
static void Fuchin_LightDragonWithEye(void)
Inserts the eye, lights the dragon room and reveals its hidden path.
struct ScenePlacement gImilFuchinFalls_FirstRoomPlacements[]
static void Imil_WalkTowardDjinni(void)
Shows the Imil Djinni and walks the leader toward it.
const struct SceneRegion * ImilFuchinFalls_GetRegions(void)
static void Fuchin_ThirdRoom_MoveSecondPlatformEast(void)
static void Fuchin_CollectDragonsEye(void)
Gives the eye to the party and removes its displayed actor.
static void Fuchin_ThirdRoom_MoveThirdPlatformSouthFromUpperStop(void)
static void Fuchin_ThirdRoom_MoveFourthPlatformSouthFromUpperStop(void)
static void Fuchin_SecondRoom_MoveSecondPlatformNorth(void)
struct SceneEntrance gImilFuchinFalls_KiRoomEntrances[]
static void Fuchin_FirstRoom_MoveThirdPlatformSouth(void)
static void Fuchin_ThirdRoom_MoveThirdPlatformNorthFromLowerStop(void)
const struct SceneEvent * ImilFuchinFalls_GetEvents(void)
static void Fuchin_AnimateFirstPlatform(void)
Advances the first platform through its two rolling animations.
@ ACTOR_FUCHIN_DJINNI
in the second platform room
@ ACTOR_FIRST_PLATFORM
The platforms, in each platform room.
@ ACTOR_IMIL_DJINNI
in the ice room
static void Fuchin_FirstRoom_MoveFirstPlatformEast(void)
static void Fuchin_FollowLeaderWithLight(void)
Attaches the active cave light to the party leader.
@ IMIL_SLIDE_ANIMATION_STEP
three times normal animation speed
static void Fuchin_AnimateSecondPlatform(void)
Advances the second platform through its two rolling animations.
struct ScenePlacement gImilFuchinFalls_NoPlacements[]
The main-image routines scene overlays import.
s32 PartyInventory_Discard(s32 itemId)
Discards one itemId from whoever carries it first, as Inventory_Discard does; always returns 0.
s32 PartyInventory_FindOwner(s32 itemId)
Returns who carries itemId, asking the selected character first, or -1.
Item numbers, named from the English release.
The keypad state the VBlank interrupt keeps.
volatile u32 gKeysHeld
Keys down now.
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.
void Battle_ResetEffectCounter(void)
Clears the field's busy flag and, while Reveal is active, ends it: Reveal used with ACT_PACKED runs i...
The fade overlay, the weather particles and the actor effect work.
void FieldObject_WaitForMove(void *fieldObject)
Waits a frame at a time until a field object has arrived at its target, at most 600 frames.
static void SceneActor_PlacePairAtOffset(s32 id, s32 dx, s32 dz)
Moves the character the player controls (in mode 27) and actor id together by (dx,...
Palette fades, the battle effect palette buffers and the colour channel curves.
@ PALETTE_TRANSFORM_PLAIN
each colour unchanged
void Field_RequestDjinnBattle(s32 flag, s32 no)
Sets up the battle with Djinni number no.
void Audio_PlayCueFromEventWork(void)
Starts the current scene's field music, chosen by Scene_ResolveInteractionResult.
FIELD_AT_OFFSET and the entity and camera views older scene code reads.
Scene numbers, named after their places.
char SceneId_ImilFuchinFalls4
char SceneId_ImilFuchinFalls7
char SceneId_ImilFuchinFalls3
char SceneId_ImilFuchinFalls6
char SceneId_ImilFuchinFalls5
char SceneId_ImilFuchinFalls2
char SceneId_ImilFuchinFalls1
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_EventEnd(void)
void Engine_AudioPlayCue()
void Engine_EventBegin(void)
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
struct AnimationSpritePart image
u8 flags
bits: 1 outlined in ObjectSystemWork's edge and fill colours | 0 shadow drawn (set when created)
u8 slot
VRAM cache entry holding its tiles.
u8 count
layers in use, up to the last one present
u16 fullColor
256 colours; set for both parts when created
u16 priority
2 when created
The work of a Psynergy effect scene: its caster and target, where it takes place, the map state it re...
s8 childOption
Set by some scenes before an effect; Carry, Frost, Force and Reveal treat the target differently with...
EffectOptions cut after its scales: the caller's frame holds only these 24 bytes.
The three action scripts cave dust can run, chosen by its spawn flags.
A field object as the object dispatcher's far calls take it.
The display transition state (heap block 31): two pages of window edges for every line,...
s8 nextMode
The mode taken when the value reaches its end; 0 ends the transition.
s8 duration
frames; 0 when the value is not moving
The options of a spawned field effect, each used when its EFFECT_USE_ flag (or EFFECT_SCALE_TO_TARGET...
s32 targetScaleY
16.16 fixed point, 0x10000 full size
s32 targetScaleX
16.16 fixed point, 0x10000 full size
s32 palette
passed to ObjectGroup_SetChildValue
s32 startScaleY
16.16 fixed point, 0x10000 full size
s32 priority
the sprite's priority
s32 startScaleX
16.16 fixed point, 0x10000 full size
s32 startTransition
SCENE_TRANSITION(style, variant).
s16 touchedTrigger
the step event a touch or exit event answers
u16 unk172
FieldWork's menu request; scenes set it to 1.
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
u8 retainSpriteCache
Nonzero keeps its sprite's VRAM cache entry while sprites are suspended or it is off screen (ObjectSy...
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....
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
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...
A field effect: a small object on the field that moves at its velocity and grows and spins at its rat...
void(*) update(union FieldObject *object)
Called each frame while the effect is live: the spawner sets BattleFx_UpdateObjectMotionScaleAndLinke...
struct Vector3 velocity
Added to x, y and z each frame by the update hooks, in 16.16 fixed-point pixels per frame; FieldActor...
s32 z
16.16 fixed-point pixels
struct AnimationObject * sprite
the sprite spin turns
u8 priorityFlags
ActorPriorityFlag bits: the spawner clears ACTOR_PRIORITY_AUTOMATIC when EFFECT_USE_PRIORITY sets the...
s32 scaleRateX
Added to scaleX each frame by the update hooks, in 16.16 fixed point a frame; zeroed by the spawner.
u8 motionFlags
ActorMotionFlag bits; zeroed by the spawner.
s32 scaleY
16.16 fixed point, 0x10000 full size
s32 scaleX
16.16 fixed point, 0x10000 full size
s32 y
16.16 fixed-point pixels
s32 x
16.16 fixed-point pixels
s32 scaleRateY
as scaleRateX, for scaleY
s32 z
16.16 fixed-point pixels
s32 selectedActor
the leader: its unit and its actor
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.
s32 GetMapCellCollision(s32 layer, s32 x, s32 y)
Returns the collision code of a layer's cell at (x, y) in 16.16 pixels.
s32 Map_GetTerrainHeight(s32 layer, s32 x, s32 y)
Returns the ground height of a layer at (x, y) in 16.16 pixels: the height function of the cell's ter...
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.
struct FieldEffect effect