Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag780.c
Go to the documentation of this file.
1/*
2 * WSTAG780: Street Corner, Kusanagi City (the Real World). Junior's town
3 * outside the MAGAMI Online Center; the news of the undersea base attack and
4 * the ending.
5 */
6
7#include "common.h"
8#include "field/stage.h"
9/* Defined below, after the code that uses them */
10extern u8 flyerFrames[];
11extern Vec2 flyerStarts[2][2][2];
16extern u8 *byteAnims[];
17
18/* The file of the stage's sprites, which the versions number differently */
19#if VERSION_US || VERSION_JP
20#define SPRITES 0x1B7
21#elif VERSION_EU
22#define SPRITES 0x1C5
23#endif
24
25/* Draws the sprite at (x, y), flipped when it goes right */
26void drawFlyer(StageFlyer *task) {
27 SpriteDrawer drawer;
28 s32 pos[2];
29
30 initSpriteDrawer(&drawer);
31 pos[0] = task->x >> 8;
32 pos[1] = task->y >> 8;
33 drawer.setLayerId(FIELD_LAYER_MAP, 2);
34 drawer.setTexture(0x140, 0x100);
35 drawer.setAltClut(0, 0x1F0);
36 drawer.setPivot(pos[0], pos[1]);
37 if (task->right) {
38 drawer.setScale(-0x1000, 0x1000, 0x1000);
39 }
40 drawer.draw(FILE_CACHE.getEntry(SPRITES << 16), task->frame, pos[0], pos[1]);
41}
42
43/* Moves the sprite diagonally unless it is still, animates it and ends it off screen */
45 switch (task->state) {
46 case TASK_INIT:
47 default:
48 task->nextState(task);
49 break;
50 case TASK_RUN:
51 if (!task->still) {
52 if (task->right) {
53 task->x += 0x500;
54 } else {
55 task->x -= 0x500;
56 }
57 if (task->up) {
58 task->y -= 0x280;
59 } else {
60 task->y += 0x280;
61 }
62 }
63 task->timer += GFX.funcs.getFrameTime();
64 if (task->timer >= 8) {
65 task->timer = 0;
66 }
67 if (task->anim != 0 && task->still) {
68 task->frame = 0x3B;
69 } else {
70 task->frame = flyerFrames[(task->timer >> 2) + task->up * 2 + task->anim * 4];
71 }
72 if (task->right) {
73 if (task->x >= 0x28000) {
74 task->setState(task, TASK_KILL);
75 }
76 } else if (task->x <= 0) {
77 task->setState(task, TASK_KILL);
78 }
79 drawFlyer(task);
80 break;
81 case TASK_DONE:
82 case TASK_KILL:
83 break;
84 }
85}
86
87/* Creates a flyer at the start the direction and stillness pick */
88void *createFlyer(s32 up, s32 right, s32 still, s32 anim) {
89 StageFlyer *task = createTask(updateFlyer, sizeof(StageFlyer), 0);
90
91 task->up = up;
92 task->right = right;
93 task->still = still;
94 task->anim = anim;
95 task->x = flyerStarts[up][right][still].x << 8;
96 task->y = flyerStarts[up][right][still].y << 8;
97 if (still && anim) {
98 task->x += 0x3200;
99 task->y -= 0x1900;
100 }
101 return task;
102}
103
104/* Draws the picture of file SPRITES with the frame of the level */
105void drawGlow(StageGlow *task) {
106 SpriteDrawer drawer;
107
108 initSpriteDrawer(&drawer);
109 drawer.setLayerId(FIELD_LAYER_MAP, 7);
110 drawer.setTexture(0x140, 0x100);
111 drawer.setAltClut(0, 0x1F0);
112 drawer.draw(FILE_CACHE.getEntry(SPRITES << 16), task->level >> 2, 0xDA, 0x47);
113}
114
115/* Raises the level with a sound, waits, lowers it and ends, drawing it */
117 switch (task->state) {
118 case TASK_INIT:
119 default:
120 task->level = 12;
123 } else {
125 }
126 task->nextState(task);
127 break;
128 case TASK_RUN:
129 switch (task->substate) {
130 case 0:
131 default:
132 task->level += GFX.funcs.getFrameTime();
133 if (task->level >= 0x1C) {
134 task->level = 0x1C;
135 task->nextSubstate(task);
136 }
137 break;
138 case 1:
139 task->step += GFX.funcs.getFrameTime();
140 if (task->step >= 0x8C) {
141 task->nextSubstate(task);
142 }
143 break;
144 case 2:
145 task->level -= GFX.funcs.getFrameTime();
146 if (task->level < 0xD) {
147 task->level = 12;
148 task->setState(task, TASK_KILL);
149 }
150 break;
151 }
152 drawGlow(task);
153 break;
154 case TASK_DONE:
155 case TASK_KILL:
156 break;
157 }
158}
159
160/* Command 802 of the event scripts: the glow (updateGlow) of the MAGAMI Online Center's events */
162 return createTaskWithId(updateGlow, sizeof(StageGlow), 0, arg);
163}
164
166
167/* Draws the sprite of the effect at (x, y) at depth 4 of LAYER while it runs */
168void drawEffect(StageEffect *task, void *arg) {
169 SpriteDrawer drawer;
170 Layer *layer = arg;
171
172 if (task->state == TASK_RUN) {
173 initSpriteDrawer(&drawer);
174 drawer.setTexture(0x140, 0x100);
175 drawer.setLayer(layer, 4);
176 drawer.setClutRow(0);
177 drawer.draw(FILE_CACHE.getEntry(FIELDSTG_state.sheetEntry), task->frame, task->x, task->y);
178 }
179}
180
181/* A looping sprite animation at the place key1 picks, started at a random point */
184
185 switch (task->state) {
186 case TASK_INIT:
187 default:
188 task->x = updateEffectSpots[task->key1].x;
189 task->y = updateEffectSpots[task->key1].y;
190 task->anim.index = RANDOM.next() & 1;
191 task->anim.timer = RANDOM.next() % 3 + 2;
192 task->frame = 0;
193 task->nextState(task);
194 break;
195 case TASK_RUN:
196 task->frame = stepLoopingAnimation(&task->anim, updateEffectSpots[task->key1].frames, 0);
197 if (task->frame != 0) {
198 layer->addSortedCallback(layer, drawEffect, task, task->y, 0);
199 }
200 break;
201 case TASK_DONE:
202 case TASK_KILL:
203 break;
204 }
205}
206
207/* Creates the task of updateEffect with KEY as its key1 */
208void *createEffect(s32 key) {
209 Task *task = createTask(updateEffect, 0x60, 0);
210
211 task->key1 = key;
212 return task;
213}
214
215/*
216 * Steps OBJ's animation through FRAMES by the frame time (at most 4),
217 * looping at the end (frame 0xFF), and returns its frame. depth is 0 for the
218 * caller
219 */
221 AnimFrame *frame = &frames[obj->anim.index];
222 s32 dt = GFX.funcs.getFrameTime();
223
224 if (dt > 4) {
225 dt = 4;
226 }
227 if (depth == 0) {
228 obj->anim.timer -= dt;
229 }
230 if (obj->anim.timer <= 0) {
231 frame++;
232 obj->anim.index++;
233 obj->anim.timer += frame->duration;
234 if (frame->frame == 0xFF) {
235 frame = frames;
236 obj->anim.index = 0;
237 obj->anim.timer += frame->duration;
238 }
239 stepTileLoopAnimation(obj, frames, depth + 1);
240 }
241 return frame->frame;
242}
243
244/* Shows and loops the animations of the map objects with animations 1 and 2 */
246 StageTile *t;
247 StageTile *tile;
248 s32 i;
249
250 switch (task->state) {
251 case TASK_INIT:
252 default:
253 task->tiles[0].anim.index = 0;
255 task->tiles[1].anim.index = 0;
257 for (t = FIELDSTG_state.objects; t->margin != 0; t++) {
258 switch (t->anim) {
259 case 1:
260 task->tiles[0].tile = t;
261 break;
262 case 2:
263 task->tiles[1].tile = t;
264 break;
265 }
266 }
267 task->nextState(task);
268 break;
269 case TASK_RUN:
270 for (i = 0; i < 2; i++) {
271 tile = task->tiles[i].tile;
272 tile->visible = 1;
273 tile->frame = stepTileLoopAnimation(&task->tiles[i], updateTileLoop2Frames[i], 0);
274 tile->clutRow = 0;
275 }
276 break;
277 case TASK_DONE:
278 case TASK_KILL:
279 break;
280 }
281}
282
283/* Creates the looping map objects with animations 1 and 2 (updateTileLoop2) */
284void *createTileLoop2(void) {
285 return createTask(updateTileLoop2, sizeof(StageTileLoop2), 0);
286}
287
288/* Creates the six objects of updateEffect (keys 0-5) and the object of updateTileLoop2 */
289void updateEffectSet(StageTask *task, void **children) {
290 s32 i;
291
292 switch (task->state) {
293 case TASK_INIT:
294 default:
295 for (i = 0; i < 6; i++) {
296 children[i] = createEffect(i);
297 }
298 children[6] = createTileLoop2();
299 task->nextState(task);
300 break;
301 case TASK_RUN:
302 case TASK_DONE:
303 case TASK_KILL:
304 break;
305 }
306}
307
308/* Creates the stage's six effects and its looping map objects (updateEffectSet) */
309void *createEffectSet(void) {
310 return createTask(updateEffectSet, 0x50, 0x1C);
311}
312
313/* Lets out the flyers of the sets that are on, where their children are free */
314void releaseFlyers(StageFlyerGate *task, void **children) {
315 s32 animA;
316 s32 animB;
317
318 if (task->spawnA) {
319 animA = RANDOM.next() & 1;
320 if (children[0] == NULL) {
321 children[0] = createFlyer(0, 0, 0, animA);
322 }
323 if (children[3] == NULL) {
324 children[3] = createFlyer(1, 1, 0, 0);
325 }
326 }
327 if (task->spawnB) {
328 animB = RANDOM.next() & 1;
329 if (children[0] == NULL) {
330 children[0] = createFlyer(0, 0, 1, 0);
331 }
332 if (children[3] == NULL) {
333 children[3] = createFlyer(0, 0, 1, 1);
334 }
335 if (children[1] == NULL) {
336 children[1] = createFlyer(1, 0, 0, 0);
337 }
338 if (children[2] == NULL) {
339 children[2] = createFlyer(0, 1, 0, animB);
340 }
341 }
342}
343
344/* Draws the three pictures of the gate */
346 SpriteDrawer drawer;
347
348 initSpriteDrawer(&drawer);
349 drawer.setLayerId(FIELD_LAYER_MAP, 2);
350 drawer.setTexture(0x140, 0x100);
351 drawer.setAltClut(0, 0x1F0);
352 drawer.setClutRow((GFX.funcs.getTime() >> 1) & 1);
353 switch (task->left) {
354 case 0:
355 default:
356 drawer.draw(FILE_CACHE.getEntry(SPRITES << 16), 0x44, 0xC6, 0xB3);
357 break;
358 case 1:
359 drawer.draw(FILE_CACHE.getEntry(SPRITES << 16), 0x45, 0xC6, 0xBC);
360 break;
361 case 2:
362 drawer.draw(FILE_CACHE.getEntry(SPRITES << 16), 0x46, 0xC6, 0xC4);
363 break;
364 }
365 switch (task->left) {
366 case 0:
367 default:
368 drawer.draw(FILE_CACHE.getEntry(SPRITES << 16), 0x44, 0x156, 0xFB);
369 break;
370 case 1:
371 drawer.draw(FILE_CACHE.getEntry(SPRITES << 16), 0x45, 0x156, 0x104);
372 break;
373 case 2:
374 drawer.draw(FILE_CACHE.getEntry(SPRITES << 16), 0x46, 0x156, 0x10C);
375 break;
376 }
377 switch (task->right) {
378 case 0:
379 default:
380 drawer.draw(FILE_CACHE.getEntry(SPRITES << 16), 0x41, 0xEA, 0xB3);
381 break;
382 case 1:
383 drawer.draw(FILE_CACHE.getEntry(SPRITES << 16), 0x42, 0xEA, 0xBC);
384 break;
385 case 2:
386 drawer.draw(FILE_CACHE.getEntry(SPRITES << 16), 0x43, 0xEA, 0xC4);
387 break;
388 }
389}
390
391/* Swaps the pictures every 0x79 frames, letting out the flyers */
392void updateFlyerGate(StageFlyerGate *task, void **children) {
393 switch (task->state) {
394 case TASK_INIT:
395 default:
396 task->nextState(task);
397 /* fallthrough */
398 case TASK_RUN:
399 switch (task->substate) {
400 case 0:
401 default:
402 task->left = 2;
403 task->right = 0;
404 task->spawnA = 1;
405 task->spawnB = 0;
406 break;
407 case 1:
408 if (task->left == 2) {
409 task->left = 1;
410 }
411 if (task->right == 2) {
412 task->right = 1;
413 }
414 task->step += GFX.funcs.getFrameTime();
415 if (task->step >= 0x79) {
416 if (task->left == 0) {
417 task->left = 2;
418 }
419 if (task->left == 1) {
420 task->left = 0;
421 }
422 if (task->right == 0) {
423 task->right = 2;
424 }
425 if (task->right == 1) {
426 task->right = 0;
427 }
428 task->nextSubstate(task);
429 }
430 task->spawnA = 0;
431 task->spawnB = 0;
432 break;
433 case 2:
434 task->spawnA = 0;
435 task->spawnB = 1;
436 break;
437 }
438 drawFlyerGate(task);
439 releaseFlyers(task, children);
440 break;
441 case TASK_DONE:
442 case TASK_KILL:
443 break;
444 }
445}
446
447/* Stops the object (substate 0) for map 0x324, starts it (substate 1) for 0x320 */
448void handleCommand800(Task *task, s32 id) {
449 if (task != NULL) {
450 switch (id) {
451 case 0x324:
452 task->setSubstate(task, 0);
453 break;
454 case 0x320:
455 task->setSubstate(task, 1);
456 break;
457 }
458 }
459}
460
461/* Creates the task of updateFlyerGate with id ARG */
463 return createTaskWithId(updateFlyerGate, sizeof(StageFlyerGate), 0x10, arg);
464}
465
466/* Draws the 40 quads, those of kind 0 and 1 with the frames of the animations */
469 u_long *ot = layer->getOtEntry(layer, 2);
470 s32 scroll[2];
471 POLY_FT4 *poly;
472 StageQuadTexture *tex;
473 StageQuad *quad;
474 s32 size;
475 s32 i;
476
477 layer->getScroll(layer, scroll);
478 poly = GFX.funcs.getPrim();
479 for (i = 0; i < 40; i++) {
480 quad = &drawByteAnimsQuads[i];
481 switch (quad->kind) {
482 case 0:
483 case 1:
484 tex = &drawByteAnimsTextures[task->anims[quad->kind].frame];
485 break;
486 default:
487 tex = &drawByteAnimsTextures[quad->kind];
488 break;
489 }
490 size = 0x28;
491 if (quad->kind == 1) {
492 size = 0x14;
493 }
494 setPolyFT4(poly);
495 if (quad->kind >= 9) {
496 setSemiTrans(poly, 1);
497 }
498 setRGB0(poly, 0x80, 0x80, 0x80);
499 poly->x0 = quad->x0 - scroll[0];
500 poly->x1 = quad->x1 - scroll[0];
501 poly->x2 = quad->x2 - scroll[0];
502 poly->x3 = quad->x3 - scroll[0];
503 poly->y0 = quad->y0 - scroll[1];
504 poly->y1 = quad->y1 - scroll[1];
505 poly->y2 = quad->y2 - scroll[1];
506 poly->y3 = quad->y3 - scroll[1];
507 poly->u0 = tex->u;
508 poly->u1 = tex->u + size;
509 poly->u2 = tex->u;
510 poly->u3 = tex->u + size;
511 poly->v0 = tex->v;
512 poly->v1 = tex->v;
513 poly->v2 = tex->v + size;
514 poly->v3 = tex->v + size;
515 poly->tpage = getTPage(0, 0, tex->tpageX, tex->tpageY);
516 poly->clut = getClut(tex->clutX, tex->clutY);
517 addPrim(ot, poly);
518 poly++;
519 }
520 GFX.funcs.setPrim(poly);
521}
522
523/* Plays its two byte-pair animations, restarting one when its animation changes, and draws */
525 StageByteAnim *a;
526 s32 i;
527
528 switch (task->state) {
529 case TASK_INIT:
530 default:
531 task->nextState(task);
532 task->anims[0].anim = 1;
533 task->anims[0].cur = -1;
534 task->anims[1].anim = 4;
535 task->anims[1].cur = -1;
536 break;
537 case TASK_RUN:
538 for (i = 0; i < 2; i++) {
539 a = &task->anims[i];
540 if (a->anim != a->cur) {
541 a->cur = a->anim;
542 a->index = 0;
543 a->frame = 0;
544 a->timer = 0;
545 }
546 a->timer -= GFX.funcs.getFrameTime();
547 if (a->timer <= 0) {
548 a->index++;
549 if (byteAnims[a->anim][a->index * 2 + 1] == 0) {
550 a->index = byteAnims[a->anim][a->index * 2];
551 }
552 a->frame = byteAnims[a->anim][a->index * 2];
553 a->timer = byteAnims[a->anim][a->index * 2 + 1];
554 }
555 }
556 drawByteAnims(task);
557 break;
558 case TASK_DONE:
559 case TASK_KILL:
560 break;
561 }
562}
563
564/* Switches the animations to 2 and 5 with a sound for map 0x322 */
566 if (id == 0x322) {
567 task->anims[0].anim = 2;
568 task->anims[1].anim = 5;
570 }
571}
572
573/*
574 * Command 801 of the event scripts: the two animations of updateByteAnims in
575 * the MAGAMI Online Center's events
576 */
578 return createTaskWithId(updateByteAnims, sizeof(StageByteAnims), 0, arg);
579}
580
581/* Creates an object and the event object of the story progress */
582void updateStage(StageTask *task, void **children) {
583 switch (task->state) {
584 case TASK_INIT:
585 default:
586 children[1] = createCommand801(0x321);
587 if (GAME.progress == STORY_START) {
588 children[0] = FIELDSTG_startEvent(0);
589 } else if (GAME.progress == STORY_GAME_MASTER_CAUGHT) {
590 children[0] = FIELDSTG_startEvent(0x2AC);
591 } else if (GAME.progress == STORY_JUNGLE_SOUND) {
592 children[0] = FIELDSTG_startEvent(0x2E6);
593 children[2] = createEffectSet();
594 } else if (GAME.progress == STORY_REAL_WORLD) {
595 children[0] = FIELDSTG_startEvent(0x375);
596 } else if (GAME.progress == STORY_ASUKA_HEADQUARTERS) {
597 children[0] = FIELDSTG_startEvent(0x3CB);
598 } else if (GAME.progress == STORY_MOVIE_BATTLES) {
599 children[0] = FIELDSTG_startEvent(0x5DC);
600 }
601 task->nextState(task);
602 break;
603 case TASK_RUN:
604 case TASK_DONE:
605 case TASK_KILL:
606 break;
607 }
608}
609
610#define STAGE_CHILDREN_SIZE 0xC
612
613/* After event 0, with Junior, Ivy and Teddy: moves the story on to STORY_START */
614void endEvent0(void) {
616}
617
618/* After event 885: lets event 886 of WSTAG750 start */
619void endEvent885(void) {
620 FLAGS_00.applyAction(FLAG(0x40, 0x66), 1);
621}
622
623#if VERSION_EU || VERSION_JP
624/* The end of event 1500, only in the European version: the story goes on to its extra chapter */
625void endEvent1500(void) {
627}
628#endif
629
630#if VERSION_US || VERSION_JP
631#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_07)
632#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
633#define STAGE_FILE 0x1B7
634#define STAGE_ARCHIVE 0x311
635#elif VERSION_EU
636#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_07)
637#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
638#define STAGE_FILE 0x1C5
639#define STAGE_ARCHIVE 0x320
640#endif
641/*
642 * Sets the stage up: its map, actors and events, playing BGM00000, or
643 * BGM00001 at STORY_JUNGLE_SOUND, BGM00002 at 0x20 and BGM00003 at 0x27
644 */
675
677 SCRIPT_FOLLOW(1, 1),
678 SCRIPT_PLACE(1, 0xB0, 0x98),
679 SCRIPT_POSE(1, 1, 5),
680 SCRIPT_PLACE(0x10, 0x130, 0xB0),
681 SCRIPT_POSE(0x10, 1, 7),
682 SCRIPT_COMMAND(0x320, 0x324, 1),
683 SCRIPT_COMMAND(0x321, 0x321, 1),
684 SCRIPT_WAIT(0x78),
685 SCRIPT_POSE(1, 0x2A, 5),
686 SCRIPT_WAIT(0x3C),
687 SCRIPT_POSE(1, 0x2B, 5),
689 SCRIPT_POSE(1, 0x2A, 5),
690 SCRIPT_WAIT(0x3C),
691 SCRIPT_TALK(0, 1, 1, 2),
692 SCRIPT_POSE(1, 0x2A, 5),
694 SCRIPT_WALK(1, 0xC0, 0x90, 1),
696 SCRIPT_POSE(1, 0x2A, 1),
697 SCRIPT_WAIT(0x78),
698 SCRIPT_TALK(0, 2, 1, 0),
700 SCRIPT_POSE(1, 0x39, 1),
701 SCRIPT_COMMAND(0x320, 0x320, 1),
703 SCRIPT_POSE(1, 0x2A, 1),
704 SCRIPT_WAIT(0x78),
705 SCRIPT_POSE(1, 0x2A, 1),
706 SCRIPT_WALK(0x10, 0x280, 0x1E0, 7),
707 SCRIPT_WAIT(0x168),
708 SCRIPT_WALK(1, 0xD0, 0x88, 5),
709 SCRIPT_PLACE(0x10, 0, 0),
710 SCRIPT_POSE(0x10, 1, 1),
712 SCRIPT_POSE(1, 0x2E, 5),
713 SCRIPT_COMMAND(0x321, 0x322, 1),
715 SCRIPT_POSE(1, 1, 5),
716 SCRIPT_WAIT(0x1E),
717 SCRIPT_POSE(1, 1, 6),
718 SCRIPT_WAIT(0x1E),
719 SCRIPT_WALK(1, 0x100, 0x98, 5),
721 SCRIPT_TALK(0, 3, 1, 4),
722 SCRIPT_POSE(1, 1, 5),
724 SCRIPT_POSE(1, 0x29, 1),
725 SCRIPT_COMMAND(0x321, 0x321, 1),
726 SCRIPT_WAIT(0x3C),
727 SCRIPT_POSE(1, 0x30, 1),
729 SCRIPT_POSE(1, 0x29, 1),
730 SCRIPT_WAIT(0x3C),
731 SCRIPT_TALK(0, 4, 1, 2),
732 SCRIPT_POSE(1, 0x29, 1),
734 SCRIPT_POSE(1, 0x30, 1),
735 SCRIPT_COMMAND(0x322, 0x323, 1),
736 SCRIPT_WAIT(0x3C),
737 SCRIPT_POSE(1, 0x29, 1),
738 SCRIPT_PLACE(0xB, 0xF0, 0x78),
739 SCRIPT_WALK(0xB, 0xC0, 0x90, 1),
740 SCRIPT_WAIT_WALK(0xB),
741 SCRIPT_POSE(0xB, 1, 6),
742 SCRIPT_PLACE(0xC, 0xF0, 0x78),
743 SCRIPT_WALK(0xC, 0xDA, 0x84, 7),
744 SCRIPT_WAIT_WALK(0xC),
745 SCRIPT_POSE(1, 0x30, 1),
746 SCRIPT_POSE(0xB, 1, 6),
747 SCRIPT_POSE(0xC, 1, 7),
748 SCRIPT_WAIT(0x1E),
749 SCRIPT_TALK(1, 6, 0xC, 2),
750 SCRIPT_TALK(0, 5, 0xB, 3),
751 SCRIPT_POSE(1, 1, 1),
752 SCRIPT_POSE(0xB, 7, 6),
753 SCRIPT_POSE(0xC, 7, 7),
755 SCRIPT_POSE(1, 1, 3),
756 SCRIPT_POSE(0xB, 1, 6),
757 SCRIPT_POSE(0xC, 1, 7),
758 SCRIPT_WAIT(0x1E),
759 SCRIPT_POSE(1, 0xC, 3),
760 SCRIPT_WAIT(0x3C),
761 SCRIPT_TALK(0, 7, 1, 2),
762 SCRIPT_POSE(1, 0xC, 3),
764 SCRIPT_POSE(1, 0x31, 3),
766 SCRIPT_POSE(1, 0xC, 3),
767 SCRIPT_WAIT(0x3C),
768 SCRIPT_TALK(0, 8, 1, 2),
769 SCRIPT_POSE(1, 0xC, 2),
771 SCRIPT_POSE(1, 1, 2),
772 SCRIPT_WALK(0xB, 0xE0, 0x98, 6),
773 SCRIPT_WAIT_WALK(0xB),
774 SCRIPT_POSE(1, 1, 2),
775 SCRIPT_POSE(0xB, 1, 6),
776 SCRIPT_WAIT(0x1E),
777 SCRIPT_TALK(0, 9, 0xB, 2),
778 SCRIPT_POSE(0xB, 7, 6),
780 SCRIPT_POSE(1, 0xC, 2),
781 SCRIPT_POSE(0xB, 0xC, 6),
782 SCRIPT_POSE(0xC, 0x34, 0),
783 SCRIPT_WAIT(0x78),
784 SCRIPT_POSE(0xC, 0x35, 0),
785 SCRIPT_WAIT(0x78),
786 SCRIPT_POSE(0xC, 1, 0),
787 SCRIPT_WAIT(0x3C),
788 SCRIPT_POSE(0xC, 9, 0),
789 SCRIPT_WAIT_ANIM(0xC),
790 SCRIPT_POSE(0xC, 1, 0),
791 SCRIPT_WAIT(0x1E),
792 SCRIPT_WALK(0xC, 0xB0, 0x98, 6),
793 SCRIPT_WAIT_WALK(0xC),
794 SCRIPT_POSE(0xC, 1, 6),
795 SCRIPT_WAIT(0x1E),
796 SCRIPT_TALK(0, 0xA, 0xC, 2),
797 SCRIPT_POSE(0xC, 7, 6),
799 SCRIPT_POSE(1, 1, 2),
800 SCRIPT_POSE(0xB, 1, 6),
801 SCRIPT_POSE(0xC, 1, 6),
802 SCRIPT_WAIT(0x3C),
803 SCRIPT_POSE(1, 9, 2),
804 SCRIPT_POSE(0xB, 9, 6),
805 SCRIPT_WAIT_ANIM(0xB),
806 SCRIPT_POSE(1, 1, 2),
807 SCRIPT_POSE(0xB, 1, 6),
808 SCRIPT_WAIT(0x1E),
809 SCRIPT_WALK(1, 0x250, 0x138, 7),
810 SCRIPT_POSE(0xB, 1, 7),
811 SCRIPT_WAIT(0x1E),
812 SCRIPT_WALK(0xB, 0x250, 0x138, 7),
813 SCRIPT_WALK(0xC, 0x250, 0x138, 7),
814 SCRIPT_WAIT(0x3C),
815 SCRIPT_LEAVE(0x2D8, 0x280, 0x100, 1),
817};
819 SCRIPT_LOOK_AT(1, 0xC0, 0x90),
820 SCRIPT_PLACE(2, 0, 0),
821 SCRIPT_POSE(2, 1, 1),
822#if VERSION_US
823 SCRIPT_PLACE(0x10, 0x90, 0xC0),
824 SCRIPT_POSE(0x10, 1, 1),
825#elif VERSION_EU || VERSION_JP
826 SCRIPT_PLACE(0x10, 0x12F, 0xC1),
827 SCRIPT_POSE(0x10, 1, 7),
828#endif
829 SCRIPT_PLACE(0x2D, 0xD0, 0x80),
830 SCRIPT_POSE(0x2D, 1, 3),
831 SCRIPT_PLACE(0x2F, 0xA0, 0x98),
832 SCRIPT_POSE(0x2F, 1, 4),
833 SCRIPT_PLACE(0x31, 0x100, 0x99),
834 SCRIPT_POSE(0x31, 1, 5),
835 SCRIPT_PLACE(0x35, 0xD8, 0x94),
836 SCRIPT_POSE(0x35, 1, 3),
837#if VERSION_US
838 SCRIPT_PLACE(0x38, 0x70, 0xB0),
839 SCRIPT_POSE(0x38, 1, 1),
840 SCRIPT_COMMAND(0x320, 0x320, 2),
841#elif VERSION_EU || VERSION_JP
842 SCRIPT_PLACE(0x38, 0x150, 0xB0),
843 SCRIPT_POSE(0x38, 1, 7),
844 SCRIPT_COMMAND(0x320, 0x324, 2),
845#endif
846 SCRIPT_COMMAND(0x321, 0x321, 0x321),
847 SCRIPT_WAIT(0x78),
848 SCRIPT_COMMAND(0x321, 0x322, 2),
849 SCRIPT_WAIT(0x1E),
850 SCRIPT_TALK(0, 1, 2, 4),
852 SCRIPT_WAIT(0x5A),
853 SCRIPT_COMMAND(0x321, 0x321, 0x321),
854 SCRIPT_COMMAND(0x323, 0x325, 0x35),
855 SCRIPT_COMMAND(0x324, 0x325, 0x2F),
856 SCRIPT_COMMAND(0x325, 0x325, 0x2D),
857 SCRIPT_WAIT(0x5A),
858 SCRIPT_COMMAND(0x323, 0x326, 0x2D),
859 SCRIPT_COMMAND(0x324, 0x326, 0x2F),
860 SCRIPT_COMMAND(0x325, 0x326, 0x35),
861 SCRIPT_WAIT(0x1E),
862 SCRIPT_TALK(0, 2, 0x2D, 2),
864 SCRIPT_WAIT(0x12),
865 SCRIPT_TALK(0, 3, 0x2F, 0),
867 SCRIPT_WAIT(0x12),
868 SCRIPT_TALK(0, 4, 0x35, 2),
870 SCRIPT_WAIT(0x12),
871 SCRIPT_WAIT(0x12),
872 SCRIPT_LEAVE(0x203, 0x14A, 0xC4, 1),
874};
876 SCRIPT_LOOK_AT(1, 0xE0, 0xB0),
877 SCRIPT_PLACE(2, 0, 0),
878 SCRIPT_POSE(2, 1, 1),
879 SCRIPT_PLACE(0x10, 0xF0, 0xA0),
880 SCRIPT_POSE(0x10, 1, 7),
881 SCRIPT_PLACE(0x2D, 0xB0, 0xC8),
882 SCRIPT_POSE(0x2D, 1, 0),
883 SCRIPT_PLACE(0x2F, 0x89, 0xAC),
884 SCRIPT_POSE(0x2F, 1, 1),
885 SCRIPT_PLACE(0x35, 0xBF, 0x88),
886 SCRIPT_POSE(0x35, 1, 0),
887 SCRIPT_PLACE(0x38, 0x10F, 0xC0),
888 SCRIPT_POSE(0x38, 1, 7),
889 SCRIPT_COMMAND(0x321, 0x321, 2),
890 SCRIPT_WAIT(0x78),
891 SCRIPT_COMMAND(0x323, 0x325, 0x2D),
892 SCRIPT_COMMAND(0x324, 0x325, 0x10),
893 SCRIPT_COMMAND(0x325, 0x325, 0x38),
894 SCRIPT_WAIT(0x5A),
895 SCRIPT_COMMAND(0x323, 0x326, 0x2D),
896 SCRIPT_COMMAND(0x324, 0x326, 0x10),
897 SCRIPT_COMMAND(0x325, 0x326, 0x38),
898 SCRIPT_WAIT(0x1E),
899 SCRIPT_TALK(0, 1, 0x2D, 2),
901 SCRIPT_WAIT(0x12),
902 SCRIPT_TALK(0, 2, 0x10, 0),
904 SCRIPT_WAIT(0x12),
905 SCRIPT_TALK(0, 3, 0x38, 0),
907 SCRIPT_WAIT(0x12),
908 SCRIPT_POSE(0x38, 1, 7),
909 SCRIPT_WAIT(0x18),
910 SCRIPT_POSE(0x38, 1, 0),
911 SCRIPT_WAIT(0x18),
912 SCRIPT_POSE(0x38, 1, 7),
913 SCRIPT_WAIT(0x18),
914 SCRIPT_POSE(0x38, 1, 6),
915 SCRIPT_WAIT(0x18),
916 SCRIPT_POSE(0x38, 1, 7),
917 SCRIPT_WAIT(0x18),
918 SCRIPT_TALK(0, 4, 0x38, 0),
920 SCRIPT_WAIT(0xC),
921 SCRIPT_WAIT(6),
922 SCRIPT_LEAVE(0x29C, 0x180, 0xDA, 1),
924};
926 SCRIPT_LOOK_AT(1, 0xE0, 0xA0),
927 SCRIPT_PLACE(2, 0, 0),
928 SCRIPT_POSE(2, 1, 1),
929 SCRIPT_COMMAND(0x321, 0x321, 0x321),
930 SCRIPT_WAIT(0x78),
931 SCRIPT_WAIT(0x1E),
932 SCRIPT_COMMAND(0x321, 0x322, 0x321),
933 SCRIPT_WAIT(0x5A),
934 SCRIPT_WAIT(0x12),
935 SCRIPT_TALK(0, 1, 2, 4),
937 SCRIPT_WAIT(0x12),
938 SCRIPT_WAIT(0x12),
939 SCRIPT_LEAVE(0x26D, 0x15E, 0xCA, 7),
941};
943 SCRIPT_LOOK_AT(1, 0xE0, 0xB0),
944 SCRIPT_PLACE(2, 0, 0),
945 SCRIPT_POSE(2, 1, 1),
946 SCRIPT_PLACE(0x110, 0x10, 0x100),
947 SCRIPT_POSE(0x110, 1, 5),
948 SCRIPT_PLACE(0x111, 0x10, 0x80),
949 SCRIPT_POSE(0x111, 1, 7),
950 SCRIPT_PLACE(0x112, 0x1D0, 0x100),
951 SCRIPT_POSE(0x112, 1, 3),
952 SCRIPT_COMMAND(0x321, 0x321, 0x321),
953 SCRIPT_WAIT(0x78),
954 SCRIPT_WALK(0x110, 0xC0, 0xA8, 5),
955 SCRIPT_WAIT_WALK(0x110),
956 SCRIPT_POSE(0x110, 1, 0),
957 SCRIPT_WALK(0x111, 0xB0, 0xD0, 1),
958 SCRIPT_WALK(0x112, 0x100, 0x98, 3),
959 SCRIPT_WAIT_WALK(0x112),
960 SCRIPT_WAIT(0x12),
961 SCRIPT_POSE(0x110, 1, 0),
962 SCRIPT_POSE(0x111, 1, 1),
963 SCRIPT_POSE(0x112, 1, 7),
964 SCRIPT_WAIT(0x12),
965 SCRIPT_POSE(0x110, 1, 1),
966 SCRIPT_POSE(0x111, 1, 0),
967 SCRIPT_POSE(0x112, 1, 0),
968 SCRIPT_WAIT(0x12),
969 SCRIPT_POSE(0x110, 1, 0),
970 SCRIPT_POSE(0x111, 1, 1),
971 SCRIPT_POSE(0x112, 1, 7),
972 SCRIPT_WAIT(0x12),
973 SCRIPT_POSE(0x110, 1, 7),
974 SCRIPT_POSE(0x111, 1, 2),
975 SCRIPT_POSE(0x112, 1, 6),
976 SCRIPT_WAIT(0x12),
977 SCRIPT_POSE(0x110, 1, 0),
978 SCRIPT_POSE(0x111, 1, 1),
979 SCRIPT_POSE(0x112, 1, 7),
980 SCRIPT_WAIT(0x12),
981 SCRIPT_COMMAND(0x322, 0x323, 1),
982 SCRIPT_WAIT(0x3C),
983 SCRIPT_PLACE(0x9D, 0xF0, 0x78),
984 SCRIPT_POSE(0x9D, 1, 1),
985 SCRIPT_WAIT(0xC),
986 SCRIPT_WALK(0x9D, 0xE7, 0x7C, 1),
987 SCRIPT_WAIT(0xC),
988 SCRIPT_COMMAND(0x323, 0x325, 0x9D),
989 SCRIPT_WAIT(0x5A),
990 SCRIPT_COMMAND(0x323, 0x326, 0x9D),
991 SCRIPT_WAIT(0x12),
992 SCRIPT_TALK(0, 1, 0x9D, 1),
994 SCRIPT_POSE(0x9D, 1, 5),
995 SCRIPT_WAIT(0x12),
996 SCRIPT_WALK(0x9D, 0xF0, 0x78, 5),
997 SCRIPT_COMMAND(0x322, 0x323, 2),
998 SCRIPT_WAIT_WALK(0x9D),
999 SCRIPT_PLACE(0x9D, 0, 0),
1000 SCRIPT_POSE(0x9D, 1, 1),
1001 SCRIPT_COMMAND(0x323, 0x325, 0x110),
1002 SCRIPT_COMMAND(0x324, 0x325, 0x111),
1003 SCRIPT_COMMAND(0x325, 0x325, 0x112),
1004 SCRIPT_WAIT(0x5A),
1005 SCRIPT_POSE(0x110, 1, 1),
1006 SCRIPT_POSE(0x111, 1, 1),
1007 SCRIPT_POSE(0x112, 1, 1),
1008 SCRIPT_COMMAND(0x323, 0x326, 0x110),
1009 SCRIPT_COMMAND(0x324, 0x326, 0x111),
1010 SCRIPT_COMMAND(0x325, 0x326, 0x112),
1011 SCRIPT_WAIT(0x12),
1012 SCRIPT_POSE(0x110, 1, 5),
1013 SCRIPT_POSE(0x111, 1, 5),
1014 SCRIPT_POSE(0x112, 1, 3),
1015 SCRIPT_WAIT(0x12),
1016 SCRIPT_LEAVE(0x272, 0x100, 0x1E0, 5),
1017 SCRIPT_END,
1018};
1020 SCRIPT_FOLLOW(1, 1),
1021 SCRIPT_PLACE(1, 0xB0, 0x98),
1022 SCRIPT_POSE(1, 1, 5),
1023 SCRIPT_PLACE(0x10, 0x130, 0xB0),
1024 SCRIPT_POSE(0x10, 1, 7),
1025 SCRIPT_COMMAND(0x320, 0x324, 1),
1026 SCRIPT_COMMAND(0x321, 0x321, 1),
1027 SCRIPT_WAIT(0x78),
1028 SCRIPT_POSE(1, 0x2A, 5),
1029 SCRIPT_WAIT(0x3C),
1030 SCRIPT_POSE(1, 0x2B, 5),
1032 SCRIPT_POSE(1, 0x2A, 5),
1033 SCRIPT_WAIT(0x3C),
1034 SCRIPT_TALK(0, 1, 1, 2),
1035 SCRIPT_POSE(1, 0x2A, 5),
1037 SCRIPT_WALK(1, 0xC0, 0x90, 1),
1039 SCRIPT_POSE(1, 0x2A, 1),
1040 SCRIPT_WAIT(0x78),
1041 SCRIPT_TALK(0, 2, 1, 0),
1043 SCRIPT_POSE(1, 0x39, 1),
1044 SCRIPT_COMMAND(0x320, 0x320, 1),
1046 SCRIPT_POSE(1, 0x29, 1),
1047 SCRIPT_WAIT(0x78),
1048 SCRIPT_POSE(1, 0x2A, 1),
1049 SCRIPT_WALK(0x10, 0x280, 0x1E0, 0),
1050 SCRIPT_WAIT(0x168),
1051 SCRIPT_WALK(1, 0xD0, 0x88, 5),
1052 SCRIPT_POSE(0x10, 1, 1),
1054 SCRIPT_POSE(1, 0x2E, 5),
1055 SCRIPT_COMMAND(0x321, 0x322, 1),
1057 SCRIPT_POSE(1, 1, 5),
1058 SCRIPT_WAIT(0x1E),
1059 SCRIPT_POSE(1, 1, 6),
1060 SCRIPT_WAIT(0x1E),
1061 SCRIPT_WALK(1, 0x100, 0x98, 5),
1063 SCRIPT_TALK(0, 3, 1, 4),
1064 SCRIPT_POSE(1, 1, 5),
1066 SCRIPT_POSE(1, 0x29, 1),
1067 SCRIPT_COMMAND(0x321, 0x321, 1),
1068 SCRIPT_WAIT(0x3C),
1069 SCRIPT_POSE(1, 0x30, 1),
1071 SCRIPT_POSE(1, 0x29, 1),
1072 SCRIPT_WAIT(0x3C),
1073 SCRIPT_TALK(0, 4, 1, 2),
1074 SCRIPT_POSE(1, 0x29, 1),
1076 SCRIPT_POSE(1, 0x30, 1),
1077 SCRIPT_COMMAND(0x322, 0x323, 1),
1078 SCRIPT_WAIT(0x3C),
1079 SCRIPT_POSE(1, 0x29, 1),
1080 SCRIPT_PLACE(0xB, 0xF0, 0x78),
1081 SCRIPT_WALK(0xB, 0xC0, 0x90, 1),
1082 SCRIPT_WAIT_WALK(0xB),
1083 SCRIPT_POSE(0xB, 1, 6),
1084 SCRIPT_PLACE(0xC, 0xF0, 0x78),
1085 SCRIPT_WALK(0xC, 0xDA, 0x84, 7),
1086 SCRIPT_WAIT_WALK(0xC),
1087 SCRIPT_POSE(1, 0x30, 1),
1088 SCRIPT_POSE(0xB, 1, 6),
1089 SCRIPT_POSE(0xC, 1, 7),
1090 SCRIPT_WAIT(0x1E),
1091 SCRIPT_TALK(1, 6, 0xC, 2),
1092 SCRIPT_TALK(0, 5, 0xB, 3),
1093 SCRIPT_POSE(1, 1, 1),
1094 SCRIPT_POSE(0xB, 7, 6),
1095 SCRIPT_POSE(0xC, 7, 7),
1097 SCRIPT_POSE(1, 1, 3),
1098 SCRIPT_POSE(0xB, 1, 6),
1099 SCRIPT_POSE(0xC, 1, 7),
1100 SCRIPT_WAIT(0x1E),
1101 SCRIPT_POSE(1, 0xC, 3),
1102 SCRIPT_WAIT(0x3C),
1103 SCRIPT_TALK(0, 7, 1, 2),
1104 SCRIPT_POSE(1, 0xC, 3),
1106 SCRIPT_POSE(1, 0x31, 3),
1108 SCRIPT_POSE(1, 0xC, 3),
1109 SCRIPT_WAIT(0x3C),
1110 SCRIPT_TALK(0, 8, 1, 2),
1111 SCRIPT_POSE(1, 0xC, 2),
1113 SCRIPT_POSE(1, 1, 2),
1114 SCRIPT_WALK(0xB, 0xE0, 0x98, 6),
1115 SCRIPT_WAIT_WALK(0xB),
1116 SCRIPT_POSE(1, 1, 2),
1117 SCRIPT_POSE(0xB, 1, 6),
1118 SCRIPT_WAIT(0x1E),
1119 SCRIPT_TALK(0, 9, 0xB, 2),
1120 SCRIPT_POSE(0xB, 7, 6),
1122 SCRIPT_POSE(1, 0xC, 2),
1123 SCRIPT_POSE(0xB, 0xC, 6),
1124 SCRIPT_POSE(0xC, 0x34, 0),
1125 SCRIPT_WAIT(0x78),
1126 SCRIPT_POSE(0xC, 0x35, 0),
1127 SCRIPT_WAIT(0x78),
1128 SCRIPT_POSE(0xC, 1, 0),
1129 SCRIPT_WAIT(0x3C),
1130 SCRIPT_POSE(0xC, 9, 0),
1131 SCRIPT_WAIT_ANIM(0xC),
1132 SCRIPT_POSE(0xC, 1, 0),
1133 SCRIPT_WAIT(0x1E),
1134 SCRIPT_WALK(0xC, 0xB0, 0x98, 6),
1135 SCRIPT_WAIT_WALK(0xC),
1136 SCRIPT_POSE(0xC, 1, 6),
1137 SCRIPT_WAIT(0x1E),
1138 SCRIPT_TALK(0, 0xA, 0xC, 2),
1139 SCRIPT_POSE(0xC, 7, 6),
1141 SCRIPT_POSE(1, 1, 2),
1142 SCRIPT_POSE(0xB, 1, 6),
1143 SCRIPT_POSE(0xC, 1, 6),
1144 SCRIPT_WAIT(0x3C),
1145 SCRIPT_POSE(1, 9, 2),
1146 SCRIPT_POSE(0xB, 9, 6),
1147 SCRIPT_WAIT_ANIM(0xB),
1148 SCRIPT_POSE(1, 1, 2),
1149 SCRIPT_POSE(0xB, 1, 6),
1150 SCRIPT_WAIT(0x1E),
1151 SCRIPT_WALK(1, 0x250, 0x138, 7),
1152 SCRIPT_POSE(0xB, 1, 7),
1153 SCRIPT_WAIT(0x1E),
1154 SCRIPT_WALK(0xB, 0x250, 0x138, 7),
1155 SCRIPT_WALK(0xC, 0x250, 0x138, 7),
1156 SCRIPT_WAIT(0x3C),
1157#if VERSION_US
1158 SCRIPT_LEAVE(0xE0C, 0, 0, 0),
1159#elif VERSION_EU || VERSION_JP
1160 SCRIPT_LEAVE(0xE03, 0, 0, 1),
1161#endif
1162 SCRIPT_END,
1163};
1165 50, 52, 53, 55, 56, 57, 56, 57,
1166};
1167Vec2 flyerStarts[2][2][2] = {
1168 { { { 640, 72 }, { 432, 176 } }, { { 0, 224 }, { 0, 0 } } },
1169 { { { 448, 392 }, { 0, 0 } }, { { 112, 392 }, { 0, 0 } } },
1170};
1172 { 50, 4 }, { 51, 4 }, { 255, 0 },
1173};
1175 { 53, 4 }, { 54, 4 }, { 255, 0 },
1176};
1178 { updateEffectSpots_0, 20, 130 },
1179 { updateEffectSpots_0, 80, 180 },
1180 { updateEffectSpots_0, 120, 230 },
1181 { updateEffectSpots_0, 170, 0x118 },
1182 { updateEffectSpots_4, 0x15E, 210 },
1183 { updateEffectSpots_4, 0x12C, 240 },
1184 { NULL, 0, 0 },
1185 { NULL, 0, 0 },
1186 { NULL, 0, 0 },
1187 { NULL, 0, 0 },
1188};
1190 { 10, 12 }, { 11, 12 }, { 12, 12 }, { 13, 12 },
1191 { 14, 12 }, { 15, 20 }, { 16, 4 }, { 17, 4 },
1192 { 15, 4 }, { 13, 4 }, { 18, 4 }, { 11, 4 },
1193 { 13, 4 }, { 15, 4 }, { 13, 4 }, { 16, 4 },
1194 { 16, 4 }, { 15, 4 }, { 18, 4 }, { 17, 4 },
1195 { 11, 4 }, { 255, 0 },
1196};
1198 { 18, 12 }, { 19, 12 }, { 20, 12 }, { 21, 12 },
1199 { 22, 12 }, { 23, 20 }, { 24, 4 }, { 25, 4 },
1200 { 22, 4 }, { 19, 4 }, { 21, 4 }, { 18, 4 },
1201 { 23, 4 }, { 20, 4 }, { 19, 4 }, { 25, 4 },
1202 { 22, 4 }, { 19, 4 }, { 18, 4 }, { 255, 0 },
1203};
1208 { 0x180, 0x100, 0x1B2, 0x130, 0x1C8, 48, 0x170, 0x1DE },
1209 { 0x180, 0x100, 0x180, 0x14C, 0x100, 76, 0x170, 0x1DE },
1210 { 0x180, 0x100, 0x18A, 0x14C, 0x128, 76, 0x170, 0x1DE },
1211 { 0x180, 0x100, 0x194, 0x158, 0x150, 88, 0x170, 0x1DE },
1212 { 0x180, 0x100, 0x19E, 0x158, 0x178, 88, 0x170, 0x1DE },
1213 { 0x180, 0x100, 0x1A8, 0x158, 0x1A0, 88, 0x170, 0x1DE },
1214 { 0x180, 0x100, 0x1B2, 0x158, 0x1C8, 88, 0x170, 0x1DE },
1215 { 0x180, 0x100, 0x180, 0x174, 0x100, 116, 0x170, 0x1DE },
1216 { 0x180, 0x100, 0x18A, 0x174, 0x128, 116, 0x170, 0x1DE },
1217 { 0x180, 0x100, 0x194, 0x180, 0x150, 128, 0x170, 0x1DE },
1218 { 0x180, 0x100, 0x19E, 0x180, 0x178, 128, 0x170, 0x1DE },
1219 { 0x180, 0x100, 0x1A8, 0x180, 0x1A0, 128, 0x170, 0x1DE },
1220 { 0x180, 0x100, 0x1B2, 0x180, 0x1C8, 128, 0x170, 0x1DD },
1221 { 0x180, 0x100, 0x180, 0x19C, 0x100, 156, 0x170, 0x1DD },
1222 { 0x180, 0x100, 0x18A, 0x19C, 0x128, 156, 0x170, 0x1DD },
1223 { 0x180, 0x100, 0x194, 0x1A8, 0x150, 168, 0x170, 0x1DD },
1224 { 0x180, 0x100, 0x19E, 0x1A8, 0x178, 168, 0x170, 0x1DD },
1225 { 0x180, 0x100, 0x1A8, 0x1A8, 0x1A0, 168, 0x170, 0x1DD },
1226 { 0x180, 0x100, 0x1B2, 0x1A8, 0x1C8, 168, 0x170, 0x1DD },
1227 { 0x180, 0x100, 0x180, 0x1C4, 0x100, 196, 0x170, 0x1DD },
1228 { 0x180, 0x100, 0x18A, 0x1C4, 0x128, 196, 0x170, 0x1DD },
1229 { 0x180, 0x100, 0x194, 0x1D0, 0x150, 208, 0x170, 0x1DD },
1230 { 0x180, 0x100, 0x19E, 0x1D0, 0x178, 208, 0x170, 0x1DD },
1231 { 0x180, 0x100, 0x1A8, 0x1D0, 0x1A0, 208, 0x170, 0x1DD },
1232 { 0x180, 0x100, 0x1B2, 0x1D0, 0x1C8, 208, 0x170, 0x1DD },
1233 { 0x1C0, 0x100, 0x1C0, 0x100, 0x200, 0, 0x170, 0x1DD },
1234 { 0x1C0, 0x100, 0x1CA, 0x100, 0x228, 0, 0x170, 0x1DC },
1235 { 0x1C0, 0x100, 0x1D4, 0x100, 0x250, 0, 0x170, 0x1DC },
1236 { 0x1C0, 0x100, 0x1DE, 0x100, 0x278, 0, 0x170, 0x1DC },
1237 { 0x1C0, 0x100, 0x1E8, 0x100, 0x2A0, 0, 0x170, 0x1DC },
1238 { 0x1C0, 0x100, 0x1F2, 0x100, 0x2C8, 0, 0x170, 0x1DB },
1239 { 0x1C0, 0x100, 0x1C0, 0x128, 0x200, 40, 0x170, 0x1DA },
1240 { 0x1C0, 0x100, 0x1CA, 0x128, 0x228, 40, 0x170, 0x1DA },
1241 { 0x1C0, 0x100, 0x1D4, 0x128, 0x250, 40, 0x170, 0x1DA },
1242 { 0x1C0, 0x100, 0x1DE, 0x128, 0x278, 40, 0x170, 0x1DA },
1243 { 0x1C0, 0x100, 0x1E8, 0x128, 0x2A0, 40, 0x170, 0x1DA },
1244 { 0x1C0, 0x100, 0x1F2, 0x128, 0x2C8, 40, 0x170, 0x1DA },
1245 { 0x1C0, 0x100, 0x1C0, 0x150, 0x200, 80, 0x170, 0x1DA },
1246 { 0x140, 0x100, 0x16A, 0x1D8, 168, 216, 0x170, 0x1DE },
1247 { 0x1C0, 0x100, 0x1FA, 0x150, 0x2E8, 80, 0x170, 0x1DE },
1248 { 0x1C0, 0x100, 0x1FA, 0x164, 0x2E8, 100, 0x170, 0x1DE },
1249 { 0x1C0, 0x100, 0x1DE, 0x178, 0x278, 120, 0x170, 0x1DE },
1250 { 0x1C0, 0x100, 0x1E3, 0x178, 0x28C, 120, 0x170, 0x1DE },
1251 { 0x1C0, 0x100, 0x1FA, 0x178, 0x2E8, 120, 0x170, 0x1DE },
1252 { 0x1C0, 0x100, 0x1DE, 0x18C, 0x278, 140, 0x170, 0x1DE },
1253 { 0x1C0, 0x100, 0x1E3, 0x18C, 0x28C, 140, 0x170, 0x1DE },
1254 { 0x1C0, 0x100, 0x1FA, 0x18C, 0x2E8, 140, 0x170, 0x1DE },
1255 { 0x1C0, 0x100, 0x1E8, 0x190, 0x2A0, 144, 0x170, 0x1DE },
1256 { 0x1C0, 0x100, 0x1ED, 0x190, 0x2B4, 144, 0x170, 0x1DE },
1257 { 0x1C0, 0x100, 0x1F2, 0x190, 0x2C8, 144, 0x170, 0x1DE },
1258 { 0x1C0, 0x100, 0x1D0, 0x194, 0x240, 148, 0x170, 0x1DD },
1259 { 0x1C0, 0x100, 0x1D5, 0x194, 0x254, 148, 0x170, 0x1DD },
1260 { 0x1C0, 0x100, 0x1C0, 0x198, 0x200, 152, 0x170, 0x1DD },
1261 { 0x1C0, 0x100, 0x1C5, 0x198, 0x214, 152, 0x170, 0x1DD },
1262 { 0x1C0, 0x100, 0x1CA, 0x198, 0x228, 152, 0x170, 0x1DD },
1263 { 0x1C0, 0x100, 0x1DA, 0x1A0, 0x268, 160, 0x170, 0x1DD },
1264 { 0x1C0, 0x100, 0x1DF, 0x1A0, 0x27C, 160, 0x170, 0x1DD },
1265 { 0x1C0, 0x100, 0x1F7, 0x1A0, 0x2DC, 160, 0x170, 0x1DD },
1266 { 0x1C0, 0x100, 0x1E4, 0x1A4, 0x290, 164, 0x170, 0x1DD },
1267 { 0x1C0, 0x100, 0x1E9, 0x1A4, 0x2A4, 164, 0x170, 0x1DD },
1268 { 0x1C0, 0x100, 0x1EE, 0x1A4, 0x2B8, 164, 0x170, 0x1DD },
1269 { 0x1C0, 0x100, 0x1CF, 0x1A8, 0x23C, 168, 0x170, 0x1DD },
1270 { 0x1C0, 0x100, 0x1D4, 0x1A8, 0x250, 168, 0x170, 0x1DD },
1271 { 0x1C0, 0x100, 0x1C0, 0x1AC, 0x200, 172, 0x170, 0x1DD },
1272 { 0x1C0, 0x100, 0x1C5, 0x1AC, 0x214, 172, 0x170, 0x1DC },
1273 { 0x1C0, 0x100, 0x1CA, 0x1AC, 0x228, 172, 0x170, 0x1DC },
1274 { 0x1C0, 0x100, 0x1D9, 0x1B4, 0x264, 180, 0x170, 0x1DC },
1275 { 0x1C0, 0x100, 0x1DE, 0x1B4, 0x278, 180, 0x170, 0x1DC },
1276 { 0x1C0, 0x100, 0x1F3, 0x1B4, 0x2CC, 180, 0x170, 0x1DB },
1277 { 0x1C0, 0x100, 0x1F8, 0x1B4, 0x2E0, 180, 0x170, 0x1DA },
1278 { 0x1C0, 0x100, 0x1E3, 0x1B8, 0x28C, 184, 0x170, 0x1DA },
1279 { 0x1C0, 0x100, 0x1E8, 0x1B8, 0x2A0, 184, 0x170, 0x1DA },
1280 { 0x1C0, 0x100, 0x1ED, 0x1B8, 0x2B4, 184, 0x170, 0x1DA },
1281 { 0x1C0, 0x100, 0x1CF, 0x1BC, 0x23C, 188, 0x170, 0x1DA },
1282 { 0x1C0, 0x100, 0x1D4, 0x1BC, 0x250, 188, 0x170, 0x1DA },
1283 { 0x1C0, 0x100, 0x1C0, 0x1C0, 0x200, 192, 0x170, 0x1DA },
1284 { 0x1C0, 0x100, 0x1C5, 0x1C0, 0x214, 192, 0x170, 0x1D9 },
1285 { 0x1C0, 0x100, 0x1CA, 0x1C0, 0x228, 192, 0x170, 0x1D9 },
1286 { 0x1C0, 0x100, 0x1D9, 0x1C8, 0x264, 200, 0x170, 0x1D9 },
1287 { 0x1C0, 0x100, 0x1DE, 0x1C8, 0x278, 200, 0x170, 0x1D9 },
1288 { 0x180, 0x100, 0x1A0, 0x100, 0x180, 0, 0x170, 0x1F6 },
1289 { 0x180, 0x100, 0x194, 0x100, 0x150, 0, 0x170, 0x1F6 },
1290 { 0x1C0, 0x100, 0x1D7, 0x178, 0x25C, 120, 0x170, 0x1F4 },
1291};
1293 { 121, 76, 168, 53, 121, 123, 168, 100, 80 },
1294 { 121, 77, 160, 58, 121, 116, 160, 97, 0 },
1295#if VERSION_US
1296 { 0x111, 94, 0x130, 109, 0x111, 125, 0x130, 140, 81 },
1297#elif VERSION_EU || VERSION_JP
1298 { 0x110, 92, 0x131, 108, 0x110, 123, 0x131, 139, 81 },
1299#endif
1300 { 0x115, 96, 0x130, 109, 0x115, 122, 0x130, 135, 0 },
1301#if VERSION_US
1302 { 27, 56, 54, 69, 27, 83, 54, 96, 81 },
1303#elif VERSION_EU || VERSION_JP
1304 { 29, 53, 56, 66, 29, 81, 56, 94, 81 },
1305#endif
1306 { 33, 59, 54, 69, 33, 81, 54, 91, 0 },
1307#if VERSION_US
1308 { 58, 72, 85, 85, 58, 99, 85, 112, 81 },
1309#elif VERSION_EU || VERSION_JP
1310 { 60, 68, 87, 81, 60, 97, 87, 110, 81 },
1311#endif
1312 { 64, 74, 85, 84, 64, 96, 85, 106, 0 },
1313#if VERSION_US
1314 { 58, 103, 85, 116, 58, 130, 85, 143, 81 },
1315#elif VERSION_EU || VERSION_JP
1316 { 60, 99, 87, 112, 60, 128, 87, 141, 81 },
1317#endif
1318 { 64, 105, 85, 115, 64, 127, 85, 137, 0 },
1319#if VERSION_US
1320 { 27, 87, 54, 100, 27, 114, 54, 127, 81 },
1321#elif VERSION_EU || VERSION_JP
1322 { 29, 84, 56, 97, 29, 112, 56, 125, 81 },
1323#endif
1324 { 33, 90, 54, 100, 33, 112, 54, 122, 0 },
1325 { 0x14F, 109, 0x15F, 101, 0x14F, 123, 0x15F, 115, 82 },
1326 { 0x14F, 109, 0x15B, 103, 0x14F, 119, 0x15B, 113, 1 },
1327 { 0x15F, 101, 0x16F, 93, 0x15F, 115, 0x16F, 107, 82 },
1328 { 0x15F, 101, 0x16B, 95, 0x15F, 111, 0x16B, 105, 1 },
1329 { 0x16F, 93, 0x17F, 85, 0x16F, 107, 0x17F, 99, 82 },
1330 { 0x16F, 93, 0x17B, 87, 0x16F, 103, 0x17B, 97, 1 },
1331 { 0x17F, 85, 0x18F, 77, 0x17F, 99, 0x18F, 91, 82 },
1332 { 0x17F, 85, 0x18B, 79, 0x17F, 95, 0x18B, 89, 1 },
1333 { 0x14F, 125, 0x15F, 117, 0x14F, 139, 0x15F, 131, 82 },
1334 { 0x14F, 125, 0x15B, 119, 0x14F, 135, 0x15B, 129, 1 },
1335 { 0x15F, 117, 0x16F, 109, 0x15F, 131, 0x16F, 123, 82 },
1336 { 0x15F, 117, 0x16B, 111, 0x15F, 127, 0x16B, 121, 1 },
1337 { 0x16F, 109, 0x17F, 101, 0x16F, 123, 0x17F, 115, 82 },
1338 { 0x16F, 109, 0x17B, 103, 0x16F, 119, 0x17B, 113, 1 },
1339 { 0x17F, 101, 0x18F, 93, 0x17F, 115, 0x18F, 107, 82 },
1340 { 0x17F, 101, 0x18B, 95, 0x17F, 111, 0x18B, 105, 1 },
1341 { 148, 91, 164, 83, 148, 105, 164, 97, 82 },
1342 { 148, 91, 160, 85, 148, 101, 160, 95, 1 },
1343 { 164, 83, 180, 75, 164, 97, 180, 89, 82 },
1344 { 164, 83, 176, 77, 164, 93, 176, 87, 1 },
1345 { 180, 75, 196, 67, 180, 89, 196, 81, 82 },
1346 { 180, 75, 192, 69, 180, 85, 192, 79, 1 },
1347 { 148, 107, 164, 99, 148, 121, 164, 113, 82 },
1348 { 148, 107, 160, 101, 148, 117, 160, 111, 1 },
1349 { 164, 99, 180, 91, 164, 113, 180, 105, 82 },
1350 { 164, 99, 176, 93, 164, 109, 176, 103, 1 },
1351 { 180, 91, 196, 83, 180, 105, 196, 97, 82 },
1352 { 180, 91, 192, 85, 180, 101, 192, 95, 1 },
1353};
1355 0, 4, 1, 4, 2, 4, 3, 4,
1356 4, 4, 5, 4, 6, 4, 7, 4,
1357 8, 4, 9, 4, 10, 4, 11, 4,
1358 0, 0, 0, 0,
1359};
1361 31, 8, 32, 8, 33, 8, 34, 8,
1362 35, 8, 36, 8, 37, 8, 0, 0,
1363};
1365 12, 10, 13, 4, 14, 4, 15, 4,
1366 16, 4, 17, 4, 18, 4, 19, 8,
1367 20, 8, 19, 8, 20, 8, 19, 8,
1368 20, 8, 19, 4, 21, 8, 22, 4,
1369 23, 4, 24, 4, 25, 4, 26, 26,
1370 26, 26, 27, 26, 26, 12, 28, 12,
1371 29, 12, 29, 12, 30, 12, 29, 12,
1372 28, 12, 26, 12, 19, 0, 0, 0,
1373};
1375 38, 4, 39, 4, 40, 4, 41, 4,
1376 42, 4, 43, 4, 44, 4, 45, 4,
1377 46, 4, 47, 4, 48, 4, 49, 4,
1378 0, 0, 0, 0,
1379};
1381 69, 4, 70, 4, 71, 4, 72, 4,
1382 73, 4, 74, 4, 75, 4, 0, 0,
1383};
1385 50, 10, 51, 4, 52, 4, 53, 4,
1386 54, 4, 55, 4, 56, 4, 57, 8,
1387 58, 8, 57, 8, 58, 8, 57, 8,
1388 58, 8, 57, 4, 59, 8, 60, 4,
1389 61, 4, 62, 4, 63, 4, 64, 26,
1390 64, 26, 65, 26, 64, 12, 66, 12,
1391 67, 12, 67, 12, 68, 12, 67, 12,
1392 66, 12, 64, 12, 76, 120, 77, 120,
1393 64, 26, 64, 26, 65, 26, 64, 12,
1394 66, 12, 67, 12, 67, 12, 68, 12,
1395 67, 12, 66, 12, 64, 12, 78, 120,
1396 79, 120, 19, 0,
1397};
1405 NULL,
1406};
1408 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
1409 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
1410 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
1411 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
1412 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
1413 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
1414 { 0x140, 0x100, 0x176, 0x1B4, 0xD8, 0xB4, 0x170, 0x1EC },
1415 { 0x140, 0x100, 0x162, 0x1D8, 0x88, 0xD8, 0x170, 0x1EB },
1416 { 0x1C0, 0x100, 0x1EA, 0x150, 0x2A8, 0x50, 0x170, 0x1EA },
1417 { 0x180, 0x100, 0x1B6, 0x100, 0x1D8, 0, 0x170, 0x1E9 },
1418 { 0x140, 0x100, 0x14E, 0x18A, 0x38, 0x8A, 0x170, 0x1E8 },
1419 { 0x1C0, 0x100, 0x1CA, 0x150, 0x228, 0x50, 0x170, 0x1E7 },
1420 { 0x1C0, 0x100, 0x1D2, 0x150, 0x248, 0x50, 0x170, 0x1E6 },
1421 { 0x1C0, 0x100, 0x1DA, 0x150, 0x268, 0x50, 0x170, 0x1E5 },
1422 { 0x1C0, 0x100, 0x1E2, 0x150, 0x288, 0x50, 0x170, 0x1E4 },
1423 { 0x1C0, 0x100, 0x1F2, 0x150, 0x2C8, 0x50, 0x170, 0x1E3 },
1424 { 0x1C0, 0x100, 0x1EA, 0x170, 0x2A8, 0x70, 0x170, 0x1E2 },
1425 { 0x1C0, 0x100, 0x1F2, 0x170, 0x2C8, 0x70, 0x170, 0x1E1 },
1426 { 0x1C0, 0x100, 0x1C0, 0x178, 0x200, 0x78, 0x170, 0x1E0 },
1427 { 0x1C0, 0x100, 0x1C8, 0x178, 0x220, 0x78, 0x170, 0x1DF },
1428};
1430 { NULL, NULL, 1 },
1431 { NULL, NULL, 1 },
1432 { NULL, NULL, 0 },
1433};
1451FieldActorEntry actor6 = { NULL, actor6Talks, 0x10, 7, 0, 0, 1 };
1452FieldActorEntry actor7 = { NULL, NULL, 0x2D, 8, 0, 0, 1 };
1453FieldActorEntry actor8 = { NULL, NULL, 0x2F, 9, 0, 0, 1 };
1454FieldActorEntry actor9 = { NULL, NULL, 0x31, 0xA, 0, 0, 1 };
1455FieldActorEntry actor10 = { NULL, NULL, 0x35, 0xB, 0, 0, 1 };
1456FieldActorEntry actor11 = { NULL, NULL, 0x38, 0xC, 0, 0, 1 };
1459FieldActorEntry actor14 = { actor14Conditions, NULL, 0x110, 0xF, 0, 0, 1 };
1460FieldActorEntry actor15 = { actor15Conditions, NULL, 0x111, 0x10, 0, 0, 1 };
1461FieldActorEntry actor16 = { actor16Conditions, NULL, 0x112, 0x11, 0, 0, 1 };
1463 &actor0,
1464 &actor1,
1465 &actor2,
1466 &actor3,
1467 &actor4,
1468 &actor5,
1469 &actor6,
1470 &actor7,
1471 &actor8,
1472 &actor9,
1473 &actor10,
1474 &actor11,
1475 &actor12,
1476 &actor13,
1477 &actor14,
1478 &actor15,
1479 &actor16,
1480 NULL,
1481};
1483 { 0, 1, 0x40, 2, 0xA, 0, 0, 0, 0, 0, 198, 179, 0, 0 },
1484 { 0, 2, 0x40, 2, 0x12, 0, 0, 0, 0, 0, 342, 251, 0, 0 },
1485 { 0, 0, 0x80, 6, 0x32, 0, 0, 0, 0, 0, 363, 206, 0, 0 },
1486 { 0, 0, 0x80, 6, 0x35, 0, 0, 0, 0, 0, 136, 235, 0, 0 },
1487 { 1, 0, 0x40, 4, 1, 0, 0, 0, 0, 0, 190, 156, 231, 0 },
1488 { 1, 0, 0x40, 4, 2, 0, 0, 0, 0, 0, 346, 229, 303, 0 },
1489 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1490};
1491void (*stageFuncs[])(void) = {
1492 setupStage,
1493};
1495 { 0, script0, EVENT_TEXT(0), NULL, endEvent0 },
1496 { 684, script684, EVENT_TEXT(0x20), NULL, NULL },
1497 { 742, script742, EVENT_TEXT(0x21), NULL, NULL },
1498 { 885, script885, EVENT_TEXT(0x22), NULL, endEvent885 },
1499 { 971, script971, EVENT_TEXT(0x23), NULL, NULL },
1500#if VERSION_US
1501 { 1500, script1500, EVENT_TEXT(0x24), NULL, NULL },
1502#elif VERSION_EU || VERSION_JP
1503 { 1500, script1500, EVENT_TEXT(0x24), NULL, endEvent1500 },
1504#endif
1505 { -1, NULL, 0, NULL, NULL },
1506};
#define NULL
Definition common.h:17
signed int s32
Definition common.h:11
signed short s16
Definition common.h:9
unsigned short u16
Definition common.h:10
unsigned char u8
Definition common.h:8
GfxState GFX
GFX: the graphics state and its methods.
Definition display.c:209
GameFlags FLAGS_00
The flag bitset FLAGS_00 and the event functions.
Definition events.c:701
GameState GAME
The save data, the game mode and the methods.
Definition state.c:64
#define TASK_RUN
Definition task.h:35
#define TASK_KILL
Definition task.h:37
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Definition task.h:34
#define TASK_DONE
Definition task.h:36
EventTask * FIELDSTG_startEvent(s32 id)
Starts the event id of FieldState.events: its script, start and end, and its text; the player stands ...
Definition event.c:250
The stage overlays (AAA/PRO/WSTAG###.PRO), loaded at 0x800A4CA4 on top of FIELDSTG.
#define SOUND_SE000000
Definition stage.h:748
#define EVENT_TEXT(n)
An entry of the stage's events' text file, for FieldEvent.text.
Definition stage.h:732
#define SOUND_DOOROPEN
Definition stage.h:749
void updateStage()
The names every stage defines, each its own (config/<version>/stages/<stage>.txt).
#define SCRIPT_WAIT_WALK(id)
until the character gets to its goal
Definition field_map.h:168
#define SCRIPT_END
The commands of an event script (FieldEvent.script), as FIELDSTG_runEvent reads them: a halfword kind...
Definition field_map.h:156
#define SCRIPT_LOOK_AT(snap, x, y)
FIELDSTG_pointCamera.
Definition field_map.h:172
#define SCRIPT_LEAVE(mode, x, y, dir)
FIELDSTG_leaveField; ends the event.
Definition field_map.h:170
#define FIELD_LAYER_MAP
the map, its objects and characters, and the menus
Definition field_map.h:20
#define SCRIPT_COMMAND(id, command, arg)
the same word for a script command's id: FIELDSTG_setEventPose creates its task if none runs and hand...
Definition field_map.h:161
#define SCRIPT_FOLLOW(snap, id)
FIELDSTG_followWithCamera.
Definition field_map.h:171
#define FIELD_MAP_FLOOR0
Some of FieldMap's maps (files): those of the floors the player walks on come first,...
Definition field_map.h:85
#define SCRIPT_WALK(id, x, y, dir)
Actor.setGoal: walks to (x, y), then faces dir.
Definition field_map.h:162
#define SCRIPT_WAIT_BOX
until box 0 closes
Definition field_map.h:167
#define SCRIPT_POSE(id, set, dir)
Actor.setPose: its animation set, facing dir.
Definition field_map.h:158
#define SCRIPT_WAIT(frames)
Definition field_map.h:166
#define SCRIPT_WAIT_ANIM(id)
until its animation ends
Definition field_map.h:169
#define SCRIPT_PLACE(id, x, y)
puts a character at (x, y)
Definition field_map.h:157
#define SCRIPT_TALK(box, entry, id, kind)
box of the event's boxes shows the event text's entry: a talk box at the corner kind next to the char...
Definition field_map.h:165
FieldMap FIELDSTG_map
Definition fieldstg.c:3660
FieldState FIELDSTG_state
Definition fieldstg.c:2641
FileCache FILE_CACHE
The file cache.
Definition file_cache.c:7
#define CODES_END
Definition game_state.h:83
#define PROGRESS(n)
GAME.progress is n.
Definition game_state.h:69
#define FLAG(group, id)
The codes of the (code, value) pairs that FLAGS_00 checks as conditions and applies as actions (event...
Definition game_state.h:68
Random RANDOM
Definition random.c:533
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
Definition sound.c:180
#define MUSIC_STREET_CORNER_1
BGM00001: the Street Corner at STORY_JUNGLE_SOUND.
Definition sound.h:115
#define MUSIC_STREET_CORNER_3
BGM00003: the Street Corner at STORY_ASUKA_HEADQUARTERS.
Definition sound.h:117
#define MUSIC_STREET_CORNER_2
BGM00002: the Street Corner at STORY_REAL_WORLD.
Definition sound.h:116
#define SOUND_SE000002
Definition sound.h:59
#define MUSIC_STREET_CORNER
BGM00000: the Street Corner (Kusanagi City)
Definition sound.h:114
#define MUSIC_BANK(music)
The sound bank of a music, which a stage loads for it (FieldState.soundBank)
Definition sound.h:148
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
FIELDSTG's start of the stage (StageEntry.init in FIELDSTG_stages): the stage's task,...
s32 stepLoopingAnimation(AnimState *anim, AnimFrame *frames, s32 depth)
Steps ANIM through FRAMES by the frame time (at most 4), looping at the end (frame 0xFF),...
@ STORY_START
a new game; WSTAG780's event 0, where Junior meets Ivy and Teddy at the Online Center in the real wor...
Definition story.h:23
@ STORY_EXTRA
WSTAG780, event 1500, in the European and Japanese versions: the extra chapter, whose stages are FIEL...
Definition story.h:149
@ STORY_JUNGLE_SOUND
WSTAG545 (Bug Maze Pit), event 711: Patamon heard a weird sound from the jungle, where its leader wen...
Definition story.h:106
@ STORY_MOVIE_BATTLES
WSTAG820, event 1080, with Snatchmon: each encounter plays MODE_BATTLE_MOVIE first.
Definition story.h:146
@ STORY_ASUKA_HEADQUARTERS
WSTAG310 (A.o.A Headquarters, Asuka City), event 961.
Definition story.h:138
@ STORY_GAME_MASTER_CAUGHT
WSTAG305 (Master Room), event 661: the Game Master is caught, but Vemmon takes over the Optical Netwo...
Definition story.h:94
@ STORY_REAL_WORLD
WSTAG750 (the emergency Matrix Chamber), event 820: back in the real world, for 180 seconds.
Definition story.h:121
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
Definition field_map.h:114
One frame of a sprite animation; frame 0xFF ends it (or loops it)
Definition gfx.h:296
s16 frame
Definition gfx.h:297
s16 duration
Definition gfx.h:298
s16 index
Definition gfx.h:302
s16 timer
Definition gfx.h:303
A character of the field (FieldState.actors, a list of pointers up to NULL), which FIELDSTG_updateFie...
Definition field_map.h:194
An event of the table FieldState.events, up to the first id -1, which FIELDSTG_startEvent starts.
Definition field_map.h:141
void(* setFile)(s32 index, s32 file)
FIELDSTG_setMapFile.
Definition field_map.h:100
void(* setFirstMap)(s32 index)
FIELDSTG_setFirstMap: the map the player starts on (GAME.mapIndex), when the mode is new.
Definition field_map.h:104
s32 sheetEntry
the stage's sprite sheet, loaded before the field starts, or 0
Definition field_map.h:445
FieldEvent * events
up to the first id -1
Definition field_map.h:451
s32 soundBank
SOUND.loadBank's, or 0.
Definition field_map.h:459
StageTile * objects
the map objects, up to the first margin 0
Definition field_map.h:446
s32 imageFile
or an image archive file, or 0
Definition field_map.h:449
Vec2 start
where the player starts
Definition field_map.h:456
ActorImage * actors
then the actors', from actors[2]
Definition field_map.h:454
s32 mapFile
the file of the map's tiles (FIELDSTG_createMapStreamer)
Definition field_map.h:444
s32 startDir
and its direction
Definition field_map.h:457
s32 textFile
the stage's text file, for the talks
Definition field_map.h:461
union FieldState::@12 images
s32 music
SOUND.playSound's, or 0.
Definition field_map.h:460
What a character says (FIELDSTG_runActorAction): the first whose conditions hold, or the last,...
Definition field_map.h:176
void *(* getEntry)(u32 fileAndIndex)
Definition file.h:96
void(* applyAction)(s32 code, s32 value)
Definition game_state.h:52
void *(* getPrim)(void)
Definition gfx.h:19
s32(* getFrameTime)(void)
Definition gfx.h:32
struct Layer *(* getLayer)(s32 id)
Definition gfx.h:28
void(* setPrim)(void *next)
Definition gfx.h:20
s32(* getTime)(void)
Definition gfx.h:31
GfxFuncs funcs
Definition gfx.h:77
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
Definition gfx.h:128
void(* getScroll)()
Definition gfx.h:148
u_long *(* getOtEntry)(struct Layer *, s32 depth)
Definition gfx.h:155
void(* addSortedCallback)()
Definition gfx.h:160
s32(* next)(void)
0 to RANDOM_COUNT - 1
Definition random.h:15
short(* playSound)(s32 id)
returns the voice of a key-on
Definition sound.h:187
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
Definition gfx.h:223
void(* setAltClut)()
(x, y)
Definition gfx.h:243
void(* setLayer)()
(layer, depth)
Definition gfx.h:245
void(* setPivot)()
(x, y)
Definition gfx.h:250
void(* setScale)()
(x, y, z), ONE = 1.0
Definition gfx.h:248
void(* setLayerId)()
(id, depth)
Definition gfx.h:244
void(* setClutRow)()
(row)
Definition gfx.h:247
void(* draw)()
(sheet, frame, x, y)
Definition gfx.h:246
void(* setTexture)()
(x, y)
Definition gfx.h:242
An animation played at (x, y)
Definition stage.h:463
AnimFrame * frames
Definition stage.h:464
An animation of a table of byte pairs (frame, duration; duration 0 loops to frame)
Definition stage.h:485
s32 cur
the animation playing
Definition stage.h:487
s32 anim
the animation wanted
Definition stage.h:486
Two StageByteAnim animations.
Definition stage.h:494
void(* nextState)(struct StageByteAnims *task)
Definition stage.h:495
StageByteAnim anims[2]
Definition stage.h:496
A sprite at (x, y) from the stage's sheet (FieldState.sheetEntry) with an animated palette,...
Definition stage.h:79
s32 x
Definition stage.h:82
s32 frame
Definition stage.h:81
s32 state
Definition stage.h:80
AnimState anim
the one-shot animation
Definition stage.h:84
void(* nextState)(struct StageEffect *task)
Definition stage.h:80
s32 key1
Definition stage.h:80
s32 y
Definition stage.h:83
Two pictures that change by turns, and the flyers they let out.
Definition stage.h:476
s32 right
the picture of the third (0-2)
Definition stage.h:479
s32 left
the picture of the first two (0-2)
Definition stage.h:478
s32 spawnA
let out the first set of flyers
Definition stage.h:480
void(* nextSubstate)(struct StageFlyerGate *task)
Definition stage.h:477
s32 spawnB
let out the second set
Definition stage.h:481
void(* nextState)(struct StageFlyerGate *task)
Definition stage.h:477
A sprite that flies off diagonally, animated.
Definition stage.h:444
void(* setState)(struct StageFlyer *task, s32 state)
Definition stage.h:445
void(* nextState)(struct StageFlyer *task)
Definition stage.h:445
s32 frame
Definition stage.h:450
s32 anim
Definition stage.h:449
s32 timer
Definition stage.h:451
s32 state
Definition stage.h:445
s32 right
else left; also flips the sprite
Definition stage.h:447
s32 up
else down
Definition stage.h:446
s32 y
Definition stage.h:453
s32 still
doesn't move or animate
Definition stage.h:448
s32 x
8.8
Definition stage.h:452
A brightness that rises from 12 to 28, holds, then falls back.
Definition stage.h:457
s32 state
Definition stage.h:458
void(* nextState)(struct StageGlow *task)
Definition stage.h:458
s32 level
Definition stage.h:459
void(* nextSubstate)(struct StageGlow *task)
Definition stage.h:458
s32 step
Definition stage.h:458
void(* setState)(struct StageGlow *task, s32 state)
Definition stage.h:458
s32 substate
Definition stage.h:458
A texture of a StageQuad: its page, square at (u, v), and palette.
Definition stage.h:518
A quad of the screen: its corners and what it shows.
Definition stage.h:500
s16 x1
Definition stage.h:503
s16 x2
Definition stage.h:505
s16 y3
Definition stage.h:508
s16 x0
Definition stage.h:501
s16 x3
Definition stage.h:507
s16 y1
Definition stage.h:504
s16 y0
Definition stage.h:502
s16 kind
0-1: the frame of that animation, else the texture
Definition stage.h:509
s16 y2
Definition stage.h:506
The task a stage starts (startStage), updated by its updateStage.
Definition stage.h:26
void(* nextState)(struct StageTask *task)
Definition stage.h:27
s32 state
Definition stage.h:27
A map object with the animation that sets its frame.
Definition stage.h:108
StageTile * tile
Definition stage.h:109
AnimState anim
Definition stage.h:110
Two map objects, animated.
Definition stage.h:470
StageTileAnim tiles[2]
Definition stage.h:472
void(* nextState)(struct StageTileLoop2 *task)
Definition stage.h:471
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
Definition field_map.h:208
u8 margin
how far off the view it is still drawn; 0 ends the table
Definition field_map.h:214
u8 anim
which of a stage's animations sets frame (1-3); FIELDSTG finds objects by it (its lift,...
Definition field_map.h:210
Any task, seen through its header.
Definition task.h:62
s32 key1
Definition task.h:63
void(* setSubstate)(struct Task *task, s32 substate)
Definition task.h:63
Definition gfx.h:352
s32 y
Definition gfx.h:354
s32 x
Definition gfx.h:353
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105
void * createTaskWithId(void(*update)(), s32 size, s32 childrenSize, s32 id)
Allocates a zeroed task of size bytes (header included) with room for childrenSize / 4 child tasks.
Definition task.c:80
u16 actor1Conditions[]
Definition wstag780.c:1435
FieldActorEntry actor0
Definition wstag780.c:1445
StageAnimSpot updateEffectSpots[]
Definition wstag780.c:1177
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag780.c:1491
FieldActorEntry actor6
Definition wstag780.c:1451
AnimFrame updateTileLoop2Frames_0[]
Definition wstag780.c:1189
void updateEffect(StageEffect *task)
A looping sprite animation at the place key1 picks, started at a random point.
Definition wstag780.c:182
void drawFlyerGate(StageFlyerGate *task)
Draws the three pictures of the gate.
Definition wstag780.c:345
void drawByteAnims(StageByteAnims *task)
Draws the 40 quads, those of kind 0 and 1 with the frames of the animations.
Definition wstag780.c:467
void endEvent0(void)
After event 0, with Junior, Ivy and Teddy: moves the story on to STORY_START.
Definition wstag780.c:614
s16 script0[]
Definition wstag780.c:676
void endEvent1500(void)
The end of event 1500, only in the European version: the story goes on to its extra chapter.
Definition wstag780.c:625
void updateGlow(StageGlow *task)
Raises the level with a sound, waits, lowers it and ends, drawing it.
Definition wstag780.c:116
void * createFlyer(s32 up, s32 right, s32 still, s32 anim)
Creates a flyer at the start the direction and stillness pick.
Definition wstag780.c:88
u8 flyerFrames[]
Defined below, after the code that uses them.
Definition wstag780.c:1164
void * createCommand801(s32 arg)
Command 801 of the event scripts: the two animations of updateByteAnims in the MAGAMI Online Center's...
Definition wstag780.c:577
void * createCommand800(s32 arg)
Creates the task of updateFlyerGate with id ARG.
Definition wstag780.c:462
void * createCommand802(s32 arg)
Command 802 of the event scripts: the glow (updateGlow) of the MAGAMI Online Center's events.
Definition wstag780.c:161
void drawFlyer(StageFlyer *task)
Draws the sprite at (x, y), flipped when it goes right.
Definition wstag780.c:26
u8 byteAnims_2[]
Definition wstag780.c:1364
FieldActorEntry actor5
Definition wstag780.c:1450
void drawGlow(StageGlow *task)
Draws the picture of file SPRITES with the frame of the level.
Definition wstag780.c:105
void updateEffectSet(StageTask *task, void **children)
Creates the six objects of updateEffect (keys 0-5) and the object of updateTileLoop2.
Definition wstag780.c:289
void updateTileLoop2(StageTileLoop2 *task)
Shows and loops the animations of the map objects with animations 1 and 2.
Definition wstag780.c:245
s16 script1500[]
Definition wstag780.c:1019
FieldActorEntry actor2
Definition wstag780.c:1447
#define SPRITES
The file of the stage's sprites, which the versions number differently.
Definition wstag780.c:22
void releaseFlyers(StageFlyerGate *task, void **children)
Lets out the flyers of the sets that are on, where their children are free.
Definition wstag780.c:314
void drawEffect(StageEffect *task, void *arg)
Draws the sprite of the effect at (x, y) at depth 4 of LAYER while it runs.
Definition wstag780.c:168
FieldActorEntry * stageActors[]
Definition wstag780.c:1462
u8 * byteAnims[]
Definition wstag780.c:1398
AnimFrame * updateTileLoop2Frames[]
Definition wstag780.c:1204
u16 actor13Conditions[]
Definition wstag780.c:1441
void handleCommand800(Task *task, s32 id)
Stops the object (substate 0) for map 0x324, starts it (substate 1) for 0x320.
Definition wstag780.c:448
#define STAGE_ARCHIVE
Definition wstag780.c:639
FieldActorEntry actor10
Definition wstag780.c:1455
void * createEffect(s32 key)
Creates the task of updateEffect with KEY as its key1.
Definition wstag780.c:208
u16 actor4Conditions[]
Definition wstag780.c:1438
FieldActorEntry actor4
Definition wstag780.c:1449
u16 actor3Conditions[]
Definition wstag780.c:1437
void * createTileLoop2(void)
Creates the looping map objects with animations 1 and 2 (updateTileLoop2)
Definition wstag780.c:284
FieldActorEntry actor8
Definition wstag780.c:1453
AnimFrame updateEffectSpots_0[]
Definition wstag780.c:1174
ActorImage stageImages[]
Definition wstag780.c:1407
FieldTalk actor6Talks[]
Definition wstag780.c:1429
void setupStage(void)
Sets the stage up: its map, actors and events, playing BGM00000, or BGM00001 at STORY_JUNGLE_SOUND,...
Definition wstag780.c:645
void * createEffectSet(void)
Creates the stage's six effects and its looping map objects (updateEffectSet)
Definition wstag780.c:309
u16 actor16Conditions[]
Definition wstag780.c:1444
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag780.c:1482
FieldActorEntry actor9
Definition wstag780.c:1454
s16 script971[]
Definition wstag780.c:942
u16 actor5Conditions[]
Definition wstag780.c:1439
u8 byteAnims_5[]
Definition wstag780.c:1384
Vec2 flyerStarts[2][2][2]
Definition wstag780.c:1167
StageQuadTexture drawByteAnimsTextures[]
Definition wstag780.c:1207
FieldActorEntry actor15
Definition wstag780.c:1460
FieldActorEntry actor12
Definition wstag780.c:1457
FieldActorEntry actor16
Definition wstag780.c:1461
u16 actor15Conditions[]
Definition wstag780.c:1443
u8 byteAnims_4[]
Definition wstag780.c:1380
u16 actor14Conditions[]
Definition wstag780.c:1442
FieldActorEntry actor7
Definition wstag780.c:1452
AnimFrame updateEffectSpots_4[]
Definition wstag780.c:1171
s16 script885[]
Definition wstag780.c:925
FieldActorEntry actor13
Definition wstag780.c:1458
AnimFrame updateTileLoop2Frames_1[]
Definition wstag780.c:1197
FieldActorEntry actor11
Definition wstag780.c:1456
FieldActorEntry actor1
Definition wstag780.c:1446
u8 byteAnims_0[]
Definition wstag780.c:1354
void updateFlyer(StageFlyer *task)
Moves the sprite diagonally unless it is still, animates it and ends it off screen.
Definition wstag780.c:44
#define STAGE_FILE
Definition wstag780.c:638
u8 byteAnims_3[]
Definition wstag780.c:1374
s16 script742[]
Definition wstag780.c:875
s16 script684[]
Definition wstag780.c:818
u16 actor2Conditions[]
Definition wstag780.c:1436
void handleCommand801(StageByteAnims *task, s32 id)
Switches the animations to 2 and 5 with a sound for map 0x322.
Definition wstag780.c:565
#define STAGE_TEXT
Definition wstag780.c:636
u8 byteAnims_1[]
Definition wstag780.c:1360
void updateFlyerGate(StageFlyerGate *task, void **children)
Swaps the pictures every 0x79 frames, letting out the flyers.
Definition wstag780.c:392
void endEvent885(void)
After event 885: lets event 886 of WSTAG750 start.
Definition wstag780.c:619
s32 stepTileLoopAnimation(StageTileAnim *obj, AnimFrame *frames, s32 depth)
Steps OBJ's animation through FRAMES by the frame time (at most 4), looping at the end (frame 0xFF),...
Definition wstag780.c:220
StageQuad drawByteAnimsQuads[]
Definition wstag780.c:1292
FieldActorEntry actor3
Definition wstag780.c:1448
FieldActorEntry actor14
Definition wstag780.c:1459
FieldEvent stageEvents[]
Definition wstag780.c:1494
void updateByteAnims(StageByteAnims *task)
Plays its two byte-pair animations, restarting one when its animation changes, and draws.
Definition wstag780.c:524
u16 actor12Conditions[]
Definition wstag780.c:1440
u16 actor0Conditions[]
Definition wstag780.c:1434