Damage

new Damage(config)

Parameters:
Name Type Description
config Object
Properties
Name Type Attributes Default Description
attribute string

Attribute the damage is going to apply to

amount number <optional>
null
attacker Character <optional>
null

Character causing the damage

type string <optional>
"physical"

Damage type e.g., physical, fire, etc.

source string <optional>
null

A damage source identifier. e.g., "skill:kick", "weapon", etc.

hidden boolean <optional>
false
Properties:
Name Type Attributes Description
attribute string

Attribute the damage is going to apply to

amount number

Initial amount of damage to be done

attacker Character <nullable>

Character causing the damage

type string <nullable>

Damage type e.g., physical, fire, etc.

source string <nullable>

A damage source identifier. e.g., "skill:kick", "weapon", etc.

finalAmount number

Amount of damage to be done after attacker/defender effects

Methods

commit(target)

Actually lower the attribute

Parameters:
Name Type Description
target Character
Fires:

evaluate(target) → {number}

Evaluate actual damage taking attacker/target's effects into account

Parameters:
Name Type Description
target Character
Returns:
number -

Final damage amount