Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
one_hp_turn.c
Go to the documentation of this file.
1/* FIGHTSTG's turn of BATTLE_KIND_FINAL_SECOND's enemy, which leaves the
2 player's fighter at 1 HP. */
3
5
6/* BATTLE_KIND_FINAL_SECOND's enemy turn: the enemy's message and its battle
7 table entry's second technique, then the player's fighter is left at 1 HP
8 with a message of the damage, and the battle goes on */
10 BattleTableEntry *entry;
11 BattleFighter *fighter;
12
13 switch (task->state) {
14 case TASK_INIT:
15 default:
17 children[0].message = FIGHTSTG_createMessage();
18 task->lines[0] = 0x10;
19 task->lines[1] = entry->techs[1];
20 children[0].message->show(children[0].message, 3, task->lines);
21 task->nextState(task);
22 break;
23 case TASK_RUN:
24 switch (task->substate) {
25 case 0:
26 default:
27 if (children[0].task == NULL) {
28 children[0].script = WFIGHTMN_startTech(0x10, task->lines[1]);
29 task->substate++;
30 }
31 break;
32 case 1:
33 if (children[0].task == NULL) {
35 children[0].message = FIGHTSTG_createMessage();
36 task->lines[0] = 0;
37 task->lines[1] = fighter->hp - 1;
38 children[0].message->show(children[0].message, 4, task->lines);
39 fighter->hp = 1;
40 task->substate++;
41 }
42 break;
43 case 2:
44 if (children[0].task == NULL) {
47 task->state = TASK_KILL;
48 }
49 break;
50 }
51 break;
52 case 2:
53 case TASK_KILL:
54 break;
55 }
56}
57
58/* Starts BATTLE_KIND_FINAL_SECOND's enemy turn */
Battle FIGHTSTG_battle
the battle: its fighters, speed and drawing functions
Definition battle.c:16
void FIGHTSTG_queueLastEnemy(void)
Queues the coming in of the last battle's third enemy, first.
Definition battle.c:152
#define SIDE_ENEMY
Definition battle.h:178
EventQueue FIGHTSTG_events
the battle's events and their functions
Definition events.c:43
void FIGHTSTG_queueEnemyTurn(s32 delay)
Queues the enemy's turn (event 3) in delay.
Definition events.c:368
FIGHTSTG.PRO: the battle.
BattleTableEntry *(* FIGHTSTG_battleTableFunc)(s32 id)
how the fight stage and WFIGHTMN read the battle table
#define NULL
Definition common.h:17
#define TASK_RUN
Definition task.h:35
#define TASK_KILL
Definition task.h:37
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Definition task.h:34
BattleMessageBox * FIGHTSTG_createMessage(void)
Creates a battle message box (FIGHTSTG_updateMessage)
Definition message.c:440
OneHpTurn * FIGHTSTG_startOneHpTurn(void)
Starts BATTLE_KIND_FINAL_SECOND's enemy turn.
Definition one_hp_turn.c:59
void FIGHTSTG_updateOneHpTurn(OneHpTurn *task, BattleChild *children)
BATTLE_KIND_FINAL_SECOND's enemy turn: the enemy's message and its battle table entry's second techni...
Definition one_hp_turn.c:9
One of the battle's fighters, three on each side (WFIGHTMN's BattleUnit): a partner's HP and MP go ba...
Definition battle.h:191
s16 id
the Digimon (DIGIMON_DATA)
Definition battle.h:192
void(* show)()
FIGHTSTG_showMessage: (task, type, data)
Definition menu.h:182
s32 active[2]
each side's fighter
Definition battle.h:226
BattleFighter fighters[2][3]
Definition battle.h:227
s16 techs[3]
its first, then those of FIGHTSTG_getEnemyAction's kinds 2 and 3
Definition battle.h:63
BattleState state
Definition battle.h:240
s32(* getDelay)(u8 side, s32 kind)
FIGHTSTG_getEventDelay: when an event of side's runs.
Definition battle.h:148
EventQueueFuncs funcs
Definition battle.h:171
FIGHTSTG_startOneHpTurn's task, BATTLE_KIND_FINAL_SECOND's enemy turn: the enemy's second technique (...
Definition action.h:115
void(* nextState)(struct OneHpTurn *task)
Definition action.h:116
s32 state
Definition action.h:116
s32 substate
Definition action.h:116
s32 lines[8]
FIGHTSTG_updateMessage's, 0 ends them.
Definition action.h:117
Any task, seen through its header.
Definition task.h:62
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105
BattleScript * WFIGHTMN_startTech(u8 actor, s32 id)
Starts the effect of actor's move id (FIGHTSTG's FIGHTSTG_createBattleScript): its kind and motions f...
Definition techs.c:150
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
BattleMessageBox * message
FIGHTSTG_createMessage.
Definition task.h:18
BattleScript * script
a technique's (FIGHTSTG_createBattleScript)
Definition task.h:19