Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
antibiotics.c
Go to the documentation of this file.
2{
3 const int ANTIBIOTICS_LIFETIME = 300;
4 const float ANTIBIOTICS_STRENGTH = 1;
5
6 float m_RegenTime;
7
8 override void Init()
9 {
12 m_IsPersistent = true;
13 m_ID = eModifiers.MDF_ANTIBIOTICS;
16
17 m_RegenTime = ANTIBIOTICS_LIFETIME;
18
20 }
21
22 override bool ActivateCondition(PlayerBase player)
23 {
24 return false;
25 }
26
27 override void OnReconnect(PlayerBase player)
28 {
29 OnActivate(player);
30 }
31
32 override string GetDebugText()
33 {
34 return (ANTIBIOTICS_LIFETIME - GetAttachedTime()).ToString();
35 }
36
37 override string GetDebugTextSimple()
38 {
39 return (ANTIBIOTICS_LIFETIME - GetAttachedTime()).ToString();
40 }
41
42 override void OnActivate(PlayerBase player)
43 {
44 player.IncreaseHealingsCount();
45 player.AddMedicalDrugsInUse(EMedicalDrugsType.ANTIBIOTICS);
46 }
47
48 override void OnDeactivate(PlayerBase player)
49 {
50 player.DecreaseHealingsCount();
51 player.RemoveMedicalDrugsInUse(EMedicalDrugsType.ANTIBIOTICS);
52 }
53
54 override bool DeactivateCondition(PlayerBase player)
55 {
56 float attachedTime = GetAttachedTime();
57
58 if (attachedTime >= m_RegenTime)
59 return true;
60
61 return false;
62 }
63
64 override void OnTick(PlayerBase player, float deltaT)
65 {
66 player.m_AgentPool.DrugsAttack(EMedicalDrugsType.ANTIBIOTICS, ANTIBIOTICS_STRENGTH * deltaT);
67 }
68}
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition effect.c:51
EMedicalDrugsType
eModifiers
Definition emodifiers.c:2
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()