Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
disinfectmdfr.c
Go to the documentation of this file.
2 {
3  const int LIFETIME = 100;
4  //const int EFFECT_TIME = 100;
5  PluginTransmissionAgents m_PluginTransmissionAgents = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
6  float m_WoundAgentInvasibility;
7  override void Init()
8  {
10  m_IsPersistent = true;
11  m_ID = eModifiers.MDF_DISINFECTION;
14  //m_WoundAgentInvasibility = m_PluginTransmissionAgents.GetAgentInvasibility(eAgents.WOUND_AGENT);
16  }
17 
18  override bool ActivateCondition(PlayerBase player)
19  {
20  return false;
21  }
22 
23  override void OnReconnect(PlayerBase player)
24  {
25  OnActivate( player );
26  }
27 
28  override string GetDebugText()
29  {
30  return ( LIFETIME - GetAttachedTime() ).ToString();
31  }
32 
33  override string GetDebugTextSimple()
34  {
35  return ( LIFETIME - GetAttachedTime() ).ToString();
36  }
37 
38 
39  override void OnActivate(PlayerBase player)
40  {
41  player.IncreaseHealingsCount();
42 
43  }
44 
45  override void OnDeactivate(PlayerBase player)
46  {
47  player.DecreaseHealingsCount();
48 
49  if(player.GetModifiersManager().IsModifierActive(eModifiers.MDF_WOUND_INFECTION1))
50  {
51  player.m_AgentPool.AddAgent(eAgents.WOUND_AGENT, -10000);
52  }
53 
54  }
55 
56  override bool DeactivateCondition(PlayerBase player)
57  {
58  float attached_time = GetAttachedTime();
59 
60  if ( attached_time >= LIFETIME )
61  {
62  return true;
63  }
64  else
65  {
66  return false;
67  }
68  }
69 
70  override void OnTick(PlayerBase player, float deltaT)
71  {
72  if(player.GetModifiersManager().IsModifierActive(eModifiers.MDF_WOUND_INFECTION2))
73  {
74  player.m_AgentPool.AddAgent(eAgents.WOUND_AGENT, -m_PluginTransmissionAgents.GetAgentInvasibility(eAgents.WOUND_AGENT) * deltaT);
75  }
76  else
77  {
78  player.m_AgentPool.AddAgent(eAgents.WOUND_AGENT, -m_PluginTransmissionAgents.GetAgentInvasibility(eAgents.WOUND_AGENT) * 2 * deltaT);
79  }
80  }
81 };
m_TickIntervalActive
float m_TickIntervalActive
Definition: modifierbase.c:19
m_TrackActivatedTime
bool m_TrackActivatedTime
Definition: modifierbase.c:15
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition: pluginmanager.c:316
DEFAULT_TICK_TIME_ACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
Definition: modifiersmanager.c:31
LIFETIME
@ LIFETIME
Float R/W.
Definition: envisual.c:161
PlayerBase
Definition: playerbaseclient.c:1
eAgents
eAgents
Definition: eagents.c:2
DisinfectionMdfr
Definition: disinfectmdfr.c:1
m_TickIntervalInactive
float m_TickIntervalInactive
Definition: modifierbase.c:18
eModifiers
eModifiers
Definition: emodifiers.c:1
ModifierBase
Definition: breathvapourmdfr.c:3
m_IsPersistent
bool m_IsPersistent
Definition: modifierbase.c:16
GetAttachedTime
float GetAttachedTime()
Definition: modifierbase.c:150
DisableActivateCheck
void DisableActivateCheck()
Definition: modifierbase.c:78
m_ID
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition: effect.c:49
DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_INACTIVE
Definition: modifiersmanager.c:33