Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag455.c
Go to the documentation of this file.
1/*
2 * WSTAG455: Bios Swamp, South Sector.
3 */
4
5#include "common.h"
6#include "field/stage.h"
7const CVECTOR stageColor = { 0x80, 0x80, 0x80, 0x00 };
8
9/* Defined below, after the code that uses them */
11
13
14/* Plays the animation of the map object with animation 1 once with a sound when the substate is 0, then kills itself */
16 StageTile *object;
17 StageTile *tile;
18 s32 frame;
19
20 switch (task->state) {
21 case TASK_INIT:
22 default:
23 task->nextState(task);
24 task->obj.anim.index = 0;
26 for (object = FIELDSTG_state.objects; object->margin != 0; object++) {
27 if (object->anim == 1) {
28 task->obj.tile = object;
29 }
30 }
31 break;
32 case TASK_RUN:
33 if (task->substate == 0) {
34 task->obj.anim.index = 0;
36 task->setSubstate(task, 1);
38 }
39 tile = task->obj.tile;
40 frame = stepAnimationOnce(&task->obj, updateTileTaskFrames, 0);
41 if (frame == 0xFF) {
42 tile->visible = 0;
43 task->setState(task, TASK_KILL);
44 } else {
45 tile->visible = 1;
46 tile->frame = frame;
47 }
48 break;
49 case TASK_DONE:
50 case TASK_KILL:
51 break;
52 }
53}
54
55/*
56 * Command 828 of the event scripts: the wall the TNT Chip blows a hole in,
57 * in event 360 (updateTileTask)
58 */
60 return createTaskWithId(updateTileTask, sizeof(StageTileTask), 0, arg);
61}
62
63/* Creates the event object of story progress 0xE */
64void updateStage(StageTask *task, void **children) {
65 switch (task->state) {
66 case TASK_INIT:
67 default:
69 children[0] = FIELDSTG_startEvent(0x168);
70 }
71 task->nextState(task);
72 break;
73 case TASK_RUN:
74 case TASK_DONE:
75 case TASK_KILL:
76 break;
77 }
78}
79
80#define STAGE_CHILDREN_SIZE 4
82
83/* After event 360, with the player: sets flag 0x4007 (which decides whether actor 0 appears) */
87
88#if VERSION_US || VERSION_JP
89#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_06)
90#define EVENT_TEXT_FILE (TEXT_EVENTS_400 - 1)
91#define STAGE_FILE 0x381
92#elif VERSION_EU
93#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_06)
94#define EVENT_TEXT_FILE (TEXT_EVENTS_400 - 1)
95#define STAGE_FILE 0x391
96#endif
97/* Sets the stage up: its map, actors, battles and events, playing the ambience ENV_0012 */
119
121 SCRIPT_PLACE(1, 0x458, 0xCC),
122 SCRIPT_POSE(1, 1, 3),
123 SCRIPT_PLACE(1, 0x458, 0xCC),
124 SCRIPT_POSE(1, 1, 3),
125 SCRIPT_WAIT(0x78),
126 SCRIPT_WAIT(0x1E),
127 SCRIPT_TALK(0, 1, 1, 3),
129 SCRIPT_WAIT(0x1E),
130 SCRIPT_LOOK_AT(0, 0x418, 0x94),
131 SCRIPT_WAIT(0x3C),
132 SCRIPT_WALK(1, 0x428, 0xB4, 3),
134 SCRIPT_WAIT(0x3C),
136 SCRIPT_WAIT(0x3C),
137 SCRIPT_WALK(1, 0x470, 0xD8, 7),
139 SCRIPT_POSE(1, 0x43, 7),
140 SCRIPT_WAIT(0x5A),
142 SCRIPT_COMMAND(0x33C, 0x335, 1),
143 SCRIPT_WAIT(0x3C),
145 SCRIPT_WAIT(0x3C),
146 SCRIPT_POSE(1, 1, 7),
147 SCRIPT_WAIT(0x3C),
148 SCRIPT_POSE(1, 1, 3),
149 SCRIPT_WAIT(0x1E),
150 SCRIPT_FOLLOW(0, 1),
151 SCRIPT_TALK(0, 2, 1, 1),
153 SCRIPT_WAIT(0x1E),
154 SCRIPT_WALK(1, 0x428, 0xB4, 3),
155 SCRIPT_WAIT(6),
156 SCRIPT_LEAVE(0x236, 0xD6, 0x84, 1),
158};
160 { 11, 4 }, { 12, 4 }, { 13, 4 }, { 14, 4 },
161 { 15, 4 }, { 16, 4 }, { 17, 4 }, { 18, 4 },
162 { 19, 4 }, { 20, 4 }, { 21, 4 }, { 22, 4 },
163 { 23, 4 }, { 23, 4 }, { 24, 4 }, { 25, 4 },
164 { 255, 0x3E7 },
165};
179AreaBattle area1Battle0 = { 0, 0, MUSIC(1, 0) };
180AreaBattle area1Battle1 = { 0, 0, MUSIC(1, 0) };
181AreaBattle area1Battle2 = { 0, 0, MUSIC(1, 0) };
182AreaBattle area1Battle3 = { 0, 0, MUSIC(1, 0) };
183AreaBattle area1Battle4 = { 0, 0, MUSIC(1, 0) };
184AreaBattle area1Battle5 = { 0, 0, MUSIC(1, 0) };
185AreaBattle area1Battle6 = { 0, 0, MUSIC(1, 0) };
186AreaBattle area1Battle7 = { 0, 0, MUSIC(1, 0) };
192AreaBattle area2Battle0 = { 0, 0, MUSIC(1, 0) };
193AreaBattle area2Battle1 = { 0, 0, MUSIC(1, 0) };
194AreaBattle area2Battle2 = { 0, 0, MUSIC(1, 0) };
195AreaBattle area2Battle3 = { 0, 0, MUSIC(1, 0) };
196AreaBattle area2Battle4 = { 0, 0, MUSIC(1, 0) };
197AreaBattle area2Battle5 = { 0, 0, MUSIC(1, 0) };
198AreaBattle area2Battle6 = { 0, 0, MUSIC(1, 0) };
199AreaBattle area2Battle7 = { 0, 0, MUSIC(1, 0) };
205AreaBattle area3Battle0 = { 0, 0, MUSIC(1, 0) };
206AreaBattle area3Battle1 = { 0, 0, MUSIC(1, 0) };
207AreaBattle area3Battle2 = { 0, 0, MUSIC(1, 0) };
210AreaBattle area3Battle5 = { 0, 0, MUSIC(1, 0) };
222 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
223 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
224 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
225 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
226 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
227 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
228 { 0x180, 0x100, 0x1AE, 0x120, 0x1B8, 0x20, 0x170, 0x1FF },
229 { 0, 0, 0, 0, 0, 0, 0, 0 },
230};
236 { actor1Talk0Conditions, NULL, 0x2EA },
238 { actor1Talk2Conditions, NULL, 0x2EC },
239 { NULL, NULL, 0 },
240};
243 ITEM(0, 0xE), 1,
245 CODES_END,
246};
248FieldActorEntry actor1 = { NULL, actor1Talks, 0x3F, 5, 1051, 195, 5 };
250 &actor0,
251 &actor1,
252 NULL,
253};
255 { 1, 0, 0x40, 2, 3, 0, 0, 0, 0, 0, 250, 247, 0, 0 },
256 { 0, 1, 0x40, 6, 0xB, 0, 0, 0, 0, 0, 1038, 93, 0, 0 },
257 { 1, 0, 0x40, 6, 0x32, 1, 0x32, 0x34, 0xA, 0, 759, 577, 0, 0 },
258 { 1, 0, 0x40, 6, 0x32, 1, 0x32, 0x34, 0xA, 0, 869, 106, 0, 0 },
259 { 1, 0, 0x40, 6, 0x32, 1, 0x32, 0x34, 0xA, 0, 994, 307, 0, 0 },
260 { 1, 0, 0x40, 6, 0x35, 1, 0x35, 0x37, 0xA, 0, 246, 499, 0, 0 },
261 { 1, 0, 0x40, 6, 0x35, 1, 0x35, 0x37, 0xA, 0, 424, 419, 0, 0 },
262 { 1, 0, 0x40, 6, 0x35, 1, 0x35, 0x37, 0xA, 0, 614, 701, 0, 0 },
263 { 1, 0, 0x40, 6, 0x35, 1, 0x35, 0x37, 0xA, 0, 668, 634, 0, 0 },
264 { 1, 0, 0x40, 6, 0x38, 1, 0x38, 0x3A, 0xA, 0, 195, 282, 0, 0 },
265 { 1, 0, 0x40, 6, 0x38, 1, 0x38, 0x3A, 0xA, 0, 572, 492, 0, 0 },
266 { 1, 0, 0x40, 6, 0x38, 1, 0x38, 0x3A, 0xA, 0, 658, 704, 0, 0 },
267 { 1, 0, 0x40, 6, 0x38, 1, 0x38, 0x3A, 0xA, 0, 1002, 297, 0, 0 },
268 { 1, 0, 0x40, 6, 0x3B, 1, 0x3B, 0x3D, 0xA, 0, 175, 158, 0, 0 },
269 { 1, 0, 0x40, 6, 0x3B, 1, 0x3B, 0x3D, 0xA, 0, 234, 281, 0, 0 },
270 { 1, 0, 0x40, 6, 0x3B, 1, 0x3B, 0x3D, 0xA, 0, 254, 557, 0, 0 },
271 { 1, 0, 0x40, 6, 0x3B, 1, 0x3B, 0x3D, 0xA, 0, 339, 312, 0, 0 },
272 { 1, 0, 0x40, 6, 0x3B, 1, 0x3B, 0x3D, 0xA, 0, 420, 249, 0, 0 },
273 { 1, 0, 0x40, 6, 0x3B, 1, 0x3B, 0x3D, 0xA, 0, 553, 243, 0, 0 },
274 { 1, 0, 0x40, 6, 0x3B, 1, 0x3B, 0x3D, 0xA, 0, 724, 281, 0, 0 },
275 { 1, 0, 0x40, 6, 0x3B, 1, 0x3B, 0x3D, 0xA, 0, 1182, 389, 0, 0 },
276 { 1, 0, 0x40, 6, 0x3B, 1, 0x3B, 0x3D, 0xA, 0, 1216, 245, 0, 0 },
277 { 1, 0, 0x40, 6, 0x3E, 1, 0x3E, 0x40, 0xA, 0, 466, 173, 0, 0 },
278 { 1, 0, 0x40, 6, 0x3E, 1, 0x3E, 0x40, 0xA, 0, 497, 669, 0, 0 },
279 { 1, 0, 0x40, 6, 0x3E, 1, 0x3E, 0x40, 0xA, 0, 568, 405, 0, 0 },
280 { 1, 0, 0x40, 6, 0x3E, 1, 0x3E, 0x40, 0xA, 0, 601, 271, 0, 0 },
281 { 1, 0, 0x40, 6, 0x3E, 1, 0x3E, 0x40, 0xA, 0, 752, 258, 0, 0 },
282 { 1, 0, 0x40, 6, 0x3E, 1, 0x3E, 0x40, 0xA, 0, 883, 396, 0, 0 },
283 { 1, 0, 0x40, 6, 0x3E, 1, 0x3E, 0x40, 0xA, 0, 1144, 314, 0, 0 },
284 { 1, 0, 0x40, 6, 0x3E, 1, 0x3E, 0x40, 0xA, 0, 1162, 505, 0, 0 },
285 { 1, 0, 0x40, 6, 0x41, 1, 0x41, 0x43, 0xA, 0, 181, 167, 0, 0 },
286 { 1, 0, 0x40, 6, 0x41, 1, 0x41, 0x43, 0xA, 0, 496, 372, 0, 0 },
287 { 1, 0, 0x40, 6, 0x41, 1, 0x41, 0x43, 0xA, 0, 667, 405, 0, 0 },
288 { 1, 0, 0x40, 6, 0x41, 1, 0x41, 0x43, 0xA, 0, 679, 276, 0, 0 },
289 { 1, 0, 0x40, 6, 0x41, 1, 0x41, 0x43, 0xA, 0, 794, 376, 0, 0 },
290 { 1, 0, 0x40, 6, 0x41, 1, 0x41, 0x43, 0xA, 0, 969, 437, 0, 0 },
291 { 1, 0, 0x40, 6, 0x41, 1, 0x41, 0x43, 0xA, 0, 970, 588, 0, 0 },
292 { 1, 0, 0x40, 6, 0x41, 1, 0x41, 0x43, 0xA, 0, 1087, 527, 0, 0 },
293 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 178, 286, 0, 0 },
294 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 225, 218, 0, 0 },
295 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 279, 323, 0, 0 },
296 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 285, 331, 0, 0 },
297 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 294, 145, 0, 0 },
298 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 296, 531, 0, 0 },
299 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 299, 336, 0, 0 },
300 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 321, 97, 0, 0 },
301 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 333, 157, 0, 0 },
302 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 338, 595, 0, 0 },
303 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 425, 96, 0, 0 },
304 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 443, 339, 0, 0 },
305 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 489, 139, 0, 0 },
306 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 529, 228, 0, 0 },
307 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 567, 255, 0, 0 },
308 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 620, 372, 0, 0 },
309 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 644, 280, 0, 0 },
310 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 653, 273, 0, 0 },
311 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 655, 284, 0, 0 },
312 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 681, 567, 0, 0 },
313 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 687, 716, 0, 0 },
314 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 726, 322, 0, 0 },
315 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 785, 99, 0, 0 },
316 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 793, 433, 0, 0 },
317 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 825, 78, 0, 0 },
318 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 850, 452, 0, 0 },
319 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 879, 564, 0, 0 },
320 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 896, 560, 0, 0 },
321 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 927, 455, 0, 0 },
322 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 951, 92, 0, 0 },
323 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 1040, 353, 0, 0 },
324 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 1166, 137, 0, 0 },
325 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 1193, 278, 0, 0 },
326 { 1, 0, 0x40, 6, 0x44, 1, 0x44, 0x46, 0xA, 0, 1200, 176, 0, 0 },
327 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 196, 394, 0, 0 },
328 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 233, 570, 0, 0 },
329 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 266, 262, 0, 0 },
330 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 280, 143, 0, 0 },
331 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 338, 500, 0, 0 },
332 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 440, 190, 0, 0 },
333 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 480, 610, 0, 0 },
334 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 484, 436, 0, 0 },
335 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 509, 342, 0, 0 },
336 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 620, 259, 0, 0 },
337 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 622, 389, 0, 0 },
338 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 628, 558, 0, 0 },
339 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 690, 250, 0, 0 },
340 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 718, 579, 0, 0 },
341 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 771, 678, 0, 0 },
342 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 780, 152, 0, 0 },
343 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 823, 557, 0, 0 },
344 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 916, 401, 0, 0 },
345 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 994, 524, 0, 0 },
346 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 1047, 396, 0, 0 },
347 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 1055, 275, 0, 0 },
348 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 1143, 443, 0, 0 },
349 { 1, 0, 0x40, 0xA, 0x47, 1, 0x47, 0x4A, 0xA, 0, 1162, 211, 0, 0 },
350 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 234, 174, 0, 0 },
351 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 235, 470, 0, 0 },
352 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 305, 395, 0, 0 },
353 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 307, 577, 0, 0 },
354 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 396, 324, 0, 0 },
355 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 418, 117, 0, 0 },
356 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 470, 418, 0, 0 },
357 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 521, 199, 0, 0 },
358 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 553, 384, 0, 0 },
359 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 561, 338, 0, 0 },
360 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 566, 185, 0, 0 },
361 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 569, 289, 0, 0 },
362 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 581, 678, 0, 0 },
363 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 587, 258, 0, 0 },
364 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 662, 523, 0, 0 },
365 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 666, 213, 0, 0 },
366 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 687, 469, 0, 0 },
367 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 690, 89, 0, 0 },
368 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 729, 413, 0, 0 },
369 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 765, 344, 0, 0 },
370 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 818, 233, 0, 0 },
371 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 868, 378, 0, 0 },
372 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 915, 101, 0, 0 },
373 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 927, 583, 0, 0 },
374 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 974, 343, 0, 0 },
375 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 1019, 574, 0, 0 },
376 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 1121, 179, 0, 0 },
377 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 1124, 520, 0, 0 },
378 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 1126, 309, 0, 0 },
379 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 1178, 348, 0, 0 },
380 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 1183, 153, 0, 0 },
381 { 1, 0, 0x40, 0xA, 0x4B, 1, 0x4B, 0x4E, 0xA, 0, 1202, 460, 0, 0 },
382 { 1, 0, 0xDA, 4, 0, 0, 0, 0, 0, 0, 923, 72, 210, 0 },
383 { 1, 0, 0x40, 4, 1, 0, 0, 0, 0, 0, 979, 425, 436, 0 },
384 { 1, 0, 0x40, 4, 2, 0, 0, 0, 0, 0, 674, 460, 490, 0 },
385 { 1, 0xFF, 0x64, 4, 0x38, 0, 0, 0, 0, 0, 392, 185, 185, 0 },
386 { 1, 0xFF, 0x64, 4, 0x38, 0, 0, 0, 0, 0, 481, 549, 549, 0 },
387 { 1, 0xFF, 0x64, 4, 0x38, 0, 0, 0, 0, 0, 545, 613, 613, 0 },
388 { 1, 0xFF, 0x64, 4, 0x38, 0, 0, 0, 0, 0, 817, 189, 189, 0 },
389 { 1, 0xFF, 0x64, 4, 0x38, 0, 0, 0, 0, 0, 865, 165, 165, 0 },
390 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
391};
393 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x234, 0x570, 0x3B8, 3, 0, 0, 0 },
394 { { { ITEM(0, 5), 1 }, { CODES_END, 0 } }, SLOT_GAUGE, 0x48, 0xFFEC, 0, 0, 0, 0, 0 },
395 { { { CODES_END, 0 }, { CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
396};
397void (*stageFuncs[])(void) = {
399};
401 { 360, script360, EVENT_TEXT(0x27), NULL, endEvent360 },
402 { -1, NULL, 0, NULL, NULL },
403};
#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
GameState GAME
The save data, the game mode and the methods.
Definition state.c:64
#define TASK_RUN
Definition task.h:35
#define TASK_KILL
Definition task.h:37
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Definition task.h:34
#define TASK_DONE
Definition task.h:36
EventTask * FIELDSTG_startEvent(s32 id)
Starts the event id of FieldState.events: its script, start and end, and its text; the player stands ...
Definition event.c:250
The stage overlays (AAA/PRO/WSTAG###.PRO), loaded at 0x800A4CA4 on top of FIELDSTG.
#define SOUND_COMAT102
Definition stage.h:737
#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 SCRIPT_WAIT_WALK(id)
until the character gets to its goal
Definition field_map.h:168
#define SCRIPT_END
The commands of an event script (FieldEvent.script), as FIELDSTG_runEvent reads them: a halfword kind...
Definition field_map.h:156
#define SCRIPT_LOOK_AT(snap, x, y)
FIELDSTG_pointCamera.
Definition field_map.h:172
#define SCRIPT_LEAVE(mode, x, y, dir)
FIELDSTG_leaveField; ends the event.
Definition field_map.h:170
#define 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_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_GAUGE
the gauge game
Definition field_map.h:261
#define FIELD_COMMAND_PLAY_SWITCH02
Definition field_map.h:56
#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 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_SWAMP
ENV_0012: the South Sector's swamps and Bulk Bridge.
Definition sound.h:128
#define MUSIC_BATTLE
BATL0000: the maps' random battles (AreaBattle, nearly all of them)
Definition sound.h:76
#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,...
#define FLAG_SINCERITY_SYMBOL_FOUND
wstag455 Bios Swamp: "There it is! The Symbol of Sincerity!" behind a wall; then Sepikmon advises ask...
Definition story.h:1106
@ 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
#define FLAG_SINCERITY_EGG_FOUND
wstag455 event 360: "I got the Digi-Egg of Sincerity!"; set at its end, tested 0 to show actor 0 in B...
Definition story.h:1309
#define FLAG_NAMI_SWAMP_CREST_TALKED
wstag485 Phoenix Bay: Nami saw a Crest behind the Bios Swamp shrine; then the player recognises the S...
Definition story.h:1010
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 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
CVECTOR spriteColor
the field's sprites' color, unless cd is 0
Definition field_map.h:458
s32 textFile
the stage's text file, for the talks
Definition field_map.h:461
union FieldState::@12 images
s32 music
SOUND.playSound's, or 0.
Definition field_map.h:460
What a character says (FIELDSTG_runActorAction): the first whose conditions hold, or the last,...
Definition field_map.h:176
void(* applyAction)(s32 code, s32 value)
Definition game_state.h:52
s32(* checkCondition)(u16 code, u16 value)
Definition game_state.h:53
short(* playSound)(s32 id)
returns the voice of a key-on
Definition sound.h:187
What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState....
Definition field_map.h:276
The task a stage starts (startStage), updated by its updateStage.
Definition stage.h:26
void(* nextState)(struct StageTask *task)
Definition stage.h:27
s32 state
Definition stage.h:27
StageTile * tile
Definition stage.h:109
AnimState anim
Definition stage.h:110
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 * 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
AreaBattle area2Battle7
Definition wstag455.c:199
FieldActorEntry actor0
Definition wstag455.c:247
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag455.c:397
AreaBattle area2Battle6
Definition wstag455.c:198
void * createCommand828(s32 arg)
Command 828 of the event scripts: the wall the TNT Chip blows a hole in, in event 360 (updateTileTask...
Definition wstag455.c:59
AnimFrame updateTileTaskFrames[]
Defined below, after the code that uses them.
Definition wstag455.c:159
AreaBattle area1Battle6
Definition wstag455.c:185
u16 actor1Talk1Conditions[]
Definition wstag455.c:232
AreaBattle area0Battle7
Definition wstag455.c:173
const CVECTOR stageColor
the color the setup copies to FIELDSTG_state.spriteColor
Definition wstag455.c:7
AreaBattle area3Battle4
Definition wstag455.c:209
AreaBattle area3Battle3
Definition wstag455.c:208
AreaBattle area0Battle1
Definition wstag455.c:167
AreaBattle area2Battle0
Definition wstag455.c:192
FieldActorEntry * stageActors[]
Definition wstag455.c:249
AreaBattle area1Battle2
Definition wstag455.c:181
void endEvent360(void)
After event 360, with the player: sets flag 0x4007 (which decides whether actor 0 appears)
Definition wstag455.c:84
AreaBattle area3Battle0
Definition wstag455.c:205
AreaBattle area0Battle6
Definition wstag455.c:172
FieldTalk actor1Talks[]
Definition wstag455.c:235
AreaBattle area3Battle2
Definition wstag455.c:207
u16 actor1Talk0Conditions[]
Definition wstag455.c:231
AreaBattle area3Battle1
Definition wstag455.c:206
AreaBattle area0Battle3
Definition wstag455.c:169
AreaBattle area3Battle6
Definition wstag455.c:211
ActorImage stageImages[]
Definition wstag455.c:221
u16 actor1Talk1Actions[]
Definition wstag455.c:233
void setupStage(void)
Sets the stage up: its map, actors, battles and events, playing the ambience ENV_0012.
Definition wstag455.c:98
AreaBattle area2Battle4
Definition wstag455.c:196
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag455.c:254
BattleList area3Battles
Definition wstag455.c:213
AreaBattle area3Battle5
Definition wstag455.c:210
AreaBattle area0Battle5
Definition wstag455.c:171
BattleList area1Battles
Definition wstag455.c:187
BattleList area2Battles
Definition wstag455.c:200
AreaBattle area1Battle4
Definition wstag455.c:183
AreaBattle area2Battle2
Definition wstag455.c:194
AreaBattle area1Battle5
Definition wstag455.c:184
StageSlot stageSlots[]
Definition wstag455.c:392
AreaBattle area2Battle1
Definition wstag455.c:193
AreaBattle area1Battle3
Definition wstag455.c:182
s16 script360[]
Definition wstag455.c:120
void updateTileTask(StageTileTask *task)
Plays the animation of the map object with animation 1 once with a sound when the substate is 0,...
Definition wstag455.c:15
AreaBattle area1Battle0
Definition wstag455.c:179
u16 actor1Talk2Conditions[]
Definition wstag455.c:234
FieldActorEntry actor1
Definition wstag455.c:248
AreaBattle area0Battle0
Definition wstag455.c:166
AreaBattle area0Battle2
Definition wstag455.c:168
#define STAGE_FILE
Definition wstag455.c:95
AreaBattle area2Battle5
Definition wstag455.c:197
AreaBattle area1Battle1
Definition wstag455.c:180
AreaBattle area2Battle3
Definition wstag455.c:195
AreaBattle area0Battle4
Definition wstag455.c:170
#define STAGE_TEXT
Definition wstag455.c:93
AreaBattle area3Battle7
Definition wstag455.c:212
BattleList area0Battles
Definition wstag455.c:174
AreaBattle area1Battle7
Definition wstag455.c:186
FieldBattles stageBattles[]
Definition wstag455.c:218
FieldEvent stageEvents[]
Definition wstag455.c:400
u16 actor0Conditions[]
Definition wstag455.c:241