Skip to Content
The Alchemy Project

include/battle/battle_action.h

A battle's battle objects and sprites, each unit's command and action, and the spoils.

Included by battle_effect_internal.h, battle_actor.h, battle_camera.h and battle_state.h.

Structures

NameDescription
structBATTLE_OBJECTA unit's place on the battlefield: its actor, resources and animations, its anchor spot and scale, and the statuses it shows.
structBATTLE_ACTIONA unit's chosen action for the turn: its command, the command's parameter, its target and range, and its priority in the action order.
structBATTLE_SPOILSA battle's spoils so far: coins, experience, enemies defeated and up to four items.

Macros

NameDescription
#defineDJINN_COMMAND (element, index) (((element) << 8) | (index))COMMAND_DJINN's parameter: the Djinni's element in bits 11 to 8, its number within the element below.
#defineDJINN_COMMAND_ELEMENT (parameter) (((parameter) >> 8) & 15)
#defineDJINN_COMMAND_INDEX (parameter) ((parameter) & 255)

Enumerations

NameDescription
enumBATTLE_COMMAND { COMMAND_ATTACK, COMMAND_PSYNERGY, COMMAND_ITEM, COMMAND_DEFE … }BATTLE_ACTION.command and BATTLE_ACTION_RUN's copy of it: what a unit does when it acts.

Description

A battle's battle objects and sprites, each unit's command and action, and the spoils.

Macros in detail

DJINN_COMMAND

#define DJINN_COMMAND(element, index) (((element) << 8) | (index))

COMMAND_DJINN's parameter: the Djinni's element in bits 11 to 8, its number within the element below.

Referenced by mnBattleDjinnMenuRun().

Definition at line 65 of file battle_action.h.

DJINN_COMMAND_ELEMENT

#define DJINN_COMMAND_ELEMENT(parameter) (((parameter) >> 8) & 15)

Referenced by btActionOrderSort(), btActionRunBuild(), mnBattleCollectPartyCommands() and mnBattleDjinnMenuShowChangePreview().

Definition at line 66 of file battle_action.h.

DJINN_COMMAND_INDEX

#define DJINN_COMMAND_INDEX(parameter) ((parameter) & 255)

Referenced by btActionOrderSort(), btActionRunBuild(), mnBattleCollectPartyCommands(), mnBattleDjinnMenuRun() and mnBattleDjinnMenuShowChangePreview().

Definition at line 67 of file battle_action.h.

Enumerations in detail

BATTLE_COMMAND

enum BATTLE_COMMAND

BATTLE_ACTION.command and BATTLE_ACTION_RUN's copy of it: what a unit does when it acts.

EnumeratorValueDescription
COMMAND_ATTACK0
COMMAND_PSYNERGY1
COMMAND_ITEM2
COMMAND_DEFEND3
COMMAND_ENEMY_ABILITY4
COMMAND_DJINN5
COMMAND_SUMMON6
COMMAND_TOTAL_DEFENSE7An enemy's Total Defense (ABILITY_EFFECT_TOTAL_DEFENSE)
COMMAND_NONE8nothing this turn
COMMAND_FLEE99

Definition at line 48 of file battle_action.h.