Attribute

Representation of an "Attribute" which is any value that has a base amount and depleted/restored safely. Where safely means without being destructive to the base value.

An attribute on its own cannot be raised above its base value. To raise attributes above their base temporarily see the Effect guide.

Constructor

new Attribute(name, base, delta)

Parameters:
Name Type Default Description
name string
base number
delta number 0
Properties:
Name Type Description
name string
base number
delta number

Current difference from the base

Methods

lower(amount)

Lower current value

Parameters:
Name Type Description
amount number

raise(amount)

Raise current value

Parameters:
Name Type Description
amount number

setBase(amount)

Change the base value

Parameters:
Name Type Description
amount number

setDelta(amount)

Bypass raise/lower, directly setting the delta

Parameters:
Name Type Description
amount amount