|
Digimon World 3 decomp
The European version, SLES_039.36
|
FIGHTSTG's events: the queue of the battle's events in time (FIGHTSTG_events), and the functions that queue turns, statuses, recovery and the end of boosts: one module, as the original's jump tables are 8-aligned from its start and a cut between these would move the second one's. More...
#include "battle/battle_mode.h"Go to the source code of this file.
Functions | |
| void | FIGHTSTG_pushEvent (BattleEvent *event) |
| FIGHTSTG_events.funcs.push: queues an event in the first free one of the 99 slots, due after its delay. | |
| void | FIGHTSTG_pushEventFirst (BattleEvent *event) |
| FIGHTSTG_events.funcs.pushFirst: queues an event ahead of all the others, which wait its delay longer (at least 1, 2 in the European version) | |
| s32 | FIGHTSTG_popEvent (void) |
| Pops the next event: the one due soonest (in EU, events of types 2 and 3 give way to any due no later), moving all the others' times on by its. | |
| s32 | FIGHTSTG_findEventFrom (s32 start) |
| The first queued event from slot start of the type being looked for (FIGHTSTG_events.findType, 1-24), or -1. | |
| s32 | FIGHTSTG_findFirstEvent (s32 type) |
| FIGHTSTG_events.funcs.first: the first queued event of type, or -1. | |
| s32 | FIGHTSTG_findNextEvent (void) |
| FIGHTSTG_events.funcs.next: the next queued event of the same type, or -1. | |
| s32 | FIGHTSTG_findEvent (s32 type, u8 side, s32 fighter) |
| FIGHTSTG_events.funcs.find: the first queued event of type for side's fighter, or -1. | |
| void | FIGHTSTG_removeEvents (EventKey *key) |
| FIGHTSTG_events.funcs.remove: drops every queued event of key's side and fighter. | |
| s32 | FIGHTSTG_getEventDelay (u8 side, s32 kind) |
| FIGHTSTG_events.funcs.getDelay: the time until side's next event of kind (FIGHTSTG_eventDelays): random, or from the active fighters' stats and the other side's resistances, within the kind's range. | |
| void | FIGHTSTG_cureStatus (u8 side, s32 fighter, s32 item) |
| An item's cure (FIGHTSTG_events.funcs.cureStatus): items 0xBE-0xC5 clear a status of the fighter and remove its events, 0xC4 and 0xC5 all of them. | |
| void | FIGHTSTG_queuePlayerTurn (s32 delay) |
| Queues the player's turn (event 2) in delay. | |
| void | FIGHTSTG_queueEnemyTurn (s32 delay) |
| Queues the enemy's turn (event 3) in delay. | |
| void | FIGHTSTG_endBattle (s32 result) |
| Ends the battle: queues event 1 ahead of the others, with how it ended (BATTLE_FLED, BATTLE_WON or BATTLE_LOST) for WFIGHTMN. | |
| void | FIGHTSTG_queueRunAway (u8 side) |
| Queues side's attempt to run away (event 4) | |
| void | FIGHTSTG_queueAutoRecoverEnd (u8 side) |
| Queues the end of side's automatic recovery (item 0xBD), or pushes back the one already queued. | |
| void | FIGHTSTG_queueRecovery (u8 side, s32 fighter, s32 big) |
| Queues a fighter's recovery of HP (event 6, with what getHeal takes as big), or sets the one already queued to 0xBD. | |
| void | FIGHTSTG_queueClearField (s32 time) |
| Queues the field's clearing in time (at most 0x7FFF), or moves the one already queued to it. | |
| 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_inflictParalysis (u8 side, s32 unused, u8 strength) |
| Paralyzes side's active fighter (FIGHTER_PARALYZED) with a strength, and queues its end, which the strength puts off, or pushes back the one already queued. | |
| 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 strength when a technique, fromTech, causes it) or pushes back 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, which the strength puts off, or pushes back the one already queued. | |
| void | FIGHTSTG_queueBoostEnd (u8 side, s32 fighter, s32 kind, s32 tech) |
| Queues the end of a fighter's boost of stat kind, 12 frames on when a technique (tech) gave it and 8 when an item did (tech 0), or pushes back the one already queued. | |
Variables | |
| s32 | FIGHTSTG_eventPopModes [] |
| per event type, whether FIGHTSTG_popEvent takes (1), peeks at (-1) or drops (0) it | |
| EventQueue | FIGHTSTG_events |
| the battle's events and their functions | |
| EventDelay | FIGHTSTG_eventDelays [] |
| the delay ranges of FIGHTSTG_getEventDelay's kinds | |
| u8 | FIGHTSTG_statusEvents [] |
| the status events FIGHTSTG_cureStatus clears, by kind of status, | |
| u8 | FIGHTSTG_statusFlags [] |
| and the flags it clears with them (all six for kind 3) | |
| s32 | FIGHTSTG_boostEvents [] |
| the event types of FIGHTSTG_queueBoostEnd, by the stat boosted | |
FIGHTSTG's events: the queue of the battle's events in time (FIGHTSTG_events), and the functions that queue turns, statuses, recovery and the end of boosts: one module, as the original's jump tables are 8-aligned from its start and a cut between these would move the second one's.
Definition in file events.c.
| void FIGHTSTG_pushEvent | ( | BattleEvent * | event | ) |
FIGHTSTG_events.funcs.push: queues an event in the first free one of the 99 slots, due after its delay.
Definition at line 11 of file events.c.
Referenced by FIGHTSTG_inflictConfusion(), FIGHTSTG_inflictParalysis(), FIGHTSTG_inflictPoison(), FIGHTSTG_inflictSleep(), FIGHTSTG_pushEventFirst(), FIGHTSTG_queueAutoRecoverEnd(), FIGHTSTG_queueBlast(), FIGHTSTG_queueBlastEnd(), FIGHTSTG_queueBoostEnd(), FIGHTSTG_queueClearField(), FIGHTSTG_queueEnemyTurn(), FIGHTSTG_queuePartnerTech(), FIGHTSTG_queuePlayerTurn(), FIGHTSTG_queueRecovery(), FIGHTSTG_queueRunAway(), FIGHTSTG_queueSpecialEnd(), FIGHTSTG_startRestriction(), and FIGHTSTG_weakenEnemy().
| void FIGHTSTG_pushEventFirst | ( | BattleEvent * | event | ) |
FIGHTSTG_events.funcs.pushFirst: queues an event ahead of all the others, which wait its delay longer (at least 1, 2 in the European version)
Definition at line 54 of file events.c.
Referenced by FIGHTSTG_endBattle(), FIGHTSTG_queueDigidevolve(), FIGHTSTG_queueKnockOut(), FIGHTSTG_queueLastEnemy(), and FIGHTSTG_queueSpecialEnd().
| s32 FIGHTSTG_popEvent | ( | void | ) |
The first queued event from slot start of the type being looked for (FIGHTSTG_events.findType, 1-24), or -1.
Definition at line 159 of file events.c.
Referenced by FIGHTSTG_findEvent(), FIGHTSTG_findFirstEvent(), FIGHTSTG_findNextEvent(), and FIGHTSTG_queueClearField().
| s32 FIGHTSTG_findNextEvent | ( | void | ) |
FIGHTSTG_events.funcs.find: the first queued event of type for side's fighter, or -1.
Definition at line 187 of file events.c.
Referenced by FIGHTSTG_inflictConfusion(), FIGHTSTG_inflictParalysis(), FIGHTSTG_inflictPoison(), FIGHTSTG_inflictSleep(), FIGHTSTG_queueAutoRecoverEnd(), FIGHTSTG_queueBoostEnd(), FIGHTSTG_queueRecovery(), FIGHTSTG_queueSpecialEnd(), and FIGHTSTG_startRestriction().
| void FIGHTSTG_removeEvents | ( | EventKey * | key | ) |
FIGHTSTG_events.funcs.getDelay: the time until side's next event of kind (FIGHTSTG_eventDelays): random, or from the active fighters' stats and the other side's resistances, within the kind's range.
< magic damage, and against it
< magic damage, and against it
< magic damage, and against it
< magic damage, and against it
< magic damage, and against it
< physical accuracy, evasion and running away
< physical accuracy, evasion and running away
< physical accuracy, evasion and running away
Definition at line 224 of file events.c.
Referenced by FIGHTSTG_inflictConfusion(), FIGHTSTG_inflictParalysis(), FIGHTSTG_inflictSleep(), FIGHTSTG_queueAutoRecoverEnd(), FIGHTSTG_queueBlastEnd(), FIGHTSTG_queueBoostEnd(), FIGHTSTG_queueRunAway(), and FIGHTSTG_queueSpecialEnd().
| void FIGHTSTG_queuePlayerTurn | ( | s32 | delay | ) |
Queues the player's turn (event 2) in delay.
The events they queue for WFIGHTMN, and its turn's substate.
Definition at line 360 of file events.c.
Referenced by queueFirstTurns(), WFIGHTMN_runCommand(), WFIGHTMN_runConfusedCommand(), and WFIGHTMN_runTurn().
| void FIGHTSTG_queueEnemyTurn | ( | s32 | delay | ) |
Queues the enemy's turn (event 3) in delay.
Definition at line 368 of file events.c.
Referenced by announceEnemyTech(), FIGHTSTG_updateEnemyTurn(), FIGHTSTG_updateOneHpTurn(), queueFirstTurns(), and WFIGHTMN_runTurn().
| void FIGHTSTG_endBattle | ( | s32 | result | ) |
Ends the battle: queues event 1 ahead of the others, with how it ended (BATTLE_FLED, BATTLE_WON or BATTLE_LOST) for WFIGHTMN.
< FIGHTSTG_endBattle
Definition at line 377 of file events.c.
Referenced by applyStatusEvent(), endBattleOnKnockOut(), fleeWhenWeak(), and WFIGHTMN_runAway().
| void FIGHTSTG_queueRunAway | ( | u8 | side | ) |
Queues side's attempt to run away (event 4)
Definition at line 386 of file events.c.
Referenced by FIGHTSTG_updateEnemyTurn(), and WFIGHTMN_runCommand().
| void FIGHTSTG_queueAutoRecoverEnd | ( | u8 | side | ) |
Queues the end of side's automatic recovery (item 0xBD), or pushes back the one already queued.
Definition at line 396 of file events.c.
Referenced by useItemTech().
Queues a fighter's recovery of HP (event 6, with what getHeal takes as big), or sets the one already queued to 0xBD.
Definition at line 417 of file events.c.
Referenced by useItemTech(), and WFIGHTMN_checkEquip().
| void FIGHTSTG_queueClearField | ( | s32 | time | ) |
Queues the field's clearing in time (at most 0x7FFF), or moves the one already queued to it.
events.c's statuses and events
Definition at line 436 of file events.c.
Referenced by boostElement(), boostFieldElement(), and boostRandomElement().
Poisons a fighter (FIGHTER_POISONED), and queues its damage or updates the one already queued.
< the damage of a poisoned fighter (FIGHTER_POISONED)
< the damage of a poisoned fighter (FIGHTER_POISONED)
< takes damage (EVENT_STATUS_DAMAGE)
Definition at line 456 of file events.c.
Referenced by applyStatusEvent().
Paralyzes side's active fighter (FIGHTER_PARALYZED) with a strength, and queues its end, which the strength puts off, or pushes back the one already queued.
< 10-12: the end of FIGHTER_PARALYZED, FIGHTER_CONFUSED or FIGHTER_ASLEEP
< 10-12: the end of FIGHTER_PARALYZED, FIGHTER_CONFUSED or FIGHTER_ASLEEP
< loses turns at random (FIGHTSTG_battleFuncs.testParalysis)
Definition at line 481 of file events.c.
Referenced by applyStatusEvent().
Confuses side's active fighter (FIGHTER_CONFUSED) with a strength, and queues its end (put off by the strength when a technique, fromTech, causes it) or pushes back the one already queued.
< 10-12: the end of FIGHTER_PARALYZED, FIGHTER_CONFUSED or FIGHTER_ASLEEP
< 10-12: the end of FIGHTER_PARALYZED, FIGHTER_CONFUSED or FIGHTER_ASLEEP
Definition at line 506 of file events.c.
Referenced by applyStatusEvent(), and confuseFighters().
Puts side's active fighter to sleep (FIGHTER_ASLEEP) with a strength, and queues its end, which the strength puts off, or pushes back the one already queued.
< 10-12: the end of FIGHTER_PARALYZED, FIGHTER_CONFUSED or FIGHTER_ASLEEP
< 10-12: the end of FIGHTER_PARALYZED, FIGHTER_CONFUSED or FIGHTER_ASLEEP
< can't act or run away; a hit may wake it up
Definition at line 535 of file events.c.
Referenced by applyStatusEvent(), and FIGHTSTG_updateActionEvents().
Queues the end of a fighter's boost of stat kind, 12 frames on when a technique (tech) gave it and 8 when an item did (tech 0), or pushes back the one already queued.
Definition at line 565 of file events.c.
Referenced by boostAttack(), boostDefense(), boostFighterStat(), boostSideStat(), boostSpeed(), FIGHTSTG_lowerAttack(), FIGHTSTG_lowerDefense(), FIGHTSTG_reviveFighter(), lowerEnemySpeed(), restoreSide(), showLoweredStat(), and weakenEnemyDefense().
| s32 FIGHTSTG_eventPopModes[] |
per event type, whether FIGHTSTG_popEvent takes (1), peeks at (-1) or drops (0) it
per event type, FIGHTSTG_popEvent takes (1), peeks at (-1) or skips (0) it
Definition at line 32 of file events.c.
Referenced by FIGHTSTG_popEvent().
| EventQueue FIGHTSTG_events |
the battle's events and their functions
Definition at line 43 of file events.c.
Referenced by announceEnemyTech(), announceKnockOut(), boostElement(), boostRandomElement(), bringSecondEnemy(), cureStatus(), cureStatusTech(), FIGHTSTG_cureStatus(), FIGHTSTG_endBattle(), FIGHTSTG_endEnemyWeakness(), FIGHTSTG_findEvent(), FIGHTSTG_findEventFrom(), FIGHTSTG_findFirstEvent(), FIGHTSTG_findNextEvent(), FIGHTSTG_getEventDelay(), FIGHTSTG_inflictConfusion(), FIGHTSTG_inflictParalysis(), FIGHTSTG_inflictPoison(), FIGHTSTG_inflictSleep(), FIGHTSTG_popEvent(), FIGHTSTG_pushEvent(), FIGHTSTG_pushEventFirst(), FIGHTSTG_queueAutoRecoverEnd(), FIGHTSTG_queueBoostEnd(), FIGHTSTG_queueClearField(), FIGHTSTG_queueRecovery(), FIGHTSTG_queueSpecialEnd(), FIGHTSTG_removeEvents(), FIGHTSTG_reviveFighter(), FIGHTSTG_startRestriction(), FIGHTSTG_testWakeUp(), FIGHTSTG_updateCounterattack(), FIGHTSTG_updateEnemyTurn(), FIGHTSTG_updateOneHpTurn(), queueFirstTurns(), showRunAway(), wakeCounteredUp(), wakePlayerUp(), wakeUpOrCounter(), WFIGHTMN_blast(), WFIGHTMN_cancelBlast(), WFIGHTMN_cureStatus(), WFIGHTMN_digidevolve(), WFIGHTMN_endAutoRecover(), WFIGHTMN_endBattle(), WFIGHTMN_endBoost(), WFIGHTMN_endRestriction(), WFIGHTMN_endSpecial(), WFIGHTMN_knockOut(), WFIGHTMN_recover(), WFIGHTMN_restoreEnemy(), WFIGHTMN_runAway(), WFIGHTMN_runCommand(), WFIGHTMN_runConfusedCommand(), WFIGHTMN_runTurn(), WFIGHTMN_tag(), and WFIGHTMN_takeDamage().
| EventDelay FIGHTSTG_eventDelays[] |
the delay ranges of FIGHTSTG_getEventDelay's kinds
Definition at line 214 of file events.c.
Referenced by FIGHTSTG_getEventDelay().
| u8 FIGHTSTG_statusEvents[] |
the status events FIGHTSTG_cureStatus clears, by kind of status,
FIGHTSTG_cureStatus's event types.
Definition at line 299 of file events.c.
Referenced by FIGHTSTG_cureStatus().
| u8 FIGHTSTG_statusFlags[] |
| s32 FIGHTSTG_boostEvents[] |
the event types of FIGHTSTG_queueBoostEnd, by the stat boosted
FIGHTSTG_queueBoostEnd's event types.
Definition at line 558 of file events.c.
Referenced by FIGHTSTG_queueBoostEnd().