10 switch (task->
state) {
25#define STAGE_CHILDREN_SIZE 4
43#if VERSION_US || VERSION_JP
44#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_01)
45#define EVENT_TEXT_FILE (TEXT_EVENTS_600 - 1)
46#define STAGE_FILE 0x4B4
48#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_01)
49#define EVENT_TEXT_FILE (TEXT_EVENTS_600 - 1)
50#define STAGE_FILE 0x4C4
207 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
208 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
209 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
210 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
211 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
212 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
213 { 0x140, 0x100, 0x140, 0x1A6, 0, 0xA6, 0x150, 0x1FF },
214 { 0x140, 0x100, 0x16E, 0x158, 0xB8, 0x58, 0x160, 0x1FF },
215 { 0x140, 0x100, 0x176, 0x158, 0xD8, 0x58, 0x170, 0x1FF },
216 { 0, 0, 0, 0, 0, 0, 0, 0 },
217 { 0x140, 0x100, 0x164, 0x180, 0x90, 0x80, 0x150, 0x1FE },
218 { 0x140, 0x100, 0x16C, 0x188, 0xB0, 0x88, 0x160, 0x1FE },
219 { 0x140, 0x100, 0x15E, 0x1A8, 0x78, 0xA8, 0x170, 0x1FE },
220 { 0x140, 0x100, 0x174, 0x188, 0xD0, 0x88, 0x140, 0x1FD },
221 { 0x140, 0x100, 0x166, 0x1B0, 0x98, 0xB0, 0x150, 0x1FD },
222 { 0x140, 0x100, 0x16E, 0x1B0, 0xB8, 0xB0, 0x160, 0x1FD },
223 { 0x140, 0x100, 0x176, 0x1B0, 0xD8, 0xB0, 0x170, 0x1FD },
224 { 0x140, 0x100, 0x148, 0x1B5, 0x20, 0xB5, 0x140, 0x1FC },
225 { 0x140, 0x100, 0x150, 0x1BD, 0x40, 0xBD, 0x150, 0x1FC },
226 { 0x140, 0x100, 0x168, 0x1D0, 0xA0, 0xD0, 0x160, 0x1FC },
227 { 0x140, 0x100, 0x14E, 0x18D, 0x38, 0x8D, 0x170, 0x1FC },
228 { 0x140, 0x100, 0x156, 0x195, 0x58, 0x95, 0x140, 0x1FB },
229 { 0x140, 0x100, 0x140, 0x1C6, 0, 0xC6, 0x150, 0x1FB },
230 { 0x140, 0x100, 0x158, 0x1C8, 0x60, 0xC8, 0x160, 0x1FB },
231 { 0x140, 0x100, 0x160, 0x1D0, 0x80, 0xD0, 0x170, 0x1FB },
436 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 6, 0, 177, 76, 0, 0 },
437 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 6, 0, 244, 43, 0, 0 },
438 { 1, 0, 0x40, 6, 0x32, 2, 0, 1, 6, 0, 350, 54, 0, 0 },
439 { 1, 0, 0x80, 6, 4, 0, 0, 0, 0, 0, 390, 289, 0, 0 },
440 { 1, 0, 0x58, 4, 0, 0, 0, 0, 0, 0, 1025, 223, 307, 0 },
441 { 1, 0, 0x40, 4, 1, 0, 0, 0, 0, 0, 492, 452, 508, 0 },
442 { 1, 0, 0x42, 4, 2, 0, 0, 0, 0, 0, 625, 443, 501, 0 },
443 { 1, 0, 0x5B, 4, 3, 0, 0, 0, 0, 0, 639, 378, 454, 0 },
444 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
447 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x25E, 0x290, 0x1F0, 1, 0, 0, 0 },
448 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_DROP, 9, 0, 0, 0, 0, 0, 0 },
449 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_CLIMB_DOWN, 8, 0x1C4, 0xA0, 0, 0, 0, 0 },
450 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_CLIMB_UP, 8, 0x1D5, 0x12C, 0, 0, 0, 0 },
451 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_CLIMB_DOWN, 4, 0x1BF, 0x150, 0, 0, 0, 0 },
452 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_CLIMB_UP, 4, 0x1AF, 0x198, 0, 0, 0, 0 },
453 { { {
FLAG(0x1A, 3), 1 }, {
PROGRESS(
STORY_NUMEMON_FOUND), 1 } },
SLOT_EVENT, 0x1A5, 0, 0, 0, 0, 0, 0 },
454 { { {
CODES_END, 0 }, {
CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
GameFlags FLAGS_00
The flag bitset FLAGS_00 and the event functions.
GameState GAME
The save data, the game mode and the methods.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
EventTask * FIELDSTG_startEvent(s32 id)
Starts the event id of FieldState.events: its script, start and end, and its text; the player stands ...
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.
void updateStage()
The names every stage defines, each its own (config/<version>/stages/<stage>.txt).
#define SCRIPT_WAIT_WALK(id)
until the character gets to its goal
#define FIELD_COMMAND_HALT_PARTNERS
The field commands, which an event script hands FIELD_TASK_COMMANDS as the first argument of a pose c...
#define SCRIPT_END
The commands of an event script (FieldEvent.script), as FIELDSTG_runEvent reads them: a halfword kind...
#define SCRIPT_LEAVE(mode, x, y, dir)
FIELDSTG_leaveField; ends the event.
#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...
#define SCRIPT_FOLLOW(snap, id)
FIELDSTG_followWithCamera.
#define FIELD_COMMAND_PLAY_PIYOPIYO
#define FIELD_MAP_FLOOR0
Some of FieldMap's maps (files): those of the floors the player walks on come first,...
#define SLOT_EVENT
starts the event arg
#define SCRIPT_WALK(id, x, y, dir)
Actor.setGoal: walks to (x, y), then faces dir.
#define SCRIPT_WAIT_BOX
until box 0 closes
#define SLOT_EXIT
The kinds of StageSlot (type).
#define SCRIPT_POSE(id, set, dir)
Actor.setPose: its animation set, facing dir.
#define FIELD_MAP_TRIGGERS
a cell's value: a direction (3 bits) and a StageSlot (5)
#define SCRIPT_WAIT(frames)
#define SCRIPT_WAIT_ANIM(id)
until its animation ends
#define FIELD_TASK_COMMANDS
script command 813 (FIELDSTG_startCommandTask): the field commands
#define SCRIPT_PLACE(id, x, y)
puts a character at (x, y)
#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...
FieldState FIELDSTG_state
#define START_EVENT(index)
action: FIELDSTG_startListedEvent
#define PROGRESS(n)
GAME.progress is n.
#define FLAG(group, id)
The codes of the (code, value) pairs that FLAGS_00 checks as conditions and applies as actions (event...
#define MUSIC_UNDERGROUND_CAVE
ENV_0020: the Underground Cave.
#define MUSIC_BANK(music)
The sound bank of a music, which a stage loads for it (FieldState.soundBank)
FIELDSTG's start of the stage (StageEntry.init in FIELDSTG_stages): the stage's task,...
#define SPECIAL_STORY_JUNGLE_SOUND_TO_AMATERASU_BRIDGE
GAME.progress is from STORY_JUNGLE_SOUND to STORY_AMATERASU_BRIDGE (PROGRESS_RANGES[0x12])
@ STORY_PRESIDENT_ARRESTED
WSTAG226 (Login Room, Amaterasu City), event 935, after the President of MAGAMI gives himself up (WST...
@ STORY_NUMEMON_FOUND
WSTAG685 (Underground Cave, Byakko City), event 413: the rock blocking the hole is Numemon.
@ STORY_KNIGHTMON_REPROGRAMMED
WSTAG210 (Main Lobby, Asuka City), event 685: the A.o.A have reprogrammed Knightmon,...
@ STORY_MOVIE_BATTLES
WSTAG820, event 1080, with Snatchmon: each encounter plays MODE_BATTLE_MOVIE first.
@ STORY_CODE_PASSES_NEEDED
WSTAG685, event 690: Leader Chuck says stopping Knightmon takes the four City Leaders' Code Passes.
@ STORY_DE_SINCERITY
WSTAG460 (Reliability Spot), event 370: the Qing Long Chief, asked for the Digi-Egg of Knowledge,...
#define SPECIAL_STORY_ASUKA_HEADQUARTERS_TO_OPERATION_SIGMA
GAME.progress is from STORY_ASUKA_HEADQUARTERS to STORY_OPERATION_SIGMA (PROGRESS_RANGES[0x13])
#define SPECIAL_STORY_KNIGHTMON_REPROGRAMMED_TO_AMATERASU_BRIDGE
GAME.progress is from STORY_KNIGHTMON_REPROGRAMMED to STORY_AMATERASU_BRIDGE (PROGRESS_RANGES[4])
#define SPECIAL_STORY_SINCE_KNIGHTMON_REPROGRAMMED
GAME.progress is STORY_KNIGHTMON_REPROGRAMMED or later (PROGRESS_RANGES[8], to 0x63)
#define SPECIAL_STORY_KNIGHTMON_REPROGRAMMED_TO_BULBMON_FOUND
GAME.progress is from STORY_KNIGHTMON_REPROGRAMMED to STORY_BULBMON_FOUND (PROGRESS_RANGES[0x11])
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
A character of the field (FieldState.actors, a list of pointers up to NULL), which FIELDSTG_updateFie...
An event of the table FieldState.events, up to the first id -1, which FIELDSTG_startEvent starts.
void(* setFile)(s32 index, s32 file)
FIELDSTG_setMapFile.
void(* setFirstMap)(s32 index)
FIELDSTG_setFirstMap: the map the player starts on (GAME.mapIndex), when the mode is new.
s32 sheetEntry
the stage's sprite sheet, loaded before the field starts, or 0
FieldEvent * events
up to the first id -1
s32 soundBank
SOUND.loadBank's, or 0.
StageTile * objects
the map objects, up to the first margin 0
s32 imageFile
or an image archive file, or 0
Vec2 start
where the player starts
StageSlot * slots
up to the first type 0
ActorImage * actors
then the actors', from actors[2]
s32 mapFile
the file of the map's tiles (FIELDSTG_createMapStreamer)
s32 startDir
and its direction
s32 textFile
the stage's text file, for the talks
union FieldState::@12 images
s32 music
SOUND.playSound's, or 0.
What a character says (FIELDSTG_runActorAction): the first whose conditions hold, or the last,...
void(* applyAction)(s32 code, s32 value)
What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState....
The task a stage starts (startStage), updated by its updateStage.
void(* nextState)(struct StageTask *task)
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
u16 actor23Talk0Actions[]
u16 actor5Talk0Conditions[]
u16 actor13Talk1Actions[]
u16 actor9Talk0Conditions[]
u16 actor6Talk1Conditions[]
void endEvent690(void)
After event 690, with General: moves the story on to STORY_CODE_PASSES_NEEDED.
void endEvent421(void)
After event 421, with Numemon: sets flag 0x4020.
FieldActorEntry * stageActors[]
u16 actor13Talk0Conditions[]
void setupStage(void)
Sets the stage up: its map, actors and events, playing the ambience ENV_0020.
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
u16 actor9Talk1Conditions[]
u16 actor6Talk0Conditions[]
u16 actor22Talk0Actions[]
u16 actor5Talk1Conditions[]
u16 actor13Talk1Conditions[]
void endEvent413(void)
After event 413, with the player: moves the story on to STORY_NUMEMON_FOUND.