Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag661.c
Go to the documentation of this file.
1/*
2 * WSTAG661: Bai Hu City, West Sector. On the Amaterasu server; its Asuka
3 * server twin is WSTAG660.
4 */
5
6#include "common.h"
7#include "field/stage.h"
8
11
12const CVECTOR stageColor = { 0x80, 0x80, 0x80, 0x00 };
13#if VERSION_US || VERSION_JP
14#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_03)
15#define EVENT_TEXT_FILE (TEXT_EVENTS_600 - 1)
16#define STAGE_FILE 0x656
17#elif VERSION_EU
18#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_03)
19#define EVENT_TEXT_FILE (TEXT_EVENTS_600 - 1)
20#define STAGE_FILE 0x666
21#endif
22/*
23 * Sets the stage up: its map, actors and events, playing BGM_0021; BGM_0029
24 * instead except at STORY_PRESIDENT_ARRESTED once flag 0x1A0A is set
25 */
49
51 SCRIPT_WALK(2, 0x43E, 0x204, 5),
52 SCRIPT_PLACE(0x15, 0x45F, 0x1F6),
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, 0),
61 SCRIPT_WAIT(0x1E),
62 SCRIPT_POSE(0x15, 0x36, 1),
64 SCRIPT_WAIT_ANIM(0x15),
65 SCRIPT_POSE(0x15, 0x37, 1),
66 SCRIPT_WAIT(0x5A),
67 SCRIPT_LEAVE(0xC0F, 0, 0, 0),
69 /* after the end, the original's padding up to a word, which isn't zeros */
70#if VERSION_EU
71 0x2,
72#endif
73};
75 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
76 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
77 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
78 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
79 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
80 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
81 { 0x1C0, 0x100, 0x1F6, 0x160, 0x2D8, 0x60, 0x150, 0x1FB },
82 { 0x180, 0x100, 0x194, 0x1A8, 0x150, 0xA8, 0x160, 0x1FB },
83 { 0x1C0, 0x100, 0x1F4, 0x100, 0x2D0, 0, 0x170, 0x1FB },
84 { 0x180, 0x100, 0x1A8, 0x1D8, 0x1A0, 0xD8, 0x150, 0x1FA },
85 { 0x1C0, 0x100, 0x1CC, 0x100, 0x230, 0, 0x160, 0x1FA },
86 { 0x1C0, 0x100, 0x1C0, 0x178, 0x200, 0x78, 0x170, 0x1FA },
87 { 0x1C0, 0x100, 0x1C8, 0x178, 0x220, 0x78, 0x140, 0x1F9 },
88 { 0x1C0, 0x100, 0x1D0, 0x178, 0x240, 0x78, 0x150, 0x1F9 },
89 { 0x1C0, 0x100, 0x1D8, 0x180, 0x260, 0x80, 0x160, 0x1F9 },
90 { 0x1C0, 0x100, 0x1EC, 0x180, 0x2B0, 0x80, 0x170, 0x1F9 },
91};
92u16 actor0Talk0Actions[] = { 0x7A2E, 1, CODES_END };
94u16 actor2Talk0Actions[] = { 0x7A1B, 1, CODES_END };
95u16 actor3Talk0Actions[] = { 0x7A1A, 1, CODES_END };
96u16 actor4Talk0Actions[] = { 0x7C00, 1, CODES_END };
100 { NULL, actor0Talk0Actions, 0x1A3 },
101 { NULL, NULL, 0 },
102};
104 { NULL, actor1Talk0Actions, 0x1A2 },
105 { NULL, NULL, 0 },
106};
108 { NULL, actor2Talk0Actions, 0x1A8 },
109 { NULL, NULL, 0 },
110};
112 { NULL, actor3Talk0Actions, 0x1A4 },
113 { NULL, NULL, 0 },
114};
116 { NULL, actor4Talk0Actions, 0x1A5 },
117 { NULL, NULL, 0 },
118};
120 { NULL, NULL, 0x176 },
121 { NULL, NULL, 0 },
122};
124 { NULL, NULL, 0x178 },
125 { NULL, NULL, 0 },
126};
128 { NULL, NULL, 0x174 },
129 { NULL, NULL, 0 },
130};
132 { NULL, NULL, 0x175 },
133 { NULL, NULL, 0 },
134};
136 { NULL, NULL, 0x175 },
137 { NULL, NULL, 0 },
138};
140 { NULL, NULL, 0x177 },
141 { NULL, NULL, 0 },
142};
144 { NULL, NULL, 0x177 },
145 { NULL, NULL, 0 },
146};
148 { actor12Talk0Conditions, NULL, 0x1D7 },
149 { actor12Talk1Conditions, NULL, 0x1D8 },
150 { NULL, NULL, 0 },
151};
153 { NULL, NULL, 0x1D9 },
154 { NULL, NULL, 0 },
155};
157 { NULL, NULL, 0x1EB },
158 { NULL, NULL, 0 },
159};
186FieldActorEntry actor0 = { NULL, actor0Talks, 0x14, 4, 908, 596, 7 };
187FieldActorEntry actor1 = { NULL, actor1Talks, 0x15, 5, 1119, 502, 1 };
188FieldActorEntry actor2 = { NULL, actor2Talks, 0x16, 6, 834, 470, 7 };
189FieldActorEntry actor3 = { NULL, actor3Talks, 0x17, 7, 690, 493, 1 };
190FieldActorEntry actor4 = { NULL, actor4Talks, 0x18, 8, 1329, 411, 1 };
193FieldActorEntry actor7 = { actor7Conditions, actor7Talks, 0x39, 0xA, 993, 531, 7 };
194FieldActorEntry actor8 = { actor8Conditions, actor8Talks, 0x9D, 0xB, 993, 531, 7 };
195FieldActorEntry actor9 = { actor9Conditions, actor9Talks, 0x9D, 0xB, 993, 531, 7 };
202 &actor0,
203 &actor1,
204 &actor2,
205 &actor3,
206 &actor4,
207 &actor5,
208 &actor6,
209 &actor7,
210 &actor8,
211 &actor9,
212 &actor10,
213 &actor11,
214 &actor12,
215 &actor13,
216 &actor14,
217 NULL,
218};
220 { 1, 0, 0x40, 2, 7, 0, 7, 0xC, 4, 0, 374, 313, 0, 0 },
221 { 1, 0, 0x40, 2, 7, 0, 7, 0xC, 4, 0, 919, 586, 0, 0 },
222 { 1, 0, 0xC8, 2, 0x5A, 1, 0x5A, 0x61, 0xA, 0, 1314, 270, 0, 0 },
223 { 1, 0, 0x48, 2, 0, 0, 0, 0, 0, 0, 444, 419, 0, 0 },
224 { 1, 0, 0x58, 2, 0xD, 0, 0, 0, 0, 0, 683, 345, 0, 0 },
225 { 1, 0, 0x4C, 2, 0xE, 0, 0, 0, 0, 0, 947, 492, 0, 0 },
226 { 1, 0, 0x60, 2, 0x10, 0, 0, 0, 0, 0, 640, 515, 0, 0 },
227 { 1, 0, 0x74, 2, 0x11, 0, 0, 0, 0, 0, 624, 524, 0, 0 },
228 { 1, 0, 0x44, 2, 0x12, 0, 0, 0, 0, 0, 304, 556, 0, 0 },
229 { 1, 0, 0x62, 2, 0xF, 0, 0, 0, 0, 0, 932, 598, 0, 0 },
230 { 1, 0, 0x41, 2, 3, 0, 0, 0, 0, 0, 960, 418, 0, 0 },
231 { 1, 0, 0x40, 6, 0x32, 2, 0, 5, 8, 0, 1378, 348, 0, 0 },
232 { 1, 0, 0x40, 6, 0x33, 2, 0, 5, 8, 0, 1391, 358, 0, 0 },
233 { 1, 0, 0x40, 6, 0x34, 2, 0, 5, 8, 0, 1250, 357, 0, 0 },
234 { 1, 0, 0x40, 6, 0x34, 2, 0, 5, 8, 0, 1263, 350, 0, 0 },
235 { 1, 0, 0x40, 6, 0x35, 1, 0x35, 0x38, 4, 0, 1217, 367, 0, 0 },
236 { 1, 0, 0x40, 6, 0x35, 1, 0x35, 0x38, 4, 0, 1417, 367, 0, 0 },
237 { 1, 0, 0x40, 6, 0x39, 2, 0, 3, 6, 0, 1310, 259, 0, 0 },
238 { 1, 0, 0xC8, 6, 0x57, 1, 0x57, 0x59, 6, 0, 1144, 428, 0, 0 },
239 { 1, 0, 0x40, 6, 0x3A, 1, 0x3A, 0x49, 0xA, 0, 290, 451, 0, 0 },
240 { 1, 0, 0x40, 6, 0x3A, 1, 0x3A, 0x49, 0xA, 0, 344, 408, 0, 0 },
241 { 1, 0, 0x40, 6, 0x3A, 1, 0x3A, 0x49, 0xA, 0, 851, 700, 0, 0 },
242 { 1, 0, 0x40, 6, 0x3A, 1, 0x3A, 0x49, 0xA, 0, 996, 725, 0, 0 },
243 { 1, 0, 0xC8, 0xA, 0x51, 1, 0x51, 0x53, 6, 0, 799, 318, 0, 0 },
244 { 1, 0, 0xC8, 0xA, 0x54, 1, 0x54, 0x56, 6, 0, 1052, 371, 0, 0 },
245 { 1, 0, 0x40, 4, 5, 0, 0, 0, 0, 0, 944, 515, 569, 0 },
246 { 1, 0, 0x40, 4, 6, 0, 0, 0, 0, 0, 582, 424, 454, 0 },
247 { 1, 0, 0x40, 4, 1, 0, 0, 0, 0, 0, 1056, 269, 327, 0 },
248 { 1, 0, 0x41, 4, 4, 0, 0, 0, 0, 0, 369, 703, 751, 0 },
249 { 1, 0, 0x41, 4, 4, 0, 0, 0, 0, 0, 449, 743, 791, 0 },
250 { 1, 0, 0x60, 4, 2, 0, 0, 0, 0, 0, 914, 233, 303, 0 },
251 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
252};
254 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x2C7, 0x100, 0x220, 5, 0, 0, 0 },
255 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x2B2, 0x1F0, 0x68, 1, 0, 0, 0 },
256 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_DOWN, 4, 0x170, 0x268, 0, 0, 0, 0 },
257 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_UP, 4, 0x180, 0x2B0, 0, 0, 0, 0 },
258 { { { CODES_END, 0 }, { CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
259};
260void (*stageFuncs[])(void) = {
262};
264 { 1230, script1230, EVENT_TEXT(6), NULL, NULL },
265 { -1, NULL, 0, NULL, NULL },
266};
#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
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 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_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 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 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 PROGRESS(n)
GAME.progress is n.
Definition game_state.h:69
#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_BYAKKO_CITY
BGM_0021: Byakko City and the Bai Hu Dome.
Definition sound.h:97
#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_OINKMON_CITIZENS_RESTORED
wstag435 Gale Tower: Airdramon spins the windmill and turns everyone back from Oinkmon; tested in 62 ...
Definition story.h:1031
@ STORY_PRESIDENT_ARRESTED
WSTAG226 (Login Room, Amaterasu City), event 935, after the President of MAGAMI gives himself up (WST...
Definition story.h:136
@ 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_WAY_TO_AMATERASU_TO_PRESIDENT_ARRESTED
GAME.progress is from STORY_WAY_TO_AMATERASU to STORY_PRESIDENT_ARRESTED (PROGRESS_RANGES[0x16])
Definition story.h:1929
#define SPECIAL_STORY_BLUE_ID_PASS_TO_AMATERASU_BRIDGE
GAME.progress is from STORY_BLUE_ID_PASS to STORY_AMATERASU_BRIDGE (PROGRESS_RANGES[0x18])
Definition story.h:1935
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
Definition field_map.h:114
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
CVECTOR spriteColor
the field's sprites' color, unless cd is 0
Definition field_map.h:458
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
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
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 actor0Talk0Actions[]
Definition wstag661.c:92
FieldActorEntry actor0
Definition wstag661.c:186
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag661.c:260
FieldActorEntry actor6
Definition wstag661.c:192
u16 actor11Conditions[]
Definition wstag661.c:182
FieldTalk actor2Talks[]
Definition wstag661.c:107
u16 actor10Conditions[]
Definition wstag661.c:177
FieldTalk actor14Talks[]
Definition wstag661.c:156
FieldTalk actor5Talks[]
Definition wstag661.c:119
FieldActorEntry actor5
Definition wstag661.c:191
FieldActorEntry actor2
Definition wstag661.c:188
const CVECTOR stageColor
the color the setup copies to FIELDSTG_state.spriteColor
Definition wstag661.c:12
u16 actor9Conditions[]
Definition wstag661.c:176
FieldActorEntry * stageActors[]
Definition wstag661.c:201
FieldTalk actor1Talks[]
Definition wstag661.c:103
u16 actor13Conditions[]
Definition wstag661.c:184
FieldTalk actor0Talks[]
Definition wstag661.c:99
FieldActorEntry actor10
Definition wstag661.c:196
u16 actor2Talk0Actions[]
Definition wstag661.c:94
FieldTalk actor4Talks[]
Definition wstag661.c:115
FieldActorEntry actor4
Definition wstag661.c:190
FieldTalk actor11Talks[]
Definition wstag661.c:143
FieldActorEntry actor8
Definition wstag661.c:194
ActorImage stageImages[]
Definition wstag661.c:74
s16 script1230[]
Definition wstag661.c:50
FieldTalk actor6Talks[]
Definition wstag661.c:123
void setupStage(void)
Sets the stage up: its map, actors and events, playing BGM_0021; BGM_0029 instead except at STORY_PRE...
Definition wstag661.c:26
u16 actor12Talk0Conditions[]
Definition wstag661.c:97
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag661.c:219
FieldActorEntry actor9
Definition wstag661.c:195
u16 actor8Conditions[]
Definition wstag661.c:171
u16 actor5Conditions[]
Definition wstag661.c:160
FieldTalk actor10Talks[]
Definition wstag661.c:139
FieldTalk actor3Talks[]
Definition wstag661.c:111
FieldTalk actor9Talks[]
Definition wstag661.c:135
FieldActorEntry actor12
Definition wstag661.c:198
u16 actor6Conditions[]
Definition wstag661.c:165
u16 actor12Talk1Conditions[]
Definition wstag661.c:98
u16 actor14Conditions[]
Definition wstag661.c:185
FieldActorEntry actor7
Definition wstag661.c:193
StageSlot stageSlots[]
Definition wstag661.c:253
u16 actor1Talk0Actions[]
Definition wstag661.c:93
FieldActorEntry actor13
Definition wstag661.c:199
FieldActorEntry actor11
Definition wstag661.c:197
FieldActorEntry actor1
Definition wstag661.c:187
FieldTalk actor13Talks[]
Definition wstag661.c:152
#define STAGE_FILE
Definition wstag661.c:20
u16 actor4Talk0Actions[]
Definition wstag661.c:96
u16 actor7Conditions[]
Definition wstag661.c:166
FieldTalk actor7Talks[]
Definition wstag661.c:127
#define STAGE_TEXT
Definition wstag661.c:18
u16 actor3Talk0Actions[]
Definition wstag661.c:95
FieldTalk actor8Talks[]
Definition wstag661.c:131
FieldTalk actor12Talks[]
Definition wstag661.c:147
FieldActorEntry actor3
Definition wstag661.c:189
FieldActorEntry actor14
Definition wstag661.c:200
FieldEvent stageEvents[]
Definition wstag661.c:263
u16 actor12Conditions[]
Definition wstag661.c:183