Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
tech_action.c File Reference

FIGHTSTG's technique action: the task that plays a technique, its messages and the boosts and statuses it gives. More...

Include dependency graph for tech_action.c:

Go to the source code of this file.

Functions

static void announceTech (TechAction *task, BattleChild *children)
 Starts the technique: its action for a physical or magic one, its message, and whether the other side's fighter is asleep.
 
static void startTechScript (TechAction *task, BattleChild *children)
 Once the message is gone, starts the technique's script and spends the user's charge, or for an enemy-only effect ends the user's weakness.
 
static void dealTechDamage (TechAction *task, BattleChild *children)
 A physical or magic technique: deals its damage to the other side's fighter (or its hits', or knocks it out), or says it missed; one with TECH_EFFECT_ENEMY_ONLY is queued as the partner's technique instead.
 
static void cureStatusTech (TechAction *task, BattleChild *children)
 Techniques 0xBE-0xC5: cure one of the four kinds of status (FIGHTSTG_statusTechFlags), the odd ones on the user's whole side.
 
static void reviveSide (TechAction *task, BattleChild *children)
 Technique 0x64: revives the partners knocked out to their max HP.
 
static void restoreSide (TechAction *task, BattleChild *children)
 Technique 0x177: revives the partners and restores them whole, statuses included.
 
static void healWithTech (TechAction *task, BattleChild *children)
 The other item techniques: heal the user, or its whole side for 0xBB and above, by FIGHTSTG_computeHeal, or say they do nothing.
 
static void useItemTech (TechAction *task, BattleChild *children)
 An item technique: an auto-recovery, a cure, a revival or a heal.
 
static void boostFighterStat (TechAction *task, BattleChild *children, TechData *tech)
 Techniques 0xC6-0xD0 (FIGHTSTG_techBoosts): boost a stat of the user, or lower the other side's, which the battle can block for the partner's.
 
static void boostSideStat (TechAction *task, BattleChild *children, TechData *tech)
 Techniques 0xC7, 0xC9 and 0xCB (FIGHTSTG_sideBoosts): boost a stat of all the user's side.
 
static void chargeUser (TechAction *task, BattleChild *children, TechData *tech)
 Techniques 0xD1 and 0xD2: charge the user by the technique's power.
 
static void drainMp (TechAction *task, BattleChild *children, TechData *tech)
 Technique 0x188: the enemy drains the partner's MP by the technique's power in 128ths of its max MP.
 
static void healEnemy (TechAction *task, BattleChild *children)
 Technique 0x190: heals the enemy by FIGHTSTG_computeHeal and charges it.
 
static void useSupportTech (TechAction *task, BattleChild *children, TechData *tech)
 A support technique: a boost, a charge, a restriction or digidevolving the enemy, or the enemy's drain of MP or heal.
 
static void boostFieldElement (TechAction *task, BattleChild *children, TechData *tech)
 Icon 6's techniques: set the field's boosted element and its amount (the user's spirit / 10 plus the technique's power, at most 0x7F), cleared after a time set by the spirit.
 
static void wakeUpOrCounter (TechAction *task, BattleChild *children)
 After the technique: wakes the other side's fighter when it was asleep and the damage wakes it (or ends), else starts the motion of the damage.
 
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).
 
TechAction * FIGHTSTG_startTechAction (s32 side, s32 tech)
 Starts side's (0 or 0x10) technique or item tech.
 

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
 
u8 FIGHTSTG_statusTechFlags []
 techniques 0xBE-0xC5's four kinds of status (FIGHTSTG_updateTechAction): the flag of each in BattleFighter.flags,
 
s32 FIGHTSTG_clearIds []
 the event types that the European version's FIGHTSTG_reviveFighter clears
 
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
 

Detailed Description

FIGHTSTG's technique action: the task that plays a technique, its messages and the boosts and statuses it gives.

Definition in file tech_action.c.

Function Documentation

◆ announceTech()

static void announceTech ( TechAction *  task,
BattleChild *  children 
)
inlinestatic

Starts the technique: its action for a physical or magic one, its message, and whether the other side's fighter is asleep.

< FIGHTSTG_rollHit and FIGHTSTG_computeDamage

< FIGHTSTG_rollMagicHit and FIGHTSTG_computeMagicDamage

< can't act or run away; a hit may wake it up

Definition at line 49 of file tech_action.c.

Referenced by FIGHTSTG_updateTechAction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startTechScript()

static void startTechScript ( TechAction *  task,
BattleChild *  children 
)
inlinestatic

Once the message is gone, starts the technique's script and spends the user's charge, or for an enemy-only effect ends the user's weakness.

< does nothing but for the enemy whose battle table entry lists it first

Definition at line 80 of file tech_action.c.

Referenced by FIGHTSTG_updateTechAction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dealTechDamage()

static void dealTechDamage ( TechAction *  task,
BattleChild *  children 
)
inlinestatic

A physical or magic technique: deals its damage to the other side's fighter (or its hits', or knocks it out), or says it missed; one with TECH_EFFECT_ENEMY_ONLY is queued as the partner's technique instead.

< does nothing but for the enemy whose battle table entry lists it first

< two magic hits, as techniques 0x1B9 and 0x1BA

Definition at line 102 of file tech_action.c.

Referenced by FIGHTSTG_updateTechAction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cureStatusTech()

static void cureStatusTech ( TechAction *  task,
BattleChild *  children 
)
inlinestatic

Techniques 0xBE-0xC5: cure one of the four kinds of status (FIGHTSTG_statusTechFlags), the odd ones on the user's whole side.

Definition at line 162 of file tech_action.c.

Referenced by useItemTech().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reviveSide()

static void reviveSide ( TechAction *  task,
BattleChild *  children 
)
inlinestatic

Technique 0x64: revives the partners knocked out to their max HP.

Definition at line 223 of file tech_action.c.

Referenced by useItemTech().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ restoreSide()

static void restoreSide ( TechAction *  task,
BattleChild *  children 
)
inlinestatic

Technique 0x177: revives the partners and restores them whole, statuses included.

Definition at line 251 of file tech_action.c.

Referenced by useItemTech().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ healWithTech()

static void healWithTech ( TechAction *  task,
BattleChild *  children 
)
inlinestatic

The other item techniques: heal the user, or its whole side for 0xBB and above, by FIGHTSTG_computeHeal, or say they do nothing.

Definition at line 293 of file tech_action.c.

Referenced by useItemTech().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ useItemTech()

static void useItemTech ( TechAction *  task,
BattleChild *  children 
)
inlinestatic

An item technique: an auto-recovery, a cure, a revival or a heal.

Definition at line 384 of file tech_action.c.

Referenced by FIGHTSTG_updateTechAction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ boostFighterStat()

static void boostFighterStat ( TechAction *  task,
BattleChild *  children,
TechData *  tech 
)
inlinestatic

Techniques 0xC6-0xD0 (FIGHTSTG_techBoosts): boost a stat of the user, or lower the other side's, which the battle can block for the partner's.

< to 10: attack, defense, speed (a technique's boost stat + 8)

Definition at line 420 of file tech_action.c.

Referenced by useSupportTech().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ boostSideStat()

static void boostSideStat ( TechAction *  task,
BattleChild *  children,
TechData *  tech 
)
inlinestatic

Techniques 0xC7, 0xC9 and 0xCB (FIGHTSTG_sideBoosts): boost a stat of all the user's side.

Definition at line 453 of file tech_action.c.

Referenced by useSupportTech().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ chargeUser()

static void chargeUser ( TechAction *  task,
BattleChild *  children,
TechData *  tech 
)
inlinestatic

Techniques 0xD1 and 0xD2: charge the user by the technique's power.

Definition at line 484 of file tech_action.c.

Referenced by useSupportTech().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drainMp()

static void drainMp ( TechAction *  task,
BattleChild *  children,
TechData *  tech 
)
inlinestatic

Technique 0x188: the enemy drains the partner's MP by the technique's power in 128ths of its max MP.

Definition at line 495 of file tech_action.c.

Referenced by useSupportTech().

Here is the caller graph for this function:

◆ healEnemy()

static void healEnemy ( TechAction *  task,
BattleChild *  children 
)
inlinestatic

Technique 0x190: heals the enemy by FIGHTSTG_computeHeal and charges it.

Definition at line 525 of file tech_action.c.

Referenced by useSupportTech().

Here is the caller graph for this function:

◆ useSupportTech()

static void useSupportTech ( TechAction *  task,
BattleChild *  children,
TechData *  tech 
)
inlinestatic

A support technique: a boost, a charge, a restriction or digidevolving the enemy, or the enemy's drain of MP or heal.

Definition at line 541 of file tech_action.c.

Referenced by FIGHTSTG_updateTechAction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ boostFieldElement()

static void boostFieldElement ( TechAction *  task,
BattleChild *  children,
TechData *  tech 
)
inlinestatic

Icon 6's techniques: set the field's boosted element and its amount (the user's spirit / 10 plus the technique's power, at most 0x7F), cleared after a time set by the spirit.

The element boosted is the technique's icon, so always 6, while the message names the technique's own element.

< magic damage, and against it

< magic damage, and against it

Definition at line 608 of file tech_action.c.

Referenced by FIGHTSTG_updateTechAction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wakeUpOrCounter()

static void wakeUpOrCounter ( TechAction *  task,
BattleChild *  children 
)
inlinestatic

After the technique: wakes the other side's fighter when it was asleep and the damage wakes it (or ends), else starts the motion of the damage.

< can't act or run away; a hit may wake it up

< can't act or run away; a hit may wake it up

< 10-12: the end of FIGHTER_PARALYZED, FIGHTER_CONFUSED or FIGHTER_ASLEEP

< FIGHTSTG_rollHit and FIGHTSTG_computeDamage

Definition at line 630 of file tech_action.c.

Referenced by FIGHTSTG_updateTechAction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FIGHTSTG_startTechAction()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ FIGHTSTG_techBoosts

TechBoost FIGHTSTG_techBoosts[]
Initial value:
= {
{ 0xC6, 1, 0, 0x30 },
{ 0xC8, 1, 1, 0x31 },
{ 0xCA, 1, 2, 0x32 },
{ 0xCC, -1, 0, 0x33 },
{ 0xCD, -1, 1, 0x34 },
{ 0xCE, -1, 1, 0x34 },
{ 0xCF, -1, 2, 0x35 },
{ 0xD0, -1, 2, 0x35 },
{ -1, 0, 0, 0 },
}

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().

◆ FIGHTSTG_sideBoosts

TechBoost FIGHTSTG_sideBoosts[]
Initial value:
= {
{ 0xC7, 1, 0, 0x30 },
{ 0xC9, 1, 1, 0x31 },
{ 0xCB, 1, 2, 0x32 },
{ -1, 0, 0, 0 },
}

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().

◆ FIGHTSTG_statusTechFlags

u8 FIGHTSTG_statusTechFlags[]
Initial value:
= {
1 , 2 , 4 , 0x3F,
}

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().

◆ FIGHTSTG_clearIds

s32 FIGHTSTG_clearIds[]
Initial value:
= {
9 , 10 , 10 + 1, 10 + 2,
16 , 16 + 1,
}

the event types that the European version's FIGHTSTG_reviveFighter clears

the six event types FIGHTSTG_reviveFighter clears

Definition at line 33 of file tech_action.c.

Referenced by FIGHTSTG_reviveFighter().

◆ FIGHTSTG_statusTechArgs

s32 FIGHTSTG_statusTechArgs[]
Initial value:
= {
1, 2, 3, 4,
}

the argument of message 9, which the odd techniques show,

Definition at line 39 of file tech_action.c.

Referenced by cureStatusTech().

◆ FIGHTSTG_statusTechLines

s32 FIGHTSTG_statusTechLines[]
Initial value:
= {
40, 41, 42, 44,
}

and the message shown when the target has the status

Definition at line 43 of file tech_action.c.

Referenced by cureStatusTech().