Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
charcoalmdfr.c
Go to the documentation of this file.
2{
3 float m_Killrate;
4 const int CHARCOAL_LIFETIME = 300;
5 const int CHARCOAL_EFFECT_TIME = 100;
6
7 override void Init()
8 {
11 m_IsPersistent = true;
12 m_ID = eModifiers.MDF_CHARCOAL;
15 m_Killrate = 2.85; // # of killed agents per sec
17 }
18
19 override bool ActivateCondition(PlayerBase player)
20 {
21 return false;
22 }
23
24 override void OnReconnect(PlayerBase player)
25 {
26 OnActivate( player );
27 }
28
29 /*
30 override string GetDebugText()
31 {
32
33 string text;
34 float time_till_effective = CHARCOAL_LIFETIME - CHARCOAL_EFFECT_TIME - GetAttachedTime();
35
36 text = "time till effective: " + time_till_effective.ToString() + "\n";
37
38 if(time_till_effective > 0)
39 text += "killing agents:" + "NO";
40 else
41 text += "killing agents:" + "YES";
42
43
44 return text;
45
46 }
47 */
48
49
50 override string GetDebugTextSimple()
51 {
52 return ( (int)(CHARCOAL_LIFETIME - GetAttachedTime()) ).ToString() + " | " + (((int)(CHARCOAL_LIFETIME - CHARCOAL_EFFECT_TIME - GetAttachedTime())) * -1).ToString();
53 }
54
55 override void OnActivate(PlayerBase player)
56 {
57 player.IncreaseHealingsCount();
58
59 }
60
61 override void OnDeactivate(PlayerBase player)
62 {
63 player.DecreaseHealingsCount();
64
65 }
66
67 override bool DeactivateCondition(PlayerBase player)
68 {
69 float attached_time = GetAttachedTime();
70
71 if ( attached_time >= CHARCOAL_LIFETIME )
72 {
73 return true;
74 }
75 else
76 {
77 return false;
78 }
79 }
80
81 override void OnTick(PlayerBase player, float deltaT)
82 {
83 if ( GetAttachedTime() > ( CHARCOAL_LIFETIME - CHARCOAL_EFFECT_TIME ) )
84 {
85 player.m_AgentPool.AddAgent(eAgents.SALMONELLA, -m_Killrate * deltaT);
86 }
87 }
88};
Param3 int
eAgents
Definition eagents.c:3
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
proto string ToString()
bool m_TrackActivatedTime
overall time this modifier was active
float GetAttachedTime()
void DisableActivateCheck()
bool m_AnalyticsStatsEnabled
float m_TickIntervalActive
float m_TickIntervalInactive
bool m_IsPersistent
should this modifier track overall time it was active ?
const int DEFAULT_TICK_TIME_INACTIVE
void OnActivate()