DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс PlayerAgentPool

Защищенные члены

void PlayerAgentPool (PlayerBase player)
 
int GetStorageVersion ()
 
void PrintAgents ()
 
void ImmuneSystemTick (float value, float deltaT)
 
void GrowAgents (float deltaT)
 
void ProcessTemporaryResistance (float deltaTime)
 
void OnStoreSave (ParamsWriteContext ctx)
 
bool OnStoreLoad (ParamsReadContext ctx, int version)
 
void DigestAgent (int agent_id, float count)
 
void AddAgent (int agent_id, float count)
 
void RemoveAgent (int agent_id)
 
void RemoveAllAgents ()
 
void ReduceAgent (int id, float percent)
 
int GetAgents ()
 
int GetSingleAgentCount (int agent_id)
 
float GetTotalAgentCount ()
 
void SpawnAgents (float deltaT)
 
void SetAgentCount (int agent_id, float count)
 
void AntibioticsAttack (float attack_value)
 
void DrugsAttack (EMedicalDrugsType drugType, float attackValue)
 
void SetTemporaryResistance (int agentId, float time)
 
float GetTemporaryResistance (int agentId)
 

Защищенные данные

ref map< int, floatm_AgentTemporaryResistance
 
PluginTransmissionAgents m_PluginTransmissionAgents = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents))
 

Закрытые члены

void ResetTemporaryResistance ()
 
void RemoteGrowRequestDebug (ParamsReadContext ctx)
 
void GetDebugObject (array< ref Param > object_out)
 

Закрытые данные

const int STORAGE_VERSION = 137
 
int m_AgentMask
 
float m_LastTicked
 
float m_TotalAgentCount
 
PlayerBase m_Player
 
ref map< int, floatm_VirusPool
 
ref array< intm_VirusPoolArray
 DEPRECATED.
 

Подробное описание

Конструктор(ы)

◆ PlayerAgentPool()

void PlayerAgentPool ( PlayerBase player)
inlineprotected

DEPRECATED

17 {
19 m_LastTicked = 0;
21
23
26 }
Definition EntityAI.c:95
ref map< int, float > m_AgentTemporaryResistance
Definition PlayerAgentPool.c:12
ref array< int > m_VirusPoolArray
DEPRECATED.
Definition PlayerAgentPool.c:352
PlayerBase m_Player
Definition PlayerAgentPool.c:8
float m_LastTicked
Definition PlayerAgentPool.c:6
ref map< int, float > m_VirusPool
Definition PlayerAgentPool.c:10

Перекрестные ссылки m_AgentTemporaryResistance, m_LastTicked, m_Player, m_VirusPool и m_VirusPoolArray.

Методы

◆ AddAgent()

void AddAgent ( int agent_id,
float count )
inlineprotected
171 {
173 return;
174
175 int max_count = m_PluginTransmissionAgents.GetAgentMaxCount(agent_id);
176
177 if (!m_VirusPool.Contains(agent_id) && count > 0)//if it contains, maybe add count only ?
178 {
180 }
181 else
182 {
183 float newValue = m_VirusPool.Get(agent_id) + count;
185 }
186 }
void SetAgentCount(int agent_id, float count)
Definition PlayerAgentPool.c:247
PluginTransmissionAgents m_PluginTransmissionAgents
Definition PlayerAgentPool.c:14
float GetTemporaryResistance(int agentId)
Definition PlayerAgentPool.c:305

Перекрестные ссылки GetTemporaryResistance(), m_PluginTransmissionAgents, m_VirusPool и SetAgentCount().

Используется в DigestAgent(), RemoteGrowRequestDebug() и SpawnAgents().

◆ AntibioticsAttack()

void AntibioticsAttack ( float attack_value)
inlineprotected
270 {
271 for (int i = 0; i < m_VirusPool.Count(); ++i)
272 {
273 int agentId = m_VirusPool.GetKey(i);
274 float resistance = 1 - m_PluginTransmissionAgents.GetAgentAntiboticsResistanceEx(agentId, m_Player);
275 float delta = attack_value * resistance;
279 }
280 }

Перекрестные ссылки m_Player, m_PluginTransmissionAgents, m_VirusPool и SetAgentCount().

Используется в DrugsAttack().

◆ DigestAgent()

void DigestAgent ( int agent_id,
float count )
inlineprotected
166 {
167 AddAgent(agent_id, m_PluginTransmissionAgents.GetAgentDigestibility(agent_id) * count);
168 }
void AddAgent(int agent_id, float count)
Definition PlayerAgentPool.c:170

Перекрестные ссылки AddAgent() и m_PluginTransmissionAgents.

◆ DrugsAttack()

void DrugsAttack ( EMedicalDrugsType drugType,
float attackValue )
inlineprotected
283 {
284 switch (drugType)
285 {
286 case EMedicalDrugsType.ANTIBIOTICS:
288 break;
289 default:
290 for (int i = 0; i < m_VirusPool.Count(); ++i)
291 {
292 int agentId = m_VirusPool.GetKey(i);
296 }
297 }
298 }
EMedicalDrugsType
Definition EMedicalDrugsType.c:2
void AntibioticsAttack(float attack_value)
Definition PlayerAgentPool.c:269

Перекрестные ссылки AntibioticsAttack(), m_VirusPool и SetAgentCount().

◆ GetAgents()

int GetAgents ( )
inlineprotected
213 {
214 return m_AgentMask;
215 }
int m_AgentMask
Definition PlayerAgentPool.c:5

Перекрестные ссылки m_AgentMask.

◆ GetDebugObject()

void GetDebugObject ( array< ref Param > object_out)
inlineprivate
333 {
334 int count = m_PluginTransmissionAgents.GetAgentList().Count();
335 for (int i = 0; i < count; i++)
336 {
337 AgentBase agent = m_PluginTransmissionAgents.GetAgentList().GetElement(i);
338 string agentName = agent.GetName();
339 int agentId = agent.GetAgentType();
340 int maxAgents = m_PluginTransmissionAgents.GetAgentMaxCount(agentId);
341 string amount = GetSingleAgentCount(agentId).ToString() + "/" + maxAgents.ToString();
342
344
346 }
347
348 object_out.InsertAt(new Param1<int>(count) ,0);
349 }
Definition AgentBase.c:2
int GetSingleAgentCount(int agent_id)
Definition PlayerAgentPool.c:217

Перекрестные ссылки GetSingleAgentCount(), GetTemporaryResistance() и m_PluginTransmissionAgents.

◆ GetSingleAgentCount()

int GetSingleAgentCount ( int agent_id)
inlineprotected
218 {
219 if (m_VirusPool.Contains(agent_id))
220 return m_VirusPool.Get(agent_id);
221
222 return 0;
223 }

Перекрестные ссылки m_VirusPool.

Используется в GetDebugObject(), OnStoreSave(), ReduceAgent() и SpawnAgents().

◆ GetStorageVersion()

int GetStorageVersion ( )
inlineprotected
29 {
30 return STORAGE_VERSION;
31 }
const int STORAGE_VERSION
Definition PlayerAgentPool.c:3

Перекрестные ссылки STORAGE_VERSION.

◆ GetTemporaryResistance()

float GetTemporaryResistance ( int agentId)
inlineprotected
306 {
309
310 return 0.0;
311 }

Перекрестные ссылки m_AgentTemporaryResistance.

Используется в AddAgent(), GetDebugObject(), GrowAgents(), OnStoreSave() и ProcessTemporaryResistance().

◆ GetTotalAgentCount()

float GetTotalAgentCount ( )
inlineprotected
226 {
227 float agentCount;
228 for (int i = 0; i < m_VirusPool.Count(); i++)
229 agentCount += m_VirusPool.GetElement(i);
230
231 return agentCount;
232 }

Перекрестные ссылки m_VirusPool.

◆ GrowAgents()

void GrowAgents ( float deltaT)
inlineprotected
53 {
55 return;
56
57 EStatLevels immunityLevel = m_Player.GetImmunityLevel();
58
60 for (int i = 0; i < m_VirusPool.Count(); i++)
61 {
62 int agentId = m_VirusPool.GetKey(i);
63 int maxCount = m_PluginTransmissionAgents.GetAgentMaxCount(agentId);
64
66
67 float growDelta;
68
70 {
72 if (temporaryResistance > 1.0)
73 continue;
74
75 if (m_Player.IsAntibioticsActive() && !m_PluginTransmissionAgents.GrowDuringMedicalDrugsAttack(agentId, EMedicalDrugsType.CHELATION, m_Player))
76 continue;
77
78 if (m_Player.IsChelationActive() && !m_PluginTransmissionAgents.GrowDuringMedicalDrugsAttack(agentId, EMedicalDrugsType.CHELATION, m_Player))
79 continue
80
81 float invasibility = m_PluginTransmissionAgents.GetAgentInvasibilityEx(agentId, m_Player);
83 }
84 else
85 {
86 float dieOffSpeed = m_PluginTransmissionAgents.GetAgentDieOffSpeedEx(agentId, m_Player);
88 }
89
90 float oldCount = m_VirusPool.Get(agentId);
91 float newCount = oldCount + growDelta;
93
96 }
97 }
EStatLevels
Definition EStatLevels.c:2
bool IsPluginManagerExists()
Definition PluginManager.c:306
Definition EnMath.c:7
float m_TotalAgentCount
Definition PlayerAgentPool.c:7
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

Перекрестные ссылки Math::Clamp(), GetTemporaryResistance(), IsPluginManagerExists(), m_Player, m_PluginTransmissionAgents, m_TotalAgentCount, m_VirusPool и SetAgentCount().

Используется в ImmuneSystemTick().

◆ ImmuneSystemTick()

void ImmuneSystemTick ( float value,
float deltaT )
inlineprotected
46 {
50 }
void ProcessTemporaryResistance(float deltaTime)
Definition PlayerAgentPool.c:99
void SpawnAgents(float deltaT)
Definition PlayerAgentPool.c:234
void GrowAgents(float deltaT)
Definition PlayerAgentPool.c:52

Перекрестные ссылки GrowAgents(), ProcessTemporaryResistance() и SpawnAgents().

◆ OnStoreLoad()

bool OnStoreLoad ( ParamsReadContext ctx,
int version )
inlineprotected
128 {
129 int count;
130 if (version >= 137)
131 {
132 count = m_PluginTransmissionAgents.GetAgentList().Count();
133 }
134 else
135 {
136 if (!ctx.Read(count))
137 return false;
138 }
139
140
141 for (int i = 0; i < count; ++i)
142 {
143 int agentId;
144 if (!ctx.Read(agentId))
145 return false;
146
147 int agentCount;
148 if (!ctx.Read(agentCount))
149 return false;
150
151 if (version >= 137)
152 {
155 return false;
156
158 }
159
161 }
162
163 return true;
164 }
void SetTemporaryResistance(int agentId, float time)
Definition PlayerAgentPool.c:300

Перекрестные ссылки m_PluginTransmissionAgents, SetAgentCount() и SetTemporaryResistance().

◆ OnStoreSave()

void OnStoreSave ( ParamsWriteContext ctx)
inlineprotected
116 {
117 int count = m_PluginTransmissionAgents.GetAgentList().Count();
118 array<int> agentList = m_PluginTransmissionAgents.GetAgentList().GetKeyArray();
119 foreach (int agentId : agentList)
120 {
121 ctx.Write(agentId);
124 }
125 }

Перекрестные ссылки GetSingleAgentCount(), GetTemporaryResistance() и m_PluginTransmissionAgents.

◆ PrintAgents()

void PrintAgents ( )
inlineprotected
34 {
35 if (m_VirusPool)
36 {
37 for (int i = 0; i < m_VirusPool.Count(); ++i)
38 {
39 Debug.Log("Agent: "+ m_VirusPool.GetKey(i).ToString(), "Agents");
40 Debug.Log("Count: "+ m_VirusPool.GetElement(i).ToString(), "Agents");
41 }
42 }
43 }
Definition Debug.c:14
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:136

Перекрестные ссылки Debug::Log() и m_VirusPool.

◆ ProcessTemporaryResistance()

void ProcessTemporaryResistance ( float deltaTime)
inlineprotected

Перекрестные ссылки GetTemporaryResistance(), m_AgentTemporaryResistance и SetTemporaryResistance().

Используется в ImmuneSystemTick().

◆ ReduceAgent()

void ReduceAgent ( int id,
float percent )
inlineprotected
202 {
203 percent = Math.Clamp(percent, 0, 100);
204 float reduction = percent * 0.01;
205
208
210 }

Перекрестные ссылки Math::Clamp(), GetSingleAgentCount() и SetAgentCount().

◆ RemoteGrowRequestDebug()

void RemoteGrowRequestDebug ( ParamsReadContext ctx)
inlineprivate
320 {
322 int id = CachedObjectsParams.PARAM1_INT.param1;
323 int max = m_PluginTransmissionAgents.GetAgentMaxCount(Math.AbsInt(id));
324 int grow = max / 10;
325
326 if (id > 0)
327 AddAgent(id, grow);
328 else if (id < 0)
329 AddAgent(-id, -grow);
330 }
Definition UtilityClasses.c:10
static ref Param1< int > PARAM1_INT
Definition UtilityClasses.c:11
static proto int AbsInt(int i)
Returns absolute value.

Перекрестные ссылки Math::AbsInt(), AddAgent(), m_PluginTransmissionAgents и CachedObjectsParams::PARAM1_INT.

◆ RemoveAgent()

void RemoveAgent ( int agent_id)
inlineprotected
189 {
191 }

Перекрестные ссылки SetAgentCount().

◆ RemoveAllAgents()

void RemoveAllAgents ( )
inlineprotected
194 {
195 m_AgentMask = 0;
196 m_VirusPool.Clear();
197
199 }
void ResetTemporaryResistance()
Definition PlayerAgentPool.c:313

Перекрестные ссылки m_AgentMask, m_VirusPool и ResetTemporaryResistance().

◆ ResetTemporaryResistance()

void ResetTemporaryResistance ( )
inlineprivate
314 {
315 foreach (int agentId, float value : m_AgentTemporaryResistance)
317 }

Перекрестные ссылки m_AgentTemporaryResistance и SetTemporaryResistance().

Используется в RemoveAllAgents().

◆ SetAgentCount()

void SetAgentCount ( int agent_id,
float count )
inlineprotected
248 {
249 if (count > 0)
250 {
251 //Debug.Log("+ growing agent"+ agent_id.ToString() +"to count: "+count.ToString(), "Agents");
254 }
255 else
256 {
257 //Debug.Log("- REMOVING agent"+ agent_id.ToString(), "Agents");
258 m_VirusPool.Remove(agent_id);
260 }
261
262 if (m_Player.m_Agents != m_AgentMask)
263 {
264 m_Player.m_Agents = m_AgentMask;
265 m_Player.SetSynchDirty();
266 }
267 }

Перекрестные ссылки m_AgentMask, m_Player и m_VirusPool.

Используется в AddAgent(), AntibioticsAttack(), DrugsAttack(), GrowAgents(), OnStoreLoad(), ReduceAgent() и RemoveAgent().

◆ SetTemporaryResistance()

void SetTemporaryResistance ( int agentId,
float time )
inlineprotected
301 {
303 }
const int MAX
Definition EnConvert.c:27

Перекрестные ссылки Math::Clamp(), m_AgentTemporaryResistance и MAX.

Используется в OnStoreLoad(), ProcessTemporaryResistance() и ResetTemporaryResistance().

◆ SpawnAgents()

void SpawnAgents ( float deltaT)
inlineprotected
235 {
236 int count = m_PluginTransmissionAgents.GetAgentList().Count();
237 for (int i = 0; i < count; ++i)
238 {
239 AgentBase agent = m_PluginTransmissionAgents.GetAgentList().GetElement(i);
240 int agentId = agent.GetAgentType();
241
242 if (GetSingleAgentCount(agentId) == 0 && agent.AutoinfectCheck(deltaT, m_Player))
243 AddAgent(agentId, agent.GetAutoinfectCount());
244 }
245 }

Перекрестные ссылки AddAgent(), GetSingleAgentCount(), m_Player и m_PluginTransmissionAgents.

Используется в ImmuneSystemTick().

Поля

◆ m_AgentMask

int m_AgentMask
private

Используется в GetAgents(), RemoveAllAgents() и SetAgentCount().

◆ m_AgentTemporaryResistance

◆ m_LastTicked

float m_LastTicked
private

Используется в PlayerAgentPool().

◆ m_Player

PlayerBase m_Player
private

◆ m_PluginTransmissionAgents

PluginTransmissionAgents m_PluginTransmissionAgents = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents))
protected

◆ m_TotalAgentCount

float m_TotalAgentCount
private

Используется в GrowAgents().

◆ m_VirusPool

◆ m_VirusPoolArray

ref array<int> m_VirusPoolArray
private

DEPRECATED.

Используется в PlayerAgentPool().

◆ STORAGE_VERSION

const int STORAGE_VERSION = 137
private

Используется в GetStorageVersion().


Объявления и описания членов класса находятся в файле: