Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag545.c
Go to the documentation of this file.
1/*
2 * WSTAG545: Bug Maze Pit, Network Break.
3 */
4
5#include "common.h"
6#include "field/stage.h"
7/* Defined below, after the code that uses them */
12
13/* Steps an animation, holding its last frame, and returns the frame */
15 AnimFrame *frame = &frames[obj->anim.index];
17
18 if (dt > 4) {
19 dt = 4;
20 }
21 if (depth == 0) {
22 obj->anim.timer -= dt;
23 }
24 if (obj->anim.timer <= 0) {
25 frame++;
26 obj->anim.index++;
27 obj->anim.timer += frame->duration;
28 if (frame->frame == 0xFF) {
29 obj->anim.index--;
30 frame = &frames[obj->anim.index];
31 obj->anim.timer += frame->duration;
32 }
33 stepHeldAnimation(obj, frames, depth + 1);
34 }
35 return frame->frame;
36}
37
38/* Moves the map object with the given animation to (x, y); hidden while running, shown and animated when done */
40 StageTile *object;
41 StageTile *tile;
42
43 switch (task->state) {
44 case TASK_INIT:
45 default:
46 task->nextState(task);
47 task->obj.anim.index = 0;
49 for (object = FIELDSTG_state.objects; object->margin != 0; object++) {
50 if (object->anim == task->anim) {
51 task->obj.tile = object;
52 object->x = task->x;
53 object->y = task->y;
54 }
55 }
56 break;
57 case TASK_RUN:
58 task->obj.tile->visible = 0;
59 break;
60 case TASK_DONE:
61 if (task->substate == 0) {
62 task->obj.anim.index = 0;
64 task->setSubstate(task, 1);
65 }
66 tile = task->obj.tile;
67 tile->visible = 1;
69 break;
70 case TASK_KILL:
71 break;
72 }
73}
74
75/* Creates a StageTileAt for the map object with the given animation */
78
79 task->anim = anim;
80 task->x = x;
81 task->y = y;
82 return task;
83}
84
86
87/* Shows the map object with animation 1 (frame 0x18); when done, animates it once with a sound and goes back to TASK_RUN */
89 StageTile *object;
90 StageTile *shown;
91 StageTile *tile;
92 s32 frame;
93
94 switch (task->state) {
95 case TASK_INIT:
96 default:
97 task->nextState(task);
98 task->obj.anim.index = 0;
100 for (object = FIELDSTG_state.objects; object->margin != 0; object++) {
101 if (object->anim == 1) {
102 task->obj.tile = object;
103 }
104 }
105 break;
106 case TASK_RUN:
107 shown = task->obj.tile;
108 shown->visible = 1;
109 shown->frame = 0x18;
110 shown->clutRow = 9;
111 break;
112 case TASK_DONE:
113 if (task->substate == 0) {
114 task->obj.anim.index = 0;
116 task->setSubstate(task, 1);
118 }
119 tile = task->obj.tile;
120 frame = stepAnimationOnce(&task->obj, updateTileTaskFrames, 0);
121 if (frame == 0xFF) {
122 task->setState(task, TASK_RUN);
123 tile->clutRow = 9;
124 } else {
125 tile->clutRow = frame;
126 }
127 tile->visible = 1;
128 tile->frame = 0x18;
129 break;
130 case TASK_KILL:
131 break;
132 }
133}
134
135/*
136 * Command 847 of the event scripts: told 0x35A in event 710 (Bulbmon's
137 * earthquake), ends its task
138 */
140 if (task != NULL && id == 0x35A) {
141 task->setState(task, TASK_DONE);
142 }
143}
144
145/*
146 * Creates the map object that event 710, Bulbmon's earthquake, sets off
147 * (updateTileTask), with an id
148 */
149void *createTileTask(s32 arg) {
150 return createTaskWithId(updateTileTask, sizeof(StageTileTask), 0, arg);
151}
152
154
155/*
156 * Plays the switch's animation N once (from its start, on step 0), then
157 * holds frame DONE and goes on to substate NEXT
158 */
159static inline void playSwitchOnce(StageTileSwitch *task, StageTile *tile, s32 n, s32 done, s32 next) {
160 s32 frame;
161
162 if (task->step == 0) {
163 task->obj.anim.index = 0;
165 task->setStep(task, 1);
166 }
167 frame = stepTileAnimation(&task->obj, updateTileSwitchFrames[n], 1, 0);
168 tile->visible = 1;
169 if (frame == 0xFF) {
170 tile->frame = done;
171 task->setSubstate(task, next);
172 } else {
173 tile->frame = frame;
174 }
175}
176
177/*
178 * The switch, the map object with animation 2, played by substate (events
179 * 0x35D to 0x35F); also sets the child that events 0x360 to 0x364 pick to
180 * TASK_DONE
181 */
183 StageTile *object;
184 StageTile *tile;
185 s32 i;
186
187 switch (task->state) {
188 case TASK_INIT:
189 default:
190 for (object = FIELDSTG_state.objects; object->margin != 0; object++) {
191 if (object->anim == 2) {
192 task->obj.anim.index = 0;
194 task->obj.tile = object;
195 }
196 }
197 for (i = 0; i < 5; i++) {
199 }
200 task->silent = 0;
201 task->spawn = 0;
202 task->nextState(task);
203 break;
204 case TASK_RUN:
205 tile = task->obj.tile;
206 switch (task->substate) {
207 case 0:
208 tile->visible = 0;
209 break;
210 case 1:
211 playSwitchOnce(task, tile, 0, 8, 2);
212 break;
213 case 3:
214 playSwitchOnce(task, tile, 1, 9, 4);
215 break;
216 case 5:
217 if (task->step == 0) {
218 task->obj.anim.index = 0;
220 task->setStep(task, 1);
222 }
223 {
224 s32 frame = stepTileAnimation(&task->obj, updateTileSwitchFrames[2], 0, 0);
225
226 tile->visible = 1;
227 tile->frame = frame;
228 }
229 break;
230 case 2:
231 case 4:
232 break;
233 }
234 if (task->spawn != 0) {
235 children->tiles[task->spawn - 1]->setState(children->tiles[task->spawn - 1], TASK_DONE);
236 task->spawn = 0;
237 }
238 break;
239 case TASK_DONE:
240 case TASK_KILL:
241 break;
242 }
243}
244
245/* Events 0x35D to 0x364: animate the map object (substates 1, 3, 5) or pick a child to set to TASK_DONE */
246void handleCommand848(void *arg, s32 id) {
247 StageTileSwitch *task = arg;
248
249 if (task != NULL) {
250 if (task->silent == 0) {
252 }
253 switch (id) {
254 case 0x35D:
255 task->setSubstate(task, 1);
256 break;
257 case 0x35E:
258 task->setSubstate(task, 3);
259 break;
260 case 0x35F:
261 task->setSubstate(task, 5);
262 break;
263 case 0x360:
264 task->spawn = 1;
265 break;
266 case 0x361:
267 task->spawn = 2;
268 break;
269 case 0x362:
270 task->spawn = 3;
271 break;
272 case 0x363:
273 task->spawn = 4;
274 break;
275 case 0x364:
276 task->spawn = 5;
277 break;
278 }
279 task->setStep(task, 0);
280 }
281}
282
283/* Creates the task of updateTileSwitch with the given id */
286}
287
288/* Creates the stage object of flag 0x4051, and the event object of story progress 0x1A */
289void updateStage(StageTask *task, void **children) {
290 switch (task->state) {
291 case TASK_INIT:
292 default:
293 task->nextState(task);
295 children[0] = createTileTask(0x34F);
296 }
298 children[2] = FIELDSTG_startEvent(0x2C7);
299 }
300 break;
301 case TASK_RUN:
302 case TASK_DONE:
303 case TASK_KILL:
304 break;
305 }
306}
307
308#define STAGE_CHILDREN_SIZE 0xC
310
311/*
312 * After event 710, with the player: starts the stage's event battle 0 and
313 * keeps it from playing again
314 */
319
320/* After event 711, with the player: moves the story on to STORY_JUNGLE_SOUND */
324
325#if VERSION_US || VERSION_JP
326#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_06)
327#define EVENT_TEXT_FILE (TEXT_EVENTS_500 - 1)
328#define STAGE_FILE 0x267
329#define STAGE_ARCHIVE 0x3CF
330#elif VERSION_EU
331#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_06)
332#define EVENT_TEXT_FILE (TEXT_EVENTS_500 - 1)
333#define STAGE_FILE 0x276
334#define STAGE_ARCHIVE 0x3DF
335#endif
336/* Sets the stage up: its map, actors, battles and events, playing BGM_0017 */
357
359 SCRIPT_WALK(2, 0x218, 0x1C4, 5),
361 SCRIPT_COMMAND(0x350, 0x35C, 2),
363 SCRIPT_POSE(2, 1, 5),
364 SCRIPT_WAIT(0x1E),
365 SCRIPT_WALK(2, 0x268, 0x19C, 5),
367 SCRIPT_LOOK_AT(0, 0x296, 0x184),
369 SCRIPT_WAIT(0x1E),
370 SCRIPT_COMMAND(0x323, 0x325, 2),
372 SCRIPT_WAIT(0x3C),
373 SCRIPT_POSE(2, 1, 1),
374 SCRIPT_COMMAND(0x323, 0x326, 2),
375 SCRIPT_WAIT(0x1E),
376 SCRIPT_POSE(2, 1, 3),
377 SCRIPT_WAIT(0x1E),
378 SCRIPT_POSE(2, 1, 7),
379 SCRIPT_WAIT(0x1E),
380 SCRIPT_TALK(0, 1, 2, 0),
381 SCRIPT_POSE(2, 1, 1),
383 SCRIPT_COMMAND(0x34F, 0x35A, 2),
384 SCRIPT_WAIT(0x1E),
385 SCRIPT_WAIT(0x5A),
386 SCRIPT_POSE(2, 1, 5),
387 SCRIPT_COMMAND(0x34F, 0x35A, 2),
388 SCRIPT_WAIT(0x5A),
389 SCRIPT_COMMAND(0x350, 0x360, 2),
390 SCRIPT_WAIT(0x48),
391 SCRIPT_COMMAND(0x350, 0x361, 2),
392 SCRIPT_WAIT(0x24),
393 SCRIPT_COMMAND(0x350, 0x362, 2),
394 SCRIPT_WAIT(0x18),
395 SCRIPT_COMMAND(0x350, 0x363, 2),
396 SCRIPT_WAIT(0x30),
397 SCRIPT_COMMAND(0x350, 0x364, 2),
398 SCRIPT_WAIT(0x60),
399 SCRIPT_COMMAND(0x350, 0x35D, 2),
400 SCRIPT_WAIT(0x96),
401 SCRIPT_COMMAND(0x350, 0x35E, 2),
402 SCRIPT_WAIT(0x12),
404 SCRIPT_WAIT(0x2A),
405 SCRIPT_TALK(0, 2, 2, 0),
407 SCRIPT_COMMAND(0x350, 0x35F, 2),
408 SCRIPT_WAIT(0x3C),
409 SCRIPT_TALK(0, 3, 2, 0),
411 SCRIPT_WAIT(0x1E),
413};
415 SCRIPT_LOOK_AT(1, 0x29A, 0x184),
416 SCRIPT_PLACE(2, 0x268, 0x19C),
417 SCRIPT_POSE(2, 1, 5),
418 SCRIPT_WAIT(0x78),
419 SCRIPT_TALK(0, 1, 2, 2),
421 SCRIPT_WAIT(0x1E),
422 SCRIPT_COMMAND(0x323, 0x325, 2),
423 SCRIPT_WAIT(0x3C),
424 SCRIPT_COMMAND(0x323, 0x326, 2),
425 SCRIPT_WAIT(0x1E),
426 SCRIPT_TALK(0, 2, 2, 2),
428 SCRIPT_WAIT(0x1E),
429 SCRIPT_WALK(2, 0x268, 0x168, 5),
431 SCRIPT_WALK(2, 0x2A8, 0x148, 5),
432 SCRIPT_WAIT(6),
433 SCRIPT_LEAVE(0x245, 0x708, 0x20C, 3),
435};
437 { 11, 4 }, { 12, 4 }, { 13, 7 }, { 14, 9 },
438 { 15, 10 }, { 16, 8 }, { 17, 4 }, { 18, 4 },
439 { 19, 4 }, { 20, 4 }, { 21, 4 }, { 22, 4 },
440 { 23, 100 }, { 255, 0 },
441};
443 { 9, 25 }, { 8, 4 }, { 7, 4 }, { 6, 4 },
444 { 5, 4 }, { 4, 4 }, { 3, 6 }, { 2, 7 },
445 { 1, 8 }, { 0, 8 }, { 1, 10 }, { 2, 10 },
446 { 3, 10 }, { 4, 10 }, { 5, 10 }, { 6, 10 },
447 { 7, 10 }, { 8, 10 }, { 255, 0x3E7 },
448};
450 { 0, 4 }, { 1, 4 }, { 2, 4 }, { 3, 4 },
451 { 4, 4 }, { 5, 4 }, { 6, 4 }, { 7, 4 },
452 { 8, 4 }, { 255, 0x3E7 },
453};
455 { 10, 4 }, { 9, 10 }, { 255, 0x3E7 },
456};
458 { 10, 4 }, { 9, 4 }, { 255, 0 },
459};
462 { 0x288, 0x1D7, 3 },
463 { 0x32F, 0x170, 4 },
464 { 0x250, 0x11F, 5 },
465 { 0x307, 0x1C9, 6 },
466 { 0x234, 0x171, 7 },
467};
481AreaBattle area1Battle0 = { 0, 0, MUSIC(1, 0) };
482AreaBattle area1Battle1 = { 0, 0, MUSIC(1, 0) };
483AreaBattle area1Battle2 = { 0, 0, MUSIC(1, 0) };
484AreaBattle area1Battle3 = { 0, 0, MUSIC(1, 0) };
485AreaBattle area1Battle4 = { 0, 0, MUSIC(1, 0) };
486AreaBattle area1Battle5 = { 0, 0, MUSIC(1, 0) };
487AreaBattle area1Battle6 = { 0, 0, MUSIC(1, 0) };
488AreaBattle area1Battle7 = { 0, 0, MUSIC(1, 0) };
494AreaBattle area2Battle0 = { 0, 0, MUSIC(1, 0) };
495AreaBattle area2Battle1 = { 0, 0, MUSIC(1, 0) };
496AreaBattle area2Battle2 = { 0, 0, MUSIC(1, 0) };
497AreaBattle area2Battle3 = { 0, 0, MUSIC(1, 0) };
498AreaBattle area2Battle4 = { 0, 0, MUSIC(1, 0) };
499AreaBattle area2Battle5 = { 0, 0, MUSIC(1, 0) };
500AreaBattle area2Battle6 = { 0, 0, MUSIC(1, 0) };
501AreaBattle area2Battle7 = { 0, 0, MUSIC(1, 0) };
509AreaBattle area3Battle2 = { 0, 0, MUSIC(1, 0) };
510AreaBattle area3Battle3 = { 0, 0, MUSIC(1, 0) };
511AreaBattle area3Battle4 = { 0, 0, MUSIC(1, 0) };
512AreaBattle area3Battle5 = { 0, 0, MUSIC(1, 0) };
513AreaBattle area3Battle6 = { 0, 0, MUSIC(1, 0) };
514AreaBattle area3Battle7 = { 0, 0, MUSIC(1, 0) };
524 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
525 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
526 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
527 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
528 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
529 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
530 { 0x180, 0x100, 0x1A8, 0x1C8, 0x1A0, 0xC8, 0x150, 0x1FC },
531 { 0x180, 0x100, 0x1A0, 0x1C8, 0x180, 0xC8, 0x160, 0x1FC },
532};
540 { NULL, actor0Talk0Actions, 0x264 },
541 { NULL, NULL, 0 },
542};
544 { NULL, NULL, 0x25 },
545 { NULL, NULL, 0 },
546};
548 { NULL, NULL, 0x12C },
549 { NULL, NULL, 0 },
550};
552 { NULL, NULL, 0x26 },
553 { NULL, NULL, 0 },
554};
556 { NULL, NULL, 0x110 },
557 { NULL, NULL, 0 },
558};
570 &actor0,
571 &actor1,
572 &actor2,
573 &actor3,
574 &actor4,
575 NULL,
576};
578 { 1, 0, 0x64, 2, 0x63, 0, 0, 0, 0, 0, 529, 465, 0, 0 },
579 { 1, 0, 0x64, 2, 0x61, 0, 0, 0, 0, 0, 427, 1040, 0, 0 },
580 { 1, 0, 0x64, 2, 0x61, 0, 0, 0, 0, 0, 546, 1044, 0, 0 },
581 { 1, 0, 0x64, 2, 0x62, 0, 0, 0, 0, 0, 502, 1051, 0, 0 },
582 { 0, 2, 0x80, 4, 0, 0, 0, 0, 0, 0, 701, 371, 371, 0 },
583 { 0, 7, 0xF0, 4, 0xB, 0, 0, 0, 0, 0, 564, 369, 369, 0 },
584 { 0, 5, 0xF0, 4, 0xB, 0, 0, 0, 0, 0, 592, 287, 287, 0 },
585 { 0, 3, 0xF0, 4, 0xB, 0, 0, 0, 0, 0, 648, 471, 471, 0 },
586 { 0, 6, 0xF0, 4, 0xB, 0, 0, 0, 0, 0, 775, 457, 457, 0 },
587 { 0, 4, 0xF0, 4, 0xB, 0, 0, 0, 0, 0, 815, 368, 368, 0 },
588 { 0, 1, 0x50, 4, 0x18, 0, 0, 0, 0, 0, 663, 340, 370, 0 },
589 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
590};
592 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x245, 0x708, 0x20C, 3, 0, 0, 0 },
593 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x245, 0x708, 0x2DC, 3, 0, 0, 0 },
594 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x245, 0x708, 0x3BC, 3, 0, 0, 0 },
595 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x245, 0x708, 0x50E, 3, 0, 0, 0 },
596 { { { PROGRESS(STORY_BULBMON_FOUND), 1 }, { FLAG_ZHU_QUE_CHIEF_CHALLENGE_SEEN, 0 } }, SLOT_EVENT, 0x2C6, 0, 0, 0, 0, 0, 0 },
597 { { { CODES_END, 0 }, { CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
598};
599void (*stageFuncs[])(void) = {
601};
603 { 710, script710, EVENT_TEXT(0x21), NULL, endEvent710 },
604 { 711, script711, EVENT_TEXT(0x1F), NULL, endEvent711 },
605 { -1, NULL, 0, NULL, NULL },
606};
#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
GfxState GFX
GFX: the graphics state and its methods.
Definition display.c:209
GameFlags FLAGS_00
The flag bitset FLAGS_00 and the event functions.
Definition events.c:701
GameState GAME
The save data, the game mode and the methods.
Definition state.c:64
#define TASK_RUN
Definition task.h:35
#define TASK_KILL
Definition task.h:37
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Definition task.h:34
#define TASK_DONE
Definition task.h:36
EventTask * FIELDSTG_startEvent(s32 id)
Starts the event id of FieldState.events: its script, start and end, and its text; the player stands ...
Definition event.c:250
The stage overlays (AAA/PRO/WSTAG###.PRO), loaded at 0x800A4CA4 on top of FIELDSTG.
#define EVENT_TEXT(n)
An entry of the stage's events' text file, for FieldEvent.text.
Definition stage.h:732
#define SOUND_FLOOR_LT
Definition stage.h:746
void updateStage()
The names every stage defines, each its own (config/<version>/stages/<stage>.txt).
#define SOUND_BULB_002
Definition stage.h:745
#define SOUND_COMEX114
Definition stage.h:741
#define FIELD_COMMAND_PLAY_DEMO_BGM
Definition field_map.h:53
#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_STOP_CAMERA_SHAKE
Definition field_map.h:63
#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 FIELD_COMMAND_SHAKE_CAMERA
Definition field_map.h:62
#define SLOT_EVENT
starts the event arg
Definition field_map.h:262
#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 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 EVENT_BATTLE(id)
action: FIELDSTG_battleFuncs.startEventBattle
Definition game_state.h:72
#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
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_BATTLE
BATL0000: the maps' random battles (AreaBattle, nearly all of them)
Definition sound.h:76
#define MUSIC_BUG_MAZE
BGM_0017: the Bug Maze (Network Break)
Definition sound.h:93
#define MUSIC_BOSS
BOSS_000: the sectors' boss battles.
Definition sound.h:108
#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,...
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,...
s32 stepTileAnimation(StageTileAnim *obj, AnimFrame *frames, s32 once, s32 depth)
Steps OBJ's animation through FRAMES by the frame time (at most 4) and returns its frame: at the end ...
#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_BULBMON_FOUND
WSTAG520 (Suzaku Hall), event 695: another earthquake; Bulbmon digs the holes.
Definition story.h:103
@ STORY_JUNGLE_SOUND
WSTAG545 (Bug Maze Pit), event 711: Patamon heard a weird sound from the jungle, where its leader wen...
Definition story.h:106
#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_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 FLAG_ZHU_QUE_CHIEF_CHALLENGE_SEEN
wstag545 event 710: the player asks Zhu Que Chief where the Digi-Egg of Knowledge is; set at its end,...
Definition story.h:1460
#define FLAG_BUG_MAZE_PIT_DIGITAMA_MAIL_FOUND
wstag545: chest that gives the Digitama Mail, "I got" text; its conditions test it 0
Definition story.h:257
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
Definition field_map.h:114
One frame of a sprite animation; frame 0xFF ends it (or loops it)
Definition gfx.h:296
s16 frame
Definition gfx.h:297
s16 duration
Definition gfx.h:298
s16 index
Definition gfx.h:302
s16 timer
Definition gfx.h:303
A 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
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
s32(* getFrameTime)(void)
Definition gfx.h:32
GfxFuncs funcs
Definition gfx.h:77
short(* playSound)(s32 id)
returns the voice of a key-on
Definition sound.h:187
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
void(* setState)(struct StageTask *task, s32 state)
Definition stage.h:27
A map object with the animation that sets its frame.
Definition stage.h:108
StageTile * tile
Definition stage.h:109
AnimState anim
Definition stage.h:110
Where a StageTileAt is created.
Definition stage.h:633
The map object with the given animation, moved to (x, y)
Definition stage.h:367
StageTileAnim obj
Definition stage.h:372
s32 state
Definition stage.h:368
void(* nextState)(struct StageTileAt *task)
Definition stage.h:368
s32 substate
Definition stage.h:368
void(* setState)(struct StageTileAt *task, s32 state)
Definition stage.h:368
void(* setSubstate)(struct StageTileAt *task, s32 substate)
Definition stage.h:368
s32 anim
Definition stage.h:371
The children of a StageTileSwitch.
Definition stage.h:640
StageTileAt * tiles[5]
Definition stage.h:641
The map object with animation 2, animated by substate, and the StageTileAt children that events set t...
Definition stage.h:625
s32 silent
no sound when an event comes
Definition stage.h:628
void(* setStep)(struct StageTileSwitch *task, s32 step)
Definition stage.h:626
StageTileAnim obj
Definition stage.h:629
void(* setSubstate)(struct StageTileSwitch *task, s32 substate)
Definition stage.h:626
s32 spawn
the child to set to TASK_DONE, + 1
Definition stage.h:627
void(* nextState)(struct StageTileSwitch *task)
Definition stage.h:626
A map object, animated.
Definition stage.h:353
s32 substate
Definition stage.h:354
void(* setSubstate)(struct StageTileTask *task, s32 substate)
Definition stage.h:354
void(* setState)(struct StageTileTask *task, s32 state)
Definition stage.h:354
void(* nextState)(struct StageTileTask *task)
Definition stage.h:354
StageTileAnim obj
Definition stage.h:355
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
Definition field_map.h:208
u8 anim
which of a stage's animations sets frame (1-3); FIELDSTG finds objects by it (its lift,...
Definition field_map.h:210
Definition gfx.h:352
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105
void * createTaskWithId(void(*update)(), s32 size, s32 childrenSize, s32 id)
Allocates a zeroed task of size bytes (header included) with room for childrenSize / 4 child tasks.
Definition task.c:80
u16 actor1Conditions[]
Definition wstag545.c:560
u16 actor0Talk0Actions[]
Definition wstag545.c:533
AreaBattle area2Battle7
Definition wstag545.c:501
FieldActorEntry actor0
Definition wstag545.c:564
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag545.c:599
void * createTileTask(s32 arg)
Creates the map object that event 710, Bulbmon's earthquake, sets off (updateTileTask),...
Definition wstag545.c:149
FieldTalk actor2Talks[]
Definition wstag545.c:547
AreaBattle area2Battle6
Definition wstag545.c:500
StageTileAt * createTileAt(s32 anim, s32 x, s32 y)
Creates a StageTileAt for the map object with the given animation.
Definition wstag545.c:76
AreaBattle area1Battle6
Definition wstag545.c:487
AreaBattle area0Battle7
Definition wstag545.c:475
FieldActorEntry actor2
Definition wstag545.c:566
AreaBattle area3Battle4
Definition wstag545.c:511
AreaBattle area3Battle3
Definition wstag545.c:510
AreaBattle area0Battle1
Definition wstag545.c:469
AreaBattle area2Battle0
Definition wstag545.c:494
void handleCommand847(StageTask *task, s32 id)
Command 847 of the event scripts: told 0x35A in event 710 (Bulbmon's earthquake), ends its task.
Definition wstag545.c:139
FieldActorEntry * stageActors[]
Definition wstag545.c:569
AnimFrame updateTileSwitchFrames_1[]
Definition wstag545.c:454
AreaBattle area1Battle2
Definition wstag545.c:483
void updateTileAt(StageTileAt *task)
Moves the map object with the given animation to (x, y); hidden while running, shown and animated whe...
Definition wstag545.c:39
void * createCommand848(s32 id)
Creates the task of updateTileSwitch with the given id.
Definition wstag545.c:284
AreaBattle area3Battle0
Definition wstag545.c:507
void endEvent710(void)
After event 710, with the player: starts the stage's event battle 0 and keeps it from playing again.
Definition wstag545.c:315
static void playSwitchOnce(StageTileSwitch *task, StageTile *tile, s32 n, s32 done, s32 next)
Plays the switch's animation N once (from its start, on step 0), then holds frame DONE and goes on to...
Definition wstag545.c:159
AreaBattle area0Battle6
Definition wstag545.c:474
FieldTalk actor1Talks[]
Definition wstag545.c:543
AreaBattle area3Battle2
Definition wstag545.c:509
void handleCommand848(void *arg, s32 id)
Events 0x35D to 0x364: animate the map object (substates 1, 3, 5) or pick a child to set to TASK_DONE...
Definition wstag545.c:246
FieldTalk actor0Talks[]
Definition wstag545.c:539
AreaBattle area3Battle1
Definition wstag545.c:508
#define STAGE_ARCHIVE
Definition wstag545.c:334
AreaBattle area0Battle3
Definition wstag545.c:471
AnimFrame updateTileSwitchFrames_2[]
Definition wstag545.c:457
FieldTalk actor4Talks[]
Definition wstag545.c:555
u16 actor4Conditions[]
Definition wstag545.c:563
FieldActorEntry actor4
Definition wstag545.c:568
u16 actor3Conditions[]
Definition wstag545.c:562
AreaBattle area3Battle6
Definition wstag545.c:513
ActorImage stageImages[]
Definition wstag545.c:523
void setupStage(void)
Sets the stage up: its map, actors, battles and events, playing BGM_0017.
Definition wstag545.c:337
AreaBattle area2Battle4
Definition wstag545.c:498
AnimFrame updateTileAtFrames[]
Defined below, after the code that uses them.
Definition wstag545.c:436
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag545.c:577
AnimFrame updateTileTaskFrames[]
Definition wstag545.c:442
FieldTalk actor3Talks[]
Definition wstag545.c:551
BattleList area3Battles
Definition wstag545.c:515
void endEvent711(void)
After event 711, with the player: moves the story on to STORY_JUNGLE_SOUND.
Definition wstag545.c:321
AreaBattle area3Battle5
Definition wstag545.c:512
AreaBattle area0Battle5
Definition wstag545.c:473
BattleList area1Battles
Definition wstag545.c:489
BattleList area2Battles
Definition wstag545.c:502
AreaBattle area1Battle4
Definition wstag545.c:485
AreaBattle area2Battle2
Definition wstag545.c:496
AreaBattle area1Battle5
Definition wstag545.c:486
AnimFrame * updateTileSwitchFrames[3]
Definition wstag545.c:460
AnimFrame updateTileSwitchFrames_0[]
Definition wstag545.c:449
s16 script711[]
Definition wstag545.c:414
StageSlot stageSlots[]
Definition wstag545.c:591
AreaBattle area2Battle1
Definition wstag545.c:495
s16 script710[]
Definition wstag545.c:358
AreaBattle area1Battle3
Definition wstag545.c:484
void updateTileTask(StageTileTask *task)
Shows the map object with animation 1 (frame 0x18); when done, animates it once with a sound and goes...
Definition wstag545.c:88
AreaBattle area1Battle0
Definition wstag545.c:481
s32 stepHeldAnimation(StageTileAnim *obj, AnimFrame *frames, s32 depth)
Steps an animation, holding its last frame, and returns the frame.
Definition wstag545.c:14
FieldActorEntry actor1
Definition wstag545.c:565
AreaBattle area0Battle0
Definition wstag545.c:468
void updateTileSwitch(StageTileSwitch *task, StageTileAts *children)
The switch, the map object with animation 2, played by substate (events 0x35D to 0x35F); also sets th...
Definition wstag545.c:182
AreaBattle area0Battle2
Definition wstag545.c:470
#define STAGE_FILE
Definition wstag545.c:333
AreaBattle area2Battle5
Definition wstag545.c:499
AreaBattle area1Battle1
Definition wstag545.c:482
AreaBattle area2Battle3
Definition wstag545.c:497
StageTileAtSpot updateTileSwitchSpots[]
Definition wstag545.c:461
u16 actor2Conditions[]
Definition wstag545.c:561
AreaBattle area0Battle4
Definition wstag545.c:472
#define STAGE_TEXT
Definition wstag545.c:331
AreaBattle area3Battle7
Definition wstag545.c:514
BattleList area0Battles
Definition wstag545.c:476
AreaBattle area1Battle7
Definition wstag545.c:488
FieldActorEntry actor3
Definition wstag545.c:567
FieldBattles stageBattles[]
Definition wstag545.c:520
FieldEvent stageEvents[]
Definition wstag545.c:602
u16 actor0Conditions[]
Definition wstag545.c:559