Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag815.c
Go to the documentation of this file.
1/*
2 * WSTAG815: Gunslinger 2F, Spy Satellite. Lord Megadeath waits beyond its Warp
3 * Gate.
4 */
5
6#include "common.h"
7#include "field/stage.h"
8/* Defined below, after the code that uses them */
10
11/* The files of the background, which the versions number differently */
12#if VERSION_US || VERSION_JP
13#define BG_ARCHIVE 0x767
14#define BG_FILE 0x766
15#define BG_FILE2 0x887
16#elif VERSION_EU
17#define BG_ARCHIVE 0x776
18#define BG_FILE 0x775
19#define BG_FILE2 0x898
20#endif
21
22/* Draws the two background images (file BG_ARCHIVE) scrolled at 2/3 of the layer's scroll */
24 SpriteDrawer drawer;
25 Vec2 scroll;
27
28 layer->getScroll(layer, &scroll);
29 scroll.x = (scroll.x << 8) / 384;
30 scroll.y = (scroll.y << 8) / 384;
31 initSpriteDrawer(&drawer);
32 drawer.setLayerId(FIELD_LAYER_MAP, 7);
33 drawer.setTexture(0x280, 0);
34 drawer.setAltClut(0, 0xF0);
35 drawer.draw(FILE_CACHE.getEntry(BG_ARCHIVE << 16 | 2), 0, scroll.x, scroll.y);
36 drawer.setTexture(0x280, 0x100);
37 drawer.setAltClut(0, 0x1F0);
38 drawer.draw(FILE_CACHE.getEntry(BG_ARCHIVE << 16 | 3), 0, scroll.x, scroll.y + 0x100);
39}
40
41/* Loads the background images (files BG_FILE and BG_FILE2) to VRAM, then draws them every frame */
43 TimLoader loader;
44
45 switch (task->state) {
46 case TASK_INIT:
47 default:
48 initTimLoader(&loader);
49 loader.setImagePos(0x280, 0);
50 loader.setClutPos(0, 0xF0);
52 loader.setImagePos(0x280, 0x100);
53 loader.setClutPos(0, 0x1F0);
55 task->nextState(task);
56 break;
57 case TASK_RUN:
58 drawBackground(task);
59 break;
60 case TASK_DONE:
61 case TASK_KILL:
62 break;
63 }
64}
65
66/* Creates the spy satellite's background (updateBackground) */
67void *createBackground(void) {
68 return createTask(updateBackground, 0x60, 0);
69}
70
71/* Creates the background, the stage's five effects and the event object of flags 0x4072/0x40A9 */
72void updateStage(StageTask *task, void **children) {
73 s32 i;
74
75 switch (task->state) {
76 case TASK_INIT:
77 default:
78 children[0] = createBackground();
79 for (i = 0; i < 5; i++) {
80 if (updateStageSpots[i].kind == 0) {
81 children[i + 1] = createStageEffect(updateStageSpots[i].x, updateStageSpots[i].y, updateStageSpots[i].frame);
82 }
83 }
84 if (FLAGS_00.checkCondition(FLAG(0x40, 0x72), 1) && FLAGS_00.checkCondition(FLAG(0x40, 0xA9), 0)) {
85 children[6] = FIELDSTG_startEvent(0x411);
86 }
87 task->nextState(task);
88 break;
89 case TASK_RUN:
90 case TASK_DONE:
91 case TASK_KILL:
92 break;
93 }
94}
95
96/* Creates the stage task (id 0x17) and calls the first function of its table */
97StageTask *startStage(void *owner) {
99
100 task->owner = owner;
101 stageFuncs[0]();
102 return task;
103}
104
110
111/*
112 * After event 1020, with Metal Soldier: starts the stage's event battle 0
113 * and keeps it from playing again
114 */
119
120/*
121 * After event 1030, with Metal Soldier: starts the stage's event battle 0
122 * and keeps it from playing again
123 */
128
129/* After event 1040, with the player: keeps it from playing again */
130void endEvent1040(void) {
131 FLAGS_00.applyAction(FLAG(0x40, 0x72), 1);
132}
133
134/* After event 1041, with the player: keeps it from playing again */
135void endEvent1041(void) {
136 FLAGS_00.applyAction(FLAG(0x40, 0xA9), 1);
137}
138
139/*
140 * After event 1050, with the player: starts the stage's event battle 1 and
141 * keeps it from playing again
142 */
147
148#if VERSION_US || VERSION_JP
149#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_07)
150#define EVENT_TEXT_FILE (TEXT_EVENTS_800 - 1)
151#define STAGE_FILE 0x767
152#elif VERSION_EU
153#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_07)
154#define EVENT_TEXT_FILE (TEXT_EVENTS_800 - 1)
155#define STAGE_FILE 0x776
156#endif
157/* Sets the stage up: its map, actors, battles and events, playing BGM_0026 */
176
178 SCRIPT_WALK(2, 0x160, 0x2CB, 3),
181 SCRIPT_POSE(2, 1, 3),
182 SCRIPT_WAIT(0x1E),
183 SCRIPT_COMMAND(0x323, 0x325, 0xD0),
184 SCRIPT_WAIT(0x5A),
185 SCRIPT_COMMAND(0x323, 0x326, 0xD0),
186 SCRIPT_WAIT(0x1E),
187 SCRIPT_TALK(0, 1, 0xD0, 2),
189 SCRIPT_WAIT(0x1E),
190 SCRIPT_TALK(0, 2, 2, 1),
191 SCRIPT_POSE(2, 7, 3),
193 SCRIPT_POSE(2, 1, 3),
194 SCRIPT_WAIT(0x1E),
195 SCRIPT_WALK(2, 0x150, 0x2C4, 3),
198};
200 SCRIPT_WALK(2, 0x3D0, 0x103, 3),
203 SCRIPT_POSE(2, 1, 3),
204 SCRIPT_WAIT(0x1E),
205 SCRIPT_COMMAND(0x323, 0x325, 2),
206 SCRIPT_WAIT(0x5A),
207 SCRIPT_COMMAND(0x323, 0x326, 0xD1),
208 SCRIPT_WAIT(0x1E),
209 SCRIPT_TALK(0, 1, 0xD1, 2),
211 SCRIPT_WAIT(0x1E),
212 SCRIPT_TALK(0, 2, 2, 1),
213 SCRIPT_POSE(2, 7, 3),
215 SCRIPT_POSE(2, 1, 3),
216 SCRIPT_WAIT(0x1E),
217 SCRIPT_WALK(2, 0x3C0, 0xFB, 3),
220};
222 SCRIPT_WALK(2, 0x27D, 0x1F9, 3),
225 SCRIPT_POSE(2, 1, 3),
227 SCRIPT_WAIT(0x1E),
228 SCRIPT_COMMAND(0x323, 0x325, 2),
229 SCRIPT_WAIT(0x5A),
230 SCRIPT_COMMAND(0x323, 0x326, 2),
231 SCRIPT_WAIT(0x1E),
232 SCRIPT_POSE(2, 1, 1),
233 SCRIPT_WAIT(0x1E),
234 SCRIPT_POSE(2, 1, 2),
235 SCRIPT_WAIT(0x1E),
236 SCRIPT_POSE(2, 1, 1),
237 SCRIPT_WAIT(0x1E),
238 SCRIPT_POSE(2, 1, 0),
239 SCRIPT_WAIT(0x1E),
240 SCRIPT_POSE(2, 1, 1),
241 SCRIPT_WAIT(0x1E),
242 SCRIPT_POSE(2, 1, 0),
243 SCRIPT_WAIT(0x1E),
244 SCRIPT_COMMAND(0x323, 0x325, 2),
245 SCRIPT_WAIT(0xB4),
246 SCRIPT_COMMAND(0x323, 0x326, 2),
247 SCRIPT_WAIT(0x1E),
248 SCRIPT_POSE(2, 1, 1),
250 SCRIPT_WAIT(0x1E),
251 SCRIPT_TALK(0, 1, 2, 2),
252 SCRIPT_POSE(2, 7, 1),
254 SCRIPT_POSE(2, 1, 1),
255 SCRIPT_WAIT(0x1E),
256 SCRIPT_POSE(2, 1, 2),
258 SCRIPT_WAIT(0x1E),
259 SCRIPT_POSE(2, 1, 1),
260 SCRIPT_WAIT(0x1E),
261 SCRIPT_POSE(2, 1, 0),
262 SCRIPT_WAIT(0x1E),
263 SCRIPT_POSE(2, 1, 1),
264 SCRIPT_WAIT(0x1E),
265 SCRIPT_POSE(2, 1, 0),
267#if VERSION_US
268 SCRIPT_LEAVE(0xE08, 0x27D, 0x1F9, 1),
269#elif VERSION_EU || VERSION_JP
270 SCRIPT_LEAVE(0xE09, 0x27D, 0x1F9, 1),
271#endif
273};
275 SCRIPT_PLACE(2, 0x27D, 0x1F9),
276 SCRIPT_POSE(2, 1, 0),
277 SCRIPT_WAIT(0x78),
278 SCRIPT_TALK(0, 1, 2, 0),
279 SCRIPT_POSE(2, 7, 0),
281 SCRIPT_POSE(2, 1, 0),
282 SCRIPT_WAIT(0x1E),
283 SCRIPT_POSE(2, 1, 3),
284 SCRIPT_WAIT(0x1E),
286};
288 SCRIPT_WALK(2, 0x17D, 0x119, 3),
291 SCRIPT_POSE(2, 1, 3),
293 SCRIPT_WAIT(0x1E),
294 SCRIPT_COMMAND(0x323, 0x325, 2),
295 SCRIPT_WAIT(0x5A),
296 SCRIPT_COMMAND(0x323, 0x326, 2),
297 SCRIPT_WAIT(0x1E),
298 SCRIPT_POSE(2, 1, 1),
299 SCRIPT_WAIT(0x1E),
300 SCRIPT_POSE(2, 1, 2),
301 SCRIPT_WAIT(0x1E),
302 SCRIPT_POSE(2, 1, 1),
303 SCRIPT_WAIT(0x1E),
304 SCRIPT_POSE(2, 1, 0),
305 SCRIPT_WAIT(0x1E),
306 SCRIPT_POSE(2, 1, 1),
307 SCRIPT_WAIT(0x1E),
308 SCRIPT_POSE(2, 1, 0),
309 SCRIPT_WAIT(0x1E),
310 SCRIPT_COMMAND(0x323, 0x325, 2),
311 SCRIPT_WAIT(0xB4),
312 SCRIPT_COMMAND(0x323, 0x326, 2),
313 SCRIPT_WAIT(0x1E),
314 SCRIPT_POSE(2, 1, 3),
315 SCRIPT_WAIT(0x1E),
316 SCRIPT_TALK(0, 1, 2, 2),
317 SCRIPT_POSE(2, 7, 3),
320 SCRIPT_POSE(2, 1, 3),
321 SCRIPT_WAIT(0x1E),
323};
325 { 60, 0, 0x318, 166 },
326 { 60, 0, 0x3F8, 0x116 },
327 { 60, 0, 168, 0x26E },
328 { 60, 0, 0x188, 0x2DE },
329 { 44, 0, 0x3F8, 0x2C6 },
330};
332 { 0, 6 }, { 1, 6 }, { 2, 68 }, { 1, 4 },
333 { 0, 4 }, { 255, 0 },
334};
336 { 0x12C, 18 }, { 1, 6 }, { 2, 6 }, { 3, 6 },
337 { 4, 6 }, { 5, 4 }, { 6, 4 }, { 7, 4 },
338 { 5, 4 }, { 6, 4 }, { 7, 4 }, { 5, 4 },
339 { 6, 4 }, { 7, 4 }, { 5, 4 }, { 6, 4 },
340 { 7, 4 }, { 4, 4 }, { 3, 4 }, { 2, 4 },
341 { 1, 4 }, { 255, 0x3E7 },
342};
343AreaBattle area0Battle0 = { 0, 0, MUSIC(1, 0) };
344AreaBattle area0Battle1 = { 0, 0, MUSIC(1, 0) };
345AreaBattle area0Battle2 = { 0, 0, MUSIC(1, 0) };
346AreaBattle area0Battle3 = { 0, 0, MUSIC(1, 0) };
347AreaBattle area0Battle4 = { 0, 0, MUSIC(1, 0) };
348AreaBattle area0Battle5 = { 0, 0, MUSIC(1, 0) };
349AreaBattle area0Battle6 = { 0, 0, MUSIC(1, 0) };
350AreaBattle area0Battle7 = { 0, 0, MUSIC(1, 0) };
356AreaBattle area1Battle0 = { 0, 0, MUSIC(1, 0) };
357AreaBattle area1Battle1 = { 0, 0, MUSIC(1, 0) };
358AreaBattle area1Battle2 = { 0, 0, MUSIC(1, 0) };
359AreaBattle area1Battle3 = { 0, 0, MUSIC(1, 0) };
360AreaBattle area1Battle4 = { 0, 0, MUSIC(1, 0) };
361AreaBattle area1Battle5 = { 0, 0, MUSIC(1, 0) };
362AreaBattle area1Battle6 = { 0, 0, MUSIC(1, 0) };
363AreaBattle area1Battle7 = { 0, 0, MUSIC(1, 0) };
369AreaBattle area2Battle0 = { 0, 0, MUSIC(1, 0) };
370AreaBattle area2Battle1 = { 0, 0, MUSIC(1, 0) };
371AreaBattle area2Battle2 = { 0, 0, MUSIC(1, 0) };
372AreaBattle area2Battle3 = { 0, 0, MUSIC(1, 0) };
373AreaBattle area2Battle4 = { 0, 0, MUSIC(1, 0) };
374AreaBattle area2Battle5 = { 0, 0, MUSIC(1, 0) };
375AreaBattle area2Battle6 = { 0, 0, MUSIC(1, 0) };
376AreaBattle area2Battle7 = { 0, 0, MUSIC(1, 0) };
384AreaBattle area3Battle2 = { 0, 0, MUSIC(1, 0) };
385AreaBattle area3Battle3 = { 0, 0, MUSIC(1, 0) };
386AreaBattle area3Battle4 = { 0, 0, MUSIC(1, 0) };
387AreaBattle area3Battle5 = { 0, 0, MUSIC(1, 0) };
388AreaBattle area3Battle6 = { 0, 0, MUSIC(1, 0) };
389AreaBattle area3Battle7 = { 0, 0, MUSIC(1, 0) };
399 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
400 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
401 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
402 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
403 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
404 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
405 { 0x1C0, 0x100, 0x1CD, 0x182, 0x234, 0x82, 0x160, 0x1FC },
406 { 0x1C0, 0x100, 0x1CD, 0x15A, 0x234, 0x5A, 0x170, 0x1FC },
407};
418FieldActorEntry actor0 = { actor0Conditions, NULL, 0xD0, 4, 302, 691, 7 };
419FieldActorEntry actor1 = { actor1Conditions, NULL, 0xD1, 5, 927, 235, 7 };
421 &actor0,
422 &actor1,
423 NULL,
424};
426 { 1, 0, 0xFF, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
427 { 1, 0, 0xF9, 6, 3, 0, 0, 0, 0, 0, 853, 643, 643, 0 },
428 { 1, 0, 0xFF, 6, 4, 0, 0, 0, 0, 0, 124, 99, 0, 0 },
429 { 1, 0, 0xD6, 6, 1, 0, 0, 0, 0, 0, 341, 195, 0, 0 },
430 { 1, 0, 0xD6, 6, 1, 0, 0, 0, 0, 0, 469, 307, 0, 0 },
431 { 1, 0, 0xD6, 6, 1, 0, 0, 0, 0, 0, 597, 419, 0, 0 },
432 { 1, 0, 0xD6, 6, 1, 0, 0, 0, 0, 0, 725, 531, 0, 0 },
433 { 1, 0, 0xFF, 6, 2, 0, 0, 0, 0, 0, 156, 617, 617, 0 },
434 { 1, 0, 0xFF, 6, 2, 0, 0, 0, 0, 0, 780, 161, 161, 0 },
435 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
436};
438 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x2DF, 0x310, 0x228, 3, 0, 0, 0 },
439 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH_OUT, 0x2DD, 0x504, 0x296, 5, 0, 0, 0 },
440 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH_OUT, 0x2DD, 0x344, 0xF6, 5, 0, 0, 0 },
441 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH_OUT, 0x2DD, 0x29C, 0x1AA, 1, 0, 0, 0 },
442 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH_OUT, 0x2DD, 0x3E4, 0x146, 5, 0, 0, 0 },
443 { { { FLAG_GUNSLINGER_2F_SOLDIER_SEEN, 0 }, { CODES_END, 0 } }, SLOT_EVENT, 0x3FC, 0, 0, 0, 0, 0, 0 },
444 { { { FLAG_MEGADEATH_TAUNT_SEEN, 0 }, { CODES_END, 0 } }, SLOT_EVENT, 0x406, 0, 0, 0, 0, 0, 0 },
445 { { { FLAG(0x40, 0x72), 0 }, { CODES_END, 0 } }, SLOT_EVENT, 0x410, 0, 0, 0, 0, 0, 0 },
446 { { { FLAG_MEGADEATH_MEETING_SEEN, 0 }, { CODES_END, 0 } }, SLOT_EVENT, 0x41A, 0, 0, 0, 0, 0, 0 },
447 { { { CODES_END, 0 }, { CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
448};
449void (*stageFuncs[])(void) = {
451};
453 { 1020, script1020, EVENT_TEXT(9), NULL, endEvent1020 },
454 { 1030, script1030, EVENT_TEXT(0xA), NULL, endEvent1030 },
455 { 1040, script1040, EVENT_TEXT(0xC), NULL, endEvent1040 },
456 { 1041, script1041, EVENT_TEXT(0xD), NULL, endEvent1041 },
457 { 1050, script1050, EVENT_TEXT(0xE), NULL, endEvent1050 },
458 { -1, NULL, 0, NULL, NULL },
459};
#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
StageEffect * createStageEffect(s32 x, s32 y, s32 frame)
Creates a StageEffect at (x, y) with its sprites' frames from FRAME.
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
#define TASK_RUN
Definition task.h:35
#define TASK_KILL
Definition task.h:37
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Definition task.h:34
#define TASK_DONE
Definition task.h:36
EventTask * FIELDSTG_startEvent(s32 id)
Starts the event id of FieldState.events: its script, start and end, and its text; the player stands ...
Definition event.c:250
The stage overlays (AAA/PRO/WSTAG###.PRO), loaded at 0x800A4CA4 on top of FIELDSTG.
#define EVENT_TEXT(n)
An entry of the stage's events' text file, for FieldEvent.text.
Definition stage.h:732
void updateStage()
The names every stage defines, each its own (config/<version>/stages/<stage>.txt).
#define 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_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 FIELD_TASK_LAUNCHER
a stage's launchers (FIELDSTG_runLaunch)
Definition field_map.h:32
#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_LAUNCH_OUT
the same, then leaves for mode arg
Definition field_map.h:268
#define SLOT_EXIT
The kinds of StageSlot (type).
Definition field_map.h:255
#define SCRIPT_POSE(id, set, dir)
Actor.setPose: its animation set, facing dir.
Definition field_map.h:158
#define FIELD_MAP_TRIGGERS
a cell's value: a direction (3 bits) and a StageSlot (5)
Definition field_map.h:88
#define SCRIPT_WAIT(frames)
Definition field_map.h:166
#define 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 EVENT_BATTLE(id)
action: FIELDSTG_battleFuncs.startEventBattle
Definition game_state.h:72
#define CODES_END
Definition game_state.h:83
#define PROGRESS(n)
GAME.progress is n.
Definition game_state.h:69
#define FLAG(group, id)
The codes of the (code, value) pairs that FLAGS_00 checks as conditions and applies as actions (event...
Definition game_state.h:68
#define MUSIC_BATTLE
BATL0000: the maps' random battles (AreaBattle, nearly all of them)
Definition sound.h:76
#define MUSIC(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_GUNSLINGER
BGM_0026: the Gunslinger (the Spy Satellite)
Definition sound.h:102
#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...
#define FLAG_GUNSLINGER_2F_SOLDIER_SEEN
wstag815 event 1020: a Metal Soldier sounds the intruder alert in Gunslinger 2F; set at its end,...
Definition story.h:1508
@ STORY_OPERATION_SIGMA
WSTAG311 (A.o.A Headquarters, Amaterasu City), event 982, after event 981, where the A....
Definition story.h:141
#define FLAG_MEGADEATH_MEETING_SEEN
wstag815 event 1050: Lord Megadeath, a life form born in the network, meets the player; set at its en...
Definition story.h:1514
#define FLAG_MEGADEATH_TAUNT_SEEN
wstag815 event 1030: Lord Megadeath taunts the player from beyond the Warp Gate; set at its end,...
Definition story.h:1511
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
Definition field_map.h:114
One frame of a sprite animation; frame 0xFF ends it (or loops it)
Definition gfx.h:296
A 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 startDir
and its direction
Definition field_map.h:457
s32 textFile
the stage's text file, for the talks
Definition field_map.h:461
union FieldState::@12 images
s32 music
SOUND.playSound's, or 0.
Definition field_map.h:460
void *(* load)(u32 file)
Definition file.h:92
void *(* getEntry)(u32 fileAndIndex)
Definition file.h:96
void(* applyAction)(s32 code, s32 value)
Definition game_state.h:52
s32(* checkCondition)(u16 code, u16 value)
Definition game_state.h:53
struct Layer *(* getLayer)(s32 id)
Definition gfx.h:28
GfxFuncs funcs
Definition gfx.h:77
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
Definition gfx.h:128
void(* getScroll)()
Definition gfx.h:148
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(* setAltClut)()
(x, y)
Definition gfx.h:243
void(* setLayerId)()
(id, depth)
Definition gfx.h:244
void(* draw)()
(sheet, frame, x, y)
Definition gfx.h:246
void(* setTexture)()
(x, y)
Definition gfx.h:242
A sprite effect a stage creates at (x, y) with the given frame, by kind.
Definition stage.h:290
What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState....
Definition field_map.h:276
The task a stage starts (startStage), updated by its updateStage.
Definition stage.h:26
void(* nextState)(struct StageTask *task)
Definition stage.h:27
s32 state
Definition stage.h:27
void * owner
Definition stage.h:28
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
Definition field_map.h:208
Uploads TIM images to VRAM (initTimLoader); acts on TIM_LOADER.
Definition gfx.h:325
void(* setClutPos)()
(x, y)
Definition gfx.h:337
void(* setImagePos)()
(x, y)
Definition gfx.h:336
void(* loadArchive)()
(archive): each image 64 halfwords to the right
Definition gfx.h:338
Definition gfx.h:352
s32 y
Definition gfx.h:354
s32 x
Definition gfx.h:353
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
void initTimLoader(TimLoader *obj)
Clears a TIM loader, gives it its methods and binds it.
Definition tim_loader.c:119
u16 actor1Conditions[]
Definition wstag815.c:413
AreaBattle area2Battle7
Definition wstag815.c:376
FieldActorEntry actor0
Definition wstag815.c:418
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag815.c:449
AreaBattle area2Battle6
Definition wstag815.c:375
s16 script1041[]
Definition wstag815.c:274
AnimFrame effectClutFrames[]
Definition wstag815.c:331
void endEvent1020(void)
After event 1020, with Metal Soldier: starts the stage's event battle 0 and keeps it from playing aga...
Definition wstag815.c:115
AreaBattle area1Battle6
Definition wstag815.c:362
#define BG_FILE
Definition wstag815.c:18
AreaBattle area0Battle7
Definition wstag815.c:350
#define BG_ARCHIVE
The files of the background, which the versions number differently.
Definition wstag815.c:17
s16 script1020[]
Definition wstag815.c:177
void endEvent1040(void)
After event 1040, with the player: keeps it from playing again.
Definition wstag815.c:130
AreaBattle area3Battle4
Definition wstag815.c:386
AreaBattle area3Battle3
Definition wstag815.c:385
AreaBattle area0Battle1
Definition wstag815.c:344
AreaBattle area2Battle0
Definition wstag815.c:369
FieldActorEntry * stageActors[]
Definition wstag815.c:420
AreaBattle area1Battle2
Definition wstag815.c:358
s16 script1040[]
Definition wstag815.c:221
AreaBattle area3Battle0
Definition wstag815.c:382
AreaBattle area0Battle6
Definition wstag815.c:349
AreaBattle area3Battle2
Definition wstag815.c:384
AreaBattle area3Battle1
Definition wstag815.c:383
AreaBattle area0Battle3
Definition wstag815.c:346
AreaBattle area3Battle6
Definition wstag815.c:388
ActorImage stageImages[]
Definition wstag815.c:398
void setupStage(void)
Sets the stage up: its map, actors, battles and events, playing BGM_0026.
Definition wstag815.c:158
AnimFrame effectFrames[]
Definition wstag815.c:335
AreaBattle area2Battle4
Definition wstag815.c:373
void drawBackground(StageTask *task)
Draws the two background images (file BG_ARCHIVE) scrolled at 2/3 of the layer's scroll.
Definition wstag815.c:23
StageTask * startStage(void *owner)
Creates the stage task (id 0x17) and calls the first function of its table.
Definition wstag815.c:97
StageEffectSpot updateStageSpots[]
Defined below, after the code that uses them.
Definition wstag815.c:324
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag815.c:425
BattleList area3Battles
Definition wstag815.c:390
void endEvent1030(void)
After event 1030, with Metal Soldier: starts the stage's event battle 0 and keeps it from playing aga...
Definition wstag815.c:124
AreaBattle area3Battle5
Definition wstag815.c:387
AreaBattle area0Battle5
Definition wstag815.c:348
BattleList area1Battles
Definition wstag815.c:364
void * createBackground(void)
Creates the spy satellite's background (updateBackground)
Definition wstag815.c:67
#define BG_FILE2
Definition wstag815.c:19
BattleList area2Battles
Definition wstag815.c:377
AreaBattle area1Battle4
Definition wstag815.c:360
AreaBattle area2Battle2
Definition wstag815.c:371
AreaBattle area1Battle5
Definition wstag815.c:361
StageSlot stageSlots[]
Definition wstag815.c:437
AreaBattle area2Battle1
Definition wstag815.c:370
AreaBattle area1Battle3
Definition wstag815.c:359
s16 script1030[]
Definition wstag815.c:199
AreaBattle area1Battle0
Definition wstag815.c:356
FieldActorEntry actor1
Definition wstag815.c:419
AreaBattle area0Battle0
Definition wstag815.c:343
AreaBattle area0Battle2
Definition wstag815.c:345
#define STAGE_FILE
Definition wstag815.c:155
AreaBattle area2Battle5
Definition wstag815.c:374
AreaBattle area1Battle1
Definition wstag815.c:357
AreaBattle area2Battle3
Definition wstag815.c:372
void updateBackground(StageTask *task)
Loads the background images (files BG_FILE and BG_FILE2) to VRAM, then draws them every frame.
Definition wstag815.c:42
void endEvent1050(void)
After event 1050, with the player: starts the stage's event battle 1 and keeps it from playing again.
Definition wstag815.c:143
AreaBattle area0Battle4
Definition wstag815.c:347
void endEvent1041(void)
After event 1041, with the player: keeps it from playing again.
Definition wstag815.c:135
s16 script1050[]
Definition wstag815.c:287
#define STAGE_TEXT
Definition wstag815.c:153
AreaBattle area3Battle7
Definition wstag815.c:389
BattleList area0Battles
Definition wstag815.c:351
AreaBattle area1Battle7
Definition wstag815.c:363
FieldBattles stageBattles[]
Definition wstag815.c:395
FieldEvent stageEvents[]
Definition wstag815.c:452
u16 actor0Conditions[]
Definition wstag815.c:408