Show / Hide Table of Contents

Class MyEntityStat

Inheritance
System.Object
MyEntityStat
Namespace: Sandbox.Game.Entities
Assembly: Sandbox.Game.dll
Syntax
[MyFactoryTag]
public class MyEntityStat : Object

Constructors

MyEntityStat()

Declaration
public MyEntityStat()

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
Type Description
MyEntityStatDefinition

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
Type Description
MyStringHash

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
Type Name Description
MyEntityStat.StatChangedDelegate value

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
Type Name Description
MyObjectBuilder_EntityStatRegenEffect objectBuilder
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
Type Description
MyEntityStatRegenEffect

GetEffects()

Declaration
public DictionaryReader<int, MyEntityStatRegenEffect> GetEffects()
Returns
Type Description
DictionaryReader<System.Int32, MyEntityStatRegenEffect>

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
Type Description
MyObjectBuilder_EntityStat

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
Type Name Description
MyObjectBuilder_Base objectBuilder

remove_OnStatChanged(MyEntityStat.StatChangedDelegate)

Declaration
public void remove_OnStatChanged(MyEntityStat.StatChangedDelegate value)
Parameters
Type Name Description
MyEntityStat.StatChangedDelegate value

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
Type Name Description
System.Int32 id
MyEntityStatRegenEffect outEffect
Returns
Type Description
System.Boolean

Update()

Declaration
public virtual void Update()

Events

OnStatChanged

Declaration
public event MyEntityStat.StatChangedDelegate OnStatChanged
Event Type
Type Description
MyEntityStat.StatChangedDelegate
☀
☾
In This Article
  • Constructors
    • MyEntityStat()
  • Fields
    • m_currentValue
    • m_defaultValue
    • m_maxValue
    • m_minValue
    • StatDefinition
  • Properties
    • CurrentRatio
    • DefaultValue
    • MaxValue
    • MinValue
    • ShouldSync
    • StatId
    • StatRegenLeft
    • Value
  • Methods
    • add_OnStatChanged(MyEntityStat.StatChangedDelegate)
    • AddEffect(Single, Single, Single, Single, Single)
    • AddEffect(MyObjectBuilder_EntityStatRegenEffect)
    • ApplyRegenAmountMultiplier(Single, Single)
    • CalculateRegenLeftForLongestEffect()
    • ClearEffects()
    • Decrease(Single, Object)
    • GetEffect(Int32)
    • GetEffects()
    • GetEfficiencyMultiplier(Single, Single)
    • GetObjectBuilder()
    • HasAnyEffect()
    • Increase(Single, Object)
    • Init(MyObjectBuilder_Base)
    • remove_OnStatChanged(MyEntityStat.StatChangedDelegate)
    • RemoveEffect(Int32)
    • ResetRegenAmountMultiplier()
    • ToString()
    • TryGetEffect(Int32, out MyEntityStatRegenEffect)
    • Update()
  • Events
    • OnStatChanged
Back to top
Generated by DocFX
☀
☾