Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag731.c
Go to the documentation of this file.
1/*
2 * WSTAG731: Kulon Weapons, North Sector. On the Amaterasu server; its Asuka
3 * server twin is WSTAG730.
4 */
5
6#include "common.h"
7#include "field/stage.h"
8/* Defined below, after the code that uses them */
10
12
14
16
18#define STAGE_CHILDREN_SIZE 4
20
21#if VERSION_US || VERSION_JP
22#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_07)
23#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
24#define STAGE_FILE 0x6B8
25#elif VERSION_EU
26#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_07)
27#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
28#define STAGE_FILE 0x6C7
29#endif
30/* Sets the stage up: its map, actors and events, playing SHOP2BGM */
49
51 SCRIPT_WALK(2, 0x1AD, 0xCE, 5),
52 SCRIPT_PLACE(0x15, 0x1CD, 0xBE),
53 SCRIPT_POSE(0x15, 1, 1),
56 SCRIPT_POSE(2, 1, 5),
57 SCRIPT_WAIT(6),
58 SCRIPT_WAIT(0x1E),
59 SCRIPT_TALK(0, 1, 0x15, 2),
61 SCRIPT_WAIT(0x1E),
62 SCRIPT_POSE(0x15, 0x36, 3),
64 SCRIPT_WAIT_ANIM(0x15),
65 SCRIPT_POSE(0x15, 0x37, 3),
66 SCRIPT_WAIT(0x5A),
67 SCRIPT_LEAVE(0xC10, 0, 0, 0),
69 /* after the end, the original's padding up to a word, which isn't zeros */
70#if VERSION_US
71 0x350,
72#elif VERSION_JP
73 0x100,
74#endif
75};
77 { 53, 8 }, { 54, 8 }, { 55, 8 }, { 56, 4 },
78 { 57, 40 }, { 58, 8 }, { 255, 0 },
79};
81 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
82 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
83 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
84 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
85 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
86 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
87 { 0x140, 0x100, 0x172, 0x13C, 0xC8, 0x3C, 0x170, 0x1FC },
88 { 0x140, 0x100, 0x160, 0x1D4, 0x80, 0xD4, 0x150, 0x1FB },
89};
92u16 actor2Talk1Conditions[] = { ITEM(3, 0x9C), 0, FLAG(0, 0), 0, CODES_END };
94u16 actor2Talk2Conditions[] = { ITEM(3, 0x9C), 0, FLAG(0, 0), 1, ITEM(2, 0x98), 0, CODES_END };
95u16 actor2Talk3Conditions[] = { ITEM(3, 0x9C), 0, FLAG(0, 0), 1, ITEM(2, 0x98), 1, CODES_END };
97 ITEM(3, 0x9C), 1,
98 ITEM(3, 0x9B), 0,
99 ITEM(2, 0x98), 0,
101 CODES_END,
102};
104u16 actor4Talk1Conditions[] = { ITEM(3, 0x90), 0, FLAG(0, 1), 0, CODES_END };
106u16 actor4Talk2Conditions[] = { ITEM(3, 0x90), 0, FLAG(0, 1), 1, ITEM(2, 0x8C), 0, CODES_END };
107u16 actor4Talk3Conditions[] = { ITEM(3, 0x90), 0, FLAG(0, 1), 1, ITEM(2, 0x8C), 1, CODES_END };
109 ITEM(3, 0x90), 1,
110 ITEM(3, 0x8F), 0,
111 ITEM(2, 0x8C), 0,
113 CODES_END,
114};
116u16 actor6Talk1Conditions[] = { ITEM(3, 0x77), 0, FLAG(0, 2), 0, CODES_END };
118u16 actor6Talk2Conditions[] = { ITEM(3, 0x77), 0, FLAG(0, 2), 1, ITEM(2, 0x73), 0, CODES_END };
119u16 actor6Talk3Conditions[] = { ITEM(3, 0x77), 0, FLAG(0, 2), 1, ITEM(2, 0x73), 1, CODES_END };
121 ITEM(3, 0x77), 1,
122 ITEM(3, 0x76), 0,
123 ITEM(2, 0x73), 0,
125 CODES_END,
126};
128u16 actor8Talk1Conditions[] = { ITEM(3, 0x83), 0, FLAG(0, 3), 0, CODES_END };
130u16 actor8Talk2Conditions[] = { ITEM(3, 0x83), 0, FLAG(0, 3), 1, ITEM(2, 0x7F), 0, CODES_END };
131u16 actor8Talk3Conditions[] = { ITEM(3, 0x83), 0, FLAG(0, 3), 1, ITEM(2, 0x7F), 1, CODES_END };
133 ITEM(3, 0x83), 1,
134 ITEM(3, 0x82), 0,
135 ITEM(2, 0x7F), 0,
137 CODES_END,
138};
140u16 actor10Talk1Conditions[] = { ITEM(3, 0x69), 0, FLAG(0, 4), 0, CODES_END };
142u16 actor10Talk2Conditions[] = { ITEM(3, 0x69), 0, FLAG(0, 4), 1, ITEM(2, 0x65), 0, CODES_END };
143u16 actor10Talk3Conditions[] = { ITEM(3, 0x69), 0, FLAG(0, 4), 1, ITEM(2, 0x65), 1, CODES_END };
145 ITEM(3, 0x69), 1,
146 ITEM(3, 0x68), 0,
147 ITEM(2, 0x65), 0,
149 CODES_END,
150};
152 { NULL, actor0Talk0Actions, 0x2CF },
153 { NULL, NULL, 0 },
154};
156 { NULL, NULL, 0x2D1 },
157 { NULL, NULL, 0 },
158};
167 { NULL, NULL, 0x316 },
168 { NULL, NULL, 0 },
169};
178 { NULL, NULL, 0x317 },
179 { NULL, NULL, 0 },
180};
189 { NULL, NULL, 0x318 },
190 { NULL, NULL, 0 },
191};
200 { NULL, NULL, 0x31D },
201 { NULL, NULL, 0 },
202};
211 { NULL, NULL, 0x31E },
212 { NULL, NULL, 0 },
213};
214u16 actor1Conditions[] = { ITEM(3, 0x9B), 0, ITEM(3, 0x9C), 0, CODES_END };
215u16 actor2Conditions[] = { ITEM(3, 0x9B), 1, ITEM(3, 0x9C), 0, CODES_END };
216u16 actor3Conditions[] = { ITEM(3, 0x8F), 0, ITEM(3, 0x9C), 1, ITEM(3, 0x90), 0, CODES_END };
217u16 actor4Conditions[] = { ITEM(3, 0x9C), 1, ITEM(3, 0x8F), 1, ITEM(3, 0x90), 0, CODES_END };
219 ITEM(3, 0x9C), 1,
220 ITEM(3, 0x90), 1,
221 ITEM(3, 0x76), 0,
222 ITEM(3, 0x77), 0,
223 CODES_END,
224};
226 ITEM(3, 0x9C), 1,
227 ITEM(3, 0x90), 1,
228 ITEM(3, 0x76), 1,
229 ITEM(3, 0x77), 0,
230 CODES_END,
231};
233 ITEM(3, 0x9C), 1,
234 ITEM(3, 0x90), 1,
235 ITEM(3, 0x77), 1,
236 ITEM(3, 0x82), 0,
237 ITEM(3, 0x83), 0,
238 CODES_END,
239};
241 ITEM(3, 0x9C), 1,
242 ITEM(3, 0x90), 1,
243 ITEM(3, 0x77), 1,
244 ITEM(3, 0x82), 1,
245 ITEM(3, 0x83), 0,
246 CODES_END,
247};
249 ITEM(3, 0x68), 0,
250 ITEM(3, 0x9C), 1,
251 ITEM(3, 0x90), 1,
252 ITEM(3, 0x77), 1,
253 ITEM(3, 0x83), 1,
254 ITEM(3, 0x69), 0,
255 CODES_END,
256};
258 ITEM(3, 0x9C), 1,
259 ITEM(3, 0x90), 1,
260 ITEM(3, 0x77), 1,
261 ITEM(3, 0x83), 1,
262 ITEM(3, 0x68), 1,
263 ITEM(3, 0x69), 0,
264 CODES_END,
265};
267 ITEM(3, 0x9C), 1,
268 ITEM(3, 0x90), 1,
269 ITEM(3, 0x77), 1,
270 ITEM(3, 0x83), 1,
271 ITEM(3, 0x69), 1,
272 CODES_END,
273};
274FieldActorEntry actor0 = { NULL, actor0Talks, 0x15, 4, 461, 190, 1 };
287 &actor0,
288 &actor1,
289 &actor2,
290 &actor3,
291 &actor4,
292 &actor5,
293 &actor6,
294 &actor7,
295 &actor8,
296 &actor9,
297 &actor10,
298 &actor11,
299 NULL,
300};
302 { 1, 0, 0x40, 2, 0x34, 2, 0, 5, 6, 0, 124, 112, 0, 0 },
303 { 1, 0, 0x40, 2, 0x34, 2, 0, 5, 6, 0, 187, 83, 0, 0 },
304 { 1, 0, 0x40, 2, 0x41, 2, 0, 3, 6, 0, 470, 34, 0, 0 },
305 { 1, 0, 0x56, 2, 1, 0, 0, 0, 0, 0, 335, 60, 0, 0 },
306 { 1, 1, 0x80, 6, 0x35, 0, 0, 0, 0, 0, 518, 136, 0, 0 },
307 { 1, 0, 0x40, 6, 0x33, 2, 0, 3, 6, 0, 284, 28, 0, 0 },
308 { 1, 0, 0x40, 6, 0x33, 2, 0, 3, 6, 0, 286, 62, 0, 0 },
309 { 1, 0, 0x40, 6, 0x33, 2, 0, 3, 6, 0, 313, 43, 0, 0 },
310 { 1, 0, 0x40, 6, 0x33, 2, 0, 3, 6, 0, 315, 77, 0, 0 },
311 { 1, 0, 0x40, 6, 0x33, 2, 0, 3, 6, 0, 342, 57, 0, 0 },
312 { 1, 0, 0x40, 6, 0x33, 2, 0, 3, 6, 0, 345, 92, 0, 0 },
313 { 1, 0, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 289, 26, 0, 0 },
314 { 1, 0, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 291, 60, 0, 0 },
315 { 1, 0, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 317, 40, 0, 0 },
316 { 1, 0, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 319, 74, 0, 0 },
317 { 1, 0, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 346, 54, 0, 0 },
318 { 1, 0, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 348, 89, 0, 0 },
319 { 1, 0, 0x40, 4, 0, 0, 0, 0, 0, 0, 312, 144, 195, 0 },
320 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
321};
323 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x2D0, 0x318, 0xAC, 1, 0, 0, 0 },
324 { { { CODES_END, 0 }, { CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
325};
326void (*stageFuncs[])(void) = {
328};
330 { 1236, script1236, EVENT_TEXT(5), NULL, NULL },
331 { -1, NULL, 0, NULL, NULL },
332};
#define NULL
Definition common.h:17
signed short s16
Definition common.h:9
unsigned short u16
Definition common.h:10
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 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_COMMAND_PLAY_SAVEDEMO
Definition field_map.h:65
#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 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_WAIT_ANIM(id)
until its animation ends
Definition field_map.h:169
#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 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 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_SHOP_2
SHOP2BGM: Lamb Chop, the Yellow Cruiser and El Dorado.
Definition sound.h:82
#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 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
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 character of the field (FieldState.actors, a list of pointers up to NULL), which FIELDSTG_updateFie...
Definition field_map.h:194
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
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
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
u16 actor1Conditions[]
Definition wstag731.c:214
u16 actor0Talk0Actions[]
Definition wstag731.c:90
u16 actor10Talk2Conditions[]
Definition wstag731.c:142
FieldActorEntry actor0
Definition wstag731.c:274
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag731.c:326
FieldActorEntry actor6
Definition wstag731.c:280
u16 actor11Conditions[]
Definition wstag731.c:266
u16 actor10Talk1Actions[]
Definition wstag731.c:141
FieldTalk actor2Talks[]
Definition wstag731.c:159
u16 actor8Talk1Conditions[]
Definition wstag731.c:128
u16 actor2Talk1Conditions[]
Definition wstag731.c:92
u16 actor4Talk3Conditions[]
Definition wstag731.c:107
u16 actor4Talk1Actions[]
Definition wstag731.c:105
u16 actor8Talk3Conditions[]
Definition wstag731.c:131
u16 actor10Conditions[]
Definition wstag731.c:257
u16 actor8Talk3Actions[]
Definition wstag731.c:132
u16 actor10Talk3Actions[]
Definition wstag731.c:144
FieldTalk actor5Talks[]
Definition wstag731.c:177
FieldActorEntry actor5
Definition wstag731.c:279
FieldActorEntry actor2
Definition wstag731.c:276
u16 actor8Talk2Conditions[]
Definition wstag731.c:130
u16 actor6Talk1Conditions[]
Definition wstag731.c:116
u16 actor9Conditions[]
Definition wstag731.c:248
FieldActorEntry * stageActors[]
Definition wstag731.c:286
u16 actor2Talk3Conditions[]
Definition wstag731.c:95
u16 actor10Talk1Conditions[]
Definition wstag731.c:140
u16 actor4Talk1Conditions[]
Definition wstag731.c:104
u16 actor6Talk2Conditions[]
Definition wstag731.c:118
u16 actor10Talk0Conditions[]
Definition wstag731.c:139
FieldTalk actor1Talks[]
Definition wstag731.c:155
u16 actor2Talk1Actions[]
Definition wstag731.c:93
FieldTalk actor0Talks[]
Definition wstag731.c:151
FieldActorEntry actor10
Definition wstag731.c:284
FieldTalk actor4Talks[]
Definition wstag731.c:170
u16 actor4Conditions[]
Definition wstag731.c:217
s16 script1236[]
Definition wstag731.c:50
FieldActorEntry actor4
Definition wstag731.c:278
u16 actor3Conditions[]
Definition wstag731.c:216
u16 actor2Talk2Conditions[]
Definition wstag731.c:94
FieldTalk actor11Talks[]
Definition wstag731.c:210
FieldActorEntry actor8
Definition wstag731.c:282
u16 actor6Talk3Actions[]
Definition wstag731.c:120
u16 actor2Talk3Actions[]
Definition wstag731.c:96
ActorImage stageImages[]
Definition wstag731.c:80
FieldTalk actor6Talks[]
Definition wstag731.c:181
void setupStage(void)
Sets the stage up: its map, actors and events, playing SHOP2BGM.
Definition wstag731.c:31
u16 actor4Talk0Conditions[]
Definition wstag731.c:103
u16 actor8Talk1Actions[]
Definition wstag731.c:129
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag731.c:301
FieldActorEntry actor9
Definition wstag731.c:283
u16 actor8Conditions[]
Definition wstag731.c:240
AnimFrame updateTileAnimsFrames[]
Defined below, after the code that uses them.
Definition wstag731.c:76
u16 actor5Conditions[]
Definition wstag731.c:218
FieldTalk actor10Talks[]
Definition wstag731.c:203
FieldTalk actor3Talks[]
Definition wstag731.c:166
FieldTalk actor9Talks[]
Definition wstag731.c:199
u16 actor6Talk3Conditions[]
Definition wstag731.c:119
u16 actor2Talk0Conditions[]
Definition wstag731.c:91
u16 actor6Talk0Conditions[]
Definition wstag731.c:115
u16 actor6Conditions[]
Definition wstag731.c:225
FieldActorEntry actor7
Definition wstag731.c:281
StageSlot stageSlots[]
Definition wstag731.c:322
FieldActorEntry actor11
Definition wstag731.c:285
FieldActorEntry actor1
Definition wstag731.c:275
u16 actor10Talk3Conditions[]
Definition wstag731.c:143
#define STAGE_FILE
Definition wstag731.c:28
u16 actor7Conditions[]
Definition wstag731.c:232
u16 actor6Talk1Actions[]
Definition wstag731.c:117
u16 actor2Conditions[]
Definition wstag731.c:215
FieldTalk actor7Talks[]
Definition wstag731.c:188
u16 actor4Talk3Actions[]
Definition wstag731.c:108
#define STAGE_TEXT
Definition wstag731.c:26
FieldTalk actor8Talks[]
Definition wstag731.c:192
u16 actor8Talk0Conditions[]
Definition wstag731.c:127
u16 actor4Talk2Conditions[]
Definition wstag731.c:106
FieldActorEntry actor3
Definition wstag731.c:277
FieldEvent stageEvents[]
Definition wstag731.c:329