Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
agentbase.c
Go to the documentation of this file.
2{
3 float m_Type = 0;
4 float m_Invasibility;
5 float m_TransferabilityIn;
6 float m_TransferabilityOut;
7 float m_Digestibility = 0.1;
8 int m_MaxCount = 1;
9 int m_AutoinfectCount = 1;
10 float m_AutoinfectProbability = CalculateAutoinfectProbability(0); // [0..1], 0 = zero chance, 1 = 100% chance of getting this agent once per hour
11 float m_TransferabilityAirOut;
12 float m_AntibioticsResistance = 1;
13
14 EStatLevels m_Potency = EStatLevels.MEDIUM;
15 float m_DieOffSpeed = 1;
16
17 void AgentBase()
18 {
19 Init();
20 }
21
22 void Init();
23
24 int GetAgentType()
25 {
26 return m_Type;
27 }
28
29 float GetDieOffSpeedEx(PlayerBase player)
30 {
31 return GetDieOffSpeed();
32 }
33
34 EStatLevels GetPotencyEx(PlayerBase player)
35 {
36 return GetPotency();
37 }
38
39 float GetInvasibilityEx(PlayerBase player)
40 {
41 return GetInvasibility();
42 }
43
44 float GetDigestibilityEx(PlayerBase player)
45 {
46 return GetDigestibility();
47 }
48
49 EStatLevels GetPotency()
50 {
51 return m_Potency;
52 }
53
54 float GetDieOffSpeed()
55 {
56 return m_DieOffSpeed;
57 }
58
59 float GetAntiboticsResistance()
60 {
61 return m_AntibioticsResistance;
62 }
63 float GetAntibioticsResistanceEx(PlayerBase player)
64 {
65 return GetAntiboticsResistance();
66 }
67
68 float GetInvasibility()
69 {
70 return m_Invasibility;
71 }
72
74 bool GrowDuringMedicalDrugsAttack(EMedicalDrugsType drugType, PlayerBase player)
75 {
76 return true;
77 }
78
79 float GetDigestibility()
80 {
81 return m_Digestibility;
82 }
83
84 float CalculateAutoinfectProbability(float userprob)
85 {
86 return ( 1 - Math.Pow( 1 - userprob, ( 1 / 1200 ) ) );
87 }
88
89 bool AutoinfectCheck(float deltaT, PlayerBase player)
90 {
91 if (m_AutoinfectProbability == 0.0)
92 return false;
93
94 float diceThrow = Math.RandomFloat01();
95
96 if (diceThrow < m_AutoinfectProbability)
97 return CanAutoinfectPlayer(player);
98
99 return false;
100 }
101
102 bool CanAutoinfectPlayer(PlayerBase player)
103 {
104 return false;
105 }
106
107 float GetTransferabilityIn()
108 {
109 return m_TransferabilityIn;
110 }
111
112 float GetTransferabilityOut()
113 {
114 return m_TransferabilityOut;
115 }
116
117 float GetTransferabilityAirOut()
118 {
119 return m_TransferabilityAirOut;
120 }
121
122 int GetMaxCount()
123 {
124 return m_MaxCount;
125 }
126
127 int GetAutoinfectCount()
128 {
129 return m_AutoinfectCount;
130 }
131
132 string GetName()
133 {
134 return ClassName();
135 }
136
137
140
142 bool GrowDuringAntibioticsAttack(PlayerBase player)
143 {
144 return true;
145 }
146}
eBleedingSourceType m_Type
Definition enmath.c:7
EMedicalDrugsType
EStatLevels
Definition estatlevels.c:2