1#ifndef FIGHTSTG_EFFECT_H
2#define FIGHTSTG_EFFECT_H
13#define FILE_CHANGE 0x8A2
14#elif VERSION_US || VERSION_JP
15#define FILE_CHANGE 0x891
20#define FILE_ENTRANCE_1D2 0x6E2
21#elif VERSION_US || VERSION_JP
22#define FILE_ENTRANCE_1D2 0x6D3
FIGHTSTG's shared declarations: the headers it builds on, the ids its tasks register with,...
void FIGHTSTG_updateSpriteAnim(SpriteAnim *task)
A frame-by-frame animation of a 2D effect: reads its flags, stride, duration and first values from da...
s32 FIGHTSTG_runScriptModel(BattleScript *script, BattleScriptChildren *children)
The battle script's model command, on the model given by FIGHTSTG_getScriptModel: 0 plays a motion (0...
SpriteEffectEntry FIGHTSTG_spriteEffects[]
the 2D effects, ended by an id of -1; the European version's differ
void FIGHTSTG_updateBattleScript(BattleScript *script, BattleScriptChildren *children)
The battle script's task: finds the fighter's effect archive and its script (loading sound bank 0x46 ...
void FIGHTSTG_runScriptCamera(BattleScript *script, BattleScriptChildren *children)
The battle script's camera command: the time of the fade (0 to cut), then the enemy's view,...
BattleScript * FIGHTSTG_createBattleScript(void)
Creates a battle script, which plays a technique (FIGHTSTG_updateBattleScript)
SpriteAnim * FIGHTSTG_createSpriteAnim(s16 *data, SVECTOR *pos, s32 sheet, Vec2 *texPos, s32 layerId)
Creates a sprite animation from data at pos, with frames of sheet (textures at texPos) on layer layer...
void FIGHTSTG_updateHitEffect(HitEffect *task, HitEffectChildren *children)
Loads effect 0x33, then turns the camera to the enemy's view, plays the effect with a sound and,...
void FIGHTSTG_runScriptFade(BattleScript *script, WhiteFlash **fade)
The battle script's fade command: 0 fades the screen out over the frames in the script,...
EffectSheet FIGHTSTG_effectSheets[]
the 2D effects' sheets; the European version's differ
void FIGHTSTG_drawSpriteAnim(void *arg, Layer *layer)
A layer callback that draws a sprite animation's frame: at its projected position,...
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...
WhiteFlash * FIGHTSTG_startWhiteFlash(s32 frames)
Starts a white flash that whitens the screen over FRAMES.
s32 FIGHTSTG_findEffectSheet(s32 effect, s32 *images, s32 *sheet, Vec2 *texPos)
Finds 2D effect effect's sheet (FIGHTSTG_spriteEffects, FIGHTSTG_effectSheets) and gives its values; ...
void FIGHTSTG_nop(void)
Empty, and nothing calls it.
void FIGHTSTG_drawWhiteFlash(WhiteFlash *task)
Draws the white flash: a full-screen quad of the task's level, added to the screen on layer BATTLE_LA...
SpriteEffect * FIGHTSTG_startSpriteEffect(s32 effect, const SVECTOR *pos)
Starts 2D effect effect (FIGHTSTG_spriteEffects) at pos; killed at once when it has no entry.
s32 FIGHTSTG_runScriptEffectModel(BattleScript *script, BattleScriptChildren *children)
The battle script's effect model command: 0 starts effect model ID at a position and rotation in the ...
s32 FIGHTSTG_runScriptWait(BattleScript *script, BattleScriptChildren *children)
The battle script's wait command: waits the time in the script, returning 0 until it is over.
BattleSound * FIGHTSTG_playBattleSound(s32 index, s32 time)
Plays battle sound index (FIGHTSTG_battleSounds; 0x5A the battle's music, 0x5B stops sound 0x20040006...
s32 FIGHTSTG_runScriptStage(BattleScript *script, BattleScriptChildren *children)
The battle script's stage command (0x38 the script's own stage, -1 none): 0 changes the fight stage (...
void FIGHTSTG_updateBattleSound(BattleSound *task)
The battle sound's task: keys its sound off once its time is up.
HitEffect * FIGHTSTG_startHitEffect()
WFIGHTMN passes the damage as a third argument, which it doesn't read; its code loads it,...
void FIGHTSTG_updateSpriteEffect(SpriteEffect *task, SpriteAnim **children)
A 2D effect's task: starts a sprite animation for each entry of its archive (up to 30),...
s32 FIGHTSTG_runScriptEffect(BattleScript *script, BattleScriptChildren *children)
The battle script's effect command: 0 starts sprite effect EFFECT (9999 the script's own) at a positi...
void FIGHTSTG_drawFader(ScreenFade *task)
void FIGHTSTG_updateWhiteFlash(WhiteFlash *task)
The white flash's task: brightens up to full white and holds it, then once ended (FIGHTSTG_endWhiteFl...
void FIGHTSTG_updateFader(ScreenFade *task)
The screen fade's task: src/shared/update_fader.inc.c, but for its first state, which sets TASK_RUN w...
void FIGHTSTG_startFader(ScreenFade *task, s32 fadeIn, s32 duration)
s32 FIGHTSTG_battleSounds[]
sound ids
ScreenFade * FIGHTSTG_createFader(void)
Creates the screen fade, idle until started, on layer BATTLE_LAYER_FRONT.
void FIGHTSTG_runScriptSound(BattleScript *script, BattleScriptChildren *children)
The battle script's sound command: plays a battle sound for a time (0x62 and 0x63 the hit's sound,...
s32 FIGHTSTG_getScriptModel(BattleScript *script, s32 type)
Shared between the overlay's objects.
DigimonChange * FIGHTSTG_startDigimonChange(s32 key1, s32 key2)
Starts a partner's Digimon change (FIGHTSTG_updateDigimonChange)
Entrance * FIGHTSTG_startEntrance(s32 id, s32 side, s32 weak)
The tasks FIGHTSTG starts for WFIGHTMN and WFIGHTTS.
void FIGHTSTG_endWhiteFlash(WhiteFlash *task, s32 frames)
Fades the white flash back out over FRAMES.
void FIGHTSTG_updateEntrance(Entrance *task, WhiteFlash **children)
A fighter's entrance: loads its model and adds it, then shows it behind a fade (FIGHTSTG_startWhiteFl...
void FIGHTSTG_runScriptHits(BattleScript *script, BattleScriptChildren *children)
The battle script's hit command: 0 starts the other side's script for the last hit's result,...
#define TASK_HEADER(Type)
FIGHTSTG's models: meshes and their drawing, bones, motions, the models task and its controls,...
The battle camera (FIGHTSTG_createBattleCamera), registered as BATTLE_TASK_CAMERA on a layer: set put...
The battle script's children.
SpriteEffect * spriteEffects[8]
BattleScript * script
one it plays
A fighter's battle script (FIGHTSTG_updateBattleScript): a list of s16 commands in an archive entry o...
s32 hitsPlayed
how many hits command 5 has played
s32 enemy
the script is the enemy's (nonzero) or the partner's
s32 soundsPlayed
and the sound commands
s32 unk74
HitEffect.unk5C; nothing reads it.
s32 sound
what the sound commands' 0x62 and 0x63 stand for on a hit
s32 effect
the sprite effect the effect command's 9999 stands for
s32 pad
never read or written
s32 effectImages
FIGHTSTG_findEffectSheet's.
s32 hits[4]
0 a hit, 3 a miss; [3] how it ended
s32 model
the Models task's id
s32 index
the script, in the fighter's archive
s32 loadStep
FIGHTSTG_runScriptEffect's, loading a 2D effect.
s32 stage
what the stage command's 0x38 stands for
A battle sound (FIGHTSTG_playBattleSound) that is keyed off after time.
struct SpriteEffect * effects[4]
Task * unused
a child slot nothing fills
A partner Digimon's change (FIGHTSTG_startDigimonChange): key1 the new Digimon, key2 the side.
s32 file
the new Digimon's model's
struct FightStage * stage
RECT clip0
BATTLE_LAYER_MODELS's.
RECT clip1
BATTLE_LAYER_WIREFRAME's.
struct BattleCamera * camera
s32 idleMotion
the old Digimon's
Shows an effect's model at a place until its motion ends (FIGHTSTG_startEffectModel)
A sprite sheet for the battle's 2D effects: an archive of animations, the sheet and where its texture...
s32 images
the archive of TIMs a script loads for it, 0 for none
A fighter's entrance (FIGHTSTG_startEntrance): key1 its Digimon, key2 its side.
s32 weak
it comes in with motion 2 (WFIGHTMN_setIdleMotion's weak one)
struct FightStage * stage
struct BattleCamera * camera
The fight stage (FIGHTSTG_createStage), registered as BATTLE_TASK_STAGE: its model,...
FIGHTSTG_updateHitEffect's children.
FIGHTSTG_startHitEffect's task: the enemy's view, effect 0x33 on the player's fighter,...
struct BattleCamera * camera
s32 effectImages
FIGHTSTG_findEffectSheet's.
s32 unk5C
FIGHTSTG_startHitEffect's second argument: 1 from WFIGHTMN, 0 from WFIGHTTS; the script's unk74.
s32 result
1 a hit, 2 a knockout: the script is result + 1
s32 sheet
its file in the high half
A ModelControl's jump (FIGHTSTG_startJump): up and down from its y, or for kinds 4 and 5 also forward...
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
The fighters' models (FIGHTSTG_createModels), registered as BATTLE_TASK_MODELS: up to four,...
FIGHTSTG_startMove's task: moves a ModelControl to a position.
Fades the whole screen to black and back with a subtractive rectangle.
One animation of a 2D effect (FIGHTSTG_createSpriteAnim), drawn by a layer callback.
SVECTOR pos
vz 0x7FFF: on screen in front, -1: on screen
s32 stride
of a frame's values
s16 v[2]
x, y; 0x1000 = 1.0
union SpriteAnim::@0 scale
s32 both
to test the two at once
A 2D effect: its sheet in FIGHTSTG_effectSheets and its animations, an archive of SpriteAnim data; th...
A 2D effect (FIGHTSTG_startSpriteEffect): a SpriteAnim per animation, killed when they all are.
Any task, seen through its header.
The white flash (FIGHTSTG_startWhiteFlash): fades the screen to white, and back once ended.
s32 level
added to the screen (white), 0-0xFF
s32 speed
0xFF / the frames