Stat
A single stat.
Properties
Name | Description | Type |
---|---|---|
identity | The identity of this stat. | StatIdentity |
baseValue | The stat value without any alterations. | float |
currentMaxValue | The stat's current max value (the value with all other stats combined). | float |
currentValue | The stat value with alterations. | float |
combineType | The method to use when combined with other stats. | CombineType |
combineOperator | The operator to use when combined with another stat. | CombineOperator |
combinedStats | A list of stats combined with this stat. | List<Stat> |
Methods
CreateCopy
Overridable
Return Type: Stat
Creates an returns a copy of this stat.
RecalculateMaxValue
Overridable
Recalculates the max value.
ResetValues
Overridable
Resets all values.
ResetCurrentValue
Overridable
Resets the current value.
IncreaseCurrentValue
Overridable
Return Type: float
Increases the current value by an amount. Returns the excess amount.
Parameters
Name | Description | Type |
---|---|---|
amount | The amount to increase by. | float |
DecreaseCurrentValue
Overridable
Return Type: float
Decreases the current value by an amount. Returns the excess amount.
Parameters
Name | Description | Type |
---|---|---|
amount | The amount to decrease by. | float |
SetCurrentValue
Overridable
Return Type: float
Sets the current value.
Parameters
Name | Description | Type |
---|---|---|
newValue | The value to set to. | float |
Combine
Overridable
Combines this stat with others.
Parameters
Name | Description | Type |
---|---|---|
stats | A list of stats to combine with. | params Stat[] |
Enums
CombineType
Supported stat combine types.
Name | Description |
---|---|
Value | Combine the stat with another by it's exact value. |
PercentMax | Combine the stat with another by it's max value as a percentage. |
PercentCurrent | Combine the stat with another by it's current value as a percentage. |
CombineOperator
Supported stat combine operators.
Name | Description |
---|---|
Add | Add the value. |
Subtract | Subtract the value. |
Last updated