EffectList(target, effects)

Self-managing list of effects for a target

new EffectList(target, effects)

Parameters:
Name Type Description
target Character
effects Array.<(Object|Effect)>

array of serialized effects (Object) or actual Effect instances

Properties:
Name Type Description
effects Set
size number

Number of currently active effects

target Character

Members

size :number

Methods

add(effect)

Parameters:
Name Type Description
effect Effect
Fires:

clear()

Remove all effects, bypassing all deactivate and remove events

emit(event, …args)

Proxy an event to all effects

Parameters:
Name Type Attributes Description
event string
args * <repeatable>

entries() → {Array.<Effect>}

Get current list of effects as an array

Returns:
Array.<Effect>

evaluateAttribute(attr) → {number}

Gets the effective "max" value of an attribute (before subtracting delta). Does the work of actaully applying attribute modification

Parameters:
Name Type Description
attr Atrribute
Returns:
number

evaluateIncomingDamage(damage, currentAmount) → {number}

Parameters:
Name Type Description
damage Damage
currentAmount number
Returns:
number

evaluateOutgoingDamage(damage, currentAmount) → {number}

Parameters:
Name Type Description
damage Damage
currentAmount number
Returns:
number

getByType(type) → {Effect}

Parameters:
Name Type Description
type string
Returns:
Effect

hasEffectType(type) → {boolean}

Parameters:
Name Type Description
type string
Returns:
boolean

remove(effect)

Deactivate and remove an effect

Parameters:
Name Type Description
effect Effect
Fires:
Throws:

ReferenceError

validateEffects()

Ensure effects are still current and if not remove them