Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag575.c
Go to the documentation of this file.
1/*
2 * WSTAG575: Bullet Valley, West Sector.
3 */
4
5#include "common.h"
6#include "field/stage.h"
7
8/* Creates the event object of story progress 0x10 */
9void updateStage(StageTask *task, void **children) {
10 switch (task->state) {
11 case TASK_INIT:
12 default:
14 children[0] = FIELDSTG_startEvent(0x1A6);
15 }
16 task->nextState(task);
17 break;
18 case TASK_RUN:
19 case TASK_DONE:
20 case TASK_KILL:
21 break;
22 }
23}
24
25#define STAGE_CHILDREN_SIZE 4
27
28/* After event 422, with Numemon: keeps it from playing again */
32
33#if VERSION_US || VERSION_JP
34#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_06)
35#define EVENT_TEXT_FILE (TEXT_EVENTS_500 - 1)
36#define STAGE_FILE 0x471
37#elif VERSION_EU
38#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_06)
39#define EVENT_TEXT_FILE (TEXT_EVENTS_500 - 1)
40#define STAGE_FILE 0x481
41#endif
42/* Sets the stage up: its map, actors, battles and events, playing the ambience ENV_0017 */
63
65 SCRIPT_LOOK_AT(1, 0xD2, 0x1F1),
66 SCRIPT_PLACE(2, 0, 0),
67 SCRIPT_POSE(2, 1, 0),
68 SCRIPT_PLACE(0x69, 0x72, 0x1C1),
69 SCRIPT_POSE(0x69, 1, 7),
70 SCRIPT_WAIT(0x1E),
71 SCRIPT_WALK(0x69, 0xAA, 0x1DD, 7),
72 SCRIPT_WAIT_WALK(0x69),
73 SCRIPT_PLACE(2, 0x91, 0x1D0),
74 SCRIPT_POSE(2, 1, 7),
75 SCRIPT_POSE(0x69, 1, 5),
76 SCRIPT_WAIT(0x1E),
77 SCRIPT_WALK(2, 0xD2, 0x1F1, 7),
78 SCRIPT_WALK(0x69, 0xD2, 0x1C9, 1),
80 SCRIPT_FOLLOW(1, 2),
81 SCRIPT_WAIT(0x1E),
82 SCRIPT_POSE(2, 1, 3),
83 SCRIPT_WALK(0x69, 0xAF, 0x1DB, 7),
84 SCRIPT_WAIT_WALK(0x69),
85 SCRIPT_POSE(0x69, 1, 7),
86 SCRIPT_WAIT(0x1E),
87 SCRIPT_TALK(0, 1, 0x69, 0),
89 SCRIPT_WAIT(0x1E),
90 SCRIPT_TALK(0, 2, 2, 3),
91 SCRIPT_POSE(2, 7, 3),
93 SCRIPT_POSE(2, 1, 3),
94 SCRIPT_WAIT(0x1E),
95 SCRIPT_TALK(0, 3, 0x69, 0),
97 SCRIPT_WAIT(0x1E),
98 SCRIPT_TALK(0, 4, 2, 3),
99 SCRIPT_POSE(2, 7, 3),
101 SCRIPT_POSE(2, 1, 3),
102 SCRIPT_WAIT(0x1E),
103 SCRIPT_TALK(0, 5, 0x69, 0),
105 SCRIPT_WAIT(0x1E),
106 SCRIPT_TALK(0, 6, 2, 3),
107 SCRIPT_POSE(2, 7, 3),
109 SCRIPT_POSE(2, 1, 3),
110 SCRIPT_WAIT(0x1E),
111 SCRIPT_TALK(0, 7, 0x69, 0),
113 SCRIPT_WAIT(0x1E),
114 SCRIPT_WALK(0x69, 0x9F, 0x1D3, 7),
115 SCRIPT_WAIT_WALK(0x69),
116 SCRIPT_POSE(0x69, 1, 7),
117 SCRIPT_WAIT(0x1E),
118 SCRIPT_TALK(0, 8, 2, 3),
119 SCRIPT_POSE(2, 7, 3),
121 SCRIPT_POSE(2, 1, 3),
122 SCRIPT_WAIT(0x1E),
123 SCRIPT_POSE(2, 1, 7),
124 SCRIPT_WAIT(0x1E),
125 SCRIPT_TALK(0, 9, 2, 3),
127 SCRIPT_WAIT(0x3C),
129 /* after the end, the original's padding up to a word, which isn't zeros */
130#if VERSION_US
131 0x181,
132#elif VERSION_EU
133 0x6004,
134#elif VERSION_JP
135 0x6008,
136#endif
137};
151AreaBattle area1Battle0 = { 0, 0, MUSIC(1, 0) };
152AreaBattle area1Battle1 = { 0, 0, MUSIC(1, 0) };
153AreaBattle area1Battle2 = { 0, 0, MUSIC(1, 0) };
154AreaBattle area1Battle3 = { 0, 0, MUSIC(1, 0) };
155AreaBattle area1Battle4 = { 0, 0, MUSIC(1, 0) };
156AreaBattle area1Battle5 = { 0, 0, MUSIC(1, 0) };
157AreaBattle area1Battle6 = { 0, 0, MUSIC(1, 0) };
158AreaBattle area1Battle7 = { 0, 0, MUSIC(1, 0) };
164AreaBattle area2Battle0 = { 0, 0, MUSIC(1, 0) };
165AreaBattle area2Battle1 = { 0, 0, MUSIC(1, 0) };
166AreaBattle area2Battle2 = { 0, 0, MUSIC(1, 0) };
167AreaBattle area2Battle3 = { 0, 0, MUSIC(1, 0) };
168AreaBattle area2Battle4 = { 0, 0, MUSIC(1, 0) };
169AreaBattle area2Battle5 = { 0, 0, MUSIC(1, 0) };
170AreaBattle area2Battle6 = { 0, 0, MUSIC(1, 0) };
171AreaBattle area2Battle7 = { 0, 0, MUSIC(1, 0) };
177AreaBattle area3Battle0 = { 0, 0, MUSIC(1, 0) };
178AreaBattle area3Battle1 = { 0, 0, MUSIC(1, 0) };
179AreaBattle area3Battle2 = { 0, 0, MUSIC(1, 0) };
181AreaBattle area3Battle4 = { 0, 0, MUSIC(1, 0) };
182AreaBattle area3Battle5 = { 0, 0, MUSIC(1, 0) };
184AreaBattle area3Battle7 = { 0, 0, MUSIC(1, 0) };
194 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
195 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
196 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
197 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
198 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
199 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
200 { 0x140, 0x100, 0x172, 0x118, 0xC8, 0x18, 0x150, 0x1FF },
201};
203 { NULL, NULL, 0x310 },
204 { NULL, NULL, 0 },
205};
209 &actor0,
210 NULL,
211};
213 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 166, 265, 0, 0 },
214 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 186, 261, 0, 0 },
215 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 186, 277, 0, 0 },
216 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 195, 287, 0, 0 },
217 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 207, 278, 0, 0 },
218 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 208, 273, 0, 0 },
219 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 217, 281, 0, 0 },
220 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 223, 291, 0, 0 },
221 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 237, 301, 0, 0 },
222 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 244, 290, 0, 0 },
223 { 1, 0, 0x40, 2, 0x32, 2, 0, 9, 4, 0, 264, 305, 0, 0 },
224 { 1, 0, 0x40, 2, 0x33, 2, 0, 9, 4, 0, 532, 182, 0, 0 },
225 { 1, 0, 0x40, 2, 0x33, 2, 0, 9, 4, 0, 551, 182, 0, 0 },
226 { 1, 0, 0x40, 2, 0x33, 2, 0, 9, 4, 0, 553, 172, 0, 0 },
227 { 1, 0, 0x40, 2, 0x34, 2, 0, 9, 4, 0, 496, 200, 0, 0 },
228 { 1, 0, 0x40, 2, 0x34, 2, 0, 9, 4, 0, 520, 201, 0, 0 },
229 { 1, 0, 0x40, 2, 0x34, 2, 0, 9, 4, 0, 526, 192, 0, 0 },
230 { 1, 0, 0x40, 2, 6, 1, 6, 0xD, 4, 0, 490, 26, 0, 0 },
231 { 1, 0, 0x40, 2, 6, 1, 6, 0xD, 4, 0, 528, 45, 0, 0 },
232 { 1, 0, 0x40, 2, 6, 1, 6, 0xD, 4, 0, 567, 64, 0, 0 },
233 { 1, 0, 0x64, 2, 0xE, 0, 0, 0, 0, 0, 698, 491, 0, 0 },
234 { 1, 0, 0x40, 6, 0x33, 2, 0, 9, 4, 0, 418, 122, 0, 0 },
235 { 1, 0, 0x40, 6, 0x33, 2, 0, 9, 4, 0, 421, 128, 0, 0 },
236 { 1, 0, 0x40, 6, 0x33, 2, 0, 9, 4, 0, 434, 112, 0, 0 },
237 { 1, 0, 0x40, 6, 0x33, 2, 0, 9, 4, 0, 450, 120, 0, 0 },
238 { 1, 0, 0x40, 6, 0x34, 2, 0, 9, 4, 0, 384, 141, 0, 0 },
239 { 1, 0, 0x40, 6, 0x34, 2, 0, 9, 4, 0, 391, 147, 0, 0 },
240 { 1, 0, 0x40, 6, 0x34, 2, 0, 9, 4, 0, 392, 125, 0, 0 },
241 { 1, 0, 0x40, 6, 0x34, 2, 0, 9, 4, 0, 414, 137, 0, 0 },
242 { 1, 0, 0x73, 4, 0, 0, 0, 0, 0, 0, 349, 733, 824, 0 },
243 { 1, 0, 0x40, 4, 1, 0, 0, 0, 0, 0, 444, 766, 777, 0 },
244 { 1, 0, 0x40, 4, 2, 0, 0, 0, 0, 0, 310, 576, 599, 0 },
245 { 1, 0, 0x40, 4, 3, 0, 0, 0, 0, 0, 487, 596, 610, 0 },
246 { 1, 0, 0x40, 4, 4, 0, 0, 0, 0, 0, 592, 118, 160, 0 },
247 { 1, 0, 0x40, 4, 5, 0, 0, 0, 0, 0, 103, 411, 477, 0 },
248 { 1, 0xFF, 0x64, 4, 0x38, 0, 0, 0, 0, 0, 336, 535, 535, 0 },
249 { 1, 0xFF, 0x64, 4, 0x38, 0, 0, 0, 0, 0, 384, 559, 559, 0 },
250 { 1, 0xFF, 0x64, 4, 0x38, 0, 0, 0, 0, 0, 576, 895, 895, 0 },
251 { 1, 0xFF, 0x64, 4, 0x38, 0, 0, 0, 0, 0, 636, 800, 800, 0 },
252 { 1, 0xFF, 0x64, 4, 0x38, 0, 0, 0, 0, 0, 673, 767, 767, 0 },
253 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
254};
256 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x24A, 0x5D8, 0x104, 1, 0, 0, 0 },
257 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x24D, 0x88, 0x3F4, 5, 0, 0, 0 },
258 { { { SPECIAL_STORY_SINCE_DE_KNOWLEDGE, 1 }, { CODES_END, 0 } }, SLOT_WARP1, 0x2E8, 0x240, 0xD0, 1, 0, 0x10, 1 },
259 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_DROP, 8, 0, 0, 0, 0, 0, 0 },
260 { { { CODES_END, 0 }, { CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
261};
262void (*stageFuncs[])(void) = {
264};
266 { 422, script422, EVENT_TEXT(5), NULL, endEvent422 },
267 { -1, NULL, 0, NULL, NULL },
268};
#define NULL
Definition common.h:17
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 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 SLOT_WARP1
a warp (FieldWarp at arg) with effect and cutscene 1
Definition field_map.h:263
#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 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 SCRIPT_PLACE(id, x, y)
puts a character at (x, y)
Definition field_map.h:157
#define SLOT_DROP
Definition field_map.h:258
#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 PROGRESS(n)
GAME.progress is n.
Definition game_state.h:69
#define MUSIC_BATTLE
BATL0000: the maps' random battles (AreaBattle, nearly all of them)
Definition sound.h:76
#define MUSIC_DUM_DUM_FACTORY
ENV_0017: Bullet Valley, the Dum Dum Factory, its Duct Rooms and Operation Room.
Definition sound.h:133
#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,...
#define FLAG_NUMEMON_BULLET_VALLEY_SEEN
wstag575 event 422: the player finds Numemon in Bullet Valley, who has nothing to tell; set at its en...
Definition story.h:1556
@ STORY_NUMEMON_FOUND
WSTAG685 (Underground Cave, Byakko City), event 413: the rock blocking the hole is Numemon.
Definition story.h:73
#define SPECIAL_STORY_SINCE_DE_KNOWLEDGE
GAME.progress is STORY_DE_KNOWLEDGE or later (PROGRESS_RANGES[0xD], to 0x63)
Definition story.h:1902
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
Definition field_map.h:114
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
What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState....
Definition field_map.h:276
The task a stage starts (startStage), updated by its updateStage.
Definition stage.h:26
void(* nextState)(struct StageTask *task)
Definition stage.h:27
s32 state
Definition stage.h:27
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
Definition field_map.h:208
Definition gfx.h:352
AreaBattle area2Battle7
Definition wstag575.c:171
FieldActorEntry actor0
Definition wstag575.c:207
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag575.c:262
AreaBattle area2Battle6
Definition wstag575.c:170
AreaBattle area1Battle6
Definition wstag575.c:157
AreaBattle area0Battle7
Definition wstag575.c:145
AreaBattle area3Battle4
Definition wstag575.c:181
AreaBattle area3Battle3
Definition wstag575.c:180
AreaBattle area0Battle1
Definition wstag575.c:139
AreaBattle area2Battle0
Definition wstag575.c:164
FieldActorEntry * stageActors[]
Definition wstag575.c:208
AreaBattle area1Battle2
Definition wstag575.c:153
AreaBattle area3Battle0
Definition wstag575.c:177
s16 script422[]
Definition wstag575.c:64
AreaBattle area0Battle6
Definition wstag575.c:144
AreaBattle area3Battle2
Definition wstag575.c:179
FieldTalk actor0Talks[]
Definition wstag575.c:202
AreaBattle area3Battle1
Definition wstag575.c:178
AreaBattle area0Battle3
Definition wstag575.c:141
AreaBattle area3Battle6
Definition wstag575.c:183
ActorImage stageImages[]
Definition wstag575.c:193
void setupStage(void)
Sets the stage up: its map, actors, battles and events, playing the ambience ENV_0017.
Definition wstag575.c:43
AreaBattle area2Battle4
Definition wstag575.c:168
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag575.c:212
BattleList area3Battles
Definition wstag575.c:185
AreaBattle area3Battle5
Definition wstag575.c:182
AreaBattle area0Battle5
Definition wstag575.c:143
BattleList area1Battles
Definition wstag575.c:159
BattleList area2Battles
Definition wstag575.c:172
AreaBattle area1Battle4
Definition wstag575.c:155
AreaBattle area2Battle2
Definition wstag575.c:166
AreaBattle area1Battle5
Definition wstag575.c:156
StageSlot stageSlots[]
Definition wstag575.c:255
AreaBattle area2Battle1
Definition wstag575.c:165
AreaBattle area1Battle3
Definition wstag575.c:154
AreaBattle area1Battle0
Definition wstag575.c:151
AreaBattle area0Battle0
Definition wstag575.c:138
AreaBattle area0Battle2
Definition wstag575.c:140
#define STAGE_FILE
Definition wstag575.c:40
AreaBattle area2Battle5
Definition wstag575.c:169
void endEvent422(void)
After event 422, with Numemon: keeps it from playing again.
Definition wstag575.c:29
AreaBattle area1Battle1
Definition wstag575.c:152
AreaBattle area2Battle3
Definition wstag575.c:167
AreaBattle area0Battle4
Definition wstag575.c:142
#define STAGE_TEXT
Definition wstag575.c:38
AreaBattle area3Battle7
Definition wstag575.c:184
BattleList area0Battles
Definition wstag575.c:146
AreaBattle area1Battle7
Definition wstag575.c:158
FieldBattles stageBattles[]
Definition wstag575.c:190
FieldEvent stageEvents[]
Definition wstag575.c:265
u16 actor0Conditions[]
Definition wstag575.c:206