Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag746.c
Go to the documentation of this file.
1/*
2 * WSTAG746: Dark Dungeon, North Sector. On the Amaterasu server; its Asuka
3 * server twin is WSTAG745.
4 */
5
6#include "common.h"
7#include "field/stage.h"
8/* Defined below, after the code that uses them */
10
12
13/* Creates the darkness task (id 0x19) */
14void *createDarkness(void) {
15 return createTaskWithId(updateDarkness, sizeof(StageTask), 0, 0x19);
16}
17
18/* Lifts the darkness (TASK_RUN) */
19void *startEvent8000(void) {
20 StageTask *task = TASK_REGISTRY.funcs.find(0x19, -1, -1);
21
22 if (task != NULL) {
23 if (task->state != TASK_RUN) {
25 }
26 task->setState(task, TASK_RUN);
27 task->key1 = 0;
28 }
29 return NULL;
30}
31
32/* Brings the darkness back (TASK_DONE) */
33void *startEvent8001(void) {
34 StageTask *task = TASK_REGISTRY.funcs.find(0x19, -1, -1);
35
36 if (task != NULL) {
37 if (task->state != TASK_DONE) {
39 }
40 task->setState(task, TASK_DONE);
41 task->key1 = 0;
42 }
43 return NULL;
44}
45
46/* Lifts the darkness and starts its countdown back (TASK_RUN, key1 = 1) */
47void *startEvent8002(void) {
48 StageTask *task = TASK_REGISTRY.funcs.find(0x19, -1, -1);
49
50 if (task != NULL) {
51 if (task->state != TASK_RUN) {
53 }
54 task->setState(task, TASK_RUN);
55 task->key1 = 1;
56 }
57 return NULL;
58}
59
60/* Creates the stage's twenty effects, another object and the event object of flags 0x4086/0x4087 */
61void updateStage(StageTask *task, void **children) {
62 s32 i;
63
64 switch (task->state) {
65 case TASK_INIT:
66 default:
67 children[20] = createDarkness();
68 for (i = 0; i < 20; i++) {
69 if (updateStageSpots[i].kind == 0) {
70 children[i] = createStageEffect(updateStageSpots[i].x, updateStageSpots[i].y, updateStageSpots[i].frame);
71 }
72 }
74 children[21] = FIELDSTG_startEvent(0x512);
75 }
76 task->nextState(task);
77 break;
78 case TASK_RUN:
79 case TASK_DONE:
80 case TASK_KILL:
81 break;
82 }
83}
84
85#define STAGE_CHILDREN_SIZE 0x58
92
93/*
94 * After event 1297, with Dark Master: starts the stage's event battle 0 and
95 * keeps it from playing again
96 */
101
102/*
103 * After event 1298, with Dark Master: gives the player the EXP Adapter and
104 * keeps it from playing again
105 */
106void endEvent1298(void) {
107 FLAGS_00.applyAction(FLAG(0x40, 0x87), 1);
108 FLAGS_00.applyAction(ITEM(7, 0x141), 1);
109}
110
111#if VERSION_US || VERSION_JP
112#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_07)
113#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
114#define STAGE_FILE 0x6C0
115#elif VERSION_EU
116#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_07)
117#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
118#define STAGE_FILE 0x6CF
119#endif
120/*
121 * Sets the stage up: its map, actors, battles and events, playing BGM_0023,
122 * with the Dark Dungeon's darkness off when the player comes in
123 */
147
149 SCRIPT_FOLLOW(1, 2),
150 SCRIPT_WALK(2, 0x103, 0xDA, 3),
151 SCRIPT_PLACE(0xCD, 0xF0, 0xD1),
152 SCRIPT_POSE(0xCD, 1, 7),
155 SCRIPT_POSE(2, 1, 3),
156 SCRIPT_WAIT(0x1E),
157 SCRIPT_TALK(0, 1, 0xCD, 2),
159 SCRIPT_WAIT(0x1E),
160 SCRIPT_TALK(0, 2, 2, 1),
161 SCRIPT_POSE(2, 7, 3),
163 SCRIPT_POSE(2, 1, 3),
164 SCRIPT_WAIT(0x1E),
165 SCRIPT_TALK(0, 3, 0xCD, 2),
167 SCRIPT_TALK(0, 4, 2, 1),
168 SCRIPT_POSE(2, 7, 3),
170 SCRIPT_POSE(2, 1, 3),
171 SCRIPT_WAIT(0x1E),
173 /* after the end, the original's padding up to a word, which isn't zeros */
174#if VERSION_JP
175 0x4,
176#endif
177};
179 SCRIPT_FOLLOW(1, 0xCD),
180 SCRIPT_PLACE(2, 0x103, 0xDA),
181 SCRIPT_POSE(2, 1, 3),
182 SCRIPT_PLACE(0xCD, 0xF0, 0xD1),
183 SCRIPT_POSE(0xCD, 1, 7),
184 SCRIPT_WAIT(0x78),
185 SCRIPT_TALK(0, 1, 0xCD, 2),
188 SCRIPT_WAIT(0x3C),
189 SCRIPT_TALK(0, 2, 2, 0),
190 SCRIPT_POSE(2, 7, 3),
192 SCRIPT_POSE(2, 1, 3),
193 SCRIPT_WAIT(0x1E),
194 SCRIPT_TALK(0, 3, 0xCD, 0),
196 SCRIPT_WAIT(0x1E),
197 SCRIPT_FOLLOW(1, 2),
198 SCRIPT_WAIT(0x1E),
200 /* after the end, the original's padding up to a word, which isn't zeros */
201#if VERSION_EU
202 0x2,
203#endif
204};
206 { 68, 0, 0x11B, 0x154 },
207 { 68, 0, 0x13C, 0x1C4 },
208 { 68, 0, 0x15C, 0x1F4 },
209 { 68, 0, 0x15C, 0x234 },
210 { 68, 0, 0x1BC, 0x104 },
211 { 68, 0, 0x1BC, 0x184 },
212 { 68, 0, 0x1DC, 0x1B4 },
213 { 68, 0, 0x1DC, 0x2B4 },
214 { 68, 0, 0x1FC, 0x224 },
215 { 68, 0, 0x1FC, 0x264 },
216 { 68, 0, 0x23C, 0x144 },
217 { 68, 0, 0x25C, 0x1B4 },
218 { 68, 0, 0x27C, 0x224 },
219 { 68, 0, 0x29C, 0x294 },
220 { 68, 0, 0x2BC, 0x2C4 },
221 { 68, 0, 0x2DC, 0x234 },
222 { 68, 0, 0x2FC, 0x1A4 },
223 { 68, 0, 0x31C, 0x1D4 },
224 { 68, 0, 0x31C, 0x214 },
225 { 20, 0, 0x3AC, 0x2A4 },
226};
228 { 0, 6 }, { 1, 6 }, { 2, 68 }, { 1, 4 },
229 { 0, 4 }, { 255, 0 },
230};
232 { 0x12C, 18 }, { 1, 6 }, { 2, 6 }, { 3, 6 },
233 { 4, 6 }, { 5, 4 }, { 6, 4 }, { 7, 4 },
234 { 5, 4 }, { 6, 4 }, { 7, 4 }, { 5, 4 },
235 { 6, 4 }, { 7, 4 }, { 5, 4 }, { 6, 4 },
236 { 7, 4 }, { 4, 4 }, { 3, 4 }, { 2, 4 },
237 { 1, 4 }, { 255, 0x3E7 },
238};
252AreaBattle area1Battle0 = { 0, 0, MUSIC(1, 0) };
253AreaBattle area1Battle1 = { 0, 0, MUSIC(1, 0) };
254AreaBattle area1Battle2 = { 0, 0, MUSIC(1, 0) };
255AreaBattle area1Battle3 = { 0, 0, MUSIC(1, 0) };
256AreaBattle area1Battle4 = { 0, 0, MUSIC(1, 0) };
257AreaBattle area1Battle5 = { 0, 0, MUSIC(1, 0) };
258AreaBattle area1Battle6 = { 0, 0, MUSIC(1, 0) };
259AreaBattle area1Battle7 = { 0, 0, MUSIC(1, 0) };
265AreaBattle area2Battle0 = { 0, 0, MUSIC(1, 0) };
266AreaBattle area2Battle1 = { 0, 0, MUSIC(1, 0) };
267AreaBattle area2Battle2 = { 0, 0, MUSIC(1, 0) };
268AreaBattle area2Battle3 = { 0, 0, MUSIC(1, 0) };
269AreaBattle area2Battle4 = { 0, 0, MUSIC(1, 0) };
270AreaBattle area2Battle5 = { 0, 0, MUSIC(1, 0) };
271AreaBattle area2Battle6 = { 0, 0, MUSIC(1, 0) };
272AreaBattle area2Battle7 = { 0, 0, MUSIC(1, 0) };
279AreaBattle area3Battle1 = { 0, 0, MUSIC(1, 0) };
280AreaBattle area3Battle2 = { 0, 0, MUSIC(1, 0) };
281AreaBattle area3Battle3 = { 0, 0, MUSIC(1, 0) };
282AreaBattle area3Battle4 = { 0, 0, MUSIC(1, 0) };
283AreaBattle area3Battle5 = { 0, 0, MUSIC(1, 0) };
284AreaBattle area3Battle6 = { 0, 0, MUSIC(1, 0) };
285AreaBattle area3Battle7 = { 0, 0, MUSIC(1, 0) };
295 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
296 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
297 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
298 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
299 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
300 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
301 { 0x140, 0x100, 0x178, 0x100, 0xE0, 0, 0x170, 0x1FB },
302 { 0x140, 0x100, 0x170, 0x180, 0xC0, 0x80, 0x150, 0x1FA },
303 { 0x140, 0x100, 0x140, 0x160, 0, 0x60, 0x160, 0x1FA },
304};
320 { NULL, actor0Talk0Actions, 0x18D },
321 { NULL, NULL, 0 },
322};
324 { NULL, NULL, 0x219 },
325 { NULL, NULL, 0 },
326};
328 { NULL, NULL, 0x219 },
329 { NULL, NULL, 0 },
330};
332 { actor3Talk0Conditions, NULL, 0x216 },
333 { actor3Talk1Conditions, NULL, 0x217 },
334 { actor3Talk2Conditions, NULL, 0x218 },
335 { actor3Talk3Conditions, NULL, 0x21A },
336 { NULL, NULL, 0 },
337};
339 { actor4Talk0Conditions, NULL, 0x216 },
340 { actor4Talk1Conditions, NULL, 0x217 },
341 { actor4Talk2Conditions, NULL, 0x218 },
342 { actor4Talk3Conditions, NULL, 0x21A },
343 { NULL, NULL, 0 },
344};
374 &actor0,
375 &actor1,
376 &actor2,
377 &actor3,
378 &actor4,
379 NULL,
380};
382 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 208, 361, 0, 0 },
383 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 240, 473, 0, 0 },
384 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 368, 409, 0, 0 },
385 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 400, 521, 0, 0 },
386 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 432, 633, 0, 0 },
387 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 496, 345, 0, 0 },
388 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 528, 457, 0, 0 },
389 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 560, 569, 0, 0 },
390 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 592, 681, 0, 0 },
391 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 656, 393, 0, 0 },
392 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 688, 505, 0, 0 },
393 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 720, 617, 0, 0 },
394 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 752, 729, 0, 0 },
395 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 848, 553, 0, 0 },
396 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
397};
399 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x2D3, 0xD0, 0x33C, 5, 0, 0, 0 },
401 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EVENT, 0x1F40, 0, 0, 0, 0, 0, 0 },
402 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EVENT, 0x1F41, 0, 0, 0, 0, 0, 0 },
403 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EVENT, 0x1F42, 0, 0, 0, 0, 0, 0 },
404 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
405 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
406 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
407 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
408 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
409 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
410 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
411 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
412 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
413 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
414 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
415 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
416 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
417 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
418 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
419 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
420 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
421 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
422 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
423 { { { CODES_END, 0 }, { CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
424};
425void (*stageFuncs[])(void) = {
427};
429 { 1297, script1297, EVENT_TEXT(0x17), NULL, endEvent1297 },
430 { 1298, script1298, EVENT_TEXT(0x18), NULL, endEvent1298 },
431 { 8000, NULL, 0, startEvent8000, NULL },
432 { 8001, NULL, 0, startEvent8001, NULL },
433 { 8002, NULL, 0, startEvent8002, NULL },
434 { -1, NULL, 0, NULL, NULL },
435};
#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.
GameFlags FLAGS_00
The flag bitset FLAGS_00 and the event functions.
Definition events.c:701
GameState GAME
The save data, the game mode and the methods.
Definition state.c:64
#define TASK_RUN
Definition task.h:35
#define TASK_KILL
Definition task.h:37
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Definition task.h:34
#define TASK_DONE
Definition task.h:36
EventTask * FIELDSTG_startEvent(s32 id)
Starts the event id of FieldState.events: its script, start and end, and its text; the player stands ...
Definition event.c:250
The stage overlays (AAA/PRO/WSTAG###.PRO), loaded at 0x800A4CA4 on top of FIELDSTG.
#define EVENT_TEXT(n)
An entry of the stage's events' text file, for FieldEvent.text.
Definition stage.h:732
void updateStage()
The names every stage defines, each its own (config/<version>/stages/<stage>.txt).
#define 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 SLOT_LAUNCH
sends the player flying (FIELDSTG_launchActor)
Definition field_map.h:267
#define SCRIPT_COMMAND(id, command, arg)
the same word for a script command's id: FIELDSTG_setEventPose creates its task if none runs and hand...
Definition field_map.h:161
#define SCRIPT_FOLLOW(snap, id)
FIELDSTG_followWithCamera.
Definition field_map.h:171
#define FIELD_MAP_FLOOR0
Some of FieldMap's maps (files): those of the floors the player walks on come first,...
Definition field_map.h:85
#define FIELD_COMMAND_ICON3
its substate 3, with ITEM_GET
Definition field_map.h:44
#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
#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
TaskRegistry TASK_REGISTRY
Definition registry.c:122
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_DUNGEON
BGM_0023: the Ice, Fire and Dark Dungeons.
Definition sound.h:99
#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 SOUND_SWITCH02
Definition sound.h:51
#define MUSIC_BANK(music)
The sound bank of a music, which a stage loads for it (FieldState.soundBank)
Definition sound.h:148
#define MUSIC_BOSS_1
BOSS_001: the Digimon Arena's, the cities', the dungeons' and the A.o.A's boss battles.
Definition sound.h:109
FIELDSTG's start of the stage (StageEntry.init in FIELDSTG_stages): the stage's task,...
#define FLAG_DARK_MASTER_WIN_SEEN
wstag746 event 1297: Dark Master loses and gives the EXP Adaptor; set at its end, tested 0 to start i...
Definition story.h:1553
@ STORY_PRESIDENT_ARRESTED
WSTAG226 (Login Room, Amaterasu City), event 935, after the President of MAGAMI gives himself up (WST...
Definition story.h:136
@ STORY_AMATERASU_BRIDGE
WSTAG206 (Amaterasu Bridge), event 922: an Attacker holds the bridge.
Definition story.h:133
@ 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_JUNGLE_SOUND_TO_BLACK_ID_PASS
GAME.progress is from STORY_JUNGLE_SOUND to STORY_BLACK_ID_PASS (PROGRESS_RANGES[0x15])
Definition story.h:1926
#define SPECIAL_STORY_SINCE_KNIGHTMON_REPROGRAMMED
GAME.progress is STORY_KNIGHTMON_REPROGRAMMED or later (PROGRESS_RANGES[8], to 0x63)
Definition story.h:1887
#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_DARK_DUNGEON_HAZARD_ARMOR_FOUND
wstag746: chest that gives the Hazard Armor, "I got" text; its conditions test it 0
Definition story.h:439
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 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 clearTempFlags
Definition game_state.h:573
short(* playSound)(s32 id)
returns the voice of a key-on
Definition sound.h:187
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
s32 key1
Definition stage.h:27
void(* setState)(struct StageTask *task, 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 *(* find)(s32 id, s32 key1, s32 key2)
Definition task.h:18
TaskFuncs funcs
Definition task.h:76
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
void updateDarkness(StageTask *task)
The darkness: the screen drawn black (a white quad subtracted from it, blend mode 2) while in TASK_DO...
u16 actor1Conditions[]
Definition wstag746.c:346
u16 actor0Talk0Actions[]
Definition wstag746.c:305
AreaBattle area2Battle7
Definition wstag746.c:272
FieldActorEntry actor0
Definition wstag746.c:368
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag746.c:425
s16 script1298[]
Definition wstag746.c:178
FieldTalk actor2Talks[]
Definition wstag746.c:327
AreaBattle area2Battle6
Definition wstag746.c:271
u16 actor3Talk3Conditions[]
Definition wstag746.c:314
u16 actor4Talk3Conditions[]
Definition wstag746.c:318
void endEvent1297(void)
After event 1297, with Dark Master: starts the stage's event battle 0 and keeps it from playing again...
Definition wstag746.c:97
void * startEvent8001(void)
Brings the darkness back (TASK_DONE)
Definition wstag746.c:33
AnimFrame effectClutFrames[]
Definition wstag746.c:227
AreaBattle area1Battle6
Definition wstag746.c:258
AreaBattle area0Battle7
Definition wstag746.c:246
FieldActorEntry actor2
Definition wstag746.c:370
s16 script1297[]
Definition wstag746.c:148
u16 actor3Talk0Conditions[]
Definition wstag746.c:311
AreaBattle area3Battle4
Definition wstag746.c:282
AreaBattle area3Battle3
Definition wstag746.c:281
AreaBattle area0Battle1
Definition wstag746.c:240
AreaBattle area2Battle0
Definition wstag746.c:265
FieldActorEntry * stageActors[]
Definition wstag746.c:373
AreaBattle area1Battle2
Definition wstag746.c:254
void * startEvent8002(void)
Lifts the darkness and starts its countdown back (TASK_RUN, key1 = 1)
Definition wstag746.c:47
AreaBattle area3Battle0
Definition wstag746.c:278
u16 actor4Talk1Conditions[]
Definition wstag746.c:316
AreaBattle area0Battle6
Definition wstag746.c:245
FieldTalk actor1Talks[]
Definition wstag746.c:323
AreaBattle area3Battle2
Definition wstag746.c:280
FieldTalk actor0Talks[]
Definition wstag746.c:319
AreaBattle area3Battle1
Definition wstag746.c:279
AreaBattle area0Battle3
Definition wstag746.c:242
u16 actor3Talk2Conditions[]
Definition wstag746.c:313
u16 actor3Talk1Conditions[]
Definition wstag746.c:312
FieldTalk actor4Talks[]
Definition wstag746.c:338
u16 actor4Conditions[]
Definition wstag746.c:362
FieldActorEntry actor4
Definition wstag746.c:372
u16 actor3Conditions[]
Definition wstag746.c:356
AreaBattle area3Battle6
Definition wstag746.c:284
ActorImage stageImages[]
Definition wstag746.c:294
void setupStage(void)
Sets the stage up: its map, actors, battles and events, playing BGM_0023, with the Dark Dungeon's dar...
Definition wstag746.c:124
AnimFrame effectFrames[]
Definition wstag746.c:231
AreaBattle area2Battle4
Definition wstag746.c:269
u16 actor4Talk0Conditions[]
Definition wstag746.c:315
StageEffectSpot updateStageSpots[]
Defined below, after the code that uses them.
Definition wstag746.c:205
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag746.c:381
FieldTalk actor3Talks[]
Definition wstag746.c:331
BattleList area3Battles
Definition wstag746.c:286
AreaBattle area3Battle5
Definition wstag746.c:283
AreaBattle area0Battle5
Definition wstag746.c:244
BattleList area1Battles
Definition wstag746.c:260
BattleList area2Battles
Definition wstag746.c:273
AreaBattle area1Battle4
Definition wstag746.c:256
AreaBattle area2Battle2
Definition wstag746.c:267
AreaBattle area1Battle5
Definition wstag746.c:257
StageSlot stageSlots[]
Definition wstag746.c:398
AreaBattle area2Battle1
Definition wstag746.c:266
void * createDarkness(void)
Creates the darkness task (id 0x19)
Definition wstag746.c:14
AreaBattle area1Battle3
Definition wstag746.c:255
AreaBattle area1Battle0
Definition wstag746.c:252
FieldActorEntry actor1
Definition wstag746.c:369
void * startEvent8000(void)
Lifts the darkness (TASK_RUN)
Definition wstag746.c:19
AreaBattle area0Battle0
Definition wstag746.c:239
AreaBattle area0Battle2
Definition wstag746.c:241
#define STAGE_FILE
Definition wstag746.c:118
AreaBattle area2Battle5
Definition wstag746.c:270
void endEvent1298(void)
After event 1298, with Dark Master: gives the player the EXP Adapter and keeps it from playing again.
Definition wstag746.c:106
AreaBattle area1Battle1
Definition wstag746.c:253
AreaBattle area2Battle3
Definition wstag746.c:268
u16 actor2Conditions[]
Definition wstag746.c:351
AreaBattle area0Battle4
Definition wstag746.c:243
#define STAGE_TEXT
Definition wstag746.c:116
AreaBattle area3Battle7
Definition wstag746.c:285
BattleList area0Battles
Definition wstag746.c:247
AreaBattle area1Battle7
Definition wstag746.c:259
u16 actor4Talk2Conditions[]
Definition wstag746.c:317
FieldActorEntry actor3
Definition wstag746.c:371
FieldBattles stageBattles[]
Definition wstag746.c:291
FieldEvent stageEvents[]
Definition wstag746.c:428
u16 actor0Conditions[]
Definition wstag746.c:345