Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
agentbase.c
Go to the documentation of this file.
1 class AgentBase extends MessageReceiverBase
2 {
3  float m_Type = 0;
4  float m_Invasibility; //how fast the agent grows when potent enough to grow
5  float m_TransferabilityIn; //to the player
6  float m_TransferabilityOut; //from the player
7  float m_Digestibility = 0.1; //multiplier for agents digested in the player stomach from an infected item(agents_transfered = digested_amount(in grams or mls) * m_Digestibility)
8  int m_MaxCount = 1;
9  float m_AutoinfectProbability = CalculateAutoinfectProbability(0); // [0..1], 0 = zero chance, 1 = 100% chance of getting this agent once per hour
10  float m_TransferabilityAirOut; // transferibility airborne out
11  float m_AntibioticsResistance = 1; //[0..1], 0 means antibiotics have full effect, 1 means no effect
12 
13  EStatLevels m_Potency = EStatLevels.MEDIUM; //grow when player's immune system is at this level or lower
14  float m_DieOffSpeed = 1; //how fast the agent dies off when not potent enough to grow(per sec)
15 
16  void AgentBase()
17  {
18  Init();
19  }
20 
21  void Init();
22 
23  int GetAgentType()
24  {
25  return m_Type;
26  }
27 
28  float GetDieOffSpeedEx(PlayerBase player)
29  {
30  return GetDieOffSpeed();
31  }
32 
33  EStatLevels GetPotencyEx(PlayerBase player)
34  {
35  return GetPotency();
36  }
37 
38  float GetInvasibilityEx(PlayerBase player)
39  {
40  return GetInvasibility();
41  }
42 
43  EStatLevels GetPotency()
44  {
45  return m_Potency;
46  }
47 
48  float GetDieOffSpeed()
49  {
50  return m_DieOffSpeed;
51  }
52 
53  float GetAntiboticsResistance()
54  {
55  return m_AntibioticsResistance;
56  }
57  float GetAntibioticsResistanceEx(PlayerBase player)
58  {
59  return GetAntiboticsResistance();
60  }
61 
62  float GetInvasibility()
63  {
64  return m_Invasibility;
65  }
66  //should this agent grow based on invasibility even during antibiotics attack
67  bool GrowDuringAntibioticsAttack(PlayerBase player)
68  {
69  return true;//for legacy balancing reasons, set to true by default
70  }
71 
72  float GetDigestibility()
73  {
74  return m_Digestibility;
75  }
76 
77  float CalculateAutoinfectProbability( float userprob )
78  {
79  return ( 1 - Math.Pow( 1 - userprob, ( 1 / 1200 ) ) );
80  }
81 
82  bool AutoinfectCheck(float deltaT, PlayerBase player)
83  {
84  if ( m_AutoinfectProbability == 0.0 )
85  return false;
86 
87  float dice_throw = Math.RandomFloat01();
88 
89  if ( dice_throw < m_AutoinfectProbability )
90  {
91  return CanAutoinfectPlayer(player);
92  }
93  else
94  {
95  return false;
96  }
97  }
98 
99  bool CanAutoinfectPlayer(PlayerBase player)
100  {
101  return false;
102  }
103 
104  float GetTransferabilityIn()
105  {
106  return m_TransferabilityIn;
107  }
108 
109  float GetTransferabilityOut()
110  {
111  return m_TransferabilityOut;
112  }
113 
114  float GetTransferabilityAirOut()
115  {
116  return m_TransferabilityAirOut;
117  }
118 
119  int GetMaxCount()
120  {
121  return m_MaxCount;
122  }
123 
124  string GetName()
125  {
126  return ClassName();
127  }
128 }
m_Type
eBleedingSourceType m_Type
Definition: bleedingsource.c:25
GetName
proto native owned string GetName()
Definition: syncedvalue.c:117
PlayerBase
Definition: playerbaseclient.c:1
MessageReceiverBase
Definition: messagereceiverbase.c:1
AgentBase
Definition: brainagent.c:1
EStatLevels
EStatLevels
Definition: estatlevels.c:1
Math
Definition: enmath.c:6