10 switch (task->
state) {
25#define STAGE_CHILDREN_SIZE 4
44#if VERSION_US || VERSION_JP
45#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_01)
46#define EVENT_TEXT_FILE (TEXT_EVENTS_400 - 1)
47#define STAGE_FILE 0x775
49#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_01)
50#define EVENT_TEXT_FILE (TEXT_EVENTS_400 - 1)
51#define STAGE_FILE 0x784
198 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
199 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
200 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
201 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
202 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
203 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
204 { 0x180, 0x100, 0x1B0, 0x1D0, 0x1C0, 0xD0, 0x150, 0x1FF },
205 { 0x180, 0x100, 0x1A4, 0x140, 0x190, 0x40, 0x160, 0x1FF },
206 { 0x1C0, 0x100, 0x1D0, 0x100, 0x240, 0, 0x170, 0x1FF },
207 { 0x1C0, 0x100, 0x1D8, 0x100, 0x260, 0, 0x140, 0x1FE },
208 { 0x1C0, 0x100, 0x1E0, 0x100, 0x280, 0, 0x150, 0x1FE },
209 { 0x1C0, 0x100, 0x1E8, 0x100, 0x2A0, 0, 0x170, 0x1FE },
210 { 0x1C0, 0x100, 0x1D2, 0x128, 0x248, 0x28, 0x140, 0x1FD },
211 { 0x1C0, 0x100, 0x1DA, 0x128, 0x268, 0x28, 0x150, 0x1FD },
212 { 0x1C0, 0x100, 0x1E2, 0x128, 0x288, 0x28, 0x160, 0x1FD },
213 { 0x1C0, 0x100, 0x1EA, 0x132, 0x2A8, 0x32, 0x170, 0x1FD },
214 { 0x1C0, 0x100, 0x1F2, 0x132, 0x2C8, 0x32, 0x140, 0x1FC },
215 { 0x1C0, 0x100, 0x1C0, 0x13E, 0x200, 0x3E, 0x150, 0x1FC },
216 { 0x1C0, 0x100, 0x1C8, 0x148, 0x220, 0x48, 0x160, 0x1FC },
1050 { 1, 0, 0x4A, 2, 0, 1, 0, 3, 6, 0, 441, 290, 0, 0 },
1051 { 1, 0, 0x4A, 2, 0, 1, 0, 3, 6, 0, 817, 114, 0, 0 },
1052 { 1, 0, 0x4A, 2, 0, 1, 0, 3, 6, 0, 949, 528, 0, 0 },
1053 { 1, 0, 0x40, 2, 4, 1, 4, 7, 4, 0, 366, 274, 0, 0 },
1054 { 1, 0, 0x40, 2, 4, 1, 4, 7, 4, 0, 446, 241, 0, 0 },
1055 { 1, 0, 0x40, 2, 4, 1, 4, 7, 4, 0, 1129, 333, 0, 0 },
1056 { 1, 0, 0x80, 2, 0x24, 0, 0, 0, 0, 0, 469, 191, 0, 0 },
1057 { 1, 0, 0x80, 2, 0x25, 0, 0, 0, 0, 0, 256, 161, 0, 0 },
1058 { 1, 0, 0x40, 6, 8, 1, 8, 0xB, 4, 0, 411, 424, 0, 0 },
1059 { 1, 0, 0x40, 6, 8, 1, 8, 0xB, 4, 0, 538, 379, 0, 0 },
1060 { 1, 0, 0x40, 6, 8, 1, 8, 0xB, 4, 0, 568, 341, 0, 0 },
1061 { 1, 0, 0x40, 6, 8, 1, 8, 0xB, 4, 0, 607, 347, 0, 0 },
1062 { 1, 0, 0x40, 6, 8, 1, 8, 0xB, 4, 0, 976, 215, 0, 0 },
1063 { 1, 0, 0x40, 6, 0xC, 1, 0xC, 0xF, 4, 0, 544, 363, 0, 0 },
1064 { 1, 0, 0x40, 6, 0xC, 1, 0xC, 0xF, 4, 0, 579, 380, 0, 0 },
1065 { 1, 0, 0x40, 6, 0xC, 1, 0xC, 0xF, 4, 0, 884, 243, 0, 0 },
1066 { 1, 0, 0x40, 6, 0xC, 1, 0xC, 0xF, 4, 0, 913, 244, 0, 0 },
1067 { 1, 0, 0x40, 6, 0xC, 1, 0xC, 0xF, 4, 0, 1020, 218, 0, 0 },
1068 { 1, 0, 0x40, 6, 0x10, 1, 0x10, 0x12, 4, 0, 906, 526, 0, 0 },
1069 { 1, 0x64, 0x40, 6, 0x1B, 0, 0, 0, 0, 0, 721, 200, 0, 0 },
1070 { 1, 0x65, 0x40, 6, 0x1C, 0, 0, 0, 0, 0, 451, 367, 0, 0 },
1071 { 1, 0, 0x40, 4, 8, 1, 8, 0xB, 4, 0, 448, 405, 445, 0 },
1072 { 1, 0, 0x40, 4, 0xC, 1, 0xC, 0xF, 4, 0, 465, 438, 464, 0 },
1073 { 1, 0, 0x40, 4, 0xC, 1, 0xC, 0xF, 4, 0, 737, 256, 281, 0 },
1074 { 1, 0, 0x40, 4, 0x18, 0, 0, 0, 0, 0, 898, 552, 576, 0 },
1075 { 1, 0, 0x40, 4, 0x19, 0, 0, 0, 0, 0, 727, 260, 280, 0 },
1076 { 1, 0, 0x40, 4, 0x1A, 0, 0, 0, 0, 0, 447, 417, 444, 0 },
1077 { 1, 0, 0x64, 4, 0x1D, 0, 0, 0, 0, 0, 784, 496, 560, 0 },
1078 { 1, 0, 0x64, 4, 0x1E, 0, 0, 0, 0, 0, 768, 488, 552, 0 },
1079 { 1, 0, 0x64, 4, 0x1F, 0, 0, 0, 0, 0, 752, 480, 544, 0 },
1080 { 1, 0, 0x64, 4, 0x20, 0, 0, 0, 0, 0, 736, 472, 536, 0 },
1081 { 1, 0, 0x64, 4, 0x21, 0, 0, 0, 0, 0, 720, 464, 528, 0 },
1082 { 1, 0, 0x64, 4, 0x22, 0, 0, 0, 0, 0, 704, 456, 520, 0 },
1083 { 1, 0, 0x64, 4, 0x23, 0, 0, 0, 0, 0, 672, 456, 496, 0 },
1084 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1087 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x229, 0x448, 0xF8, 1, 0, 0, 0 },
1088 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x230, 0xC8, 0x1A4, 5, 0, 0, 0 },
1089 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x230, 0x1B8, 0x204, 3, 0x64, 0, 0 },
1090 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x22F, 0x208, 0x1AC, 3, 0x65, 0, 0 },
1091 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x231, 0x1A7, 0x254, 3, 0, 0, 0 },
1092 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_CLIMB_DOWN, 6, 0x400, 0x120, 0, 0, 0, 0 },
1093 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_CLIMB_UP, 6, 0x410, 0x188, 0, 0, 0, 0 },
1094 { { {
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 FIELD_MAP_FLOOR0
Some of FieldMap's maps (files): those of the floors the player walks on come first,...
#define FIELD_COMMAND_ICON3
its substate 3, with ITEM_GET
#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 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 EVENT_BATTLE(id)
action: FIELDSTG_battleFuncs.startEventBattle
#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...
#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 PARTY_STAT(id)
checkPartyStat
#define CARD_BATTLE(opponent, kind)
action: startCardBattle
#define MUSIC_SEIRYU_CITY
SEIR_BGM: Seiryu City.
#define MUSIC_CITY_CRISIS
BGM_0029: the cities and their streets instead of their music while the story is at a crisis (Knightm...
#define MUSIC(bank, n)
A field's or a battle's music (FieldState.music, Battle.music): track (SEP) n of the first sequence o...
#define MUSIC_BATTLE_1
BATL1000: the Digimon Arena's battles and some event battles (AreaBattle)
#define MUSIC_BANK(music)
The sound bank of a music, which a stage loads for it (FieldState.soundBank)
#define MUSIC_BOSS_1
BOSS_001: the Digimon Arena's, the cities', the dungeons' and the A.o.A's boss battles.
FIELDSTG's start of the stage (StageEntry.init in FIELDSTG_stages): the stage's task,...
#define FLAG_GUILMON_DDNA_REQUESTED
wstag420: DRI Jimmy asks the player to get Guilmon DDNA from WarGrowlmon; tested in wstag490 with the...
#define SPECIAL_PARTY_LEVEL_TOTAL_60
the party's levels add up to 60 or more (2 * 15 + 30)
#define SPECIAL_STORY_JUNGLE_SOUND_TO_AMATERASU_BRIDGE
GAME.progress is from STORY_JUNGLE_SOUND to STORY_AMATERASU_BRIDGE (PROGRESS_RANGES[0x12])
#define SPECIAL_STORY_JUNGLE_SOUND_TO_NETWORK_OFFLINE
GAME.progress is from STORY_JUNGLE_SOUND to STORY_NETWORK_OFFLINE (PROGRESS_RANGES[0x19])
@ STORY_PRESIDENT_ARRESTED
WSTAG226 (Login Room, Amaterasu City), event 935, after the President of MAGAMI gives himself up (WST...
@ STORY_BYAKKO_LEADER_FOUGHT
WSTAG620 (the rebels' hideout), event 534: the Byakko Leader takes the player for the A....
@ STORY_SEPIKMON_MASK_LOST
WSTAG480 (Jungle Grave), event 171: Sepikmon will say how to beat Zanbamon once the player finds his ...
@ STORY_GUNSLINGER
WSTAG810 (Gunslinger 1F), event 1035.
@ STORY_GENJI_BEATEN
WSTAG200, event 52: after the first battle, won against Tamer Genji (event 50), the Digimon Navi give...
@ STORY_TEDDY_FOUND
WSTAG212, event 352: Teddy is found; MAGAMI is part of the A.o.A, and the player sets off to beat the...
@ STORY_LOOKING_FOR_TEDDY
WSTAG212, event 273: Kail and the player will put on the Agumon Suits to look for Teddy.
@ STORY_MOVIE_BATTLES
WSTAG820, event 1080, with Snatchmon: each encounter plays MODE_BATTLE_MOVIE first.
@ STORY_ASUKA_HEADQUARTERS
WSTAG310 (A.o.A Headquarters, Asuka City), event 961.
@ STORY_SEIRYU_BADGE
WSTAG420, event 71: the Seiryu Leader is beaten (the Silver ID and the Seiryu Badge),...
@ STORY_REAL_WORLD
WSTAG750 (the emergency Matrix Chamber), event 820: back in the real world, for 180 seconds.
@ STORY_FAKE_BLUE_CARD
WSTAG410 (East Station), event 90: the Blue Card the player was given turns out to be a fake.
@ STORY_NETWORK_OFFLINE
WSTAG750, event 886: the news say the Optical Network is offline.
#define SPECIAL_STORY_ASUKA_HEADQUARTERS_TO_OPERATION_SIGMA
GAME.progress is from STORY_ASUKA_HEADQUARTERS to STORY_OPERATION_SIGMA (PROGRESS_RANGES[0x13])
#define SPECIAL_GUILMON_UNLOCKED
PARTNER_GUILMON is unlocked.
#define FLAG_KEITH_NICK_SEARCH_STARTED
wstag620 Secret Room: set after event 540; then Lisa says "Find Keith and Nick" and people in 10 stag...
#define SPECIAL_STORY_GENJI_BEATEN_TO_PRESIDENT_ARRESTED
GAME.progress is from STORY_GENJI_BEATEN to STORY_PRESIDENT_ARRESTED (PROGRESS_RANGES[0x1A])
#define FLAG_FAKE_BLUE_CARD_TALKED
wstag420 Seiryu City: a Guilmon says the card is a fake by Trickster Guilmon, hiding underground; the...
#define FLAG_DRI_JIMMY_TALKED
wstag420 Seiryu City: DRI Jimmy introduces himself as a DRI researcher once; set there,...
#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_DE_SINCERITY_TO_LISA_SAVED
GAME.progress is from STORY_DE_SINCERITY to STORY_LISA_SAVED (PROGRESS_RANGES[0xF])
#define FLAG_CARD_BATTLE_WON
set by updateModeFlags on the way back from a card battle: 1 if the player won it (FLAGS_00....
#define SPECIAL_STORY_GENJI_BEATEN_TO_GAME_MASTER_CAUGHT
GAME.progress is from STORY_GENJI_BEATEN to STORY_GAME_MASTER_CAUGHT (PROGRESS_RANGES[1])
#define SPECIAL_PARTY_LEVEL_TOTAL_30
the party's levels add up to 30 or more (0 * 15 + 30)
#define FLAG_SEPIKMON_LOST_MASK_SEEN
wstag475 Shaman House event 180: the player meets maskless Sepikmon ("A monster!"),...
#define FLAG_CARD_BATTLE_ENDED
set by updateModeFlags on the way back from a card battle; the talks that follow one test it and clea...
#define SPECIAL_STORY_SEIRYU_BADGE_TO_ZANBAMON_DRIVEN_OFF
GAME.progress is from STORY_SEIRYU_BADGE to STORY_ZANBAMON_DRIVEN_OFF (PROGRESS_RANGES[0xE])
#define SPECIAL_UNLOCK_GUILMON
an action: unlocks PARTNER_GUILMON; the talks that take or give its DDNA apply it
#define SPECIAL_GUILMON_LOCKED
PARTNER_GUILMON is still locked.
#define FLAG_CHRIS_FOUGHT
wstag420 (Seiryu City): Tamer Chris says "All right then! Digimon Battle!" and starts a Digimon battl...
#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...
#define SPECIAL_STORY_KNIGHTMON_REPROGRAMMED_TO_BULBMON_FOUND
GAME.progress is from STORY_KNIGHTMON_REPROGRAMMED to STORY_BULBMON_FOUND (PROGRESS_RANGES[0x11])
#define FLAG_SEIRYU_LEADER_WIN_SEEN
wstag420 event 70: Seiryu Leader loses and gives the player his badge; set at its end,...
#define SPECIAL_STORY_BYAKKO_LEADER_FOUGHT_TO_CONTROL_ROOM
GAME.progress is from STORY_BYAKKO_LEADER_FOUGHT to STORY_CONTROL_ROOM (PROGRESS_RANGES[0x10])
#define SPECIAL_STORY_SINCE_GENJI_BEATEN
GAME.progress is STORY_GENJI_BEATEN or later (PROGRESS_RANGES[6], to 0x63)
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
A battle of an area's BattleList, which can start on the field (see FIELDSTG_startEncounter); FIGHTST...
The battles of an area of the map (its cells' value at FieldMap.files[4]), one picked at random.
A character of the field (FieldState.actors, a list of pointers up to NULL), which FIELDSTG_updateFie...
The battles of a place (FieldState.battles), by area of the map: the fourth area's are also the ones ...
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)
s32(* checkCondition)(u16 code, u16 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 actor41Talk2Actions[]
u16 actor0Talk0Conditions[]
u16 actor45Talk1Conditions[]
u16 actor18Talk5Conditions[]
u16 actor58Talk0Conditions[]
u16 actor0Talk1Conditions[]
u16 actor2Talk1Conditions[]
u16 actor16Talk5Conditions[]
u16 actor18Talk6Conditions[]
u16 actor15Talk6Actions[]
u16 actor18Talk2Actions[]
void endEvent70(void)
After event 70, with Seiryu Leader: lets event 71 start and starts the stage's event battle 1.
u16 actor16Talk2Conditions[]
u16 actor58Talk2Conditions[]
u16 actor1Talk1Conditions[]
u16 actor3Talk0Conditions[]
u16 actor18Talk4Conditions[]
u16 actor15Talk2Conditions[]
u16 actor16Talk4Conditions[]
u16 actor15Talk3Conditions[]
u16 actor0Talk3Conditions[]
FieldActorEntry * stageActors[]
u16 actor2Talk3Conditions[]
u16 actor15Talk6Conditions[]
u16 actor31Talk3Conditions[]
u16 actor16Talk3Conditions[]
u16 actor41Talk6Conditions[]
u16 actor18Talk1Conditions[]
u16 actor16Talk0Actions[]
u16 actor14Talk1Actions[]
u16 actor1Talk0Conditions[]
u16 actor41Talk3Actions[]
u16 actor31Talk2Conditions[]
u16 actor0Talk4Conditions[]
u16 actor3Talk1Conditions[]
u16 actor15Talk5Conditions[]
u16 actor58Talk0Actions[]
u16 actor2Talk2Conditions[]
u16 actor31Talk4Conditions[]
u16 actor31Talk0Conditions[]
void endEvent71(void)
After event 71, with Seiryu Leader: gives the player the Silver ID and the Seiryu Badge and moves the...
u16 actor16Talk6Conditions[]
u16 actor18Talk6Actions[]
u16 actor15Talk1Conditions[]
u16 actor14Talk1Conditions[]
u16 actor41Talk4Conditions[]
void setupStage(void)
Sets the stage up: its map, actors, battles and events, playing SEIR_BGM; BGM_0029 instead at story s...
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
u16 actor16Talk1Conditions[]
u16 actor41Talk0Conditions[]
u16 actor41Talk2Conditions[]
u16 actor38Talk0Actions[]
u16 actor31Talk1Conditions[]
u16 actor15Talk2Actions[]
u16 actor31Talk0Actions[]
u16 actor41Talk1Conditions[]
u16 actor2Talk0Conditions[]
u16 actor15Talk3Actions[]
u16 actor0Talk2Conditions[]
u16 actor18Talk3Conditions[]
u16 actor41Talk6Actions[]
u16 actor16Talk2Actions[]
u16 actor16Talk3Actions[]
u16 actor14Talk2Actions[]
u16 actor16Talk0Conditions[]
u16 actor45Talk0Conditions[]
u16 actor18Talk3Actions[]
u16 actor18Talk2Conditions[]
u16 actor58Talk1Conditions[]
u16 actor14Talk2Conditions[]
u16 actor41Talk3Conditions[]
u16 actor15Talk0Conditions[]
u16 actor2Talk4Conditions[]
u16 actor15Talk0Actions[]
u16 actor41Talk5Conditions[]
u16 actor18Talk0Conditions[]
u16 actor15Talk4Conditions[]
u16 actor18Talk0Actions[]
u16 actor16Talk6Actions[]
FieldBattles stageBattles[]
u16 actor14Talk0Conditions[]