Stat
Stat
Kind: global class
- Stat
- new Stat(value)
- instance
- .id :
number
- .base :
Vector1
- .postprocess :
function
- .onModifierAdded ⇒
Signal.<LinearModifier>
- .onModifierRemoved ⇒
Signal.<LinearModifier>
- .onChanged ⇒
Signal
- .isStat :
boolean
- .resetModifiers()
- .valueOf() ⇒
number
- .toString() ⇒
string
- .getValue() ⇒
number
- .getBaseValue() ⇒
number
- .setBaseValue(v)
- .getModifiers() ⇒
Array.<LinearModifier>
- .addModifier(mod)
- .hasModifier(mod) ⇒
boolean
- .removeModifier(mod) ⇒
boolean
- .equals(other) ⇒
boolean
- .copy(other)
- .copyBase(other)
- .setBaseFromParametricFunction(f, v)
- .addNonTransientModifiersFromStat(other)
- .id :
- static
- .applyModifiers(input, modifiers) ⇒
number
- .applyModifiers(input, modifiers) ⇒
new Stat(value)
Param | Type |
---|---|
value | number |
stat.id : number
Unique identifier of a stat, such a health, armor etc.
Kind: instance property of Stat
stat.base : Vector1
Kind: instance property of Stat
stat.postprocess : function
Kind: instance property of Stat
stat.onModifierAdded ⇒ Signal.<LinearModifier>
Kind: instance property of Stat
stat.onModifierRemoved ⇒ Signal.<LinearModifier>
Kind: instance property of Stat
stat.onChanged ⇒ Signal
Kind: instance property of Stat
stat.isStat : boolean
Kind: instance property of Stat
Read only: true
stat.resetModifiers()
Remove all modifiers from the stat
Kind: instance method of Stat
stat.valueOf() ⇒ number
Kind: instance method of Stat
stat.toString() ⇒ string
Kind: instance method of Stat
stat.getValue() ⇒ number
Kind: instance method of Stat
stat.getBaseValue() ⇒ number
Kind: instance method of Stat
stat.setBaseValue(v)
Kind: instance method of Stat
Param | Type |
---|---|
v | number |
stat.getModifiers() ⇒ Array.<LinearModifier>
NOTE: do not modify result
Kind: instance method of Stat
stat.addModifier(mod)
Kind: instance method of Stat
Param | Type |
---|---|
mod | LinearModifier |
stat.hasModifier(mod) ⇒ boolean
Kind: instance method of Stat
Param | Type |
---|---|
mod | LinearModifier |
stat.removeModifier(mod) ⇒ boolean
Kind: instance method of Stat
Param | Type |
---|---|
mod | LinearModifier |
stat.equals(other) ⇒ boolean
Kind: instance method of Stat
Param | Type |
---|---|
other | Stat |
stat.copy(other)
Kind: instance method of Stat
Param | Type |
---|---|
other | Stat |
stat.copyBase(other)
Copy base value from another stat
Kind: instance method of Stat
Param | Type |
---|---|
other | Stat |
stat.setBaseFromParametricFunction(f, v)
Kind: instance method of Stat
Param | Type |
---|---|
f | function |
v | number |
stat.addNonTransientModifiersFromStat(other)
Kind: instance method of Stat
Param | Type |
---|---|
other | Stat |
Stat.applyModifiers(input, modifiers) ⇒ number
Kind: static method of Stat
Param | Type |
---|---|
input | number |
modifiers | List.<LinearModifier> |