28 fighter->
hp += task->
args[1];
39 task->
args[1] = fighter->
mp;
45 enemy->
mp += task->
args[1];
49 fighter->
mp -= task->
args[1];
100 task->
args[0] = 0x20;
104 task->
args[0] = 0x21;
108 task->
args[0] = 0x44;
111 task->
args[0] = 0x33;
114 task->
args[0] = 0x34;
117 task->
args[0] = 0x4C;
120 task->
args[0] = 0x48;
124 task->
args[1] = (task->
side == 0) << 4;
141 switch (task->
state) {
153 for (i = 0; i < 0x25; i++) {
156 side = task->
side >> 4;
171 drainHp(task, children, fighter);
193 if (task->
step == 0) {
198 if (children[0].task ==
NULL) {
ActionEvents * FIGHTSTG_startActionEvents(s32 side)
Starts running the current action's events for SIDE (FIGHTSTG_updateActionEvents)
static void stealEnemyItem(ActionEvents *task, BattleChild *children)
Takes the enemy's item into the bag (up to 99) and says so.
static void drainMp(ActionEvents *task, BattleChild *children)
Moves the drained MP (as much as the partner has) from the partner to the enemy, up to its max MP,...
static void showRaisedStatus(ActionEvents *task, BattleChild *children)
Says which status (bit 0, 1 or 2 of the event's flags) the technique raises.
static void showNextRaisedStatus(ActionEvents *task, BattleChild *children)
Says the next status the technique raises and clears its bit, so the event runs again for the remaini...
static void drainHp(ActionEvents *task, BattleChild *children, BattleFighter *fighter)
Heals FIGHTER by the drained HP (up to its max HP) and says so.
static void applyStatusEvent(ActionEvents *task, BattleChild *children, s32 i)
Applies event I's status or battle effect (a poison, a lowered stat, an escape...) and shows its mess...
void FIGHTSTG_updateActionEvents(ActionEvents *task, BattleChild *children)
Runs the queued battle events: the first flag set in FIGHTSTG_action.effects picks the step,...
BattleAction FIGHTSTG_action
the command being carried out
Battle FIGHTSTG_battle
the battle: its fighters, speed and drawing functions
void FIGHTSTG_startRestriction(s32 tech)
Restricts the partner with technique tech: sets FIGHTER_NO_SWITCH or FIGHTER_NO_DIGIVOLVE by the tech...
#define TECH_EFFECT_POISON
#define TECH_EFFECT_MULTI_HIT
#define TECH_EFFECT_SLEEP
#define TECH_EFFECT_CONFUSION
#define BATTLE_FLED
How a battle ends (FIGHTSTG_endBattle)
#define TECH_EFFECT_PARALYSIS
#define TECH_EFFECT_DRAIN_MP
the partner's, in 128ths of its max MP
#define TECH_EFFECT_ENEMY_ONLY
does nothing but for the enemy whose battle table entry lists it first
#define TECH_EFFECT_END_BATTLE
in BATTLE_KIND_UNK2: takes 70 percent of the partner's HP, ends as BATTLE_FLED
#define TECH_EFFECT_DRAIN
HP, in 128ths of the damage.
#define TECH_EFFECT_RAISE_ALL_STATUS
#define TECH_EFFECT_LOWER_DEFENSE
#define TECH_EFFECT_NO_SWITCH
FIGHTER_NO_SWITCH for a while.
#define TECH_EFFECT_LOWER_ATTACK
#define TECH_EFFECT_STEAL
the enemy's item
#define TECH_EFFECT_RAISE_EACH_STATUS
each one that a roll lets
#define FIGHTER_ASLEEP
can't act or run away; a hit may wake it up
#define TECH_EFFECT_RAISE_ONE_STATUS
PartnerStats.status: one at random.
#define TECH_EFFECT_CRITICAL
raises the critical hit chance
void FIGHTSTG_inflictConfusion(u8 side, s32 fromTech, u8 strength)
Confuses side's active fighter (FIGHTER_CONFUSED) with a strength, and queues its end (put off by the...
void FIGHTSTG_inflictParalysis(u8 side, s32 unused, u8 strength)
Paralyzes side's active fighter (FIGHTER_PARALYZED) with a strength, and queues its end,...
void FIGHTSTG_inflictPoison(u8 side, s32 fighter, s32 damage)
Poisons a fighter (FIGHTER_POISONED), and queues its damage or updates the one already queued.
void FIGHTSTG_inflictSleep(u8 side, s32 unused, u8 strength)
Puts side's active fighter to sleep (FIGHTER_ASLEEP) with a strength, and queues its end,...
void FIGHTSTG_endBattle(s32 result)
Ends the battle: queues event 1 ahead of the others, with how it ended (BATTLE_FLED,...
FIGHTSTG.PRO: the battle.
GameState GAME
The save data, the game mode and the methods.
BattleMessageBox * FIGHTSTG_createMessage(void)
Creates a battle message box (FIGHTSTG_updateMessage)
FIGHTSTG_updateActionEvents's task (FIGHTSTG_startActionEvents)
void(* setSubstate)(struct ActionEvents *task, s32 substate)
void(* nextState)(struct ActionEvents *task)
s32 drain
the HP or MP that TECH_EFFECT_DRAIN or TECH_EFFECT_DRAIN_MP takes
u8 effects[0x28]
by TECH_EFFECT_*: what each one does, 0 for none
One of the battle's fighters, three on each side (WFIGHTMN's BattleUnit): a partner's HP and MP go ba...
void(* show)()
FIGHTSTG_showMessage: (task, type, data)
s32 active[2]
each side's fighter
BattleFighter fighters[2][3]
s8 items[0x193]
counts, up to 99
Any task, seen through its header.
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
A turn's or a counterattack's one child, and what WFIGHTMN's battle menu waits for (NULL when it is d...
BattleMessageBox * message
FIGHTSTG_createMessage.