include/battle/battle_side.h
The two sides of a battle, their unit lists, and the Djinn each side has on standby or recovering.
Included by battle_internal.h, turn_end_tables.c, window_internal.h and character.h.
Structures
| Name | Description | |
|---|---|---|
struct | BATTLE_SIDE_ORDER | The order the two sides take their turn-end effects in. |
struct | DJINN_RECOVERY_ENTRY | A Djinni on standby or recovering: its element and index, its owner, and the turns until it is set again. |
struct | DJINN_RECOVERY_LIST | One side's Djinn recovery list: up to 72 entries and their count. |
struct | DJINN_RECOVERY_TABLE | One side's Djinn recovery table, as gmDjinnGetRecoveryTable returns it: the party's inside MainRoutineStateWork from summonMask on, the link opponent's in the fourth enemy unit (FIRST_ENEMY_UNIT + 3), which an opponent of three never fills. |
Macros
| Name | Description | |
|---|---|---|
#define | DJINN_RECOVERY_PARTY 0 | The Djinn recovery list's two tables (gmDjinnGetRecoveryTableStub): the party's and the link opponent's. |
#define | DJINN_RECOVERY_OPPONENT 1 | |
#define | DJINN_RECOVERY_AFTER_BATTLE -1 | DJINN_RECOVERY_ENTRY.turns of a Djinni on standby. |
#define | DJINN_RECOVERY_SUMMONED -2 | DJINN_RECOVERY_ENTRY.turns of a standby Djinni a summon has just used, until the summoner's action ends and sets its count of turns to recover. |
Enumerations
| Name | Description | |
|---|---|---|
enum | BATTLE_SIDE { BATTLE_SIDE_NONE, BATTLE_SIDE_ENEMY, BATTLE_SIDE_PARTY } | UNIT.side: which side a unit fights on, if it is in the battle. |
enum | BATTLE_UNIT_LIST_MARK { BATTLE_UNIT_REMOVED, BATTLE_UNIT_LIST_END } | Marks in a list of unit ids, such as BATTLE_STATE.partyUnits and enemyIds. |
enum | BATTLE_SIDE_MASK { BATTLE_SIDE_MASK_PARTY, BATTLE_SIDE_MASK_ENEMIES, BATTLE_SID … } | Which sides a unit list takes. |
Functions
| Name | Description | |
|---|---|---|
Sint32 | btEnemyList (Sint16 *unitIds) | Lists the enemy units present and returns how many, 0 when unitIds is null. |
Sint32 | btPartyAssignOpponentSlots (void) | Records the unit id the link opponent knows each party member by: an enemy's, FIRST_ENEMY_UNIT on from the first member, as memberSlot - FIRST_ENEMY_UNIT comes out in the byte it is stored in. |
Bool | btUnitRollCounterEarlyEnd (Sint32 unitId, Sint32 turns, Sint32 bias) | Rolls whether a stat change or status with five turns or fewer left ends early, at luck * 3 - turns * 5 + bias percent, and returns 1 when it does. |
Bool | btUnitCountDownAttackStage (Sint32 unitId) | Counts down an Attack change and returns 1 when it ends; a lowered Attack may recover early. |
Bool | btUnitCountDownDefenseStage (Sint32 unitId) | Counts down a Defense change and returns 1 when it ends; a lowered Defense may recover early. |
Bool | btUnitCountDownResistanceStage (Sint32 unitId) | Counts down a Resistance change and returns 1 when it ends; a lowered Resistance may recover early. |
Bool | btUnitCountDownDelusion (Sint32 unitId) | Counts down delusion and returns 1 when it ends, early or not. |
Bool | btUnitCountDownConfusion (Sint32 unitId) | Counts down confusion and returns 1 when it ends, early or not. |
Bool | btUnitCountDownCharm (Sint32 unitId) | Counts down charm and returns 1 when it ends, early or not. |
Bool | btUnitCountDownStun (Sint32 unitId) | Counts down a stun and returns 1 when it ends, early or not. |
Bool | btUnitCountDownSleep (Sint32 unitId) | Counts down sleep and returns 1 when it ends, early or not. |
Bool | btUnitCountDownPsynergySeal (Sint32 unitId) | Counts down both seals in UNIT.psySeal and returns 1 when the last ends; only Bind's, once Luff's is gone, may end early. |
Bool | btUnitCountDownReflect (Sint32 unitId) | Counts down Reflect and returns 1 when it runs out; it never ends early. |
Bool | btUnitCountDownAgilityStage (Sint32 unitId) | Counts down an Agility change and returns 1 when it runs out; it never ends early. |
Description
The two sides of a battle, their unit lists, and the Djinn each side has on standby or recovering.
Macros in detail
DJINN_RECOVERY_PARTY
#define DJINN_RECOVERY_PARTY 0
The Djinn recovery list's two tables (gmDjinnGetRecoveryTableStub): the
party's and the link opponent's.
Referenced by btActionRunBuild(), btDebugParamSetLoad(), btDjinnCountStandby(), btDjinnRecoveryCountDown(), btLinkBattleSendParty(), btRun(), btSummonUpdateAvailability(), gmDjinnRecoveryCountStandby(), gmSummonLearn() and gmSummonListLearned().
Definition at line 41 of file battle_side.h.
DJINN_RECOVERY_OPPONENT
#define DJINN_RECOVERY_OPPONENT 1
Referenced by btActionRunBuild(), btDjinnCountStandby() and btLinkBattleReceiveParty().
Definition at line 42 of file battle_side.h.
DJINN_RECOVERY_AFTER_BATTLE
#define DJINN_RECOVERY_AFTER_BATTLE -1
DJINN_RECOVERY_ENTRY.turns of a Djinni on standby. In battle it stays so
until a Djinn command sets it again or a summon uses it
(DJINN_RECOVERY_SUMMONED), both in btActionRunBuild.
Referenced by btActionRunBuild(), btDjinnCountStandby(), btUnitDrainDjinn(), btUnitProcessActionEnd(), gmDjinnRecoveryAddStandby() and gmDjinnRecoveryCountStandby().
Definition at line 47 of file battle_side.h.
DJINN_RECOVERY_SUMMONED
#define DJINN_RECOVERY_SUMMONED -2
DJINN_RECOVERY_ENTRY.turns of a standby Djinni a summon has just used, until
the summoner's action ends and sets its count of turns to recover.
Referenced by btActionRunBuild(), btUnitDrainDjinn() and gmDjinnCanSet().
Definition at line 51 of file battle_side.h.
Enumerations in detail
BATTLE_SIDE
enum BATTLE_SIDE
UNIT.side: which side a unit fights on, if it is in the battle.
| Enumerator | Value | Description |
|---|---|---|
BATTLE_SIDE_NONE | 0 | |
BATTLE_SIDE_ENEMY | 1 | |
BATTLE_SIDE_PARTY | 2 |
Definition at line 11 of file battle_side.h.
BATTLE_UNIT_LIST_MARK
enum BATTLE_UNIT_LIST_MARK
Marks in a list of unit ids, such as BATTLE_STATE.partyUnits and enemyIds.
| Enumerator | Value | Description |
|---|---|---|
BATTLE_UNIT_REMOVED | 254 | a place whose unit has left the battle |
BATTLE_UNIT_LIST_END | 255 | ends the list |
Definition at line 19 of file battle_side.h.
BATTLE_SIDE_MASK
enum BATTLE_SIDE_MASK
Which sides a unit list takes.
| Enumerator | Value | Description |
|---|---|---|
BATTLE_SIDE_MASK_PARTY | 1 | |
BATTLE_SIDE_MASK_ENEMIES | 2 | |
BATTLE_SIDE_MASK_BOTH | BATTLE_SIDE_MASK_PARTY | BATTLE_SIDE_MASK_ENEMIES |
Definition at line 26 of file battle_side.h.