DayZ 1.24
Loading...
Searching...
No Matches
ThirstMdfr Class Reference
Inheritance diagram for ThirstMdfr:
[legend]
Collaboration diagram for ThirstMdfr:
[legend]

Private Member Functions

override void Init ()
 
override bool ActivateCondition (PlayerBase player)
 
override void OnReconnect (PlayerBase player)
 
override bool DeactivateCondition (PlayerBase player)
 
override void OnTick (PlayerBase player, float deltaT)
 

Private Attributes

float m_LastWaterLevel
 
ref HumanMovementState m_MovementState = new HumanMovementState()
 

Detailed Description

Definition at line 1 of file Thirst.c.

Member Function Documentation

◆ ActivateCondition()

override bool ThirstMdfr::ActivateCondition ( PlayerBase player)
inlineprivate

Definition at line 15 of file Thirst.c.

16 {
17 return true;
18 }

◆ DeactivateCondition()

override bool ThirstMdfr::DeactivateCondition ( PlayerBase player)
inlineprivate

Definition at line 25 of file Thirst.c.

26 {
27 return false;
28 }

◆ Init()

override void ThirstMdfr::Init ( )
inlineprivate

Definition at line 6 of file Thirst.c.

7 {
9 m_ID = eModifiers.MDF_THIRST;
13 }
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
bool m_TrackActivatedTime
void DisableDeactivateCheck()
float m_TickIntervalActive
float m_TickIntervalInactive
const int DEFAULT_TICK_TIME_INACTIVE
eModifiers
Definition eModifiers.c:2

References DEFAULT_TICK_TIME_INACTIVE, DisableDeactivateCheck(), m_ID, m_TickIntervalActive, m_TickIntervalInactive, and m_TrackActivatedTime.

◆ OnReconnect()

override void ThirstMdfr::OnReconnect ( PlayerBase player)
inlineprivate

Definition at line 20 of file Thirst.c.

21 {
22
23 }

◆ OnTick()

override void ThirstMdfr::OnTick ( PlayerBase player,
float deltaT )
inlineprivate

Definition at line 30 of file Thirst.c.

31 {
32 player.GetMovementState(m_MovementState);
33 float water = player.GetStatWater().Get();
34 float metabolic_speed = MiscGameplayFunctions.GetWaterMetabolicSpeed(m_MovementState.m_iMovement);
35
37 metabolic_speed *= modifier; //non linear shaping for consumption curve (comment out to have it linear)
38
39 player.GetStatWater().Add((-metabolic_speed * deltaT));
40
42 {
43 player.SetMixedSoundState(eMixedSoundStates.THIRSTY);
44 if ((player.GetStomach().GetDigestingType() & PlayerStomach.DIGESTING_WATER) == 0)
45 player.AddHealth("GlobalHealth", "Health", -PlayerConstants.LOW_WATER_DAMAGE_PER_SEC * deltaT);
46 }
47 else
48 player.UnsetMixedSoundState(eMixedSoundStates.THIRSTY);
49 }
eMixedSoundStates
bits
void PlayerStomach(PlayerBase player)
static const float CONSUMPTION_MULTIPLIER_BASE
static const float LOW_WATER_DAMAGE_PER_SEC
static const float LOW_WATER_THRESHOLD
static const float SL_WATER_MAX
ref HumanMovementState m_MovementState
Definition Thirst.c:4

References PlayerConstants::CONSUMPTION_MULTIPLIER_BASE, PlayerConstants::LOW_WATER_DAMAGE_PER_SEC, PlayerConstants::LOW_WATER_THRESHOLD, m_MovementState, PlayerStomach(), and PlayerConstants::SL_WATER_MAX.

Member Data Documentation

◆ m_LastWaterLevel

float ThirstMdfr::m_LastWaterLevel
private

Definition at line 3 of file Thirst.c.

◆ m_MovementState

ref HumanMovementState ThirstMdfr::m_MovementState = new HumanMovementState()
private

Definition at line 4 of file Thirst.c.

Referenced by OnTick().


The documentation for this class was generated from the following file: