Damage(attribute, amount, attackeropt, sourceopt)

new Damage(attribute, amount, attackeropt, sourceopt)

Parameters:
Name Type Attributes Default Description
attribute string

Attribute the damage is going to apply to

amount number
attacker Character <optional>
null

Character causing the damage

source * <optional>
null

Where the damage came from: skill, item, room, etc.

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

source *

Where the damage came from: skill, item, room, etc.

metadata Object

Extra info about the damage: type, hidden, critical, etc.

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