28 switch (task->
state) {
56 for (i = 0; i < 3; i++) {
81 for (j = 0; j < 3; j++) {
125 switch (task->
state) {
144#define STAGE_CHILDREN_SIZE 0x8
152#if VERSION_US || VERSION_JP
153#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_03)
154#define EVENT_TEXT_FILE (TEXT_EVENTS_200 - 1)
155#define STAGE_FILE 0x4A8
157#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_03)
158#define EVENT_TEXT_FILE (TEXT_EVENTS_200 - 1)
159#define STAGE_FILE 0x4B8
324 { 70, 4 }, { 71, 4 }, { 70, 4 }, { 71, 4 },
328 { 0x12C, 56 }, { 85, 6 }, { 86, 6 }, { 87, 4 },
329 { 88, 4 }, { 89, 4 }, { 90, 4 }, { 88, 4 },
330 { 89, 4 }, { 90, 4 }, { 88, 4 }, { 89, 4 },
331 { 90, 4 }, { 88, 4 }, { 89, 4 }, { 90, 4 },
332 { 88, 4 }, { 89, 4 }, { 90, 4 }, { 255, 0x3E7 },
335 { 0x12C, 16 }, { 72, 4 }, { 73, 4 }, { 74, 4 },
336 { 73, 4 }, { 75, 6 }, { 76, 6 }, { 77, 14 },
337 { 78, 114 }, { 79, 6 }, { 80, 6 }, { 81, 6 },
338 { 82, 6 }, { 83, 6 }, { 84, 8 }, { 255, 0x3E7 },
350 { 0x150, 0x112 }, { 112, 0x112 },
353 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
354 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
355 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
356 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
357 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
358 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
359 { 0x140, 0x100, 0x160, 0x180, 0x80, 0x80, 0x170, 0x1FE },
360 { 0x140, 0x100, 0x168, 0x180, 0xA0, 0x80, 0x160, 0x1FD },
361 { 0x140, 0x100, 0x160, 0x160, 0x80, 0x60, 0x170, 0x1FD },
362 { 0x140, 0x100, 0x152, 0x198, 0x48, 0x98, 0x150, 0x1FC },
363 { 0x140, 0x100, 0x15A, 0x198, 0x68, 0x98, 0x160, 0x1FC },
364 { 0x140, 0x100, 0x168, 0x160, 0xA0, 0x60, 0x170, 0x1FC },
365 { 0x140, 0x100, 0x14A, 0x190, 0x28, 0x90, 0x160, 0x1FB },
366 { 0x140, 0x100, 0x14A, 0x170, 0x28, 0x70, 0x170, 0x1FB },
482 { 0, 1, 0x50, 6, 0x46, 0, 0, 0, 0, 0, 336, 274, 0, 0 },
483 { 1, 0, 0x40, 6, 0x3F, 1, 0x3F, 0x42, 6, 0, 116, 258, 0, 0 },
484 { 1, 0, 0x40, 6, 0x3F, 1, 0x3F, 0x42, 6, 0, 228, 282, 0, 0 },
485 { 1, 0, 0x40, 6, 0x3F, 1, 0x3F, 0x42, 6, 0, 340, 258, 0, 0 },
486 { 1, 0, 0x40, 6, 0x3F, 1, 0x3F, 0x42, 6, 0, 355, 346, 0, 0 },
487 { 0, 2, 0x50, 4, 0x48, 0, 2, 0, 0, 0, 336, 227, 301, 0 },
488 { 0, 3, 0x50, 4, 0x55, 0, 0, 0, 0, 0, 336, 227, 294, 0 },
489 { 1, 0, 0x40, 4, 0x3B, 1, 0x3B, 0x3E, 6, 0, 116, 274, 300, 0 },
490 { 1, 0, 0x40, 4, 0x3B, 1, 0x3B, 0x3E, 6, 0, 228, 298, 324, 0 },
491 { 1, 0, 0x40, 4, 0x3B, 1, 0x3B, 0x3E, 6, 0, 340, 274, 300, 0 },
492 { 1, 0, 0x40, 4, 0x3B, 1, 0x3B, 0x3E, 6, 0, 355, 362, 388, 0 },
493 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
496 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x273, 0x2DA, 0x17E, 1, 0, 0, 0 },
497 { { {
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 SCRIPT_END
The commands of an event script (FieldEvent.script), as FIELDSTG_runEvent reads them: a halfword kind...
#define SCRIPT_LOOK_AT(snap, x, y)
FIELDSTG_pointCamera.
#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_MAP_FLOOR0
Some of FieldMap's maps (files): those of the floors the player walks on come first,...
#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_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 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...
void resetTileEffect(StageTileEffect *task)
Restarts the three animations of a StageTileEffect, from the stage's updateTileEffectFrames.
#define MUSIC_ADMIN_CENTER
KANRIBGM: the cities' Main Lobby, Admin Center, Digimon Arena, Master Room.
#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(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,...
s32 stepAnimationOnce(StageTileAnim *obj, AnimFrame *frames, s32 depth)
Steps OBJ's animation through FRAMES by the frame time (at most 4) and returns its frame,...
#define FLAG_OINKMON_CITIZENS_RESTORED
wstag435 Gale Tower: Airdramon spins the windmill and turns everyone back from Oinkmon; tested in 62 ...
@ 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 SPECIAL_STORY_ASUKA_HEADQUARTERS_TO_OPERATION_SIGMA
GAME.progress is from STORY_ASUKA_HEADQUARTERS to STORY_OPERATION_SIGMA (PROGRESS_RANGES[0x13])
#define FLAG_VEMMON_AT_HQ_SEEN
wstag311 event 934: looking for the Matrix System, the player finds Vemmon there; set at its end,...
#define SPECIAL_STORY_AMATERASU_BRIDGE_TO_PRESIDENT_ARRESTED
GAME.progress is from STORY_AMATERASU_BRIDGE to STORY_PRESIDENT_ARRESTED (PROGRESS_RANGES[0x14])
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 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,...
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)
Three map objects (animations 1 to 3) moved to (x, y) and animated once when the substate is set to 1...
void(* setSubstate)(struct StageTileEffect *task, s32 substate)
void(* nextState)(struct StageTileEffect *task)
void(* nextStep)(struct StageTileEffect *task)
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
u8 margin
how far off the view it is still drawn; 0 ends the table
u8 anim
which of a stage's animations sets frame (1-3); FIELDSTG finds objects by it (its lift,...
s16 sortY
drawn sorted at this y, or 0
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
void endEvent935(void)
After event 935, with Teddy, Kail and Kurt: moves the story on to STORY_PRESIDENT_ARRESTED.
void updateTileEffect(StageTileEffect *task)
Moves its map objects to (x, y) and animates them when the substate is set to 1.
s16 tileEffectPlaces[][2]
u16 actor9Talk0Conditions[]
u16 actor6Talk1Conditions[]
u16 actor3Talk0Conditions[]
AnimFrame * updateTileEffectFrames[]
Defined below, after the code that uses them.
FieldActorEntry * stageActors[]
void * createTileEffectTask(void)
Creates the effect of map objects that startTileEffect sets off (updateTileEffect)
u16 actor3Talk1Conditions[]
AnimFrame updateTileEffectFrames_0[]
void setupStage(void)
Sets the stage up: its map, actors and events, playing KANRIBGM; BGM_0029 instead except at STORY_PRE...
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
u16 actor9Talk1Conditions[]
void startTileEffect(StageTileEffect *task, s32 id)
Starts the effect at the place of map 0 or 1.
u16 actor6Talk0Conditions[]
AnimFrame updateTileEffectFrames_2[]
AnimFrame updateTileEffectFrames_1[]