Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
thirst.c
Go to the documentation of this file.
2{
5
14
15 override bool ActivateCondition(PlayerBase player)
16 {
17 return true;
18 }
19
20 override void OnReconnect(PlayerBase player)
21 {
22
23 }
24
25 override bool DeactivateCondition(PlayerBase player)
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 {
49 player.UnsetMixedSoundState( eMixedSoundStates.THIRSTY );
50 }
51 }
52};
static const float SL_WATER_MAX
static const float CONSUMPTION_MULTIPLIER_BASE
static const float LOW_WATER_THRESHOLD
Percents of agents count <-1.0; 1.0>.
static const float LOW_WATER_DAMAGE_PER_SEC
override bool DeactivateCondition(PlayerBase player)
Definition thirst.c:25
override void OnReconnect(PlayerBase player)
Definition thirst.c:20
override void OnTick(PlayerBase player, float deltaT)
Definition thirst.c:30
override void Init()
Definition thirst.c:6
override bool ActivateCondition(PlayerBase player)
Definition thirst.c:15
ref HumanMovementState m_MovementState
Definition thirst.c:4
float m_LastWaterLevel
Definition thirst.c:3
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it).
Definition effect.c:51
eMixedSoundStates
bits
eModifiers
Definition emodifiers.c:2
bool m_TrackActivatedTime
overall time this modifier was active
void DisableDeactivateCheck()
float m_TickIntervalActive
float m_TickIntervalInactive
const int DEFAULT_TICK_TIME_INACTIVE
void PlayerStomach(PlayerBase player)