UpgradableStat

A stat that can be upgraded.

Inherits from Stat.

Properties

NameDescriptionType

initialValue

The value of the stat at level 0.

float

scaling

The amount this stat will scale each level.

float

currentLevel

The current level of this stat.

int

maxLevel

The max level of this stat.

int

text

Any-purpose stat text.

string

nextBaseValue

The base value of the stat if leveled up.

float

isMaxed

If this stat is maxed.

bool

statsProviderReference

The stats provider reference.

UnitStatsProvider

Methods

NameMatches

Return Type: bool

Checks if this stat's name or abbreviation match the provided string.

Parameters

NameDescriptionType

name

The stat's name or abbreviation.

string

RecalculateBaseValue

Return Type: float

Recalculates the base value. Returns the base value after recalculation.

SetLevel

Sets the level while ignoring min/max level values. Use TryUpgrade or TryDowngrade to not ignore min/max values.

Parameters

NameDescriptionType

level

The level to set to.

int

TryUpgrade

Return Type: int

Increases the stat level by an amount if possible. The excess amount of stat points.

Parameters

NameDescriptionType

amount

The amount to increase by. Default: 1.

int

TryDowngrade

Return Type: int

Decreases the stat level by an amount if possible. The excess amount of stat points.

Parameters

NameDescriptionType

amount

The amount to decrease by. Default: 1.

int

Deplete

Completely removes all upgrades.

Recalculate

Recalculates the stat's values. This does not change the current value.

Last updated