nw::AttackData

struct AttackData

Structure for aggregating attack related data.

Public Types

using DamageArray = absl::InlinedVector<DamageResult, 8>

Public Functions

void add(nw::Damage type_, int amount, bool unblockable = false)

Adds damage to damage result.

DamageArray &damages()

Gets damage array.

const DamageArray &damages() const

Gets damage array.

Public Members

Creature *attacker = nullptr
ObjectBase *target = nullptr
Item *weapon = nullptr
AttackType type = AttackType::invalid()
AttackResult result = AttackResult::miss_by_roll
TargetState target_state = TargetState::none
bool target_is_creature = false
bool is_ranged_attack = false
bool is_killing_blow = false

Is the attack enough to kill target.

int nth_attack = 0

The nth attack in the ‘round’.

int attack_roll = 0
int attack_bonus = 0
int damage_total = 0
int armor_class = 0
int iteration_penalty = 0
int multiplier = 0
int threat_range = 0
int concealment = 0
DamageResult damage_base

Base weapon damage.

absl::InlinedVector<nw::Effect*, 8> effects_to_apply

Effects to apply to target.

absl::InlinedVector<nw::EffectHandle, 8> effects_to_remove

Effects to remove from target.