Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag931.c
Go to the documentation of this file.
1/*
2 * WSTAG931: Wedge's Shop, Amaterasu City, in the extra chapter. The European
3 * version's: in its extra chapter (STORY_EXTRA), mode 636 starts it instead of
4 * WSTAG246.
5 */
6
7#include "common.h"
8#include "field/stage.h"
9
11#define STAGE_CHILDREN_SIZE 4
13
14#if VERSION_EU
15#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_08)
16#define STAGE_FILE 0x8F5
17#define STAGE_FILE_8 0x1A6
18#elif VERSION_JP
19#define STAGE_TEXT 0x89A
20#define STAGE_FILE 0x8B6
21#define STAGE_FILE_8 0x198
22#endif
23/* Sets the stage up: its map, actors and events, playing SHOP1BGM */
42
43/* Defined below, after the tables that use them */
44extern s16 script1614[];
45
47 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
48 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
49 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
50 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
51 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
52 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
53 { 0x1C0, 0x100, 0x1F4, 0x140, 0x2D0, 0x40, 0x150, 0x1FF },
54 { 0x140, 0x100, 0x162, 0x1DC, 0x88, 0xDC, 0x160, 0x1FF },
55 { 0x1C0, 0x100, 0x1CE, 0x1A4, 0x238, 0xA4, 0x170, 0x1FF },
56 { 0x140, 0x100, 0x174, 0x1DC, 0xD0, 0xDC, 0x150, 0x1FE },
57 { 0x1C0, 0x100, 0x1D6, 0x1A9, 0x258, 0xA9, 0x160, 0x1FE },
58};
59u16 actor0Talk0Actions[] = { 0x7A11, 1, CODES_END };
60u16 actor1Talk0Actions[] = { 0x7A0F, 1, CODES_END };
61u16 actor3Talk0Actions[] = { 0x7A10, 1, CODES_END };
63u16 actor4Talk1Conditions[] = { ITEM(0, 0x25), 1, FLAG(0x18, 7), 0, CODES_END };
64u16 actor4Talk1Actions[] = { START_EVENT(0x71), 1, FLAG(0x18, 7), 1, CODES_END };
65u16 actor4Talk2Conditions[] = { ITEM(0, 0x25), 1, FLAG(0x18, 7), 1, CODES_END };
67 { NULL, actor0Talk0Actions, 0x33 },
68 { NULL, NULL, 0 },
69};
71 { NULL, actor1Talk0Actions, 0x32 },
72 { NULL, NULL, 0 },
73};
75 { NULL, NULL, 0x86 },
76 { NULL, NULL, 0 },
77};
79 { NULL, actor3Talk0Actions, 0x34 },
80 { NULL, NULL, 0 },
81};
89 { NULL, NULL, 0x85 },
90 { NULL, NULL, 0 },
91};
92u16 actor4Conditions[] = { FLAG(0x18, 7), 0, CODES_END };
93u16 actor5Conditions[] = { FLAG(0x18, 7), 1, CODES_END };
94FieldActorEntry actor0 = { NULL, actor0Talks, 0x16, 4, 449, 281, 7 };
95FieldActorEntry actor1 = { NULL, actor1Talks, 0x17, 5, 304, 369, 7 };
96FieldActorEntry actor2 = { NULL, actor2Talks, 0x34, 6, 287, 432, 3 };
97FieldActorEntry actor3 = { NULL, actor3Talks, 0xB7, 7, 359, 308, 7 };
101 &actor0,
102 &actor1,
103 &actor2,
104 &actor3,
105 &actor4,
106 &actor5,
107 NULL,
108};
110 { 1, 0, 0x40, 2, 0x11, 2, 0, 1, 4, 0, 384, 79, 0, 0 },
111 { 1, 0, 0x40, 2, 0x11, 2, 0, 1, 4, 0, 492, 137, 0, 0 },
112 { 1, 0, 0x40, 2, 0x11, 2, 0, 1, 4, 0, 548, 165, 0, 0 },
113 { 1, 0, 0x40, 6, 3, 1, 3, 8, 4, 0, 485, 145, 0, 0 },
114 { 1, 0, 0x40, 6, 9, 1, 9, 0xE, 4, 0, 541, 172, 0, 0 },
115 { 1, 0x64, 0x40, 6, 0x12, 0, 0, 0, 0, 0, 304, 99, 0, 0 },
116 { 1, 0x65, 0x40, 6, 0x13, 0, 0, 0, 0, 0, 64, 285, 0, 0 },
117 { 1, 0, 0xA0, 4, 0, 0, 0, 0, 0, 0, 144, 257, 380, 0 },
118 { 1, 0, 0xA0, 4, 1, 0, 0, 0, 0, 0, 256, 257, 337, 0 },
119 { 1, 0, 0xA0, 4, 2, 0, 0, 0, 0, 0, 384, 261, 287, 0 },
120 { 1, 0, 0x60, 4, 0xF, 0, 0, 0, 0, 0, 240, 73, 150, 0 },
121 { 1, 0, 0x60, 4, 0x10, 0, 0, 0, 0, 0, 0, 255, 335, 0 },
122 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
123};
125 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x270, 0x1E0, 0x1DA, 7, 0, 0, 0 },
126 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x270, 0x240, 0x1AA, 7, 0, 0, 0 },
127 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x27D, 0x218, 0xE4, 3, 0x64, 0, 0 },
128 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x27D, 0x128, 0x19C, 3, 0x65, 0, 0 },
129 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_DOWN, 4, 0x11F, 0xBA, 0, 0, 0, 0 },
130 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_CLIMB_UP, 4, 0x110, 0xFE, 0, 0, 0, 0 },
131 { { { CODES_END, 0 }, { CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
132};
133void (*stageFuncs[])(void) = {
135};
136#define EVENT_TEXT_FILE EXTRA_TEXT
138 { 1614, script1614, EVENT_TEXT(7), NULL, NULL },
139 { -1, NULL, 0, NULL, NULL },
140};
142 SCRIPT_FOLLOW(1, 2),
143 SCRIPT_WALK(2, 0xB0, 0x198, 3),
144 SCRIPT_PLACE(0xFF, 0x98, 0x18D),
145 SCRIPT_POSE(0xFF, 1, 7),
148 SCRIPT_POSE(2, 1, 3),
149 SCRIPT_WAIT(0x1E),
150 SCRIPT_COMMAND(0x323, 0x325, 0xFF),
151 SCRIPT_WAIT(0x3C),
152 SCRIPT_COMMAND(0x323, 0x326, 0xFF),
153 SCRIPT_WAIT(0x1E),
154 SCRIPT_TALK(0, 1, 0xFF, 2),
156 SCRIPT_WAIT(0x1E),
157 SCRIPT_WALK(0xFF, 0x68, 0x174, 3),
158 SCRIPT_WAIT_WALK(0xFF),
159 SCRIPT_WALK(0xFF, 0x90, 0x160, 5),
160 SCRIPT_WAIT_WALK(0xFF),
161 SCRIPT_POSE(0xFF, 1, 1),
162 SCRIPT_WAIT(0x1E),
164};
#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 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_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_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 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_1
SHOP1BGM: the inns, shops and towers.
Definition sound.h:81
#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,...
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
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 actor0Talk0Actions[]
Definition wstag931.c:59
FieldActorEntry actor0
Definition wstag931.c:94
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag931.c:133
FieldTalk actor2Talks[]
Definition wstag931.c:74
s16 script1614[]
Defined below, after the tables that use them.
Definition wstag931.c:141
u16 actor4Talk1Actions[]
Definition wstag931.c:64
FieldTalk actor5Talks[]
Definition wstag931.c:88
FieldActorEntry actor5
Definition wstag931.c:99
FieldActorEntry actor2
Definition wstag931.c:96
#define STAGE_FILE_8
Definition wstag931.c:17
FieldActorEntry * stageActors[]
Definition wstag931.c:100
u16 actor4Talk1Conditions[]
Definition wstag931.c:63
FieldTalk actor1Talks[]
Definition wstag931.c:70
FieldTalk actor0Talks[]
Definition wstag931.c:66
FieldTalk actor4Talks[]
Definition wstag931.c:82
u16 actor4Conditions[]
Definition wstag931.c:92
FieldActorEntry actor4
Definition wstag931.c:98
ActorImage stageImages[]
Definition wstag931.c:46
void setupStage(void)
Sets the stage up: its map, actors and events, playing SHOP1BGM.
Definition wstag931.c:24
u16 actor4Talk0Conditions[]
Definition wstag931.c:62
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag931.c:109
u16 actor5Conditions[]
Definition wstag931.c:93
FieldTalk actor3Talks[]
Definition wstag931.c:78
StageSlot stageSlots[]
Definition wstag931.c:124
u16 actor1Talk0Actions[]
Definition wstag931.c:60
FieldActorEntry actor1
Definition wstag931.c:95
#define STAGE_FILE
Definition wstag931.c:16
#define STAGE_TEXT
Definition wstag931.c:15
u16 actor3Talk0Actions[]
Definition wstag931.c:61
u16 actor4Talk2Conditions[]
Definition wstag931.c:65
FieldActorEntry actor3
Definition wstag931.c:97
FieldEvent stageEvents[]
Definition wstag931.c:137