Alchemy
Loading...
Searching...
No Matches

world_map.c

Go to the documentation of this file.
1/// @file
2/// The world map: the Djinn met on it, the passages between its regions, the
3/// map markers, and the actors of particular arrivals.
4
5#include "script.h"
6#include "version.h"
7#include "game_state.h"
8#include "vram_tab.h"
9#include "unit/import.h"
12#include "unit/object/object.h"
14#include "unit/field/field.h"
15#include "unit/game/game.h"
16#include "unit/window/window.h"
19#include "battle.h"
20#include "debug.h"
21#include "field.h"
22#include "game.h"
23#include "graphics.h"
24#include "menu.h"
25#include "minigame.h"
26#include "sound.h"
27#include "system.h"
28#include "global_cells.h"
29#include "types.h"
30#include "animspr.h"
31#include "field_event.h"
32#include "field_scene.h"
33#include "djinn_ids.h"
34#include "map_render_work.h"
35#include "field_service.h"
36#include "iwram_call.h"
37#include "scene_ids.h"
38#include "call.h"
39#include "text/msg_ids.h"
40#include "edition.h"
41#include "tbs_edition.h"
42#include "inventory.h"
43#include "resource.h"
44#include "mem.h"
45#include "field_effect.h"
46#include "io_reg.h"
47#include "io_write_queue.h"
48#include "ability_ids.h"
49#include "objcmd.h"
50#include "field_obj.h"
51#include "frame.h"
52#include "fx_scene.h"
53#include "fixed_math.h"
54#include "palbuf.h"
55#include "flags.h"
56#include "songs.h"
57#include "item_ids.h"
58
59static s32 WorldMap_ApplyMapRotation(struct ScriptInterpreter *interpreter);
60static void WorldMap_BoardBunzasWagon(void);
61static void WorldMap_DepartWithTravelers(void);
62static void WorldMap_ShakeTransferStartCamera(void);
65static void WorldMap_TransferToExit102(void);
66static void WorldMap_TransferToExit103(void);
67static void WorldMap_TransferToExit104(void);
69static void WorldMap_TransferToExit106(void);
70static void WorldMap_CompleteTransfer(void);
71static void WorldMap_DisembarkCarriage(void);
72static void WorldMap_RunBlackOrbScene(void);
73static void WorldMap_ActivateSite138(s32 actor);
74static void Event_StopLeavingShip(void);
75static void WorldMap_ShowEndingScene(void);
76static void WorldMap_StartTransitionEffect(void);
77static void WorldMap_UpdateTransitionEffect(void);
78static void WorldMap_MoveActorEightToExit(void);
80static s32 WorldMap_GetSelectedReward(u32 selection);
81static void WorldMap_RunOpeningRise(void);
83static void WorldMap_PlayLighthouseTransition(s32 palette);
84
85/// The one actor placed for entrance 75, which travels north to exit 110.
86#define ACTOR 8
87
88enum {
92};
93
94/// The Djinn met on the world map. The Venus Djinni is Flint, bobbing on the
95/// map until the party meets him, and later Vine.
96enum {
100};
101
102// The world map's scene flags:
103// FLAG_SCENE_TEMP_00: the carried actor has landed on its guide.
104// FLAG_SCENE_TEMP_34: the Black Orb has been handed over.
105// FLAG_SCENE_TEMP_35: the map's ordinary placements are in use.
106// FLAG_SCENE_TEMP_F0: the party is up in the air.
107// FLAG_SCENE_TEMP_F1: the airborne journey is over.
108// FLAG_SCENE_TEMP_F8: a byte: frames left in the air.
109
110/// Walking near Vine, or talking to him: once a battle is nearly due, half the
111/// time Vine fights; otherwise the next step brings an ordinary battle.
112/// Reached by talking to actor 8, or by walking onto cell code 92 until Vine is
113/// caught.
114static void Event_MeetVine(void) {
115 struct EventWork *work = gEventWork;
116
118 Math_Divide(work->encounterThreshold * 9, 10)) {
119 if ((u32)Engine_RandomNext() < 0x8000) {
121 work->encounterBias = 0;
122 } else {
124 }
125 }
126}
127
128/// Walking near Corona, or talking to him: once a battle is nearly due, Corona
129/// fights.
130/// Reached by talking to actor 9, or by walking onto cell code 91 until Corona
131/// is caught.
132static void Event_MeetCorona(void) {
133 struct GameState *state = &gGameState;
134 s32 *steps = &state->encounterSteps;
135 struct EventWork *work = gEventWork;
136
137 if (*steps >= Math_Divide(work->encounterThreshold * 9, 10)) {
139 work->encounterBias = 0;
140 }
141}
142
143/// Walking near Hail, or talking to him: once a battle is nearly due, Hail
144/// fights.
145/// Reached by talking to actor 10, or by walking onto cell code 93 until Hail
146/// is caught.
147static void Event_MeetHail(void) {
148 struct GameState *state = &gGameState;
149 s32 *steps = &state->encounterSteps;
150 struct EventWork *work = gEventWork;
151
152 if (*steps >= Math_Divide(work->encounterThreshold * 9, 10)) {
154 work->encounterBias = 0;
155 }
156}
157
158/// Releases the spark after its initial timer step.
159static void WorldMap_ReleaseSparkAfterDelay(union FieldObject *fieldObject) {
160 struct FieldActor *actor = (struct FieldActor *)fieldObject;
161 if (actor->timer <= 0) {
162 actor->timer++;
163 } else {
165 }
166}
167
168/// Pulses the orb's scale and emits short-lived sparks.
169static void WorldMap_PulseOrbAndSpawnSparks(union FieldObject *fieldObject) {
170 struct FieldActor *actor = (struct FieldActor *)fieldObject;
171 struct FieldActor *spark;
172 s32 x;
173 s32 y;
174 s32 z;
175
176 if (gFrameCount & 4) {
177 actor->scaleX = 13 * Q16_ONE / 10;
178 actor->scaleY = 13 * Q16_ONE / 10;
179 } else {
180 actor->scaleX = Q16_ONE;
181 actor->scaleY = Q16_ONE;
182 }
183 if (!(gFrameCount & 2))
184 return;
185 x = actor->x.fixed;
186 y = actor->y.fixed;
187 z = actor->z.fixed;
188 spark = Engine_ObjectCreate(0x11d, x, y, z);
190 if (spark == 0)
191 return;
192 spark->motionFlags = 0;
193 spark->sprite->image.priority = 1;
195 Object_SetMode(spark, 1);
196 spark->timer = 0;
198}
199
200/// Cycles the marker's palette and orbits it around its map position.
201static void WorldMap_UpdateBobbingMarker(union FieldObject *fieldObject) {
202 struct FieldActor *actor = (struct FieldActor *)fieldObject;
203 s16 *angle;
204
205 if (gFrameCount & 2)
207 else
209 if ((s16)actor->work == 0) {
210 angle = (s16 *)&actor->timer;
211 actor->x.fixed = PIXELS(5584);
212 actor->y.fixed =
213 Iwram_MulQ16(Engine_MathSin(*angle << 3), PIXELS(4)) + PIXELS(16);
214 actor->z.fixed = PIXELS(1328);
215 Vector_AddPolarOffset(PIXELS(16), *angle, &actor->x);
216 actor->facing = *angle + FACING_SOUTH;
217 *angle += 0x400;
218 }
219}
220
221/// Animates the first Djinni until it has met the party.
222static s32
224 struct FieldActor *actor = (struct FieldActor *)interpreter;
226 return 0;
227 }
229 return 0;
230 }
232 actor->motionFlags = 0;
233 actor->timer = 0;
234 actor->work = 0;
235 actor->scaleX = Q16_ONE / 2;
236 actor->scaleY = Q16_ONE / 2;
237 return 0;
238}
239
241 return gWorldMapEntrances;
242}
243
244const struct SceneRegion *WorldMap_GetRegions(void) { return NULL; }
245
246const u32 *WorldMap_GetExits(void) { return gWorldMapExits; }
247
248/// Aligns the actor to the map and selects its flagged animation mode.
249static s32
251 struct FieldActor *actor = (struct FieldActor *)interpreter;
252 WorldMap_ApplyMapRotation(interpreter);
254 Object_SetMode(actor, 2);
255 }
256 return 1;
257}
258
259/// Aligns the actor's sprite rotation to the map.
261 struct FieldActor *actor = (struct FieldActor *)interpreter;
262 struct MapRenderWork *work = gMapWork[0];
263 struct AnimationObject *sprite = actor->sprite;
264
265 sprite->rotation = work->rotation;
266 sprite->flags = 0;
267 return 1;
268}
269
270/// Enables the actor's collision and aligns its sprite to the map.
271static s32
273 struct FieldActor *actor = (struct FieldActor *)interpreter;
274 struct MapRenderWork *work = gMapWork[0];
275 struct AnimationObject *sprite = actor->sprite;
276
277 actor->collisionFlags |= 1;
278 sprite->rotation = work->rotation;
279 return 1;
280}
281
282/// Resets the map marker after the corresponding story progress.
283/// Called by its object script as the travel marker is placed. Once the Tolbi
284/// ship lies at anchor off the island (FLAG_TOLBI_SHIP_AT_ISLAND), sets
285/// FLAG_SCENE_TEMP_F1 and puts the marker away at the map's origin.
286static s32
288 struct FieldActor *actor = (struct FieldActor *)interpreter;
291 actor->collisionFlags = 0;
294 actor->x.fixed = 0;
295 actor->y.fixed = 0;
296 }
297 return 0;
298}
299
300/// Blinks a visible actor on alternating frames.
302 struct FieldActor *actor = (struct FieldActor *)interpreter;
303 if ((actor->spriteStorageKind & 1) && (gFrameCount & 1))
304 actor->spriteStorageKind ^= 1;
305 return 1;
306}
307
309 switch (gGameState.entrance) {
310 case 49:
314 }
315 break;
316 case 64:
319 }
320 break;
321 case 65:
322 case 70:
324 case 71:
326 case 72:
328 case 73:
330 case 66:
331 case 67:
332 case 68:
333 case 69:
334 case 75:
336 case 80:
338 default:
339 break;
340 }
341
343 return gWorldMapPlacements;
344}
345
346/// Chooses a passage exit from the side of the actor the leader approaches.
347static void WorldMap_SelectExitByX(s32 trigger, s32 exitBefore, s32 exitAfter) {
348 struct EventWork *work;
349 struct FieldActor *subject;
350 struct FieldActor *other;
351
352 subject = Object_GetById(trigger - CONTACT_TRIGGER_BASE);
355 if (other->x.fixed < subject->x.fixed) {
356 work->requestedExit = exitBefore;
357 } else {
358 work->requestedExit = exitAfter;
359 }
361}
362
363/// Chooses a passage exit from the leader's north-south approach.
364static void WorldMap_SelectExitByZ(s32 trigger, s32 exitBefore, s32 exitAfter) {
365 struct EventWork *work;
366 struct FieldActor *subject;
367 struct FieldActor *other;
368
369 subject = Object_GetById(trigger - CONTACT_TRIGGER_BASE);
372 if (other->z.fixed < subject->z.fixed) {
373 work->requestedExit = exitBefore;
374 } else {
375 work->requestedExit = exitAfter;
376 }
378}
379
380/// Walking into a passage: the side the party comes from decides which exit
381/// takes it through to the other side.
382/// Reached by walking onto cell code 130.
384 WorldMap_SelectExitByX(0x82, 6, 0x2F);
385}
386
387/// As Event_PassThroughWestEastPassage, for a passage crossed north to south.
388/// Reached by walking onto cell code 150.
390 WorldMap_SelectExitByZ(0x96, 0x2E, 0x0B);
391}
392
393/// As Event_PassThroughFirstNorthSouthPassage.
394/// Reached by walking onto cell code 116.
396 WorldMap_SelectExitByZ(0x74, 0x38, 0x15);
397}
398
399/// As Event_PassThroughFirstNorthSouthPassage.
400/// Reached by walking onto cell code 151.
402 WorldMap_SelectExitByZ(0x97, 0x19, 0x36);
403}
404
405/// As Event_PassThroughFirstNorthSouthPassage.
406/// Reached by walking onto cell code 125.
408
409 WorldMap_SelectExitByZ(0x7D, 0x3B, 0x1E);
410}
411
412const struct SceneEvent *WorldMap_GetEvents(void) { return gWorldMapEvents; }
413
414/// Culls distant location sprites and detects the leader touching nearby ones.
415/// Run each frame on the world map; WorldMap_Initialize adds it.
417 struct FieldActor *leader;
418 struct EventWork *work;
419 struct FieldActor *actor;
420 s32 left;
421 s32 right;
422 s32 top;
423 s32 bottom;
424 s32 leaderReach;
425 u32 i;
426
428 leaderReach = leader->sprite->scale * leader->radius;
430 actor = work->viewCenter;
431 left = actor->x.fixed - PIXELS(160);
432 right = actor->x.fixed + PIXELS(160);
433 top = actor->z.fixed - PIXELS(300);
434 bottom = actor->z.fixed + PIXELS(200);
435
436 for (i = ACTOR_FIRST_PLACED; i <= CONTACT_LAST_ACTOR; i++) {
437 s32 x;
438 s32 z;
439 s32 dx;
440 s32 reach;
441 s32 scale;
442
443 actor = Engine_ActorLookup(i);
444 if (actor == NULL) {
445 continue;
446 }
447 x = actor->x.fixed;
448 z = actor->z.fixed;
449 if (x < left || x > right || z < top || z > bottom) {
450 actor->spriteStorageKind = 0;
451 continue;
452 }
453 actor->spriteStorageKind = 1;
455 continue;
456 }
457 scale = actor->sprite->scale;
458 dx = actor->x.fixed - leader->x.fixed;
459 if (dx < 0) {
460 dx = leader->x.fixed - actor->x.fixed;
461 }
462 reach = leaderReach + actor->radius * scale;
463 if (dx + (actor->z.fixed - leader->z.fixed < 0
464 ? leader->z.fixed - actor->z.fixed
465 : actor->z.fixed - leader->z.fixed) <
466 reach &&
468 work->touchedTrigger = i + CONTACT_TRIGGER_BASE;
469 }
470 }
471}
472
473/// Walking onto this spot: the first time the travel scene plays, later it is
474/// an ordinary entrance.
475/// Reached by walking onto cell code 112.
476static void Event_EnterTransferRoute(void) {
479 } else {
482 }
483}
484
485/// Walking east off this edge of the map, once allowed.
486/// Reached by walking east into cell code 74 once the Tolbi ship lies at
487/// anchor off the island (FLAG_TOLBI_SHIP_AT_ISLAND).
488static void Event_LeaveEastward(void) {
489
492}
493
494/// Restores the map's state and runs the sequence its arrival entrance
495/// selects: 90 and 91 carry the party from a lighthouse's beam up to its
496/// aerie, 1 marks the first time the party leaves Vale, 33 the Black Orb, 49
497/// Bunza's wagon, 64 the travellers' departure, 65 to 70 the Tolbi ship's
498/// crossing, 71 the carriage, 78 a discarded item,
499/// 72 and 73 the transitions, 75 the travelling actor, 80 the ending, and 74,
500/// 76 and 77 resume airborne travel.
501/// The scene's initialization. Sets FLAG_RETREAT_BLOCKED on the map; entrance
502/// 99, a debug start, sets FLAG_NO_ENCOUNTERS, FLAG_DEBUG_STEPS_OFF and flag
503/// 0x161. Entrance 1 sets FLAG_PARTY_LEFT_VALE and flag 0x85c the first time.
504/// XXX: flags 0x161 and 0x85c are read by no code of this game; a reader would
505/// say what they record.
507 struct GameState *state = &gGameState;
508 s16 *entrance = &state->entrance;
509
510 if (*entrance == 99) {
512 Engine_GameFlagSet(0x161);
514 }
515 if (*entrance == 90) {
518 } else if (*entrance == 91) {
521 } else if (*entrance == 78) {
525 } else {
534 FieldMap_SetWindowCellTile(128, 256, 176, 56);
535 }
536 // Each special entrance resumes its travel or story sequence.
537 switch (*entrance) {
538 case 1:
541 Engine_GameFlagSet(0x85c);
542 }
543 break;
544 case 33:
549 Actor_SetPosition(55, PIXELS(6036), PIXELS(3400));
553 }
556 0) {
558 }
559 break;
560 case 49:
564 }
565 break;
566 case 64:
569 }
570 break;
571 case 65:
573 break;
574 case 66:
576 break;
577 case 67:
579 break;
580 case 68:
582 break;
583 case 69:
585 break;
586 case 70:
588 break;
589 case 71:
591 break;
592 case 72:
594 break;
595 case 73:
597 break;
598 case 74:
599 case 76:
600 case 77:
605 }
606 break;
607 case 75:
609 break;
610 case 80:
612 break;
613 default:
614 Object_GetById(53)->scaleX = 5 * Q16_ONE / 4;
615 Object_GetById(53)->scaleY = 5 * Q16_ONE / 4;
616 break;
617 }
618 }
619 return 0;
620}
621
622/// The actors placed at entrance 49: Bunza's wagon, Bunza and Hammet.
623enum { ACTOR_WAGON = 8, ACTOR_BUNZA = 11, ACTOR_HAMMET = 12 };
624
625/// Out of West Lunpa Cave by wagon: Bunza and Hammet nod to each other and
626/// climb aboard with the hero, and the wagon rolls off.
627/// Called by WorldMap_Initialize at entrance 49, after the trade reopens
628/// (FLAG_LUNPA_TRADE_REOPENED) and until the wagon has left; sets
629/// FLAG_BUNZAS_WAGON_LEFT.
630static void WorldMap_BoardBunzasWagon(void) {
631 struct FieldActor *record;
632
650 Engine_EventWait(120);
654 record = Object_GetById(ACTOR_WAGON);
655 if (record != 0) {
657 record->z.part.pixel);
658 }
663 record = Object_GetById(ACTOR_WAGON);
664 if (record != 0) {
665 Actor_SetDestination(ACTOR_BUNZA, record->x.part.pixel,
666 record->z.part.pixel);
667 }
672 record = Object_GetById(ACTOR_WAGON);
673 if (record != 0) {
675 record->z.part.pixel);
676 }
680 Actor_SetSpeed(ACTOR_WAGON, PIXELS(1) / 2, PIXELS(1) / 4);
690}
691
692/// Stages the travelers' departure and their transfer to the next scene.
693/// Called by WorldMap_Initialize at entrance 64 until FLAG_GUARDS_SUSPECT_KALAY
694/// is set; sets it.
696 struct FieldActor *actor;
697 struct FieldActor *spriteActor;
698 const s32 *action;
699
700 actor = Object_GetById(15);
707 Camera_MoveTo(-1, -1, -1, 0);
710 Actor_SetSpeed(GARET, PIXELS(8) / 5, PIXELS(4) / 5);
713 Actor_SetPosition(8, PIXELS(5848), PIXELS(1576));
715 Actor_SetChildValue(8, 15);
716 spriteActor = Actor_Get(8);
717 Engine_ActorSetSpriteFlags(spriteActor, 0);
718 Actor_SetSpeed(10, PIXELS(8) / 5, PIXELS(2) / 5);
719 Actor_SetSpeed(11, PIXELS(8) / 5, PIXELS(2) / 5);
720 Actor_SetSpeed(12, PIXELS(8) / 5, PIXELS(2) / 5);
721 Actor_SetSpeed(13, PIXELS(8) / 5, PIXELS(2) / 5);
731 spriteActor = Object_GetById(ACTOR_PARTY_LEADER);
732 if (spriteActor != 0) {
733 Actor_SetPosition(GARET, spriteActor->x.fixed, spriteActor->z.fixed);
734 }
735 Actor_WalkToAndWait(GARET, 5892, 1600);
740 Actor_SetPosition(8, PIXELS(5848), PIXELS(1592));
742 // The travelers decide to depart; gather the actors for the transfer.
743 Engine_EventSetMessage(MsgWorldMapWeCantStayAnotherMinute);
744 Event_ShowMessageAndWait(8, 0, 10);
768 Camera_MoveTo(PIXELS(5640), -1, PIXELS(1784), 1);
772 Actor_SetPosition(9, PIXELS(5640), PIXELS(1752));
774 Actor_SetSpeed(9, PIXELS(6) / 5, PIXELS(3) / 5);
775 Actor_WalkToAndWait(9, 5640, 1736);
776 Actor_WalkToAndWait(9, 5624, 1736);
777 Actor_WalkToAndWait(9, 5624, 1784);
783 Actor_FaceDirection(9, 0, 20);
785 Event_ShowMessageAndWait(9, 0, 20);
786 Actor_SetPosition(8, PIXELS(5656), PIXELS(1784));
789 spriteActor = Actor_Get(8);
790 Engine_ActorSetSpriteFlags(spriteActor, 1);
791 Actor_SetSpeed(8, PIXELS(4) / 5, PIXELS(2) / 5);
792 Actor_WalkToAndWait(8, 5640, 1784);
807 Actor_FaceDirection(9, 0, 10);
808 Event_ShowMessageAndWait(9, 0, 10);
815 Event_ShowMessageAndWait(9, 0, 20);
820 // Focus on the departure effect before moving the group to the landing.
826 Actor_FaceDirection(9, 0, 40);
829 Camera_SetSpeed(PIXELS(1), PIXELS(1) / 8);
830 Camera_MoveTo(PIXELS(5608), -1, PIXELS(1736), 1);
832 Actor_SetPosition(14, PIXELS(5544), PIXELS(1704));
834 Actor_SetSpeed(14, PIXELS(3) / 10, PIXELS(3) / 20);
836 Engine_EventWait(160);
837 // Stage the guide and the transferred actor's landing motion.
838 actor->gravity = PIXELS(1) / 10;
839 actor->bounce = PIXELS(1) / 10;
840 actor->scaleX = 3 * Q16_ONE / 2;
841 actor->scaleY = 3 * Q16_ONE / 2;
842 actor->timer = 0;
843 actor->y.fixed = PIXELS(64);
844 actor->sprite->rotation = 0xf000;
846 Object_SetMode(actor, 2);
848 spriteActor = Actor_Get(15);
849 Engine_ActorSetSpriteFlags(spriteActor, 0);
851 do {
853 } while (actor->timer == 0);
854 spriteActor = Actor_Get(15);
855 Engine_ActorSetSpriteFlags(spriteActor, 0);
856 spriteActor = Actor_Get(14);
857 Engine_ActorSetSpriteFlags(spriteActor, 0);
859 spriteActor = Actor_Get(9);
860 spriteActor->velocityY = PIXELS(6);
861 spriteActor = Object_GetById(8);
862 spriteActor->velocityY = PIXELS(6);
868 Camera_SetSpeed(PIXELS(2), PIXELS(1) / 4);
869 Camera_MoveTo(PIXELS(5640), -1, PIXELS(1784), 1);
877 Actor_SetPosition(14, 0, 0);
878 Actor_SetPosition(15, 0, 0);
880 Engine_ActorJump(8, 4, 40);
882 Actor_FaceDirection(9, 0, 10);
883 Event_ShowMessageAndWait(9, 0, 20);
886 Engine_ActorJump(9, 4, 20);
887 Event_ShowMessageAndWait(9, 0, 10);
897 Actor_WalkToAndWait(8, 5656, 1784);
898 Actor_SetPosition(8, 0, 0);
899 Actor_WalkToAndWait(9, 5624, 1736);
900 Actor_WalkToAndWait(9, 5640, 1736);
901 Actor_WalkToAndWait(9, 5640, 1752);
902 Actor_SetPosition(9, 0, 0);
912 Actor_SetPosition(GARET, PIXELS(5908), PIXELS(1600));
913 Camera_SetSpeed(PIXELS(4), PIXELS(1) / 2);
914 Camera_MoveTo(PIXELS(5848), -1, PIXELS(1608), 1);
916 action = gTransferGather;
917 Actor_SetActionScript(10, action);
919 Camera_SetSpeed(PIXELS(2) / 5, PIXELS(1) / 20);
920 Camera_MoveTo(PIXELS(5848), -1, PIXELS(1544), 1);
921 Actor_SetActionScript(11, action);
923 Actor_SetActionScript(12, action);
927 Actor_SetActionScript(13, action);
933 Camera_SetSpeed(PIXELS(4), PIXELS(1) / 2);
934 Camera_MoveTo(PIXELS(5880), -1, PIXELS(1608), 1);
942 spriteActor = Object_GetById(ACTOR_PARTY_LEADER);
943 if (spriteActor != 0) {
944 Actor_SetDestination(GARET, spriteActor->x.part.pixel,
945 spriteActor->z.part.pixel);
946 }
949 Camera_SetSpeed(PIXELS(4) / 5, PIXELS(1) / 10);
950 Camera_MoveTo(PIXELS(5848), -1, PIXELS(1608), 1);
958}
959
960/// Moves to the next camera-shake point and holds it for four frames.
961static inline void WorldMap_MoveShakeCamera(s32 x, s32 z) {
962 Camera_MoveTo(x, -1, z, 1);
964}
965
966/// Shakes the camera around the departure point.
980}
981
982/// Shakes the camera around the landing point.
996}
997
998/// Keeps the transferred actor above the guide and triggers its landing once.
999/// Run each frame while WorldMap_DepartWithTravelers carries an actor; sets
1000/// FLAG_SCENE_TEMP_00 as it lands.
1002 struct FieldActor *actor;
1003 struct FieldActor *guide;
1004
1005 actor = Object_GetById(15);
1006 guide = Object_GetById(14);
1007 actor->x.fixed = guide->x.fixed;
1008 actor->z.fixed = guide->z.fixed;
1009 if (actor->y.fixed < PIXELS(10)) {
1010 actor->y.fixed = PIXELS(10);
1013 Object_SetMode(actor, 3);
1015 actor->timer = 1;
1016 }
1017 }
1018}
1019
1020/// Stages the next leg of travel and leaves through exit 102.
1021/// Called by WorldMap_Initialize at entrance 65; sets FLAG_TOLBI_SHIP_ROWING.
1023 struct FieldActor *actor;
1024
1025 actor = Object_GetById(8);
1027 Camera_MoveTo(-1, -1, -1, 0);
1028 Engine_TaskWait(1);
1030 actor->scaleY = 5 * Q16_ONE / 4;
1031 actor->scaleX = 5 * Q16_ONE / 4;
1034 Actor_SetSpeed(8, PIXELS(2) / 5, PIXELS(1) / 5);
1035 Actor_WalkToAndWait(8, 5288, 2328);
1041}
1042
1043/// Stages the next leg of travel and leaves through exit 103.
1044/// Called by WorldMap_Initialize at entrance 66; sets FLAG_TOLBI_SHIP_ROWING.
1046 struct FieldActor *actor;
1047
1048 actor = Object_GetById(8);
1050 Camera_MoveTo(-1, -1, -1, 0);
1051 Engine_TaskWait(1);
1053 Actor_SetPosition(8, PIXELS(7944), PIXELS(200));
1054 actor->scaleX = 5 * Q16_ONE / 4;
1055 actor->scaleY = 5 * Q16_ONE / 4;
1056 Engine_TaskWait(1);
1059 Actor_SetSpeed(8, PIXELS(3) / 5, PIXELS(3) / 10);
1060 actor->timer = 0;
1062 do {
1063 Engine_TaskWait(1);
1064 } while (actor->timer == 0);
1070}
1071
1072/// Stages the next leg of travel and leaves through exit 104.
1073/// Called by WorldMap_Initialize at entrance 67; sets FLAG_TOLBI_SHIP_ROWING.
1075 struct FieldActor *actor;
1076
1077 actor = Object_GetById(8);
1079 Camera_MoveTo(-1, -1, -1, 0);
1080 Engine_TaskWait(1);
1082 Actor_SetPosition(8, PIXELS(7944), PIXELS(200));
1083 actor->scaleX = 5 * Q16_ONE / 4;
1084 actor->scaleY = 5 * Q16_ONE / 4;
1085 Engine_TaskWait(1);
1088 Actor_SetSpeed(8, PIXELS(3) / 5, PIXELS(3) / 10);
1089 actor->timer = 0;
1091 do {
1092 Engine_TaskWait(1);
1093 } while (actor->timer == 0);
1099}
1100
1101/// Stages the travelers' arrival in the ship interior.
1102/// Called by WorldMap_Initialize at entrance 68; sets FLAG_TOLBI_SHIP_ROWING.
1104 struct FieldActor *actor;
1105
1106 actor = Object_GetById(8);
1108 Camera_MoveTo(-1, -1, -1, 0);
1109 Engine_TaskWait(1);
1111 Actor_SetPosition(8, PIXELS(7944), PIXELS(200));
1112 actor->scaleX = 5 * Q16_ONE / 4;
1113 actor->scaleY = 5 * Q16_ONE / 4;
1114 Engine_TaskWait(1);
1117 Actor_SetSpeed(8, PIXELS(3) / 5, PIXELS(3) / 10);
1118 actor->timer = 0;
1120 do {
1121 Engine_TaskWait(1);
1122 } while (actor->timer == 0);
1128}
1129
1130/// Stages the next leg of travel and leaves through exit 106.
1131/// Called by WorldMap_Initialize at entrance 69; sets FLAG_TOLBI_SHIP_ROWING.
1133 struct FieldActor *actor;
1134
1135 actor = Object_GetById(8);
1137 Camera_MoveTo(-1, -1, -1, 0);
1138 Engine_TaskWait(1);
1140 Actor_SetPosition(8, PIXELS(7944), PIXELS(200));
1141 actor->scaleX = 5 * Q16_ONE / 4;
1142 actor->scaleY = 5 * Q16_ONE / 4;
1143 Engine_TaskWait(1);
1146 Actor_SetSpeed(8, PIXELS(3) / 5, PIXELS(3) / 10);
1147 actor->timer = 0;
1150 } else {
1152 }
1153 do {
1154 Engine_TaskWait(1);
1155 } while (actor->timer == 0);
1161}
1162
1163/// Finishes the journey and restores the leader's movement.
1164/// Called by WorldMap_Initialize at entrance 70; sets
1165/// FLAG_TOLBI_SHIP_REACHED_TOLBI and clears FLAG_TOLBI_SHIP_ROWING.
1166static void WorldMap_CompleteTransfer(void) {
1167 struct FieldActor *actor;
1168
1169 actor = Object_GetById(8);
1171 Camera_MoveTo(-1, -1, -1, 0);
1172 Engine_TaskWait(1);
1174 Actor_SetPosition(8, PIXELS(5096), PIXELS(2328));
1175 actor->scaleY = 5 * Q16_ONE / 4;
1176 actor->scaleX = 5 * Q16_ONE / 4;
1177 Engine_TaskWait(1);
1180 Actor_SetSpeed(8, PIXELS(2) / 5, PIXELS(1) / 5);
1181 Actor_WalkToAndWait(8, 5064, 2328);
1188}
1189
1190/// Demonstrates setting a Djinni and placing it on standby.
1191/// Called by Event_MeetFlint; sets and clears FLAG_DJINN_TUTORIAL_PART_A and
1192/// _PART_B to choose the menu's two lessons.
1199 Engine_EventSetMessage(MsgWorldMapAfterBringingDjinniIntoYour);
1201 Engine_EventWait(30);
1208 Engine_EventSetMessage(MsgWorldMapNextIllShowHowCan);
1213 Engine_EventWait(30);
1215}
1216
1217/// Walking up to Flint: he joins the party and shows how Djinn are set and put
1218/// on standby; then comes the tutorial battle.
1219/// Reached by walking onto cell code 90 until Flint (Djinni 0) is caught. Sets
1220/// FLAG_DJINN_TUTORIAL and its two part flags for each lesson, and clears them
1221/// all after the battle.
1222static void Event_MeetFlint(void) {
1223 struct FieldActor *djinni;
1224 struct FieldActor *leader;
1225 s32 x;
1226 s32 z;
1227 s32 count;
1228 s32 i;
1229
1230 count = 0;
1233 x = (leader->x.fixed - PIXELS(5584)) / 2 + PIXELS(5584);
1234 z = (leader->z.fixed - PIXELS(1328)) / 2 + PIXELS(1328);
1235 // Introduce the Djinni and demonstrate how it joins the party.
1239 Event_Begin();
1240 leader = Actor_Get(ACTOR_PARTY_LEADER);
1241 if (leader != 0)
1243 Djinn_AddToOwner(0, 0, 0);
1244 DjinnRecovery_AddStandby(0, 0, 0);
1247 Event_Wait(10);
1249 djinni->work = 1;
1251 Task_Wait(16);
1252 Event_SetMessage(MsgWorldMapOh);
1258 djinni->motionFlags = 2;
1259 djinni->gravity = PIXELS(1) / 4;
1260 djinni->speed = PIXELS(1);
1261 djinni->acceleration = PIXELS(1);
1262 djinni->velocityY = 0;
1263 djinni->terrainHeight = 0;
1264 FieldObject_SetPosition(djinni, PIXELS(5584), 0, PIXELS(1328));
1265 for (i = 0; i < 16; i++) {
1266 djinni->scaleX += Q16_ONE / 32;
1267 djinni->scaleY += Q16_ONE / 32;
1268 Task_Wait(1);
1269 }
1272 Task_Wait(16);
1273 djinni->update = 0;
1275 djinni->gravity = PIXELS(1);
1278 Engine_PsynergyBegin(140, 0);
1279 for (i = 59; i >= 0; i--) {
1280 if (gFrameCount & 2)
1282 else
1284 if ((gFrameCount & 15) == 0)
1286 Task_Wait(1);
1287 }
1300 UiWork_PushValueSlot(300, 4);
1308 i = 0;
1309 djinni->motionFlags = 0;
1310 FieldObject_SetPosition(djinni, x, PIXELS(16), z);
1311 for (; i < 16; i++) {
1312 djinni->facing += FACING_STEP;
1313 Task_Wait(1);
1314 }
1317 djinni->motionFlags = 2;
1318 djinni->velocityY = 0;
1319 djinni->terrainHeight = 0;
1320 for (i = 7; i >= 0; i--) {
1321 djinni->facing += FACING_STEP;
1322 Task_Wait(1);
1323 }
1332 // Each "No" makes Flint plead again; the seventh time he gives up asking.
1333 count = 0;
1334 plead:
1335 if (Event_ChooseYesNo(0, 0) == 1) {
1338 if (count == 6) {
1339 Event_SetMessage(MsgWorldMapMeanieDontCare);
1341 goto listened;
1342 }
1343 Event_SetMessage(count + MsgWorldMapComePromiseWont);
1345 count++;
1346 goto plead;
1347 }
1351 Event_SetMessage(MsgWorldMapSeeWontRegret);
1353 listened:
1354 UiWork_PushValueSlot(300, 4);
1356 count = MsgWorldMapAbilityVenusDjinni;
1357 Message_ShowCentered(count++, 3);
1358 Event_SetMessage(count);
1364 return;
1365 }
1366 Event_Begin();
1368 if (leader != 0)
1370 djinni->velocityY = PIXELS(10);
1371 FieldObject_SetPosition(djinni, x, 0, z);
1372 Event_Wait(30);
1377 // Offer the tutorial again, then demonstrate setting and standby.
1378 Event_SetMessage(MsgWorldMapSeeDjinnUseful);
1389 Event_SetMessage(MsgWorldMapGoSetStandby);
1390 FieldObject_SetPosition(djinni, PIXELS(5584), 0, PIXELS(1328));
1391 Event_Wait(30);
1396 if (Event_ChooseYesNo(0, 0) == 1) {
1399 Event_SetMessage(MsgWorldMapHmmmmExplainAgain);
1401 if (Event_ChooseYesNo(0, 0) != 1) {
1406 return;
1407 }
1408 }
1410 Event_SetMessage(MsgWorldMapYeahWantLearn);
1424 Event_End();
1428}
1429
1431
1432/// Brings the carriage to a stop and lets Isaac disembark.
1433/// Called by WorldMap_Initialize at entrance 71.
1435 struct FieldActor *actor;
1436
1437 actor = Object_GetById(10);
1439 Camera_MoveTo(-1, -1, -1, 0);
1440 Engine_TaskWait(1);
1442 Engine_TaskWait(1);
1443 actor->scaleX = 3 * Q16_ONE / 2;
1444 actor->scaleY = 3 * Q16_ONE / 2;
1445 actor->facing = FACING_SOUTH;
1448 Engine_EventWait(20);
1449 Actor_SetPosition(10, PIXELS(5480), PIXELS(2104));
1450 Engine_TaskWait(1);
1452 Actor_SetSpeed(10, PIXELS(8) / 5, PIXELS(2) / 5);
1454 Actor_MoveToAndWait(10, 5485, 2136);
1455 Camera_SetSpeed(PIXELS(2) / 5, PIXELS(1) / 20);
1456 Camera_MoveTo(PIXELS(5560), -1, PIXELS(2136), 1);
1457 Actor_MoveToAndWait(10, 5534, 2136);
1458 Actor_MoveToAndWait(10, 5544, 2158);
1459 Actor_MoveToAndWait(10, 5608, 2168);
1462 Engine_EventWait(20);
1464 Engine_TaskWait(1);
1471 Actor_MoveToAndWait(10, 5624, 2168);
1473 Actor_MoveToAndWait(10, 5624, 2104);
1475 Actor_MoveToAndWait(10, 5565, 2104);
1476 Actor_MoveToAndWait(10, 5560, 2131);
1478 Actor_MoveToAndWait(10, 5490, 2136);
1479 Actor_MoveToAndWait(10, 5480, 2104);
1480 Actor_SetPosition(10, 0, 0);
1482 Engine_EventWait(40);
1483 Camera_MoveTo(PIXELS(5592), -1, PIXELS(2136), 1);
1490}
1491
1492/// Introduces the Black Orb and prompts Isaac to use it on the ship.
1493/// Called by WorldMap_Initialize at entrance 33 until the Black Orb is handed
1494/// back and before the wounded soldiers are seen in Lalivero
1495/// (FLAG_LALIVERO_WOUNDED_SOLDIERS_SEEN). Sets FLAG_SCENE_TEMP_34 and
1496/// FLAG_SAW_SHIP_FROM_VENUS_LIGHTHOUSE, and turns the exit at cell code 138
1497/// into Event_StopLeavingShip.
1498static void WorldMap_RunBlackOrbScene(void) {
1499 struct FieldActor *leader;
1500
1508 if (leader != NULL) {
1510 leader->z.fixed);
1511 }
1517 Engine_EventSetMessage(MsgWorldMapLook);
1519 0, 10);
1524 Engine_CameraMoveTo(PIXELS(6024), -1, PIXELS(3432), 1);
1526 Engine_EventWait(40);
1529 Engine_EventWait(60);
1538 Engine_EventWait(20);
1541 while (Object_GetById(ACTOR_PARTY_LEADER)->timer == 0) {
1542 Engine_TaskWait(1);
1543 }
1555 Engine_EventWait(20);
1560 Engine_ItemShowFound(242, 3);
1563 Engine_EventSetMessage(MsgWorldMapNowUseOnShip);
1569 Engine_EventWait(20);
1575}
1576
1577/// Turns the exit at cell code 138 into a touch event that runs
1578/// Event_StopLeavingShip, and places the Black Orb's giver (sprite 57) at
1579/// pixel (6036, 3400).
1580/// Called by WorldMap_RunBlackOrbScene, and by WorldMap_Initialize when the
1581/// party returns to entrance 33 with the orb still to use.
1582static void WorldMap_ActivateSite138(s32 actor) {
1583 s32 i;
1584
1585 i = 0;
1586 while (1) {
1587 if (gWorldMapEvents[i].control == EVENT_EXIT &&
1588 gWorldMapEvents[i].trigger == 138) {
1591 }
1592 if (gWorldMapEvents[i].control == SCENE_EVENTS_END)
1593 break;
1594 i++;
1595 }
1596 for (i = 0;; i++) {
1597 if (gWorldMapPlacements[i].sprite == 57) {
1598 gWorldMapPlacements[i].x = PIXELS(6036);
1599 gWorldMapPlacements[i].z = PIXELS(3400);
1601 return;
1602 }
1603 }
1604}
1605
1606/// Makes cell code 138 an exit again, to exit 33.
1607/// Called by Event_UseBlackOrb once the orb is handed back.
1609 s32 i;
1610
1611 i = 0;
1612 while (1) {
1613 if (gWorldMapEvents[i].control == EVENT_TOUCH &&
1614 gWorldMapEvents[i].trigger == 138) {
1616 gWorldMapEvents[i].value = 33;
1617 break;
1618 }
1619 if (gWorldMapEvents[i].control == SCENE_EVENTS_END)
1620 break;
1621 i++;
1622 }
1623}
1624
1625/// Talking to the one who gave the Black Orb (or reading his mind): he urges
1626/// its use. "Now use it... on the ship."
1627/// Reached by talking to actor 55, or by Mind Read on it.
1628static void Event_TalkAboutBlackOrb(void) {
1631 Engine_EventSetMessage(MsgWorldMapNowUseOnShip);
1635}
1636
1637/// Walking away from the shipwreck with the Black Orb: the hero walks back.
1638/// "(Hero), where you going? I said to use the Orb on Babi's ship!"
1639/// Reached by walking onto cell code 138 while WorldMap_ActivateSite138 has
1640/// made it a touch event.
1641static void Event_StopLeavingShip(void) {
1644 Engine_EventSetMessage(MsgWorldMapIsaacWhereGoingSaidUse);
1650}
1651
1652/// Searching the shipwreck. "The wreckage of a ship scuttled off the coast."
1653/// Reached by searching cell code 96.
1654static void Event_SearchShipwreck(void) {
1655
1657#if !TBS_PATCH_3
1659#endif
1660 Engine_MessageShowCentered(MsgWorldMapWreckageShipScuttledOffCoast, 1);
1662 gEventWork->unk172 = 1;
1663 }
1664#if !TBS_PATCH_3
1666#endif
1668}
1669
1670#define SITE 55
1671
1672/// Using the Black Orb on the shipwreck: nothing happens, the orb is taken back
1673/// and the party is to press on to Babi Lighthouse.
1674/// Reached by using the Black Orb on cell code 96 until it is handed back.
1675/// Clears FLAG_SCENE_TEMP_34 and sets FLAG_BLACK_ORB_RETURNED.
1676static void Event_UseBlackOrb(void) {
1677 struct FieldActor *site;
1678 struct FieldActor *orb;
1679 struct FieldActor *leader;
1680 struct FieldActor *actor;
1681 s32 message;
1682 struct AnimationObject *sprite;
1683 u8 *buffer;
1684
1685 leader = Actor_Get(ACTOR_PARTY_LEADER);
1686 Event_Begin();
1689 Camera_SetSpeed(PIXELS(3), PIXELS(3) / 8);
1690 Camera_MoveTo(PIXELS(6024), -1, PIXELS(3432), 1);
1692 site = NULL;
1694 leader->paused = 0;
1695 ObjectDispatch_StartIdle((struct DispatchObject *)leader);
1696 if (leader->z.fixed > PIXELS(3432)) {
1697 if (leader->x.fixed > PIXELS(5998)) {
1698 FieldObject_SetPosition(leader, PIXELS(5998), leader->y.fixed,
1699 PIXELS(3453));
1701 }
1702 } else if (leader->x.fixed > PIXELS(6010)) {
1703 // BUG: site is NULL here; this branch reads its height through null.
1704 FieldObject_SetPosition(leader, PIXELS(6010), site->y.fixed, PIXELS(3400));
1706 }
1707 FieldObject_SetPosition(leader, PIXELS(5993), 0, PIXELS(3432));
1713 Event_Wait(20);
1715 // Present the orb icon before its sparks and the ship's response.
1716 orb = Object_Create(22, leader->x.fixed + PIXELS(2), PIXELS(38),
1717 leader->z.fixed);
1718 if (orb != NULL) {
1719 u8 *motion;
1720
1721 orb->motionFlags = 0;
1722 sprite = orb->sprite;
1723 sprite->flags = 0;
1724 sprite->count = 0;
1725 sprite->image.fullColor = 0;
1726 sprite->image.palette = 0;
1727 /* FAKEMATCH: a second clear through a byte pointer, removed after reload,
1728 * keeps the zero in r1 and the address in r0, as native; as plain stores,
1729 * 20 instructions differ in tbs-en. */
1730 motion = &orb->motionFlags;
1731 *motion = 0;
1732 buffer = Heap_Allocate(17, 0x608);
1734 Vram_Load(sprite->slot, 128, buffer + 0x400);
1735 Heap_Release(17);
1736 Event_Wait(20);
1738 Event_Wait(80);
1739 }
1744 message = MsgWorldMapMatter;
1745 Event_SetMessage(message);
1747 if (orb != NULL) {
1749 }
1751 Event_Wait(40);
1760 20);
1764 site = Actor_Get(SITE);
1765 FieldObject_SetPosition(site, PIXELS(6010), site->y.fixed, PIXELS(3400));
1767 FieldObject_SetPosition(site, PIXELS(6001), 0, PIXELS(3416));
1773 20);
1777 FieldObject_SetPosition(site, PIXELS(5997), 0, PIXELS(3424));
1780 Event_Wait(10);
1782 FieldObject_SetPosition(site, PIXELS(6001), 0, PIXELS(3416));
1785 Message_ShowCentered(message + 6, 1);
1788 Event_Wait(20);
1795 if (actor != NULL) {
1797 actor->z.part.pixel);
1798 }
1803 Event_Wait(20);
1808 Event_End();
1809}
1810
1811enum {
1817};
1818
1820
1821#define WORLD_MAP_QUEUE_TRANSITION_FRAME(buffer, offset) \
1822 IO_WRITE_QUEUE_PUSH(0x06002000, (u32)((buffer) + (offset)), 0x84000140)
1823
1824/// Shows Jenna and Kraden's closing scene before returning to the title.
1825/// Called by WorldMap_Initialize at entrance 80.
1826static void WorldMap_ShowEndingScene(void) {
1830 Camera_MoveTo(-1, -1, -1, 0);
1834 Engine_TaskWait(1);
1842 Engine_EventWait(40);
1844 Engine_EventWait(20);
1845 // Jenna and Kraden discuss the island before their guide arrives.
1846 Engine_EventSetMessage(MsgWorldMapKradenHowLongWillIsland);
1849 Engine_EventWait(20);
1850 Event_ShowMessageAndWait(8, 0, 20);
1853 Actor_ShowEmote(8, EMOTE_IN_FRONT | 5, 80);
1854 Event_ShowMessageAndWait(8, 0, 10);
1857 Actor_ShowEmote(8, EMOTE_IN_FRONT | 5, 100);
1860 Event_ShowMessageAndWait(8, 0, 10);
1864 Engine_EventWait(80);
1865 Event_ShowMessageAndWait(8, 0, 20);
1867 Event_ShowMessageAndWait(8, 0, 120);
1870 Event_ShowMessageAndWait(8, 0, 20);
1873 // Bring the guide into the conversation and lead the group onward.
1874 Actor_SetSpeed(9, PIXELS(2) / 5, PIXELS(1) / 5);
1875 Actor_SetPosition(9, PIXELS(7644), PIXELS(3460));
1876 Actor_WalkToAndWait(9, 7572, 3468);
1877 Actor_WalkToAndWait(9, 7560, 3488);
1878 Engine_EventWait(20);
1879 Event_ShowMessageAndWait(0x6009, 0, 20);
1883 Event_ShowMessage(0x6009, 0);
1885 Engine_EventWait(20);
1887 Engine_EventWait(80);
1889 Engine_ActorJump(8, 4, 40);
1891 Engine_ActorJump(JENNA, 4, 60);
1894 Actor_SetSpeed(8, PIXELS(3) / 5, PIXELS(3) / 10);
1895 Actor_SetSpeed(JENNA, PIXELS(3) / 5, PIXELS(3) / 10);
1897 Engine_EventWait(20);
1898 Camera_SetSpeed(PIXELS(7) / 10, PIXELS(7) / 80);
1899 Camera_MoveTo(PIXELS(7736), -1, PIXELS(3528), 1);
1901 do {
1904 Engine_TaskWait(1);
1905 } while (Object_GetById(5)->timer == 0);
1906 Engine_EventWait(20);
1910 Engine_EventWait(40);
1912 Event_ShowTwoMessagesAndWait(5, 7, 13, 2, 12, 8, 9, 4, 4, 3, 0);
1913 Engine_EventWait(20);
1915 Camera_SetSpeed(PIXELS(1), PIXELS(1) / 8);
1916 Camera_MoveTo(PIXELS(7768), -1, PIXELS(3528), 1);
1918 Actor_SetSpeed(8, PIXELS(8) / 5, PIXELS(4) / 5);
1919 Actor_SetSpeed(JENNA, PIXELS(8) / 5, PIXELS(4) / 5);
1920 Actor_WalkTo(8, 7804, 3512);
1921 Actor_WalkToAndWait(JENNA, 7788, 3544);
1924 Engine_EventWait(80);
1926 Event_ShowMessageAndWait(8, 0, 20);
1931 Event_ShowMessageAndWait(8, 0, 60);
1936 Engine_TaskWait(120);
1938}
1939
1940/// Starts the sparkling travel transition and fades out to its destination.
1941/// Called by WorldMap_Initialize at entrance 73; sets FLAG_KEEP_MUSIC.
1948 Engine_TaskWait(2);
1954 Engine_TaskWait(1);
1956 {
1957 s32 transitionDelay = 3200;
1959 FieldScheduler_AddCallback(transitionCallback, transitionDelay);
1960 }
1965 Engine_EventWait(240);
1968 Engine_TaskWait(90);
1972}
1973
1974/// Scatters transition particles and jitters the camera.
1978 struct FieldActor *object;
1979
1983 if (object != NULL) {
1984 struct AnimationObject *sprite = object->sprite;
1985 s32 scale = (((u32)Engine_RandomNext() << 15) >> 16) + 6 * Q16_ONE / 5;
1986
1987 sprite->flags = 0;
1988 sprite->image.priority = 2;
1989 object->motionFlags = 0;
1990 object->scaleX = scale;
1991 object->scaleY = scale;
1992 Object_SetMode(object, 1);
1994 }
1995 if (gFrameCount % 3 == 0) {
1996 switch (((u32)Engine_RandomNext() << 2) >> 16) {
1997 case 0:
1998 Engine_CameraMoveTo(PIXELS(6087), -1, PIXELS(3177), 1);
1999 break;
2000 case 1:
2001 Engine_CameraMoveTo(PIXELS(6089), -1, PIXELS(3175), 1);
2002 break;
2003 case 2:
2004 Engine_CameraMoveTo(PIXELS(6089), -1, PIXELS(3177), 1);
2005 break;
2006 case 3:
2007 Engine_CameraMoveTo(PIXELS(6087), -1, PIXELS(3175), 1);
2008 break;
2009 }
2010 }
2011}
2012
2013/// Moves the arrival actor along the staged route to its exit.
2014/// Called by WorldMap_Initialize at entrance 75.
2016
2017 struct FieldActor *actor;
2018
2020 Camera_MoveTo(-1, -1, -1, 0);
2021 Engine_TaskWait(1);
2023 Actor_SetPosition(ACTOR, PIXELS(4872), PIXELS(808));
2024 actor = Actor_Get(ACTOR);
2025 {
2026 s32 value = FACING_NORTHWEST;
2027
2028 actor->facing = value;
2029 }
2030 Engine_TaskWait(1);
2034 Engine_TaskWait(1);
2035 gEventWork->startTransition = 0x100;
2037 Actor_SetSpeed(ACTOR, PIXELS(2) / 5, PIXELS(1) / 5);
2038 Actor_MoveToAndWait(ACTOR, 4824, 712);
2039 Actor_MoveToAndWait(ACTOR, 4776, 616);
2040 Actor_SetSpeed(ACTOR, PIXELS(3) / 10, PIXELS(3) / 20);
2041 Actor_MoveToAndWait(ACTOR, 4776, 472);
2042 Actor_SetSpeed(ACTOR, PIXELS(1) / 5, PIXELS(1) / 10);
2043 Actor_MoveToAndWait(ACTOR, 4760, 456);
2044 Actor_SetSpeed(ACTOR, PIXELS(1) / 10, PIXELS(1) / 20);
2045 Actor_MoveToAndWait(ACTOR, 4760, 440);
2047 Engine_EventWait(40);
2051}
2052
2053/// Subtracts the opposing pair's rewards from the first pair's total.
2055 s32 positiveTotal = WorldMap_GetSelectedReward(0);
2056 s32 negativeTotal;
2057
2058 positiveTotal += WorldMap_GetSelectedReward(2);
2059 negativeTotal = WorldMap_GetSelectedReward(1);
2060 negativeTotal += WorldMap_GetSelectedReward(3);
2061 return positiveTotal - negativeTotal;
2062}
2063
2064/// Looks up the reward selected by the first set progress flag.
2066 s32 flagBase = 0;
2067 u32 offset;
2068
2069 switch (selection) {
2070 case 0:
2071 flagBase = 0x92C;
2072 break;
2073 case 1:
2074 flagBase = 0x935;
2075 break;
2076 case 2:
2077 flagBase = 0x917;
2078 break;
2079 case 3:
2080 flagBase = 0x990;
2081 break;
2082 }
2083 for (offset = 0; offset < 9; offset++) {
2084 if (Engine_GameFlagIsSet(flagBase + offset) != 0)
2085 return gWorldMapRewards[offset];
2086 }
2087 return 0;
2088}
2089
2090/// Spawns a puff behind the moving actor at staggered intervals.
2092 struct FieldActor *leader;
2093 struct FieldActor *actor;
2094 struct AnimationObject *sprite;
2095 u32 value;
2096
2097 if ((*(s32 *)&gFrameCount & 15) != 0)
2098 return;
2099 leader = Object_GetById(8);
2100 actor = Engine_ObjectCreate(222, leader->x.fixed - PIXELS(32),
2101 leader->y.fixed, leader->z.fixed - PIXELS(16));
2102 if (actor == 0)
2103 return;
2104 actor->scaleX = Q16_ONE / 2;
2105 actor->scaleY = Q16_ONE / 2;
2106 sprite = actor->sprite;
2107 if (((u32)Engine_RandomNext() * 2 >> 16)) {
2108 s32 back = (((u32)Engine_RandomNext() * 48) >> 16) << 16;
2109
2110 actor->x.fixed -= back >> 1;
2111 actor->z.fixed -= back;
2112 } else {
2113 value = (((u32)Engine_RandomNext() << 5) >> 16) << 16;
2114 actor->x.fixed += value;
2115 value = (s32)value >> 1;
2116 actor->z.fixed += value;
2117 }
2118 sprite->flags = 0;
2119 sprite->image.priority = leader->sprite->image.priority;
2121 actor->motionFlags = leader->motionFlags;
2122 ObjectGroup_SetChildValue(actor, 9);
2123 Object_SetMode(actor, 2);
2125}
2126
2127/// Stages the rising actor and its trailing puffs before the next arrival.
2128/// Called by WorldMap_Initialize at entrance 72.
2129static void WorldMap_RunOpeningRise(void) {
2130 struct FieldActor *actor;
2131 struct FieldActor *spriteActor;
2132
2133 actor = Object_GetById(8);
2134 Engine_EventWait(60);
2137 actor->scaleX = 6 * Q16_ONE / 5;
2138 actor->scaleY = 6 * Q16_ONE / 5;
2140 Engine_TaskWait(1);
2142 spriteActor = Actor_Get(ACTOR_PARTY_LEADER);
2143 Engine_ActorSetSpriteFlags(spriteActor, 0);
2144 spriteActor = Actor_Get(8);
2145 Engine_ActorSetSpriteFlags(spriteActor, 0);
2146 Actor_SetSpeed(8, PIXELS(2) / 5, PIXELS(1) / 5);
2147 actor->timer = 0;
2154 Engine_EventWait(120);
2156 Engine_EventWait(0x10e);
2158 PLTT_BACKDROP = 0x7fff;
2162}
2163
2164/// Rotates the traveler and counts down to the raised travel event.
2165/// Run each frame while the party is in the air; stores the frames left in the
2166/// byte at FLAG_SCENE_TEMP_F8.
2168
2169 struct FieldActor *actor;
2170 struct EventWork *scene;
2171 s32 progress;
2172
2174 scene = gEventWork;
2175 actor->facing = (gFrameCount << 12);
2176
2178 if (progress != 0) {
2179 if (progress == 1) {
2180 scene->raisedTrigger = 99;
2181 } else if (Engine_GameFlagIsSet(FLAG_MENU_OPEN) == 0) {
2182 progress -= 1;
2183 }
2184 }
2186}
2187
2188/// Moves the selected actor toward the travel marker and starts its timer.
2189/// Called by Event_EnterAirborneTravel. Sets FLAG_SCENE_TEMP_F0 and gives the
2190/// party 180 frames in the air (FLAG_SCENE_TEMP_F8).
2191static void WorldMap_StartAirborneTravel(s32 targetActor) {
2192 s32 alreadyTraveling;
2193 struct FieldActor *actor;
2194 struct FieldActor *record;
2195 s32 id;
2196
2198 actor = Object_GetById(id);
2199 alreadyTraveling = GameFlag_IsSet(FLAG_SCENE_TEMP_F0);
2200 if (alreadyTraveling == 0) {
2204 record = Object_GetById(targetActor);
2205 if (record != 0) {
2206 Actor_SetDestination(id, record->x.part.pixel, record->z.part.pixel);
2207 }
2211 actor->motionFlags = alreadyTraveling;
2212 Engine_ObjectSetPosition(actor, actor->x.fixed, actor->y.fixed + PIXELS(32),
2213 actor->z.fixed);
2215 actor->velocityY = alreadyTraveling;
2216 actor->motionFlags = 4;
2221 gEventWork->encounterEnemyGroup = 0; // drop any battle this step rolled
2222 }
2223}
2224
2225/// Walking onto the marker: the party is lifted up into the air.
2226/// Reached by walking onto cell code 95 until the airborne journey is over
2227/// (FLAG_SCENE_TEMP_F1).
2228static void Event_EnterAirborneTravel(void) {
2230}
2231
2232/// Starting to cast Douse on the marker.
2233/// Reached by the first phase of Douse on the marker (actor 54) while the party
2234/// is in the air (FLAG_SCENE_TEMP_F0).
2236 ((struct BattleFxScene *)gEffectWork)->childOption = 1;
2237}
2238
2239/// Douse on the marker: the party comes down and a battle begins.
2240/// Reached by Douse on the marker (actor 54) while the party is in the air.
2241/// Clears FLAG_SCENE_TEMP_F0, sets FLAG_SCENE_TEMP_F1 and empties the timer.
2242static void Event_DouseTravelMarker(void) {
2243 struct FieldActor *selectedActor;
2244
2245 if (gEventWork->raisedTrigger == 99) {
2247 }
2252 Battle_SetStart(3);
2254 selectedActor = Object_GetById(gGameState.selectedActor);
2255 selectedActor->motionFlags = 2;
2256}
2257
2258/// When the time in the air runs out: the party and the marker fly off, and
2259/// the map reopens elsewhere.
2260/// Reached by the scene raising 99 as the timer runs out. Sets
2261/// FLAG_ARRIVE_FALLING and sends the party to the world map's entrance 27.
2264 struct FieldActor *other = Actor_Get(54);
2265 s32 frames;
2266
2268 Camera_MoveTo(-1, -1, -1, 0);
2271 other->motionFlags = 0;
2272 actor->motionFlags = 0;
2273 actor->velocityY = 0;
2274 actor->frozen = 1;
2275 other->frozen = 1;
2276 for (frames = 59; frames >= 0; --frames) {
2277 actor->velocityY += PIXELS(1) / 5;
2278 other->velocityY += PIXELS(1) / 5;
2279 Engine_TaskWait(1);
2280 }
2286}
2287
2288/// Refreshes the transition's blend registers on alternating frames.
2290
2291 IoWriteQueue_Store16(0x04000050, 0x3f41);
2292 if ((gFrameCount & 2) != 0) {
2293 IoWriteQueue_Store16(0x04000052, gWorldMapBlend | 0x0c);
2294 } else {
2295 IoWriteQueue_Store16(0x04000052, gWorldMapBlend | 0x10);
2296 }
2297}
2298
2299/// Jitters the view around the selected actor during the transition.
2301
2302 struct FieldActor *record;
2303 s32 sx;
2304 s32 sy;
2305 u32 mode;
2306
2308 sx = record->x.part.pixel;
2309 sy = record->z.part.pixel;
2310 if (gFrameCount % 3 == 0) {
2311 mode = (u32)(Random_Next() << 2) >> 16;
2312 switch (mode) {
2313 case 0:
2314 Camera_MoveTo((sx << 16) - PIXELS(1), -1, (sy << 16) + PIXELS(1), 1);
2315 break;
2316 case 1:
2317 Engine_CameraMoveTo((sx << 16) + PIXELS(1), -1, (sy << 16) - PIXELS(1),
2318 1);
2319 break;
2320 case 2:
2321 Camera_MoveTo((sx << 16) + PIXELS(1), -1, (sy << 16) + PIXELS(1), 1);
2322 break;
2323 case 3:
2324 Camera_MoveTo((sx << 16) - PIXELS(1), -1, (sy << 16) - PIXELS(1), 1);
2325 break;
2326 }
2327 }
2328}
2329
2330/// Displays a transition frame before advancing its animation delay.
2331static inline void WorldMap_ShowTransitionFrame(u8 *buffer, s32 offset,
2332 s32 frames) {
2333 WORLD_MAP_QUEUE_TRANSITION_FRAME(buffer, offset);
2334 Engine_EventWait(frames);
2335}
2336
2337/// Animates the lighthouse transition frames, palette, and camera.
2338/// Called by WorldMap_Initialize at entrances 90 (Mercury Lighthouse) and 91
2339/// (Venus Lighthouse). Clears FLAG_KEEP_PARTY_POSITION and sets
2340/// FLAG_SKIP_SCENE_CHANGE_SOUND.
2342 u8 *buffer = Runtime_BumpAllocateAlternatePool(0x4000);
2343
2344 Engine_TaskWait(1);
2349 IO_WRITE_QUEUE_PUSH(0x050001c0, (u32)(gWorldMapPalettes + palette * 32),
2350 0x80000010);
2351 IO_WRITE_QUEUE_PUSH(0x06001000, (u32)buffer, 0x84000400);
2354 WORLD_MAP_QUEUE_TRANSITION_FRAME(buffer, 0x3a80);
2360
2361 // Fade through the inward frames, hold, then reverse the animation.
2362 gWorldMapBlend = 0xe00;
2363 WorldMap_ShowTransitionFrame(buffer, 0x3480, 2);
2364 gWorldMapBlend = 0xd00;
2365 WorldMap_ShowTransitionFrame(buffer, 0x2e80, 2);
2366 gWorldMapBlend = 0xc00;
2367 WorldMap_ShowTransitionFrame(buffer, 0x2880, 2);
2368 gWorldMapBlend = 0xb00;
2369 WorldMap_ShowTransitionFrame(buffer, 0x2280, 2);
2370 gWorldMapBlend = 0xa00;
2371 WorldMap_ShowTransitionFrame(buffer, 0x1c80, 2);
2372 gWorldMapBlend = 0x900;
2373 WorldMap_ShowTransitionFrame(buffer, 0x1680, 2);
2374 gWorldMapBlend = 0x800;
2375 WorldMap_ShowTransitionFrame(buffer, 0x1080, 140);
2376
2377 WorldMap_ShowTransitionFrame(buffer, 0x1680, 4);
2378 WorldMap_ShowTransitionFrame(buffer, 0x1c80, 4);
2379 WorldMap_ShowTransitionFrame(buffer, 0x2280, 4);
2380 gWorldMapBlend = 0x900;
2381 WorldMap_ShowTransitionFrame(buffer, 0x2880, 4);
2382 gWorldMapBlend = 0xa00;
2383 WorldMap_ShowTransitionFrame(buffer, 0x2e80, 4);
2384 gWorldMapBlend = 0xb00;
2385 WorldMap_ShowTransitionFrame(buffer, 0x3480, 4);
2386 gWorldMapBlend = 0xc00;
2387 WORLD_MAP_QUEUE_TRANSITION_FRAME(buffer, 0x3a80);
2391 gWorldMapBlend = 0xd00;
2393 gWorldMapBlend = 0xe00;
2395 gWorldMapBlend = 0xf00;
2397 gWorldMapBlend = 0x1000;
2398 Engine_EventWait(45);
2401 MemFree(buffer);
2403}
2404
2405/// Blinks an unused actor and periodically creates its linked effects.
2406UNUSED static void
2408 if ((gFrameCount & 2) != 0) {
2410 } else {
2412 }
2413 if ((gFrameCount & 15) == 0) {
2415 }
2416}
2417
2418/// Cycles an unused actor's palettes and periodically creates linked effects.
2419UNUSED static void
2421 if ((gFrameCount & 1) != 0) {
2422 Engine_ObjectSetPartPalettes(actor, ((u32)((gFrameCount >> 1)) % (u32)6));
2423 }
2424 if ((gFrameCount & 15) == 0) {
2426 }
2427}
2428
2429/// Advances an unused actor's palette on odd frames.
2431 if ((gFrameCount & 1) != 0) {
2432 s32 slot = (gFrameCount >> 1) % 6;
2433
2434 Engine_ObjectSetPartPalettes(actor, slot);
2435 }
2436}
2437
2438#include "common/effect_vertical.h"
2440
2442 SC_POS(PIXELS(5848), 0, PIXELS(1576)),
2443 SC_SET(SW_SCALE_X, 3 * Q16_ONE / 2),
2444 SC_SET(SW_SCALE_Y, 3 * Q16_ONE / 2),
2445 SC_WAIT(1),
2446 SC_ARG(2),
2447 SC_MOVE(PIXELS(5848), 0, PIXELS(1544)),
2448 SC_SYNC,
2449 SC_MOVE(PIXELS(5795), 0, PIXELS(1544)),
2450 SC_SYNC,
2451 SC_MOVE(PIXELS(5800), 0, PIXELS(1614)),
2452 SC_SYNC,
2453 SC_MOVE(PIXELS(5864), 0, PIXELS(1624)),
2454 SC_SYNC,
2455 SC_ARG(1),
2456 SC_END,
2457};
2458
2460 SC_ARG(2),
2461 SC_MOVE(PIXELS(5868), 0, PIXELS(1624)),
2462 SC_SYNC,
2463 SC_MOVE(PIXELS(5868), 0, PIXELS(1736)),
2464 SC_SYNC,
2465 SC_ARG(1),
2466 SC_POS(PIXELS(5656), 0, PIXELS(1800)),
2467 SC_END,
2468};
2469
2471 SC_ARG(2), SC_MOVE(PIXELS(5800), 0, PIXELS(1800)), SC_SYNC, SC_POS(0, 0, 0),
2472 SC_END,
2473};
2474
2476 SC_POS(PIXELS(5868), 0, PIXELS(1704)),
2477 SC_WAIT(1),
2478 SC_ARG(2),
2479 SC_MOVE(PIXELS(5872), 0, PIXELS(1528)),
2480 SC_SYNC,
2481 SC_MOVE(PIXELS(5880), 0, PIXELS(1352)),
2482 SC_SYNC,
2483 SC_POS(0, 0, 0),
2484 SC_END,
2485};
2486
2488 SC_POS(PIXELS(5848), 0, PIXELS(1576)),
2489 SC_SET(SW_SCALE_X, 3 * Q16_ONE / 2),
2490 SC_SET(SW_SCALE_Y, 3 * Q16_ONE / 2),
2491 SC_WAIT(1),
2492 SC_ARG(2),
2493 SC_MOVE(PIXELS(5848), 0, PIXELS(1544)),
2494 SC_SYNC,
2495 SC_MOVE(PIXELS(5795), 0, PIXELS(1544)),
2496 SC_SYNC,
2497 SC_MOVE(PIXELS(5800), 0, PIXELS(1630)),
2498 SC_SYNC,
2499 SC_MOVE(PIXELS(5832), 0, PIXELS(1640)),
2500 SC_SYNC,
2501 SC_ARG(1),
2502 SC_END,
2503};
2504
2506 SC_ARG(2),
2507 SC_MOVE(PIXELS(5863), 0, PIXELS(1640)),
2508 SC_SYNC,
2509 SC_MOVE(PIXELS(5868), 0, PIXELS(1736)),
2510 SC_SYNC,
2511 SC_ARG(1),
2512 SC_POS(PIXELS(5640), 0, PIXELS(1768)),
2513 SC_END,
2514};
2515
2517 SC_ARG(2), SC_MOVE(PIXELS(5640), 0, PIXELS(1795)),
2518 SC_SYNC, SC_MOVE(PIXELS(5800), 0, PIXELS(1800)),
2519 SC_SYNC, SC_POS(0, 0, 0),
2520 SC_END,
2521};
2522
2524 SC_POS(PIXELS(5848), 0, PIXELS(1576)),
2525 SC_SET(SW_SCALE_X, 3 * Q16_ONE / 2),
2526 SC_SET(SW_SCALE_Y, 3 * Q16_ONE / 2),
2527 SC_WAIT(1),
2528 SC_ARG(2),
2529 SC_MOVE(PIXELS(5848), 0, PIXELS(1544)),
2530 SC_SYNC,
2531 SC_MOVE(PIXELS(5795), 0, PIXELS(1544)),
2532 SC_SYNC,
2533 SC_MOVE(PIXELS(5800), 0, PIXELS(1614)),
2534 SC_SYNC,
2535 SC_MOVE(PIXELS(5832), 0, PIXELS(1624)),
2536 SC_SYNC,
2537 SC_ARG(1),
2538 SC_END,
2539};
2540
2542 SC_ARG(2),
2543 SC_MOVE(PIXELS(5863), 0, PIXELS(1624)),
2544 SC_SYNC,
2545 SC_MOVE(PIXELS(5868), 0, PIXELS(1736)),
2546 SC_SYNC,
2547 SC_ARG(1),
2548 SC_POS(PIXELS(5656), 0, PIXELS(1768)),
2549 SC_END,
2550};
2551
2553 SC_ARG(2), SC_MOVE(PIXELS(5656), 0, PIXELS(1795)),
2554 SC_SYNC, SC_MOVE(PIXELS(5800), 0, PIXELS(1800)),
2555 SC_SYNC, SC_POS(0, 0, 0),
2556 SC_END,
2557};
2558
2560 SC_POS(PIXELS(5848), 0, PIXELS(1576)),
2561 SC_SET(SW_SCALE_X, 3 * Q16_ONE / 2),
2562 SC_SET(SW_SCALE_Y, 3 * Q16_ONE / 2),
2563 SC_WAIT(1),
2564 SC_ARG(2),
2565 SC_MOVE(PIXELS(5848), 0, PIXELS(1544)),
2566 SC_SYNC,
2567 SC_MOVE(PIXELS(5795), 0, PIXELS(1544)),
2568 SC_SYNC,
2569 SC_MOVE(PIXELS(5800), 0, PIXELS(1598)),
2570 SC_SYNC,
2571 SC_MOVE(PIXELS(5832), 0, PIXELS(1608)),
2572 SC_SYNC,
2573 SC_ARG(1),
2574 SC_END,
2575};
2576
2578 SC_ARG(2),
2579 SC_MOVE(PIXELS(5863), 0, PIXELS(1608)),
2580 SC_SYNC,
2581 SC_MOVE(PIXELS(5868), 0, PIXELS(1736)),
2582 SC_SYNC,
2583 SC_ARG(1),
2584 SC_POS(PIXELS(5672), 0, PIXELS(1768)),
2585 SC_END,
2586};
2587
2589 SC_ARG(3), SC_MOVE(PIXELS(5672), 0, PIXELS(1795)),
2590 SC_SYNC, SC_MOVE(PIXELS(5800), 0, PIXELS(1800)),
2591 SC_SYNC, SC_POS(0, 0, 0),
2592 SC_END,
2593};
2594
2596 SC_SET(SW_SCALE_X, Q16_ONE / 10),
2597 SC_SET(SW_SCALE_Y, Q16_ONE / 10),
2598 SC_WAIT(1),
2599 SC_MOVE(PIXELS(5608), 0, PIXELS(1720)),
2600 SC_LABEL(1),
2601 SC_ADD(SW_SCALE_X, 655),
2602 SC_ADD(SW_SCALE_Y, 655),
2603 SC_WAIT(1),
2604 SC_LOOP(160, SC_TO(1)),
2605 SC_END,
2606};
2607
2609 SC_SET(0x23, 0),
2610 SC_ARG(2),
2611 SC_MOVE(PIXELS(6008), 0, PIXELS(3400)),
2612 SC_SYNC,
2613 SC_MOVE(PIXELS(6020), 0, PIXELS(3400)),
2614 SC_SYNC,
2615 SC_ARG(1),
2616 SC_SET(0x23, 1),
2617 SC_WAIT(1),
2618 SC_END,
2619};
2620
2622 SC_ARG(2),
2623 SC_MOVE(PIXELS(7564), 0, PIXELS(3476)),
2624 SC_SYNC,
2625 SC_MOVE(PIXELS(7576), 0, PIXELS(3464)),
2626 SC_SYNC,
2627 SC_MOVE(PIXELS(7640), 0, PIXELS(3464)),
2628 SC_SYNC,
2629 SC_MOVE(PIXELS(7656), 0, PIXELS(3480)),
2630 SC_SYNC,
2631 SC_MOVE(PIXELS(7720), 0, PIXELS(3480)),
2632 SC_SYNC,
2633 SC_MOVE(PIXELS(7752), 0, PIXELS(3496)),
2634 SC_SYNC,
2635 SC_ARG(1),
2637 SC_WAIT(1),
2638 SC_END,
2639};
2640
2642 SC_ARG(2),
2643 SC_MOVE(PIXELS(7564), 0, PIXELS(3476)),
2644 SC_SYNC,
2645 SC_MOVE(PIXELS(7576), 0, PIXELS(3464)),
2646 SC_SYNC,
2647 SC_MOVE(PIXELS(7640), 0, PIXELS(3464)),
2648 SC_SYNC,
2649 SC_MOVE(PIXELS(7656), 0, PIXELS(3480)),
2650 SC_SYNC,
2651 SC_MOVE(PIXELS(7704), 0, PIXELS(3512)),
2652 SC_SYNC,
2653 SC_ARG(1),
2655 SC_WAIT(1),
2656 SC_END,
2657};
2658
2660 SC_SET(0x23, 0),
2661 SC_ARG(2),
2662 SC_MOVE(PIXELS(7564), 0, PIXELS(3476)),
2663 SC_SYNC,
2664 SC_MOVE(PIXELS(7576), 0, PIXELS(3464)),
2665 SC_SYNC,
2666 SC_MOVE(PIXELS(7640), 0, PIXELS(3464)),
2667 SC_SYNC,
2668 SC_MOVE(PIXELS(7656), 0, PIXELS(3480)),
2669 SC_SYNC,
2670 SC_MOVE(PIXELS(7688), 0, PIXELS(3528)),
2671 SC_SYNC,
2672 SC_ARG(1),
2674 SC_SET(0x23, 1),
2675 SC_WAIT(1),
2676 SC_END,
2677};
2678
2680 SC_WAIT(16),
2681 SC_FREE,
2682};
2683
2685 SC_ARG(2), SC_MOVE_BY(PIXELS(-8), 0, 0),
2686 SC_SYNC, SC_LOOP(40, SC_TOP),
2687 SC_SET(0x23, 1), SC_MOVE_BY(PIXELS(-8), 0, 0),
2688 SC_SYNC, SC_MOVE_BY(PIXELS(-8), 0, 0),
2689 SC_SYNC, SC_END,
2690};
2691
2693 SC_ARG(2), SC_MOVE_BY(PIXELS(-8), 0, PIXELS(-2)),
2694 SC_SYNC, SC_LOOP(40, SC_TOP),
2695 SC_SET(0x23, 1), SC_MOVE_BY(PIXELS(-8), 0, PIXELS(-2)),
2696 SC_SYNC, SC_MOVE_BY(PIXELS(-8), 0, PIXELS(-2)),
2697 SC_SYNC, SC_END,
2698};
2699
2701 SC_MOVE_BY(PIXELS(24), 0, 0),
2702 SC_SYNC,
2703 SC_LOOP(10, SC_TOP),
2704 SC_SET(0x23, 1),
2705 SC_MOVE_BY(PIXELS(24), 0, 0),
2706 SC_SYNC,
2707 SC_MOVE_BY(PIXELS(24), 0, 0),
2708 SC_SYNC,
2709 SC_END,
2710};
2711
2714 SC_END,
2715};
2716
2718 {0, CONDITION_ALWAYS, 5656, 0, 1256, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2719 {1, CONDITION_ALWAYS, 5680, 0, 1226, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2720 {2, CONDITION_ALWAYS, 5688, 0, 1224, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2721 {3, CONDITION_ALWAYS, 5848, 0, 1608, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2722 {4, CONDITION_ALWAYS, 6424, 0, 1320, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2723 {5, CONDITION_ALWAYS, 6584, 0, 1224, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2724 {6, CONDITION_ALWAYS, 6928, 0, 1368, FACING_WEST, 0, -1, -1, -1, -1, 0},
2725 {7, CONDITION_ALWAYS, 7328, 0, 1240, FACING_WEST, 0, -1, -1, -1, -1, 0},
2726 {8, CONDITION_ALWAYS, 7136, 0, 1054, FACING_WEST, 0, -1, -1, -1, -1, 0},
2727 {9, CONDITION_ALWAYS, 5928, 0, 296, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2728 {10, CONDITION_ALWAYS, 6024, 0, 200, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2729 {11, CONDITION_ALWAYS, 7568, 0, 1416, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2730 {12, CONDITION_ALWAYS, 7880, 0, 1592, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2731 {13, CONDITION_ALWAYS, 7852, 0, 1688, FACING_NORTH, 0, -1, -1, -1, -1, 0},
2732 {14, CONDITION_ALWAYS, 7544, 0, 2008, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2733 {15, CONDITION_ALWAYS, 7144, 0, 1736, FACING_EAST, 0, -1, -1, -1, -1, 0},
2734 {16, CONDITION_ALWAYS, 7008, 0, 1624, FACING_EAST, 0, -1, -1, -1, -1, 0},
2735 {17, CONDITION_ALWAYS, 6888, 0, 1736, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2736 {18, CONDITION_ALWAYS, 6888, 0, 1828, FACING_EAST, 0, -1, -1, -1, -1, 0},
2737 {19, CONDITION_ALWAYS, 5560, 0, 2136, FACING_WEST, 0, -1, -1, -1, -1, 0},
2738 {20, CONDITION_ALWAYS, 5592, 0, 2168, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2739 {21, CONDITION_ALWAYS, 5424, 0, 2264, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2740 {22, CONDITION_ALWAYS, 5004, 0, 2328, FACING_WEST, 0, -1, -1, -1, -1, 0},
2741 {23, CONDITION_ALWAYS, 4904, 0, 2312, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2742 {24, CONDITION_ALWAYS, 4840, 0, 1992, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2743 {25, CONDITION_ALWAYS, 4940, 0, 2648, FACING_NORTH, 0, -1, -1, -1, -1, 0},
2744 {26, CONDITION_ALWAYS, 5656, 0, 2424, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2745 {27, CONDITION_ALWAYS, 5388, 0, 2840, FACING_WEST, 0, -1, -1, -1, -1, 0},
2746 {28, CONDITION_ALWAYS, 5448, 0, 2920, FACING_NORTH, 0, -1, -1, -1, -1, 0},
2747 {29, CONDITION_ALWAYS, 5864, 0, 3400, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2748 {30, CONDITION_ALWAYS, 5996, 0, 2930, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2749 {31, CONDITION_ALWAYS, 5996, 0, 2840, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2750 {32, CONDITION_ALWAYS, 6032, 0, 3192, FACING_WEST, 0, -1, -1, -1, -1, 0},
2751 {33, CONDITION_ALWAYS, 5976, 0, 3432, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2752 {34, CONDITION_ALWAYS, 5896, 0, 1160, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2753 {35, CONDITION_ALWAYS, 5990, 0, 804, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2754 {38, CONDITION_ALWAYS, 7376, 0, 1240, FACING_EAST, 0, -1, -1, -1, -1, 0},
2755 {39, CONDITION_ALWAYS, 5956, 0, 266, FACING_EAST, 0, -1, -1, -1, -1, 0},
2756 {40, CONDITION_ALWAYS, 6484, 0, 1212, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2757 {41, CONDITION_ALWAYS, 5480, 0, 2632, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2758 {42, CONDITION_ALWAYS, 5928, 0, 3272, FACING_EAST, 0, -1, -1, -1, -1, 0},
2759 {43, CONDITION_ALWAYS, 7792, 0, 2104, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2760 {44, CONDITION_ALWAYS, 5848, 0, 1544, FACING_NORTH, 0, -1, -1, -1, -1, 0},
2761 {45, CONDITION_ALWAYS, 6248, 0, 520, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2762 {46, CONDITION_ALWAYS, 7568, 0, 1352, FACING_NORTH, 0, -1, -1, -1, -1, 0},
2763 {47, CONDITION_ALWAYS, 6976, 0, 1360, FACING_EAST, 0, -1, -1, -1, -1, 0},
2764 {48, CONDITION_ALWAYS, 6228, 0, 552, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2765 {49, CONDITION_ALWAYS, 5860, 0, 1212, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2766 {50, CONDITION_ALWAYS, 7056, 0, 1656, FACING_NORTH, 0, -1, -1, -1, -1, 0},
2767 {51, CONDITION_ALWAYS, 7000, 0, 1736, FACING_WEST, 0, -1, -1, -1, -1, 0},
2768 {52, CONDITION_ALWAYS, 6920, 0, 1696, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2769 {53, CONDITION_ALWAYS, 6090, 0, 2232, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2770 {54, CONDITION_ALWAYS, 4940, 0, 2728, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2771 {55, CONDITION_ALWAYS, 5416, 0, 3272, FACING_EAST, 0, -1, -1, -1, -1, 0},
2772 {56, CONDITION_ALWAYS, 5416, 0, 2808, FACING_NORTH, 0, -1, -1, -1, -1, 0},
2773 {57, CONDITION_ALWAYS, 5444, 0, 2840, FACING_EAST, 0, -1, -1, -1, -1, 0},
2774 {58, CONDITION_ALWAYS, 5424, 0, 2200, FACING_NORTH, 0, -1, -1, -1, -1, 0},
2775 {59, CONDITION_ALWAYS, 5996, 0, 2856, FACING_NORTH, 0, -1, -1, -1, -1, 0},
2776 {60, CONDITION_ALWAYS, 5480, 0, 2120, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2777 {61, CONDITION_ALWAYS, 6152, 0, 3212, FACING_EAST, 0, -1, -1, -1, -1, 0},
2778 {64, CONDITION_ALWAYS, 5848, 0, 1608, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2779 {65, CONDITION_ALWAYS, 5384, 0, 2248, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2780 {66, CONDITION_ALWAYS, 7944, 0, 200, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2781 {67, CONDITION_ALWAYS, 7944, 0, 200, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2782 {68, CONDITION_ALWAYS, 7944, 0, 200, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2783 {69, CONDITION_ALWAYS, 7944, 0, 200, FACING_SOUTH, 0, -1, 128, -1, -1, 0},
2784 {70, CONDITION_ALWAYS, 5096, 0, 2328, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2785 {71, CONDITION_ALWAYS, 5528, 0, 2120, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2786 {72, CONDITION_ALWAYS, 7464, 0, 200, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2787 {73, CONDITION_ALWAYS, 6088, 0, 3176, FACING_WEST, 0, -1, -1, -1, -1, 0},
2788 {74, CONDITION_ALWAYS, 4728, 0, 424, FACING_WEST, 0, -1, -1, -1, -1, 0},
2789 {75, CONDITION_ALWAYS, 4872, 0, 808, FACING_WEST, 0, -1, -1, -1, -1, 0},
2790 {76, CONDITION_ALWAYS, 4576, 0, 508, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2791 {77, CONDITION_ALWAYS, 4392, 0, 328, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2792 {78, CONDITION_ALWAYS, 8, 0, 8, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2793 {80, CONDITION_ALWAYS, 7552, 0, 3504, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2794 {90, CONDITION_ALWAYS, 6024, 0, 160, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2795 {91, CONDITION_ALWAYS, 6088, 0, 3168, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2796 {97, CONDITION_ALWAYS, 6248, 0, 872, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2797 {98, CONDITION_ALWAYS, 4248, 0, 2424, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2798 {99, CONDITION_ALWAYS, 5576, 0, 2088, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
2800};
2801
2803 SCENE_EXITS(2), SCENE_EXIT(1, 5, 10),
2804 SCENE_EXIT(2, 2, 2), SCENE_EXIT(3, 20, 1),
2805 SCENE_EXIT(4, 25, 1), SCENE_EXIT(5, 30, 1),
2806 SCENE_EXIT(6, 35, 1), SCENE_EXIT(7, 36, 1),
2807 SCENE_EXIT(8, 40, 4), SCENE_EXIT(9, 50, 1),
2808 SCENE_EXIT(10, 57, 11), SCENE_EXIT(11, 39, 1),
2809 SCENE_EXIT(12, 60, 1), SCENE_EXIT(13, 68, 1),
2810 SCENE_EXIT(14, 72, 1), SCENE_EXIT(15, 74, 1),
2811 SCENE_EXIT(16, 75, 1), SCENE_EXIT(17, 88, 1),
2812 SCENE_EXIT(18, 89, 1), SCENE_EXIT(19, 2, 19),
2813 SCENE_EXIT(20, 99, 9), SCENE_EXIT(21, 107, 1),
2814 SCENE_EXIT(22, 112, 2), SCENE_EXIT(23, 135, 1),
2815 SCENE_EXIT(24, 146, 1), SCENE_EXIT(25, 152, 1),
2816 SCENE_EXIT(26, 158, 1), SCENE_EXIT(27, 167, 10),
2817 SCENE_EXIT(28, 164, 1), SCENE_EXIT(29, 169, 1),
2818 SCENE_EXIT(30, 178, 20), SCENE_EXIT(31, 177, 1),
2819 SCENE_EXIT(32, 181, 1), SCENE_EXIT(33, 171, 4),
2820 SCENE_EXIT(34, 104, 1), SCENE_EXIT(35, 49, 1),
2821 SCENE_EXIT(40, 29, 2), SCENE_EXIT(41, 158, 6),
2822 SCENE_EXIT(42, 169, 5), SCENE_EXIT(43, 70, 13),
2823 SCENE_EXIT(44, 20, 3), SCENE_EXIT(45, 49, 1),
2824 SCENE_EXIT(46, 39, 2), SCENE_EXIT(47, 35, 2),
2825 SCENE_EXIT(48, 47, 3), SCENE_EXIT(49, 106, 1),
2826 SCENE_EXIT(50, 74, 2), SCENE_EXIT(51, 74, 3),
2827 SCENE_EXIT(52, 87, 4), SCENE_EXIT(53, 92, 4),
2828 SCENE_EXIT(54, 152, 2), SCENE_EXIT(55, 165, 2),
2829 SCENE_EXIT(56, 107, 4), SCENE_EXIT(59, 178, 21),
2830 SCENE_EXIT(60, 153, 2), SCENE_EXIT(61, 181, 3),
2831 SCENE_EXIT(74, 109, 6), SCENE_EXIT(75, 113, 1),
2832 SCENE_EXIT(100, 2, 1), SCENE_EXIT(101, 2, 64),
2833 SCENE_EXIT(102, 110, 11), SCENE_EXIT(103, 110, 12),
2834 SCENE_EXIT(104, 110, 13), SCENE_EXIT(105, 111, 21),
2835 SCENE_EXIT(106, 110, 14), SCENE_EXIT(107, 109, 18),
2836 SCENE_EXIT(108, 153, 10), SCENE_EXIT(109, 187, 4),
2837 SCENE_EXIT(110, 111, 23), SCENE_EXIT(111, 2, 80),
2838 SCENE_EXIT(112, 105, 10), SCENE_EXITS_END,
2839};
2840
2843 SC_END,
2844};
2845
2848 SC_END,
2849};
2850
2853 SC_END,
2854};
2855
2859 SC_END,
2860};
2861
2862// clang-format off
2865 0, 0, 0, FACING_SOUTH, TALK_FACE_PARTY, 0 },
2867 0, 0, 0, FACING_SOUTH, TALK_FACE_PARTY, 0 },
2869 0, 0, 0, FACING_EAST, TALK_FACE_PARTY, 0 },
2871 PIXELS(5678), 0, PIXELS(1200), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2873 PIXELS(5848), 0, PIXELS(1576), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2875 PIXELS(6976), 0, PIXELS(1624), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2877 PIXELS(5416), 0, PIXELS(2840), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2879 PIXELS(5892), 0, PIXELS(1128), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2881 PIXELS(5422), 0, PIXELS(2232), FACING_EAST, TALK_KEEP_FACING, 0 },
2883 PIXELS(5036), 0, PIXELS(2328), FACING_WEST, TALK_KEEP_FACING, 0 },
2885 PIXELS(5928), 0, PIXELS(270), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2887 PIXELS(7352), 0, PIXELS(1240), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2889 PIXELS(7544), 0, PIXELS(1976), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2891 PIXELS(6888), 0, PIXELS(1712), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2893 PIXELS(7880), 0, PIXELS(1560), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2895 PIXELS(6584), 0, PIXELS(1192), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2897 PIXELS(5592), 0, PIXELS(2136), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2899 PIXELS(5996), 0, PIXELS(2894), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2901 PIXELS(4904), 0, PIXELS(2280), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2903 PIXELS(6024), 0, PIXELS(168), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2905 PIXELS(5656), 0, PIXELS(1112), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2907 PIXELS(6088), 0, PIXELS(3176), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2909 PIXELS(6952), 0, PIXELS(1362), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2911 PIXELS(5996), 0, PIXELS(2808), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2913 PIXELS(6424), 0, PIXELS(1302), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2915 PIXELS(6484), 0, PIXELS(1184), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2917 PIXELS(4840), 0, PIXELS(1960), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2919 PIXELS(5656), 0, PIXELS(2392), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2921 PIXELS(5480), 0, PIXELS(2600), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2923 PIXELS(7790), 0, PIXELS(2080), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2925 PIXELS(5976), 0, PIXELS(3400), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2927 PIXELS(5988), 0, PIXELS(774), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2929 PIXELS(6224), 0, PIXELS(520), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2931 PIXELS(5856), 0, PIXELS(1174), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2933 PIXELS(6920), 0, PIXELS(1664), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2935 PIXELS(6092), 0, PIXELS(2200), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2937 PIXELS(7166), 0, PIXELS(1054), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2939 PIXELS(7856), 0, PIXELS(1736), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2941 PIXELS(5480), 0, PIXELS(2088), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2943 0, 0, 0, FACING_SOUTH, TALK_KEEP_FACING, 0 },
2949 PIXELS(7568), 0, PIXELS(1384), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2951 PIXELS(4942), 0, PIXELS(2690), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2953 PIXELS(6036), 0, PIXELS(3458), FACING_WEST, TALK_KEEP_FACING, 0 },
2955 PIXELS(4760), 0, PIXELS(440), FACING_NORTH, TALK_KEEP_FACING, 0 },
2957 PIXELS(4392), 0, PIXELS(296), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2960 { SCENE_TABLE_END },
2962 0, 0, 0, FACING_SOUTH, TALK_KEEP_FACING, 0 },
2963 { SCENE_TABLE_END },
2964};
2965
2968 0, 0, 0, FACING_SOUTH, TALK_KEEP_FACING, 0 },
2970 0, 0, 0, FACING_SOUTH, TALK_KEEP_FACING, 0 },
2972 0, 0, 0, FACING_SOUTH, TALK_KEEP_FACING, 0 },
2974 0, 0, 0, FACING_NORTH, TALK_KEEP_FACING, 0 },
2976 0, 0, 0, FACING_NORTH, TALK_KEEP_FACING, 0 },
2978 0, 0, 0, FACING_NORTH, TALK_KEEP_FACING, 0 },
2980 0, 0, 0, FACING_NORTH, TALK_KEEP_FACING, 0 },
2982 0, 0, 0, FACING_SOUTH, TALK_KEEP_FACING, 0 },
2984 0, 0, 0, FACING_SOUTH, TALK_KEEP_FACING, 0 },
2986 PIXELS(5848), 0, PIXELS(1576), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2987 { SCENE_TABLE_END },
2988};
2989
2992 0, 0, 0, FACING_NORTH, TALK_KEEP_FACING, 0 },
2994 PIXELS(5892), 0, PIXELS(1128), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2996 PIXELS(5856), 0, PIXELS(1174), FACING_SOUTH, TALK_KEEP_FACING, 0 },
2998 0, 0, 0, FACING_SOUTH, TALK_FACE_PARTY, 0 },
3000 0, 0, 0, FACING_SOUTH, TALK_KEEP_FACING, 0 },
3001 { SCENE_TABLE_END },
3002};
3003
3006 PIXELS(5384), 0, PIXELS(2248), FACING_WEST, TALK_KEEP_FACING, 0 },
3008 PIXELS(5592), 0, PIXELS(2136), FACING_SOUTH, TALK_KEEP_FACING, 0 },
3010 PIXELS(5422), 0, PIXELS(2232), FACING_EAST, TALK_KEEP_FACING, 0 },
3013 { SCENE_TABLE_END },
3014};
3015
3018 PIXELS(5432), 0, PIXELS(2312), FACING_WEST, TALK_KEEP_FACING, 0 },
3019 { SCENE_TABLE_END },
3020};
3021
3024 PIXELS(5592), 0, PIXELS(2136), FACING_SOUTH, TALK_KEEP_FACING, 0 },
3026 PIXELS(5480), 0, PIXELS(2088), FACING_SOUTH, TALK_KEEP_FACING, 0 },
3028 0, 0, 0, FACING_NORTH, TALK_KEEP_FACING, 0 },
3029 { SCENE_TABLE_END },
3030};
3031
3036 PIXELS(7816), 0, PIXELS(3528), FACING_EAST, TALK_FACE_PARTY_AND_BACK, 0 },
3044 PIXELS(7604), 0, PIXELS(3522), FACING_WEST, TALK_KEEP_FACING, 0 },
3045 { SCENE_TABLE_END },
3046};
3047
3050 PIXELS(7464), 0, PIXELS(200), FACING_SOUTH, TALK_KEEP_FACING, 0 },
3051 { SCENE_TABLE_END },
3052};
3053
3056 PIXELS(6080), 0, PIXELS(3168), FACING_SOUTH, TALK_KEEP_FACING, 0 },
3057 { SCENE_TABLE_END },
3058};
3059
3074 { EVENT_EXIT, 13, CONDITION_ALWAYS, 13 },
3075 { EVENT_EXIT, 15, CONDITION_ALWAYS, 15 },
3076 { EVENT_EXIT, 50, CONDITION_ALWAYS, 50 },
3077 { EVENT_EXIT, 51, CONDITION_ALWAYS, 51 },
3078 { EVENT_EXIT, 18, CONDITION_ALWAYS, 18 },
3079 { EVENT_EXIT, 28, CONDITION_ALWAYS, 28 },
3080 { EVENT_EXIT, 55, CONDITION_ALWAYS, 55 },
3081 { EVENT_EXIT, 29, CONDITION_ALWAYS, 29 },
3082 { EVENT_EXIT, 42, CONDITION_ALWAYS, 42 },
3083 { EVENT_EXIT, 32, CONDITION_ALWAYS, 32 },
3084 { EVENT_EXIT, 61, CONDITION_ALWAYS, 61 },
3085 { EVENT_EXIT, 47, CONDITION_ALWAYS, 47 },
3086 { EVENT_EXIT, 111, CONDITION_ALWAYS, 1 },
3088 { EVENT_EXIT, 132, CONDITION_ALWAYS, 4 },
3089 { EVENT_EXIT, 133, CONDITION_ALWAYS, 40 },
3090 { EVENT_EXIT, 123, CONDITION_ALWAYS, 5 },
3092 { EVENT_EXIT, 119, CONDITION_ALWAYS, 7 },
3094 { EVENT_EXIT, 144, CONDITION_ALWAYS, 8 },
3095 { EVENT_EXIT, 139, CONDITION_ALWAYS, 35 },
3096 { EVENT_EXIT, 140, CONDITION_ALWAYS, 48 },
3097 { EVENT_EXIT, 118, CONDITION_ALWAYS, 9 },
3098 { EVENT_EXIT, 127, CONDITION_ALWAYS, 10 },
3099 { EVENT_EXIT, 122, CONDITION_ALWAYS, 12 },
3100 { EVENT_EXIT, 145, CONDITION_ALWAYS, 13 },
3101 { EVENT_EXIT, 137, CONDITION_ALWAYS, 43 },
3102 { EVENT_EXIT, 120, CONDITION_ALWAYS, 14 },
3103 { EVENT_EXIT, 113, CONDITION_ALWAYS, 16 },
3104 { EVENT_EXIT, 142, CONDITION_ALWAYS, 52 },
3105 { EVENT_EXIT, 121, CONDITION_ALWAYS, 17 },
3106 { EVENT_EXIT, 143, CONDITION_ALWAYS, 53 },
3107 { EVENT_EXIT, 124, CONDITION_ALWAYS, 20 },
3108 { EVENT_EXIT, 115, CONDITION_ALWAYS, 34 },
3109 { EVENT_EXIT, 141, CONDITION_ALWAYS, 49 },
3111 { EVENT_EXIT, 117, CONDITION_ALWAYS, 22 },
3112 { EVENT_EXIT, 126, CONDITION_ALWAYS, 23 },
3113 { EVENT_EXIT, 134, CONDITION_ALWAYS, 24 },
3115 { EVENT_EXIT, 146, CONDITION_ALWAYS, 60 },
3116 { EVENT_EXIT, 135, CONDITION_ALWAYS, 26 },
3117 { EVENT_EXIT, 136, CONDITION_ALWAYS, 41 },
3118 { EVENT_EXIT, 114, CONDITION_ALWAYS, 27 },
3119 { EVENT_EXIT, 138, CONDITION_ALWAYS, 33 },
3120 { EVENT_EXIT, 131, CONDITION_ALWAYS, 31 },
3123 { 0xc401, 75, CONDITION_ALWAYS, 75 },
3127 { SCENE_EVENTS_END },
3128};
3129
3131 7, 5, 8, 4, 9, 12, 6, 3,
3132 0,
3133};
3134// clang-format on
3135
3137 SC_ADD(SW_X, -PIXELS(1) / 10),
3138 SC_ADD(SW_Z, PIXELS(1) / 10),
3139 SC_ADD(SW_SCALE_X, 7 * Q16_ONE / 128),
3140 SC_ADD(SW_SCALE_Y, -3 * Q16_ONE / 512),
3141 SC_WAIT(1),
3142 SC_LOOP(48, SC_TOP),
3143 SC_POS(0, 0, 0),
3144 SC_WAIT(1),
3145 SC_FREE,
3146};
Ability numbers, named from the English release.
@ ABILITY_DOUSE
Definition ability_ids.h:12
@ ABILITY_MIND_READ
Definition ability_ids.h:16
void ObjectGroup_SetChildValue(struct FieldActor *actor, s32 param)
Sets the param byte of every animated part of an actor's sprite.
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.
Animated sprites: their layers, frames and colour modes, and the resource slots they draw from.
Calls through a function pointer, by argument count.
void(*) SchedulerCallback(void)
#define GARET
Jerald.
#define JENNA
Jasmine.
void Engine_ActorSetSpriteFlags(struct FieldActor *, s32)
struct FieldActor * Engine_ObjectCreate(s32, s32, s32, s32)
The engine calls the debug menus import, and their palette swatch tiles.
Djinn numbers, named from the English release.
@ DJINNI_VINE
Definition djinn_ids.h:14
@ DJINNI_CORONA
Definition djinn_ids.h:27
@ DJINNI_HAIL
Definition djinn_ids.h:22
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,...
Definition djinni.c:124
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
static s32 FieldScheduler_AddCallback(SchedulerCallback callback, s32 priority)
Registers a main-image scheduler callback.
Definition engine_call.h:36
static s32 FieldResource_DecodeType01(const void *source, void *destination)
Decodes type-01 compressed data.
Definition engine_call.h:90
static s32 FieldGameFlag_GetByte(s32 flag)
Definition engine_call.h:71
static void FieldGameFlag_SetByte(s32 flag, s32 value)
Definition engine_call.h:75
void ObjectDispatch_StartIdle(struct DispatchObject *object)
Starts an object on the idle script (a lone SC_END).
Definition objects.c:471
void Map_LoadAreaGraphics(void)
Reloads the world map area's palette and tiles after the still view, puts the default cells back and ...
Definition world_map.c:737
void WorldMap_BeginStillView(void)
Freezes the world map's perspective view as a still picture on BG1: saves BG1's tiles,...
Definition world_map.c:701
void Map_LoadDefaultCellsAndUpdateBlock(void)
Puts the default world map cells back after the still view and returns to the perspective view,...
Definition world_map.c:780
const u8 gWorldMapPalettes[]
const u8 gWorldMapPackedTiles[]
const u8 gWorldMapPackedFrames[]
Field effects, their scripts and the flags that spawn them.
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
void Engine_ObjectSetPosition(struct FieldActor *object, s32 fixed_x, s32 fixed_y, s32 fixed_z)
@ ANIM_WALK
Definition field_event.h:44
@ ANIM_STAND
Definition field_event.h:43
@ ANIM_NOD
Definition field_event.h:45
#define SPEAKER_PORTRAIT_LEFT
Definition field_event.h:54
static s32 Event_OpenMessage(s32 speaker, s32 flags)
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_PsynergyBegin(s32 ability, s32 flags)
struct FieldActor * Engine_ActorLookup(s32 actor)
static void Event_ShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
void Engine_MessageShowCentered(s32 message, s32 flags)
void Engine_ObjectSetPartPalettes(struct FieldActor *object, s32 palette)
s32 Engine_PartyGiveItem(s32 item, s32 flags)
void Engine_EventShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
#define GameFlag_IsSet
#define SPEAKER_PORTRAIT_RIGHT
Definition field_event.h:55
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)
s32 Engine_TaskRemoveCallback(void(*callback)(void))
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
#define EMOTE_IN_FRONT
Definition field_event.h:49
static void Actor_MoveToAndWait(s32 actor, s32 x, s32 z)
s32 Engine_MathSin(s32 angle)
void Engine_ItemShowFound(s32 item, s32 height)
static void Actor_SetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_EventCloseScreen(void)
void Engine_ObjectDispatchRelease(struct FieldActor *object)
static void Actor_RunActionScriptAndWait(s32 actor, const s32 *script)
Runs a script, waiting at most 300 frames for its final command.
void Engine_ActorWalkToAndWait(s32 actor, s32 x, s32 z)
static void Actor_FaceActor(s32 actor, s32 target, s32 frames)
static void ColorBuffer_ApplyTarget(s32 value, s32 mode)
static void Actor_WalkTo(s32 actor, s32 x, s32 z)
#define GameFlag_Clear
void Engine_EventWaitForScreen(void)
#define GameFlag_Set
void Engine_ActorDestroy(s32 actor)
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
void Engine_ObjectSetScript(struct FieldActor *object, const s32 *script)
static s32 Math_Divide(s32 dividend, s32 divisor)
static void Event_ShowTwoMessagesAndWait(s32 speaker, s32 x, s32 y, s32 arg, s32 extra, s32 otherSpeaker, s32 otherX, s32 otherY, s32 otherArg, s32 otherExtra, s32 flags)
void Engine_EventOpenScreen(void)
void Engine_GameFlagSet(s32 flag)
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)
void Engine_CameraFollowActor(s32 actor, s32 keep_position)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
static void Event_ShowMessage(s32 speaker, s32 flags)
void Engine_ActorSetAttachedEffect(s32 actor, s32 effect)
s32 Engine_RandomNext()
static void Event_PlayCue(s32 cue)
void Engine_ActorSetChildValue(s32 actor, s32 value)
static void Actor_SetChildValue(s32 actor, s32 value)
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
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)
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_EventWait(s32 frames)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
void Engine_ColorBufferApplyTarget(s32 value, s32 mode)
void Engine_ColorBufferApplySource(s32 value, s32 mode)
static struct FieldActor * Actor_Get(s32 actor)
Field objects and actors, and the scene transition styles.
@ TRANSITION_BACKDROP_FADE
Definition field_obj.h:16
@ ACTOR_PRIORITY_UNDERFOOT
The depth sort treats it as 320 pixels higher on the screen.
Definition field_obj.h:155
#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
#define FIND_ITEM(item)
@ EVENT_TOUCH
@ EVENT_EXIT
@ EVENT_TALK
@ EVENT_RAISED
@ FACING_STEP
Definition field_scene.h:36
#define PSYNERGY_PHASE_ON_ACTOR(ability, phase)
A Psynergy event on an actor at one phase of the cast, as PSYNERGY_IN_AREA is for an area.
#define SCENE_EXITS(scene)
Definition field_scene.h:72
#define IF_FLAG_SET(flag)
Definition field_scene.h:48
#define USE_ITEM(item)
#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
@ FLAG_PARTY_LEFT_VALE
Definition field_scene.h:50
@ TALK_KEEP_FACING
@ TALK_FACE_PARTY
@ TALK_FACE_PARTY_AND_BACK
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
@ ACTOR_STAND
#define SEARCH(target)
#define SCENE_EXITS_END
Definition field_scene.h:77
#define TOUCH_WALKING_INTO(facing)
#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 PIXELS(value)
@ SEARCH_GROUND
@ SEARCH_UNNAMED
The scene service layer: one typed inline for each engine service a scene calls by its own name,...
static void Event_End(void)
static void Actor_RunRepeatedMotion(s32 actor, s32 repeats)
static s32 Vram_Load(s32 block, s32 size, const void *data)
static void Message_ShowCentered(s32 message, s32 flags)
static void Task_Wait(s32 frames)
static void Event_Begin(void)
static void Actor_WaitForMove(s32 actor)
static void Actor_SetAnimation(s32 actor, s32 animation)
static void Actor_SetAnimationAndWait(s32 actor, s32 animation)
static void Event_Wait(s32 frames)
static void Item_LoadIcon(s32 item)
static void Heap_Release(s32 slot)
static void Actor_Jump(s32 actor, s32 height, s32 frames)
static s32 Event_ChooseYesNo(s32 actor, s32 flags)
static void Event_SetMessage(s32 message)
static void FieldObject_SetPosition(struct FieldActor *object, s32 fixed_x, s32 fixed_y, s32 fixed_z)
static void FieldMap_SetWindowCellTile(s32 a0, s32 a1, s32 a2, s32 a3)
static void * Heap_Allocate(s32 slot, s32 size)
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.
Definition fixed_math.h:10
Game flags, named where their meaning is shown.
#define FLAG_ARRIVE_FALLING
The leader falls into the next scene from 160 pixels above (ObjectEffect_RunPendingFlagEvent),...
Definition flags.h:45
#define FLAG_SHOW_LOCATION_NAME
Definition flags.h:94
#define FLAG_SCENE_TEMP_35
Definition flags.h:766
#define FLAG_BLACK_ORB_RETURNED
The Black Orb did nothing on Babi's ship and was handed back.
Definition flags.h:707
#define FLAG_NO_ENCOUNTERS
No random encounters while set (Encounter_SelectEnemyGroup), unless flag 0x15f is set; debug entrance...
Definition flags.h:59
#define FLAG_DJINNI_0
the flag of Djinni 0, set once it is caught
Definition flags.h:15
#define FLAG_TOLBI_SHIP_REACHED_TOLBI
The ship reached Tolbi. "The ship has arrived safely".
Definition flags.h:425
#define FLAG_SKIP_SCENE_CHANGE_SOUND
The next scene change is silent: the scene loader clears it in place of playing SE_288,...
Definition flags.h:19
#define FLAG_KEEP_MUSIC
The next scene keeps the music that is playing; scene.c clears FLAG_KEEP_MUSIC as it does,...
Definition flags.h:35
#define FLAG_SCENE_TEMP_34
Definition flags.h:765
#define FLAG_TOLBI_SHIP_ROWING
the oars are moving
Definition flags.h:411
#define FLAG_KOLIMA_BRIDGE_COLLAPSED
Kolima's bridge fell as the party crossed it.
Definition flags.h:262
#define FLAG_BUNZAS_WAGON_LEFT
Bunza's wagon has left West Lunpa Cave, with the party aboard or without.
Definition flags.h:126
#define FLAG_LUNPA_TRADE_REOPENED
Definition flags.h:123
#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_WORLD_MAP_TURTLE_BOOTS
buried, found by searching
Definition flags.h:708
#define FLAG_TOLBI_SHIP_AT_ISLAND
at anchor off the island
Definition flags.h:396
#define FLAG_DJINN_TUTORIAL_PART_A
With FLAG_DJINN_TUTORIAL set, these two choose the part of the tutorial the Djinn menu plays: neither...
Definition flags.h:73
#define FLAG_SCENE_TEMP_F8
Definition flags.h:961
#define FLAG_DJINN_TUTORIAL
Definition flags.h:69
#define FLAG_KEEP_PARTY_POSITION
Definition flags.h:93
#define FLAG_SAW_SHIP_FROM_VENUS_LIGHTHOUSE
The party saw the ship from Venus Lighthouse before coming back.
Definition flags.h:274
#define FLAG_LAMAKAN_SAND_MONSTER_BEATEN
on the third map
Definition flags.h:268
#define FLAG_SCENE_TEMP_F0
Definition flags.h:953
#define FLAG_DEBUG_STEPS_OFF
In debug mode, steps on the field are not processed (Field_RunScene) and the world map's places do no...
Definition flags.h:63
#define FLAG_LALIVERO_WOUNDED_SOLDIERS_SEEN
Definition flags.h:275
#define FLAG_SCENE_TEMP_F1
Definition flags.h:954
#define FLAG_GUARDS_SUSPECT_KALAY
Set on the world map; from then on the east guard asks whether the party came from Kalay.
Definition flags.h:283
#define FLAG_NOT_ON_MAP
the current place is not on the world map
Definition flags.h:37
#define FLAG_DJINN_TUTORIAL_PART_B
Definition flags.h:74
#define FLAG_MENU_OPEN
Set while the field menu is open; scenes hold their moving actors still.
Definition flags.h:23
The frame loop's globals: lag counts, the CPU load display and the VBlank flags.
u8 gDebugMode
Debug builds: Start+Select pauses the frame loop.
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.
Definition djinn.c:65
u32 * DjinnRecovery_AddStandby(u32 owner, u32 element, u32 djinnIndex)
Puts the owner's Djinni at the end of its side's list on standby (turns -1), moving it there if it wa...
Definition djinn.c:185
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[]
void * gEffectWork
Slot 56: points to a scene-specific structure.
The screen blend's globals and the graphics routines.
void * Runtime_BumpAllocateAlternatePool(s32 size)
As MemAlloc, but tries EWRAM first.
Definition heap.c:140
s32 Menu_AnimateSelectionToEntry(s32 start, s32 command)
Opens the field command menu and animates from start to the command's icon.
Definition icon_menu.c:495
The main-image routines scene overlays import.
s32 DjinnMenu_Open(void)
s32 PartyInventory_Discard(s32 itemId)
Discards one itemId from whoever carries it first, as Inventory_Discard does; always returns 0.
Definition inventory.c:422
gOverflowItem, an item slot the spoils code uses when items are handed out.
void IoWriteQueue_Store16(u32 address, u32 value)
Queues a halfword store.
Definition io_queue.c:21
The hardware's I/O registers and their bits, as pret names them.
#define PLTT_BACKDROP
Definition io_reg.h:155
The register write queue that VBlank carries out after each finished frame.
#define IO_WRITE_QUEUE_PUSH(address, value, control)
Disables interrupts to add one register write or DMA to the queue; a write to a full queue is dropped...
Item numbers, named from the English release.
@ ITEM_TURTLE_BOOTS
Definition item_ids.h:83
@ ITEM_BLACK_ORB
Definition item_ids.h:80
The IWRAM call layer: the routines the game keeps resident in IWRAM, each at its fixed address,...
#define Iwram_MulQ16(left, right)
Definition iwram_call.h:127
@ ACTOR_BUNZA
Definition kalay.c:72
@ ACTOR_WAGON
Definition kalay.c:70
@ ACTOR_HAMMET
Definition kalay.c:71
@ ACTOR_VENUS_DJINNI
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,...
Definition math.c:23
The heaps: allocating and freeing blocks.
void MemFree(void *buffer)
The reel game's title lettering.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#define SC_LABEL(n)
Branch destination.
Definition objcmd.h:11
#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_SYNC
Wait for arrival.
Definition objcmd.h:17
#define SC_TO(n)
Definition objcmd.h:12
#define SC_ADD(w, v)
Definition objcmd.h:38
#define SC_ARG(v)
Definition objcmd.h:44
#define SC_MOVE(x, y, z)
Move toward the target.
Definition objcmd.h:19
#define SC_WAIT(n)
Wait n frames.
Definition objcmd.h:16
#define SC_TOP
Script start.
Definition objcmd.h:13
#define SC_END
Return to the main script.
Definition objcmd.h:32
#define SC_MOVE_BY(x, y, z)
Move by a relative offset.
Definition objcmd.h:20
@ SW_SCALE_Y
Definition objcmd.h:63
@ SW_Z
Definition objcmd.h:60
@ SW_FACING
Definition objcmd.h:57
@ SW_X
Definition objcmd.h:58
@ SW_SCALE_X
Definition objcmd.h:62
#define SC_CALL(fn)
Definition objcmd.h:50
void Event_SetDestination(s32 scene, s32 entrance)
Makes the event leave for the given entrance of the given scene: raises the exit request 999 and writ...
Definition events.c:517
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
void BattleFx_ScheduleRatioTransition(s32 zoom, s32 frames)
Starts a zoom to zoom (16.16) over frames frames, on the world map (event mode 3) only.
Definition view.c:69
void Event_WaitForZoomTransition(void)
Waits for a zoom transition to end (on the world map only, at most 300 frames).
Definition view.c:94
void FieldObject_WaitForMove(void *fieldObject)
Waits a frame at a time until a field object has arrived at its target, at most 600 frames.
void PaletteGlow_Update(s32 phase, s32 brightness)
Sets the window colours (BG palette 15, colours 4 to 10) for a window hue (0 to 23) and brightness (0...
Definition options.c:152
Palette fades, the battle effect palette buffers and the colour channel curves.
@ PALETTE_TRANSFORM_MUTED
Definition palbuf.h:76
@ PALETTE_TRANSFORM_PLAIN
each colour unchanged
Definition palbuf.h:72
@ PALETTE_TRANSFORM_WARM
Definition palbuf.h:75
#define DJINN_NO_HOP
Field_RequestDjinnBattle's flag: the Djinni does not hop first.
void Field_RequestBattleFromEncounterTable(s32 zoneNo, s32 slotNo)
Sets up a battle with enemy group slot of encounter table zone.
Definition requests.c:14
void Field_RequestDjinnBattle(s32 flag, s32 no)
Sets up the battle with Djinni number no.
Definition requests.c:35
static s32 WorldMap_ApplyMapRotation(struct ScriptInterpreter *interpreter)
Aligns the actor's sprite rotation to the map.
Definition world_map.c:260
s32 gTransferArrive13[]
Definition world_map.c:2559
static s32 WorldMap_InitializeProgressMarker(struct ScriptInterpreter *interpreter)
Resets the map marker after the corresponding story progress.
Definition world_map.c:287
s32 gTransferArrive12[]
Definition world_map.c:2523
static void WorldMap_ShakeTransferStartCamera(void)
Shakes the camera around the departure point.
Definition world_map.c:967
s32 gWorldMapPlacement4[]
Definition world_map.c:2851
struct ScenePlacement gWorldMapPlacements80[]
Definition world_map.c:3032
static void Event_MeetFlint(void)
Walking up to Flint: he joins the party and shows how Djinn are set and put on standby; then comes th...
Definition world_map.c:1222
s32 gTransferDepart10[]
Definition world_map.c:2459
s32 gWorldMapTriggerActor
Definition world_map.c:1430
static void WorldMap_DepartWithTravelers(void)
Stages the travelers' departure and their transfer to the next scene.
Definition world_map.c:695
s32 gActorEightPuffScript[]
Definition world_map.c:3136
static UNUSED void WorldMap_UpdateCyclingLinkedEffects(struct FieldActor *actor)
Cycles an unused actor's palettes and periodically creates linked effects.
Definition world_map.c:2420
static void WorldMap_RunOpeningRise(void)
Stages the rising actor and its trailing puffs before the next arrival.
Definition world_map.c:2129
static void WorldMap_BoardBunzasWagon(void)
Out of West Lunpa Cave by wagon: Bunza and Hammet nod to each other and climb aboard with the hero,...
Definition world_map.c:630
static void Event_MeetCorona(void)
Walking near Corona, or talking to him: once a battle is nearly due, Corona fights.
Definition world_map.c:132
u32 gWorldMapRewards[]
Definition world_map.c:3130
static void WorldMap_TransferToExit102(void)
Stages the next leg of travel and leaves through exit 102.
Definition world_map.c:1022
static void WorldMap_MoveShakeCamera(s32 x, s32 z)
Moves to the next camera-shake point and holds it for four frames.
Definition world_map.c:961
static void Event_StartDousingTravelMarker(void)
Starting to cast Douse on the marker.
Definition world_map.c:2235
static void WorldMap_ShakeTransferLandingCamera(void)
Shakes the camera around the landing point.
Definition world_map.c:983
static void Event_SearchShipwreck(void)
Searching the shipwreck.
Definition world_map.c:1654
u16 gWorldMapBlend
Definition world_map.c:1819
s32 gTransitionSparkScript[]
Definition world_map.c:2679
s32 gPresentGuide5[]
Definition world_map.c:2659
static void WorldMap_PulseOrbAndSpawnSparks(union FieldObject *fieldObject)
Pulses the orb's scale and emits short-lived sparks.
Definition world_map.c:169
static void Event_TalkAboutBlackOrb(void)
Talking to the one who gave the Black Orb (or reading his mind): he urges its use.
Definition world_map.c:1628
static void WorldMap_UpdateLocationContacts(void)
Culls distant location sprites and detects the leader touching nearby ones.
Definition world_map.c:416
s32 gTransferGuide14[]
Definition world_map.c:2595
s32 gTransferGather[]
Definition world_map.c:2475
struct ScenePlacement gWorldMapPlacements64[]
Definition world_map.c:2966
s32 gTransferLeaderTurn[]
Definition world_map.c:2692
static void WorldMap_CompleteTransfer(void)
Finishes the journey and restores the leader's movement.
Definition world_map.c:1166
static void WorldMap_TransferToTolbiShipInteriors(void)
Stages the travelers' arrival in the ship interior.
Definition world_map.c:1103
#define ACTOR
The one actor placed for entrance 75, which travels north to exit 110.
Definition world_map.c:86
static void Event_DouseTravelMarker(void)
Douse on the marker: the party comes down and a battle begins.
Definition world_map.c:2242
s32 gTransferReturn12[]
Definition world_map.c:2552
struct ScenePlacement gWorldMapPlacements[]
Definition world_map.c:2863
#define SITE
Definition world_map.c:1670
static UNUSED void WorldMap_UpdateBlinkingLinkedEffects(struct FieldActor *actor)
Blinks an unused actor and periodically creates its linked effects.
Definition world_map.c:2407
static void WorldMap_ActivateSite138(s32 actor)
Turns the exit at cell code 138 into a touch event that runs Event_StopLeavingShip,...
Definition world_map.c:1582
static void WorldMap_PlayLighthouseTransition(s32 palette)
Animates the lighthouse transition frames, palette, and camera.
Definition world_map.c:2341
struct ScenePlacement gWorldMapPlacements49[]
Definition world_map.c:2990
s32 gTransferReturn11[]
Definition world_map.c:2516
static void Event_UseBlackOrb(void)
Using the Black Orb on the shipwreck: nothing happens, the orb is taken back and the party is to pres...
Definition world_map.c:1676
static void WorldMap_JitterTransitionCamera(void)
Jitters the view around the selected actor during the transition.
Definition world_map.c:2300
static void WorldMap_RestoreExitTrigger(void)
Makes cell code 138 an exit again, to exit 33.
Definition world_map.c:1608
s32 gTransferArrive11[]
Definition world_map.c:2487
@ TRANSITION_EFFECT_TYPE
Definition world_map.c:1812
@ TRANSITION_EFFECT_TOP
Definition world_map.c:1814
@ TRANSITION_EFFECT_WIDTH
Definition world_map.c:1815
@ TRANSITION_EFFECT_DEPTH
Definition world_map.c:1816
@ TRANSITION_EFFECT_LEFT
Definition world_map.c:1813
const struct ScenePlacement * WorldMap_GetPlacements(void)
Definition world_map.c:308
static void WorldMap_MoveActorEightToExit(void)
Moves the arrival actor along the staged route to its exit.
Definition world_map.c:2015
static void Event_MeetVine(void)
Walking near Vine, or talking to him: once a battle is nearly due, half the time Vine fights; otherwi...
Definition world_map.c:114
static void WorldMap_SpawnActorEightPuff(void)
Spawns a puff behind the moving actor at staggered intervals.
Definition world_map.c:2091
static void Event_PassThroughFirstNorthSouthPassage(void)
As Event_PassThroughWestEastPassage, for a passage crossed north to south.
Definition world_map.c:389
static void WorldMap_SelectExitByZ(s32 trigger, s32 exitBefore, s32 exitAfter)
Chooses a passage exit from the leader's north-south approach.
Definition world_map.c:364
static void WorldMap_UpdateAirborneTravelTimer(void)
Rotates the traveler and counts down to the raised travel event.
Definition world_map.c:2167
s32 gOpeningLeaderRise[]
Definition world_map.c:2700
static void Event_PassThroughWestEastPassage(void)
Walking into a passage: the side the party comes from decides which exit takes it through to the othe...
Definition world_map.c:383
static void WorldMap_TransferToExit106(void)
Stages the next leg of travel and leaves through exit 106.
Definition world_map.c:1132
struct SceneEntrance gWorldMapEntrances[]
Definition world_map.c:2717
static void WorldMap_RunBlackOrbScene(void)
Introduces the Black Orb and prompts Isaac to use it on the ship.
Definition world_map.c:1498
static UNUSED void WorldMap_CycleActorPalettes(struct FieldActor *actor)
Advances an unused actor's palette on odd frames.
Definition world_map.c:2430
s32 WorldMap_Initialize(void)
Restores the map's state and runs the sequence its arrival entrance selects: 90 and 91 carry the part...
Definition world_map.c:506
struct ScenePlacement gWorldMapPlacements72[]
Definition world_map.c:3048
static void WorldMap_UpdateTransitionEffect(void)
Scatters transition particles and jitters the camera.
Definition world_map.c:1975
static void Event_EnterTransferRoute(void)
Walking onto this spot: the first time the travel scene plays, later it is an ordinary entrance.
Definition world_map.c:476
static s32 WorldMap_ComputeOpposingRewardTotals(void)
Subtracts the opposing pair's rewards from the first pair's total.
Definition world_map.c:2054
static void WorldMap_StartTransitionEffect(void)
Starts the sparkling travel transition and fades out to its destination.
Definition world_map.c:1942
static void Event_MeetHail(void)
Walking near Hail, or talking to him: once a battle is nearly due, Hail fights.
Definition world_map.c:147
static void WorldMap_ShowTransitionFrame(u8 *buffer, s32 offset, s32 frames)
Displays a transition frame before advancing its animation delay.
Definition world_map.c:2331
s32 gWorldMapPlacement3[]
Definition world_map.c:2856
static void Event_PassThroughThirdNorthSouthPassage(void)
As Event_PassThroughFirstNorthSouthPassage.
Definition world_map.c:401
s32 gWorldMapPlacement1[]
Definition world_map.c:2846
s32 gPresentGuide9[]
Definition world_map.c:2621
struct SceneEvent gWorldMapEvents[]
Definition world_map.c:3060
static void WorldMap_UpdateBobbingMarker(union FieldObject *fieldObject)
Cycles the marker's palette and orbits it around its map position.
Definition world_map.c:201
const struct SceneEntrance * WorldMap_GetEntrances(void)
Definition world_map.c:240
s32 gTransferArrive10[]
Definition world_map.c:2441
static s32 WorldMap_ApplyMapRotationAndMode(struct ScriptInterpreter *interpreter)
Aligns the actor to the map and selects its flagged animation mode.
Definition world_map.c:250
const struct SceneRegion * WorldMap_GetRegions(void)
Definition world_map.c:244
s32 gWorldMapPlacement2[]
Definition world_map.c:2841
s32 gTransferDepart11[]
Definition world_map.c:2505
static void Event_LeaveEastward(void)
Walking east off this edge of the map, once allowed.
Definition world_map.c:488
const u32 * WorldMap_GetExits(void)
Definition world_map.c:246
s32 gWorldMapPlacement0[]
Definition world_map.c:2712
static void Event_PassThroughSecondNorthSouthPassage(void)
As Event_PassThroughFirstNorthSouthPassage.
Definition world_map.c:395
static void WorldMap_StartAirborneTravel(s32 targetActor)
Moves the selected actor toward the travel marker and starts its timer.
Definition world_map.c:2191
static s32 WorldMap_ApplyMapRotationAndCollision(struct ScriptInterpreter *interpreter)
Enables the actor's collision and aligns its sprite to the map.
Definition world_map.c:272
static void WorldMap_UpdateTransitionBlend(void)
Refreshes the transition's blend registers on alternating frames.
Definition world_map.c:2289
struct ScenePlacement gWorldMapPlacements71[]
Definition world_map.c:3022
@ ACTOR_MERCURY_DJINNI
Definition world_map.c:99
@ ACTOR_MARS_DJINNI
Definition world_map.c:98
static s32 WorldMap_GetSelectedReward(u32 selection)
Looks up the reward selected by the first set progress flag.
Definition world_map.c:2065
static void Event_EnterAirborneTravel(void)
Walking onto the marker: the party is lifted up into the air.
Definition world_map.c:2228
static void Event_FinishAirborneTravel(void)
When the time in the air runs out: the party and the marker fly off, and the map reopens elsewhere.
Definition world_map.c:2262
s32 gTransferReturn13[]
Definition world_map.c:2588
struct ScenePlacement gWorldMapPlacements65[]
Definition world_map.c:3004
static s32 WorldMap_BlinkActorSprite(struct ScriptInterpreter *interpreter)
Blinks a visible actor on alternating frames.
Definition world_map.c:301
static void WorldMap_SelectExitByX(s32 trigger, s32 exitBefore, s32 exitAfter)
Chooses a passage exit from the side of the actor the leader approaches.
Definition world_map.c:347
const struct SceneEvent * WorldMap_GetEvents(void)
Definition world_map.c:412
s32 gBlackOrbLeaderScript[]
Definition world_map.c:2608
static s32 WorldMap_InitializeFirstDjinni(struct ScriptInterpreter *interpreter)
Animates the first Djinni until it has met the party.
Definition world_map.c:223
static void WorldMap_TransferToExit104(void)
Stages the next leg of travel and leaves through exit 104.
Definition world_map.c:1074
#define WORLD_MAP_QUEUE_TRANSITION_FRAME(buffer, offset)
Definition world_map.c:1821
static void WorldMap_ShowDjinnTutorial(void)
Demonstrates setting a Djinni and placing it on standby.
Definition world_map.c:1193
static void WorldMap_DisembarkCarriage(void)
Brings the carriage to a stop and lets Isaac disembark.
Definition world_map.c:1434
@ CONTACT_TRIGGER_BASE
Definition world_map.c:90
@ FLAG_CONTACT_BLOCKED
Definition world_map.c:91
@ CONTACT_LAST_ACTOR
Definition world_map.c:89
s32 gTransferDepart13[]
Definition world_map.c:2577
static void WorldMap_UpdateTransferredActorLanding(void)
Keeps the transferred actor above the guide and triggers its landing once.
Definition world_map.c:1001
static void WorldMap_TransferToExit103(void)
Stages the next leg of travel and leaves through exit 103.
Definition world_map.c:1045
s32 gTransferLeaderIdle[]
Definition world_map.c:2684
struct ScenePlacement gWorldMapPlacements73[]
Definition world_map.c:3054
static void Event_StopLeavingShip(void)
Walking away from the shipwreck with the Black Orb: the hero walks back.
Definition world_map.c:1641
static void WorldMap_ReleaseSparkAfterDelay(union FieldObject *fieldObject)
Releases the spark after its initial timer step.
Definition world_map.c:159
static void Event_PassThroughFourthNorthSouthPassage(void)
As Event_PassThroughFirstNorthSouthPassage.
Definition world_map.c:407
s32 gPresentGuide8[]
Definition world_map.c:2641
u32 gWorldMapExits[]
Definition world_map.c:2802
s32 gTransferDepart12[]
Definition world_map.c:2541
static void WorldMap_ShowEndingScene(void)
Shows Jenna and Kraden's closing scene before returning to the title.
Definition world_map.c:1826
s32 gTransferReturn10[]
Definition world_map.c:2470
struct ScenePlacement gWorldMapPlacements66[]
Definition world_map.c:3016
Scene numbers, named after their places.
char SceneId_Title
char SceneId_WorldMap
char SceneId_MercuryLighthouseAerie1
char SceneId_VenusLighthouseAerie
The field object script interpreter and the operands its commands read.
Song and sound effect ids, indices into gSound_SongTable.
#define MUS_042
Definition songs.h:50
#define MUS_081
Definition songs.h:80
#define SE_107
Definition songs.h:100
#define SE_MENU_CURSOR_MOVE
Definition songs.h:104
#define SE_219
Definition songs.h:214
#define SE_131
Definition songs.h:124
#define SE_MAP_EXIT
Definition songs.h:116
#define MUS_017
Definition songs.h:27
#define SE_141
Definition songs.h:134
#define SE_145
Definition songs.h:138
#define SE_246
Definition songs.h:241
#define SE_244
Definition songs.h:239
#define SE_289
Definition songs.h:282
#define MUS_009
Definition songs.h:19
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_TaskWait()
void Engine_EventSetMessage()
void Engine_EventShowMessage()
#define NULL
Definition bilibin.h:6
void WorldMap_CreateLinkedEffects(struct FieldActor *parent)
Attaches two rising particles to the actor, sharing the effect's cached tiles.
void WorldMap_EndEvent(void)
Ends what WorldMap_BeginEvent started: on the world map, reloads the area's graphics and sets the cam...
Definition step.c:484
void WorldMap_BeginEvent(void)
Starts an event or menu on the world map: ends any colour ratio transition in progress,...
Definition step.c:464
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
u16 rotation
1/65536 turns
Definition animspr.h:118
u8 flags
bits: 1 outlined in ObjectSystemWork's edge and fill colours | 0 shadow drawn (set when created)
Definition animspr.h:128
u8 slot
VRAM cache entry holding its tiles.
Definition animspr.h:112
u8 count
layers in use, up to the last one present
Definition animspr.h:129
s32 scale
16.16 fixed point, 0x10000 full size
Definition animspr.h:111
u16 fullColor
256 colours; set for both parts when created
Definition animspr.h:94
u16 priority
2 when created
Definition animspr.h:100
The work of a Psynergy effect scene: its caster and target, where it takes place, the map state it re...
Definition fx_scene.h:31
s8 childOption
Set by some scenes before an effect; Carry, Frost, Force and Reveal treat the target differently with...
Definition fx_scene.h:52
A field object as the object dispatcher's far calls take it.
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
Definition event_work.h:20
s32 encounterThreshold
encounter steps before a battle
Definition event_work.h:41
u16 encounterEnemyGroup
the next battle's enemy group, 0 for none
Definition event_work.h:32
s16 raisedTrigger
a raised event for Scene_RunRaisedEvent
Definition event_work.h:35
s32 startTransition
SCENE_TRANSITION(style, variant).
Definition event_work.h:43
u16 unk172
FieldWork's menu request; scenes set it to 1.
Definition event_work.h:29
s32 encounterBias
randomized distance adjustment between battles
Definition event_work.h:40
s32 transitionFrames
frames
Definition event_work.h:45
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
s16 timer
The parameter its action script reads (a follow distance or an angle to face), the player's frames to...
Definition field_obj.h:109
s32 speed
speed limit, 16.16 fixed-point pixels per frame
Definition field_obj.h:55
u16 radius
Collision radius in pixels: 16, or half the sprite metadata's boxY, when created; the overlap checks ...
Definition field_obj.h:43
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
u8 paused
nonzero skips its script and motion, not its update
Definition field_obj.h:93
s32 bounce
The share of its falling speed kept as it bounces on landing, 16.16 fixed point (0x4000 when created)...
Definition field_obj.h:64
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
u8 spriteStorageKind
Zero hides sprites; one draws a single sprite, two draws a group.
Definition field_obj.h:78
s32 gravity
Taken off the vertical velocity each frame while it is above the ground, in 16.16 fixed-point pixels ...
Definition field_obj.h:68
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 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
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
Definition field_obj.h:116
u16 work
The side of the player's next footprint (2 after a stop), or scene scratch.
Definition field_obj.h:112
u8 collisionFlags
bits: 7 refuses to move into a solid object | 4 nearer for Psynergy targets | 3 never a talk or Psyne...
Definition field_obj.h:91
u8 frozen
Nonzero skips steering, terrain, gravity and floating; its velocity still moves it (ScriptMotionObjec...
Definition field_obj.h:104
The game's state: play time, coins, the scene and the leader's position, the active party and the opt...
Definition game_state.h:14
u8 paletteGlow[2]
window hue (0 to 24), brightness
Definition game_state.h:62
s32 encounterSteps
the encounter count, reset with a new group
Definition game_state.h:105
s16 entrance
Definition game_state.h:37
u8 movementMode
1 while the leader is climbing, 0 otherwise
Definition game_state.h:57
s32 selectedActor
the leader: its unit and its actor
Definition game_state.h:59
s16 savedScene
where a defeat returns to without a defeat point
Definition game_state.h:38
s16 savedEntrance
where a defeat returns to without a defeat point
Definition game_state.h:39
The world map's perspective work (struct PerspectiveWork) as the world map scene sees it,...
u16 rotation
PerspectiveWork's yaw, 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...
u32 value
A message below 0x10000, else an event function; for an exit, the exit kind its scene's exit table ma...
u32 control
The kind and its detail, read by Scene_FindEvent and the item, Psynergy and search lookups; -1 ends t...
An actor a scene places: its sprite, the condition for placing it, how it behaves,...
Definition field_scene.h:81
s32 x
16.16 fixed-point pixels
Definition field_scene.h:91
u16 facing
1/65536 turns (enum Facing)
Definition field_scene.h:94
s32 z
16.16 fixed-point pixels
Definition field_scene.h:93
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.
Definition script.h:16
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
Values that differ by patch level or language, chosen once for their code.
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
#define UNUSED
Definition types.h:22
unsigned char u8
Definition types.h:11
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_RestoreHpPp(s32 cureConditions)
Restores every party member's HP and PP; with cureConditions 1 it also cures poison and haunting.
Definition units.c:662
The patch levels: our groups of the measured changes from the Japanese release.
The sprite VRAM block cache and its owners.
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; ...
Definition messages.c:216