Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
action.h
Go to the documentation of this file.
1#ifndef FIGHTSTG_ACTION_H
2#define FIGHTSTG_ACTION_H
3
4/* FIGHTSTG's actions: techniques, enemy attacks, counterattacks, items, the
5 first technique, action events and the turn at 1 HP (tech_action.c,
6 enemy_attack.c, counterattack.c, item.c, first_tech.c, action_events.c
7 and one_hp_turn.c). */
8
10
11/* FIGHTSTG_updateFirstTech's task (FIGHTSTG_startFirstTech): a side's first technique */
12typedef struct FirstTech {
14 /* 0x50 */ u8 side; /* the side that uses it, 0 or 0x10 */
15 /* 0x54 */ s32 tech;
16 /* 0x58 */ s32 damage;
17 /* 0x5C */ s32 asleep; /* whether the other side's fighter was asleep */
18 /* 0x60 */ s32 lines[8]; /* FIGHTSTG_updateMessage's */
19} FirstTech;
20
21/* FIGHTSTG_updateItem's task: an item used in battle, FIGHTSTG_runItemScript its script */
22typedef struct BattleItem {
24 /* 0x50 */ s32 lines[8]; /* FIGHTSTG_updateMessage's, 0 ends them */
25 /* 0x70 */ s32 item; /* the item */
26 /* 0x74 */ s32 element; /* item 0x54's element, 2-8 */
27 /* 0x78 */ s32 damage; /* the damage */
28 /* 0x7C */ s32 lowered; /* item 0x58's: 1 it lowered the enemy's first stat, 2 its second */
30
31/* An item's script settings (FIGHTSTG_itemScripts, ended by -1) */
32typedef struct ItemScript {
33 /* 0x0 */ s16 item;
34 /* 0x2 */ s16 effect; /* BattleScript's */
35 /* 0x4 */ s16 sound;
37
38/* A technique's boost (FIGHTSTG_techBoosts and FIGHTSTG_sideBoosts, each
39 ended by -1) */
40typedef struct TechBoost {
41 /* 0x0 */ s16 tech;
42 /* 0x2 */ s16 amount; /* times the technique's effectPower, below 0 for the other side */
43 /* 0x4 */ s16 stat;
44 /* 0x6 */ s16 line; /* the message */
45} TechBoost;
46
49
50/* What an item cures (FIGHTSTG_itemCures, items 0x42-0x45) */
51typedef struct StatusCure {
52 /* 0x0 */ s16 message;
53 /* 0x2 */ s16 flag; /* in BattleFighter.flags */
54 /* 0x4 */ s32 item; /* FIGHTSTG_events.funcs.cureStatus's */
56
62#if VERSION_EU || VERSION_JP
63extern s32 FIGHTSTG_clearIds[]; /* the six event types FIGHTSTG_reviveFighter clears */
64void FIGHTSTG_reviveFighter(s32 tech, s32 fighter);
65#endif
66
67typedef struct TechAction {
69 /* 0x50 */ u8 side; /* the side that uses it, 0 or 0x10 */
70 /* 0x54 */ s32 tech; /* the technique or item */
71 /* 0x58 */ s32 damage;
72 /* 0x5C */ s32 heal; /* the HP an item heals */
73 /* 0x60 */ s32 asleep; /* whether the other side's fighter was asleep */
74 /* 0x64 */ s32 lines[8]; /* FIGHTSTG_updateMessage's */
76
77/* FIGHTSTG_updateEnemyAttack's task (FIGHTSTG_startEnemyAttack): an attack
78 on the player's active fighter, as state kind + 1 */
79typedef struct EnemyAttack {
81 /* 0x50 */ s32 lines[4]; /* FIGHTSTG_updateMessage's */
82 /* 0x60 */ s32 resetIdleMotion; /* the weakness ended: WFIGHTMN_setIdleMotion once the technique starts */
83 /* 0x64 */ u8 pad[0xC]; /* never read or written */
84 /* 0x70 */ s32 tech; /* the technique */
85 /* 0x74 */ s32 kind; /* 0 the enemy's technique, 1 another attack */
86 /* 0x78 */ s32 noKnockout; /* don't knock the fighter out at 0 HP */
87 /* 0x7C */ s32 asleep; /* the fighter was asleep */
89
90/* FIGHTSTG_updateActionEvents's task (FIGHTSTG_startActionEvents) */
91typedef struct ActionEvents {
93 /* 0x50 */ u8 side; /* 0 or 0x10 */
94 /* 0x54 */ s32 args[3];
95 /* 0x60 */ u8 pad[0x14]; /* never read or written: createTask allocates 0x74 bytes */
97
98/* A counterattack (FIGHTSTG_startCounterattack) */
99typedef struct Counterattack {
101 /* 0x50 */ s32 lines[8]; /* FIGHTSTG_updateMessage's */
102 /* 0x70 */ u8 side; /* the side that counters, 0 or 0x10 */
103 /* 0x74 */ s32 received; /* the damage it answers, 0 for none */
104 /* 0x78 */ s32 tech;
105 /* 0x7C */ s32 hit; /* whether the technique hits (FIGHTSTG_battleFuncs.rollHit) */
106 /* 0x80 */ s32 damage;
107 /* 0x84 */ s32 noKnockOutEvent; /* a knockout doesn't call FIGHTSTG_queueKnockOut */
108 /* 0x88 */ s32 pad; /* never read or written: createTask allocates 0x8C bytes */
110
111/* FIGHTSTG_startOneHpTurn's task, BATTLE_KIND_FINAL_SECOND's enemy turn:
112 the enemy's second technique (WFIGHTMN_startTech), which leaves the
113 player's fighter at 1 HP, each with its message, then the battle goes on
114 (FIGHTSTG_queueEnemyTurn and FIGHTSTG_queueLastEnemy) */
115typedef struct OneHpTurn {
117 /* 0x50 */ s32 lines[8]; /* FIGHTSTG_updateMessage's, 0 ends them */
118} OneHpTurn;
119
120/* The tasks FIGHTSTG starts for WFIGHTMN and WFIGHTTS */
121OneHpTurn *FIGHTSTG_startOneHpTurn(); /* (void): unprototyped, as WFIGHTMN passes it &FIGHTSTG_battle */
126
127/* Shared between the overlay's objects */
128void FIGHTSTG_updateOneHpTurn(OneHpTurn *task, BattleChild *children);
129Counterattack *FIGHTSTG_startCounterattack(s32 side, s32 received, s32 noKnockOutEvent);
133void FIGHTSTG_updateFirstTech(FirstTech *task, BattleChild *children);
134void FIGHTSTG_updateItem(BattleItem *task, BattleChild *children);
138
139#endif /* FIGHTSTG_ACTION_H */
Counterattack * FIGHTSTG_startCounterattack(s32 side, s32 received, s32 noKnockOutEvent)
Starts SIDE's counterattack (FIGHTSTG_updateCounterattack) to RECEIVED damage; NOKNOCKOUTEVENT keeps ...
ActionEvents * FIGHTSTG_startActionEvents(s32 side)
Starts running the current action's events for SIDE (FIGHTSTG_updateActionEvents)
TechBoost FIGHTSTG_sideBoosts[]
and the ones that boost a stat of all the user's side
Definition tech_action.c:20
s32 FIGHTSTG_clearIds[]
the six event types FIGHTSTG_reviveFighter clears
Definition tech_action.c:33
s32 FIGHTSTG_statusTechArgs[]
the argument of message 9, which the odd techniques show,
Definition tech_action.c:39
void FIGHTSTG_updateEnemyAttack(EnemyAttack *task, BattleChild *children)
An attack on the player's active fighter (FIGHTSTG_startEnemyAttack): state 1 is the enemy's techniqu...
s32 FIGHTSTG_runItemScript(BattleItem *task, BattleChild *children)
An item's script (FIGHTSTG_updateItem): step 0 sets it up and deals the damage (lowerEnemyStat,...
Definition item.c:141
BattleItem * FIGHTSTG_startItem(s32 item)
Starts an item's script (FIGHTSTG_updateItem)
Definition item.c:870
void FIGHTSTG_updateTechAction(TechAction *task, BattleChild *children)
A side's technique or item (FIGHTSTG_startTechAction): state 0 shows its message (announceTech),...
s32 FIGHTSTG_statusTechLines[]
and the message shown when the target has the status
Definition tech_action.c:43
void FIGHTSTG_updateFirstTech(FirstTech *task, BattleChild *children)
A side's first technique (FIGHTSTG_startFirstTech): the partner's skills[0] or the enemy's battle tab...
Definition first_tech.c:130
StatusCure FIGHTSTG_itemCures[4]
what items 0x42-0x45 cure (FIGHTSTG_updateItem, below)
Definition item.c:230
ItemScript FIGHTSTG_itemScripts[]
the items' script settings (FIGHTSTG_runItemScript, above)
Definition item.c:237
TechBoost FIGHTSTG_techBoosts[]
the techniques that boost a stat of a fighter (FIGHTSTG_updateTechAction): the user's,...
Definition tech_action.c:8
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 b...
void FIGHTSTG_updateCounterattack(Counterattack *task, BattleChild *children)
A counterattack (FIGHTSTG_startCounterattack): the player's from an event of type 8 or the partner's ...
OneHpTurn * FIGHTSTG_startOneHpTurn()
The tasks FIGHTSTG starts for WFIGHTMN and WFIGHTTS.
Definition one_hp_turn.c:59
void FIGHTSTG_updateItem(BattleItem *task, BattleChild *children)
An item used in battle (FIGHTSTG_startItem): its message, FIGHTSTG_runItemScript's script,...
Definition item.c:759
EnemyAttack * FIGHTSTG_startEnemyAttack(s32 kind, s32 noKnockout)
Starts an attack on the player's active fighter (FIGHTSTG_updateEnemyAttack): kind 0 for the enemy's ...
FirstTech * FIGHTSTG_startFirstTech(s32 side)
Starts side's first technique (FIGHTSTG_updateFirstTech)
Definition first_tech.c:238
void FIGHTSTG_updateOneHpTurn(OneHpTurn *task, BattleChild *children)
Shared between the overlay's objects.
Definition one_hp_turn.c:9
void FIGHTSTG_updateActionEvents(ActionEvents *task, BattleChild *children)
Runs the queued battle events: the first flag set in FIGHTSTG_action.effects picks the step,...
u8 FIGHTSTG_statusTechFlags[]
techniques 0xBE-0xC5's four kinds of status (FIGHTSTG_updateTechAction): the flag of each in BattleFi...
Definition tech_action.c:28
TechAction * FIGHTSTG_startTechAction(s32 side, s32 tech)
Starts side's (0 or 0x10) technique or item tech.
FIGHTSTG's shared declarations: the headers it builds on, the ids its tasks register with,...
signed int s32
Definition common.h:11
signed short s16
Definition common.h:9
unsigned char u8
Definition common.h:8
#define TASK_HEADER(Type)
Definition task.h:39
FIGHTSTG_updateActionEvents's task (FIGHTSTG_startActionEvents)
Definition action.h:91
u8 side
0 or 0x10
Definition action.h:93
s32 args[3]
Definition action.h:94
u8 pad[0x14]
never read or written: createTask allocates 0x74 bytes
Definition action.h:95
FIGHTSTG_updateItem's task: an item used in battle, FIGHTSTG_runItemScript its script.
Definition action.h:22
s32 damage
the damage
Definition action.h:27
s32 element
item 0x54's element, 2-8
Definition action.h:26
s32 lines[8]
FIGHTSTG_updateMessage's, 0 ends them.
Definition action.h:24
s32 lowered
item 0x58's: 1 it lowered the enemy's first stat, 2 its second
Definition action.h:28
s32 item
the item
Definition action.h:25
A counterattack (FIGHTSTG_startCounterattack)
Definition action.h:99
s32 noKnockOutEvent
a knockout doesn't call FIGHTSTG_queueKnockOut
Definition action.h:107
s32 lines[8]
FIGHTSTG_updateMessage's.
Definition action.h:101
s32 pad
never read or written: createTask allocates 0x8C bytes
Definition action.h:108
s32 hit
whether the technique hits (FIGHTSTG_battleFuncs.rollHit)
Definition action.h:105
u8 side
the side that counters, 0 or 0x10
Definition action.h:102
s32 received
the damage it answers, 0 for none
Definition action.h:103
FIGHTSTG_updateEnemyAttack's task (FIGHTSTG_startEnemyAttack): an attack on the player's active fight...
Definition action.h:79
s32 noKnockout
don't knock the fighter out at 0 HP
Definition action.h:86
u8 pad[0xC]
never read or written
Definition action.h:83
s32 resetIdleMotion
the weakness ended: WFIGHTMN_setIdleMotion once the technique starts
Definition action.h:82
s32 tech
the technique
Definition action.h:84
s32 asleep
the fighter was asleep
Definition action.h:87
s32 kind
0 the enemy's technique, 1 another attack
Definition action.h:85
s32 lines[4]
FIGHTSTG_updateMessage's.
Definition action.h:81
FIGHTSTG_updateFirstTech's task (FIGHTSTG_startFirstTech): a side's first technique.
Definition action.h:12
u8 side
the side that uses it, 0 or 0x10
Definition action.h:14
s32 damage
Definition action.h:16
s32 asleep
whether the other side's fighter was asleep
Definition action.h:17
s32 lines[8]
FIGHTSTG_updateMessage's.
Definition action.h:18
s32 tech
Definition action.h:15
An item's script settings (FIGHTSTG_itemScripts, ended by -1)
Definition action.h:32
s16 item
Definition action.h:33
s16 effect
BattleScript's.
Definition action.h:34
s16 sound
Definition action.h:35
FIGHTSTG_startOneHpTurn's task, BATTLE_KIND_FINAL_SECOND's enemy turn: the enemy's second technique (...
Definition action.h:115
s32 lines[8]
FIGHTSTG_updateMessage's, 0 ends them.
Definition action.h:117
What an item cures (FIGHTSTG_itemCures, items 0x42-0x45)
Definition action.h:51
s16 flag
in BattleFighter.flags
Definition action.h:53
s32 item
FIGHTSTG_events.funcs.cureStatus's.
Definition action.h:54
s16 message
Definition action.h:52
s32 heal
the HP an item heals
Definition action.h:72
s32 lines[8]
FIGHTSTG_updateMessage's.
Definition action.h:74
u8 side
the side that uses it, 0 or 0x10
Definition action.h:69
s32 damage
Definition action.h:71
s32 asleep
whether the other side's fighter was asleep
Definition action.h:73
s32 tech
the technique or item
Definition action.h:70
A technique's boost (FIGHTSTG_techBoosts and FIGHTSTG_sideBoosts, each ended by -1)
Definition action.h:40
s16 tech
Definition action.h:41
s16 stat
Definition action.h:43
s16 amount
times the technique's effectPower, below 0 for the other side
Definition action.h:42
s16 line
the message
Definition action.h:44
A turn's or a counterattack's one child, and what WFIGHTMN's battle menu waits for (NULL when it is d...
Definition task.h:16