DayZ 1.24
Loading...
Searching...
No Matches
Thirst.c
Go to the documentation of this file.
2{
5
14
16 {
17 return true;
18 }
19
21 {
22
23 }
24
26 {
27 return false;
28 }
29
30 override void OnTick(PlayerBase player, float deltaT)
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 }
50};
eMixedSoundStates
bits
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
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
override void OnTick(PlayerBase player, float deltaT)
Definition Thirst.c:30
override bool DeactivateCondition(PlayerBase player)
Definition Thirst.c:25
override void Init()
Definition Thirst.c:6
override void OnReconnect(PlayerBase player)
Definition Thirst.c:20
float m_LastWaterLevel
Definition Thirst.c:3
override bool ActivateCondition(PlayerBase player)
Definition Thirst.c:15
eModifiers
Definition eModifiers.c:2