Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag750.c
Go to the documentation of this file.
1/*
2 * WSTAG750: Chamber Room, North Sector: the emergency Matrix Chamber. Its
3 * gates lead to the Real World and the Ice Dungeon (WSTAG735); the trip to the
4 * Real World (its 180 seconds, the Juggernaut taken) plays here.
5 */
6
7#include "common.h"
8#include "field/stage.h"
9/* Defined below, after the code that uses them */
12extern s8 tileEffectSortY[];
13extern s8 tileEffectY[];
14extern s16 tileEffectPlaces[][2];
15
17
19
20/* Moves its map objects to (x, y) and animates them when the substate is set to 1 */
22 StageTile *tile;
23 StageTile *t;
24 s32 i;
25 s32 n;
26 s32 j;
27 s32 frame;
28 s32 done;
29
30 switch (task->state) {
31 case TASK_INIT:
32 default:
33 resetTileEffect(task);
34 task->nextState(task);
35 break;
36 case TASK_RUN:
37 switch (task->substate) {
38 case 0:
39 break;
40 case 1:
41 switch (task->step) {
42 case 0:
43 n = 0;
44 for (t = FIELDSTG_state.objects; t->margin != 0; t++) {
45 if (t->anim >= 1 && t->anim <= 3) {
46 task->anims[n].tile = t;
47 t->x = task->x;
48 t->y = task->y + tileEffectY[n];
49 t->sortY = task->y + tileEffectSortY[n];
50 n++;
51 }
52 }
54 task->nextStep(task);
55 /* fallthrough */
56 case 1:
57 done = 0;
58 for (i = 0; i < 3; i++) {
59 tile = task->anims[i].tile;
60 frame = stepAnimationOnce(&task->anims[i], updateTileEffectFrames[i], 0);
61 switch (frame) {
62 case 0xFF:
63 done++;
64 tile->visible = 0;
65 tile->frame = 0;
66 break;
67 case 0x12C:
68 tile->visible = 0;
69 tile->frame = 0;
70 break;
71 default:
72 tile->visible = 1;
73 tile->frame = frame;
74 break;
75 }
76 }
77 if (done < 3) {
78 break;
79 }
80 task->nextStep(task);
81 /* fallthrough */
82 case 2:
83 for (j = 0; j < 3; j++) {
84 task->anims[j].tile->visible = 0;
85 }
86 resetTileEffect(task);
87 task->setSubstate(task, 0);
88 break;
89 }
90 break;
91 }
92 break;
93 case TASK_DONE:
94 case TASK_KILL:
95 break;
96 }
97}
98
99/* Starts the effect at the place of map 0x335 */
101 s32 i;
102
103 if (task != NULL) {
104 i = 0;
105 switch (id) {
106 case 0x335:
107 task->x = tileEffectPlaces[i][0];
108 task->y = tileEffectPlaces[i][1];
109 task->setSubstate(task, 1);
110 break;
111 }
112 }
113}
114
116
117/* Creates the stage's effect, the event object of story progress 0x20 that applies, and another object */
118void updateStage(StageTask *task, void **children) {
119 switch (task->state) {
120 case TASK_INIT:
121 default:
122 if (updateStageSpots[0].kind == 0) {
123 children[0] = createStageEffect(updateStageSpots[0].x, updateStageSpots[0].y, updateStageSpots[0].frame);
124 }
126 FLAGS_00.checkCondition(FLAG(0x40, 0x66), 0)) {
127 children[2] = FIELDSTG_startEvent(0x35C);
130 children[2] = FIELDSTG_startEvent(0x373);
132 FLAGS_00.checkCondition(FLAG(0x40, 0x62), 0) && FLAGS_00.checkCondition(FLAG(0x40, 0x66), 0)) {
133 children[2] = FIELDSTG_startEvent(0x374);
134 } else if (GAME.progress == STORY_REAL_WORLD && FLAGS_00.checkCondition(FLAG(0x40, 0x66), 1)) {
135 children[2] = FIELDSTG_startEvent(0x376);
136 }
137 children[1] = createTileEffect(0x34E);
138 task->nextState(task);
139 break;
140 case TASK_RUN:
141 case TASK_DONE:
142 case TASK_KILL:
143 break;
144 }
145}
146
147#define STAGE_CHILDREN_SIZE 0xC
154
155/* After event 820, with Chamber Officer: moves the story on to STORY_REAL_WORLD */
156void endEvent820(void) {
158}
159
160/* After event 860, with Chamber Office: keeps it from playing again */
164
165/* After event 883, with Chamber Officer: keeps it from playing again */
169
170/* After event 884, with the player: keeps it from playing again */
171void endEvent884(void) {
172 FLAGS_00.applyAction(FLAG(0x40, 0x62), 1);
173}
174
175/* After event 886, with the player: moves the story on to STORY_NETWORK_OFFLINE */
179
180/*
181 * After event 1245, with Guardromon: applies 0x7C0A, an action that does
182 * nothing (applyAction's mode changes 0x7C are only 0 and 1)
183 */
184void endEvent1245(void) {
185 FLAGS_00.applyAction(0x7C0A, 1);
186}
187
188#if VERSION_US || VERSION_JP
189#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_02)
190#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
191#define STAGE_FILE 0x6B2
192#elif VERSION_EU
193#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_02)
194#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
195#define STAGE_FILE 0x6C1
196#endif
197/* Sets the stage up: its map, actors and events, playing the ambience ENV_0024 */
216
218 SCRIPT_WALK(2, 0xA0, 0x128, 3),
219 SCRIPT_POSE(0xD, 1, 7),
222 SCRIPT_POSE(2, 1, 3),
224 SCRIPT_WAIT(0x78),
226 SCRIPT_WAIT(0x1E),
227 SCRIPT_TALK(0, 1, 0xD, 2),
229 SCRIPT_WAIT(0x1E),
230 SCRIPT_TALK(0, 2, 2, 1),
231 SCRIPT_POSE(2, 7, 3),
233 SCRIPT_POSE(2, 1, 3),
234 SCRIPT_WAIT(0x1E),
235 SCRIPT_POSE(0xD, 9, 7),
236 SCRIPT_WAIT_ANIM(0xD),
237 SCRIPT_POSE(0xD, 1, 7),
238 SCRIPT_WAIT(0x1E),
239 SCRIPT_TALK(0, 3, 0xD, 2),
241 SCRIPT_WAIT(0x1E),
242 SCRIPT_POSE(0xD, 1, 3),
243 SCRIPT_WAIT(0x1E),
244 SCRIPT_WALK(0xD, 0x6F, 0x110, 3),
245 SCRIPT_WAIT_WALK(0xD),
246 SCRIPT_POSE(0xD, 1, 3),
247 SCRIPT_WAIT(0x1E),
248 SCRIPT_POSE(0xD, 2, 3),
249 SCRIPT_WAIT(0x78),
250 SCRIPT_POSE(0xD, 1, 3),
251 SCRIPT_WAIT(0x5A),
252 SCRIPT_POSE(0xD, 1, 7),
253 SCRIPT_WAIT(0x1E),
254 SCRIPT_WALK(0xD, 0x81, 0x119, 7),
255 SCRIPT_WAIT_WALK(0xD),
256 SCRIPT_POSE(0xD, 1, 7),
257 SCRIPT_WAIT(0x1E),
258 SCRIPT_TALK(0, 4, 0xD, 2),
260 SCRIPT_WAIT(0x1E),
261 SCRIPT_COMMAND(0x323, 0x325, 2),
262 SCRIPT_WAIT(0x5A),
263 SCRIPT_COMMAND(0x323, 0x326, 2),
264 SCRIPT_WAIT(0x1E),
265 SCRIPT_WAIT(0x1E),
266 SCRIPT_TALK(0, 5, 2, 1),
267 SCRIPT_POSE(2, 7, 3),
269 SCRIPT_POSE(2, 1, 3),
270 SCRIPT_WAIT(0x1E),
271 SCRIPT_TALK(0, 6, 0xD, 2),
273 SCRIPT_WAIT(0x1E),
274 SCRIPT_TALK(0, 7, 2, 1),
275 SCRIPT_POSE(2, 7, 3),
277 SCRIPT_POSE(2, 1, 3),
278 SCRIPT_WAIT(0x1E),
279 SCRIPT_TALK(0, 8, 0xD, 2),
281 SCRIPT_WAIT(0x1E),
282 SCRIPT_POSE(2, 1, 5),
283 SCRIPT_WAIT(0x1E),
284 SCRIPT_WALK(2, 0x160, 0xC8, 5),
286 SCRIPT_LOOK_AT(1, 0x160, 0xC8),
287 SCRIPT_POSE(2, 1, 5),
288 SCRIPT_WAIT(0x1E),
289 SCRIPT_POSE(2, 1, 1),
290 SCRIPT_WAIT(0x3C),
291 SCRIPT_COMMAND(0x34E, 0x335, 2),
292 SCRIPT_WAIT(0x78),
293 SCRIPT_PLACE(2, 0, 0),
294 SCRIPT_POSE(2, 1, 1),
295 SCRIPT_WAIT(0x3C),
296 SCRIPT_WAIT(0x3C),
297 SCRIPT_LEAVE(0x2DA, 0x45F, 0x37D, 1),
299};
301 SCRIPT_LOOK_AT(1, 0xF0, 0xE0),
302 SCRIPT_PLACE(2, 0, 0),
303 SCRIPT_POSE(2, 1, 0),
304 SCRIPT_PLACE(0xD, 0x81, 0x119),
305 SCRIPT_POSE(0xD, 1, 7),
306 SCRIPT_WAIT(0x78),
307 SCRIPT_TALK(0, 1, 2, 4),
309 SCRIPT_LOOK_AT(0, 0xD0, 0xF0),
310 SCRIPT_COMMAND(0x323, 0x325, 0xD),
311 SCRIPT_WAIT(0x3C),
312 SCRIPT_COMMAND(0x323, 0x326, 0xD),
313 SCRIPT_WAIT(0x1E),
314 SCRIPT_WALK(0xD, 0x6F, 0x110, 3),
315 SCRIPT_WAIT_WALK(0xD),
316 SCRIPT_POSE(0xD, 2, 3),
317 SCRIPT_WAIT(0x3C),
318 SCRIPT_LOOK_AT(0, 0xF0, 0xE0),
319 SCRIPT_WAIT(0x3C),
320 SCRIPT_COMMAND(0x34E, 0x335, 2),
321 SCRIPT_WAIT(0x78),
322 SCRIPT_PLACE(2, 0x15E, 0xCA),
323 SCRIPT_POSE(2, 1, 1),
324 SCRIPT_WAIT(0x5A),
325 SCRIPT_LOOK_AT(0, 0xD0, 0xF0),
326 SCRIPT_TALK(0, 2, 0xD, 2),
328 SCRIPT_FOLLOW(0, 2),
329 SCRIPT_POSE(0xD, 1, 7),
330 SCRIPT_WAIT(0x3C),
331 SCRIPT_WALK(0xD, 0x81, 0x119, 7),
332 SCRIPT_COMMAND(0x323, 0x325, 2),
333 SCRIPT_WAIT(0x3C),
334 SCRIPT_COMMAND(0x323, 0x326, 2),
335 SCRIPT_WAIT(0x1E),
336 SCRIPT_POSE(2, 1, 3),
337 SCRIPT_WAIT(0x1E),
338 SCRIPT_POSE(2, 1, 7),
339 SCRIPT_WAIT(0x1E),
340 SCRIPT_POSE(2, 1, 1),
341 SCRIPT_WAIT(0x1E),
342 SCRIPT_TALK(0, 3, 2, 3),
344 SCRIPT_WAIT(0x3C),
345 SCRIPT_TALK(0, 4, 2, 3),
347 SCRIPT_LEAVE(0x2DC, 1, 1, 0),
349};
351 SCRIPT_LOOK_AT(1, 0xF0, 0xE0),
352 SCRIPT_PLACE(2, 0, 0),
353 SCRIPT_POSE(2, 1, 0),
354 SCRIPT_PLACE(0xD, 0x81, 0x119),
355 SCRIPT_POSE(0xD, 1, 7),
356 SCRIPT_WAIT(0x78),
357 SCRIPT_TALK(0, 3, 2, 4),
359 SCRIPT_LOOK_AT(0, 0xD0, 0xF0),
360 SCRIPT_COMMAND(0x323, 0x325, 0xD),
361 SCRIPT_WAIT(0x3C),
362 SCRIPT_COMMAND(0x323, 0x326, 0xD),
363 SCRIPT_WAIT(0x1E),
364 SCRIPT_WALK(0xD, 0x6F, 0x110, 3),
365 SCRIPT_WAIT_WALK(0xD),
366 SCRIPT_POSE(0xD, 2, 3),
367 SCRIPT_WAIT(0x3C),
368 SCRIPT_LOOK_AT(0, 0xF0, 0xE0),
369 SCRIPT_WAIT(0x3C),
370 SCRIPT_COMMAND(0x34E, 0x335, 2),
371 SCRIPT_WAIT(0x78),
372 SCRIPT_PLACE(2, 0x15E, 0xCA),
373 SCRIPT_POSE(2, 1, 1),
374 SCRIPT_WAIT(0x5A),
375 SCRIPT_LOOK_AT(0, 0xD0, 0xF0),
376 SCRIPT_TALK(0, 1, 0xD, 2),
378 SCRIPT_FOLLOW(0, 2),
379 SCRIPT_POSE(0xD, 1, 7),
380 SCRIPT_WAIT(0x3C),
381 SCRIPT_WALK(0xD, 0x81, 0x119, 7),
382 SCRIPT_COMMAND(0x323, 0x325, 2),
383 SCRIPT_WAIT(0x3C),
384 SCRIPT_COMMAND(0x323, 0x326, 2),
385 SCRIPT_WAIT(0x1E),
386 SCRIPT_TALK(0, 4, 2, 2),
388 SCRIPT_COMMAND(0x323, 0x327, 2),
389 SCRIPT_WAIT(0x3C),
390 SCRIPT_COMMAND(0x323, 0x326, 2),
391 SCRIPT_WAIT(0x1E),
392 SCRIPT_TALK(0, 2, 2, 2),
393 SCRIPT_POSE(2, 1, 7),
395 SCRIPT_WAIT(0x1E),
396 SCRIPT_LEAVE(0x2D7, 0, 0, 1),
398};
400 SCRIPT_PLACE(2, 0x15E, 0xCA),
401 SCRIPT_POSE(2, 1, 1),
402 SCRIPT_PLACE(0xD, 0x81, 0x119),
403 SCRIPT_POSE(0xD, 1, 7),
404 SCRIPT_WAIT(0x78),
405 SCRIPT_TALK(0, 1, 2, 2),
407 SCRIPT_COMMAND(0x323, 0x327, 2),
408 SCRIPT_WAIT(0x3C),
409 SCRIPT_POSE(2, 1, 7),
410 SCRIPT_COMMAND(0x323, 0x326, 2),
411 SCRIPT_WAIT(0x1E),
412 SCRIPT_TALK(0, 2, 2, 2),
414 SCRIPT_WAIT(0x1E),
415 SCRIPT_LEAVE(0x2D7, 0x64, 0x64, 0),
417};
419 SCRIPT_PLACE(2, 0x15E, 0xCA),
420 SCRIPT_POSE(2, 1, 7),
421 SCRIPT_PLACE(0xD, 0x81, 0x119),
422 SCRIPT_POSE(0xD, 1, 7),
423 SCRIPT_WAIT(0x78),
424 SCRIPT_TALK(0, 1, 2, 2),
426 SCRIPT_WAIT(0x1E),
427 SCRIPT_TALK(0, 2, 2, 2),
428 SCRIPT_POSE(2, 1, 1),
430 SCRIPT_WAIT(0x1E),
431 SCRIPT_WALK(2, 0xA0, 0x128, 1),
432 SCRIPT_WAIT(0x3C),
433 SCRIPT_LEAVE(0x26A, 0x3C0, 0x50, 7),
435};
437 SCRIPT_WALK(2, 0x100, 0x1C8, 3),
438 SCRIPT_PLACE(0x15, 0xE0, 0x1B9),
439 SCRIPT_POSE(0x15, 1, 7),
442 SCRIPT_POSE(2, 1, 3),
443 SCRIPT_WAIT(6),
444 SCRIPT_WAIT(0x1E),
445 SCRIPT_TALK(0, 1, 0x15, 0),
447 SCRIPT_WAIT(0x1E),
448 SCRIPT_POSE(0x15, 0x36, 7),
450 SCRIPT_WAIT_ANIM(0x15),
451 SCRIPT_POSE(0x15, 0x37, 7),
452 SCRIPT_WAIT(0x5A),
453 SCRIPT_LEAVE(0xC08, 0, 0, 0),
455};
457 { 70, 4 }, { 71, 4 }, { 70, 4 }, { 71, 4 },
458 { 255, 0x3E7 },
459};
461 { 0x12C, 56 }, { 85, 6 }, { 86, 6 }, { 87, 4 },
462 { 88, 4 }, { 89, 4 }, { 90, 4 }, { 88, 4 },
463 { 89, 4 }, { 90, 4 }, { 88, 4 }, { 89, 4 },
464 { 90, 4 }, { 88, 4 }, { 89, 4 }, { 90, 4 },
465 { 88, 4 }, { 89, 4 }, { 90, 4 }, { 255, 0x3E7 },
466};
468 { 0x12C, 16 }, { 72, 4 }, { 73, 4 }, { 74, 4 },
469 { 73, 4 }, { 75, 6 }, { 76, 6 }, { 77, 14 },
470 { 78, 114 }, { 79, 6 }, { 80, 6 }, { 81, 6 },
471 { 82, 6 }, { 83, 6 }, { 84, 8 }, { 255, 0x3E7 },
472};
477 30, 30, 30, 0,
478};
480 0, -0x2F, -0x2F, 0,
481};
483 { 0x140, 186 },
484};
486 { 28, 0, 108, 0x144 },
487};
489 { 0, 6 }, { 1, 6 }, { 2, 68 }, { 1, 4 },
490 { 0, 4 }, { 255, 0 },
491};
493 { 0x12C, 18 }, { 1, 6 }, { 2, 6 }, { 3, 6 },
494 { 4, 6 }, { 5, 4 }, { 6, 4 }, { 7, 4 },
495 { 5, 4 }, { 6, 4 }, { 7, 4 }, { 5, 4 },
496 { 6, 4 }, { 7, 4 }, { 5, 4 }, { 6, 4 },
497 { 7, 4 }, { 4, 4 }, { 3, 4 }, { 2, 4 },
498 { 1, 4 }, { 255, 0x3E7 },
499};
501 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
502 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
503 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
504 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
505 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
506 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
507 { 0x140, 0x100, 0x176, 0x1B0, 0xD8, 0xB0, 0x160, 0x1F8 },
508 { 0x140, 0x100, 0x164, 0x1C8, 0x90, 0xC8, 0x170, 0x1F8 },
509 { 0x140, 0x100, 0x14A, 0x1B0, 0x28, 0xB0, 0x150, 0x1F7 },
510 { 0x180, 0x100, 0x194, 0x140, 0x150, 0x40, 0x160, 0x1F7 },
511 { 0x180, 0x100, 0x19C, 0x148, 0x170, 0x48, 0x170, 0x1F7 },
512};
515u16 actor0Talk1Conditions[] = { ITEM(0, 0xC), 0, FLAG(0, 0), 1, CODES_END };
517 ITEM(0, 0xC), 1,
519 FLAG(0, 0), 1,
520 CODES_END,
521};
524 ITEM(0, 0xC), 1,
526 FLAG(0, 0), 1,
527 CODES_END,
528};
539 { NULL, actor1Talk0Actions, 0x16B },
540 { NULL, NULL, 0 },
541};
543 { NULL, actor2Talk0Actions, 0x168 },
544 { NULL, NULL, 0 },
545};
547 { NULL, NULL, 0x212 },
548 { NULL, NULL, 0 },
549};
551 { NULL, NULL, 0x20F },
552 { NULL, NULL, 0 },
553};
555 { NULL, NULL, 0x20F },
556 { NULL, NULL, 0 },
557};
559 { NULL, NULL, 0x20F },
560 { NULL, NULL, 0 },
561};
563 { NULL, NULL, 0x20F },
564 { NULL, NULL, 0 },
565};
567 { NULL, NULL, 0x20F },
568 { NULL, NULL, 0 },
569};
571 { NULL, NULL, 0x210 },
572 { NULL, NULL, 0 },
573};
575 { NULL, NULL, 0x211 },
576 { NULL, NULL, 0 },
577};
579 { NULL, NULL, 0x20E },
580 { NULL, NULL, 0 },
581};
583 { NULL, NULL, 0x20E },
584 { NULL, NULL, 0 },
585};
587 { NULL, NULL, 0x312 },
588 { NULL, NULL, 0 },
589};
607FieldActorEntry actor1 = { NULL, actor1Talks, 0x14, 5, 162, 473, 7 };
608FieldActorEntry actor2 = { NULL, actor2Talks, 0x15, 6, 224, 441, 7 };
621 &actor0,
622 &actor1,
623 &actor2,
624 &actor3,
625 &actor4,
626 &actor5,
627 &actor6,
628 &actor7,
629 &actor8,
630 &actor9,
631 &actor10,
632 &actor11,
633 &actor12,
634 &actor13,
635 NULL,
636};
638 { 0, 1, 0x50, 6, 0x46, 0, 0, 0, 0, 0, 320, 186, 0, 0 },
639 { 1, 0, 0x40, 6, 0x60, 1, 0x60, 0x63, 6, 0, 324, 169, 0, 0 },
640 { 1, 0, 0x40, 6, 0x39, 2, 0, 0xB, 8, 0, 78, 233, 0, 0 },
641 { 1, 0, 0x40, 6, 0x39, 2, 0, 0xB, 8, 0, 93, 214, 0, 0 },
642 { 1, 0, 0x40, 6, 0x39, 2, 0, 0xB, 8, 0, 109, 217, 0, 0 },
643 { 1, 0, 0x40, 6, 0x3A, 2, 0, 0xB, 8, 0, 78, 221, 0, 0 },
644 { 1, 0, 0x40, 6, 0x3A, 2, 0, 0xB, 8, 0, 93, 225, 0, 0 },
645 { 1, 0, 0x40, 6, 0x3A, 2, 0, 0xB, 8, 0, 109, 205, 0, 0 },
646 { 1, 0, 0x40, 6, 0x32, 1, 0x32, 0x34, 0xA, 0, 82, 234, 0, 0 },
647 { 1, 0, 0x40, 6, 0x35, 1, 0x35, 0x37, 0xA, 0, 139, 230, 0, 0 },
648 { 0, 3, 0x50, 4, 0x55, 0, 0, 0, 0, 0, 320, 139, 206, 0 },
649 { 0, 2, 0x50, 4, 0x48, 0, 0, 0, 0, 0, 320, 139, 213, 0 },
650 { 1, 0, 0x40, 4, 0x5C, 1, 0x5C, 0x5F, 6, 0, 324, 185, 209, 0 },
651 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
652};
654 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x26C, 0xB8, 0xB4, 7, 0, 0, 0 },
655 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH_OUT, 0x26A, 0x3C0, 0x50, 7, 0, 0, 0 },
656 { { { CODES_END, 0 }, { CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
657};
658void (*stageFuncs[])(void) = {
660};
662 { 820, script820, EVENT_TEXT(0x19), NULL, endEvent820 },
663 { 860, script860, EVENT_TEXT(0x1C), NULL, endEvent860 },
664 { 883, script883, EVENT_TEXT(0x1D), NULL, endEvent883 },
665 { 884, script884, EVENT_TEXT(0x1E), NULL, endEvent884 },
666 { 886, script886, EVENT_TEXT(0x1F), NULL, endEvent886 },
667 { 1245, script1245, EVENT_TEXT(8), NULL, endEvent1245 },
668 { -1, NULL, 0, NULL, NULL },
669};
#define NULL
Definition common.h:17
signed int s32
Definition common.h:11
signed char s8
Definition common.h:7
signed short s16
Definition common.h:9
unsigned short u16
Definition common.h:10
StageEffect * createStageEffect(s32 x, s32 y, s32 frame)
Creates a StageEffect at (x, y) with its sprites' frames from FRAME.
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 EVENT_TEXT(n)
An entry of the stage's events' text file, for FieldEvent.text.
Definition stage.h:732
#define SOUND_ENTRY_02
Definition stage.h:752
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 FIELD_COMMAND_HALT_PARTNERS
The field commands, which an event script hands FIELD_TASK_COMMANDS as the first argument of a pose c...
Definition field_map.h:41
#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 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 FIELD_COMMAND_PLAY_SAVEDEMO
Definition field_map.h:65
#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 FIELD_COMMAND_ICON1
the player icon's substate 1, with ITEM_GET
Definition field_map.h:42
#define FIELD_COMMAND_ICON2
its substate 2
Definition field_map.h:43
#define SCRIPT_WAIT_BOX
until box 0 closes
Definition field_map.h:167
#define SLOT_LAUNCH_OUT
the same, then leaves for mode arg
Definition field_map.h:268
#define SLOT_EXIT
The kinds of StageSlot (type).
Definition field_map.h:255
#define SCRIPT_POSE(id, set, dir)
Actor.setPose: its animation set, facing dir.
Definition field_map.h:158
#define FIELD_MAP_TRIGGERS
a cell's value: a direction (3 bits) and a StageSlot (5)
Definition field_map.h:88
#define SCRIPT_WAIT(frames)
Definition field_map.h:166
#define SCRIPT_WAIT_ANIM(id)
until its animation ends
Definition field_map.h:169
#define FIELD_TASK_COMMANDS
script command 813 (FIELDSTG_startCommandTask): the field commands
Definition field_map.h:33
#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
#define START_EVENT(index)
action: FIELDSTG_startListedEvent
Definition game_state.h:81
#define CODES_END
Definition game_state.h:83
#define ITEM(kind, id)
an item, in the bag or equipped; kind (bits 9-11) isn't read, and the scripts set it after the item's...
Definition game_state.h:80
#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
void resetTileEffect(StageTileEffect *task)
Restarts the three animations of a StageTileEffect, from the stage's updateTileEffectFrames.
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_CHAMBER_ROOM
ENV_0024: the Chamber Rooms.
Definition sound.h:140
#define MUSIC_BANK(music)
The sound bank of a music, which a stage loads for it (FieldState.soundBank)
Definition sound.h:148
FIELDSTG's start of the stage (StageEntry.init in FIELDSTG_stages): the stage's task,...
s32 stepAnimationOnce(StageTileAnim *obj, AnimFrame *frames, s32 depth)
Steps OBJ's animation through FRAMES by the frame time (at most 4) and returns its frame,...
#define FLAG_FORCED_DIGITIZATION_SEEN
wstag750 event 860: the realize transfer limit is reached and the player is forced back to digital; s...
Definition story.h:1445
@ STORY_BLACK_ID_PASS
WSTAG756 (Battle Gate), event 911: the Black ID Pass.
Definition story.h:131
@ STORY_WHITE_ID_PASS
WSTAG676 (Bai Hu Dome), event 901: the General says the A.o.A came on Bulbmon (the White ID Pass)
Definition story.h:129
@ STORY_PRESIDENT_ARRESTED
WSTAG226 (Login Room, Amaterasu City), event 935, after the President of MAGAMI gives himself up (WST...
Definition story.h:136
@ STORY_AMATERASU_BRIDGE
WSTAG206 (Amaterasu Bridge), event 922: an Attacker holds the bridge.
Definition story.h:133
@ STORY_WAY_TO_AMATERASU
WSTAG305, events 893 and 895: the way into Amaterasu City, the A.o.A's headquarters,...
Definition story.h:126
@ STORY_DE_KNOWLEDGE
WSTAG526 (Zhu Que UG Lake), event 760: the fight with Zanbamon (the DE Knowledge)
Definition story.h:115
@ STORY_MOVIE_BATTLES
WSTAG820, event 1080, with Snatchmon: each encounter plays MODE_BATTLE_MOVIE first.
Definition story.h:146
@ STORY_GENBU_BADGE
WSTAG755 (Battle Gate), event 781: the Xuen Wu Chief, who holds the Black ID Pass,...
Definition story.h:118
@ STORY_REAL_WORLD
WSTAG750 (the emergency Matrix Chamber), event 820: back in the real world, for 180 seconds.
Definition story.h:121
@ STORY_NETWORK_OFFLINE
WSTAG750, event 886: the news say the Optical Network is offline.
Definition story.h:123
#define SPECIAL_STORY_ASUKA_HEADQUARTERS_TO_OPERATION_SIGMA
GAME.progress is from STORY_ASUKA_HEADQUARTERS to STORY_OPERATION_SIGMA (PROGRESS_RANGES[0x13])
Definition story.h:1920
#define FLAG_JUGGERNAUT_LAUNCH_SEEN
wstag805 event 880: the player wins but the field is gone and the Juggernaut launches; set at its end...
Definition story.h:1439
#define FLAG_MATRIX_CHAMBER_USED
wstag750 Chamber Room: Chamber Clark checks the 4 Leader Badges and the player goes to the Real World...
Definition story.h:1146
#define FLAG_JUGGERNAUT_TAKEN_SEEN
wstag750 event 883: "...they took the Juggernaut...", in the Chamber Room; set at its end,...
Definition story.h:1442
#define SPECIAL_STORY_GENJI_BEATEN_TO_MOVIE_BATTLES
GAME.progress is from STORY_GENJI_BEATEN to 0x2C (PROGRESS_RANGES[2]); nothing sets 0x2C,...
Definition story.h:1869
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
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
StageSlot * slots
up to the first type 0
Definition field_map.h:447
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(* applyAction)(s32 code, s32 value)
Definition game_state.h:52
s32(* checkCondition)(u16 code, u16 value)
Definition game_state.h:53
short(* playSound)(s32 id)
returns the voice of a key-on
Definition sound.h:187
A sprite effect a stage creates at (x, y) with the given frame, by kind.
Definition stage.h:290
What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState....
Definition field_map.h:276
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
StageTile * tile
Definition stage.h:109
Three map objects (animations 1 to 3) moved to (x, y) and animated once when the substate is set to 1...
Definition stage.h:117
StageTileAnim anims[3]
Definition stage.h:121
void(* setSubstate)(struct StageTileEffect *task, s32 substate)
Definition stage.h:118
void(* nextState)(struct StageTileEffect *task)
Definition stage.h:118
void(* nextStep)(struct StageTileEffect *task)
Definition stage.h:118
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
s16 sortY
drawn sorted at this y, or 0
Definition field_map.h:224
Definition gfx.h:352
void * createTileEffect(void)
Creates the arrival effect (updateTileEffect) without an id; nothing in the game calls it.
Definition wstag225.c:124
u16 actor0Talk0Actions[]
Definition wstag750.c:514
FieldActorEntry actor0
Definition wstag750.c:606
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag750.c:658
FieldActorEntry actor6
Definition wstag750.c:612
u16 actor11Conditions[]
Definition wstag750.c:603
void endEvent884(void)
After event 884, with the player: keeps it from playing again.
Definition wstag750.c:171
u16 actor0Talk0Conditions[]
Definition wstag750.c:513
FieldTalk actor2Talks[]
Definition wstag750.c:542
u16 actor0Talk1Conditions[]
Definition wstag750.c:515
u16 actor10Conditions[]
Definition wstag750.c:602
AnimFrame effectClutFrames[]
Definition wstag750.c:488
void updateTileEffect(StageTileEffect *task)
Moves its map objects to (x, y) and animates them when the substate is set to 1.
Definition wstag750.c:21
void endEvent860(void)
After event 860, with Chamber Office: keeps it from playing again.
Definition wstag750.c:161
AnimFrame * updateTileEffectFrames[]
Defined below, after the code that uses them.
Definition wstag750.c:473
FieldTalk actor5Talks[]
Definition wstag750.c:554
void endEvent886(void)
After event 886, with the player: moves the story on to STORY_NETWORK_OFFLINE.
Definition wstag750.c:176
s16 script860[]
Definition wstag750.c:300
FieldActorEntry actor5
Definition wstag750.c:611
s8 tileEffectSortY[]
Definition wstag750.c:476
FieldActorEntry actor2
Definition wstag750.c:608
void endEvent820(void)
After event 820, with Chamber Officer: moves the story on to STORY_REAL_WORLD.
Definition wstag750.c:156
u16 actor0Talk3Conditions[]
Definition wstag750.c:523
u16 actor9Conditions[]
Definition wstag750.c:601
FieldActorEntry * stageActors[]
Definition wstag750.c:620
s8 tileEffectY[]
Definition wstag750.c:479
FieldTalk actor1Talks[]
Definition wstag750.c:538
u16 actor13Conditions[]
Definition wstag750.c:605
FieldTalk actor0Talks[]
Definition wstag750.c:531
FieldActorEntry actor10
Definition wstag750.c:616
u16 actor2Talk0Actions[]
Definition wstag750.c:530
AnimFrame updateTileEffectFrames_0[]
Definition wstag750.c:456
FieldTalk actor4Talks[]
Definition wstag750.c:550
u16 actor4Conditions[]
Definition wstag750.c:596
FieldActorEntry actor4
Definition wstag750.c:610
u16 actor3Conditions[]
Definition wstag750.c:595
s16 tileEffectPlaces[][2]
Definition wstag750.c:482
FieldTalk actor11Talks[]
Definition wstag750.c:578
FieldActorEntry actor8
Definition wstag750.c:614
ActorImage stageImages[]
Definition wstag750.c:500
FieldTalk actor6Talks[]
Definition wstag750.c:558
void setupStage(void)
Sets the stage up: its map, actors and events, playing the ambience ENV_0024.
Definition wstag750.c:198
AnimFrame effectFrames[]
Definition wstag750.c:492
StageEffectSpot updateStageSpots[]
Definition wstag750.c:485
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag750.c:637
void handleCommand846(StageTileEffect *task, s32 id)
Starts the effect at the place of map 0x335.
Definition wstag750.c:100
FieldActorEntry actor9
Definition wstag750.c:615
u16 actor8Conditions[]
Definition wstag750.c:600
u16 actor5Conditions[]
Definition wstag750.c:597
FieldTalk actor10Talks[]
Definition wstag750.c:574
FieldTalk actor3Talks[]
Definition wstag750.c:546
s16 script884[]
Definition wstag750.c:399
FieldTalk actor9Talks[]
Definition wstag750.c:570
u16 actor0Talk2Actions[]
Definition wstag750.c:522
FieldActorEntry actor12
Definition wstag750.c:618
u16 actor6Conditions[]
Definition wstag750.c:598
void endEvent1245(void)
After event 1245, with Guardromon: applies 0x7C0A, an action that does nothing (applyAction's mode ch...
Definition wstag750.c:184
u16 actor0Talk2Conditions[]
Definition wstag750.c:516
AnimFrame updateTileEffectFrames_2[]
Definition wstag750.c:460
FieldActorEntry actor7
Definition wstag750.c:613
StageSlot stageSlots[]
Definition wstag750.c:653
u16 actor1Talk0Actions[]
Definition wstag750.c:529
FieldActorEntry actor13
Definition wstag750.c:619
AnimFrame updateTileEffectFrames_1[]
Definition wstag750.c:467
FieldActorEntry actor11
Definition wstag750.c:617
FieldActorEntry actor1
Definition wstag750.c:607
FieldTalk actor13Talks[]
Definition wstag750.c:586
#define STAGE_FILE
Definition wstag750.c:195
u16 actor7Conditions[]
Definition wstag750.c:599
s16 script886[]
Definition wstag750.c:418
FieldTalk actor7Talks[]
Definition wstag750.c:562
#define STAGE_TEXT
Definition wstag750.c:193
s16 script1245[]
Definition wstag750.c:436
FieldTalk actor8Talks[]
Definition wstag750.c:566
void endEvent883(void)
After event 883, with Chamber Officer: keeps it from playing again.
Definition wstag750.c:166
s16 script820[]
Definition wstag750.c:217
FieldTalk actor12Talks[]
Definition wstag750.c:582
s16 script883[]
Definition wstag750.c:350
FieldActorEntry actor3
Definition wstag750.c:609
FieldEvent stageEvents[]
Definition wstag750.c:661
u16 actor12Conditions[]
Definition wstag750.c:604
u16 actor0Conditions[]
Definition wstag750.c:590