Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag555.c
Go to the documentation of this file.
1/*
2 * WSTAG555: Noise Desert, West Sector.
3 */
4
5#include "common.h"
6#include "field/stage.h"
7/* Defined below, after the code that uses them */
11
13
15
17
19#define STAGE_CHILDREN_SIZE 0x8
21
22/* After event 380, with Numemon: keeps it from playing again */
23void endEvent380(void) {
24 FLAGS_00.applyAction(FLAG(0x40, 0xC), 1);
25}
26
27#if VERSION_US || VERSION_JP
28#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_06)
29#define EVENT_TEXT_FILE (TEXT_EVENTS_500 - 1)
30#define STAGE_FILE 0x235
31#define STAGE_ARCHIVE 0x312
32#elif VERSION_EU
33#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_06)
34#define EVENT_TEXT_FILE (TEXT_EVENTS_500 - 1)
35#define STAGE_FILE 0x244
36#define STAGE_ARCHIVE 0x321
37#endif
38/* Sets the stage up: its map, actors, battles and events, playing the ambience ENV_0016 */
59
61 SCRIPT_FOLLOW(1, 2),
62 SCRIPT_WALK(2, 0xF6, 0x163, 3),
63 SCRIPT_PLACE(0x69, 0x140, 0xC8),
64 SCRIPT_POSE(0x69, 1, 1),
67 SCRIPT_WALK(0x69, 0xDB, 0xFA, 1),
68 SCRIPT_WAIT_WALK(0x69),
69 SCRIPT_FOLLOW(0, 0x69),
70 SCRIPT_COMMAND(0x323, 0x325, 0x69),
71 SCRIPT_WAIT(0x5A),
72 SCRIPT_COMMAND(0x323, 0x326, 0x69),
73 SCRIPT_WAIT(0x1E),
74 SCRIPT_POSE(0x69, 1, 0),
75 SCRIPT_WAIT(0x1E),
76 SCRIPT_FOLLOW(0, 2),
77 SCRIPT_WALK(0x69, 0xDB, 0x151, 7),
78 SCRIPT_WAIT_WALK(0x69),
79 SCRIPT_POSE(0x69, 1, 7),
80 SCRIPT_WAIT(0x1E),
81 SCRIPT_TALK(0, 1, 0x69, 2),
83 SCRIPT_WAIT(0x1E),
84 SCRIPT_TALK(0, 2, 2, 1),
85 SCRIPT_POSE(2, 7, 3),
87 SCRIPT_POSE(2, 1, 3),
88 SCRIPT_WAIT(0x1E),
89 SCRIPT_TALK(0, 3, 0x69, 2),
91 SCRIPT_WAIT(0x1E),
92 SCRIPT_TALK(0, 4, 2, 1),
93 SCRIPT_POSE(2, 7, 3),
95 SCRIPT_POSE(2, 1, 3),
96 SCRIPT_WAIT(0x1E),
97 SCRIPT_TALK(0, 5, 0x69, 0),
99 SCRIPT_WAIT(0x1E),
100 SCRIPT_POSE(0x69, 1, 1),
101 SCRIPT_WAIT(0x1E),
102 SCRIPT_TALK(0, 6, 2, 2),
103 SCRIPT_POSE(2, 7, 3),
105 SCRIPT_WALK(0x69, 0xC7, 0x15C, 1),
106 SCRIPT_WAIT_WALK(0x69),
107 SCRIPT_POSE(2, 1, 3),
108 SCRIPT_WALK(0x69, 0x10E, 0x180, 7),
109 SCRIPT_WAIT_WALK(0x69),
110 SCRIPT_POSE(2, 1, 7),
111 SCRIPT_WALK(0x69, 0x1A7, 0x1CB, 7),
112 SCRIPT_WAIT_WALK(0x69),
113 SCRIPT_TALK(0, 7, 2, 2),
114 SCRIPT_PLACE(0x69, 0, 0),
115 SCRIPT_POSE(0x69, 1, 0),
117 SCRIPT_WAIT(0x3C),
119};
121 { 50, 8 }, { 51, 8 }, { 52, 8 }, { 53, 8 },
122 { 54, 8 }, { 55, 8 }, { 56, 8 }, { 57, 8 },
123 { 58, 8 }, { 59, 8 }, { 60, 8 }, { 82, 160 },
124 { 255, 0 },
125};
127 { 61, 8 }, { 62, 8 }, { 63, 8 }, { 64, 8 },
128 { 65, 8 }, { 66, 8 }, { 67, 8 }, { 68, 8 },
129 { 69, 8 }, { 70, 8 }, { 71, 8 }, { 82, 160 },
130 { 255, 0 },
131};
133 { 72, 8 }, { 73, 8 }, { 74, 8 }, { 75, 8 },
134 { 76, 8 }, { 77, 8 }, { 78, 8 }, { 79, 8 },
135 { 80, 8 }, { 81, 8 }, { 82, 160 }, { 255, 0 },
136};
150AreaBattle area1Battle0 = { 0, 0, MUSIC(1, 0) };
151AreaBattle area1Battle1 = { 0, 0, MUSIC(1, 0) };
152AreaBattle area1Battle2 = { 0, 0, MUSIC(1, 0) };
153AreaBattle area1Battle3 = { 0, 0, MUSIC(1, 0) };
154AreaBattle area1Battle4 = { 0, 0, MUSIC(1, 0) };
155AreaBattle area1Battle5 = { 0, 0, MUSIC(1, 0) };
156AreaBattle area1Battle6 = { 0, 0, MUSIC(1, 0) };
157AreaBattle area1Battle7 = { 0, 0, MUSIC(1, 0) };
163AreaBattle area2Battle0 = { 0, 0, MUSIC(1, 0) };
164AreaBattle area2Battle1 = { 0, 0, MUSIC(1, 0) };
165AreaBattle area2Battle2 = { 0, 0, MUSIC(1, 0) };
166AreaBattle area2Battle3 = { 0, 0, MUSIC(1, 0) };
167AreaBattle area2Battle4 = { 0, 0, MUSIC(1, 0) };
168AreaBattle area2Battle5 = { 0, 0, MUSIC(1, 0) };
169AreaBattle area2Battle6 = { 0, 0, MUSIC(1, 0) };
170AreaBattle area2Battle7 = { 0, 0, MUSIC(1, 0) };
176AreaBattle area3Battle0 = { 0, 0, MUSIC(1, 0) };
177AreaBattle area3Battle1 = { 0, 0, MUSIC(1, 0) };
178AreaBattle area3Battle2 = { 0, 0, MUSIC(1, 0) };
179AreaBattle area3Battle3 = { 0, 0, MUSIC(1, 0) };
180AreaBattle area3Battle4 = { 0, 0, MUSIC(1, 0) };
181AreaBattle area3Battle5 = { 0, 0, MUSIC(1, 0) };
182AreaBattle area3Battle6 = { 0, 0, MUSIC(1, 0) };
183AreaBattle area3Battle7 = { 0, 0, MUSIC(1, 0) };
193 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
194 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
195 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
196 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
197 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
198 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
199 { 0x180, 0x100, 0x1B0, 0x180, 0x1C0, 0x80, 0x170, 0x1FF },
200};
204 &actor0,
205 NULL,
206};
208 { 1, 0, 0x80, 2, 6, 0, 0, 0, 0, 0, 874, 1273, 0, 0 },
209 { 1, 1, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 50, 721, 0, 0 },
210 { 1, 1, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 87, 297, 0, 0 },
211 { 1, 2, 0x40, 6, 0x3D, 0, 0, 0, 0, 0, 150, 1359, 0, 0 },
212 { 1, 1, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 185, 1233, 0, 0 },
213 { 1, 2, 0x40, 6, 0x3D, 0, 0, 0, 0, 0, 211, 917, 0, 0 },
214 { 1, 3, 0xC8, 6, 0x48, 0, 0, 0, 0, 0, 232, 991, 0, 0 },
215 { 1, 2, 0x40, 6, 0x3D, 0, 0, 0, 0, 0, 299, 296, 0, 0 },
216 { 1, 3, 0xC8, 6, 0x48, 0, 0, 0, 0, 0, 337, 292, 0, 0 },
217 { 1, 1, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 401, 938, 0, 0 },
218 { 1, 2, 0x40, 6, 0x3D, 0, 0, 0, 0, 0, 530, 1299, 0, 0 },
219 { 1, 1, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 710, 1019, 0, 0 },
220 { 1, 1, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 832, 395, 0, 0 },
221 { 1, 2, 0x40, 6, 0x3D, 0, 0, 0, 0, 0, 964, 526, 0, 0 },
222 { 1, 1, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 967, 699, 0, 0 },
223 { 1, 3, 0xC8, 6, 0x48, 0, 0, 0, 0, 0, 1223, 896, 0, 0 },
224 { 1, 2, 0x40, 6, 0x3D, 0, 0, 0, 0, 0, 1411, 668, 0, 0 },
225 { 1, 0, 0x80, 6, 7, 0, 0, 0, 0, 0, 856, 1221, 0, 0 },
226 { 1, 0, 0x40, 4, 0, 0, 0, 0, 0, 0, 506, 475, 544, 0 },
227 { 1, 0, 0x40, 4, 1, 0, 0, 0, 0, 0, 317, 423, 488, 0 },
228 { 1, 0, 0x40, 4, 2, 0, 0, 0, 0, 0, 225, 615, 666, 0 },
229 { 1, 0, 0x40, 4, 3, 0, 0, 0, 0, 0, 476, 647, 713, 0 },
230 { 1, 0, 0x40, 4, 4, 0, 0, 0, 0, 0, 592, 815, 880, 0 },
231 { 1, 0, 0x64, 4, 5, 0, 0, 0, 0, 0, 289, 127, 230, 0 },
232 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
233};
235 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x25D, 0xC8, 0x3BC, 5, 0, 0, 0 },
236 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x249, 0x7A, 0xEA, 5, 0, 0, 0 },
237 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x247, 0xB0, 0x90, 7, 0, 0, 0 },
238 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x257, 0x320, 0x88, 1, 0, 0, 0 },
239 { { { SPECIAL_STORY_SINCE_DE_KNOWLEDGE, 1 }, { CODES_END, 0 } }, SLOT_WARP1, 0x2E9, 0xB0, 0xF8, 7, 0, 0x1B, 1 },
240 { { { SPECIAL_STORY_SINCE_DE_KNOWLEDGE, 1 }, { CODES_END, 0 } }, SLOT_WARP1, 0x2E8, 0x240, 0xD0, 1, 0, 1, 2 },
241 { { { PROGRESS(STORY_DE_SINCERITY), 1 }, { FLAG(0x40, 0xC), 0 } }, SLOT_EVENT, 0x17C, 0, 0, 0, 0, 0, 0 },
242 { { { CODES_END, 0 }, { CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
243};
244void (*stageFuncs[])(void) = {
246};
248 { 380, script380, EVENT_TEXT(4), NULL, endEvent380 },
249 { -1, NULL, 0, NULL, NULL },
250};
#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
The stage overlays (AAA/PRO/WSTAG###.PRO), loaded at 0x800A4CA4 on top of FIELDSTG.
#define EVENT_TEXT(n)
An entry of the stage's events' text file, for FieldEvent.text.
Definition stage.h:732
#define 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_WARP1
a warp (FieldWarp at arg) with effect and cutscene 1
Definition field_map.h:263
#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 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 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_DESERT
ENV_0016: the West Sector's deserts and the Mirage Tower.
Definition sound.h:132
#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,...
@ STORY_DE_SINCERITY
WSTAG460 (Reliability Spot), event 370: the Qing Long Chief, asked for the Digi-Egg of Knowledge,...
Definition story.h:70
#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
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
void(* applyAction)(s32 code, s32 value)
Definition game_state.h:52
What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState....
Definition field_map.h:276
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 wstag555.c:170
FieldActorEntry actor0
Definition wstag555.c:202
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag555.c:244
AnimFrame updateTileAnimsFrames2[]
Definition wstag555.c:132
AreaBattle area2Battle6
Definition wstag555.c:169
s16 script380[]
Definition wstag555.c:60
AreaBattle area1Battle6
Definition wstag555.c:156
AreaBattle area0Battle7
Definition wstag555.c:144
AreaBattle area3Battle4
Definition wstag555.c:180
AreaBattle area3Battle3
Definition wstag555.c:179
AreaBattle area0Battle1
Definition wstag555.c:138
AreaBattle area2Battle0
Definition wstag555.c:163
FieldActorEntry * stageActors[]
Definition wstag555.c:203
AreaBattle area1Battle2
Definition wstag555.c:152
AreaBattle area3Battle0
Definition wstag555.c:176
AreaBattle area0Battle6
Definition wstag555.c:143
AreaBattle area3Battle2
Definition wstag555.c:178
AreaBattle area3Battle1
Definition wstag555.c:177
#define STAGE_ARCHIVE
Definition wstag555.c:36
AreaBattle area0Battle3
Definition wstag555.c:140
AreaBattle area3Battle6
Definition wstag555.c:182
AnimFrame updateTileAnimsFrames1[]
Definition wstag555.c:126
ActorImage stageImages[]
Definition wstag555.c:192
void setupStage(void)
Sets the stage up: its map, actors, battles and events, playing the ambience ENV_0016.
Definition wstag555.c:39
AreaBattle area2Battle4
Definition wstag555.c:167
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag555.c:207
BattleList area3Battles
Definition wstag555.c:184
AreaBattle area3Battle5
Definition wstag555.c:181
AreaBattle area0Battle5
Definition wstag555.c:142
BattleList area1Battles
Definition wstag555.c:158
BattleList area2Battles
Definition wstag555.c:171
AreaBattle area1Battle4
Definition wstag555.c:154
AreaBattle area2Battle2
Definition wstag555.c:165
AreaBattle area1Battle5
Definition wstag555.c:155
StageSlot stageSlots[]
Definition wstag555.c:234
AreaBattle area2Battle1
Definition wstag555.c:164
AreaBattle area1Battle3
Definition wstag555.c:153
void endEvent380(void)
After event 380, with Numemon: keeps it from playing again.
Definition wstag555.c:23
AreaBattle area1Battle0
Definition wstag555.c:150
AnimFrame updateTileAnimsFrames0[]
Defined below, after the code that uses them.
Definition wstag555.c:120
AreaBattle area0Battle0
Definition wstag555.c:137
AreaBattle area0Battle2
Definition wstag555.c:139
#define STAGE_FILE
Definition wstag555.c:35
AreaBattle area2Battle5
Definition wstag555.c:168
AreaBattle area1Battle1
Definition wstag555.c:151
AreaBattle area2Battle3
Definition wstag555.c:166
AreaBattle area0Battle4
Definition wstag555.c:141
#define STAGE_TEXT
Definition wstag555.c:33
AreaBattle area3Battle7
Definition wstag555.c:183
BattleList area0Battles
Definition wstag555.c:145
AreaBattle area1Battle7
Definition wstag555.c:157
FieldBattles stageBattles[]
Definition wstag555.c:189
FieldEvent stageEvents[]
Definition wstag555.c:247
u16 actor0Conditions[]
Definition wstag555.c:201