20 task->
dir = cell >> 5;
21 task->
index = cell & 0x1F;
43#if VERSION_EU || VERSION_JP
105#elif VERSION_EU || VERSION_JP
122 if (task->
dir == 4) {
125 arg = (task->
dir >> 1) + 6;
155 for (;
object->margin != 0;
object++) {
156 if (object->
anim ==
id) {
196 switch (task->
state) {
Balloon * FIELDSTG_createBalloon(s32 kind, s32 anim, s32 id)
Creates a balloon of a kind (its sprites) with an animation, under a task id.
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 ...
void FIELDSTG_leaveField(s32 mode, s32 arg, s32 x, s32 y, s32 dir)
Leaves the field for a mode now (the executable calls it by this name)
void FIELDSTG_leaveFieldAfter(s32 mode, s32 arg, s32 x, s32 y, s32 dir, s32 delay)
Leaves the field for a mode after a delay: the field task (FIELD_TASK_FIELD) goes to TASK_DONE,...
#define ACTOR_WALK_OUT
walks off through an exit (FIELDSTG_walkActorInDir)
#define SLOT_DEPTH
the player's depth, arg
#define SLOT_LAUNCH
sends the player flying (FIELDSTG_launchActor)
#define SLOT_WARP1
a warp (FieldWarp at arg) with effect and cutscene 1
#define SLOT_MAP
the map the player is on, arg (FieldMap.setMap)
#define SLOT_DEST(slot)
A slot's destination: its arg on, read as signed halfwords.
#define FIELD_TASK_ACTOR
every character (FIELDSTG_createActor)
#define SLOT_EVENT
starts the event arg
#define SLOT_GAUGE
the gauge game
#define SLOT_LAUNCH_OUT
the same, then leaves for mode arg
#define SLOT_EXIT
The kinds of StageSlot (type).
#define FIELD_MAP_TRIGGERS
a cell's value: a direction (3 bits) and a StageSlot (5)
#define SLOT_WARP0
the same with effect and cutscene 0
FIELDSTG.PRO: the field mode, where the player walks around the map.
FieldState FIELDSTG_state
u8 FIELDSTG_nearDirs[][8]
whether two directions are at most 45 degrees apart
PadState PAD
Controller input: cleared by initPad, then the methods.
TaskRegistry TASK_REGISTRY
A character on the field (FIELDSTG_createActor): the player (kind 0) and the other characters.
void(* walkInDir)(struct Actor *, s32 dir)
void(* warp)(struct Actor *, SlotDest *dest, s32 kind)
s32 depth
the layer's ordering table entry
void(* launch)(struct Actor *, SlotDest *dest)
void(* startSlide)(struct Actor *, s32 dir)
void(* stopSlide)(struct Actor *)
s32 frame
into its FIELDSTG_triggerAnims row
void(* setState)(struct Balloon *task, s32 state)
s32(* getCell)(s32 index, Vec2 *pos)
FIELDSTG_getMapCell.
void(* setMap)(s32 index)
FIELDSTG_setMap: the map the player is on.
s32 frozen
no control, triggers or encounters for the player: while the area name banner shows (FIELDSTG_createB...
s32 busy
an event, a warp, a launch or a battle has the player
StageTile * objects
the map objects, up to the first margin 0
StageSlot * slots
up to the first type 0
s32(* checkCondition)(u16 code, u16 value)
u16 place
where the last warp or trigger put the player (FieldBattles.id)
u16 placeArg
the place's argument, which the stage reads with it
s32(* getPressed)(s32 pad)
What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState....
u16 arg
by type: a mode, a depth, a map, an event or a height (in 16 pixels, plus 1 for a climb); a warp's an...
u16 conditions[2][2]
flag code and value, or code 0xFFFF
u16 place
copied to GAME.place, the place (FieldBattles.id)
u16 hideAnim
the animation of the map objects to hide, or 0
u16 placeArg
copied to GAME.placeArg: with place, the next stage's place points
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
u8 anim
which of a stage's animations sets frame (1-3); FIELDSTG finds objects by it (its lift,...
void *(* find)(s32 id, s32 key1, s32 key2)
The children of an Triggers.
The map's triggers (FIELDSTG_createTriggers): on a trigger's cell (layer 7: index and direction) the ...
s32 dir
the trigger's direction
s32 sheetEntry
the stage's sprite sheet (FieldState.sheetEntry); nothing reads it
void(* nextSubstate)(struct Triggers *task)
StageSlot * entries
FieldState.slots.
s32 index
the trigger under it
void(* nextState)(struct Triggers *task)
void(* setSubstate)(struct Triggers *task, s32 substate)
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
s32 FIELDSTG_findTrigger(Triggers *task)
Finds the slot under the player (FIELD_MAP_TRIGGERS); those up to SLOT_GAUGE count only while the pla...
void FIELDSTG_setOffTrigger(Triggers *task)
Sets off the slot the player pressed cross on.
Triggers * FIELDSTG_createTriggers(s32 sheetEntry, StageSlot *slots)
Creates the triggers.
s32 FIELDSTG_offerTrigger(Triggers *task, TriggerChildren *children)
Acts at once on a slot that does (SLOT_DEPTH...), or shows the balloon of one that waits for a button...
const Vec2 FIELDSTG_noOffset
void FIELDSTG_updateTriggers(Triggers *task, TriggerChildren *children)
The triggers' update: offers the slot under the player while the field isn't busy,...