46#include "text/msg_ids.h"
68#define MERCURY_LIGHTHOUSE_MOVE_LEADER_TO_ENTRY Actor_MoveToAndWait
70#define MERCURY_LIGHTHOUSE_MOVE_LEADER_TO_ENTRY Actor_SetDestination
74#define MERCURY_LIGHTHOUSE_ANIMATE_ACTOR_AND_WAIT \
75 Engine_ActorSetAnimationAndWait
77#define MERCURY_LIGHTHOUSE_ANIMATE_ACTOR_AND_WAIT \
78 ((s32 (*)())Engine_ActorSetAnimationAndWait)
94#define NULL ((void *)0)
173#define MERCURY_LIGHTHOUSE_OFFSET_FIXED(value) ((value) * 0x10000)
175#define MERCURY_LIGHTHOUSE_OFFSET_FIXED(value) ((value) << 16)
189struct LeaderEffectWork {
191 struct FieldActor *target;
196static void MercuryLighthouse_UpdateLeaderEffectTarget(
void) {
198 struct LeaderEffectWork *effectWork =
202 leader->
z.
fixed >> 20 <= 18)
203 effectWork->target =
NULL;
205 effectWork->target = leader;
346 if (StagedActor_FindClearPosition(&probe) != 0) {
351 SceneActor_MoveAndRedraw(probe);
362 SceneActor_MoveAndRedraw(probe);
368 SceneActor_MoveAndRedraw(probe);
383 SceneActor_MoveAndRedraw(probe);
389 if (column >> 20 == 40) {
390 SceneActor_MoveAndRedraw(probe);
393 SceneActor_MoveAndRedraw(probe);
439 StagedActor_AdvancePair();
454 if (column == 5 && row == 13) {
481 if ((
u32)(
x - 84) <= 7 &&
z > 211 &&
z <= 219) {
516 s32 firstStep,
s32 endStep) {
520 if (delayFrames != 0) {
524 if (step < endStep) {
526 Map_CopyCellsTo(45 - (step << 1), 32, 44 - (step << 1), 32, (step + 1),
529 sourceColumn = 109 - step;
532 if (delayFrames != 0) {
538 }
while (step < endStep);
546 s32 destinationColumn;
555 destinationColumn = 41;
568 if (delayFrames != 0) {
574 destinationColumn += 2;
595 s32 negativeRowOffset;
605 effectOptions = &options;
615 rowOffset = (row << 4);
617 negativeRowOffset = -(row << 20);
618 particleX = (0x2d80000 + negativeRowOffset);
620 if ((particleIndex & 1) != 0) {
623 velocityX = ((
u32)(randomX << 3) >> 16) * 0x3333 - 0xcccc;
624 negativeIndex = -particleIndex;
626 velocityZ = ((
u32)(randomZ << 3) >> 16) * 0x3333 - 0xcccc;
627 Effect_Spawn(particleX, 0, 0x2480000, velocityX, 0, velocityZ, 0x90000,
631 negativeIndex = -particleIndex;
637 particleIndex = (particleIndex + 1);
638 particleX = (particleX + -0x10000);
639 }
while ((
u32)particleIndex <= 7);
644 }
while ((
u32)nextRow <= 1);
665 effectOptions = &options;
674 if ((particleIndex & 1) != 0) {
676 particleZ = ((0x248 - ((
u32)((random << 2) + random) >> 16)) & 0xffff)
678 particleX = (offsetX - (row << 19)) + 0x2d80000;
679 Effect_Spawn(particleX, 0, particleZ, -0x4000, 0, 0, 0x90000,
684 offsetX = offsetX + -0x20000;
685 }
while ((
u32)particleIndex <= 7);
688 }
while ((
u32)row <= 2);
702 if (StagedActor_FindClearPosition(&probe) != 0) {
707 if ((column >> 20) == 11) {
708 SceneActor_MoveAndRedraw(probe);
729 SceneActor_MoveAndRedraw(probe);
732 }
else if (blockId == 10) {
734 SceneActor_MoveAndRedraw(probe);
746 }
else if ((probe.
position.
z >> 20) == 42) {
748 SceneActor_MoveAndRedraw(probe);
761 StagedActor_AdvancePair();
773 if (column == 10 && row == 23) {
840 return ((drift << 3) >> 16) * 0x3333;
854 }
else if (side == 1) {
861 effectOptions = &options;
865 for (row = 0; row <= 1; row++) {
866 for (particleIndex = 0; particleIndex <= 7; particleIndex++) {
867 if (particleIndex & 1) {
869 Effect_Spawn(0x3180000, 0,
870 0x2c00000 + (row * 16 + particleIndex) * 0x10000,
873 0x90000, effectOptions);
874 }
else if (side == 1) {
875 Effect_Spawn(0x3200000 + (row * 16 + particleIndex) * 0x10000, 0,
879 0x90000, effectOptions);
881 Effect_Spawn(0x32c0000 + (row * 16 + particleIndex) * -0x10000, 0,
885 0x90000, effectOptions);
893 }
else if (side == 1) {
906 u32 particleIndex, row;
915 for (row = 0; row <= 2; row++) {
916 for (particleIndex = 1; particleIndex <= 7; particleIndex++) {
917 if ((particleIndex & 1) != 0) {
920 0, (((row << 2) + particleIndex) << 17) + 0x02b70000, 0,
921 side, 0x4000, 0x90000, &options);
922 }
else if (side == 1) {
923 Effect_Spawn((((row << 2) + particleIndex) << 17) + 0x03120000, 0,
926 0x4000, 0, 0, 0x90000, &options);
928 Effect_Spawn(0x3380000 - (particleIndex << 17) - (row << 19), 0,
931 0x4000, 0, 0, 0x90000, &options);
961 }
else if (cellX == 49) {
967 }
else if (cellZ == 44 &&
971 }
else if (cellZ == 46 &&
989 s32 particleY = pillar->
y.
fixed + (((random << 2) >> 16) << 16);
998 s32 priority = 0xc80;
1023 s32 destinationColumn;
1027 if (StagedActor_FindClearPosition(&probe) != 0) {
1030 SceneActor_MoveAndRedraw(probe);
1039 SceneActor_MoveAndRedraw(probe);
1040 destinationColumn = probe.
position.
x >> 20;
1041 if (destinationColumn == 47) {
1046 if (startColumn == 54)
1048 else if (startColumn == 48)
1052 }
else if (destinationColumn == 48) {
1068 OverlayObject_PrepareObject(x, 0,
PIXELS(786), 223);
1069 OverlayObject_PrepareObject(x, 0,
PIXELS(818), 223);
1092 }
else if (destinationColumn == 53) {
1104 if (startColumn == 47)
1106 else if (startColumn == 48)
1121 StagedActor_AdvancePair();
1136 blockIndex <= 3; blockIndex++, positionFlag += 2) {
1139 if (column == (blockIndex << 2) + 39) {
1142 }
else if (column == (blockIndex << 2) + 41) {
1156 }
else if (column == 59) {
1177 s32 destinationColumn = 31;
1178 s32 destinationRow = 20;
1200 destination = colors;
1201 firstColor = *destination;
1203 colors[colorCount - 1] = firstColor;
1205 source = colors + 1;
1206 while (colorIndex <= colorCount - 2) {
1207 *destination++ = *source++;
1287 volatile u16 *palette;
1297 for (colorIndex = 0; colorIndex <= 7; colorIndex++) {
1298 red = *palette & 31;
1299 green = (*palette >> 5) & 31;
1300 blue = (*palette >> 10) & 31;
1301 if (red == 31 && green == 31 && blue == 31) {
1310 *palette = (blue << 10) | (green << 5) | red;
1315 }
while (whiteColors <= 7);
1466 actor->
z.
part.pixel);
1495 volatile u16 *palette;
1505 for (colorIndex = 0; colorIndex <= 6; colorIndex++) {
1506 red = *palette & 31;
1507 green = (*palette >> 5) & 31;
1508 blue = (*palette >> 10) & 31;
1515 *palette = (blue << 10) | (green << 5) | red;
1521 }
while (blackColors != 7);
1540 effectOptions = &options;
1543 effectOptions->
type = 0x11e;
1545 for (frame = 0; frame <= 47; frame++) {
1551 particleX = actor->
x.
fixed +
1553 particleY = actor->
y.
fixed +
1556 Effect_Spawn(particleX, particleY, actor->
z.
fixed, 0, riseSpeed, 0,
1557 0x330000, effectOptions);
1559 actor->
y.
fixed += frame * 0x1999;
1577 s32 particleVelocityX;
1587 effectOptions = &options;
1590 effectOptions->
type = 0x11e;
1598 if ((1 & wave) != 0) {
1602 particleX = random * 48;
1605 particleX += 0x3000000;
1611 Effect_Spawn(particleX, 0, z, 0, 0, 0, 0x330001, effectOptions);
1614 }
while ((
u32)wave <= 15);
1622 if ((1 & wave) != 0) {
1626 particleX = random * 48;
1629 particleX += 0x3000000;
1636 particleSpeed = -((random * 10 >> 16) * 0x3333) - 0x3333;
1637 Effect_Spawn(particleX, 0, z, 0, 0, particleSpeed, 0x330001, effectOptions);
1640 }
while ((
u32)wave <= 15);
1658 rowOffset = (wave << 4);
1661 particleX = ((((((random << 1) + random) << 4) >> 16) << 16) + 0x3000000);
1665 Effect_Spawn(particleX, 0,
1666 ((-((
u32)particleIndex >> 1) - rowOffset) << 16) + 0xc00000,
1667 particleVelocityX, 0, particleSpeed, 0xd0001, effectOptions);
1668 particleIndex = (particleIndex + 1);
1670 }
while ((
u32)particleIndex <= 31);
1672 }
while ((
u32)wave <= 3);
1813 MSGNO(MsgMercuryLighthouseFountainFlowsWithWater), 1);
1819 *menuRequest = enabled;
1869 u32 particleIndex, row;
1875 for (row = 0; row <= 1; row++) {
1876 for (particleIndex = 0; particleIndex <= 7; particleIndex++) {
1877 if ((particleIndex & 1) != 0) {
1883 Effect_Spawn(0x690000, 0,
1884 ((-particleIndex - (row << 4)) << 16) + 0x2200000,
1885 velocityX, 0, velocityZ, 0x90000, &options);
1903 effectOptions = &options;
1907 for (row = 0; row <= 2; row++) {
1909 for (particleIndex = 1; particleIndex <= 7; particleIndex++) {
1910 if (particleIndex & 1) {
1911 if (particleIndex & 2) {
1913 offsetZ - (row << 19) + 0x22e0000, 0, 0, -0x4000,
1914 0x90000, effectOptions);
1916 Effect_Spawn((((row << 2) + particleIndex) << 17) + 0xb70000, 0,
1918 0x4000, 0, 0, 0x90000, effectOptions);
1922 offsetZ += -0x20000;
1935 if (framePhase == 0) {
1949 framePhase, 0x90000, &options);
1959 if (framePhase == 0) {
1971 Effect_Spawn(x, y, z, velocityX, velocityY, framePhase, 0x90000,
1991 Effect_Spawn(particleX, y, particleZ, 0, 0, 0, 0xb0000, &options);
2004 if ((particleIndex & 1) != 0) {
2006 if ((particleIndex & 2) != 0)
2019 Effect_Spawn(particleX, y, particleZ, velocity[0], velocity[1],
2020 velocity[2], 0x90000, &options);
2025 }
while (particleIndex <= 11);
2033 s32 keepPartyPosition;
2181 for (; blockIndex <= 3; blockIndex++) {
2357 if (keepPartyPosition) {
2439 s32 questionMessage;
2443 if (blockColumn != 48) {
2447 firstMessage = MsgMercurySavedMeAgain;
2481 questionMessage = firstMessage + 5;
2494 questionMessage = MsgMercuryDontHideTruth;
2560 liftLayer->
offsetY -= liftSpeed;
2569 liftSpeed += -0x560;
2602 liftLayer->
offsetY += liftSpeed;
2608 if ((
gFrameCount & 7) == 0 && liftSpeed <= 0xcccc)
2609 liftSpeed += 0x1999;
2645 if (inventorySlot != -1) {
2697#define DIRECTION_STEP(dx, dz) (((u32)(dx) << 16) | ((u32)(dz) & 0xffff))
2710 207, 205, 228, 229, 298, 297,
2823 MAP_CELL_STEP(15, 1, 1, 2, 10),
MAP_CELL_STEP(13, 1, 1, 2, 6),
MAP_CELL_STEP(11, 1, 1, 2, 6),
MAP_CELL_STEP(9, 1, 1, 2, 6),
MAP_CELL_STEPS_END,
2827 MAP_CELL_STEP(9, 1, 1, 2, 10),
MAP_CELL_STEP(11, 1, 1, 2, 6),
MAP_CELL_STEP(13, 1, 1, 2, 6),
MAP_CELL_STEP(15, 1, 1, 2, 6),
MAP_CELL_STEPS_END,
2831 MAP_CELL_STEP(16, 28, 1, 2, 10),
MAP_CELL_STEP(14, 28, 1, 2, 6),
MAP_CELL_STEP(12, 28, 1, 2, 6),
MAP_CELL_STEP(10, 28, 1, 2, 6),
MAP_CELL_STEPS_END,
2835 MAP_CELL_STEP(10, 28, 1, 2, 10),
MAP_CELL_STEP(12, 28, 1, 2, 6),
MAP_CELL_STEP(14, 28, 1, 2, 6),
MAP_CELL_STEP(16, 28, 1, 2, 6),
MAP_CELL_STEPS_END,
2839 MAP_CELL_STEP(126, 35, 1, 2, 2),
MAP_CELL_STEP(126, 38, 1, 2, 2),
MAP_CELL_STEP(126, 41, 1, 2, 2),
MAP_CELL_STEP(126, 44, 1, 2, 2),
MAP_CELL_STEP(126, 47, 1, 2, 2),
MAP_CELL_STEPS_END,
2843 { 0,
CONDITION_ALWAYS, 248, 0, 344,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
2844 { 1,
CONDITION_ALWAYS, 56, 0, 440,
FACING_NORTH, 0, 16, 16, 496, 448, 0 },
2845 { 2,
CONDITION_ALWAYS, 248, 0, 440,
FACING_NORTH, 0, 16, 16, 496, 448, 0 },
2846 { 3,
CONDITION_ALWAYS, 248, 0, 344,
FACING_SOUTH, 0, 16, 16, 496, 448, 0 },
2847 { 4,
CONDITION_ALWAYS, 760, 0, 344,
FACING_NORTH, 0, 544, 16, 816, 352, 0 },
2848 { 5,
CONDITION_ALWAYS, 120, 0, 936,
FACING_NORTH, 0, 64, 784, 384, 944, 0 },
2849 { 6,
CONDITION_ALWAYS, 344, 0, 936,
FACING_NORTH, 0, 64, 784, 384, 944, 0 },
2850 { 7,
CONDITION_ALWAYS, 120, 0, 584,
FACING_SOUTH, 0, 80, 528, 320, 688, 0 },
2851 { 8,
CONDITION_ALWAYS, 280, 0, 584,
FACING_SOUTH, 0, 80, 528, 320, 688, 0 },
2852 { 9,
CONDITION_ALWAYS, 776, 0, 472,
FACING_SOUTH, 0, 640, 416, 896, 704, 0 },
2853 { 10,
CONDITION_ALWAYS, 856, 0, 520,
FACING_SOUTH, 0, 640, 416, 896, 704, 0 },
2854 { 11,
CONDITION_ALWAYS, 472, 0, 696,
FACING_NORTH, 0, 352, 512, 592, 720, 0 },
2855 { 15,
CONDITION_ALWAYS, 712, 0, 264,
FACING_SOUTH, 0, 544, 16, 816, 352, 0 },
2860 { 0,
CONDITION_ALWAYS, 248, 0, 344,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
2861 { 1,
CONDITION_ALWAYS, 120, 0, 472,
FACING_SOUTH, 0, 32, 400, 480, 848, 0 },
2862 { 2,
CONDITION_ALWAYS, 152, 0, 824,
FACING_NORTH, 0, 32, 400, 480, 848, 0 },
2863 { 3,
CONDITION_ALWAYS, 152, 0, 184,
FACING_SOUTH, 0, 48, 16, 592, 416, 0 },
2864 { 4,
CONDITION_ALWAYS, 488, 0, 136,
FACING_SOUTH, 0, 48, 16, 592, 416, 0 },
2865 { 5,
CONDITION_ALWAYS, 728, 0, 88,
FACING_SOUTH, 0, 656, 16, 896, 272, 0 },
2866 { 6,
CONDITION_ALWAYS, 728, 0, 216,
FACING_SOUTH, 0, 656, 16, 896, 272, 0 },
2867 { 7,
CONDITION_ALWAYS, 632, 0, 712,
FACING_NORTH, 0, 576, 480, 832, 736, 0 },
2868 { 8,
CONDITION_ALWAYS, 792, 0, 712,
FACING_NORTH, 0, 576, 480, 832, 736, 0 },
2869 { 9,
CONDITION_ALWAYS, 712, 0, 568,
FACING_SOUTH, 0, 576, 480, 832, 736, 0 },
2870 { 10,
CONDITION_ALWAYS, 888, 0, 440,
FACING_NORTH, 0, 760, 304, 1040, 464, 0 },
2875 { 0,
CONDITION_ALWAYS, 248, 0, 344,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
2876 { 1,
CONDITION_ALWAYS, 88, 0, 184,
FACING_NORTH, 0, 32, 32, 544, 208, 0 },
2877 { 2,
CONDITION_ALWAYS, 504, 0, 184,
FACING_NORTH, 0, 32, 32, 544, 208, 0 },
2878 { 3,
CONDITION_ALWAYS, 264, 0, 120,
FACING_SOUTH, 0, 32, 32, 544, 208, 0 },
2879 { 4,
CONDITION_ALWAYS, 648, 0, 168,
FACING_NORTH, 0, 592, 16, 992, 320, 0 },
2880 { 5,
CONDITION_ALWAYS, 776, 0, 88,
FACING_SOUTH, 0, 592, 16, 992, 320, 0 },
2881 { 6,
CONDITION_ALWAYS, 936, 0, 88,
FACING_SOUTH, 0, 592, 16, 992, 320, 0 },
2882 { 7,
CONDITION_ALWAYS, 88, 0, 328,
FACING_SOUTH, 0, 48, 272, 288, 432, 0 },
2883 { 8,
CONDITION_ALWAYS, 168, 0, 328,
FACING_SOUTH, 0, 48, 272, 288, 432, 0 },
2884 { 9,
CONDITION_ALWAYS, 248, 0, 328,
FACING_SOUTH, 0, 48, 272, 288, 432, 0 },
2885 { 10,
CONDITION_ALWAYS, 472, 0, 328,
FACING_SOUTH, 0, 352, 272, 592, 432, 0 },
2886 { 11,
CONDITION_ALWAYS, 424, 0, 408,
FACING_NORTH, 0, 352, 272, 592, 432, 0 },
2887 { 12,
CONDITION_ALWAYS, 88, 0, 600,
FACING_SOUTH, 0, 48, 512, 544, 672, 0 },
2888 { 13,
CONDITION_ALWAYS, 456, 0, 600,
FACING_SOUTH, 0, 48, 512, 544, 672, 0 },
2889 { 14,
CONDITION_ALWAYS, 888, 0, 712,
FACING_SOUTH, 0, 688, 384, 928, 816, 0 },
2890 { 15,
CONDITION_ALWAYS, 168, 0, 368,
FACING_SOUTH, 0, 40, 256, 296, 448, 0 },
2891 { 16,
CONDITION_ALWAYS, 760, 0, 584,
FACING_SOUTH, 0, 688, 384, 928, 816, 0 },
2896 { 0,
CONDITION_ALWAYS, 248, 0, 344,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
2897 { 1,
CONDITION_ALWAYS, 232, 0, 104,
FACING_SOUTH, 0, 64, 32, 288, 504, 0 },
2898 { 2,
CONDITION_ALWAYS, 232, 0, 488,
FACING_NORTH, 0, 64, 32, 288, 504, 0 },
2899 { 3,
CONDITION_ALWAYS, 408, 0, 104,
FACING_SOUTH, 0, 352, 32, 592, 328, 0 },
2900 { 4,
CONDITION_ALWAYS, 408, 0, 312,
FACING_NORTH, 0, 352, 32, 592, 328, 0 },
2901 { 10,
CONDITION_ALWAYS, 792, 0, 216,
FACING_SOUTH, 0, 664, 124, 920, 292, 0 },
2902 { 11,
CONDITION_ALWAYS, 840, 0, 856,
FACING_NORTH, 0, 576, 328, 960, 912, 0 },
2903 { 12,
CONDITION_ALWAYS, 840, 0, 600,
FACING_SOUTH, 0, 576, 328, 960, 912, 0 },
2904 { 13,
CONDITION_ALWAYS, 872, 0, 600,
FACING_SOUTH, 0, 720, 544, 960, 912, 0 },
2905 { 15,
CONDITION_ALWAYS, 680, 0, 584,
FACING_SOUTH, 0, 576, 328, 960, 912, 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.
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[]
s32 AnimationObjects_SelectAnimation(struct AnimationObject *sprite, s32 animation)
Starts animation flags & 0x7f on every layer of a sprite (bit 7 keeps each layer's place and timer),...
Animated sprites: their layers, frames and colour modes, and the resource slots they draw from.
const s32 * gEffectScripts[]
BattleUnit, a party member's or enemy's battle state, with the elements, abilities and actions it use...
The engine calls the debug menus import, and their palette swatch tiles.
Djinn numbers, named from the English release.
DMA channel registers, and the DMA and CPU fills.
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
static UNUSED void SetEffectRecordMode(struct FieldActor *work, s32 mode)
Sets the actor's sprite priority (0 in front of the backgrounds, 3 behind).
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 void FieldBattleFx_RunRisingObjectSequence(s32 actor, s32 mode, s32 action)
void BattleFx_StartFadeOverlay(void *object)
Starts the fade overlay on object (the party leader when NULL): loads its solid tiles,...
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
static s32 Event_OpenMessage(s32 speaker, s32 flags)
void Engine_ActorFaceActor(s32 actor, s32 target, s32 frames)
static void Actor_SetDestination(s32 actor, s32 x, s32 z)
static void Actor_FaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_ActorSetAnimationAndWait(s32 actor, s32 animation)
static void Map_AnimateCells(const u16 *steps, s32 destX, s32 destY)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
void Engine_PsynergyBegin(s32 ability, s32 flags)
static void Event_ShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
void Engine_MessageShowCentered(s32 message, s32 flags)
void Engine_EventShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
void Engine_CameraSetSpeed(s32 speed, s32 acceleration)
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
static void Camera_SetSpeed(s32 speed, s32 acceleration)
void Engine_CameraMoveTo(s32 fixed_x, s32 fixed_y, s32 fixed_z, s32 pan)
void Engine_PsynergyRaiseHands(void)
s32 Engine_TaskRemoveCallback(void(*callback)(void))
void Engine_PsynergyLowerHands(void)
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
#define MAP_CELL_STEP(srcX, srcY, width, height, frames)
void Engine_ItemShowFound(s32 item, s32 height)
void Engine_ActorSetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_EventCloseScreen(void)
void Engine_ActorSetDestination(s32 actor, s32 x, s32 z)
static void Map_CopyCellsTo(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
void Engine_ActorWalkToAndWait(s32 actor, s32 x, s32 z)
static void ColorBuffer_ApplyTarget(s32 value, s32 mode)
static void Actor_WalkTo(s32 actor, s32 x, s32 z)
void Engine_EventWaitForScreen(void)
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
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)
void Engine_MapRenderWaitForValues(void)
void Engine_MapCopyCellsTo(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
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_ActorRunRepeatedMotion(s32 actor, s32 repeats)
void Engine_ActorWalkTo(s32 actor, s32 x, s32 z)
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.
#define MAP_CELL_STEPS_END
static void Actor_SetChildValue(s32 actor, s32 value)
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_MapAnimateCells(const u16 *steps, s32 destX, s32 destY)
void Engine_PsynergyPlayEffect(s32 effect)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
struct FieldActor * Engine_EventGetViewCenter(void)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_MapRedraw(void)
static s32 Random_Next(void)
void Engine_ColorBufferInterpolate(s32 frames)
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)
void Engine_PsynergySetTarget(s32 caster, s32 target)
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)
Field objects and actors, and the scene transition styles.
@ TRANSITION_BACKDROP_FADE
@ 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)
@ TALK_FACE_PARTY_AND_BACK
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
#define TOUCH_WALKING_INTO(facing)
#define PLACEMENT_SHARE_PREVIOUS_SPRITE
Game flags, named where their meaning is shown.
#define FLAG_MIA_JOINED_PARTY
rescued again, Mia joins with Fizz
#define FLAG_MERCURY_LIGHTHOUSE_LIT
#define FLAG_MERCURY_LIGHTHOUSE_PLY_ACTIVATED
Ply in the entrance hall: the lights cycle and the pillar routes open.
#define FLAG_DJINNI_0
the flag of Djinni 0, set once it is caught
#define FLAG_MERCURY_LIGHTHOUSE_GATE_HELD_OPEN
The block rests on the floor switch and holds the gate open.
#define FLAG_MERCURY_LIGHTHOUSE_CHANNELS_OPEN
All three channel blocks are in place and the water runs.
#define FLAG_MIA_SENSED_SOMEONE_INSIDE
Mia has told the party she senses someone inside the lighthouse.
#define FLAG_SCENE_TEMP_00
#define FLAG_MERCURY_LIGHTHOUSE_STAIR_GATE_HELD_OPEN
The block rests on the stair gate's floor switch and holds it open.
#define FLAG_KEEP_PARTY_POSITION
#define FLAG_MERCURY_LIGHTHOUSE_STATUE_FELL
The sliding statue has fallen through to the floor below.
#define FLAG_MIA_OPENED_MERCURY_LIGHTHOUSE
The statue is moved and Mia's Ply has opened the lighthouse door.
#define FLAG_IMIL_MET_MIA
Mia healed the old man, and the party saw the Mercury Lighthouse lit.
#define FLAG_SATUROS_BEATEN_AT_MERCURY
Saturos is beaten at Mercury Lighthouse: the Hermes fountain at its foot flows again.
volatile u32 gFrameCount
Frames WaitFrames has finished.
BattleFxScene, the work of a battle or field Psynergy effect scene, and its arc objects.
s32 Djinn_AddToOwner(s32 owner, s32 element, s32 djinnIndex)
Gives Djinni djinnIndex of element to a unit: sets its bit in djinnAvailable and counts it.
s32 Djinn_Activate(s32 owner, s32 element, s32 djinnIndex)
Sets a ready Djinni on the unit, counts it and works out the unit's class again.
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.
void * gEffectWork
Slot 56: points to a scene-specific structure.
The screen blend's globals and the graphics routines.
The heap's work slots and HeapState.
The main-image routines scene overlays import.
s32 Inventory_Find(s32 owner, s32 itemId)
Returns the first slot holding itemId (any quantity, equipped or not), or -1.
s32 PartyInventory_FindOwner(s32 itemId)
Returns who carries itemId, asking the selected character first, or -1.
The hardware's I/O registers and their bits, as pret names them.
#define BLDCNT_EFFECT_BLEND
weighted by REG_BLDALPHA
#define BLEND_ALPHA(top, bottom)
A REG_BLDALPHA value: top and bottom are the two targets' weights, out of 16.
#define BG_PLTT_COLOR(palette, color)
Io_Write16, a 16-bit write to a register or memory.
#define Io_Write16(v, reg)
Writes a value to a 16-bit register or memory location.
Item numbers, named from the English release.
The IWRAM call layer: the routines the game keeps resident in IWRAM, each at its fixed address,...
The keypad state the VBlank interrupt keeps.
Small statement macros both games use for positions, velocities and bounds.
#define SET_VECTOR(v, x, y, z)
Sets the x, y and z of a three-part vector: a position about to be projected, a per-frame step,...
Maps: their cells, layers, animations and blend scripts, and the map state.
void DisplayBlend_SuspendScript(void)
Suspends the blend script.
void DisplayBlend_ResumeScript(void)
Resumes the blend script, through DisplayBlend_ResumeScriptFar.
MapRenderWork, the map renderer's work.
void Vector_AddPolarOffset(s32 radius, s32 angle, void *position)
Moves the point position by radius in direction angle on the ground plane: x by the cosine,...
The heaps: allocating and freeing blocks.
Includes field_event.h with FIELD_STAGED_ACTOR_IMPORTS defined, so a scene gets the staged-actor impo...
@ FLAG_FOUNTAIN_SHOWN
the camera has shown it start once
@ FLAG_DOOR_SWITCH_BLOCK_AT_48
@ FLAG_LAST_CROSSING_BLOCK_EAST
@ FLAG_DOOR_ROOM_BLOCK_PUSHED
@ FLAG_CHANNEL_313
cleared with the three, never set here
@ FLAG_LAST_CROSSING_BLOCK_WEST
@ FLAG_FIRST_CROSSING_BLOCK
Two flags per crossing block for its two resting columns, then the last.
@ FLAG_DOOR_SWITCH_BLOCK_AT_53
@ FLAG_DOOR_SWITCH_BLOCK_AT_47
The door switch block's column: each opens a different stone door.
s32 gMercuryLighthouse_PillarScript[]
static void MercuryLighthouse_AnimateFountainTiles(s32 delayFrames, s32 firstStep, s32 endStep)
Animates the fountain's map strips between the requested steps.
static void MercuryLighthouse_MoveChannelBlocks(void)
Pushing a channel block (walking into trigger 25) on the first map: each block opens one channel when...
static void MercuryLighthouse_StartDjinnBattle(void)
Talking to Sleet: the Djinni battle (Djinni 21, Mercury Djinni 1).
struct ScenePlacement gMercuryLighthousePlacements4[]
struct SceneEntrance gMercuryLighthouseEntrances4[]
MercuryLighthouse3Actor
The third map: the sliding statue and where it lands below, the blocks of the stone-door room,...
@ ACTOR_DOOR_SWITCH_BLOCK
@ ACTOR_LAST_CROSSING_BLOCK
@ ACTOR_FIRST_CROSSING_BLOCK
static void MercuryLighthouse_FadePaletteToBlack(void)
The waterfall's colors fade to black as it stops.
static void MercuryLighthouse_TryPillarStep(void)
Walking into trigger 11, 21 or 31: one step across the water pillars.
const struct SceneEntrance * MercuryLighthouse_GetEntrances(void)
const u32 * MercuryLighthouse_GetExits(void)
Returns the packed exits shared by the lighthouse scenes.
u16 gMercuryLighthouse_GateCells[]
static void MercuryLighthouse_ExitWithSparks(void)
Walking north into trigger 53 on the third map: the leader rises through exit 3 (the trigger less 50)...
static void MercuryLighthouse_OpenThreeStepStair(void)
Restores the stair tiles in three particle-covered steps.
static void MercuryLighthouse_MiaCastsPlyOnEntrance(void)
Mia casts Ply on the Ply target, moved onto the door.
static void MercuryLighthouse_SprayAtFountain(void)
Emits the scheduled spray at the fountain's fixed position.
struct SceneEvent gMercuryLighthouseEvents3[]
const struct SceneEvent * MercuryLighthouse_GetEvents(void)
Selects the puzzle interactions and dialogue for the current scene.
static void MercuryLighthouse_FillHermesWaterBottle(void)
Using the Empty Bottle at the fountain (event 0xb904: the bottle's item number and kind 4) once Satur...
const struct SceneRegion * MercuryLighthouse_GetRegions(void)
static __inline__ s32 MercuryLighthouse_RandomDoorParticleSpeed(void)
Chooses the random speed component used by stone-door particles.
struct SceneEvent gMercuryLighthouseEvents2[]
static s32 MercuryLighthouse_StartStatueSlide(void)
The camera turns to the sliding statue, which moves on only for the door switch block positions recor...
s32 gMercuryLighthouse_ScaleCounterScript[]
static void MercuryLighthouse_MiaOpensEntranceWithPly(void)
Move on the door statue: once it stands at column 51 Mia asks whether the party did that,...
static void MercuryLighthouse_EnterRisingPassage(void)
Walking south into trigger 15 on the first or second map: on the first the leader steps to the hole a...
MercuryLighthouse4Actor
The fourth map: Garet, Ivan and Mia in their own party slots, the statue at the door,...
static void MercuryLighthouse_OpenGateWithMovedBlock(void)
Move on the gate statue, or after a push: resting on the floor switch at (5, 13), it sinks two pixels...
static void MercuryLighthouse_OpenStairGateWithMovedBlock(void)
Move on the fallen statue, or after a push: resting on the switch at (10, 23), it sinks two pixels an...
static void MercuryLighthouse_ReadHermesFountainInscription(void)
Searching trigger 42 at the foot shows the fountain's sign.
static void MercuryLighthouse_WalkLeaderIn(void)
Touching trigger 2, 3 or 4 once the stairs are raised, or 46: the leader is carried to the landing in...
s32 MercuryLighthouse_Initialize(void)
Restores each lighthouse scene's puzzle state and entrance sequence.
static void MercuryLighthouse_CycleWaterfallPalette(void)
The waterfall shimmers: background palette 6, colors 1 to 7, rotates every eight frames.
s32 gMercuryLighthouse_PushScriptD[]
struct ScenePlacement gMercuryLighthousePlacements1[]
s32 gMercuryLighthouse_PushScriptB[]
static void MercuryLighthouse_MiaDiscussesBlockedEntrance(void)
Talking to Mia again. "This statue is blocking the entrance.".
static void MercuryLighthouse_InspectHealingFountain(void)
Searching the fountain (trigger 5) before taking its water: it seems dry, or once Saturos is beaten f...
struct SceneEntrance gMercuryLighthouseEntrancesOther[]
static void MercuryLighthouse_ExitAfterSparkStep(void)
Walking north into trigger 63 on the third map: the same, through exit 13.
static void MercuryLighthouse_InspectLockedDoor(void)
Searching trigger 20 on the second or third map: the door is locked tight.
static void MercuryLighthouse_StopFountainSpray(void)
Restores the fountain tiles and stops its continuous spray.
struct SceneEvent gMercuryLighthouseEventsOther[]
u16 gMercuryLighthouse_ColumnCells[]
static void MercuryLighthouse_PressGateFloorSwitch(void)
Touching trigger 12 while the gate is shut: standing on the floor switch sinks the leader two pixels ...
static void MercuryLighthouse_PushAndSaveBlockPositions(void)
Pushing a crossing block (walking into trigger 47): it moves a step and where the blocks rest is save...
static void MercuryLighthouse_OpenMovedBlockCrossing(void)
Move on the gap block: at column 28 it fills the gap for good.
struct SceneEvent gMercuryLighthouseEvents1[]
static void MercuryLighthouse_PressStairFloorSwitch(void)
Touching trigger 12 while the stair gate is shut: standing on its switch opens it.
static void MercuryLighthouse_SyncBlockFlags(void)
Move on a crossing block, or after a push: each block's column is saved in its pair of flags,...
static void MercuryLighthouse_ReplaceInventoryItem(s32 oldItem, s32 newItem)
Replaces one inventory item in the owner and slot that contain it.
s32 gMercuryLighthouse_PushScriptA[]
MercuryLighthouse1Actor
The first map: Mia, the statue that blocks her and the channel blocks.
@ ACTOR_STATUE_BLOCKING_MIA
s32 gMercuryLighthouse_RampScript[]
static void MercuryLighthouse_PlyOpensWaterfallPassage(void)
Ply on the waterfall statue: the waterfall darkens and stops, sparkles rise and the way behind it ope...
static void SceneEffect_SpawnParticleEveryFourthFrame(void)
Emits particles around the leader once every four frames.
struct SceneEntrance gMercuryLighthouseEntrances3[]
static void MercuryLighthouse_RideLift(void)
Entrance 15 at the foot: the leader rides the lift up beside its statue, hops off onto the landing,...
static void SceneEffect_SpawnRandomizedBurst(s32 x, s32 y, s32 z, s32 angle)
Emits a short burst with velocities spreading along the supplied angle.
static s32 MercuryLighthouse_StartStatueSpray(struct ScriptInterpreter *interpreter)
The slide scripts start the sparkles as the statue sets off.
#define MERCURY_LIGHTHOUSE_OFFSET_FIXED(value)
#define MERCURY_LIGHTHOUSE_ANIMATE_ACTOR_AND_WAIT
s32 gMercuryLighthouse_SparkBurstScript[]
static void MercuryLighthouse_MiaSensesSomeoneInside(void)
Talking to Mia at the lighthouse's foot, or Mind Read on her, before the door is open: she senses som...
static void MercuryLighthouse_CloseFloorSwitch(void)
Touching trigger 10 or 13: stepping off the switch closes the gate again.
static void MercuryLighthouse_MoveStoneDoorBlocks(void)
Pushing a block in the stone-door room (walking into trigger 40) on the third map: the door switch bl...
u16 gMercuryLighthouse_GateCloseCells[]
static void SceneEffect_SpawnRandomEveryFourFrames(s32 x, s32 y, s32 z)
Emits particles at a fixed point once every four frames.
static void MercuryLighthouse_PushStairSwitchBlock(void)
Pushing the fallen statue (walking into trigger 10 or 12) while the stair gate is shut: it moves a st...
static void MercuryLighthouse_SprayAboveStatue(void)
Sparkles rise from the sliding statue as it moves.
struct SceneEntrance gMercuryLighthouseEntrances2[]
static void MercuryLighthouse_FadePaletteToWhite(void)
The door's light brightens to white as it opens.
static void MercuryLighthouse_PushGateSwitchBlock(void)
Pushing the gate statue (walking into trigger 10) while the gate is shut: it moves a step,...
u32 gMercuryLighthouse_Exits[]
s32 gMercuryLighthouse_RiseScript[]
s32 gMercuryLighthouse_SparkScript[]
struct ScenePlacement gMercuryLighthousePlacements3[]
struct ScenePlacement gMercuryLighthousePlacements2[]
u16 gMercuryLighthouse_FloorSwitchCloseCells[]
static void MercuryLighthouse_ReleaseStairFloorSwitch(void)
Touching trigger 10: stepping off the switch closes the stair gate.
s32 gMercuryLighthouse_PushScriptC[]
static void MercuryLighthouse_RestoreFountainTiles(s32 delayFrames)
Restores the fountain's map strips after moving its block away.
static void OverlayObject_SpawnKind24AtObject(struct FieldActor *source)
Creates the rising effect at the source actor and sets its sprite priority.
u16 gMercuryLighthouse_MoveAngles[]
static void SceneEffect_SpawnWithRandomOffset(s32 x, s32 y, s32 z)
Emits a stationary particle near the supplied position.
static void MercuryLighthouse_RaiseActorWithSparks(s32 actorId)
Raises an actor into the passage with sparks for 48 ticks, two frames each.
const struct ScenePlacement * MercuryLighthouse_GetPlacements(void)
Selects the actors and obstacles for the current lighthouse scene.
static void MercuryLighthouse_OpenStoneDoor(s32 side)
Opens the selected stone door with particles along its moving edge.
static void MercuryLighthouse_MiaJoinsAfterRescue(void)
Move on the statue blocking Mia, before she has joined: once it stands at column 48,...
#define MERCURY_LIGHTHOUSE_MOVE_LEADER_TO_ENTRY
static s32 MercuryLighthouse_StopStatueSpray(void)
MercuryLighthouse2Actor
The second map: the stair and fountain blocks, the statue for the gate's floor switch and Sleet,...
static void MercuryLighthouse_OpenFountainWithSpray(s32 delayFrames)
Opens the fountain row by row and starts its continuous spray.
struct ScenePlacement gMercuryLighthousePlacementsOther[]
static void MercuryLighthouse_RotatePaletteRange(u16 *colors, u32 colorCount)
Rotates the selected palette range once every eight frames.
@ FLAG_LEADER_ON_FLOOR_SWITCH
@ FLAG_HERMES_WATER_TAKEN
static void MercuryLighthouse_CloseStoneDoor(s32 side)
Restores the selected stone door's tiles with trailing particles.
static void MercuryLighthouse_ReleaseRaisedPillar(void)
Touching trigger 31 or 32: the raised pillar is let go.
static void MercuryLighthouse_RaiseTouchedPillar(void)
Touching trigger 11: the pillar underfoot rises to its full height.
static void MercuryLighthouse_ExitWhenChannelsOpen(void)
With all three channel blocks in place the floor shakes, the screen fades and the party is carried do...
static void MercuryLighthouse_MoveStairAndFountainBlocks(void)
Pushing a block on the second map (walking into trigger 1 or 45): the stair block raises the stairs a...
u16 gMercuryLighthouse_FloorSwitchCells[]
static void MercuryLighthouse_SpawnTimedRiseEffect(void)
On the first map, as in the entrance hall, once Ply has worked there: touching trigger 21 keeps risin...
static void SceneEffect_SpawnParticleRowsAndDrawTiles(void)
Reveals the stair's map rows with particles along their edges.
static void MercuryLighthouse_CycleEntrancePalette(void)
While the lighthouse door is shut its light shimmers: background palette 2, colors 8 to 15,...
static void MercuryLighthouse_LeaveWithSparkTrail(void)
Walking north into trigger 55 at the foot: the same, through exit 5.
static void MercuryLighthouse_InspectBlockedPassage(void)
Searching trigger 10 at the lighthouse's foot.
Declares nothing of its own: it only includes field_event.h, field_effect.h, configured_effect_spawn....
Mercury Lighthouse and its entrance: arriving on a floor through one of its sparkling passages.
static void MercuryLighthouse_ArriveWithSparks(void)
Unless the party returns to where it was, the leader appears 16 pixels north of the entrance,...
static void MercuryLighthouse_ClearPalette(void)
While the pool sleeps: colours 9 to 15 of background palette 6 are black.
static void MercuryLighthouse_CyclePalette(void)
A scene callback: every fifth frame colour 9's red level steps on by 4, and each of colours 10 to 15 ...
Mercury Lighthouse and its entrance: leaving a floor through one of its sparkling passages.
static void MercuryLighthouse_LeaveThroughPassage(s32 exit)
Touch a passage: the leader moves north with the trail of sparks, vanishes, and after half a second t...
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.
void Event_PrepareObjectAndApplyValue(s32 unit, s32 announce)
Adds unit to the party.
ObjectRuntime, a field object's runtime state, and the object snapshots.
The work pointers in the gWorkSlot table, by name.
#define Ram_ActorEffectWork
void BattleFx_PlayQueuedSound(void)
Plays the sound BattleFx_SetQueuedSoundAndPlay remembered, if any.
void Field_RequestDjinnBattle(s32 flag, s32 no)
Sets up the battle with Djinni number no.
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.
char SceneId_MercuryLighthouse4
char SceneId_MercuryLighthouse2
char SceneId_MercuryLighthouse1
char SceneId_MercuryLighthouse3
The field object script interpreter and the operands its commands read.
Song and sound effect ids, indices into gSound_SongTable.
#define MUS_TREASURE_FOUND
#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_EventRequestExit()
void Engine_ActorSetPosition(u32 actor, s32 x, s32 z)
void Engine_EventEnd(void)
void Engine_AudioPlayCue()
void Engine_EventBegin(void)
void Engine_ActorShowEmote()
void Engine_EventSetMessage()
void MercuryLighthouse_RestoreLights(s32 region, struct MercuryLighthouseLights *st)
Keeps the lights' state st in work slot 35 for the floor's region, the pool's collision code.
static s32 OverlayObject_RampWords24And28Over16Frames(struct ScriptInterpreter *interpreter)
Grows the moving light over the first sixteen script frames.
void MercuryLighthouse_HopAcrossPool(void)
Pushing against the pool's edge (triggers 11, 21 and 31): the leader hops two cells the way the pad p...
static s32 MercuryLighthouse_FollowLeader(struct ScriptInterpreter *interpreter)
Follows the linked actor and alternates the light's animation parameter.
static void MercuryLighthouse_RemoveColumnOnRetreat(void)
Retreat (PSYNERGY_IN_AREA(ABILITY_RETREAT, 1)): remove the column of light.
void MercuryLighthouse_LoseLights(void)
Touch trigger 31: the leader loses their lights, and the column swells and fades away.
static s32 OverlayObject_AdvanceScaleCounter(struct ScriptInterpreter *interpreter)
Expands the released light before its script removes it.
void MercuryLighthouse_SparkleAtLeader(void)
Touch trigger 21: while the leader stands there, a sparkle rises from them every 10 to 39 frames.
void MercuryLighthouse_ChargeLights(void)
Touch trigger 11, the pool's heart: the column of light appears over the leader if it is not there,...
static s32 SceneEffect_AdvanceAnchoredRiseFrame(struct ScriptInterpreter *interpreter)
Raises the spark while its scale follows a half-sine pulse.
The pushable actors' movement probes and footprint bounds.
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)
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 messageMode
the announcement's box mode: 1, a scene adds 8
u16 inventory[15]
Items held, one entry each: bits 15..11 quantity | 10 broken | 9 equipped | 8..0 item id (INVENTORY_*...
The options of a spawned field effect, each used when its EFFECT_USE_ flag (or EFFECT_SCALE_TO_TARGET...
s16 type
the object type to create; 222 without the flag
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
const s32 * script
the object script, run in mode 1
s32 startScaleX
16.16 fixed point, 0x10000 full size
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
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,...
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
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 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 targetY
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
s32 scaleX
16.16 fixed point, 0x10000 full size
u8 collisionFlags
bits: 7 refuses to move into a solid object | 4 nearer for Psynergy targets | 3 never a talk or Psyne...
u8 terrainId
The map layer (0 to 3) its ground height is read from, which the scrolling camera updates from the ce...
s32 z
16.16 fixed-point pixels
Full event work allocated by Field_RunScene (heap slot 27).
s16 menu
open the main menu
s16 retreatEntrance
where Retreat goes; the group's first entrance
s16 retreatScene
where Retreat goes; the group's first entrance
Published in the scene's light-controller slot while the pillar is active.
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.
void(*) callback(void)
Run as the leader follows the rolling thing, when not null; the probe clears it.
s32 actorSlot
the large thing's actor number, 8 to 65
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 UnitCalc(s32 owner)
Recomputes a unit's stats from its base stats, equipment, set Djinn, class and battle stat levels,...
struct BattleUnit * UnitGet(u32 owner)
Returns the unit record of owner: 0 to 7 are the playable characters in the game state,...
void UiWork_PushValueSlot(u32 value, u32 kind)
Adds a message argument of kind (MSG_ARG_) with value to the first free place of the argument table; ...
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,...