Table of Contents

Class StatModifiers

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public class StatModifiers
Inheritance
StatModifiers
Inherited Members
Extension Methods

Fields

canEat

public bool canEat

Field Value

bool

generalStats

Unaffected by item being broken

public Dictionary<string, float>? generalStats

Field Value

Dictionary<string, float>

healingeffectivness

public float healingeffectivness

Field Value

float

hungerrate

public float hungerrate

Field Value

float

negativeEffectStats

When item broken only positive values applied

public Dictionary<string, float>? negativeEffectStats

Field Value

Dictionary<string, float>

positiveEffectStats

When item broken only negative values applied

public Dictionary<string, float>? positiveEffectStats

Field Value

Dictionary<string, float>

rangedWeaponsAcc

public float rangedWeaponsAcc

Field Value

float

rangedWeaponsSpeed

public float rangedWeaponsSpeed

Field Value

float

walkSpeed

public float walkSpeed

Field Value

float

Methods

AddFrom(StatModifiers, bool, float, float)

public virtual void AddFrom(StatModifiers other, bool broken = false, float multiplier = 1, float walkSpeedDebufMultiplier = 1)

Parameters

other StatModifiers
broken bool
multiplier float
walkSpeedDebufMultiplier float

AggregateStatsFrom(Dictionary<string, float>?, Dictionary<string, float>, string)

protected static void AggregateStatsFrom(Dictionary<string, float>? statValues, Dictionary<string, float> aggregatedValues, string code)

Parameters

statValues Dictionary<string, float>
aggregatedValues Dictionary<string, float>
code string

Apply(EntityStats, string)

public virtual void Apply(EntityStats entityStats, string entityStatCode)

Parameters

entityStats EntityStats
entityStatCode string

GetDescription(StringBuilder, bool)

public virtual void GetDescription(StringBuilder description, bool broken = false)

Parameters

description StringBuilder
broken bool

GetStatDescription(string, float)

Gets translated stat value description entry
"wearable-stat-description-hungerrate": "Hunger rate: {1}{0:0%}" - will result in 'Hunger rate: +12%' from value of 0.123
"wearable-stat-description-rangedweaponsspeed": "Ranged Weapon Charge Time: {2}{0:0.#%}" - will result in 'Ranged Weapon Charge Time: -12.3%' from value of 0.123

public static string GetStatDescription(string entityStatCategory, float value)

Parameters

entityStatCategory string
value float

Returns

string