DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
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
6 override void Init()
7 {
9 m_ID = eModifiers.MDF_TOXICITY;
13 }
14
15 override bool ActivateCondition(PlayerBase player)
16 {
17 return true;
18 }
19
20 override bool DeactivateCondition(PlayerBase player)
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 {
35 }
36 }
37 }
38
39 override void OnReconnect(PlayerBase player)
40 {
41
42 }
43
44 override void OnActivate(PlayerBase player)
45 {
46
47 }
48};
protected 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
void SetDuration(float duration)
Definition StateBase.c:80
override bool DeactivateCondition(PlayerBase player)
Definition Toxicity.c:20
override void OnReconnect(PlayerBase player)
Definition Toxicity.c:39
override void OnActivate(PlayerBase player)
Definition Toxicity.c:44
private const float TOXICITY_CLEANUP_PER_SEC
Definition Toxicity.c:3
override void OnTick(PlayerBase player, float deltaT)
Definition Toxicity.c:25
override void Init()
Definition Toxicity.c:6
override bool ActivateCondition(PlayerBase player)
Definition Toxicity.c:15
private const float VOMIT_THRESHOLD
Definition Toxicity.c:4
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:53