Scaling Value
Scripting with the ScalingValue class.
The ScalingValue
class is a numeric value that can scale with level.
Fields & Properties
numericType
The numeric type.
NumericValue.NumericType
public
value
The current value.
NumericValue
public
excessValue
The last calculated excess value.
NumericValue
protected
scalingSource
The scaling source.
ScalingSource
public
level
The current level.
int
public
maxLevel
The max level.
int
public
lowValue
The low value.
NumericValue
public
HighValue
The value at the current level.
NumericValue
public
NextValue
The high value if leveled up.
NumericValue
public
MaxValue
The high value at the max level.
NumericValue
public
IsLevelMaxed
If the level is maxed.
bool
public
IsLow
If the current value is equal to the low value.
bool
public
IsHigh
If the current value is equal to the high value.
bool
public
Creating a Scaling Value
To create a ScalingValue
, you need to define the scaling. This can be done by creating and providing the Scaling Source or by simply providing the appropriate values in the constructor.
The default current level set is 1 and the default max level set is the 'Default Max Level' value that you can set from Settings.
No Scaling
Linear Scaling
Curve Scaling
Managing Levels
Setting the Level
To set the max value, use the SetMaxLevel
method.
The SetLevel
will set the current level to a specific value.
Increasing the Level
Use the LevelUp
method to increase the level by a given amount. This method returns the unused excess amount. The level cannot go over the max level.
Decreasing the Level
Use the LevelDown
method to decrease the level by a given amount. This method returns the unused excess amount. The level cannot go lower than 1.
Optionally, you can use the Deplete
method to set the level to 1.
Last updated