battle_type.h
games/tbs/include/battle_type.h on GitHub
Structures
BattlePlan
struct BattlePlan
One action, as BattleCommand_BuildPlan lays it out for BattleTargetExec to apply target by target.
| Field | Declared as | |
|---|---|---|
actorId | u8 actorId | the acting unit |
targetCount | s8 targetCount | targets in targetIds |
targetIds | u8 targetIds[BATTLE_TARGET_CAPACITY] | in battlefield order |
targetOffset | s8 targetOffset[BATTLE_TARGET_CAPACITY] | Each target's place relative to the aimed one: negative to one side. |
targetMultiplier | s8 targetMultiplier[BATTLE_TARGET_CAPACITY] | The damage multiplier: 0 a miss, 1 a blow, 2 or 3 a double or triple. |
targetCritical | s8 targetCritical[BATTLE_TARGET_CAPACITY] | enum BattleCritical |
targetHit | s8 targetHit[BATTLE_TARGET_CAPACITY] | 1, 0 or HIT_NOT_ROLLED |
command | s16 command | enum BattleCommand |
unk4a | u8 unk4a[2] | not named by TBS code |
abilityId | s32 abilityId | |
element | s32 element | enum Element |
outcome | s32 outcome | enum BattlePlanStaging: how the action is shown |
presentationFlags | u32 presentationFlags | How the effect is staged (STAGING_ in battle_internal.h). bits: 19 view reversed | 18 view across | 17 other side | 16 on downed | 15 scene | 14 by id range | 13..12 variant | 11..0 effect kind |
failure | s32 failure | 0 cast; 1 the Psynergy is sealed, 2 too little PP |
hauntDamage | u32 hauntDamage | The damage the evil spirit deals a haunted actor at the end of its turn. |
Used by BattleCommand_BuildPlan, BattlePres_BuildTargetList, BattlePres_RunActorEntries, BattlePres_RunAttack, BattlePres_RunEscape, BattlePres_RunItem, BattlePres_RunPlainAttack, BattlePres_RunPsynergyCast, BattlePresentation_RunUnitTransition.
Enumerations
BattleCritical
enum BattleCritical
BattlePlan.targetCritical: the critical hit rolled for each target.
| Value | = | |
|---|---|---|
CRITICAL_NONE | ||
CRITICAL_HIT | an attack's: a quarter more damage | |
CRITICAL_STRONG | an ability's (effects 36 to 40): half as much again |
Macros
HIT_NOT_ROLLED
#define HIT_NOT_ROLLED -1
BattlePlan.targetHit while the hit is still to be rolled, as the ability lands; BattleCommand_BuildPlan rolls it ahead only for Annihilation.
Used by BattleCommand_BuildPlan.