![]() |
Eye of the Nile Docs
Everything you need to know to get started!
|
Basic properties of a player stat that can be modified by abilities using StatModifiers (see StatModifier, StatsAE, and PlayerStatHolder). Each stat has a name and a base value, set in the editor.
Documentation updated 10/11/2024
Public Member Functions | |
void | AddModifier (StatModifier statMod) |
Add a stat modifier. Checks to see if the stat modifer is already applied. | |
bool | RemoveModifier (StatModifier statMod) |
Remove a stat modifier. Checks to see if the stat modifer is actually applied. | |
float | FinalValue () |
Returns the final value of this stat, based on baseValue and all active stat modifiers. | |
Properties | |
string | StatName [get, set] |
Public version of _statName that can be used by scripts. | |
float | BaseValue [get, set] |
Public version of _baseValue that can be used by scripts. | |
Events | |
static Action< string, float > | modifierAdded |
Event that is triggered when a stat modifier is added to the player. | |
static Action< string, float > | modifierRemoved |
Event that is triggered when a stat modifier is removed from the player. | |
Private Attributes | |
string | _statName |
Name of the stat. Can be changed in the Unity Editor. | |
float | _baseValue |
Base value of the stat. Can be changed in the Unity Editor. | |
List< StatModifier > | statModifiers = new List<StatModifier>() |
List of currently active stat modifiers. | |
void PlayerStat.AddModifier | ( | StatModifier | statMod | ) |
Add a stat modifier. Checks to see if the stat modifer is already applied.
statMod | Stat modifier to add. |
float PlayerStat.FinalValue | ( | ) |
Returns the final value of this stat, based on baseValue and all active stat modifiers.
bool PlayerStat.RemoveModifier | ( | StatModifier | statMod | ) |
Remove a stat modifier. Checks to see if the stat modifer is actually applied.
statMod | Stat modifer to remove. |
|
private |
Base value of the stat. Can be changed in the Unity Editor.
|
private |
Name of the stat. Can be changed in the Unity Editor.
|
private |
List of currently active stat modifiers.
|
getset |
Public version of _baseValue that can be used by scripts.
|
getset |
Public version of _statName that can be used by scripts.
|
static |
Event that is triggered when a stat modifier is added to the player.
|
static |
Event that is triggered when a stat modifier is removed from the player.