PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
StaminaHandler.c File Reference

Data Structures

class  StaminaConsumers
 
class  StaminaModifierExponential
 
class  StaminaHandler
 

Enumerations

enum  EStaminaMultiplierTypes
 

Functions

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

Variables

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

Enumeration Type Documentation

◆ EStaminaMultiplierTypes

Function Documentation

◆ AddRunTime()

void AddRunTime ( float  val)

References m_ProgressTime.

◆ GetActivationThreshold()

float GetActivationThreshold ( )

References m_ActivationThreshold.

◆ GetCooldown()

float GetCooldown ( )

References m_Cooldown.

◆ GetDrainThreshold()

float GetDrainThreshold ( )

◆ GetDuration()

float GetDuration ( )

References m_Duration.

◆ GetDurationAdjusted()

float GetDurationAdjusted ( )

References m_Duration, and m_Tick.

◆ GetMaxValue()

float GetMaxValue ( )

References m_MaxValue.

◆ GetMinValue()

float GetMinValue ( )

References m_MinValue.

◆ GetModifierData()

StaminaModifier GetModifierData ( EStaminaModifiers  modifier)

◆ GetRunTime()

float GetRunTime ( )

References m_ProgressTime.

◆ GetStartTime()

float GetStartTime ( )

References m_StartTime.

◆ GetStartTimeAdjustment()

float GetStartTimeAdjustment ( )

References m_StartTimeAdjustment.

◆ GetState()

bool GetState ( )

returns one of STATE_...

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

◆ GetType()

int GetType ( )

References m_Type.

◆ HasEnoughStaminaFor()

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

◆ HasEnoughStaminaToStart()

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

◆ IsInUse()

bool IsInUse ( )

References m_InUse.

◆ RegisterConsumer()

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

init of StaminaConsumer - threshold, state

◆ RegisterExponential()

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

References EXPONENTIAL, m_StaminaModifiers, and StaminaModifier().

◆ RegisterExponentialEx()

void RegisterExponentialEx ( EStaminaModifiers  modifier,
SMDataExponential  data 
)

register exponential modifier, extended parameters

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

◆ RegisterFixed()

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

register single value modifier - depletes stamina for that value

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

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 
)

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

References LINEAR, m_StaminaModifiers, and StaminaModifier().

◆ RegisterRandomized()

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;

init of StaminaModifier - type, min, max values

References m_StaminaModifiers, RANDOMIZED, and StaminaModifier().

◆ ResetRunTime()

void ResetRunTime ( )

References m_ProgressTime.

◆ SetActivationThreshold()

void SetActivationThreshold ( float  threshold)

References m_ActivationThreshold.

◆ SetCooldown()

void SetCooldown ( float  val)

References m_Cooldown.

Referenced by HandleFightLogic().

◆ SetDrainThreshold()

void SetDrainThreshold ( float  threshold)

◆ SetInUse()

void SetInUse ( bool  val)

References m_InUse.

◆ SetMaxValue()

void SetMaxValue ( float  val)

References m_MaxValue.

◆ SetMinValue()

void SetMinValue ( float  val)

References m_MinValue.

◆ SetRunTimeTick()

void SetRunTimeTick ( float  val)

References m_Tick.

◆ SetStartTime()

void SetStartTime ( float  val)

References m_StartTime.

◆ SetState()

◆ StaminaConsumer()

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

◆ StaminaConsumers()

void StaminaConsumers ( )

◆ StaminaModifier()

◆ StaminaModifiers()

void StaminaModifiers ( )

Variable Documentation

◆ DISEASE_PNEUMONIA

DISEASE_PNEUMONIA

◆ DROWNING

@ DROWNING

◆ EPINEPHRINE

EPINEPHRINE

◆ EXPONENTIAL

const int EXPONENTIAL = 3

◆ FATIGUE

FATIGUE

◆ FIXED

Referenced by RegisterFixed().

◆ LINEAR

const int LINEAR = 2

Referenced by RegisterLinear().

◆ m_ActivationThreshold

m_ActivationThreshold

◆ m_Cooldown

float m_Cooldown

◆ m_Duration

float m_Duration

◆ m_InUse

m_InUse = false

Referenced by IsInUse(), and SetInUse().

◆ m_MaxValue

float m_MaxValue

◆ m_MinValue

float m_MinValue

◆ m_Multiplier

float m_Multiplier

Referenced by Init().

◆ m_ProgressTime

float m_ProgressTime

◆ m_StaminaConsumers

protected ref map<EStaminaConsumers, ref StaminaConsumer> m_StaminaConsumers

◆ m_StaminaModifiers

◆ m_StartTime

float m_StartTime

Referenced by GetStartTime(), and SetStartTime().

◆ m_StartTimeAdjustment

float m_StartTimeAdjustment

◆ m_State

protected float m_DrainThreshold protected bool m_State

◆ m_Tick

◆ m_Type

int m_Type

◆ MASK

MASK = 1

◆ RANDOMIZED

const int RANDOMIZED = 1

Referenced by RegisterRandomized().

◆ VOMIT_EXHAUSTION

VOMIT_EXHAUSTION