Skip to Content
The Alchemy Project

include/battle/battle_side.h

Which units are in a battle, and the Djinn recovery list.

Included by battle_internal.h, turn_end_tables.c, battle_effect_internal.h, game_internal.h, battle_arena.c, screens_internal.h and window_internal.h.

Structures

NameDescription
structBATTLE_SIDE_ORDERThe order the two sides take their turn-end effects in.
structDJINN_RECOVERY_ENTRYA Djinni on standby or recovering: its element and index, the unit it belongs to, and the turns until it is set again.
structDJINN_RECOVERY_LISTOne side's Djinn recovery list: up to 64 entries and their count.
structDJINN_RECOVERY_TABLEOne side's Djinn recovery table, as gmDjinnGetRecoveryTable returns it: the party's MainRoutineStateWork.holdings, the enemies' over battle unit OPPONENT_RECOVERY_UNIT.

Macros

NameDescription
#definePLACE_PARTY (1 << 8)The list place codes the target pickers return (battle_targeting.c, mnBattleTargetRunSelection, btFindUnitPlace): a place in the party's list or the enemies', or'd with the side's tag.
#definePLACE_ENEMY (PLACE_PARTY | PLACE_ENEMY_SIDE)
#definePLACE_ENEMY_SIDE (1 << 7)A place code's side bit, set for the enemies' list, and its place in the list (btGetUnitAtPlace).
#definePLACE_INDEX_MASK ((1 << 4) - 1)
#defineDJINN_RECOVERY_PARTY 0The Djinn recovery list's two tables (gmDjinnGetRecoveryTableStub): the party's and the link opponent's.
#defineDJINN_RECOVERY_OPPONENT 1
#defineOPPONENT_RECOVERY_UNIT (FIRST_ENEMY_UNIT + 3)The enemy unit whose record holds the link opponent's Djinn recovery table: the opponent's three party members take the three before it (scBattleArenaReceivePartyRecords), and the table fits in one unit's record.
#defineDJINN_RECOVERY_AFTER_BATTLE -1DJINN_RECOVERY_ENTRY.turns of a Djinni on standby.
#defineDJINN_RECOVERY_SUMMONED -2DJINN_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 (btUnitProcessActionEnd).

Enumerations

NameDescription
enumBATTLE_SIDE { BATTLE_SIDE_NONE, BATTLE_SIDE_ENEMY, BATTLE_SIDE_PARTY }UNIT.side: which side a unit fights on, if it is in the battle.
enumBATTLE_UNIT_LIST_MARK { BATTLE_UNIT_REMOVED, BATTLE_UNIT_LIST_END }Marks in a list of unit ids, such as BATTLE_STATE.partyUnits and enemyIds.
enumBATTLE_SIDE_MASK { BATTLE_SIDE_MASK_PARTY, BATTLE_SIDE_MASK_ENEMIES, BATTLE_SID … }Which sides a unit list takes, as btUnitListLiving reads it.

Description

Which units are in a battle, and the Djinn recovery list.

Macros in detail

PLACE_PARTY

#define PLACE_PARTY (1 << 8)

The list place codes the target pickers return (battle_targeting.c, mnBattleTargetRunSelection, btFindUnitPlace): a place in the party's list or the enemies', or'd with the side's tag.

Referenced by btAIChooseRandomTarget(), btAIChooseTarget(), btFindUnitPlace(), mnBattleCollectPartyCommands() and mnBattleTargetRunSelection().

Definition at line 27 of file battle_side.h.

PLACE_ENEMY

#define PLACE_ENEMY (PLACE_PARTY | PLACE_ENEMY_SIDE)

Referenced by btAIChooseRandomTarget(), btAIChooseTarget(), btFindUnitPlace() and mnBattleTargetRunSelection().

Definition at line 28 of file battle_side.h.

PLACE_ENEMY_SIDE

#define PLACE_ENEMY_SIDE (1 << 7)

A place code's side bit, set for the enemies' list, and its place in the list (btGetUnitAtPlace).

Referenced by btActionRunBuild() and btGetUnitAtPlace().

Definition at line 31 of file battle_side.h.

PLACE_INDEX_MASK

#define PLACE_INDEX_MASK ((1 << 4) - 1)

Referenced by btActionRunBuild() and btGetUnitAtPlace().

Definition at line 32 of file battle_side.h.

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(), btDjinnCountStandby(), btDjinnRecoveryCountDown(), btDjinnRecoveryReconcile(), btLinkBattleSendParty(), btRun(), btSummonUpdateAvailability(), gmDjinnRecoveryCountStandby(), gmSummonListLearned(), mnBattleCommandRowRun(), mnBattleDjinnMenuRun() and scBattleArenaSendPartyRecords().

Definition at line 50 of file battle_side.h.

DJINN_RECOVERY_OPPONENT

#define DJINN_RECOVERY_OPPONENT 1

Referenced by btActionRunBuild(), btDjinnCountStandby(), btDjinnRecoveryReconcile(), btLinkBattleReceiveParty(), mnBattleDjinnMenuRun() and scBattleArenaReceivePartyRecords().

Definition at line 51 of file battle_side.h.

OPPONENT_RECOVERY_UNIT

#define OPPONENT_RECOVERY_UNIT (FIRST_ENEMY_UNIT + 3)

The enemy unit whose record holds the link opponent's Djinn recovery table: the opponent's three party members take the three before it (scBattleArenaReceivePartyRecords), and the table fits in one unit's record.

Referenced by gmDjinnGetRecoveryTable().

Definition at line 56 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; a party member who does not fight has it set as the next battle starts, outside a link battle (btDjinnRecoveryReconcile). btDjinnRecoveryCountDown counts down only positive turns.

Referenced by btActionRunBuild(), btDjinnCountStandby(), btDjinnRecoveryReconcile(), btUnitProcessActionEnd(), gmDjinnRecoveryAddStandby() and gmDjinnRecoveryCountStandby().

Definition at line 64 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 (btUnitProcessActionEnd).

Referenced by btActionRunBuild(), btUnitProcessActionEnd() and gmDjinnCanSet().

Definition at line 69 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.

EnumeratorValueDescription
BATTLE_SIDE_NONE0
BATTLE_SIDE_ENEMY1
BATTLE_SIDE_PARTY2

Definition at line 10 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.

EnumeratorValueDescription
BATTLE_UNIT_REMOVED254a place whose unit has left the battle
BATTLE_UNIT_LIST_END255ends the list

Definition at line 18 of file battle_side.h.

BATTLE_SIDE_MASK

enum BATTLE_SIDE_MASK

Which sides a unit list takes, as btUnitListLiving reads it.

EnumeratorValueDescription
BATTLE_SIDE_MASK_PARTY1
BATTLE_SIDE_MASK_ENEMIES2
BATTLE_SIDE_MASK_BOTHBATTLE_SIDE_MASK_PARTY | BATTLE_SIDE_MASK_ENEMIES

Definition at line 35 of file battle_side.h.