Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag280.c
Go to the documentation of this file.
1/*
2 * WSTAG280: El Dorado, Asuka City.
3 */
4
5#include "common.h"
6#define STAGE_TWEEN /* stageFuncs is a StageFuncs (stage.h) */
7#include "field/stage.h"
8
9/* The text file of the menus, which the versions number differently */
10#if VERSION_US || VERSION_JP
11#define MENU_TEXT TEXT_FILE(TEXT_EVENTS_200)
12#elif VERSION_EU
13#define MENU_TEXT (TEXT_EVENTS_200 - 1)
14#endif
15
16/* A two-option menu: creates the event object of the chosen option */
17void updateMenu(StageMenu *task, ChoiceChildren *children) {
18 SpriteDrawer drawer;
19 s32 prev;
20 s32 i;
21 s32 j;
22 s32 k;
23
24 switch (task->state) {
25 case TASK_INIT:
26 default:
27 task->nextState(task);
28 task->tween.duration = 10;
29 for (i = 0; i < 2; i++) {
30 children->options[i] = createTextWindow(FIELD_LAYER_MAP, 1, 0x1C, 0xBE + i * 14);
31 children->options[i]->setDepth(children->options[i], 1);
32 }
33 children->cursor = createCursor(FIELD_LAYER_MAP, 1, 0x12, 0xBE);
34 children->cursor->setVisible(children->cursor, 0);
35 children->title = createTextWindow(FIELD_LAYER_MAP, 1, 0x12, 0xB0);
36 break;
37 case TASK_RUN:
38 switch (task->substate) {
39 case 0:
40 default:
41 stageFuncs.start(&task->tween, 1);
42 task->substate++;
43 break;
44 case 1:
45 if (stageFuncs.update(&task->tween)) {
46 for (j = 0; j < 2; j++) {
47 children->options[j]->setString(children->options[j], FILE_CACHE.getEntry(TEXT_ENTRY(MENU_TEXT, 0x39)), j + 2);
48 }
49 children->cursor->setVisible(children->cursor, 1);
50 children->title->setString(children->title, FILE_CACHE.getEntry(TEXT_ENTRY(MENU_TEXT, 0x39)), 1);
51 task->substate++;
52 }
53 break;
54 case 2:
55 prev = task->cursor;
57 if (--task->cursor < 0) {
58 task->cursor = 0;
59 }
60 } else if (PAD_PRESSED(PAD_DOWN) || PAD_REPEATED(PAD_DOWN)) {
61 task->cursor++;
62 if (task->cursor > 1) {
63 task->cursor = 1;
64 }
65 }
66 if (prev != task->cursor) {
68 children->cursor->setPos(children->cursor, 0x12, task->cursor * 14 + 0xBE);
69 break;
70 }
73 task->substate = 10;
74 task->step = 1;
75 }
76 break;
77 case 3:
78 children->event = FIELDSTG_startEvent(task->cursor == 0 ? 0x39 : 0x5F3);
79 task->substate++;
80 break;
81 case 4:
82 if (children->event == NULL) {
83 task->state = TASK_KILL;
84 }
85 break;
86 case 10:
87 for (k = 0; k < 2; k++) {
88 children->options[k]->setVisible(children->options[k], 0);
89 }
90 children->cursor->setVisible(children->cursor, 0);
91 children->title->setVisible(children->title, 0);
92 stageFuncs.start(&task->tween, 0);
93 task->substate++;
94 break;
95 case 11:
96 if (stageFuncs.update(&task->tween)) {
97 if (task->step == 1) {
98 task->substate = 3;
99 } else {
100 task->state = TASK_KILL;
101 }
102 }
103 break;
104 }
105 initSpriteDrawer(&drawer);
106 drawer.setLayerId(FIELD_LAYER_MAP, 2);
107 drawer.setTexture(0x140, 0);
108 drawer.setFollowScroll(0);
109 if (task->tween.level != 0) {
110 if (task->tween.level != 0x1000) {
111 drawer.setScale(task->tween.level, 0x1000, 0x1000);
112 drawer.setPivot(0, 0xC3);
113 }
114 drawer.draw(FILE_CACHE.getEntry(MENU_SPRITES), 0x45, 0, 0xAC);
115 }
116 break;
117 case TASK_DONE:
118 case TASK_KILL:
119 break;
120 }
121}
122
123/*
124 * Starts event 1522, which asks whether to listen to basic item information:
125 * yes starts event 57, no event 1523
126 */
127void *startEvent1522(void) {
128 return createTask(updateMenu, sizeof(StageMenu), sizeof(ChoiceChildren));
129}
130
131/* Creates the event object while PARTY_STAT(1), ITEM(0, 8) and
132 SPECIAL_STORY_ASUKA_HEADQUARTERS_TO_OPERATION_SIGMA are false */
133void updateStage(StageTask *task, void **children) {
134 switch (task->state) {
135 case TASK_INIT:
136 default:
138 children[0] = FIELDSTG_startEvent(0x42);
139 }
140 task->nextState(task);
141 break;
142 case TASK_RUN:
143 case TASK_DONE:
144 case TASK_KILL:
145 break;
146 }
147}
148
149#define STAGE_CHILDREN_SIZE 4
151
152#if VERSION_US || VERSION_JP
153#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_00)
154#define EVENT_TEXT_FILE (TEXT_EVENTS_200 - 1)
155#define STAGE_FILE 0x1A5
156#define STAGE_ARCHIVE 0x3C3
157#elif VERSION_EU
158#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_00)
159#define EVENT_TEXT_FILE (TEXT_EVENTS_200 - 1)
160#define STAGE_FILE 0x1B3
161#define STAGE_ARCHIVE 0x3D3
162#endif
163/* Sets the stage up: its map, actors and events, playing SHOP2BGM */
182
185
187 SCRIPT_WALK(2, 0x180, 0xB0, 3),
188 SCRIPT_POSE(0x10B, 1, 7),
191 SCRIPT_WAIT(0x1E),
192 SCRIPT_TALK(0, 1, 0x10B, 2),
194 SCRIPT_WAIT(0x1E),
196 SCRIPT_WAIT(0x1E),
197 SCRIPT_TALK(0, 2, 2, 4),
199 SCRIPT_WAIT(0x1E),
200 SCRIPT_TALK(0, 3, 0x10B, 4),
202 SCRIPT_WAIT(0x1E),
203 SCRIPT_TALK(0, 4, 2, 4),
205 SCRIPT_WAIT(0x1E),
207 SCRIPT_WAIT(0x1E),
208 SCRIPT_WAIT(0x1E),
209 SCRIPT_TALK(0, 5, 0x10B, 2),
211 SCRIPT_WAIT(0x1E),
213};
215 SCRIPT_PLACE(2, 0x218, 0xF4),
216 SCRIPT_POSE(2, 1, 3),
217 SCRIPT_PLACE(0x2D, 0x1F6, 0xE4),
218 SCRIPT_POSE(0x2D, 1, 7),
219 SCRIPT_WAIT(0x1E),
220 SCRIPT_WALK(2, 0x210, 0xF1, 3),
222 SCRIPT_POSE(2, 1, 3),
223 SCRIPT_WAIT(0x1E),
224 SCRIPT_WAIT(0x1E),
225 SCRIPT_TALK(0, 1, 0x2D, 0),
227 SCRIPT_WAIT(0x1E),
228 SCRIPT_POSE(2, 1, 7),
229 SCRIPT_WAIT(0x1E),
230 SCRIPT_WALK(2, 0x22B, 0xFC, 7),
231 SCRIPT_WAIT(0x1E),
232 SCRIPT_LEAVE(0x201, 0x180, 0xD8, 7),
234};
236 SCRIPT_WALK(2, 0x14F, 0xD0, 3),
237 SCRIPT_PLACE(0x118, 0x131, 0xC1),
238 SCRIPT_POSE(0x118, 1, 7),
241 SCRIPT_POSE(2, 1, 3),
242 SCRIPT_WAIT(0x1E),
243 SCRIPT_TALK(0, 1, 0x118, 2),
245 SCRIPT_POSE(0x118, 1, 7),
246 SCRIPT_WAIT(0x1E),
247 SCRIPT_POSE(2, 1, 5),
248 SCRIPT_WAIT(0x1E),
249 SCRIPT_WALK(2, 0x168, 0xC4, 5),
251 SCRIPT_POSE(2, 1, 1),
252 SCRIPT_WALK(0x118, 0x170, 0xE0, 7),
253 SCRIPT_WAIT_WALK(0x118),
254 SCRIPT_WALK(2, 0x14F, 0xD0, 3),
255 SCRIPT_POSE(0x118, 1, 3),
257 SCRIPT_POSE(2, 1, 3),
258 SCRIPT_WAIT(0x1E),
260};
262 SCRIPT_WALK(2, 0x180, 0xB0, 3),
263 SCRIPT_POSE(0x10B, 1, 7),
266 SCRIPT_WAIT(0x1E),
267 SCRIPT_TALK(0, 1, 0x10B, 2),
269 SCRIPT_WAIT(0x1E),
271};
273 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
274 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
275 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
276 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
277 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
278 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
279 { 0x140, 0x100, 0x178, 0x17A, 0xE0, 0x7A, 0x160, 0x1FF },
280 { 0x140, 0x100, 0x158, 0x182, 0x60, 0x82, 0x170, 0x1FF },
281 { 0x140, 0x100, 0x170, 0x17A, 0xC0, 0x7A, 0x160, 0x1FE },
282 { 0x140, 0x100, 0x140, 0x182, 0, 0x82, 0x170, 0x1FE },
283 { 0x140, 0x100, 0x160, 0x189, 0x80, 0x89, 0x140, 0x1FD },
284 { 0x140, 0x100, 0x168, 0x189, 0xA0, 0x89, 0x150, 0x1FD },
285 { 0x140, 0x100, 0x158, 0x1A2, 0x60, 0xA2, 0x160, 0x1FD },
286 { 0x140, 0x100, 0x170, 0x1A2, 0xC0, 0xA2, 0x170, 0x1FD },
287 { 0x140, 0x100, 0x148, 0x182, 0x20, 0x82, 0x140, 0x1FC },
288 { 0, 0, 0, 0, 0, 0, 0, 0 },
289 { 0x140, 0x100, 0x150, 0x182, 0x40, 0x82, 0x150, 0x1FC },
290 { 0x140, 0x100, 0x160, 0x1A9, 0x80, 0xA9, 0x160, 0x1FC },
291};
299 PARTY_STAT(2), 1,
300 ITEM(0, 8), 0,
301 CODES_END,
302};
306 PARTY_STAT(2), 1,
307 ITEM(0, 8), 1,
308 CODES_END,
309};
312u16 actor45Talk1Conditions[] = { ITEM(0, 8), 1, FLAG(0, 0), 0, CODES_END };
314u16 actor45Talk2Conditions[] = { ITEM(0, 8), 1, FLAG(0, 0), 1, CODES_END };
316u16 actor46Talk1Conditions[] = { FLAG(0, 0), 0, ITEM(0, 8), 1, CODES_END };
318u16 actor46Talk2Conditions[] = { ITEM(0, 8), 1, FLAG(0, 0), 1, CODES_END };
320 { NULL, NULL, 0x8A },
321 { NULL, NULL, 0 },
322};
324 { NULL, NULL, 0x8A },
325 { NULL, NULL, 0 },
326};
328 { NULL, NULL, 0x8A },
329 { NULL, NULL, 0 },
330};
332 { NULL, NULL, 0x8A },
333 { NULL, NULL, 0 },
334};
336 { NULL, NULL, 0x8A },
337 { NULL, NULL, 0 },
338};
340 { NULL, NULL, 0x8A },
341 { NULL, NULL, 0 },
342};
344 { NULL, NULL, 0x8A },
345 { NULL, NULL, 0 },
346};
348 { NULL, NULL, 0x8A },
349 { NULL, NULL, 0 },
350};
352 { NULL, NULL, 0x469 },
353 { NULL, NULL, 0 },
354};
356 { NULL, NULL, 0x471 },
357 { NULL, NULL, 0 },
358};
360 { NULL, NULL, 0x46A },
361 { NULL, NULL, 0 },
362};
364 { NULL, NULL, 0x46B },
365 { NULL, NULL, 0 },
366};
368 { NULL, NULL, 0x46C },
369 { NULL, NULL, 0 },
370};
372 { NULL, NULL, 0x46D },
373 { NULL, NULL, 0 },
374};
376 { NULL, NULL, 0x473 },
377 { NULL, NULL, 0 },
378};
380 { NULL, NULL, 0x46E },
381 { NULL, NULL, 0 },
382};
384 { NULL, NULL, 0x46F },
385 { NULL, NULL, 0 },
386};
388 { NULL, NULL, 0x470 },
389 { NULL, NULL, 0 },
390};
392 { NULL, NULL, 0x474 },
393 { NULL, NULL, 0 },
394};
396 { NULL, NULL, 0x47C },
397 { NULL, NULL, 0 },
398};
400 { NULL, NULL, 0x475 },
401 { NULL, NULL, 0 },
402};
404 { NULL, NULL, 0x476 },
405 { NULL, NULL, 0 },
406};
408 { NULL, NULL, 0x477 },
409 { NULL, NULL, 0 },
410};
412 { NULL, NULL, 0x478 },
413 { NULL, NULL, 0 },
414};
416 { NULL, NULL, 0x47E },
417 { NULL, NULL, 0 },
418};
420 { NULL, NULL, 0x47B },
421 { NULL, NULL, 0 },
422};
424 { NULL, NULL, 0x479 },
425 { NULL, NULL, 0 },
426};
428 { NULL, NULL, 0x47A },
429 { NULL, NULL, 0 },
430};
432 { NULL, NULL, 0x45E },
433 { NULL, NULL, 0 },
434};
436 { NULL, NULL, 0x467 },
437 { NULL, NULL, 0 },
438};
440 { NULL, NULL, 0x45F },
441 { NULL, NULL, 0 },
442};
444 { NULL, NULL, 0x460 },
445 { NULL, NULL, 0 },
446};
448 { NULL, NULL, 0x461 },
449 { NULL, NULL, 0 },
450};
452 { NULL, NULL, 0x462 },
453 { NULL, NULL, 0 },
454};
456 { NULL, NULL, 0x468 },
457 { NULL, NULL, 0 },
458};
460 { NULL, NULL, 0x463 },
461 { NULL, NULL, 0 },
462};
464 { NULL, NULL, 0x465 },
465 { NULL, NULL, 0 },
466};
468 { NULL, NULL, 0x464 },
469 { NULL, NULL, 0 },
470};
472 { NULL, NULL, 0x8B },
473 { NULL, NULL, 0 },
474};
476 { NULL, NULL, 0x466 },
477 { NULL, NULL, 0 },
478};
480 { NULL, NULL, 0x472 },
481 { NULL, NULL, 0 },
482};
484 { NULL, NULL, 0x47D },
485 { NULL, NULL, 0 },
486};
488 { NULL, actor42Talk0Actions, 0x138 },
489 { NULL, NULL, 0 },
490};
511 { NULL, NULL, 0xA4 },
512 { NULL, NULL, 0 },
513};
515 { NULL, NULL, 0xA4 },
516 { NULL, NULL, 0 },
517};
519 { NULL, NULL, 0xA5 },
520 { NULL, NULL, 0 },
521};
535 ITEM(0, 8), 0,
537 PARTY_STAT(1), 0,
538 CODES_END,
539};
541 ITEM(0, 8), 1,
543 PARTY_STAT(1), 0,
544 CODES_END,
545};
560 ITEM(0, 8), 0,
561 PARTY_STAT(1), 1,
562 CODES_END,
563};
566 ITEM(0, 8), 1,
567 PARTY_STAT(1), 1,
568 CODES_END,
569};
663FieldActorEntry actor44 = { NULL, NULL, 0x10C, 0xD, 360, 172, 7 };
670 &actor0,
671 &actor1,
672 &actor2,
673 &actor3,
674 &actor4,
675 &actor5,
676 &actor6,
677 &actor7,
678 &actor8,
679 &actor9,
680 &actor10,
681 &actor11,
682 &actor12,
683 &actor13,
684 &actor14,
685 &actor15,
686 &actor16,
687 &actor17,
688 &actor18,
689 &actor19,
690 &actor20,
691 &actor21,
692 &actor22,
693 &actor23,
694 &actor24,
695 &actor25,
696 &actor26,
697 &actor27,
698 &actor28,
699 &actor29,
700 &actor30,
701 &actor31,
702 &actor32,
703 &actor33,
704 &actor34,
705 &actor35,
706 &actor36,
707 &actor37,
708 &actor38,
709 &actor39,
710 &actor40,
711 &actor41,
712 &actor42,
713 &actor43,
714 &actor44,
715 &actor45,
716 &actor46,
717 &actor47,
718 &actor48,
719 &actor49,
720 NULL,
721};
723 { 1, 0, 0x40, 2, 0xA, 0, 0, 0, 0, 0, 93, 125, 0, 0 },
724 { 1, 0, 0x40, 2, 0xB, 0, 0, 0, 0, 0, 126, 109, 0, 0 },
725 { 1, 0, 0x40, 2, 0xC, 0, 0, 0, 0, 0, 158, 93, 0, 0 },
726 { 1, 0, 0x40, 2, 0xD, 0, 0, 0, 0, 0, 235, 67, 0, 0 },
727 { 1, 0, 0x40, 2, 0xE, 0, 0, 0, 0, 0, 282, 43, 0, 0 },
728 { 1, 0, 0x40, 2, 0xF, 0, 0, 0, 0, 0, 379, 34, 0, 0 },
729 { 1, 0, 0x40, 2, 0x10, 0, 0, 0, 0, 0, 403, 46, 0, 0 },
730 { 1, 0, 0x40, 2, 0x11, 0, 0, 0, 0, 0, 427, 90, 0, 0 },
731 { 1, 0, 0x40, 2, 0x12, 0, 0, 0, 0, 0, 463, 113, 0, 0 },
732 { 1, 0, 0x40, 2, 0x13, 0, 0, 0, 0, 0, 482, 109, 0, 0 },
733 { 1, 0, 0x40, 2, 0x14, 0, 0, 0, 0, 0, 503, 123, 0, 0 },
734 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 4, 0, 84, 130, 0, 0 },
735 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 4, 0, 116, 114, 0, 0 },
736 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 4, 0, 148, 98, 0, 0 },
737 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 4, 0, 272, 44, 0, 0 },
738 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 4, 0, 368, 36, 0, 0 },
739 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 4, 0, 417, 91, 0, 0 },
740 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 4, 0, 453, 113, 0, 0 },
741 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 4, 0, 473, 112, 0, 0 },
742 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 4, 0, 493, 134, 0, 0 },
743 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 4, 0, 497, 124, 0, 0 },
744 { 1, 0, 0x40, 6, 0x33, 2, 0, 1, 4, 0, 292, 104, 0, 0 },
745 { 1, 0, 0x40, 6, 0x15, 0, 0, 0, 0, 0, 416, 59, 0, 0 },
746 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 4, 0, 224, 68, 0, 0 },
747 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 4, 0, 392, 48, 0, 0 },
748 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 4, 0, 416, 60, 0, 0 },
749 { 1, 0, 0x40, 4, 0, 0, 0, 0, 0, 0, 208, 263, 288, 0 },
750 { 1, 0, 0x40, 4, 1, 0, 0, 0, 0, 0, 384, 191, 217, 0 },
751 { 1, 0, 0x40, 4, 2, 0, 0, 0, 0, 0, 320, 169, 184, 0 },
752 { 1, 0, 0x40, 4, 3, 0, 0, 0, 0, 0, 304, 161, 174, 0 },
753 { 1, 0, 0x40, 4, 4, 0, 0, 0, 0, 0, 336, 161, 174, 0 },
754 { 1, 0, 0x40, 4, 5, 0, 0, 0, 0, 0, 288, 153, 166, 0 },
755 { 1, 0, 0x40, 4, 6, 0, 0, 0, 0, 0, 352, 153, 166, 0 },
756 { 1, 0, 0x40, 4, 7, 0, 0, 0, 0, 0, 272, 144, 158, 0 },
757 { 1, 0, 0x40, 4, 8, 0, 0, 0, 0, 0, 368, 145, 158, 0 },
758 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
759};
761 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x201, 0x180, 0xD8, 7, 0, 0, 0 },
762 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x212, 0x92, 0x1A2, 7, 0, 0, 0 },
763 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_DOWN, 3, 0x110, 0xB8, 0, 0, 0, 0 },
764 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_UP, 3, 0x100, 0xF0, 0, 0, 0, 0 },
765 { { { CODES_END, 0 }, { CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
766};
769 { 57, script57, EVENT_TEXT(0x11), NULL, NULL },
770 { 66, script66, EVENT_TEXT(0x13), NULL, NULL },
771 { 67, script67, EVENT_TEXT(0x14), NULL, NULL },
772 { 1522, NULL, EVENT_TEXT(0x39), startEvent1522, NULL },
773 { 1523, script1523, EVENT_TEXT(0x34), NULL, NULL },
774 { -1, NULL, 0, NULL, NULL },
775};
#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
GameFlags FLAGS_00
The flag bitset FLAGS_00 and the event functions.
Definition events.c:701
#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
Cursor * createCursor(s16 layerId, s32 depth, s16 x, s16 y)
A menu cursor on a layer at (x, y)
Definition cursor.c:92
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 TEXT_ENTRY(file, n)
Definition stage.h:707
#define MENU_SPRITES
The menu sprite sheet, and an entry of a text file: the European version numbers the disc's files dif...
Definition stage.h:702
#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_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 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 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_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 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
FileCache FILE_CACHE
The file cache.
Definition file_cache.c:7
#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
#define PARTY_STAT(id)
checkPartyStat
Definition game_state.h:71
#define PAD_CROSS
Definition pad.h:31
#define PAD_DOWN
Definition pad.h:24
#define PAD_PRESSED(button)
One button of pad 1: newly pressed, auto-repeated while held, or held.
Definition pad.h:140
#define PAD_UP
Definition pad.h:22
#define PAD_REPEATED(button)
Definition pad.h:141
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 SOUND_SELECT
Sounds the overlays share, with SOUNDTST's names.
Definition sound.h:38
#define MUSIC_SHOP_2
SHOP2BGM: Lamb Chop, the Yellow Cruiser and El Dorado.
Definition sound.h:82
#define SOUND_CURSOR
SYSTEM02: a cursor moves.
Definition sound.h:40
#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,...
void startTween(PanelAnim *tween, s32 up)
Starts the menu stage's tween (stageFuncs.start) with its sound: up, from 0 to ONE over its duration,...
#define SPECIAL_STORY_JUNGLE_SOUND_TO_AMATERASU_BRIDGE
GAME.progress is from STORY_JUNGLE_SOUND to STORY_AMATERASU_BRIDGE (PROGRESS_RANGES[0x12])
Definition story.h:1917
@ STORY_PRESIDENT_ARRESTED
WSTAG226 (Login Room, Amaterasu City), event 935, after the President of MAGAMI gives himself up (WST...
Definition story.h:136
@ STORY_CONTROL_ROOM
WSTAG325 (Control Room, Asuka City), event 560: a Soldier guards the way.
Definition story.h:90
@ STORY_GENJI_BEATEN
WSTAG200, event 52: after the first battle, won against Tamer Genji (event 50), the Digimon Navi give...
Definition story.h:36
@ STORY_TEDDY_FOUND
WSTAG212, event 352: Teddy is found; MAGAMI is part of the A.o.A, and the player sets off to beat the...
Definition story.h:67
@ STORY_LOOKING_FOR_TEDDY
WSTAG212, event 273: Kail and the player will put on the Agumon Suits to look for Teddy.
Definition story.h:61
@ STORY_MOVIE_BATTLES
WSTAG820, event 1080, with Snatchmon: each encounter plays MODE_BATTLE_MOVIE first.
Definition story.h:146
#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 SPECIAL_STORY_GENJI_BEATEN_TO_PRESIDENT_ARRESTED
GAME.progress is from STORY_GENJI_BEATEN to STORY_PRESIDENT_ARRESTED (PROGRESS_RANGES[0x1A])
Definition story.h:1941
#define SPECIAL_STORY_DE_SINCERITY_TO_LISA_SAVED
GAME.progress is from STORY_DE_SINCERITY to STORY_LISA_SAVED (PROGRESS_RANGES[0xF])
Definition story.h:1908
#define FLAG_PONCHOMON_TALKED
wstag280 El Dorado: Ponchomon welcomes the player to the Item Maniac's El Dorado once; set there,...
Definition story.h:1016
#define SPECIAL_STORY_SEIRYU_BADGE_TO_ZANBAMON_DRIVEN_OFF
GAME.progress is from STORY_SEIRYU_BADGE to STORY_ZANBAMON_DRIVEN_OFF (PROGRESS_RANGES[0xE])
Definition story.h:1905
#define SPECIAL_SHOW_ITEM_GET_ICON
an action: the player's icon plays its animation 3 with SOUND_ITEM_GET (FIELD_COMMAND_ICON3); the tal...
Definition story.h:1982
#define SPECIAL_STORY_KNIGHTMON_REPROGRAMMED_TO_BULBMON_FOUND
GAME.progress is from STORY_KNIGHTMON_REPROGRAMMED to STORY_BULBMON_FOUND (PROGRESS_RANGES[0x11])
Definition story.h:1914
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
Definition field_map.h:114
The children of a yes/no question at the bottom of the screen: FIELDSTG's ChoiceTask and the stages' ...
Definition field_map.h:483
TextWindow * options[2]
Definition field_map.h:485
Cursor * cursor
Definition field_map.h:486
TextWindow * title
Definition field_map.h:484
struct EventTask * event
the answer's (FIELDSTG_startEvent)
Definition field_map.h:487
void(* setPos)()
(cursor, x, y)
Definition text.h:34
void(* setVisible)()
(cursor, visible)
Definition text.h:33
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 *(* getEntry)(u32 fileAndIndex)
Definition file.h:96
s32(* checkCondition)(u16 code, u16 value)
Definition game_state.h:53
s32 level
Definition menu.h:21
s32 duration
Definition menu.h:19
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(* 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(* setFollowScroll)()
(on)
Definition gfx.h:251
void(* draw)()
(sheet, frame, x, y)
Definition gfx.h:246
void(* setTexture)()
(x, y)
Definition gfx.h:242
The table of a stage's functions: its setup, then the menu stages' tween (startTween and updateTween)...
Definition stage.h:95
void(* start)(PanelAnim *tween, s32 up)
Definition stage.h:97
s32(* update)(PanelAnim *tween)
whether it has ended
Definition stage.h:98
A yes/no menu at the bottom of the screen, a copy of FIELDSTG's ChoiceTask (FIELDSTG_runChoice) witho...
Definition stage.h:667
s32 step
Definition stage.h:668
void(* nextState)(struct StageMenu *task)
Definition stage.h:668
s32 state
Definition stage.h:668
s32 substate
Definition stage.h:668
PanelAnim tween
Definition stage.h:670
s32 cursor
Definition stage.h:669
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
void(* setDepth)()
Definition text.h:183
void(* setString)()
Definition text.h:165
void(* setVisible)(struct TextWindow *obj, u8 arg)
Definition text.h:177
Definition gfx.h:352
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105
TextWindow * createTextWindow(s16 layerId, s16 style, s16 x, s16 y)
A text window on a layer, in a font style, at (x, y)
s32 updateTween(PanelAnim *tween)
Steps the tween (stageFuncs.update): whether it has ended.
u16 actor1Conditions[]
Definition wstag280.c:528
u16 actor26Conditions[]
Definition wstag280.c:588
FieldActorEntry actor0
Definition wstag280.c:619
FieldActorEntry actor6
Definition wstag280.c:625
FieldTalk actor37Talks[]
Definition wstag280.c:467
u16 actor11Conditions[]
Definition wstag280.c:573
u16 actor45Talk1Conditions[]
Definition wstag280.c:312
FieldTalk actor31Talks[]
Definition wstag280.c:443
FieldTalk actor2Talks[]
Definition wstag280.c:327
FieldTalk actor47Talks[]
Definition wstag280.c:510
FieldTalk actor42Talks[]
Definition wstag280.c:487
u16 actor10Conditions[]
Definition wstag280.c:572
FieldActorEntry actor25
Definition wstag280.c:644
s16 script66[]
Definition wstag280.c:214
FieldActorEntry actor24
Definition wstag280.c:643
s16 script67[]
Definition wstag280.c:235
u16 actor18Conditions[]
Definition wstag280.c:580
FieldActorEntry actor17
Definition wstag280.c:636
FieldActorEntry actor39
Definition wstag280.c:658
u16 actor34Conditions[]
Definition wstag280.c:596
FieldActorEntry actor33
Definition wstag280.c:652
FieldTalk actor38Talks[]
Definition wstag280.c:471
FieldTalk actor14Talks[]
Definition wstag280.c:375
u16 actor43Talk3Actions[]
Definition wstag280.c:310
u16 actor24Conditions[]
Definition wstag280.c:586
FieldActorEntry actor18
Definition wstag280.c:637
FieldTalk actor5Talks[]
Definition wstag280.c:339
FieldActorEntry actor40
Definition wstag280.c:659
FieldTalk actor43Talks[]
Definition wstag280.c:491
u16 actor42Conditions[]
Definition wstag280.c:604
u16 actor46Conditions[]
Definition wstag280.c:611
FieldActorEntry actor5
Definition wstag280.c:624
FieldActorEntry actor37
Definition wstag280.c:656
u16 actor46Talk0Conditions[]
Definition wstag280.c:315
u16 actor45Talk2Conditions[]
Definition wstag280.c:314
FieldActorEntry actor36
Definition wstag280.c:655
u16 actor35Conditions[]
Definition wstag280.c:597
FieldTalk actor33Talks[]
Definition wstag280.c:451
FieldTalk actor41Talks[]
Definition wstag280.c:483
u16 actor22Conditions[]
Definition wstag280.c:584
FieldActorEntry actor2
Definition wstag280.c:621
FieldActorEntry actor31
Definition wstag280.c:650
u16 actor38Conditions[]
Definition wstag280.c:600
FieldActorEntry actor23
Definition wstag280.c:642
FieldActorEntry actor19
Definition wstag280.c:638
FieldTalk actor36Talks[]
Definition wstag280.c:463
u16 actor9Conditions[]
Definition wstag280.c:571
FieldActorEntry * stageActors[]
Definition wstag280.c:669
FieldActorEntry actor28
Definition wstag280.c:647
u16 actor23Conditions[]
Definition wstag280.c:585
u16 actor32Conditions[]
Definition wstag280.c:594
FieldActorEntry actor45
Definition wstag280.c:664
u16 actor29Conditions[]
Definition wstag280.c:591
#define MENU_TEXT
The text file of the menus, which the versions number differently.
Definition wstag280.c:13
u16 actor47Conditions[]
Definition wstag280.c:612
u16 actor43Talk3Conditions[]
Definition wstag280.c:304
u16 actor30Conditions[]
Definition wstag280.c:592
FieldActorEntry actor22
Definition wstag280.c:641
u16 actor37Conditions[]
Definition wstag280.c:599
FieldActorEntry actor41
Definition wstag280.c:660
FieldTalk actor1Talks[]
Definition wstag280.c:323
u16 actor13Conditions[]
Definition wstag280.c:575
FieldTalk actor35Talks[]
Definition wstag280.c:459
FieldActorEntry actor29
Definition wstag280.c:648
FieldTalk actor0Talks[]
Definition wstag280.c:319
u16 actor48Conditions[]
Definition wstag280.c:617
#define STAGE_ARCHIVE
Definition wstag280.c:161
FieldTalk actor21Talks[]
Definition wstag280.c:403
FieldActorEntry actor27
Definition wstag280.c:646
FieldTalk actor20Talks[]
Definition wstag280.c:399
FieldActorEntry actor10
Definition wstag280.c:629
u16 actor31Conditions[]
Definition wstag280.c:593
u16 actor19Conditions[]
Definition wstag280.c:581
FieldTalk actor49Talks[]
Definition wstag280.c:518
FieldTalk actor4Talks[]
Definition wstag280.c:335
u16 actor4Conditions[]
Definition wstag280.c:546
FieldTalk actor27Talks[]
Definition wstag280.c:427
FieldActorEntry actor4
Definition wstag280.c:623
u16 actor3Conditions[]
Definition wstag280.c:540
u16 actor43Talk0Actions[]
Definition wstag280.c:294
FieldTalk actor17Talks[]
Definition wstag280.c:387
FieldTalk actor39Talks[]
Definition wstag280.c:475
FieldActorEntry actor35
Definition wstag280.c:654
FieldTalk actor11Talks[]
Definition wstag280.c:363
FieldActorEntry actor32
Definition wstag280.c:651
FieldActorEntry actor8
Definition wstag280.c:627
s16 script1523[]
Definition wstag280.c:261
FieldActorEntry actor44
Definition wstag280.c:663
ActorImage stageImages[]
Definition wstag280.c:272
FieldTalk actor28Talks[]
Definition wstag280.c:431
FieldTalk actor6Talks[]
Definition wstag280.c:343
void setupStage(void)
Sets the stage up: its map, actors and events, playing SHOP2BGM.
Definition wstag280.c:164
FieldActorEntry actor43
Definition wstag280.c:662
u16 actor43Talk1Conditions[]
Definition wstag280.c:295
u16 actor43Talk1Actions[]
Definition wstag280.c:296
FieldTalk actor25Talks[]
Definition wstag280.c:419
FieldTalk actor19Talks[]
Definition wstag280.c:395
FieldActorEntry actor48
Definition wstag280.c:667
u16 actor33Conditions[]
Definition wstag280.c:595
void * startEvent1522(void)
Starts event 1522, which asks whether to listen to basic item information: yes starts event 57,...
Definition wstag280.c:127
FieldTalk actor23Talks[]
Definition wstag280.c:411
u16 actor16Conditions[]
Definition wstag280.c:578
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag280.c:722
u16 actor41Conditions[]
Definition wstag280.c:603
u16 actor43Talk0Conditions[]
Definition wstag280.c:293
void updateMenu(StageMenu *task, ChoiceChildren *children)
A two-option menu: creates the event object of the chosen option.
Definition wstag280.c:17
FieldActorEntry actor9
Definition wstag280.c:628
u16 actor8Conditions[]
Definition wstag280.c:570
FieldActorEntry actor20
Definition wstag280.c:639
FieldTalk actor26Talks[]
Definition wstag280.c:423
u16 actor43Talk2Conditions[]
Definition wstag280.c:297
u16 actor5Conditions[]
Definition wstag280.c:552
FieldTalk actor10Talks[]
Definition wstag280.c:359
FieldTalk actor3Talks[]
Definition wstag280.c:331
FieldTalk actor9Talks[]
Definition wstag280.c:355
u16 actor46Talk1Conditions[]
Definition wstag280.c:316
FieldTalk actor32Talks[]
Definition wstag280.c:447
FieldTalk actor15Talks[]
Definition wstag280.c:379
FieldTalk actor46Talks[]
Definition wstag280.c:504
FieldActorEntry actor47
Definition wstag280.c:666
u16 actor46Talk1Actions[]
Definition wstag280.c:317
FieldTalk actor40Talks[]
Definition wstag280.c:479
u16 actor43Talk2Actions[]
Definition wstag280.c:303
FieldActorEntry actor15
Definition wstag280.c:634
FieldActorEntry actor12
Definition wstag280.c:631
u16 actor27Conditions[]
Definition wstag280.c:589
FieldActorEntry actor16
Definition wstag280.c:635
u16 actor15Conditions[]
Definition wstag280.c:577
FieldActorEntry actor38
Definition wstag280.c:657
u16 actor6Conditions[]
Definition wstag280.c:558
u16 actor14Conditions[]
Definition wstag280.c:576
FieldActorEntry actor30
Definition wstag280.c:649
FieldActorEntry actor7
Definition wstag280.c:626
u16 actor43Conditions[]
Definition wstag280.c:605
u16 actor49Conditions[]
Definition wstag280.c:618
StageSlot stageSlots[]
Definition wstag280.c:760
FieldActorEntry actor13
Definition wstag280.c:632
FieldTalk actor24Talks[]
Definition wstag280.c:415
s16 script57[]
Definition wstag280.c:186
FieldActorEntry actor11
Definition wstag280.c:630
FieldActorEntry actor49
Definition wstag280.c:668
u16 actor25Conditions[]
Definition wstag280.c:587
u16 actor45Talk0Conditions[]
Definition wstag280.c:311
FieldActorEntry actor1
Definition wstag280.c:620
u16 actor40Conditions[]
Definition wstag280.c:602
FieldActorEntry actor21
Definition wstag280.c:640
FieldActorEntry actor42
Definition wstag280.c:661
FieldTalk actor13Talks[]
Definition wstag280.c:371
u16 actor46Talk2Conditions[]
Definition wstag280.c:318
#define STAGE_FILE
Definition wstag280.c:160
u16 actor45Conditions[]
Definition wstag280.c:606
u16 actor7Conditions[]
Definition wstag280.c:564
FieldTalk actor48Talks[]
Definition wstag280.c:514
u16 actor39Conditions[]
Definition wstag280.c:601
FieldTalk actor45Talks[]
Definition wstag280.c:498
u16 actor2Conditions[]
Definition wstag280.c:534
FieldTalk actor18Talks[]
Definition wstag280.c:391
FieldTalk actor7Talks[]
Definition wstag280.c:347
u16 actor20Conditions[]
Definition wstag280.c:582
FieldActorEntry actor34
Definition wstag280.c:653
#define STAGE_TEXT
Definition wstag280.c:158
u16 actor42Talk0Actions[]
Definition wstag280.c:292
FieldTalk actor8Talks[]
Definition wstag280.c:351
u16 actor45Talk1Actions[]
Definition wstag280.c:313
FieldTalk actor34Talks[]
Definition wstag280.c:455
FieldTalk actor30Talks[]
Definition wstag280.c:439
FieldActorEntry actor46
Definition wstag280.c:665
FieldTalk actor12Talks[]
Definition wstag280.c:367
u16 actor21Conditions[]
Definition wstag280.c:583
u16 actor28Conditions[]
Definition wstag280.c:590
FieldTalk actor16Talks[]
Definition wstag280.c:383
u16 actor17Conditions[]
Definition wstag280.c:579
FieldTalk actor29Talks[]
Definition wstag280.c:435
FieldActorEntry actor3
Definition wstag280.c:622
FieldActorEntry actor26
Definition wstag280.c:645
u16 actor36Conditions[]
Definition wstag280.c:598
FieldActorEntry actor14
Definition wstag280.c:633
FieldEvent stageEvents[]
Definition wstag280.c:768
u16 actor12Conditions[]
Definition wstag280.c:574
FieldTalk actor22Talks[]
Definition wstag280.c:407
StageFuncs stageFuncs
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag280.c:767
u16 actor0Conditions[]
Definition wstag280.c:522