Class MyEntityStat
Inheritance
System.Object
MyEntityStat
Assembly: Sandbox.Game.dll
Syntax
[MyFactoryTag]
public class MyEntityStat : Object
Constructors
MyEntityStat()
Declaration
Fields
m_currentValue
Declaration
protected float m_currentValue
Field Value
Type |
Description |
System.Single |
|
m_defaultValue
Declaration
protected float m_defaultValue
Field Value
Type |
Description |
System.Single |
|
m_maxValue
Declaration
protected float m_maxValue
Field Value
Type |
Description |
System.Single |
|
m_minValue
Declaration
protected float m_minValue
Field Value
Type |
Description |
System.Single |
|
StatDefinition
Declaration
public MyEntityStatDefinition StatDefinition
Field Value
Properties
CurrentRatio
Declaration
public float CurrentRatio { get; }
Property Value
Type |
Description |
System.Single |
|
DefaultValue
Declaration
public float DefaultValue { get; }
Property Value
Type |
Description |
System.Single |
|
MaxValue
Declaration
public float MaxValue { get; }
Property Value
Type |
Description |
System.Single |
|
MinValue
Declaration
public float MinValue { get; }
Property Value
Type |
Description |
System.Single |
|
ShouldSync
Declaration
public bool ShouldSync { get; }
Property Value
Type |
Description |
System.Boolean |
|
StatId
Declaration
public MyStringHash StatId { get; }
Property Value
StatRegenLeft
Declaration
public float StatRegenLeft { get; set; }
Property Value
Type |
Description |
System.Single |
|
Value
Declaration
public float Value { get; set; }
Property Value
Type |
Description |
System.Single |
|
Methods
add_OnStatChanged(MyEntityStat.StatChangedDelegate)
Declaration
public void add_OnStatChanged(MyEntityStat.StatChangedDelegate value)
Parameters
AddEffect(Single, Single, Single, Single, Single)
Declaration
public int AddEffect(float amount, float interval, float duration = -1F, float minRegenRatio = 0F, float maxRegenRatio = 1F)
Parameters
Type |
Name |
Description |
System.Single |
amount |
|
System.Single |
interval |
|
System.Single |
duration |
|
System.Single |
minRegenRatio |
|
System.Single |
maxRegenRatio |
|
Returns
Type |
Description |
System.Int32 |
|
AddEffect(MyObjectBuilder_EntityStatRegenEffect)
Declaration
public int AddEffect(MyObjectBuilder_EntityStatRegenEffect objectBuilder)
Parameters
Returns
Type |
Description |
System.Int32 |
|
ApplyRegenAmountMultiplier(Single, Single)
Declaration
public void ApplyRegenAmountMultiplier(float amountMultiplier = 1F, float duration = 2F)
Parameters
Type |
Name |
Description |
System.Single |
amountMultiplier |
|
System.Single |
duration |
|
CalculateRegenLeftForLongestEffect()
Declaration
public float CalculateRegenLeftForLongestEffect()
Returns
Type |
Description |
System.Single |
|
ClearEffects()
Declaration
public void ClearEffects()
Decrease(Single, Object)
Declaration
public void Decrease(float amount, object statChangeData)
Parameters
Type |
Name |
Description |
System.Single |
amount |
|
System.Object |
statChangeData |
|
GetEffect(Int32)
Declaration
public MyEntityStatRegenEffect GetEffect(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
GetEffects()
Declaration
public DictionaryReader<int, MyEntityStatRegenEffect> GetEffects()
Returns
GetEfficiencyMultiplier(Single, Single)
Declaration
public float GetEfficiencyMultiplier(float multiplier, float threshold)
Parameters
Type |
Name |
Description |
System.Single |
multiplier |
|
System.Single |
threshold |
|
Returns
Type |
Description |
System.Single |
|
GetObjectBuilder()
Declaration
public virtual MyObjectBuilder_EntityStat GetObjectBuilder()
Returns
HasAnyEffect()
Declaration
public bool HasAnyEffect()
Returns
Type |
Description |
System.Boolean |
|
Increase(Single, Object)
Declaration
public void Increase(float amount, object statChangeData)
Parameters
Type |
Name |
Description |
System.Single |
amount |
|
System.Object |
statChangeData |
|
Init(MyObjectBuilder_Base)
Declaration
public virtual void Init(MyObjectBuilder_Base objectBuilder)
Parameters
remove_OnStatChanged(MyEntityStat.StatChangedDelegate)
Declaration
public void remove_OnStatChanged(MyEntityStat.StatChangedDelegate value)
Parameters
RemoveEffect(Int32)
Declaration
public bool RemoveEffect(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
System.Boolean |
|
ResetRegenAmountMultiplier()
Declaration
public void ResetRegenAmountMultiplier()
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
TryGetEffect(Int32, out MyEntityStatRegenEffect)
Declaration
public bool TryGetEffect(int id, out MyEntityStatRegenEffect outEffect)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Update()
Declaration
public virtual void Update()
Events
OnStatChanged
Declaration
public event MyEntityStat.StatChangedDelegate OnStatChanged
Event Type