Dayz Explorer 1.28.160049
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 {
34 symptom.SetDuration(Math.RandomIntInclusive(4,8));
35 }
36 }
37 }
38
39 override void OnReconnect(PlayerBase player)
40 {
41
42 }
43
44 override void OnActivate(PlayerBase player)
45 {
46
47 }
48};
Definition enmath.c:7
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition effect.c:51
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
enum eModifierSyncIDs DEFAULT_TICK_TIME_ACTIVE
void OnActivate()