|
Digimon World 3 decomp
The European version, SLES_039.36
|
FIGHTSTG's actions: techniques, enemy attacks, counterattacks, items, the first technique, action events and the turn at 1 HP (tech_action.c, enemy_attack.c, counterattack.c, item.c, first_tech.c, action_events.c and one_hp_turn.c). More...
#include "battle/battle_mode/types.h"Go to the source code of this file.
Data Structures | |
| struct | FirstTech |
| FIGHTSTG_updateFirstTech's task (FIGHTSTG_startFirstTech): a side's first technique. More... | |
| struct | BattleItem |
| FIGHTSTG_updateItem's task: an item used in battle, FIGHTSTG_runItemScript its script. More... | |
| struct | ItemScript |
| An item's script settings (FIGHTSTG_itemScripts, ended by -1) More... | |
| struct | TechBoost |
| A technique's boost (FIGHTSTG_techBoosts and FIGHTSTG_sideBoosts, each ended by -1) More... | |
| struct | StatusCure |
| What an item cures (FIGHTSTG_itemCures, items 0x42-0x45) More... | |
| struct | TechAction |
| struct | EnemyAttack |
| FIGHTSTG_updateEnemyAttack's task (FIGHTSTG_startEnemyAttack): an attack on the player's active fighter, as state kind + 1. More... | |
| struct | ActionEvents |
| FIGHTSTG_updateActionEvents's task (FIGHTSTG_startActionEvents) More... | |
| struct | Counterattack |
| A counterattack (FIGHTSTG_startCounterattack) More... | |
| struct | OneHpTurn |
| FIGHTSTG_startOneHpTurn's task, BATTLE_KIND_FINAL_SECOND's enemy turn: the enemy's second technique (WFIGHTMN_startTech), which leaves the player's fighter at 1 HP, each with its message, then the battle goes on (FIGHTSTG_queueEnemyTurn and FIGHTSTG_queueLastEnemy) More... | |
Functions | |
| void | FIGHTSTG_reviveFighter (s32 tech, s32 fighter) |
| Revives one of the player's fighters at full HP, clearing its status events, and raises its defense by tech's effectPower (FIGHTSTG_battleFuncs.changeBoost) | |
| OneHpTurn * | FIGHTSTG_startOneHpTurn () |
| The tasks FIGHTSTG starts for WFIGHTMN and WFIGHTTS. | |
| FirstTech * | FIGHTSTG_startFirstTech (s32 side) |
| Starts side's first technique (FIGHTSTG_updateFirstTech) | |
| BattleItem * | FIGHTSTG_startItem (s32 item) |
| Starts an item's script (FIGHTSTG_updateItem) | |
| TechAction * | FIGHTSTG_startTechAction (s32 side, s32 tech) |
| Starts side's (0 or 0x10) technique or item tech. | |
| EnemyAttack * | FIGHTSTG_startEnemyAttack (s32 kind, s32 noKnockout) |
| Starts an attack on the player's active fighter (FIGHTSTG_updateEnemyAttack): kind 0 for the enemy's technique, 1 for another attack. | |
| void | FIGHTSTG_updateOneHpTurn (OneHpTurn *task, BattleChild *children) |
| Shared between the overlay's objects. | |
| Counterattack * | FIGHTSTG_startCounterattack (s32 side, s32 received, s32 noKnockOutEvent) |
| Starts SIDE's counterattack (FIGHTSTG_updateCounterattack) to RECEIVED damage; NOKNOCKOUTEVENT keeps a knockout from queueing its event. | |
| ActionEvents * | FIGHTSTG_startActionEvents (s32 side) |
| Starts running the current action's events for SIDE (FIGHTSTG_updateActionEvents) | |
| void | FIGHTSTG_updateTechAction (TechAction *task, BattleChild *children) |
| A side's technique or item (FIGHTSTG_startTechAction): state 0 shows its message (announceTech), substate 1 does what it does by its kind (2 and 3 deal damage (dealTechDamage), 4 is an item's cure, revival or healing (useItemTech), 5 a boost, a drain or a heal of the enemy (useSupportTech), 6 a boost of the field's element (boostFieldElement)), then the wake-up when the other side's fighter is asleep (substate 4, wakeUpOrCounter) and the motion of the damage (FIGHTSTG_startCounterattack). | |
| void | FIGHTSTG_updateEnemyAttack (EnemyAttack *task, BattleChild *children) |
| An attack on the player's active fighter (FIGHTSTG_startEnemyAttack): state 1 is the enemy's technique, 2 another attack, each with its messages, motion and damage. | |
| void | FIGHTSTG_updateFirstTech (FirstTech *task, BattleChild *children) |
| A side's first technique (FIGHTSTG_startFirstTech): the partner's skills[0] or the enemy's battle table techs[0], its message (announceFirstTech) and WFIGHTMN's WFIGHTMN_startTech, then the damage to the other side's active fighter (showFirstTechResult, takeFirstTechDamage: TECH_EFFECT_KNOCK_OUT knocks it out, TECH_EFFECT_END_BATTLE takes 70 percent of the partner's HP), its waking up when that fighter is asleep (substate 4, wakeCounteredUp) and FIGHTSTG_startEnemyAttack when the partner misses in BATTLE_KIND_FINAL_LAST. | |
| void | FIGHTSTG_updateItem (BattleItem *task, BattleChild *children) |
| An item used in battle (FIGHTSTG_startItem): its message, FIGHTSTG_runItemScript's script, then substate 1 does what the item does (healPartner to damageEnemy, one per item) and 2 takes it from the bag (item 0x55 attacks again in BATTLE_KIND_FINAL_LAST). | |
| s32 | FIGHTSTG_runItemScript (BattleItem *task, BattleChild *children) |
| An item's script (FIGHTSTG_updateItem): step 0 sets it up and deals the damage (lowerEnemyStat, setUpDrain, setUpItemTech, setItemScript), 1 plays item 0x55's second part when the enemy is still standing, 2 waits. | |
| void | FIGHTSTG_updateActionEvents (ActionEvents *task, BattleChild *children) |
| Runs the queued battle events: the first flag set in FIGHTSTG_action.effects picks the step, which shows its message, applies its effect and clears the flag (stealEnemyItem, drainHp, drainMp, showRaisedStatus, showNextRaisedStatus or applyStatusEvent). | |
| void | FIGHTSTG_updateCounterattack (Counterattack *task, BattleChild *children) |
| A counterattack (FIGHTSTG_startCounterattack): the player's from an event of type 8 or the partner's first technique, the enemy's from its table entry; substate 0 plays the technique (playCounterTech), 1 shows the damage and takes the HP (showCounterResult), 2 hands received to WFIGHTMN_chargeGauge. | |
Variables | |
| TechBoost | FIGHTSTG_techBoosts [] |
| the techniques that boost a stat of a fighter (FIGHTSTG_updateTechAction): the user's, or the enemy's for an amount below 0 | |
| TechBoost | FIGHTSTG_sideBoosts [] |
| and the ones that boost a stat of all the user's side | |
| StatusCure | FIGHTSTG_itemCures [4] |
| what items 0x42-0x45 cure (FIGHTSTG_updateItem, below) | |
| ItemScript | FIGHTSTG_itemScripts [] |
| the items' script settings (FIGHTSTG_runItemScript, above) | |
| u8 | FIGHTSTG_statusTechFlags [] |
| techniques 0xBE-0xC5's four kinds of status (FIGHTSTG_updateTechAction): the flag of each in BattleFighter.flags, | |
| s32 | FIGHTSTG_statusTechArgs [] |
| the argument of message 9, which the odd techniques show, | |
| s32 | FIGHTSTG_statusTechLines [] |
| and the message shown when the target has the status | |
| s32 | FIGHTSTG_clearIds [] |
| the six event types FIGHTSTG_reviveFighter clears | |
FIGHTSTG's actions: techniques, enemy attacks, counterattacks, items, the first technique, action events and the turn at 1 HP (tech_action.c, enemy_attack.c, counterattack.c, item.c, first_tech.c, action_events.c and one_hp_turn.c).
Definition in file action.h.
Revives one of the player's fighters at full HP, clearing its status events, and raises its defense by tech's effectPower (FIGHTSTG_battleFuncs.changeBoost)
Definition at line 212 of file counterattack.c.
Referenced by restoreSide().
| OneHpTurn * FIGHTSTG_startOneHpTurn | ( | void | ) |
The tasks FIGHTSTG starts for WFIGHTMN and WFIGHTTS.
(void): unprototyped, as WFIGHTMN passes it &FIGHTSTG_battle
The tasks FIGHTSTG starts for WFIGHTMN and WFIGHTTS.
Definition at line 59 of file one_hp_turn.c.
Referenced by WFIGHTMN_runTurn().
Starts side's first technique (FIGHTSTG_updateFirstTech)
Definition at line 238 of file first_tech.c.
Referenced by useEnemyTech(), WFIGHTMN_runCommand(), and WFIGHTMN_runConfusedCommand().
| BattleItem * FIGHTSTG_startItem | ( | s32 | item | ) |
Starts an item's script (FIGHTSTG_updateItem)
Definition at line 870 of file item.c.
Referenced by WFIGHTMN_runCommand().
| TechAction * FIGHTSTG_startTechAction | ( | s32 | side, |
| s32 | tech | ||
| ) |
Starts side's (0 or 0x10) technique or item tech.
Definition at line 783 of file tech_action.c.
Referenced by useEnemyTech(), WFIGHTMN_pairTech(), and WFIGHTMN_runCommand().
| EnemyAttack * FIGHTSTG_startEnemyAttack | ( | s32 | kind, |
| s32 | noKnockout | ||
| ) |
Starts an attack on the player's active fighter (FIGHTSTG_updateEnemyAttack): kind 0 for the enemy's technique, 1 for another attack.
Definition at line 234 of file enemy_attack.c.
Referenced by FIGHTSTG_updateFirstTech(), FIGHTSTG_updateItem(), FIGHTSTG_updateTechAction(), and WFIGHTMN_runTurn().
| void FIGHTSTG_updateOneHpTurn | ( | OneHpTurn * | task, |
| BattleChild * | children | ||
| ) |
Shared between the overlay's objects.
Shared between the overlay's objects.
Definition at line 9 of file one_hp_turn.c.
Referenced by FIGHTSTG_startOneHpTurn().
| Counterattack * FIGHTSTG_startCounterattack | ( | s32 | side, |
| s32 | received, | ||
| s32 | noKnockOutEvent | ||
| ) |
Starts SIDE's counterattack (FIGHTSTG_updateCounterattack) to RECEIVED damage; NOKNOCKOUTEVENT keeps a knockout from queueing its event.
Definition at line 200 of file counterattack.c.
Referenced by FIGHTSTG_updateFirstTech(), FIGHTSTG_updateTechAction(), and wakeUpOrCounter().
| ActionEvents * FIGHTSTG_startActionEvents | ( | s32 | side | ) |
Starts running the current action's events for SIDE (FIGHTSTG_updateActionEvents)
Definition at line 212 of file action_events.c.
Referenced by FIGHTSTG_updateEnemyAttack(), FIGHTSTG_updateFirstTech(), and FIGHTSTG_updateTechAction().
| void FIGHTSTG_updateTechAction | ( | TechAction * | task, |
| BattleChild * | children | ||
| ) |
A side's technique or item (FIGHTSTG_startTechAction): state 0 shows its message (announceTech), substate 1 does what it does by its kind (2 and 3 deal damage (dealTechDamage), 4 is an item's cure, revival or healing (useItemTech), 5 a boost, a drain or a heal of the enemy (useSupportTech), 6 a boost of the field's element (boostFieldElement)), then the wake-up when the other side's fighter is asleep (substate 4, wakeUpOrCounter) and the motion of the damage (FIGHTSTG_startCounterattack).
The match depends on the other side's fighter being found as its row's offset added as an int to its slot (as in FIGHTSTG_updateFirstTech), on each case's variables being its own, on substate 1's cases advancing substate themselves (case 5 once, after its switch) and on the heal tests being written hp + heal > maxHp.
< FIGHTSTG_rollHit and FIGHTSTG_computeDamage
< FIGHTSTG_rollMagicHit and FIGHTSTG_computeMagicDamage
< FIGHTSTG_rollHit and FIGHTSTG_computeDamage
< FIGHTSTG_rollMagicHit and FIGHTSTG_computeMagicDamage
< its third enemy; winning plays the ending
< FIGHTSTG_rollHit and FIGHTSTG_computeDamage
Definition at line 675 of file tech_action.c.
Referenced by FIGHTSTG_startTechAction().
| void FIGHTSTG_updateEnemyAttack | ( | EnemyAttack * | task, |
| BattleChild * | children | ||
| ) |
An attack on the player's active fighter (FIGHTSTG_startEnemyAttack): state 1 is the enemy's technique, 2 another attack, each with its messages, motion and damage.
The match depends on each case advancing substate itself and on a fighter variable of its own in each case.
< can't act or run away; a hit may wake it up
Definition at line 115 of file enemy_attack.c.
Referenced by FIGHTSTG_startEnemyAttack().
| void FIGHTSTG_updateFirstTech | ( | FirstTech * | task, |
| BattleChild * | children | ||
| ) |
A side's first technique (FIGHTSTG_startFirstTech): the partner's skills[0] or the enemy's battle table techs[0], its message (announceFirstTech) and WFIGHTMN's WFIGHTMN_startTech, then the damage to the other side's active fighter (showFirstTechResult, takeFirstTechDamage: TECH_EFFECT_KNOCK_OUT knocks it out, TECH_EFFECT_END_BATTLE takes 70 percent of the partner's HP), its waking up when that fighter is asleep (substate 4, wakeCounteredUp) and FIGHTSTG_startEnemyAttack when the partner misses in BATTLE_KIND_FINAL_LAST.
The match depends on the other side's fighter being found as its row's offset, other * 0x60, added as an int to its slot in the first row, each in a variable of its own in a block of its own (as an index, gcc folds the row into (other * 3 + active) * 32); on the blocks of their own of substate 0's row and of the event that wakeCounteredUp finds; on announceFirstTech's MP test being written tech->mp > fighter->mp and on TECH_EFFECT_END_BATTLE's damage being stored before lines[0].
< in BATTLE_KIND_UNK2: takes 70 percent of the partner's HP, ends as BATTLE_FLED
< its third enemy; winning plays the ending
< can't act or run away; a hit may wake it up
Definition at line 130 of file first_tech.c.
Referenced by FIGHTSTG_startFirstTech().
| void FIGHTSTG_updateItem | ( | BattleItem * | task, |
| BattleChild * | children | ||
| ) |
An item used in battle (FIGHTSTG_startItem): its message, FIGHTSTG_runItemScript's script, then substate 1 does what the item does (healPartner to damageEnemy, one per item) and 2 takes it from the bag (item 0x55 attacks again in BATTLE_KIND_FINAL_LAST).
The match depends on each case's variables being its own, on item 0x47's halves being declared in its if, on its MP test being written maxMp <= mp + halfMp, on item 0x57's cap being read after the boosts change and on the cases that say the item does nothing ending on their own (item 0x2B's, 0x57's and 0x59's).
< its third enemy; winning plays the ending
Definition at line 759 of file item.c.
Referenced by FIGHTSTG_startItem().
| s32 FIGHTSTG_runItemScript | ( | BattleItem * | task, |
| BattleChild * | children | ||
| ) |
An item's script (FIGHTSTG_updateItem): step 0 sets it up and deals the damage (lowerEnemyStat, setUpDrain, setUpItemTech, setItemScript), 1 plays item 0x55's second part when the enemy is still standing, 2 waits.
The match depends on item 0x55's damage being 20 percent, on the row pointer of item 0x5A, on the stage being written out in each case and on the table being walked by index.
< its third enemy; winning plays the ending
Definition at line 141 of file item.c.
Referenced by FIGHTSTG_updateItem().
| void FIGHTSTG_updateActionEvents | ( | ActionEvents * | task, |
| BattleChild * | children | ||
| ) |
Runs the queued battle events: the first flag set in FIGHTSTG_action.effects picks the step, which shows its message, applies its effect and clears the flag (stealEnemyItem, drainHp, drainMp, showRaisedStatus, showNextRaisedStatus or applyStatusEvent).
The match depends on each event branch ending with its own flag clear and break (the copies are merged after reload, but they make the loop big enough that loop.c leaves 0x10 at each use), on case 2 written next to default in applyStatusEvent's switch (it sets the jump table's base) and on drainMp setting its fighter and enemy before args[0].
< does nothing but for the enemy whose battle table entry lists it first
< raises the critical hit chance
< can't act or run away; a hit may wake it up
< the enemy's item
< HP, in 128ths of the damage
< the partner's, in 128ths of its max MP
< PartnerStats.status: one at random
< each one that a roll lets
Definition at line 137 of file action_events.c.
Referenced by FIGHTSTG_startActionEvents().
| void FIGHTSTG_updateCounterattack | ( | Counterattack * | task, |
| BattleChild * | children | ||
| ) |
A counterattack (FIGHTSTG_startCounterattack): the player's from an event of type 8 or the partner's first technique, the enemy's from its table entry; substate 0 plays the technique (playCounterTech), 1 shows the damage and takes the HP (showCounterResult), 2 hands received to WFIGHTMN_chargeGauge.
The match depends on playCounterTech's technique and side being declared in it, on the event index and the stats being variables of their own, on the stage being written element * 3 + 0x21 and one more and on one row variable for both of playCounterTech's rows.
< loses turns at random (FIGHTSTG_battleFuncs.testParalysis)
< a technique of the partner's, run as its command
Definition at line 103 of file counterattack.c.
Referenced by FIGHTSTG_startCounterattack().
|
extern |
the techniques that boost a stat of a fighter (FIGHTSTG_updateTechAction): the user's, or the enemy's for an amount below 0
Definition at line 8 of file tech_action.c.
Referenced by boostFighterStat().
|
extern |
and the ones that boost a stat of all the user's side
Definition at line 20 of file tech_action.c.
Referenced by boostSideStat().
|
extern |
what items 0x42-0x45 cure (FIGHTSTG_updateItem, below)
Definition at line 230 of file item.c.
Referenced by cureStatus().
|
extern |
the items' script settings (FIGHTSTG_runItemScript, above)
Definition at line 237 of file item.c.
Referenced by setItemScript().
|
extern |
techniques 0xBE-0xC5's four kinds of status (FIGHTSTG_updateTechAction): the flag of each in BattleFighter.flags,
Definition at line 28 of file tech_action.c.
Referenced by cureStatusTech().
|
extern |
the argument of message 9, which the odd techniques show,
Definition at line 39 of file tech_action.c.
Referenced by cureStatusTech().
|
extern |
and the message shown when the target has the status
Definition at line 43 of file tech_action.c.
Referenced by cureStatusTech().
|
extern |
the six event types FIGHTSTG_reviveFighter clears
the six event types FIGHTSTG_reviveFighter clears
Definition at line 33 of file tech_action.c.
Referenced by FIGHTSTG_reviveFighter().