349 Error(
"attempting to activate unregistered depletion modifier");
381 Error(
"attempting to activate unregistered recovery modifier");
430 switch (
m_State.m_CommandTypeId)
638 pCtx.Write(
p.param1);
639 pCtx.Write(
p.param2);
769 ad.SetExhaustion(0,
true);
920 switch (
sm.GetType())
939 sm.SetRunTimeTick(
dT);
952 ErrorEx(
"StaminaModifierExponential not found for modifier type: " +
sm.GetType());
eBleedingSourceType m_Type
eBleedingSourceType GetType()
void StaminaConsumer(float threshold, float threshold2, bool state)
void SetMaxValue(float val)
void StaminaModifier(int type, float min, float max, float cooldown, float startTime=0, float duration=0)
void RegisterLinear(EStaminaModifiers modifier, float startValue, float endValue, float startTime, float duration, float cooldown=GameConstants.STAMINA_REGEN_COOLDOWN_DEPLETION)
register lerped modifier - depletes stamina for startValue, and, after a startTime,...
void SetActivationThreshold(float threshold)
void SetStartTime(float val)
StaminaModifierExponential FIXED
void SetDrainThreshold(float threshold)
float m_StartTimeAdjustment
void SetState(bool state)
ref map< EStaminaModifiers, ref StaminaModifier > m_StaminaModifiers
void RegisterExponentialEx(EStaminaModifiers modifier, SMDataExponential data)
register exponential modifier, extended parameters
float GetStartTimeAdjustment()
float GetDrainThreshold()
float GetActivationThreshold()
void SetRunTimeTick(float val)
void SetMinValue(float val)
void RegisterExponential(EStaminaModifiers modifier, float startValue, float exponent, float startTime, float duration, float cooldown=GameConstants.STAMINA_REGEN_COOLDOWN_DEPLETION)
register exponential modifier - depletes stamina for startValue, and, after a startTime,...
void RegisterFixed(EStaminaModifiers modifier, float value, float cooldown=GameConstants.STAMINA_REGEN_COOLDOWN_DEPLETION)
register single value modifier - depletes stamina for that value
void SetCooldown(float val)
StaminaModifier GetModifierData(EStaminaModifiers modifier)
float GetDurationAdjusted()
void AddRunTime(float val)
void RegisterRandomized(EStaminaModifiers modifier, float minValue, float maxValue, float cooldown=GameConstants.STAMINA_REGEN_COOLDOWN_DEPLETION)
register randomized modifier - stamina will be depleted by value between min and max value;
static float GetSprintLadderStaminaModifier()
static float GetStaminaKgToStaminaPercentPenalty()
static float GetStaminaMinCap()
static float GetSprintStaminaModifierCro()
static float GetSprintStaminaModifierErc()
static float GetObstacleTraversalStaminaModifier()
static float GetStaminaMax()
static float GetMeleeStaminaModifier()
static float GetSprintSwimmingStaminaModifier()
static float GetStaminaWeightLimitThreshold()
Super root of all classes in Enforce script.
static const int SJ_STAMINA
static const int SJ_STAMINA_MISC
static const float STAMINA_RECOVERY_MULTIPLIER
const float STAMINA_DEPLETION_MULTIPLIER
static const float STAMINA_DEPLETION_MULTIPLIER
static const float STAMINA_RECOVERY_MULTIPLIER
const float STAMINA_RECOVERY_MODIFIER
const float STAMINA_DEPLETION_MODIFIER
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Serialization general interface. Serializer API works with:
void RegisterConsumer(EStaminaConsumers consumer, float threshold, float depletion_threshold=-1)
ref map< EStaminaConsumers, ref StaminaConsumer > m_StaminaConsumers
bool HasEnoughStaminaToStart(EStaminaConsumers consumer, float curStamina, bool isDepleted, float cap)
bool HasEnoughStaminaFor(EStaminaConsumers consumer, float curStamina, bool isDepleted, float cap)
float m_StaminaDepletionMultiplier
Timer GetCooldownTimer(int modifier)
void StaminaProcessor_Ladder(HumanMovementState pHumanMovementState)
void RegisterStaminaModifiers()
ref HumanMovementState m_State
void StaminaProcessor_Swimming(HumanMovementState pHumanMovementState)
float GetDepletionMultiplier()
void RecalculateRecoveryMultiplier()
void DepleteStamina(EStaminaModifiers modifier, float dT=-1)
void SetDepletionMultiplier(float val)
void SetRecoveryMultiplier(float val)
float m_StaminaRecoveryMultiplier
ref set< EStaminaMultiplierTypes > m_ActiveDepletionModifiers
void SyncAdditionalStaminaInfo(Param par)
Method to sync more info for stamina manager. Template parameter means it is very extendable for furt...
ref StaminaModifiers m_StaminaModifiers
void OnSyncJuncture(int pJunctureID, ParamsReadContext pCtx)
called from PlayerBase - syncs stamina values on server with client AND sets the value to match on se...
void CheckStaminaState()
check if the stamina is completely depleted
void DeactivateRecoveryModifier(EStaminaMultiplierTypes type)
void RegisterStaminaConsumers()
bool HasEnoughStaminaFor(EStaminaConsumers consumer)
void StaminaHandler(PlayerBase player)
ref map< int, ref Timer > m_TimerMap
ref Param3< float, float, bool > m_StaminaParams
float GetRecoveryMultiplier()
void OnRPC(float stamina, float stamina_cap, bool cooldown)
deprecated use, StaminaHandler uses SyncJunctures now
float CalcStaminaGainBonus()
Calulates stamina regain bonus coef based on current stamina cap and level.
ref set< EStaminaMultiplierTypes > m_ActiveRecoveryModifiers
void RecalculateDepletionMultiplier()
void StaminaProcessor_Move(HumanMovementState pHumanMovementState)
float GetStaminaNormalized()
float GetSyncedStaminaNormalized()
void DeactivateDepletionModifier(EStaminaMultiplierTypes type)
bool m_StaminaDepleted
DEPRECATED.
bool HasEnoughStaminaToStart(EStaminaConsumers consumer)
void SetCooldown(float time, int modifier=-1)
set cooldown timer between each consume of stamina
void SetStamina(float stamina_value)
void ReadAdditionalStaminaInfo(ParamsReadContext pCtx)
Order of read parameters must match the order of writing above.
ref StaminaConsumers m_StaminaConsumers
void ActivateDepletionModifier(EStaminaMultiplierTypes type)
SHumanCommandMoveSettings m_HumanMoveSettings
void ResetCooldown(int modifier=-1)
void SyncStamina(float stamina, float stamina_cap, bool cooldown)
stamina sync - server part
ref map< EStaminaMultiplierTypes, float > m_RegisteredRecoveryModifiers
void ActivateRecoveryModifier(EStaminaMultiplierTypes type)
ref map< EStaminaMultiplierTypes, float > m_RegisteredDepletionModifiers
void Update(float deltaT, int pCurrentCommandID)
override float GetStartTimeAdjustment()
override float GetCooldown()
override float GetDuration()
void SetData(SMDataExponential data)
override float GetDurationAdjusted()
ref SMDataExponential m_SMDataEx
DayZPlayerInstanceType
defined in C++
DayZPlayerConstants
defined in C++
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Min(float x, float y)
Returns smaller of two given values.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float Pow(float v, float power)
Return power of v ^ power.
static proto float AbsFloat(float f)
Returns absolute value.
const float STAMINA_DRAIN_CLIMB
const float STAMINA_HOLD_BREATH_THRESHOLD_DRAIN
const float STAMINA_DRAIN_MELEE_LIGHT
const float STAMINA_KG_TO_GRAMS
in grams (weight where the player is not penalized by stamina)
const float STAMINA_ROLL_THRESHOLD
const float STAMINA_CLIMB_THRESHOLD
const float STAMINA_DRAIN_MELEE_HEAVY
const int STAMINA_GAIN_IDLE_PER_SEC
const float STAMINA_GAIN_BONUS_CAP
const float STAMINA_JUMP_THRESHOLD
const float STAMINA_REGEN_COOLDOWN_EXHAUSTION
const int STAMINA_DRAIN_SWIM_FAST_PER_SEC
const int STAMINA_GAIN_WALK_PER_SEC
const int STAMINA_GAIN_JOG_PER_SEC
const float STAMINA_VAULT_THRESHOLD
const float STAMINA_MELEE_EVADE_THRESHOLD
const float STAMINA_HOLD_BREATH_THRESHOLD_ACTIVATE
const float STAMINA_MELEE_HEAVY_THRESHOLD
const int STAMINA_GAIN_ROLL_PER_SEC
const float STAMINA_DRAIN_JUMP
const float STAMINA_DRAIN_ROLL
const float STAMINA_DRAIN_MELEE_EVADE
const float STAMINA_REGEN_COOLDOWN_DEPLETION
const int STAMINA_DRAIN_STANDING_SPRINT_PER_SEC
const int STAMINA_DRAIN_CROUCHED_SPRINT_PER_SEC
const int STAMINA_DRAIN_LADDER_FAST_PER_SEC
const float STAMINA_DRAIN_VAULT
const int STAMINA_GAIN_SWIM_PER_SEC
const int STAMINA_GAIN_LADDER_PER_SEC
const float STAMINA_SYNC_RATE
proto native int GetState()
returns one of STATE_...
class HumanCommandWeapons HumanCommandAdditives()
class SHumanGlobalSettings SHumanCommandMoveSettings()