Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag655.c
Go to the documentation of this file.
1/*
2 * WSTAG655: Mirage Room, 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(0x1AF);
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/*
29 * After event 430, with Byakko Leader: lets event 431 start and starts the
30 * stage's event battle 0
31 */
36
37/*
38 * After event 431, with Byakko Leader: moves the story on to STORY_BYAKKO_BADGE
39 * and gives the player the Byakko Badge
40 */
41void endEvent431(void) {
43 FLAGS_00.applyAction(ITEM(0, 0xB), 1);
44}
45
46#if VERSION_US || VERSION_JP
47#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_02)
48#define EVENT_TEXT_FILE (TEXT_EVENTS_600 - 1)
49#define STAGE_FILE 0x487
50#elif VERSION_EU
51#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_02)
52#define EVENT_TEXT_FILE (TEXT_EVENTS_600 - 1)
53#define STAGE_FILE 0x497
54#endif
55/*
56 * Sets the stage up: its map, actors, battles and events, playing BGM_0020;
57 * BGM_0029 instead at story steps 0x27 to 0x28
58 */
82
84 SCRIPT_WALK(2, 0x183, 0x77, 5),
85 SCRIPT_PLACE(0x7A, 0x1A3, 0x67),
86 SCRIPT_POSE(0x7A, 1, 1),
89 SCRIPT_POSE(2, 1, 5),
90 SCRIPT_WAIT(0x1E),
91 SCRIPT_TALK(0, 1, 2, 1),
92 SCRIPT_POSE(2, 7, 5),
94 SCRIPT_POSE(2, 1, 5),
95 SCRIPT_COMMAND(0x323, 0x325, 0x7A),
96 SCRIPT_WAIT(0x3C),
97 SCRIPT_COMMAND(0x323, 0x326, 0x7A),
98 SCRIPT_WAIT(0x1E),
99 SCRIPT_TALK(0, 2, 0x7A, 2),
101 SCRIPT_WAIT(0x1E),
102 SCRIPT_TALK(0, 3, 2, 1),
103 SCRIPT_POSE(2, 7, 5),
105 SCRIPT_POSE(2, 1, 5),
106 SCRIPT_WAIT(0x1E),
107 SCRIPT_TALK(0, 4, 0x7A, 2),
109 SCRIPT_WAIT(0x1E),
110 SCRIPT_COMMAND(0x323, 0x325, 2),
111 SCRIPT_WAIT(0x3C),
112 SCRIPT_COMMAND(0x323, 0x326, 2),
113 SCRIPT_WAIT(0x1E),
114 SCRIPT_TALK(0, 5, 2, 1),
115 SCRIPT_POSE(2, 7, 5),
117 SCRIPT_POSE(2, 1, 5),
118 SCRIPT_WAIT(0x1E),
119 SCRIPT_TALK(0, 6, 0x7A, 2),
121 SCRIPT_WAIT(0x1E),
122 SCRIPT_TALK(0, 7, 2, 1),
124 SCRIPT_WAIT(0x1E),
126};
128 SCRIPT_PLACE(2, 0x183, 0x77),
129 SCRIPT_POSE(2, 1, 5),
130 SCRIPT_PLACE(0x7A, 0x1A3, 0x67),
131 SCRIPT_POSE(0x7A, 1, 1),
132 SCRIPT_WAIT(0x78),
133 SCRIPT_TALK(0, 1, 0x7A, 2),
135 SCRIPT_WAIT(0x1E),
136 SCRIPT_TALK(0, 2, 2, 1),
137 SCRIPT_POSE(2, 7, 5),
139 SCRIPT_POSE(2, 1, 5),
140 SCRIPT_WAIT(0x1E),
141 SCRIPT_TALK(0, 3, 0x7A, 2),
143 SCRIPT_WAIT(0x1E),
144 SCRIPT_TALK(0, 4, 2, 1),
145 SCRIPT_POSE(2, 7, 5),
147 SCRIPT_POSE(2, 1, 5),
148 SCRIPT_WAIT(0x1E),
149 SCRIPT_TALK(0, 5, 0x7A, 2),
151 SCRIPT_WAIT(0x1E),
152 SCRIPT_TALK(0, 6, 2, 1),
153 SCRIPT_POSE(2, 7, 5),
155 SCRIPT_POSE(2, 1, 5),
156 SCRIPT_WAIT(0x1E),
157 SCRIPT_POSE(2, 1, 1),
158 SCRIPT_WAIT(0x1E),
159 SCRIPT_TALK(0, 7, 0x7A, 2),
161 SCRIPT_COMMAND(0x323, 0x325, 2),
162 SCRIPT_WAIT(0x3C),
163 SCRIPT_COMMAND(0x323, 0x326, 2),
164 SCRIPT_WAIT(0x1E),
165 SCRIPT_POSE(2, 1, 5),
166 SCRIPT_WAIT(0x1E),
167 SCRIPT_TALK(0, 9, 0x7A, 2),
170 SCRIPT_WAIT(0x1E),
171 SCRIPT_TALK(0, 8, 2, 1),
172 SCRIPT_POSE(2, 7, 5),
174 SCRIPT_POSE(2, 1, 5),
175 SCRIPT_WAIT(0x1E),
176 SCRIPT_TALK(0, 0xA, 0x7A, 2),
178 SCRIPT_WAIT(0x1E),
179 SCRIPT_WALK(2, 0x103, 0xB7, 1),
180 SCRIPT_WAIT(6),
181 SCRIPT_LEAVE(0x25B, 0x126, 0x96, 1),
183};
184AreaBattle area0Battle0 = { 0, 0, MUSIC(1, 0) };
185AreaBattle area0Battle1 = { 0, 0, MUSIC(1, 0) };
186AreaBattle area0Battle2 = { 0, 0, MUSIC(1, 0) };
187AreaBattle area0Battle3 = { 0, 0, MUSIC(1, 0) };
188AreaBattle area0Battle4 = { 0, 0, MUSIC(1, 0) };
189AreaBattle area0Battle5 = { 0, 0, MUSIC(1, 0) };
190AreaBattle area0Battle6 = { 0, 0, MUSIC(1, 0) };
191AreaBattle area0Battle7 = { 0, 0, MUSIC(1, 0) };
197AreaBattle area1Battle0 = { 0, 0, MUSIC(1, 0) };
198AreaBattle area1Battle1 = { 0, 0, MUSIC(1, 0) };
199AreaBattle area1Battle2 = { 0, 0, MUSIC(1, 0) };
200AreaBattle area1Battle3 = { 0, 0, MUSIC(1, 0) };
201AreaBattle area1Battle4 = { 0, 0, MUSIC(1, 0) };
202AreaBattle area1Battle5 = { 0, 0, MUSIC(1, 0) };
203AreaBattle area1Battle6 = { 0, 0, MUSIC(1, 0) };
204AreaBattle area1Battle7 = { 0, 0, MUSIC(1, 0) };
210AreaBattle area2Battle0 = { 0, 0, MUSIC(1, 0) };
211AreaBattle area2Battle1 = { 0, 0, MUSIC(1, 0) };
212AreaBattle area2Battle2 = { 0, 0, MUSIC(1, 0) };
213AreaBattle area2Battle3 = { 0, 0, MUSIC(1, 0) };
214AreaBattle area2Battle4 = { 0, 0, MUSIC(1, 0) };
215AreaBattle area2Battle5 = { 0, 0, MUSIC(1, 0) };
216AreaBattle area2Battle6 = { 0, 0, MUSIC(1, 0) };
217AreaBattle area2Battle7 = { 0, 0, MUSIC(1, 0) };
224AreaBattle area3Battle1 = { 0, 0, MUSIC(1, 0) };
225AreaBattle area3Battle2 = { 0, 0, MUSIC(1, 0) };
226AreaBattle area3Battle3 = { 0, 0, MUSIC(1, 0) };
227AreaBattle area3Battle4 = { 0, 0, MUSIC(1, 0) };
228AreaBattle area3Battle5 = { 0, 0, MUSIC(1, 0) };
229AreaBattle area3Battle6 = { 0, 0, MUSIC(1, 0) };
230AreaBattle area3Battle7 = { 0, 0, MUSIC(1, 0) };
240 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
241 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
242 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
243 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
244 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
245 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
246 { 0x140, 0x100, 0x16C, 0x100, 0xB0, 0, 0x150, 0x1FF },
247};
252 { NULL, NULL, 0x19 },
253 { NULL, NULL, 0 },
254};
256 { NULL, NULL, 0x162 },
257 { NULL, NULL, 0 },
258};
260 { NULL, NULL, 0x164 },
261 { NULL, NULL, 0 },
262};
265 { actor3Talk1Conditions, NULL, 0x308 },
266 { NULL, NULL, 0 },
267};
269 { NULL, NULL, 0x162 },
270 { NULL, NULL, 0 },
271};
283 &actor0,
284 &actor1,
285 &actor2,
286 &actor3,
287 &actor4,
288 NULL,
289};
291 { 1, 0, 0xFF, 6, 0x32, 2, 0, 2, 0xC, 0, 318, 266, 0, 0 },
292 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
293};
295 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x25B, 0x126, 0x96, 1, 0, 0, 0 },
296 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_DOWN, 6, 0xEE, 0x138, 0, 0, 0, 0 },
297 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_UP, 6, 0xDC, 0x1A0, 0, 0, 0, 0 },
298 { { { CODES_END, 0 }, { CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
299};
300void (*stageFuncs[])(void) = {
302};
304 { 430, script430, EVENT_TEXT(0x11), NULL, endEvent430 },
305 { 431, script431, EVENT_TEXT(0x12), NULL, endEvent431 },
306 { -1, NULL, 0, NULL, NULL },
307};
#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 SLOT_CLIMB_UP
Definition field_map.h:256
#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 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_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_CLIMB_DOWN
Definition field_map.h:257
#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 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 START_EVENT(index)
action: FIELDSTG_startListedEvent
Definition game_state.h:81
#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 MUSIC_MIRAGE_HALL
BGM_0020: the Mirage Hall and Mirage Room.
Definition sound.h:96
#define MUSIC_CITY_CRISIS
BGM_0029: the cities and their streets instead of their music while the story is at a crisis (Knightm...
Definition sound.h:105
#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
#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,...
@ STORY_BYAKKO_BADGE
WSTAG655 (Mirage Room), event 431: HiAndromon guards the way to Numemon (the Byakko Badge)
Definition story.h:76
@ STORY_GUNSLINGER
WSTAG810 (Gunslinger 1F), event 1035.
Definition story.h:143
@ STORY_NUMEMON_FOUND
WSTAG685 (Underground Cave, Byakko City), event 413: the rock blocking the hole is Numemon.
Definition story.h:73
@ STORY_LISA_SAVED
WSTAG605 (Operation Room), event 511: the player saves Lisa from WaruMonzaemon (the Rusty Rifle)
Definition story.h:79
@ STORY_ASUKA_HEADQUARTERS
WSTAG310 (A.o.A Headquarters, Asuka City), event 961.
Definition story.h:138
@ STORY_DE_SINCERITY
WSTAG460 (Reliability Spot), event 370: the Qing Long Chief, asked for the Digi-Egg of Knowledge,...
Definition story.h:70
#define FLAG_BYAKKO_LEADER_APOLOGY_SEEN
wstag655 event 430: Byakko Leader apologizes for mistaking the player for the A.o....
Definition story.h:1414
#define SPECIAL_STORY_BYAKKO_LEADER_FOUGHT_TO_CONTROL_ROOM
GAME.progress is from STORY_BYAKKO_LEADER_FOUGHT to STORY_CONTROL_ROOM (PROGRESS_RANGES[0x10])
Definition story.h:1911
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
u16 actor1Conditions[]
Definition wstag655.c:273
AreaBattle area2Battle7
Definition wstag655.c:217
FieldActorEntry actor0
Definition wstag655.c:277
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag655.c:300
FieldTalk actor2Talks[]
Definition wstag655.c:259
AreaBattle area2Battle6
Definition wstag655.c:216
AreaBattle area1Battle6
Definition wstag655.c:203
AreaBattle area0Battle7
Definition wstag655.c:191
FieldActorEntry actor2
Definition wstag655.c:279
s16 script430[]
Definition wstag655.c:83
u16 actor3Talk0Conditions[]
Definition wstag655.c:248
AreaBattle area3Battle4
Definition wstag655.c:227
AreaBattle area3Battle3
Definition wstag655.c:226
AreaBattle area0Battle1
Definition wstag655.c:185
s16 script431[]
Definition wstag655.c:127
void endEvent431(void)
After event 431, with Byakko Leader: moves the story on to STORY_BYAKKO_BADGE and gives the player th...
Definition wstag655.c:41
AreaBattle area2Battle0
Definition wstag655.c:210
FieldActorEntry * stageActors[]
Definition wstag655.c:282
AreaBattle area1Battle2
Definition wstag655.c:199
AreaBattle area3Battle0
Definition wstag655.c:223
AreaBattle area0Battle6
Definition wstag655.c:190
FieldTalk actor1Talks[]
Definition wstag655.c:255
AreaBattle area3Battle2
Definition wstag655.c:225
FieldTalk actor0Talks[]
Definition wstag655.c:251
AreaBattle area3Battle1
Definition wstag655.c:224
AreaBattle area0Battle3
Definition wstag655.c:187
u16 actor3Talk1Conditions[]
Definition wstag655.c:250
FieldTalk actor4Talks[]
Definition wstag655.c:268
u16 actor4Conditions[]
Definition wstag655.c:276
FieldActorEntry actor4
Definition wstag655.c:281
u16 actor3Conditions[]
Definition wstag655.c:275
AreaBattle area3Battle6
Definition wstag655.c:229
ActorImage stageImages[]
Definition wstag655.c:239
void setupStage(void)
Sets the stage up: its map, actors, battles and events, playing BGM_0020; BGM_0029 instead at story s...
Definition wstag655.c:59
AreaBattle area2Battle4
Definition wstag655.c:214
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag655.c:290
FieldTalk actor3Talks[]
Definition wstag655.c:263
void endEvent430(void)
After event 430, with Byakko Leader: lets event 431 start and starts the stage's event battle 0.
Definition wstag655.c:32
BattleList area3Battles
Definition wstag655.c:231
AreaBattle area3Battle5
Definition wstag655.c:228
AreaBattle area0Battle5
Definition wstag655.c:189
BattleList area1Battles
Definition wstag655.c:205
BattleList area2Battles
Definition wstag655.c:218
AreaBattle area1Battle4
Definition wstag655.c:201
AreaBattle area2Battle2
Definition wstag655.c:212
AreaBattle area1Battle5
Definition wstag655.c:202
StageSlot stageSlots[]
Definition wstag655.c:294
AreaBattle area2Battle1
Definition wstag655.c:211
AreaBattle area1Battle3
Definition wstag655.c:200
AreaBattle area1Battle0
Definition wstag655.c:197
FieldActorEntry actor1
Definition wstag655.c:278
AreaBattle area0Battle0
Definition wstag655.c:184
AreaBattle area0Battle2
Definition wstag655.c:186
#define STAGE_FILE
Definition wstag655.c:53
AreaBattle area2Battle5
Definition wstag655.c:215
AreaBattle area1Battle1
Definition wstag655.c:198
AreaBattle area2Battle3
Definition wstag655.c:213
u16 actor2Conditions[]
Definition wstag655.c:274
AreaBattle area0Battle4
Definition wstag655.c:188
#define STAGE_TEXT
Definition wstag655.c:51
u16 actor3Talk0Actions[]
Definition wstag655.c:249
AreaBattle area3Battle7
Definition wstag655.c:230
BattleList area0Battles
Definition wstag655.c:192
AreaBattle area1Battle7
Definition wstag655.c:204
FieldActorEntry actor3
Definition wstag655.c:280
FieldBattles stageBattles[]
Definition wstag655.c:236
FieldEvent stageEvents[]
Definition wstag655.c:303
u16 actor0Conditions[]
Definition wstag655.c:272