Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
staminahandler.c File Reference

Go to the source code of this file.

Data Structures

class  StaminaConsumers
class  StaminaHandler
class  StaminaModifierExponential

Typedefs

typedef Param1< floatStaminaCooldownParams

Enumerations

enum  EStaminaMultiplierTypes

Functions

void AddRunTime (float val)
float GetActivationThreshold ()
float GetCooldown ()
float GetDrainThreshold ()
float GetDuration ()
float GetDurationAdjusted ()
float GetMaxValue ()
float GetMinValue ()
StaminaModifier GetModifierData (EStaminaModifiers modifier)
float GetRunTime ()
float GetStartTime ()
float GetStartTimeAdjustment ()
bool GetState ()
 returns one of STATE_...
int GetType ()
bool HasEnoughStaminaFor (EStaminaConsumers consumer, float curStamina, bool isDepleted, float cap)
bool HasEnoughStaminaToStart (EStaminaConsumers consumer, float curStamina, bool isDepleted, float cap)
bool IsInUse ()
void RegisterConsumer (EStaminaConsumers consumer, float threshold, float depletion_threshold=-1)
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, lerps from 0 to exponent over duration
void RegisterExponentialEx (EStaminaModifiers modifier, SMDataExponential data)
 register exponential modifier, extended parameters
void RegisterFixed (EStaminaModifiers modifier, float value, float cooldown=GameConstants.STAMINA_REGEN_COOLDOWN_DEPLETION)
 register single value modifier - depletes stamina for that value
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, lerps to endValue over duration
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;
void ResetRunTime ()
void SetActivationThreshold (float threshold)
void SetCooldown (float val)
void SetDrainThreshold (float threshold)
void SetInUse (bool val)
void SetMaxValue (float val)
void SetMinValue (float val)
void SetRunTimeTick (float val)
void SetStartTime (float val)
void SetState (bool state)
void StaminaConsumer (float threshold, float threshold2, bool state)
void StaminaConsumers ()
void StaminaModifier (int type, float min, float max, float cooldown, float startTime=0, float duration=0)
void StaminaModifiers ()

Variables

 DISEASE_PNEUMONIA
 DROWNING
 EPINEPHRINE
const int EXPONENTIAL = 3
 FATIGUE
StaminaModifierExponential FIXED = 0
const int LINEAR = 2
 m_ActivationThreshold
float m_Cooldown
float m_Duration
 m_InUse = false
float m_MaxValue
float m_MinValue
float m_Multiplier
float m_ProgressTime
ref map< EStaminaConsumers, ref StaminaConsumerm_StaminaConsumers
ref map< EStaminaModifiers, ref StaminaModifierm_StaminaModifiers
float m_StartTime
float m_StartTimeAdjustment
bool m_State
float m_Tick
int m_Type
 MASK = 1
const int RANDOMIZED = 1
 VOMIT_EXHAUSTION

Typedef Documentation

◆ StaminaCooldownParams

typedef Param1<float> StaminaCooldownParams
protected

Definition at line 259 of file staminahandler.c.

Enumeration Type Documentation

◆ EStaminaMultiplierTypes

Definition at line 1 of file staminahandler.c.

Function Documentation

◆ AddRunTime()

void AddRunTime ( float val)
protected

Definition at line 175 of file staminahandler.c.

References m_ProgressTime.

◆ GetActivationThreshold()

float GetActivationThreshold ( )
protected

Definition at line 34 of file staminahandler.c.

References m_ActivationThreshold.

◆ GetCooldown()

float GetCooldown ( )
protected

Definition at line 160 of file staminahandler.c.

References m_Cooldown.

◆ GetDrainThreshold()

float GetDrainThreshold ( )
protected

Definition at line 37 of file staminahandler.c.

◆ GetDuration()

float GetDuration ( )
protected

Definition at line 168 of file staminahandler.c.

References m_Duration.

◆ GetDurationAdjusted()

float GetDurationAdjusted ( )
protected

Definition at line 169 of file staminahandler.c.

References m_Duration, and m_Tick.

◆ GetMaxValue()

float GetMaxValue ( )
protected

Definition at line 157 of file staminahandler.c.

References m_MaxValue.

◆ GetMinValue()

float GetMinValue ( )
protected

Definition at line 154 of file staminahandler.c.

References m_MinValue.

◆ GetModifierData()

StaminaModifier GetModifierData ( EStaminaModifiers modifier)
protected

Definition at line 253 of file staminahandler.c.

References m_StaminaModifiers, and StaminaModifier().

◆ GetRunTime()

float GetRunTime ( )
protected

Definition at line 174 of file staminahandler.c.

References m_ProgressTime.

◆ GetStartTime()

float GetStartTime ( )
protected

Definition at line 163 of file staminahandler.c.

References m_StartTime.

◆ GetStartTimeAdjustment()

float GetStartTimeAdjustment ( )
protected

Definition at line 166 of file staminahandler.c.

References m_StartTimeAdjustment.

◆ GetState()

bool GetState ( )
protected

returns one of STATE_...

returns the state of climb (enum value of ClimbStates);

Definition at line 31 of file staminahandler.c.

◆ GetType()

int GetType ( )
protected

Definition at line 152 of file staminahandler.c.

References m_Type.

◆ HasEnoughStaminaFor()

bool HasEnoughStaminaFor ( EStaminaConsumers consumer,
float curStamina,
bool isDepleted,
float cap )
protected

Definition at line 65 of file staminahandler.c.

◆ HasEnoughStaminaToStart()

bool HasEnoughStaminaToStart ( EStaminaConsumers consumer,
float curStamina,
bool isDepleted,
float cap )
protected

Definition at line 105 of file staminahandler.c.

◆ IsInUse()

bool IsInUse ( )
protected

Definition at line 171 of file staminahandler.c.

References m_InUse.

◆ RegisterConsumer()

void RegisterConsumer ( EStaminaConsumers consumer,
float threshold,
float depletion_threshold = -1 )
protected

init of StaminaConsumer - threshold, state

Definition at line 50 of file staminahandler.c.

◆ RegisterExponential()

void RegisterExponential ( EStaminaModifiers modifier,
float startValue,
float exponent,
float startTime,
float duration,
float cooldown = GameConstants.STAMINA_REGEN_COOLDOWN_DEPLETION )
protected

register exponential modifier - depletes stamina for startValue, and, after a startTime, lerps from 0 to exponent over duration

Definition at line 239 of file staminahandler.c.

References EXPONENTIAL, m_StaminaModifiers, and StaminaModifier().

◆ RegisterExponentialEx()

void RegisterExponentialEx ( EStaminaModifiers modifier,
SMDataExponential data )
protected

register exponential modifier, extended parameters

Definition at line 246 of file staminahandler.c.

References EXPONENTIAL, m_StaminaModifiers, and StaminaModifierExponential::SetData().

◆ RegisterFixed()

void RegisterFixed ( EStaminaModifiers modifier,
float value,
float cooldown = GameConstants.STAMINA_REGEN_COOLDOWN_DEPLETION )
protected

register single value modifier - depletes stamina for that value

init of StaminaModifier - type and min, max values (min is not relevant for that type)

Definition at line 210 of file staminahandler.c.

References FIXED, m_StaminaModifiers, and StaminaModifier().

◆ RegisterLinear()

void RegisterLinear ( EStaminaModifiers modifier,
float startValue,
float endValue,
float startTime,
float duration,
float cooldown = GameConstants.STAMINA_REGEN_COOLDOWN_DEPLETION )
protected

register lerped modifier - depletes stamina for startValue, and, after a startTime, lerps to endValue over duration

Definition at line 232 of file staminahandler.c.

References LINEAR, m_StaminaModifiers, and StaminaModifier().

◆ RegisterRandomized()

void RegisterRandomized ( EStaminaModifiers modifier,
float minValue,
float maxValue,
float cooldown = GameConstants.STAMINA_REGEN_COOLDOWN_DEPLETION )
protected

register randomized modifier - stamina will be depleted by value between min and max value;

init of StaminaModifier - type, min, max values

Definition at line 221 of file staminahandler.c.

References m_StaminaModifiers, RANDOMIZED, and StaminaModifier().

◆ ResetRunTime()

void ResetRunTime ( )
protected

Definition at line 177 of file staminahandler.c.

References m_ProgressTime.

◆ SetActivationThreshold()

void SetActivationThreshold ( float threshold)
protected

Definition at line 35 of file staminahandler.c.

References m_ActivationThreshold.

◆ SetCooldown()

void SetCooldown ( float val)
protected

Definition at line 161 of file staminahandler.c.

References m_Cooldown.

Referenced by HandleFightLogic().

◆ SetDrainThreshold()

void SetDrainThreshold ( float threshold)
protected

Definition at line 38 of file staminahandler.c.

◆ SetInUse()

void SetInUse ( bool val)
protected

Definition at line 172 of file staminahandler.c.

References m_InUse.

◆ SetMaxValue()

void SetMaxValue ( float val)
protected

Definition at line 158 of file staminahandler.c.

References m_MaxValue.

◆ SetMinValue()

void SetMinValue ( float val)
protected

Definition at line 155 of file staminahandler.c.

References m_MinValue.

◆ SetRunTimeTick()

void SetRunTimeTick ( float val)
protected

Definition at line 176 of file staminahandler.c.

References m_Tick.

◆ SetStartTime()

void SetStartTime ( float val)
protected

Definition at line 164 of file staminahandler.c.

References m_StartTime.

◆ SetState()

◆ StaminaConsumer()

void StaminaConsumer ( float threshold,
float threshold2,
bool state )
protected

◆ StaminaConsumers()

void StaminaConsumers ( )
protected

Definition at line 45 of file staminahandler.c.

Referenced by StaminaHandler::RegisterStaminaConsumers().

◆ StaminaModifier()

void StaminaModifier ( int type,
float min,
float max,
float cooldown,
float startTime = 0,
float duration = 0 )
protected

◆ StaminaModifiers()

void StaminaModifiers ( )
protected

Definition at line 204 of file staminahandler.c.

References m_StaminaModifiers.

Referenced by StaminaHandler::RegisterStaminaModifiers().

Variable Documentation

◆ DISEASE_PNEUMONIA

DISEASE_PNEUMONIA

Definition at line 8 of file staminahandler.c.

◆ DROWNING

@ DROWNING

Definition at line 6 of file staminahandler.c.

◆ EPINEPHRINE

EPINEPHRINE

Definition at line 5 of file staminahandler.c.

◆ EXPONENTIAL

const int EXPONENTIAL = 3
protected

Definition at line 200 of file staminahandler.c.

Referenced by RegisterExponential(), and RegisterExponentialEx().

◆ FATIGUE

FATIGUE

Definition at line 4 of file staminahandler.c.

◆ FIXED

StaminaModifierExponential FIXED = 0
protected

Referenced by RegisterFixed().

◆ LINEAR

const int LINEAR = 2
protected

Definition at line 199 of file staminahandler.c.

Referenced by RegisterLinear().

◆ m_ActivationThreshold

m_ActivationThreshold

◆ m_Cooldown

float m_Cooldown
protected

Definition at line 139 of file staminahandler.c.

Referenced by GetCooldown(), Init(), SetCooldown(), and StaminaModifier().

◆ m_Duration

float m_Duration
protected

Definition at line 139 of file staminahandler.c.

◆ m_InUse

m_InUse = false
protected

Referenced by IsInUse(), and SetInUse().

◆ m_MaxValue

float m_MaxValue
protected

Definition at line 139 of file staminahandler.c.

◆ m_MinValue

float m_MinValue
protected

Definition at line 139 of file staminahandler.c.

◆ m_Multiplier

float m_Multiplier
protected

Definition at line 139 of file staminahandler.c.

Referenced by Init().

◆ m_ProgressTime

float m_ProgressTime
protected

Definition at line 139 of file staminahandler.c.

Referenced by AddRunTime(), GetRunTime(), and ResetRunTime().

◆ m_StaminaConsumers

ref map<EStaminaConsumers, ref StaminaConsumer> m_StaminaConsumers
protected

Definition at line 43 of file staminahandler.c.

◆ m_StaminaModifiers

◆ m_StartTime

float m_StartTime
protected

Definition at line 139 of file staminahandler.c.

Referenced by GetStartTime(), and SetStartTime().

◆ m_StartTimeAdjustment

float m_StartTimeAdjustment
protected

Definition at line 139 of file staminahandler.c.

Referenced by GetStartTimeAdjustment(), Init(), and StaminaModifier().

◆ m_State

bool m_State
protected

Definition at line 22 of file staminahandler.c.

◆ m_Tick

◆ m_Type

int m_Type
protected

Definition at line 138 of file staminahandler.c.

◆ MASK

MASK = 1

Definition at line 3 of file staminahandler.c.

◆ RANDOMIZED

const int RANDOMIZED = 1
protected

Definition at line 198 of file staminahandler.c.

Referenced by RegisterRandomized().

◆ VOMIT_EXHAUSTION

VOMIT_EXHAUSTION

Definition at line 7 of file staminahandler.c.