Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag580.c
Go to the documentation of this file.
1/*
2 * WSTAG580: Dum Dum Factory, West Sector.
3 */
4
5#include "common.h"
6#include "field/stage.h"
7
8/* Creates the event object of story progress 0x11 or 0x12, the first that applies */
9void updateStage(StageTask *task, void **children) {
10 switch (task->state) {
11 case TASK_INIT:
12 default:
13 do {
15 children[0] = FIELDSTG_startEvent(0x1B8);
16 break;
17 }
19 children[0] = FIELDSTG_startEvent(0x208);
20 break;
21 }
22 } while (0);
23 task->nextState(task);
24 break;
25 case TASK_RUN:
26 case TASK_DONE:
27 case TASK_KILL:
28 break;
29 }
30}
31
32#define STAGE_CHILDREN_SIZE 4
34
35/* After event 440, with Numemon: sets flag 0x1C1F and keeps it from playing again */
40
41/*
42 * After event 450, with the player: lets event 460 of WSTAG585 start and
43 * keeps it from playing again
44 */
49
50/*
51 * After event 470, with Numemon: sets flag 0x1C22 (which decides whether
52 * actor 0 in WSTAG600 appears) and keeps it from playing again
53 */
54void endEvent470(void) {
55 FLAGS_00.applyAction(FLAG(0x40, 0x34), 1);
56 FLAGS_00.applyAction(FLAG(0x1C, 0x22), 1);
57}
58
59/*
60 * After event 480, with the player: sets flag 0x1C23 (which decides whether
61 * actor 0 in WSTAG590 appears) and keeps it from playing again
62 */
63void endEvent480(void) {
64 FLAGS_00.applyAction(FLAG(0x40, 0x35), 1);
65 FLAGS_00.applyAction(FLAG(0x1C, 0x23), 1);
66}
67
68/*
69 * After event 490, with the player: sets flag 0x1C24 (which decides whether
70 * actor 0 in WSTAG595 appears) and keeps it from playing again
71 */
72void endEvent490(void) {
73 FLAGS_00.applyAction(FLAG(0x40, 0x36), 1);
74 FLAGS_00.applyAction(FLAG(0x1C, 0x24), 1);
75}
76
77/*
78 * After event 500, with the player: sets flag 0x1C25 (which decides what
79 * actor 8 in WSTAG605 says) and keeps it from playing again
80 */
81void endEvent500(void) {
82 FLAGS_00.applyAction(FLAG(0x40, 0x37), 1);
83 FLAGS_00.applyAction(FLAG(0x1C, 0x25), 1);
84}
85
86/* After event 520, with the player: keeps it from playing again */
90
91#if VERSION_US || VERSION_JP
92#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_06)
93#define EVENT_TEXT_FILE (TEXT_EVENTS_500 - 1)
94#define STAGE_FILE 0x771
95#elif VERSION_EU
96#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_06)
97#define EVENT_TEXT_FILE (TEXT_EVENTS_500 - 1)
98#define STAGE_FILE 0x780
99#endif
100/* Sets the stage up: its map, actors, battles and events, playing the ambience ENV_0017 */
121
123 SCRIPT_FOLLOW(1, 2),
124 SCRIPT_PLACE(2, 0x70, 0x400),
125 SCRIPT_POSE(2, 1, 5),
126 SCRIPT_PLACE(0x11D, 0x1C7, 0x3BB),
127 SCRIPT_POSE(0x11D, 1, 3),
128 SCRIPT_WAIT(0x1E),
129 SCRIPT_WALK(2, 0xD5, 0x3CE, 5),
131 SCRIPT_POSE(2, 1, 5),
132 SCRIPT_COMMAND(0x323, 0x325, 2),
133 SCRIPT_WAIT(0x3C),
134 SCRIPT_COMMAND(0x323, 0x326, 2),
135 SCRIPT_WAIT(0x1E),
136 SCRIPT_LOOK_AT(0, 0x101, 0x3B8),
137 SCRIPT_WALK(0x11D, 0x160, 0x387, 3),
138 SCRIPT_WAIT_WALK(0x11D),
139 SCRIPT_TALK(0, 1, 2, 0),
140 SCRIPT_POSE(2, 7, 5),
141 SCRIPT_POSE(0x11D, 1, 3),
143 SCRIPT_POSE(2, 1, 5),
144 SCRIPT_COMMAND(0x323, 0x325, 0x11D),
145 SCRIPT_WAIT(0x3C),
146 SCRIPT_POSE(0x11D, 1, 1),
147 SCRIPT_COMMAND(0x323, 0x326, 0x69),
148 SCRIPT_WAIT(0x1E),
149 SCRIPT_TALK(0, 2, 0x11D, 1),
151 SCRIPT_WAIT(0x1E),
152 SCRIPT_TALK(0, 3, 2, 0),
153 SCRIPT_POSE(2, 7, 5),
155 SCRIPT_POSE(2, 1, 5),
156 SCRIPT_WAIT(0x1E),
157 SCRIPT_TALK(0, 4, 0x11D, 1),
159 SCRIPT_POSE(0x11D, 1, 5),
160 SCRIPT_WAIT(0x1E),
161 SCRIPT_WALK(0x11D, 0x1A7, 0x363, 5),
162 SCRIPT_WAIT_WALK(0x11D),
163 SCRIPT_TALK(0, 5, 2, 0),
164 SCRIPT_POSE(2, 7, 5),
165 SCRIPT_PLACE(0x11D, 0, 0),
166 SCRIPT_POSE(0x11D, 1, 0),
168 SCRIPT_POSE(2, 1, 5),
169 SCRIPT_WAIT(0x1E),
170 SCRIPT_FOLLOW(0, 2),
171 SCRIPT_WAIT(0x3C),
173};
175 SCRIPT_WALK(2, 0x1F0, 0x2B0, 7),
176 SCRIPT_PLACE(0x69, 0x339, 0x36C),
177 SCRIPT_POSE(0x69, 1, 7),
179 SCRIPT_WAIT(0x3C),
180 SCRIPT_COMMAND(0x323, 0x325, 2),
181 SCRIPT_WAIT(0x3C),
182 SCRIPT_COMMAND(0x323, 0x326, 2),
183 SCRIPT_WAIT(0x1E),
184 SCRIPT_WALK(2, 0x281, 0x2FA, 7),
186 SCRIPT_POSE(2, 1, 7),
187 SCRIPT_WAIT(0x1E),
188 SCRIPT_LOOK_AT(0, 0x2E0, 0x328),
189 SCRIPT_WALK(0x69, 0x357, 0x37C, 7),
190 SCRIPT_WAIT_WALK(0x69),
191 SCRIPT_WALK(0x69, 0x364, 0x376, 5),
192 SCRIPT_WAIT_WALK(0x69),
193 SCRIPT_POSE(0x69, 1, 5),
194 SCRIPT_WAIT(0x1E),
196 SCRIPT_WAIT(0x1E),
197 SCRIPT_WALK(0x69, 0x394, 0x35E, 5),
198 SCRIPT_WAIT_WALK(0x69),
199 SCRIPT_PLACE(0x69, 0, 0),
200 SCRIPT_POSE(0x69, 1, 0),
202 SCRIPT_WAIT(0x1E),
203 SCRIPT_TALK(0, 1, 2, 3),
205 SCRIPT_WAIT(0x1E),
206 SCRIPT_FOLLOW(0, 2),
207 SCRIPT_WAIT(0x3C),
209};
211 SCRIPT_WALK(2, 0x280, 0x148, 5),
214 SCRIPT_POSE(2, 1, 5),
215 SCRIPT_WAIT(0x1E),
216 SCRIPT_COMMAND(0x323, 0x325, 2),
217 SCRIPT_WAIT(0x3C),
218 SCRIPT_COMMAND(0x323, 0x326, 2),
219 SCRIPT_WAIT(0x1E),
220 SCRIPT_LOOK_AT(0, 0x2D0, 0x120),
221 SCRIPT_WAIT(0x3C),
222 SCRIPT_PLACE(0x69, 0x33E, 0xD8),
223 SCRIPT_POSE(0x69, 1, 1),
225 SCRIPT_WAIT(0x3C),
226 SCRIPT_WALK(0x69, 0x301, 0xF7, 1),
227 SCRIPT_WAIT_WALK(0x69),
228 SCRIPT_WALK(0x69, 0x312, 0xFF, 7),
229 SCRIPT_WAIT_WALK(0x69),
230 SCRIPT_WALK(0x69, 0x2F0, 0x110, 1),
231 SCRIPT_WAIT_WALK(0x69),
232 SCRIPT_TALK(0, 1, 2, 2),
233 SCRIPT_POSE(2, 7, 5),
234 SCRIPT_POSE(0x69, 1, 1),
236 SCRIPT_POSE(2, 1, 5),
237 SCRIPT_COMMAND(0x323, 0x325, 0x69),
238 SCRIPT_WAIT(0x3C),
239 SCRIPT_COMMAND(0x323, 0x326, 0x69),
240 SCRIPT_WAIT(0x1E),
241 SCRIPT_TALK(0, 2, 0x69, 1),
243 SCRIPT_POSE(0x69, 1, 5),
244 SCRIPT_WAIT(0x1E),
245 SCRIPT_WALK(0x69, 0x312, 0xFF, 5),
246 SCRIPT_WAIT_WALK(0x69),
247 SCRIPT_WALK(0x69, 0x301, 0xF7, 3),
248 SCRIPT_WAIT_WALK(0x69),
249 SCRIPT_WALK(0x69, 0x310, 0xF0, 5),
250 SCRIPT_WAIT_WALK(0x69),
251 SCRIPT_WALK(0x69, 0x338, 0xDC, 5),
252 SCRIPT_WAIT_WALK(0x69),
253 SCRIPT_PLACE(0x69, 0, 0),
254 SCRIPT_POSE(0x69, 1, 0),
256 SCRIPT_WAIT(0x3C),
257 SCRIPT_FOLLOW(0, 2),
258 SCRIPT_WAIT(0x3C),
260};
262 SCRIPT_WALK(2, 0x42F, 0x2B4, 6),
263 SCRIPT_PLACE(0x69, 0x4D9, 0x2C4),
264 SCRIPT_POSE(0x69, 1, 7),
267 SCRIPT_POSE(2, 1, 6),
268 SCRIPT_COMMAND(0x323, 0x325, 2),
269 SCRIPT_WAIT(0x3C),
270 SCRIPT_COMMAND(0x323, 0x326, 2),
271 SCRIPT_WAIT(0x1E),
272 SCRIPT_LOOK_AT(0, 0x47E, 0x2B4),
273 SCRIPT_WAIT(0x78),
274 SCRIPT_WALK(0x69, 0x4F1, 0x2D0, 7),
275 SCRIPT_WAIT_WALK(0x69),
276 SCRIPT_WALK(0x69, 0x4F7, 0x2CC, 5),
277 SCRIPT_WAIT_WALK(0x69),
278 SCRIPT_POSE(0x69, 1, 5),
279 SCRIPT_WAIT(0x1E),
281 SCRIPT_WAIT(0x1E),
282 SCRIPT_WALK(0x69, 0x51F, 0x2B8, 5),
283 SCRIPT_WAIT_WALK(0x69),
284 SCRIPT_PLACE(0x69, 0, 0),
285 SCRIPT_POSE(0x69, 1, 0),
287 SCRIPT_WAIT(0x3C),
288 SCRIPT_TALK(0, 1, 2, 1),
290 SCRIPT_WAIT(0x1E),
291 SCRIPT_FOLLOW(0, 2),
292 SCRIPT_WAIT(0x5A),
294};
296 SCRIPT_FOLLOW(0, 2),
297 SCRIPT_WALK(2, 0x4BA, 0x1DB, 5),
298 SCRIPT_PLACE(0x69, 0x3CC, 0x1C1),
299 SCRIPT_POSE(0x69, 1, 5),
302 SCRIPT_POSE(2, 1, 5),
303 SCRIPT_COMMAND(0x323, 0x325, 2),
304 SCRIPT_WAIT(0x3C),
305 SCRIPT_POSE(2, 1, 2),
306 SCRIPT_COMMAND(0x323, 0x326, 2),
307 SCRIPT_WAIT(0x1E),
308 SCRIPT_LOOK_AT(0, 0x460, 0x1C7),
309 SCRIPT_WALK(0x69, 0x40F, 0x19F, 5),
310 SCRIPT_WAIT_WALK(0x69),
311 SCRIPT_POSE(0x69, 1, 5),
312 SCRIPT_WAIT(0x1E),
314 SCRIPT_WAIT(0x1E),
315 SCRIPT_POSE(2, 1, 3),
316 SCRIPT_WALK(0x69, 0x440, 0x187, 5),
317 SCRIPT_WAIT_WALK(0x69),
318 SCRIPT_PLACE(0x69, 0, 0),
319 SCRIPT_POSE(0x69, 1, 0),
321 SCRIPT_WAIT(0x3C),
322 SCRIPT_TALK(0, 1, 2, 1),
324 SCRIPT_WAIT(0x1E),
325 SCRIPT_FOLLOW(0, 2),
326 SCRIPT_WAIT(0x5A),
328};
330 SCRIPT_WALK(2, 0x27F, 0x1D9, 7),
333 SCRIPT_COMMAND(0x323, 0x325, 2),
334 SCRIPT_WAIT(0x5A),
335 SCRIPT_WALK(2, 0x311, 0x221, 7),
336 SCRIPT_COMMAND(0x323, 0x326, 2),
338 SCRIPT_POSE(2, 1, 5),
339 SCRIPT_WAIT(0x18),
340 SCRIPT_WALK(2, 0x39C, 0x1DB, 5),
341 SCRIPT_PLACE(0x69, 0x47E, 0x149),
342 SCRIPT_POSE(0x69, 1, 3),
344 SCRIPT_POSE(2, 1, 5),
345 SCRIPT_WAIT(0x1E),
346 SCRIPT_LOOK_AT(0, 0x3FF, 0x108),
347 SCRIPT_WALK(0x69, 0x450, 0x10F, 3),
348 SCRIPT_WAIT_WALK(0x69),
349 SCRIPT_WALK(0x69, 0x440, 0x108, 5),
350 SCRIPT_WAIT_WALK(0x69),
351 SCRIPT_WALK(0x69, 0x460, 0xF7, 5),
352 SCRIPT_WAIT_WALK(0x69),
353 SCRIPT_POSE(0x69, 1, 3),
354 SCRIPT_WAIT(6),
355 SCRIPT_FOLLOW(0, 2),
356 SCRIPT_PLACE(0x69, 0, 0),
357 SCRIPT_POSE(0x69, 1, 0),
358 SCRIPT_WAIT(0x3C),
359 SCRIPT_WAIT(0x3C),
360 SCRIPT_TALK(0, 1, 2, 0),
362 SCRIPT_WAIT(0x1E),
364};
366 SCRIPT_LOOK_AT(1, 0x118, 0xA4),
367 SCRIPT_PLACE(2, 0xCF, 0x6D),
368 SCRIPT_POSE(2, 1, 7),
369 SCRIPT_PLACE(0x69, 0xA9, 0x21B),
370 SCRIPT_POSE(0x69, 1, 1),
372 SCRIPT_WAIT(0x1E),
373 SCRIPT_WALK(2, 0x105, 0x88, 7),
375 SCRIPT_WAIT(0x1E),
377 SCRIPT_WAIT(0x1E),
378 SCRIPT_WALK(2, 0x129, 0x9A, 1),
380 SCRIPT_POSE(2, 1, 1),
381 SCRIPT_COMMAND(0x323, 0x325, 2),
382 SCRIPT_WAIT(0x3C),
383 SCRIPT_COMMAND(0x323, 0x326, 2),
384 SCRIPT_WAIT(0x1E),
385 SCRIPT_POSE(2, 1, 1),
386 SCRIPT_WAIT(0x3C),
387 SCRIPT_LOOK_AT(0, 0xCF, 0x1E0),
388 SCRIPT_WALK(0x69, 0x89, 0x22B, 1),
389 SCRIPT_WAIT_WALK(0x69),
390 SCRIPT_WALK(0x69, 0x81, 0x227, 3),
391 SCRIPT_WAIT_WALK(0x69),
392 SCRIPT_POSE(0x69, 1, 3),
393 SCRIPT_WAIT(0x1E),
395 SCRIPT_WAIT(0x1E),
396 SCRIPT_WALK(0x69, 0x56, 0x213, 3),
397 SCRIPT_WAIT_WALK(0x69),
398 SCRIPT_PLACE(0x69, 0, 0),
399 SCRIPT_POSE(0x69, 1, 0),
401 SCRIPT_WAIT(0x3C),
402 SCRIPT_FOLLOW(0, 2),
403 SCRIPT_WAIT(0x3C),
404 SCRIPT_TALK(0, 1, 2, 2),
406 SCRIPT_POSE(2, 1, 7),
407 SCRIPT_WAIT(0x1E),
409};
423AreaBattle area1Battle0 = { 0, 0, MUSIC(1, 0) };
424AreaBattle area1Battle1 = { 0, 0, MUSIC(1, 0) };
425AreaBattle area1Battle2 = { 0, 0, MUSIC(1, 0) };
426AreaBattle area1Battle3 = { 0, 0, MUSIC(1, 0) };
427AreaBattle area1Battle4 = { 0, 0, MUSIC(1, 0) };
428AreaBattle area1Battle5 = { 0, 0, MUSIC(1, 0) };
429AreaBattle area1Battle6 = { 0, 0, MUSIC(1, 0) };
430AreaBattle area1Battle7 = { 0, 0, MUSIC(1, 0) };
436AreaBattle area2Battle0 = { 0, 0, MUSIC(1, 0) };
437AreaBattle area2Battle1 = { 0, 0, MUSIC(1, 0) };
438AreaBattle area2Battle2 = { 0, 0, MUSIC(1, 0) };
439AreaBattle area2Battle3 = { 0, 0, MUSIC(1, 0) };
440AreaBattle area2Battle4 = { 0, 0, MUSIC(1, 0) };
441AreaBattle area2Battle5 = { 0, 0, MUSIC(1, 0) };
442AreaBattle area2Battle6 = { 0, 0, MUSIC(1, 0) };
443AreaBattle area2Battle7 = { 0, 0, MUSIC(1, 0) };
449AreaBattle area3Battle0 = { 0, 0, MUSIC(1, 0) };
450AreaBattle area3Battle1 = { 0, 0, MUSIC(1, 0) };
451AreaBattle area3Battle2 = { 0, 0, MUSIC(1, 0) };
452AreaBattle area3Battle3 = { 0, 0, MUSIC(1, 0) };
453AreaBattle area3Battle4 = { 0, 0, MUSIC(1, 0) };
454AreaBattle area3Battle5 = { 0, 0, MUSIC(1, 0) };
455AreaBattle area3Battle6 = { 0, 0, MUSIC(1, 0) };
456AreaBattle area3Battle7 = { 0, 0, MUSIC(1, 0) };
466 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
467 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
468 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
469 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
470 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
471 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
472 { 0x140, 0x100, 0x150, 0x1DB, 0x40, 0xDB, 0x160, 0x1FF },
473 { 0x140, 0x100, 0x158, 0x1DB, 0x60, 0xDB, 0x170, 0x1FF },
474};
483 FLAG(0x40, 0x34), 0,
484 CODES_END,
485};
489 FLAG(0x40, 0x35), 0,
490 CODES_END,
491};
495 FLAG(0x40, 0x36), 0,
496 CODES_END,
497};
501 FLAG(0x40, 0x37), 0,
502 CODES_END,
503};
515FieldActorEntry actor0 = { actor0Conditions, NULL, 0x69, 4, 825, 876, 7 };
516FieldActorEntry actor1 = { actor1Conditions, NULL, 0x69, 4, 830, 216, 1 };
517FieldActorEntry actor2 = { actor2Conditions, NULL, 0x69, 4, 1241, 708, 7 };
518FieldActorEntry actor3 = { actor3Conditions, NULL, 0x69, 4, 972, 449, 5 };
519FieldActorEntry actor4 = { actor4Conditions, NULL, 0x69, 4, 1150, 329, 3 };
520FieldActorEntry actor5 = { actor5Conditions, NULL, 0x69, 4, 169, 539, 1 };
522FieldActorEntry actor7 = { actor7Conditions, NULL, 0x11D, 5, 455, 955, 7 };
524 &actor0,
525 &actor1,
526 &actor2,
527 &actor3,
528 &actor4,
529 &actor5,
530 &actor6,
531 &actor7,
532 NULL,
533};
535 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 249, 482, 0, 0 },
536 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 273, 494, 0, 0 },
537 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 720, 847, 0, 0 },
538 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 745, 378, 0, 0 },
539 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 769, 390, 0, 0 },
540 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 891, 346, 0, 0 },
541 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 913, 750, 0, 0 },
542 { 1, 0, 0x40, 2, 0x33, 2, 0, 9, 4, 0, 984, 754, 0, 0 },
543 { 1, 0, 0x40, 2, 0x33, 2, 0, 9, 4, 0, 1269, 276, 0, 0 },
544 { 1, 0, 0x40, 2, 0x34, 2, 0, 9, 4, 0, 889, 739, 0, 0 },
545 { 1, 0, 0x40, 2, 0x34, 2, 0, 9, 4, 0, 960, 766, 0, 0 },
546 { 1, 0, 0x40, 2, 0x34, 2, 0, 9, 4, 0, 1234, 293, 0, 0 },
547 { 1, 0, 0x40, 2, 0x35, 2, 0, 1, 6, 0, 946, 161, 0, 0 },
548 { 1, 0, 0x40, 2, 0x36, 2, 0, 1, 6, 0, 787, 181, 0, 0 },
549 { 1, 0, 0x40, 2, 0x36, 2, 0, 1, 6, 0, 867, 829, 0, 0 },
550 { 1, 0, 0x40, 2, 0x36, 2, 0, 1, 6, 0, 1043, 353, 0, 0 },
551 { 1, 0, 0x40, 2, 0x36, 2, 0, 1, 6, 0, 1268, 657, 0, 0 },
552 { 1, 0, 0x40, 2, 0x37, 2, 0, 1, 6, 0, 236, 78, 0, 0 },
553 { 1, 0, 0x40, 2, 0x37, 2, 0, 1, 6, 0, 1092, 186, 0, 0 },
554 { 1, 0, 0x47, 2, 0xE, 0, 0, 0, 0, 0, 799, 790, 0, 0 },
555 { 1, 0, 0x41, 2, 0xF, 0, 0, 0, 0, 0, 727, 809, 0, 0 },
556 { 1, 0, 0x40, 6, 0x32, 2, 0, 9, 4, 0, 696, 835, 0, 0 },
557 { 1, 0, 0x40, 6, 0x33, 2, 0, 9, 4, 0, 241, 879, 0, 0 },
558 { 1, 0, 0x40, 6, 0x33, 2, 0, 9, 4, 0, 305, 559, 0, 0 },
559 { 1, 0, 0x40, 6, 0x33, 2, 0, 9, 4, 0, 1025, 775, 0, 0 },
560 { 1, 0, 0x40, 6, 0x34, 2, 0, 9, 4, 0, 217, 891, 0, 0 },
561 { 1, 0, 0x40, 6, 0x34, 2, 0, 9, 4, 0, 281, 571, 0, 0 },
562 { 1, 0, 0x40, 6, 0x34, 2, 0, 9, 4, 0, 1001, 787, 0, 0 },
563 { 1, 0x68, 0x40, 6, 7, 0, 0, 0, 0, 0, 93, 496, 0, 0 },
564 { 1, 0x69, 0x40, 6, 8, 0, 0, 0, 0, 0, 1260, 665, 0, 0 },
565 { 1, 0x67, 0x40, 6, 9, 0, 0, 0, 0, 0, 1036, 355, 0, 0 },
566 { 1, 0x6B, 0x40, 6, 0xA, 0, 0, 0, 0, 0, 1086, 196, 0, 0 },
567 { 1, 0x6A, 0x40, 6, 0xB, 0, 0, 0, 0, 0, 943, 171, 0, 0 },
568 { 1, 0x66, 0x40, 6, 0xC, 0, 0, 0, 0, 0, 783, 191, 0, 0 },
569 { 1, 0x65, 0x40, 6, 0x11, 0, 0, 0, 0, 0, 859, 837, 0, 0 },
570 { 1, 0x64, 0x40, 6, 0xD, 0, 0, 0, 0, 0, 230, 86, 0, 0 },
571 { 1, 0, 0x80, 6, 0x19, 0, 0, 0, 0, 0, 876, 192, 0, 0 },
572 { 1, 0, 0x40, 4, 0x33, 2, 0, 9, 4, 0, 401, 463, 491, 0 },
573 { 1, 0, 0x40, 4, 0x34, 2, 0, 9, 4, 0, 377, 475, 497, 0 },
574 { 1, 0, 0x40, 4, 0, 0, 0, 0, 0, 0, 64, 512, 552, 0 },
575 { 1, 0, 0x40, 4, 1, 0, 0, 0, 0, 0, 1071, 379, 415, 0 },
576 { 1, 0, 0x40, 4, 2, 0, 0, 0, 0, 0, 1049, 211, 247, 0 },
577 { 1, 0, 0x40, 4, 3, 0, 0, 0, 0, 0, 975, 187, 224, 0 },
578 { 1, 0, 0x40, 4, 4, 0, 0, 0, 0, 0, 815, 207, 239, 0 },
579 { 1, 0, 0x40, 4, 6, 0, 0, 0, 0, 0, 894, 347, 370, 0 },
580 { 1, 0, 0x40, 4, 0x10, 0, 0, 0, 0, 0, 896, 855, 888, 0 },
581 { 1, 0, 0x40, 4, 5, 0, 0, 0, 0, 0, 208, 103, 138, 0 },
582 { 1, 0, 0x40, 4, 0x14, 0, 0, 0, 0, 0, 397, 464, 491, 0 },
583 { 1, 0, 0x40, 4, 0x15, 0, 0, 0, 0, 0, 381, 476, 497, 0 },
584 { 1, 0, 0x80, 4, 0x16, 0, 0, 0, 0, 0, 891, 116, 221, 0 },
585 { 1, 0, 0x80, 4, 0x17, 0, 0, 0, 0, 0, 899, 112, 207, 0 },
586 { 1, 0, 0x80, 4, 0x18, 0, 0, 0, 0, 0, 907, 108, 203, 0 },
587 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
588};
590 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x24C, 0x228, 0x94, 1, 0, 0, 0 },
591 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x24E, 0x108, 0x174, 5, 0x65, 0, 0 },
592 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x24F, 0x108, 0x174, 5, 0x69, 0, 0 },
593 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x252, 0x2F8, 0x264, 3, 0x6B, 0, 0 },
594 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x250, 0x108, 0x174, 5, 0x67, 0, 0 },
595 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x252, 0x258, 0x24C, 5, 0x6A, 0, 0 },
596 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x251, 0x108, 0x174, 5, 0x66, 0, 0 },
597 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x252, 0x68, 0x20C, 3, 0x64, 0, 0 },
598 { { { SPECIAL_STORY_SINCE_LISA_SAVED, 1 }, { CODES_END, 0 } }, SLOT_EXIT, 0x253, 0x278, 0xD4, 3, 0x68, 0, 0 },
599 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_DOWN, 6, 0x160, 0x80, 0, 0, 0, 0 },
600 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_UP, 6, 0x170, 0xE8, 0, 0, 0, 0 },
601 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_DOWN, 0xC, 0xDF, 0x142, 0, 0, 0, 0 },
602 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_UP, 0xC, 0xD2, 0x208, 0, 0, 0, 0 },
603 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_DOWN, 8, 0x2D0, 0x29A, 0, 0, 0, 0 },
604 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_UP, 8, 0x2C1, 0x322, 0, 0, 0, 0 },
605 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_DOWN, 8, 0x33E, 0x2D2, 0, 0, 0, 0 },
606 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_UP, 8, 0x330, 0x35A, 0, 0, 0, 0 },
607 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_DOWN, 8, 0x42E, 0x34A, 0, 0, 0, 0 },
608 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_UP, 8, 0x420, 0x3D2, 0, 0, 0, 0 },
609 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_DOWN, 5, 0x4B0, 0x25A, 0, 0, 0, 0 },
610 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_UP, 5, 0x4BE, 0x2AE, 0, 0, 0, 0 },
611 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_DROP, 5, 0, 0, 0, 0, 0, 0 },
612 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_DROP, 8, 0, 0, 0, 0, 0, 0 },
613 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_DROP, 7, 0, 0, 0, 0, 0, 0 },
614 { { { PROGRESS(STORY_BYAKKO_BADGE), 1 }, { FLAG_NUMEMON_FACTORY_FOUND_SEEN, 0 } }, SLOT_EVENT, 0x1C2, 0, 0, 0, 0, 0, 0 },
615 { { { FLAG_DUCT_ROOM_01_HP_CHIP_FOUND, 1 }, { FLAG(0x40, 0x34), 0 } }, SLOT_EVENT, 0x1D6, 0, 0, 0, 0, 0, 0 },
616 { { { FLAG_DUCT_ROOM_04_MIND_CHIP_FOUND, 1 }, { FLAG(0x40, 0x35), 0 } }, SLOT_EVENT, 0x1E0, 0, 0, 0, 0, 0, 0 },
617 { { { FLAG_DUCT_ROOM_02_MP_CHIP_FOUND, 1 }, { FLAG(0x40, 0x36), 0 } }, SLOT_EVENT, 0x1EA, 0, 0, 0, 0, 0, 0 },
618 { { { FLAG_DUCT_ROOM_03_POWER_CHIP_FOUND, 1 }, { FLAG(0x40, 0x37), 0 } }, SLOT_EVENT, 0x1F4, 0, 0, 0, 0, 0, 0 },
619 { { { CODES_END, 0 }, { CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
620};
621void (*stageFuncs[])(void) = {
623};
625 { 440, script440, EVENT_TEXT(6), NULL, endEvent440 },
626 { 450, script450, EVENT_TEXT(0x16), NULL, endEvent450 },
627 { 470, script470, EVENT_TEXT(0x17), NULL, endEvent470 },
628 { 480, script480, EVENT_TEXT(0x18), NULL, endEvent480 },
629 { 490, script490, EVENT_TEXT(0x19), NULL, endEvent490 },
630 { 500, script500, EVENT_TEXT(0x1A), NULL, endEvent500 },
631 { 520, script520, EVENT_TEXT(0x1B), NULL, endEvent520 },
632 { -1, NULL, 0, NULL, NULL },
633};
#define NULL
Definition common.h:17
signed short s16
Definition common.h:9
unsigned short u16
Definition common.h:10
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
void updateStage()
The names every stage defines, each its own (config/<version>/stages/<stage>.txt).
#define SLOT_CLIMB_UP
Definition field_map.h:256
#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_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 SLOT_CLIMB_DOWN
Definition field_map.h:257
#define SLOT_EVENT
starts the event arg
Definition field_map.h:262
#define FIELD_COMMAND_SHOW_OBJECTS(n)
shows them
Definition field_map.h:46
#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 SLOT_EXIT
The kinds of StageSlot (type).
Definition field_map.h:255
#define FIELD_MAP_AREAS
a cell's value: its battle area (FieldBattles), or 0
Definition field_map.h:87
#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 FIELD_TASK_COMMANDS
script command 813 (FIELDSTG_startCommandTask): the field commands
Definition field_map.h:33
#define FIELD_COMMAND_HIDE_OBJECTS(n)
hides the map objects of group n
Definition field_map.h:45
#define SCRIPT_PLACE(id, x, y)
puts a character at (x, y)
Definition field_map.h:157
#define SLOT_DROP
Definition field_map.h:258
#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 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
#define MUSIC_BATTLE
BATL0000: the maps' random battles (AreaBattle, nearly all of them)
Definition sound.h:76
#define MUSIC_DUM_DUM_FACTORY
ENV_0017: Bullet Valley, the Dum Dum Factory, its Duct Rooms and Operation Room.
Definition sound.h:133
#define MUSIC(bank, n)
A field's or a battle's music (FieldState.music, Battle.music): track (SEP) n of the first sequence o...
Definition sound.h:70
#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,...
#define FLAG_NICK_KEITH_FACTORY_SEEN
wstag580 event 520: the player finds Nick and Keith arguing in the Dum Dum Factory; set at its end,...
Definition story.h:1405
#define FLAG_DUCT_ROOM_03_POWER_CHIP_FOUND
wstag595: chest that gives the Power Chip, "I got" text; its conditions test it 0; Dum Dum Factory (w...
Definition story.h:224
@ STORY_BYAKKO_BADGE
WSTAG655 (Mirage Room), event 431: HiAndromon guards the way to Numemon (the Byakko Badge)
Definition story.h:76
@ 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_LISA_SAVED
WSTAG605 (Operation Room), event 511: the player saves Lisa from WaruMonzaemon (the Rusty Rifle)
Definition story.h:79
#define FLAG_DUCT_ROOM_02_MP_CHIP_FOUND
wstag590: chest that gives the MP Chip, "I got" text; its conditions test it 0; Dum Dum Factory (wsta...
Definition story.h:221
#define FLAG_NUMEMON_FACTORY_FOUND_SEEN
wstag580 event 450: "OK, I found you!", the player corners Numemon in the Dum Dum Factory; set at its...
Definition story.h:1354
#define FLAG_DUCT_ROOM_01_HP_CHIP_FOUND
wstag585: chest that gives the HP Chip, "I got" text; its conditions test it 0; Dum Dum Factory (wsta...
Definition story.h:215
#define SPECIAL_STORY_SINCE_LISA_SAVED
GAME.progress is STORY_LISA_SAVED or later (PROGRESS_RANGES[0xA], to 0x63)
Definition story.h:1893
#define FLAG_DUCT_ROOM_04_MIND_CHIP_FOUND
wstag600: chest that gives the Mind Chip, "I got" text; its conditions test it 0; Dum Dum Factory (ws...
Definition story.h:218
#define FLAG_NUMEMON_MISSING_SEEN
wstag580 event 440: "Numemon isn't here.", in the Dum Dum Factory; set at its end,...
Definition story.h:1411
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
Definition field_map.h:114
A battle of an area's BattleList, which can start on the field (see FIELDSTG_startEncounter); FIGHTST...
Definition field_map.h:402
The battles of an area of the map (its cells' value at FieldMap.files[4]), one picked at random.
Definition field_map.h:411
A character of the field (FieldState.actors, a list of pointers up to NULL), which FIELDSTG_updateFie...
Definition field_map.h:194
The battles of a place (FieldState.battles), by area of the map: the fourth area's are also the ones ...
Definition field_map.h:422
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
FieldBattles * battles
Definition field_map.h:450
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
void(* applyAction)(s32 code, s32 value)
Definition game_state.h:52
s32(* checkCondition)(u16 code, u16 value)
Definition game_state.h:53
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
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
Definition field_map.h:208
Definition gfx.h:352
u16 actor1Conditions[]
Definition wstag580.c:480
AreaBattle area2Battle7
Definition wstag580.c:443
FieldActorEntry actor0
Definition wstag580.c:515
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag580.c:621
FieldActorEntry actor6
Definition wstag580.c:521
AreaBattle area2Battle6
Definition wstag580.c:442
void endEvent470(void)
After event 470, with Numemon: sets flag 0x1C22 (which decides whether actor 0 in WSTAG600 appears) a...
Definition wstag580.c:54
void endEvent450(void)
After event 450, with the player: lets event 460 of WSTAG585 start and keeps it from playing again.
Definition wstag580.c:45
AreaBattle area1Battle6
Definition wstag580.c:429
FieldActorEntry actor5
Definition wstag580.c:520
AreaBattle area0Battle7
Definition wstag580.c:417
FieldActorEntry actor2
Definition wstag580.c:517
AreaBattle area3Battle4
Definition wstag580.c:453
AreaBattle area3Battle3
Definition wstag580.c:452
AreaBattle area0Battle1
Definition wstag580.c:411
AreaBattle area2Battle0
Definition wstag580.c:436
FieldActorEntry * stageActors[]
Definition wstag580.c:523
AreaBattle area1Battle2
Definition wstag580.c:425
AreaBattle area3Battle0
Definition wstag580.c:449
AreaBattle area0Battle6
Definition wstag580.c:416
s16 script500[]
Definition wstag580.c:329
AreaBattle area3Battle2
Definition wstag580.c:451
AreaBattle area3Battle1
Definition wstag580.c:450
void endEvent520(void)
After event 520, with the player: keeps it from playing again.
Definition wstag580.c:87
AreaBattle area0Battle3
Definition wstag580.c:413
u16 actor4Conditions[]
Definition wstag580.c:498
FieldActorEntry actor4
Definition wstag580.c:519
u16 actor3Conditions[]
Definition wstag580.c:492
AreaBattle area3Battle6
Definition wstag580.c:455
ActorImage stageImages[]
Definition wstag580.c:465
void setupStage(void)
Sets the stage up: its map, actors, battles and events, playing the ambience ENV_0017.
Definition wstag580.c:101
AreaBattle area2Battle4
Definition wstag580.c:440
void endEvent490(void)
After event 490, with the player: sets flag 0x1C24 (which decides whether actor 0 in WSTAG595 appears...
Definition wstag580.c:72
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag580.c:534
s16 script490[]
Definition wstag580.c:295
s16 script440[]
Definition wstag580.c:122
u16 actor5Conditions[]
Definition wstag580.c:504
s16 script520[]
Definition wstag580.c:365
BattleList area3Battles
Definition wstag580.c:457
AreaBattle area3Battle5
Definition wstag580.c:454
AreaBattle area0Battle5
Definition wstag580.c:415
BattleList area1Battles
Definition wstag580.c:431
void endEvent500(void)
After event 500, with the player: sets flag 0x1C25 (which decides what actor 8 in WSTAG605 says) and ...
Definition wstag580.c:81
BattleList area2Battles
Definition wstag580.c:444
AreaBattle area1Battle4
Definition wstag580.c:427
s16 script450[]
Definition wstag580.c:174
void endEvent440(void)
After event 440, with Numemon: sets flag 0x1C1F and keeps it from playing again.
Definition wstag580.c:36
u16 actor6Conditions[]
Definition wstag580.c:509
AreaBattle area2Battle2
Definition wstag580.c:438
AreaBattle area1Battle5
Definition wstag580.c:428
FieldActorEntry actor7
Definition wstag580.c:522
StageSlot stageSlots[]
Definition wstag580.c:589
AreaBattle area2Battle1
Definition wstag580.c:437
AreaBattle area1Battle3
Definition wstag580.c:426
AreaBattle area1Battle0
Definition wstag580.c:423
void endEvent480(void)
After event 480, with the player: sets flag 0x1C23 (which decides whether actor 0 in WSTAG590 appears...
Definition wstag580.c:63
FieldActorEntry actor1
Definition wstag580.c:516
AreaBattle area0Battle0
Definition wstag580.c:410
AreaBattle area0Battle2
Definition wstag580.c:412
#define STAGE_FILE
Definition wstag580.c:98
AreaBattle area2Battle5
Definition wstag580.c:441
AreaBattle area1Battle1
Definition wstag580.c:424
u16 actor7Conditions[]
Definition wstag580.c:510
AreaBattle area2Battle3
Definition wstag580.c:439
u16 actor2Conditions[]
Definition wstag580.c:486
AreaBattle area0Battle4
Definition wstag580.c:414
#define STAGE_TEXT
Definition wstag580.c:96
AreaBattle area3Battle7
Definition wstag580.c:456
BattleList area0Battles
Definition wstag580.c:418
AreaBattle area1Battle7
Definition wstag580.c:430
s16 script470[]
Definition wstag580.c:210
FieldActorEntry actor3
Definition wstag580.c:518
FieldBattles stageBattles[]
Definition wstag580.c:462
s16 script480[]
Definition wstag580.c:261
FieldEvent stageEvents[]
Definition wstag580.c:624
u16 actor0Conditions[]
Definition wstag580.c:475