8const CVECTOR
stageColor = { 0x80, 0x80, 0x80, 0x00 };
26 switch (task->
state) {
41#define STAGE_CHILDREN_SIZE 0x8
150#if VERSION_US || VERSION_JP
151#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_07)
152#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
153#define STAGE_FILE 0x741
155#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_07)
156#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
157#define STAGE_FILE 0x751
244 { 50, 4 }, { 51, 4 }, { 52, 4 }, { 53, 4 },
245 { 54, 4 }, { 55, 4 }, { 255, 0x3E7 },
248 { 0x12C, 4 }, { 56, 4 }, { 57, 4 }, { 58, 4 },
249 { 59, 4 }, { 60, 4 }, { 61, 4 }, { 62, 4 },
250 { 63, 4 }, { 64, 4 }, { 65, 4 }, { 66, 4 },
251 { 67, 4 }, { 255, 0x3E7 },
312 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
313 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
314 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
315 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
316 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
317 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
318 { 0x180, 0x100, 0x180, 0x158, 0x100, 0x58, 0x140, 0x1FB },
319 { 0x180, 0x100, 0x1A6, 0x158, 0x198, 0x58, 0x150, 0x1FB },
385 { 1, 0, 0x40, 4, 0x50, 1, 0x50, 0x63, 6, 0, 224, 601, 638, 0 },
386 { 1, 0, 0x40, 4, 0x50, 1, 0x50, 0x63, 5, 0, 253, 334, 371, 0 },
387 { 1, 0, 0x40, 4, 0x50, 1, 0x50, 0x63, 5, 0, 465, 242, 274, 0 },
388 { 1, 0, 0x40, 4, 0x50, 1, 0x50, 0x63, 6, 0, 607, 402, 441, 0 },
389 { 1, 0, 0x40, 4, 0x50, 1, 0x50, 0x63, 4, 0, 647, 343, 371, 0 },
390 { 1, 0, 0x40, 4, 0x50, 1, 0x50, 0x63, 4, 0, 699, 740, 781, 0 },
391 { 1, 0, 0x40, 4, 0x50, 1, 0x50, 0x63, 4, 0, 760, 579, 615, 0 },
392 { 1, 0, 0x40, 4, 0xA, 1, 0xA, 0x1D, 5, 0, 213, 576, 638, 0 },
393 { 1, 0, 0x40, 4, 0xA, 1, 0xA, 0x1D, 6, 0, 267, 297, 371, 0 },
394 { 1, 0, 0x40, 4, 0xA, 1, 0xA, 0x1D, 4, 0, 472, 403, 466, 0 },
395 { 1, 0, 0x40, 4, 0xA, 1, 0xA, 0x1D, 5, 0, 616, 385, 441, 0 },
396 { 1, 0, 0x40, 4, 0xA, 1, 0xA, 0x1D, 6, 0, 855, 692, 756, 0 },
397 { 1, 0, 0x40, 4, 0x1E, 1, 0x1E, 0x31, 5, 0, 331, 427, 493, 0 },
398 { 1, 0, 0x40, 4, 0x1E, 1, 0x1E, 0x31, 6, 0, 465, 211, 274, 0 },
399 { 1, 0, 0x40, 4, 0x1E, 1, 0x1E, 0x31, 4, 0, 698, 429, 493, 0 },
400 { 1, 0, 0x40, 4, 0x1E, 1, 0x1E, 0x31, 5, 0, 699, 715, 781, 0 },
401 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
404 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x2D2, 0x70, 0x2EC, 5, 0, 0, 0 },
405 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x2D4, 0x448, 0x288, 1, 0, 0, 0 },
406 { { {
FLAG_AMATERASU_FIRE_TRAP_9000_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x2328, 0, 0, 0, 0, 0, 0 },
407 { { {
FLAG_AMATERASU_FIRE_TRAP_9001_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x2329, 0, 0, 0, 0, 0, 0 },
408 { { {
FLAG_AMATERASU_FIRE_TRAP_9002_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x232A, 0, 0, 0, 0, 0, 0 },
409 { { {
FLAG_AMATERASU_FIRE_TRAP_9003_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x232B, 0, 0, 0, 0, 0, 0 },
410 { { {
FLAG_AMATERASU_FIRE_TRAP_9004_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x232C, 0, 0, 0, 0, 0, 0 },
411 { { {
FLAG_AMATERASU_FIRE_TRAP_9005_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x232D, 0, 0, 0, 0, 0, 0 },
412 { { {
FLAG_AMATERASU_FIRE_TRAP_9006_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x232E, 0, 0, 0, 0, 0, 0 },
413 { { {
FLAG_AMATERASU_FIRE_TRAP_9007_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x232F, 0, 0, 0, 0, 0, 0 },
414 { { {
FLAG_AMATERASU_FIRE_TRAP_9008_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x2330, 0, 0, 0, 0, 0, 0 },
415 { { {
FLAG_AMATERASU_FIRE_TRAP_9009_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x2331, 0, 0, 0, 0, 0, 0 },
416 { { {
FLAG_AMATERASU_FIRE_TRAP_9010_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x2332, 0, 0, 0, 0, 0, 0 },
417 { { {
FLAG_AMATERASU_FIRE_TRAP_9011_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x2333, 0, 0, 0, 0, 0, 0 },
418 { { {
FLAG_AMATERASU_FIRE_TRAP_9012_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x2334, 0, 0, 0, 0, 0, 0 },
419 { { {
FLAG_AMATERASU_FIRE_TRAP_9013_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x2335, 0, 0, 0, 0, 0, 0 },
420 { { {
FLAG_AMATERASU_FIRE_TRAP_9014_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x2336, 0, 0, 0, 0, 0, 0 },
421 { { {
FLAG_AMATERASU_FIRE_TRAP_9015_SPRUNG, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x2337, 0, 0, 0, 0, 0, 0 },
422 { { {
FLAG_FIRE_MASTER_WIN_SEEN, 0 }, {
SPECIAL_STORY_ASUKA_HEADQUARTERS_TO_OPERATION_SIGMA, 0 } },
SLOT_EVENT, 0x50F, 0, 0, 0, 0, 0, 0 },
423 { { {
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.
#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_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_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 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 FIELD_MAP_AREAS
a cell's value: its battle area (FieldBattles), or 0
#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 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 MUSIC_BATTLE
BATL0000: the maps' random battles (AreaBattle, nearly all of them)
#define MUSIC_DUNGEON
BGM_0023: the Ice, Fire and Dark Dungeons.
#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_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.
void * startEvents9000To9015(void)
Starts events 9000 to 9015 (updateEvent9015), with StagePartyChildren.
FIELDSTG's start of the stage (StageEntry.init in FIELDSTG_stages): the stage's task,...
#define FLAG_AMATERASU_FIRE_TRAP_9002_SPRUNG
wstag741 event 9002: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
#define FLAG_AMATERASU_FIRE_TRAP_9003_SPRUNG
wstag741 event 9003: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
@ STORY_PRESIDENT_ARRESTED
WSTAG226 (Login Room, Amaterasu City), event 935, after the President of MAGAMI gives himself up (WST...
@ STORY_AMATERASU_BRIDGE
WSTAG206 (Amaterasu Bridge), event 922: an Attacker holds the bridge.
@ STORY_MOVIE_BATTLES
WSTAG820, event 1080, with Snatchmon: each encounter plays MODE_BATTLE_MOVIE first.
#define FLAG_AMATERASU_FIRE_TRAP_9008_SPRUNG
wstag741 event 9008: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
#define FLAG_AMATERASU_FIRE_TRAP_9005_SPRUNG
wstag741 event 9005: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
#define SPECIAL_STORY_ASUKA_HEADQUARTERS_TO_OPERATION_SIGMA
GAME.progress is from STORY_ASUKA_HEADQUARTERS to STORY_OPERATION_SIGMA (PROGRESS_RANGES[0x13])
#define FLAG_DARK_MASTER_CHALLENGE_SEEN
wstag741 event 1296: the player challenges Dark Master; set at its end (gives the Mind Chip),...
#define FLAG_AMATERASU_FIRE_TRAP_9013_SPRUNG
wstag741 event 9013: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
#define FLAG_AMATERASU_FIRE_TRAP_9012_SPRUNG
wstag741 event 9012: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
#define FLAG_AMATERASU_FIRE_TRAP_9007_SPRUNG
wstag741 event 9007: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
#define FLAG_AMATERASU_FIRE_TRAP_9015_SPRUNG
wstag741 event 9015: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
#define FLAG_AMATERASU_FIRE_TRAP_9000_SPRUNG
wstag741 event 9000: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
#define FLAG_FIRE_MASTER_WIN_SEEN
wstag741 event 1295: Fire Master loses and gives the Mind Chip; set at its end, tested 0 to start it
#define FLAG_AMATERASU_FIRE_TRAP_9011_SPRUNG
wstag741 event 9011: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
#define SPECIAL_STORY_JUNGLE_SOUND_TO_BLACK_ID_PASS
GAME.progress is from STORY_JUNGLE_SOUND to STORY_BLACK_ID_PASS (PROGRESS_RANGES[0x15])
#define SPECIAL_STORY_SINCE_KNIGHTMON_REPROGRAMMED
GAME.progress is STORY_KNIGHTMON_REPROGRAMMED or later (PROGRESS_RANGES[8], to 0x63)
#define FLAG_AMATERASU_FIRE_TRAP_9004_SPRUNG
wstag741 event 9004: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
#define FLAG_AMATERASU_FIRE_TRAP_9001_SPRUNG
wstag741 event 9001: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
#define FLAG_AMATERASU_FIRE_TRAP_9010_SPRUNG
wstag741 event 9010: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
#define FLAG_AMATERASU_FIRE_TRAP_9009_SPRUNG
wstag741 event 9009: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
#define FLAG_AMATERASU_FIRE_TRAP_9006_SPRUNG
wstag741 event 9006: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
#define FLAG_AMATERASU_FIRE_TRAP_9014_SPRUNG
wstag741 event 9014: a Fire Dungeon trap (Amaterasu server) leaves the party at 1 HP; set at its end,...
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
One frame of a sprite animation; frame 0xFF ends it (or loops it)
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
CVECTOR spriteColor
the field's sprites' color, unless cd is 0
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...
AnimFrame * updateSpritePairFrames[]
u16 actor3Talk3Conditions[]
u16 actor2Talk1Conditions[]
void endEvent9011(void)
After the trap of event 9011 goes off: keeps it from going off again.
void endEvent9014(void)
After the trap of event 9014 goes off: keeps it from going off again.
const CVECTOR stageColor
the color the setup copies to FIELDSTG_state.spriteColor
u16 actor3Talk0Conditions[]
void endEvent9015(void)
After the trap of event 9015 goes off: keeps it from going off again.
FieldActorEntry * stageActors[]
u16 actor2Talk3Conditions[]
void endEvent1295(void)
After event 1295, with Fire Master: starts the stage's event battle 0 and keeps it from playing again...
u16 actor3Talk2Conditions[]
u16 actor3Talk1Conditions[]
void endEvent9005(void)
After the trap of event 9005 goes off: keeps it from going off again.
u16 actor2Talk2Conditions[]
void endEvent9013(void)
After the trap of event 9013 goes off: keeps it from going off again.
void endEvent9004(void)
After the trap of event 9004 goes off: keeps it from going off again.
void setupStage(void)
Sets the stage up: its map, actors, battles and events, playing BGM_0023.
void endEvent9006(void)
After the trap of event 9006 goes off: keeps it from going off again.
void endEvent9007(void)
After the trap of event 9007 goes off: keeps it from going off again.
void endEvent1296(void)
After event 1296, with Fire Master: gives the player the Mind Chip and keeps it from playing again.
void endEvent9001(void)
After the trap of event 9001 goes off: keeps it from going off again.
void endEvent9009(void)
After the trap of event 9009 goes off: keeps it from going off again.
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
void endEvent9000(void)
After the trap of event 9000 goes off: keeps it from going off again.
u16 actor2Talk0Conditions[]
void endEvent9010(void)
After the trap of event 9010 goes off: keeps it from going off again.
void endEvent9003(void)
After the trap of event 9003 goes off: keeps it from going off again.
s32 partyActorIds[]
Defined below, after the code that uses them.
AnimFrame updateSpritePairFrames_0[]
void endEvent9012(void)
After the trap of event 9012 goes off: keeps it from going off again.
AnimFrame updateSpritePairFrames_1[]
void endEvent9008(void)
After the trap of event 9008 goes off: keeps it from going off again.
void * createSpritePair(s32 x, s32 y)
Creates a StageSpritePair at (x, y)
void endEvent9002(void)
After the trap of event 9002 goes off: keeps it from going off again.
FieldBattles stageBattles[]