Alchemy
Loading...
Searching...
No Matches

mercury_lighthouse_aerie.c

Go to the documentation of this file.
1/// @file
2/// Mercury Lighthouse's aerie: the platforms the leader jumps between, the
3/// party's arrival and the confrontation with Saturos and Menardi, the battle
4/// with Saturos, and Alex's scene after it.
5
6#include "game_state.h"
7#include "scene_ids.h"
8#include "unit/import.h"
12#include "unit/object/object.h"
14#include "unit/game/game.h"
16#include "types.h"
17#include "field_event.h"
18#include "engine_call.h"
19#include "field_scene.h"
20#include "overlay_object.h"
22#include "global_cells.h"
23#include "battle.h"
24#include "debug.h"
25#include "field.h"
26#include "game.h"
27#include "graphics.h"
28#include "menu.h"
29#include "minigame.h"
30#include "sound.h"
31#include "system.h"
32#include "iwram_call.h"
33#include "map_scroll.h"
34#include "text/msg_ids.h"
35#include "field_obj.h"
36#include "macros.h"
37#include "flags.h"
38#include "songs.h"
39#include "ability_ids.h"
40
41/// The aerie's actors. The party and Jenna stand in their own slots. The
42/// speakers are known from the text: Kraden ("It's all right, Jenna."), Felix
43/// ("Jenna, please... Just do as she says"), Saturos (Menardi: "Oh,
44/// Saturos..."), Menardi (Saturos: "Menardi... Wait!") and Alex (Mia:
45/// "Alex!"). Saturos is fought as encounter table 36, slot 2.
47 ACTOR_BEACON_FLAME = ACTOR_FIRST_PLACED, ///< flickers and sheds sparks
49 ACTOR_FIRST_PLATFORM = ACTOR_FIRST_PLACED + 6, ///< six, sprite 0xf2
50 /// The two platforms that stand on the lift and go up and down with it.
58};
59
60/// Scene flags, kept while the party stays on the aerie.
61enum {
62 /// The leader stands on a platform, which has dipped under the weight.
65 /// Set on every arrival but the first: Jenna, Kraden, Felix and Menardi
66 /// are placed only before it.
68};
69
70enum { FLAG_PSYNERGY_STONE = 0x350 };
71
77static void MercuryLighthouseAerie_LowerLift(void);
78static void MercuryLighthouseAerie_RaiseLift(void);
80
81#define NULL ((void *)0)
82
84
85/// The event work, seen for its table of the scene's 66 actor slots.
86struct ActorTable {
87 u8 unk00[0x14];
88 struct FieldActor *actors[66];
89};
90
91#include "common/effect_spawn.h"
92#include "objcmd.h"
93
96}
97
98const struct SceneRegion *MercuryLighthouseAerie_GetRegions(void) { return 0; }
99
100/// One exit: the lift down to the lighthouse's foot.
103}
104
105/// The actors; only the first arrival places Jenna, Kraden, Felix and Menardi.
107 if (gGameState.entrance != 1) {
109 }
111}
112
115}
116
117/// On arriving: the beacon flickers and the six platforms sit 50 pixels down;
118/// the first arrival (entrance 1) plays the party's arrival, the return from
119/// the Saturos battle (entrance 2) Alex's scene, and arriving by the lift
120/// (entrance 5) leaves the lift up.
122 u32 i;
123 s32 actor;
124 struct FieldActor *obj;
125
147 for (i = ACTOR_FIRST_PLATFORM; i < ACTOR_FIRST_PLATFORM + 6; i++) {
151 Object_GetById(i)->y.fixed = -0x328000;
152 }
154 (actor = SceneActor_FindNearestSlotOfKindF2()) != 0 &&
155 (obj = Object_GetById(actor)) != NULL) {
156 obj->motionFlags = 0;
157 }
163 Object_GetById(12)->scaleX = -0x10000;
164 Object_GetById(13)->scaleX = -0x10000;
165 if (gGameState.entrance == 1) {
168 }
169 } else if (gGameState.entrance == 2) {
171 {
172 struct MapLayerScroll *lift =
173 &((struct MapScrollWork *)gMapWork[0])->layers[2];
174
175 lift->offsetY = PIXELS(1024);
176 }
179 Map_CopyCellsTo(4, 70, 4, 74, 5, 4);
183 }
184 }
185 } else if (gGameState.entrance == 5) {
187 }
188 }
189 return 0;
190}
191
192/// Entrance 1, unless resuming: the Adepts of lit elements regain their PP;
193/// the aerie shakes, the camera pans across and in a flash the party stands
194/// at the top. Isaac shakes his head and the others gather on him.
196 struct FieldActor *leader;
197
204 Camera_MoveTo(PIXELS(304), -1, PIXELS(120), 0);
209 Map_SetShake(0x50000, 0x50000, 0x10000);
211 Map_SetShake(-1, -1, 0xe666);
218 Camera_SetSpeed(0xcccc, 0x1999);
219 Camera_MoveTo(PIXELS(512), -PIXELS(24), PIXELS(160), 1);
221 ColorBuffer_ApplySource(0x10000, 0);
222 ColorBuffer_ApplyTarget(0x10005, 0);
225 ColorBuffer_ApplyTarget(0x7fff, 0);
230 Actor_SetPosition(IVAN, PIXELS(488), PIXELS(144));
231 Actor_SetPosition(MIA, PIXELS(512), PIXELS(152));
237 ColorBuffer_ApplyTarget(0x10000, 0);
265 Actor_SetSpeed(GARET, 0xcccc, 0x6666);
266 Actor_SetSpeed(IVAN, 0xcccc, 0x6666);
267 Actor_SetSpeed(MIA, 0xcccc, 0x6666);
272 if (leader != 0)
273 Actor_SetDestination(GARET, leader->x.part.pixel, leader->z.part.pixel);
275 if (leader != 0)
276 Actor_SetDestination(IVAN, leader->x.part.pixel, leader->z.part.pixel);
278 if (leader != 0)
279 Actor_SetDestination(MIA, leader->x.part.pixel, leader->z.part.pixel);
281 Actor_SetPosition(MIA, 0, 0);
283 Actor_SetPosition(IVAN, 0, 0);
287}
288
291
292/// Walking into trigger 10 or 11: if nothing is in the way the leader jumps
293/// two cells ahead, off any platform and onto the next.
295 struct FieldActor *actor;
296 struct FieldPosition position;
297 s32 angle;
298 u8 flags;
299
301 angle = (actor->facing + 0x1000) & 0xe000;
302 flags = actor->motionFlags;
303 SET_POSITION(&position, (actor->x.fixed & 0xfff00000) + PIXELS(8),
304 actor->y.fixed, (actor->z.fixed & 0xfff00000) + PIXELS(8));
305 Vector_AddPolarOffset(PIXELS(32), angle, &position);
306 if (FieldObject_CheckMovementCollision(actor, &position) == 0) {
309 Object_SetMode(actor, 6);
312 Object_SetMode(actor, 7);
313 actor->speed = PIXELS(3);
314 actor->acceleration = PIXELS(2);
315 actor->velocityY = PIXELS(4);
316 actor->motionFlags &= 0x7e;
319 position.z >> 16);
320 Object_SetMode(actor, 6);
322 actor->motionFlags = flags;
323 }
324}
325
326/// Touching trigger 10 when not already on one: the platform underfoot dips
327/// with the leader and bobs back up.
329 struct FieldActor *leader;
330 struct FieldActor *actor;
331 s32 id;
332
337 if (id != 0) {
340 actor->motionFlags = 0;
341 leader->motionFlags &= 0xfe;
342 actor->y.fixed -= 0x30000;
343 leader->y.fixed -= 0x30000;
344 leader->terrainHeight -= 0x30000;
346 actor->y.fixed -= 0x20000;
347 leader->y.fixed -= 0x20000;
348 leader->terrainHeight -= 0x20000;
349 Engine_TaskWait(10);
350 actor->y.fixed += 0x20000;
351 leader->y.fixed += 0x20000;
352 leader->terrainHeight += 0x20000;
354 actor->y.fixed += 0x20000;
355 leader->y.fixed += 0x20000;
356 leader->terrainHeight += 0x20000;
358 actor->y.fixed += 0x10000;
359 leader->y.fixed += 0x10000;
360 leader->terrainHeight += 0x10000;
361 }
363}
364
365/// Touching trigger 11: the leader walks normally again and the platforms
366/// stop following.
375}
376
377/// Touching trigger 5 before the confrontation: Garet sees the lighthouse is
378/// lit. "It's too late! The lighthouse has already been lit!" Mia learns the
379/// party is from Vale; Jenna calls out, and Felix, Menardi and Saturos face
380/// the party. Menardi leaves with Jenna, Kraden and Felix for the next
381/// lighthouse, and Saturos fights alone (encounter table 36, slot 2).
383 struct FieldActor *actor;
384
386 Actor_Get(ACTOR_LIFT_PLATFORM_1)->motionFlags &= 0xfa;
387 Actor_SetSpeed(ACTOR_PARTY_LEADER, 0x0000cccc, 0x00006666);
388 Actor_SetSpeed(GARET, 0x0000cccc, 0x00006666);
389 Actor_SetSpeed(IVAN, 0x0000cccc, 0x00006666);
390 Actor_SetSpeed(MIA, 0x0000cccc, 0x00006666);
392 if (actor != 0) {
393 Actor_SetPosition(GARET, actor->x.fixed, actor->z.fixed);
394 }
396 if (actor != 0) {
397 Actor_SetPosition(IVAN, actor->x.fixed, actor->z.fixed);
398 }
400 if (actor != 0) {
401 Actor_SetPosition(MIA, actor->x.fixed, actor->z.fixed);
402 }
405 Actor_WalkTo(GARET, 328, 232);
406 Actor_WalkTo(IVAN, 344, 248);
407 Actor_WalkTo(MIA, 328, 248);
419 Camera_SetSpeed(0x18000, 0x3000);
420 Camera_MoveTo(PIXELS(328), PIXELS(40), PIXELS(176), 1);
422 Actor_SetSpeed(GARET, 0x18000, 0xC000);
423 Actor_WalkToAndWait(GARET, 328, 216);
425 Actor_SetSpeed(GARET, 0x0000cccc, 0x00006666);
427 Camera_MoveTo(PIXELS(344), PIXELS(24), PIXELS(232), 1);
431 Engine_EventSetMessage(MsgMercuryLighthouseAlreadyLit);
435 Actor_SetSpeed(MIA, 0x18000, 0xC000);
436 Actor_WalkToAndWait(MIA, 328, 232);
444 Actor_WalkToAndWait(IVAN, 336, 248);
451 if (Engine_EventChooseYesNo(0, 0) == 0) {
461 gEventWork->message += 2;
462 } else {
463 gEventWork->message += 2;
473 }
495 // Jenna calls out: "Isaac! Garet!"
516 Camera_SetSpeed(0x30000, 0x6000);
517 Camera_MoveTo(PIXELS(120), -PIXELS(24), PIXELS(168), 1);
553 Actor_SetSpeed(ACTOR_FELIX, 0x0000cccc, 0x00006666);
569 Camera_SetSpeed(0x18000, 0x3000);
570 Camera_MoveTo(PIXELS(232), PIXELS(40), PIXELS(152), 1);
571 Actor_SetSpeed(ACTOR_SATUROS, 0x0000cccc, 0x00006666);
583 Camera_MoveTo(PIXELS(296), PIXELS(40), PIXELS(216), 1);
626 Actor_Get(GARET)->steeringFlags &= ~ACTOR_FACES_MOTION;
627 Actor_WalkTo(GARET, 328, 224);
629 Actor_WalkTo(IVAN, 344, 232);
631 Actor_Get(GARET)->steeringFlags |= ACTOR_FACES_MOTION;
644 Camera_SetSpeed(0x30000, 0x6000);
645 Camera_MoveTo(PIXELS(120), -PIXELS(24), PIXELS(168), 1);
686 Actor_SetSpeed(JENNA, 0x0000b333, 0x00005999);
687 Actor_SetSpeed(ACTOR_KRADEN, 0x0000b333, 0x00005999);
688 Actor_WalkTo(JENNA, 128, 144);
696 Actor_Get(ACTOR_FELIX)->steeringFlags |= ACTOR_FACES_MOTION;
701 Actor_SetSpeed(ACTOR_MENARDI, 0x30000, 0x20000);
702 Actor_Get(ACTOR_MENARDI)->velocityY = 0x40000;
704 Actor_Get(ACTOR_MENARDI)->motionFlags &= 0x7e;
709 Actor_Get(ACTOR_MENARDI)->motionFlags = 3;
727 Camera_MoveTo(PIXELS(304), PIXELS(32), PIXELS(216), 1);
735 Actor_SetSpeed(GARET, 0x18000, 0xC000);
736 Actor_WalkToAndWait(GARET, 312, 216);
747 Actor_SetSpeed(GARET, 0x20000, 0x10000);
748 Actor_Get(GARET)->steeringFlags &= ~ACTOR_FACES_MOTION;
749 Actor_WalkToAndWait(GARET, 328, 224);
751 Actor_Get(GARET)->steeringFlags |= ACTOR_FACES_MOTION;
772 if (Engine_EventChooseYesNo(0, 0) == 0) {
778 } else {
784 }
806 // Saturos: encounter table 36, slot 2.
809}
810
811/// Entrance 2, back from the battle, unless resuming: Saturos is beaten, but
812/// not for long. "Isaac, we got him!" Alex appears and explains that the
813/// lighthouse bound Saturos' fire Psynergy and lent Mia endless power.
814/// Saturos stands again; the two warp over to the lift and ride it down, and
815/// the party regroups on the leader.
817
819 Actor_Get(ACTOR_LIFT_STATUE)->motionFlags = 0;
822 Actor_SetPosition(IVAN, PIXELS(344), PIXELS(232));
823 Actor_SetPosition(MIA, PIXELS(328), PIXELS(232));
831 Camera_MoveTo(PIXELS(336), -1, PIXELS(208), 0);
835
843 Engine_EventSetMessage(MsgMercuryGot);
864 Camera_SetSpeed(0x0000cccc, 0x00001999);
866 Camera_MoveTo(PIXELS(336), -1, PIXELS(168), 1);
868 Actor_SetSpeed(ACTOR_ALEX, 0x0000cccc, 0x00006666);
873 Camera_MoveTo(PIXELS(336), -1, PIXELS(184), 1);
927 if (Engine_EventChooseYesNo(0, 0) == 0) {
931 } else {
935 }
1001 Engine_EventWait(30);
1003 Engine_EventWait(20);
1005 Engine_EventWait(30);
1007 Engine_EventWait(10);
1009 Engine_EventWait(30);
1011 Engine_EventWait(10);
1013 Engine_EventWait(35);
1015 Engine_EventWait(30);
1017 Engine_EventWait(20);
1022 Engine_EventWait(20);
1024 Engine_EventWait(20);
1026 Engine_EventWait(10);
1029 Engine_EventWait(30);
1036 Engine_EventWait(20);
1037 if (Engine_EventChooseYesNo(0, 0) == 0) {
1038 Engine_EventWait(30);
1041 } else {
1042 Engine_EventWait(30);
1043
1046 }
1047 Engine_EventWait(20);
1049 Engine_EventWait(20);
1053 Engine_EventWait(20);
1056 Engine_EventWait(20);
1059 Engine_EventWait(20);
1073 Camera_MoveTo(PIXELS(280), -1, PIXELS(232), 1);
1087 Actor_WalkTo(IVAN, 336, 224);
1088 Actor_WalkToAndWait(GARET, 312, 216);
1096 Engine_EventWait(20);
1105 Engine_EventWait(20);
1109 Camera_SetSpeed(0x30000, 0x6000);
1110 {
1111 struct MapLayerScroll *lift;
1112 void **cells;
1113 Camera_MoveTo(PIXELS(152), -1, PIXELS(216), 1);
1114 lift = &((struct MapScrollWork *)gMapWork[0])->layers[2];
1115 lift->offsetY = 0x3800000;
1116 cells = gMapWork;
1118 Engine_TaskWait(1);
1119 Actor_Get(ACTOR_LIFT_STATUE)->motionFlags = 0;
1121 Actor_Get(ACTOR_LIFT_STATUE)->y.fixed = -PIXELS(32);
1123 Map_CopyCellsTo(0x1D, 0x4A, 4, 0x4A, 5, 4);
1130 Engine_EventWait(30);
1133 Camera_MoveTo(PIXELS(280), -1, PIXELS(216), 1);
1139 Engine_EventWait(20);
1143 Engine_EventWait(20);
1147 if (Engine_EventChooseYesNo(0, 0) == 0) {
1148 Engine_EventWait(20);
1150 Engine_EventWait(20);
1152 ((struct EventWork *)cells[19])->message++;
1153 } else {
1154 ((struct EventWork *)cells[19])->message++;
1155 Engine_EventWait(20);
1157 }
1158 }
1160 Engine_EventWait(20);
1167 if (Engine_EventChooseYesNo(0, 0) == 0) {
1168 Engine_EventWait(20);
1170 Engine_EventWait(20);
1173 } else {
1175 Engine_EventWait(20);
1177 Engine_EventWait(20);
1179 }
1180 Engine_EventWait(20);
1182 Engine_EventWait(20);
1183 Camera_MoveTo(PIXELS(128), -1, PIXELS(200), 1);
1194 Engine_EventWait(30);
1197 if (Engine_EventChooseYesNo(0, 0) == 0) {
1199 Engine_EventWait(20);
1202 } else {
1205 Engine_EventWait(20);
1207 }
1210 Engine_EventWait(20);
1213 Engine_EventWait(20);
1221 Camera_MoveTo(PIXELS(336), -1, PIXELS(216), 1);
1224 Engine_EventWait(20);
1230 Engine_EventWait(10);
1238 Actor_Get(MIA)->scaleX = -0x10000;
1239 Engine_EventWait(20);
1242 Engine_EventWait(20);
1245 Engine_EventWait(20);
1248 Actor_Get(MIA)->scaleX = 0x10000;
1252 if (Engine_EventChooseYesNo(0, 0) == 0) {
1254 Engine_EventWait(20);
1257 } else {
1260 Engine_EventWait(20);
1262 }
1265 Engine_EventWait(20);
1270 Engine_EventWait(10);
1274 Engine_EventWait(20);
1281 Actor_SetSpeed(MIA, 0x0000cccc, 0x00006666);
1282 Actor_SetSpeed(GARET, 0x0000cccc, 0x00006666);
1283 Actor_WalkToAndWait(MIA, 328, 216);
1285 Actor_Get(GARET)->steeringFlags &= ~ACTOR_FACES_MOTION;
1286 Actor_WalkTo(GARET, 312, 200);
1287 Actor_WalkTo(MIA, 280, 216);
1293 Engine_EventWait(30);
1297 Engine_EventWait(20);
1306 Engine_EventWait(60);
1309 Engine_EventWait(20);
1315 Engine_EventWait(20);
1322 Engine_EventWait(30);
1329 Engine_EventWait(20);
1331 Engine_EventWait(20);
1334 Actor_WalkTo(GARET, 312, 216);
1335 Actor_WalkTo(IVAN, 312, 216);
1336 Actor_WalkTo(MIA, 312, 216);
1339 Actor_SetPosition(GARET, 0, 0);
1341 Actor_SetPosition(IVAN, 0, 0);
1343 Actor_SetPosition(MIA, 0, 0);
1344 {
1345 struct MapLayerScroll *lift =
1346 &((struct MapScrollWork *)gMapWork[0])->layers[2];
1347
1348 lift->offsetY = 0x4000000;
1349 }
1351 Engine_TaskWait(1);
1352 Map_CopyCellsTo(4, 0x46, 4, 0x4A, 5, 4);
1356}
1357
1358/// Touching trigger 6 while the lift is down: the camera watches it rise with
1359/// its statue.
1361 struct MapLayerScroll *lift;
1362
1363 lift = &((struct MapScrollWork *)gMapWork[0])->layers[2];
1365 lift->offsetY = 0x3800000;
1367 Engine_TaskWait(1);
1373 Engine_CameraSetSpeed(0xcccc, 0x1999);
1374 Engine_CameraMoveTo(PIXELS(128), -1, PIXELS(184), 1);
1376 Engine_EventWait(30);
1377 Map_CopyCellsTo(29, 74, 4, 74, 5, 4);
1383 Engine_EventWait(20);
1386}
1387
1388/// Touching trigger 12: the leader steps onto the lift and rides it down to
1389/// the lighthouse's foot (exit 1).
1392 Actor_SetSpeed(ACTOR_PARTY_LEADER, 0x8000, 0x4000);
1398 Camera_MoveTo(-1, -1, -1, 0);
1401}
1402
1403/// Saturos and Alex warp out in a column of sparkles and vanish.
1405 struct EffectOptions options;
1406 struct EffectOptions *effectOptions;
1407 struct FieldActor *left;
1408 struct FieldActor *right;
1409 u32 i;
1410 s32 x;
1411 s32 r;
1412
1414 right = Object_GetById(ACTOR_ALEX);
1420 effectOptions = &options;
1421 effectOptions->priority = 1;
1422 effectOptions->palette = 5;
1423 effectOptions->type = 0x11c;
1424 effectOptions->startScaleX = 0x6666;
1425 effectOptions->startScaleY = 0x30000;
1426 for (i = 0; i <= 31; i++) {
1428 if (i & 1) {
1429 r = ((((u32)Engine_RandomNext() * 24) >> 16) << 16);
1430 x = left->x.fixed;
1431 x += r;
1432 x += -0xc0000;
1433 Effect_Spawn(x,
1434 left->y.fixed +
1435 ((((u32)Engine_RandomNext() << 5) >> 16) << 16) +
1436 -0x100000,
1437 left->z.fixed, 0, 0x40000, 0,
1440 effectOptions);
1441 } else {
1442 r = ((((u32)Engine_RandomNext() * 24) >> 16) << 16);
1443 x = right->x.fixed;
1444 x += r;
1445 x += -0xc0000;
1446 Effect_Spawn(x,
1447 right->y.fixed +
1448 ((((u32)Engine_RandomNext() << 5) >> 16) << 16) +
1449 -0x100000,
1450 right->z.fixed, 0, 0x40000, 0,
1453 effectOptions);
1454 }
1455 }
1458}
1459
1460/// Saturos and Alex warp in where they have been placed.
1462 struct EffectOptions options;
1463 struct EffectOptions *effectOptions;
1464 struct FieldActor *left;
1465 struct FieldActor *right;
1466 u32 i;
1467 s32 x;
1468 s32 r;
1469
1471 right = Object_GetById(ACTOR_ALEX);
1475 effectOptions = &options;
1476 effectOptions->priority = 1;
1477 effectOptions->palette = 5;
1478 effectOptions->type = 0x11c;
1479 effectOptions->startScaleX = 0x6666;
1480 effectOptions->startScaleY = 0x30000;
1481 for (i = 0; i <= 31; i++) {
1483 if (i & 1) {
1484 r = ((((u32)Engine_RandomNext() * 24) >> 16) << 16);
1485 x = left->x.fixed;
1486 x += r;
1487 x += -0xc0000;
1488 Effect_Spawn(x,
1489 left->y.fixed +
1490 ((((u32)Engine_RandomNext() << 5) >> 16) << 16) +
1491 0x200000,
1492 left->z.fixed, 0, -0x40000, 0,
1495 effectOptions);
1496 } else {
1497 r = ((((u32)Engine_RandomNext() * 24) >> 16) << 16);
1498 x = right->x.fixed;
1499 x += r;
1500 x += -0xc0000;
1501 Effect_Spawn(x,
1502 right->y.fixed +
1503 ((((u32)Engine_RandomNext() << 5) >> 16) << 16) +
1504 0x200000,
1505 right->z.fixed, 0, -0x40000, 0,
1508 effectOptions);
1509 }
1510 if (i == 20) {
1513 }
1514 }
1519}
1520
1521/// MercuryLighthouseAerie_LowerLift passes its lift as a third
1522/// argument, which this function does not take.
1524 struct ActorTable *table;
1525 u32 slot;
1526
1527 table = (struct ActorTable *)gEventWork;
1528 y = 64 - (y >> 20);
1529 for (slot = 0; slot <= 65; slot++) {
1530 struct FieldActor *actor = table->actors[slot];
1531
1532 if (actor != 0) {
1533 s32 cell = actor->x.fixed >> 20;
1534 s32 row = actor->z.fixed >> 20;
1535
1536 if (cell >= 4 && cell <= 8 && y + 8 <= row && row < y + 11)
1537 *out++ = slot;
1538 }
1539 }
1540}
1541
1542/// The lift sinks with everything standing on it, speeding up.
1544 s32 ids[5];
1545 struct MapLayerScroll *lift;
1546 u32 i;
1547 u32 j;
1548 u32 n;
1549 s32 speed;
1550 struct FieldActor *actor;
1551
1552 lift = &((struct MapScrollWork *)gMapWork[0])->layers[2];
1553 speed = 0x1999;
1554 n = 0;
1555 for (i = 0; i <= 4; i++)
1556 ids[i] = 66;
1557 // the lift goes as a third argument, as the bytes show: the cast keeps it
1558 ((void (*)())MercuryLighthouseAerie_FindLiftRiders)(ids, lift->offsetY, lift);
1559 for (i = 0; i <= 4; i++) {
1560 if (ids[i] == 66)
1561 break;
1562 Object_GetById(ids[i])->motionFlags = 0;
1563 n++;
1564 }
1566 for (i = 0; i <= 227; i++) {
1567 lift->offsetY -= speed;
1568 for (j = 0; j < n; j++) {
1569 Object_GetById(ids[j])->z.fixed += speed;
1570 actor = Object_GetById(ids[j]);
1571 actor->targetZ = Object_GetById(ids[j])->z.fixed;
1572 }
1573 if ((i & 3) == 3)
1574 speed += 0x1999;
1575 if (speed > 0x17fff)
1576 speed = 0x18000;
1577 Engine_TaskWait(1);
1578 }
1579 for (i = 0; i < n; i++)
1580 Object_GetById(ids[i])->motionFlags = 0;
1581}
1582
1583/// The lift rises with everything standing on it, slowing at the top.
1585 s32 ids[5];
1586 struct MapLayerScroll *lift;
1587 u32 i;
1588 u32 j;
1589 u32 n;
1590 s32 speed;
1591 struct FieldActor *actor;
1592
1593 lift = &((struct MapScrollWork *)gMapWork[0])->layers[2];
1594 speed = 0x18000;
1595 n = 0;
1596 for (i = 0; i <= 4; i++)
1597 ids[i] = 66;
1599 for (i = 0; i <= 4; i++) {
1600 if (ids[i] == 66)
1601 break;
1602 Object_GetById(ids[i])->motionFlags = 0;
1603 n++;
1604 }
1606 for (i = 0; i <= 85; i++) {
1607 lift->offsetY += speed;
1608 for (j = 0; j < n; j++) {
1609 Object_GetById(ids[j])->z.fixed -= speed;
1610 actor = Object_GetById(ids[j]);
1611 actor->targetZ = Object_GetById(ids[j])->z.fixed;
1612 }
1613 if ((i & 3) == 3 && i > 75)
1614 speed += -0x3333;
1615 if (speed < 0xccc)
1616 speed = 0xccc;
1617 Engine_TaskWait(1);
1618 }
1619 lift->offsetY = 0x4000000;
1621 Engine_TaskWait(2);
1622}
1623
1624/// Alex casts Ply on the statue; nothing calls it.
1632}
1633
1634/// A beacon spark's update: it swings round the flame, its angle stepping
1635/// back each frame.
1636static void SceneEffect_UpdateArcPosition(union FieldObject *fieldObject) {
1637 struct OverlayObject *object = (struct OverlayObject *)fieldObject;
1638 struct OverlayObject *parent;
1639 u16 angle;
1640
1641 parent = object->linkedObject;
1642 angle = object->angle64;
1643 object->coordinate08 =
1644 parent->coordinate08 + Engine_MathCos(angle) * (object->field30 + 28);
1645 object->coordinate10 = (Engine_MathSin(angle) << 4) + 0x900000;
1646 object->coordinate38 = object->coordinate08;
1647 object->coordinate40 = object->coordinate10;
1648 object->angle64 -= 0x200;
1649}
1650
1651/// A spark the beacon flame throws off, swinging round the flame on its arc.
1653 u8 unk00[0x30];
1655 u8 unk34[0x1c];
1659 u8 unk56[0x0e];
1663 void (*update)();
1664};
1665
1666/// Every frame: while the view is near the top the beacon flame flickers
1667/// between two sizes, and every 16 frames it throws off a spark that swings
1668/// round it.
1670 struct FieldActor *beacon;
1671 struct BeaconSpark *spark;
1672 struct AnimationObject *sprite;
1673 struct MapScrollWork *map;
1674 s32 height;
1675 s32 scale;
1676 s32 tick;
1677 u32 angle;
1678
1680 map = gMapWork[0];
1681 height = ((u32)(Engine_RandomNext() * 48) >> 16) << 16;
1682 if (((union FieldCoordinate *)&map->viewY)->part.pixel <= 129) {
1683 if (gFrameCount & 1) {
1685 scale = 0x10000;
1687 } else {
1689 scale = 0x14ccc;
1691 }
1693 } else {
1695 }
1696 if (beacon == NULL) {
1697 return;
1698 }
1699 tick = gFrameCount & 15;
1700 if (tick != 0) {
1701 return;
1702 }
1703 spark = (struct BeaconSpark *)Object_Create(
1704 0x11c, beacon->x.fixed + 0x80000, beacon->y.fixed + height + 0x80000,
1705 beacon->z.fixed);
1706 height = height / 0x60000;
1707 height <<= 16;
1708 if (spark == NULL) {
1709 return;
1710 }
1711 sprite = spark->sprite;
1712 Engine_ObjectSetScript((struct FieldActor *)spark,
1714 ObjectGroup_SetChildValue((struct FieldActor *)spark, 3);
1715 spark->motionFlags = tick;
1716 angle = Engine_RandomNext() & 0x0ffff000;
1717 spark->angle = angle;
1718 spark->turn = tick;
1719 spark->source = beacon;
1721 spark->swing = (Engine_MathSin((height & 0xfffff) >> 4) * 24) >> 16;
1722 /* FAKEMATCH: the byte view keeps this store ahead of the beacon's reload; the
1723 * field store lets the reload schedule first (score 210). Field store:
1724 * differ 2. */
1725 *(u8 *)&sprite->flags = 0;
1726 sprite->image.priority = beacon->sprite->image.priority;
1727}
1728
1730 SC_WAIT(1), SC_LOOP(22, SC_TOP), SC_WAIT(1),
1731 SC_POS(0, 0, 0), SC_WAIT(1), SC_FREE,
1732};
1733
1735 SC_WAIT(1), SC_LOOP(44, SC_TOP), SC_WAIT(1),
1736 SC_POS(0, 0, 0), SC_WAIT(1), SC_FREE,
1737};
1738
1740 SC_WAIT(1), SC_LOOP(126, SC_TOP), SC_WAIT(1),
1741 SC_POS(0, 0, 0), SC_WAIT(1), SC_FREE,
1742};
1743
1748};
1749
1751 {0, CONDITION_ALWAYS, 172, 0, 149, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
1752 {1, CONDITION_ALWAYS, 8, 0, 8, FACING_SOUTH, 0, 0, 0, 608, 424, 0},
1753 {2, CONDITION_ALWAYS, 8, 0, 8, FACING_SOUTH, 0, 0, 0, 608, 424, 0},
1754 {5, CONDITION_ALWAYS, 504, 0, 152, FACING_SOUTH, 0, 0, 0, 608, 424, 0},
1755 {51, CONDITION_ALWAYS, 504, 0, 168, FACING_SOUTH, 0, 0, 0, 608, 424, 0},
1757};
1758
1760 SCENE_EXITS(58),
1761 SCENE_EXIT(1, 57, 15),
1763};
1764
1765// clang-format off
1772 PIXELS(8), 0, PIXELS(8), FACING_SOUTH, TALK_KEEP_FACING, 0 },
1774 PIXELS(120), 0, PIXELS(160), FACING_EAST, TALK_KEEP_FACING, 0 },
1775 { 0xf4, CONDITION_ALWAYS, 7,
1776 PIXELS(304), PIXELS(40), PIXELS(144), FACING_SOUTH, TALK_KEEP_FACING, 0 },
1778 PIXELS(104), 0, PIXELS(136), FACING_SOUTH, TALK_KEEP_FACING, 0 },
1787 { 0xf2, CONDITION_ALWAYS, 7,
1788 PIXELS(440), 0, PIXELS(200), FACING_SOUTH, TALK_KEEP_FACING, 0 },
1789 { 0xf2, CONDITION_ALWAYS, 7,
1791 { 0xf2, CONDITION_ALWAYS, 7,
1793 { 0xf2, CONDITION_ALWAYS, 7,
1795 { 0xf2, CONDITION_ALWAYS, 7,
1797 { 0xf2, CONDITION_ALWAYS, 7,
1800 PIXELS(104), 0, PIXELS(152), FACING_EAST, TALK_KEEP_FACING, 0 },
1802 PIXELS(88), 0, PIXELS(160), FACING_EAST, TALK_KEEP_FACING, 0 },
1804 PIXELS(8), 0, PIXELS(8), FACING_SOUTH, TALK_KEEP_FACING, 0 },
1806 PIXELS(104), 0, PIXELS(200), FACING_EAST, TALK_KEEP_FACING, 0 },
1808 PIXELS(8), 0, PIXELS(8), FACING_EAST, TALK_KEEP_FACING, 0 },
1809 { SCENE_TABLE_END },
1810};
1811// clang-format on
1812
1830};
1831
1833
1835 SC_SET(SW_SCALE_Y, 0x16666),
1836 SC_SET(SW_SCALE_X, 0x16666),
1837 SC_ARG(4),
1838 SC_WAIT(30),
1839 SC_FREE,
1840};
Ability numbers, named from the English release.
@ ABILITY_PLY
Definition ability_ids.h:14
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 gEffectScript0[]
const s32 * gEffectScripts[]
s32 gEffectScript1[]
s32 gEffectScript2[]
#define GARET
Jerald.
#define MIA
Mary.
#define JENNA
Jasmine.
#define IVAN
Ivan.
The engine calls a scene uses to create an overlay object and set its sprite flags.
void Engine_ActorSetSpriteFlags(struct FieldActor *, s32)
The engine calls the debug menus import, and their palette swatch tiles.
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.
Definition engine_call.h:36
static s32 FieldObject_CheckMovementCollision(struct FieldActor *actor, struct FieldPosition *position)
Definition engine_call.h:66
@ EFFECT_USE_PALETTE
options.palette, as its group child value
@ EFFECT_USE_START_SCALE
options.startScaleX and startScaleY
@ EFFECT_USE_TYPE
options.type, else object type 222
@ 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,...
@ ANIM_WALK
Definition field_event.h:44
@ ANIM_STAND
Definition field_event.h:43
@ ANIM_NOD
Definition field_event.h:45
@ ANIM_SHAKE_HEAD
Definition field_event.h:46
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)
void Object_SetMode(struct FieldActor *object, s32 animation)
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_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)
void Engine_PsynergyLowerHands(void)
void Engine_ActorMoveToAndWait(s32 actor, s32 x, s32 z)
#define EMOTE_IN_FRONT
Definition field_event.h:49
s32 Engine_MathSin(s32 angle)
static void Map_CopyCellsTo(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
static void ColorBuffer_ApplyTarget(s32 value, s32 mode)
static void Actor_WalkTo(s32 actor, s32 x, s32 z)
void Engine_EventWaitForScreen(void)
#define GameFlag_Set
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_GameFlagClear(s32 flag)
void Engine_CameraWaitForMove(void)
void Engine_ActorWaitForMove(s32 actor)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
static void Event_ShowMessage(s32 speaker, s32 flags)
s32 Engine_RandomNext()
static void Event_PlayCue(s32 cue)
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_PsynergyPlayEffect(s32 effect)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
static struct FieldActor * Object_Create(s32 type, s32 fixed_x, s32 fixed_y, s32 fixed_z)
struct FieldActor * Engine_EventGetViewCenter(void)
s32 Engine_MathCos(s32 angle)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_MapRedraw(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)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
void Engine_PsynergySetTarget(s32 caster, s32 target)
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_WINDOW
Definition field_obj.h:17
@ TRANSITION_BACKDROP_FADE
Definition field_obj.h:16
#define SCENE_TRANSITION(style, variant)
Definition field_obj.h:20
@ ACTOR_FACES_MOTION
turns toward its velocity, 1/16 turn a frame
Definition field_obj.h:166
The scene table formats: entrances, exits, placements and events, and the macros that write them.
#define SCENE_EVENTS_END
@ EVENT_TOUCH
@ FACING_STEP
Definition field_scene.h:36
#define SCENE_EXITS(scene)
Definition field_scene.h:72
#define FIND_PSYNERGY_STONE
#define SCENE_EXIT(exit, scene, entrance)
Definition field_scene.h:73
@ ACTOR_FIRST_PLACED
@ ACTOR_PARTY_LEADER
@ SCENE_TABLE_END
Definition field_scene.h:43
@ CONDITION_ALWAYS
Definition field_scene.h:44
@ TALK_KEEP_FACING
#define EVENT_SCRIPT(script)
@ ACTOR_STAND
#define SEARCH(target)
#define SCENE_EXITS_END
Definition field_scene.h:77
#define PLACEMENT_SHARE_PREVIOUS_SPRITE
@ FACING_NORTHEAST
Definition field_scene.h:33
@ FACING_EAST
Definition field_scene.h:26
@ FACING_SOUTHEAST
Definition field_scene.h:27
@ FACING_NORTH
Definition field_scene.h:32
@ FACING_SOUTHWEST
Definition field_scene.h:29
@ FACING_NORTHWEST
Definition field_scene.h:31
@ FACING_SOUTH
Definition field_scene.h:28
@ FACING_WEST
Definition field_scene.h:30
#define TOUCH_WALKING
#define PIXELS(value)
@ SEARCH_UNNAMED
Game flags, named where their meaning is shown.
#define FLAG_MERCURY_LIGHTHOUSE_LIT
Definition flags.h:30
#define FLAG_RETREAT_BLOCKED
Retreat is blocked, from Psynergy or an item.
Definition flags.h:55
#define FLAG_SCENE_TEMP_00
Definition flags.h:713
#define FLAG_KEEP_PARTY_POSITION
Definition flags.h:93
#define FLAG_MERCURY_AERIE_CONFRONTATION_DONE
The aerie's confrontation with Saturos, the battle and Alex's visit are over; set with FLAG_SATUROS_B...
Definition flags.h:355
#define FLAG_SATUROS_BEATEN_AT_MERCURY
Saturos is beaten at Mercury Lighthouse: the Hermes fountain at its foot flows again.
Definition flags.h:358
#define FLAG_SCENE_TEMP_50
Definition flags.h:793
volatile u32 gFrameCount
Frames WaitFrames has finished.
GameState, the game's state: play time, coins, the scene and the leader's position,...
#define Battle_SetStart(mode)
Sets the battle start type.
Definition game_state.h:164
struct GameState gGameState
The work slots of gWorkSlot, read through their own names.
void * gMapWork[]
The screen blend's globals and the graphics routines.
@ ACTOR_FIRST_PLATFORM
The platforms, in each platform room.
The main-image routines scene overlays import.
The IWRAM call layer: the routines the game keeps resident in IWRAM, each at its fixed address,...
Small statement macros both games use for positions, velocities and bounds.
#define SET_POSITION(p, px, py, pz)
Sets the position or the velocity of a particle, a piece of debris or an object in one statement.
Definition macros.h:16
The map layers' scroll work and the background scroll values.
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,...
Definition math.c:23
@ ACTOR_LIFT_STATUE
const struct ScenePlacement * MercuryLighthouseAerie_GetPlacements(void)
The actors; only the first arrival places Jenna, Kraden, Felix and Menardi.
s32 MercuryLighthouseAerie_Initialize(void)
On arriving: the beacon flickers and the six platforms sit 50 pixels down; the first arrival (entranc...
static void MercuryLighthouseAerie_ConfrontSaturos(void)
Touching trigger 5 before the confrontation: Garet sees the lighthouse is lit.
static void MercuryLighthouseAerie_RaiseLift(void)
The lift rises with everything standing on it, slowing at the top.
struct SceneEntrance gMercuryLighthouseAerieEntrances[]
@ FLAG_ON_PLATFORM
The leader stands on a platform, which has dipped under the weight.
@ FLAG_HOSTAGES_GONE
Set on every arrival but the first: Jenna, Kraden, Felix and Menardi are placed only before it.
const struct SceneRegion * MercuryLighthouseAerie_GetRegions(void)
static void MercuryLighthouseAerie_RideLiftDown(void)
Touching trigger 12: the leader steps onto the lift and rides it down to the lighthouse's foot (exit ...
struct SceneEvent gMercuryLighthouseAerieEvents[]
static void MercuryLighthouseAerie_AlexAppears(void)
Entrance 2, back from the battle, unless resuming: Saturos is beaten, but not for long.
struct ScenePlacement gMercuryLighthouseAeriePlacements[]
static void MercuryLighthouseAerie_SaturosAndAlexWarpOut(void)
Saturos and Alex warp out in a column of sparkles and vanish.
static void MercuryLighthouseAerie_FlickerBeacon(void)
Every frame: while the view is near the top the beacon flame flickers between two sizes,...
static void MercuryLighthouseAerie_LowerLift(void)
The lift sinks with everything standing on it, speeding up.
static void MercuryLighthouseAerie_FindLiftRiders(s32 *out, s32 y)
MercuryLighthouseAerie_LowerLift passes its lift as a third argument, which this function does not ta...
const struct SceneEvent * MercuryLighthouseAerie_GetEvents(void)
@ FLAG_PSYNERGY_STONE
u32 gMercuryLighthouseAerieExits[]
static void SceneEffect_UpdateArcPosition(union FieldObject *fieldObject)
A beacon spark's update: it swings round the flame, its angle stepping back each frame.
s32 gMercuryLighthouseAerie_SparkScript[]
static void MercuryLighthouseAerie_SettlePlatforms(void)
Touching trigger 11: the leader walks normally again and the platforms stop following.
MercuryLighthouseAerieActor
The aerie's actors.
@ ACTOR_LIFT_PLATFORM_2
@ ACTOR_LIFT_PLATFORM_1
The two platforms that stand on the lift and go up and down with it.
@ ACTOR_BEACON_FLAME
flickers and sheds sparks
static void MercuryLighthouseAerie_JumpToPlatform(void)
Walking into trigger 10 or 11: if nothing is in the way the leader jumps two cells ahead,...
const struct SceneEntrance * MercuryLighthouseAerie_GetEntrances(void)
static UNUSED void MercuryLighthouseAerie_AlexCastsPly(void)
Alex casts Ply on the statue; nothing calls it.
static void MercuryLighthouseAerie_CallLift(void)
Touching trigger 6 while the lift is down: the camera watches it rise with its statue.
const u32 * MercuryLighthouseAerie_GetExits(void)
One exit: the lift down to the lighthouse's foot.
s32 gMercuryLighthouseAerie_PlatformUnderfoot
static void MercuryLighthouseAerie_PartyArrives(void)
Entrance 1, unless resuming: the Adepts of lit elements regain their PP; the aerie shakes,...
static void MercuryLighthouseAerie_StepOntoPlatform(void)
Touching trigger 10 when not already on one: the platform underfoot dips with the leader and bobs bac...
static void MercuryLighthouseAerie_SaturosAndAlexWarpIn(void)
Saturos and Alex warp in where they have been placed.
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.
Definition objcmd.h:37
#define SC_LOOP(n, to)
Repeat up to n times.
Definition objcmd.h:28
#define SC_POS(x, y, z)
Set position.
Definition objcmd.h:18
#define SC_FREE
Release.
Definition objcmd.h:43
#define SC_ARG(v)
Definition objcmd.h:44
#define SC_WAIT(n)
Wait n frames.
Definition objcmd.h:16
#define SC_TOP
Script start.
Definition objcmd.h:13
@ SW_SCALE_Y
Definition objcmd.h:63
@ SW_SCALE_X
Definition objcmd.h:62
void BattleEffect_CleanupSceneObjects(void)
Ends a Psynergy effect: frees the effect slots still in use and, unless another effect is being resol...
Definition setup.c:110
Overlay objects and their records.
void Field_RequestBattleFromEncounterTable(s32 zoneNo, s32 slotNo)
Sets up a battle with enemy group slot of encounter table zone.
Definition requests.c:14
void Event_SetNextDestination(s32 scene, s32 entrance)
Sets the scene and entrance that the field goes to next (gGameState.nextScene and nextEntrance).
Definition requests.c:61
void Audio_PlayCueFromEventWork(void)
Starts the current scene's field music, chosen by Scene_ResolveInteractionResult.
Definition scene.c:355
Scene numbers, named after their places.
char SceneId_MercuryLighthouseAerie1
Song and sound effect ids, indices into gSound_SongTable.
#define MUS_029
Definition songs.h:39
#define SE_223
Definition songs.h:218
#define SE_288
Definition songs.h:281
#define MUS_061
Definition songs.h:65
#define MUS_017
Definition songs.h:27
#define SE_190
Definition songs.h:185
#define SE_141
Definition songs.h:134
#define SE_JUMP
An actor jumps: ObjectMotion_Launch plays the high jump above 5 pixels a frame.
Definition songs.h:147
#define SE_289
Definition songs.h:282
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_TaskWait()
void Engine_EventSetMessage()
#define NULL
Definition bilibin.h:6
s32 SceneActor_FindNearestSlotOfKindF2(void)
Returns the placed actor drawn with sprite 0xf2 nearest the leader, within 640 pixels,...
The event work, seen for its table of the scene's 66 actor slots.
struct FieldActor * actors[66]
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
Definition animspr.h:108
struct AnimationSpritePart image
Definition animspr.h:109
u8 flags
bits: 1 outlined in ObjectSystemWork's edge and fill colours | 0 shadow drawn (set when created)
Definition animspr.h:128
u16 priority
2 when created
Definition animspr.h:100
A spark the beacon flame throws off, swinging round the flame on its arc.
struct FieldActor * source
struct AnimationObject * sprite
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 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
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
Definition event_work.h:20
s32 startTransition
SCENE_TRANSITION(style, variant).
Definition event_work.h:43
u16 message
the next message, advanced as each window opens
Definition event_work.h:47
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
s32 speed
speed limit, 16.16 fixed-point pixels per frame
Definition field_obj.h:55
u8 steeringFlags
ActorSteeringFlag bits.
Definition field_obj.h:92
u8 motionFlags
ActorMotionFlag bits; zero is free flight in 3D, and 3 is set on creation.
Definition field_obj.h:83
union FieldCoordinate x
16.16 fixed-point pixels
Definition field_obj.h:35
s32 targetZ
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
Definition field_obj.h:61
union FieldCoordinate y
16.16 fixed-point pixels
Definition field_obj.h:36
u8 priorityFlags
ActorPriorityFlag bits, read by the scrolling camera.
Definition field_obj.h:51
s32 terrainHeight
16.16 fixed-point pixels
Definition field_obj.h:38
s32 velocityY
16.16 fixed-point pixels per frame
Definition field_obj.h:53
union FieldCoordinate z
16.16 fixed-point pixels
Definition field_obj.h:37
u16 facing
1/65536 turns
Definition field_obj.h:34
s32 acceleration
Added toward the target each frame, or taken off the speed when there is none, in 16....
Definition field_obj.h:58
s32 targetY
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
Definition field_obj.h:60
s32 scaleX
16.16 fixed point, 0x10000 full size
Definition field_obj.h:39
s32 scaleY
16.16 fixed point, 0x10000 full size
Definition field_obj.h:40
A position on the field.
s32 z
16.16 fixed-point pixels
s16 entrance
Definition game_state.h:37
One background layer of the field map: its scroll position, origin, parallax against the view,...
Definition map_scroll.h:14
struct MapCell * cells
the layer's first cell in the map cell buffer
Definition map_scroll.h:21
s32 offsetY
16.16 fixed-point pixels
Definition map_scroll.h:16
The field map's work: the followed position, screen shake, tile animations, blend script,...
Definition map_scroll.h:27
s32 viewY
the view's top left, 16.16 fixed-point pixels
Definition map_scroll.h:40
struct MapLayerScroll layers[3]
BG3, BG2 and BG1, in that order.
Definition map_scroll.h:49
A field object as a Mercury Lighthouse beacon spark sees it: its position and target,...
s32 coordinate08
16.16 fixed-point pixels
struct OverlayObject * linkedObject
u16 angle64
1/65536 turns
u16 angle
1/65536 turns
A scene entrance: where and facing which way the party arrives, and the camera's bounds there (-1 for...
Definition field_scene.h:54
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,...
Definition field_scene.h:81
A scene's exit region: the box that, while its condition holds, takes the party leader out through it...
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
unsigned short u16
Definition types.h:13
#define UNUSED
Definition types.h:22
unsigned char u8
Definition types.h:11
A field coordinate, read whole or as its fraction and its whole pixels.
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.
void Party_RestorePpOfLitElements(void)
Restores the PP of each party member whose element group has a lit lighthouse: Venus or Mars for grou...
Definition units.c:685