new Attribute(name, base, delta, formula, metadata)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
name |
string | ||
base |
number | ||
delta |
number | 0 | |
formula |
AttributeFormula | null | |
metadata |
object | {} |
Properties:
Name | Type | Description |
---|---|---|
name |
string | |
base |
number | |
delta |
number | Current difference from the base |
formula |
AttributeFormula | |
metadata |
object | any custom info for this attribute |
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