DIFF

class StaminaHandlerSource

Constructors 2

void ~StaminaHandler()

Constants 4

protected const float STAMINA_GAIN_THRESHOLD = 25.0
protected const float STAMINA_GAIN_MODIFIER = 10.0
protected const float LOAD_DIFF_UPDATE_THRESHOLD = 1.0
Referenced by Update()
protected const float LOAD_DIFF_CAP_UPDATE_THRESHOLD = 0.01
Referenced by Update()

Members 38

protected bool m_InitUpdate
Referenced by StaminaHandler(), and Update()
protected float m_PlayerLoad
protected float m_StaminaSynced

guaranteed to be identical on server and client

protected float m_StaminaCapSynced

guaranteed to be identical on server and client

protected float m_StaminaDepletionMultiplierNext

value being sent via SJ

Referenced by StaminaHandler()
protected float m_StaminaRecoveryMultiplierNext

value being sent via SJ

Referenced by StaminaHandler()
protected float m_StaminaDepletion
protected float m_Time
protected ref Param3<float,float,bool> m_StaminaParams
Referenced by StaminaHandler()
protected SHumanCommandMoveSettings m_HumanMoveSettings
protected bool m_StaminaDepleted
ref map<EStaminaMultiplierTypes, float> m_RegisteredDepletionModifiers
ref map<EStaminaMultiplierTypes, float> m_RegisteredRecoveryModifiers
protected ref StaminaModifiers m_StaminaModifiers
protected float m_LastPlayerLoad = -1
Referenced by Update()
protected float m_CachedStaminaGainBonus
protected bool m_IsStaminaGainBonusCached
protected ref map<int, ref StaminaCooldownParams> m_CooldownMap
Referenced by ~StaminaHandler(), ResetCooldown(), SetCooldown()
Show 2 more, StaminaHandler(), and Update()
protected int m_LastCommandTypeId = -1
protected int m_LastMovementIdx = -1
protected int m_LastStanceIdx = -1
protected bool m_MovementStateChanged = true

Force initial processing

Referenced by Update()
protected bool m_ForceLoadRecheck
Referenced by MarkLoadDirty(), and Update()
protected bool m_StaminaDisabledDIAG_DEVELOPER
protected float m_DebugTimer = 0DIAG_DEVELOPER
protected int m_LastPoolInUse = 0DIAG_DEVELOPER
protected bool m_Debug

Methods 50

void OnSyncJuncture(int pJunctureID, ParamsReadContext pCtx)

called from PlayerBase - syncs stamina values on server with client AND sets the value to match on server and client both (m_StaminaSynced guarantees identical values)

protected void SyncStaminaEx()

stamina sync - server part

References SyncStamina(), m_IsInCooldown, m_Stamina
Show 1 more, m_StaminaCap
protected void SyncStamina(float stamina, float stamina_cap, bool cooldown)

stamina sync - server part

Referenced by SyncStaminaEx()
protected void SyncAdditionalStaminaInfo(Param par)

Method to sync more info for stamina manager. Template parameter means it is very extendable for further use

protected void ReadAdditionalStaminaInfo(ParamsReadContext pCtx)

Order of read parameters must match the order of writing above

Referenced by OnSyncJuncture()
protected float CalcStaminaGainBonus()

Calulates stamina regain bonus coef based on current stamina cap and level and caches it during one Update call

protected void CheckStaminaState()

check if the stamina is completely depleted

Referenced by Update()
protected void SetCooldown(float time, int modifier = -1)

set cooldown timer between each consume of stamina

float GetStaminaNormalized()
References GetStaminaMax(), and m_Stamina
float GetSyncedStamina()
References m_StaminaSynced
float GetStaminaCap()
References m_StaminaCap
float GetSyncedStaminaCap()
float GetDepletionMultiplier()
float GetRecoveryMultiplier()
void DepleteStaminaEx(EStaminaModifiers modifier, float dT = -1, float coef = 1.0)
void ObtainState(PlayerBaseOwnerState state)

run cooldown right after depletion

void ObtainMove(PlayerBaseMove move)
void MarkLoadDirty()
void SetStaminaDisabled(bool value)DIAG_DEVELOPER
void DepleteStamina(EStaminaModifiers modifier, float dT = -1)
void OnRPC(float stamina, float stamina_cap, bool cooldown)