31 if (stage->
state == 2) {
35 models->
add(models, 1, task->
key1, 0);
61 control = models->
get(models, 0);
73 control->
rot.
y = 0x800;
76 if (task->
key2 != 0) {
82 if (task->
key2 == 0) {
96 task->
clip0.h -= t * 2;
97 task->
clip1.h += t * 2;
98 task->
clip1.y -= t * 2;
99 if (task->
clip1.y <= 0) {
116 models->
setId(models, 1, 0);
117 control = models->
get(models, 0);
124 models->
face(models, 0);
133 control->
rot.
y = 0x800;
152 task->
clip0.h += t * 2;
153 task->
clip1.y += t * 2;
154 task->
clip1.h -= t * 2;
155 if (task->
clip0.h >= 240) {
170 switch (task->
step) {
202 switch (task->
state) {
208 switch (task->
step) {
253 stage->
setStage(stage, task->
key2 != 0 ? 0x1F : 0x1C, 0x20, 0x20);
273 switch (task->
step) {
291 switch (task->
step) {
322 if (stage->
state != 2) {
323 models->
face(models, 0);
FighterCache FIGHTSTG_fighterCache
the fighters' data, loaded one at a time
#define BATTLE_LAYER_WIREFRAME
the models' wireframe copies, in a Digimon change
#define BATTLE_TASK_CAMERA
#define BATTLE_TASK_MODELS
the fighters'
#define BATTLE_TASK_STAGE
#define BATTLE_LAYER_MODELS
FIGHTSTG.PRO: the battle.
static void startChange(DigimonChange *task, DigimonChangeChildren *children, Models *models, BattleCamera *camera)
Starts the change: the clips at the old Digimon whole, the camera on the partner, its wireframe layer...
static void wipeFromWireframe(DigimonChange *task, DigimonChangeChildren *children, Models *models)
Wipes the new Digimon in over its wireframe; once it's whole, hides the wireframe layer and starts th...
const SVECTOR FIGHTSTG_changeEndPos
static void wipeToWireframe(DigimonChange *task, DigimonChangeChildren *children, Models *models)
Wipes the old Digimon away into its wireframe; once it's all wireframe, hides its model layer and sta...
const SVECTOR FIGHTSTG_changeMidPos
void FIGHTSTG_updateDigimonChange(DigimonChange *task, DigimonChangeChildren *children)
A partner Digimon's change: a stage of its own (addNewDigimon), the new Digimon's model in front of a...
static void addNewDigimon(DigimonChange *task, Models *models, FightStage *stage)
Once the change's stage is set, plays the change sound and adds the new Digimon as model 1,...
static void swapInNewDigimon(DigimonChange *task, Models *models, BattleCamera *camera)
Puts the new Digimon in the partner's place (model 1 becomes model 0) with both layers on,...
DigimonChange * FIGHTSTG_startDigimonChange(s32 key1, s32 key2)
Starts a partner's Digimon change (FIGHTSTG_updateDigimonChange)
static void setChangeClips(DigimonChange *task)
Applies the wipe: clips BATTLE_LAYER_MODELS to clip0 and BATTLE_LAYER_WIREFRAME to clip1.
const SVECTOR FIGHTSTG_changeStartPos
where FIGHTSTG_updateDigimonChange's effects are: the first (1000, 1001 or 1007) when the old Digimon...
static void returnToBattle(DigimonChange *task, Models *models, BattleCamera *camera)
Goes back to the battle: shows model 0x10 again, gives the new Digimon its idle motion,...
GfxState GFX
GFX: the graphics state and its methods.
#define FILE_CHANGE
The images of a Digimon's change (FIGHTSTG_updateDigimonChange): entry 5.
FileCache FILE_CACHE
The file cache.
CameraView FIGHTSTG_fighterView
the view FIGHTSTG_getFighterView makes
TaskRegistry TASK_REGISTRY
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
SpriteEffect * FIGHTSTG_startSpriteEffect(s32 effect, const SVECTOR *pos)
Starts 2D effect effect (FIGHTSTG_spriteEffects) at pos; killed at once when it has no entry.
The battle camera (FIGHTSTG_createBattleCamera), registered as BATTLE_TASK_CAMERA on a layer: set put...
CameraView *(* getFighterView)(struct BattleCamera *task, s32 id, s32 camera)
CameraView *(* getEnemyView)(struct BattleCamera *task)
void(* set)(struct BattleCamera *task, CameraView *view)
void(* fade)(struct BattleCamera *task, CameraView *from, CameraView *to, s32 time)
from: NULL for the current
s32 music
the battle's music
s32 stage
the battle's fight stage
struct SpriteEffect * effects[4]
A partner Digimon's change (FIGHTSTG_startDigimonChange): key1 the new Digimon, key2 the side.
s32 file
the new Digimon's model's
void(* nextStep)(struct DigimonChange *task)
void(* nextState)(struct DigimonChange *task)
struct FightStage * stage
RECT clip0
BATTLE_LAYER_MODELS's.
RECT clip1
BATTLE_LAYER_WIREFRAME's.
struct BattleCamera * camera
s32 idleMotion
the old Digimon's
void(* setState)(struct DigimonChange *task, s32 state)
void(* nextSubstate)(struct DigimonChange *task)
The fight stage (FIGHTSTG_createStage), registered as BATTLE_TASK_STAGE: its model,...
void(* setStage)(struct FightStage *task, s32 stage, s32 fadeOutTime, s32 fadeInTime)
FighterInfo *(* getInfo)(s32 id)
s32(* isLoading)(s32 file)
void(* request)(s32 file)
void *(* getEntry)(u32 fileAndIndex)
s32(* getFrameTime)(void)
struct Layer *(* getLayer)(s32 id)
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
void(* setClipSize)()
no prototype: callers would truncate s16 args
void(* setClipPos)()
no prototype: callers would truncate s16 args
What drives a Model, owned by whoever created it.
s32 wireframe
they are drawn as wireframe (Mesh.drawWireframe)
s32 layerId
the layer its meshes are drawn in
struct ModelControl::@3 layers[2]
the model is drawn once for each one enabled
s32 motion
the motion to play
The fighters' models (FIGHTSTG_createModels), registered as BATTLE_TASK_MODELS: up to four,...
void(* setId)(struct Models *task, s32 id, s32 newId)
void(* face)(struct Models *task, s32 id)
ids under 0x10 are one side
void(* add)(struct Models *task, s32 id, s32 fighter, s32 visible)
ModelControl *(* get)(struct Models *task, s32 id)
short(* playSound)(s32 id)
returns the voice of a key-on
void *(* find)(s32 id, s32 key1, s32 key2)
Any task, seen through its header.
Uploads TIM images to VRAM (initTimLoader); acts on TIM_LOADER.
void(* setImagePos)()
(x, y)
void(* loadArchive)()
(archive): each image 64 halfwords to the right
void(* setState)(struct WhiteFlash *task, s32 state)
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
void initTimLoader(TimLoader *obj)
Clears a TIM loader, gives it its methods and binds it.
WhiteFlash * FIGHTSTG_startWhiteFlash(s32 frames)
Starts a white flash that whitens the screen over FRAMES.