DayZ 1.24
Loading...
Searching...
No Matches
Toxicity.c
Go to the documentation of this file.
2{
3 private const float TOXICITY_CLEANUP_PER_SEC = 1;
4 private const float VOMIT_THRESHOLD = 70;
5
14
16 {
17 return true;
18 }
19
21 {
22 return false;
23 }
24
25 override void OnTick(PlayerBase player, float deltaT)
26 {
27 player.GetStatToxicity().Add(-TOXICITY_CLEANUP_PER_SEC * deltaT);
28 if (player.GetStatToxicity().Get() > VOMIT_THRESHOLD)
29 {
30 SymptomBase symptom = player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_VOMIT);
31
32 if (symptom)
33 symptom.SetDuration(Math.RandomIntInclusive(4, 8));
34 }
35 }
36
38 {
39
40 }
41
43 {
44
45 }
46};
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
const int DEFAULT_TICK_TIME_ACTIVE
Definition EnMath.c:7
override void Init()
Definition Toxicity.c:6
override void OnActivate(PlayerBase player)
Definition Toxicity.c:42
const float TOXICITY_CLEANUP_PER_SEC
Definition Toxicity.c:3
const float VOMIT_THRESHOLD
Definition Toxicity.c:4
override void OnTick(PlayerBase player, float deltaT)
Definition Toxicity.c:25
override bool ActivateCondition(PlayerBase player)
Definition Toxicity.c:15
override void OnReconnect(PlayerBase player)
Definition Toxicity.c:37
override bool DeactivateCondition(PlayerBase player)
Definition Toxicity.c:20
eModifiers
Definition eModifiers.c:2
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54