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

◆ GrowAgents()

void PlayerAgentPool::GrowAgents ( float deltaT)
inlineprotected

Agent's growth/death simulation.

  • based on the potency, invasibility
    • takes into account the temporary resistance
      Аргументы
      deltaTtick

См. определение в файле PlayerAgentPool.c строка 55

56 {
58 return;
59
60 EStatLevels immunityLevel = m_Player.GetImmunityLevel();
61
63 for (int i = 0; i < m_VirusPool.Count(); i++)
64 {
65 int agentId = m_VirusPool.GetKey(i);
66 int maxCount = m_PluginTransmissionAgents.GetAgentMaxCount(agentId);
67
68 EStatLevels agentPotency = m_PluginTransmissionAgents.GetAgentPotencyEx(agentId, m_Player);
69
70 float growDelta;
71
72 if (agentPotency <= immunityLevel)
73 {
74 float temporaryResistance = GetTemporaryResistance(agentId);
75 if (temporaryResistance > 1.0)
76 continue;
77
78 if (m_Player.IsAntibioticsActive() && !m_PluginTransmissionAgents.GrowDuringMedicalDrugsAttack(agentId, EMedicalDrugsType.CHELATION, m_Player))
79 continue;
80
81 if (m_Player.IsChelationActive() && !m_PluginTransmissionAgents.GrowDuringMedicalDrugsAttack(agentId, EMedicalDrugsType.CHELATION, m_Player))
82 continue
83
84 float invasibility = m_PluginTransmissionAgents.GetAgentInvasibilityEx(agentId, m_Player);
85 growDelta = invasibility * deltaT;
86 }
87 else
88 {
89 float dieOffSpeed = m_PluginTransmissionAgents.GetAgentDieOffSpeedEx(agentId, m_Player);
90 growDelta = -dieOffSpeed * deltaT;
91 }
92
93 float oldCount = m_VirusPool.Get(agentId);
94 float newCount = oldCount + growDelta;
95 newCount = Math.Clamp(newCount, 0, maxCount);
96
97 m_TotalAgentCount += newCount;
98 SetAgentCount(agentId, newCount);
99 }
100 }
EMedicalDrugsType
Определения EMedicalDrugsType.c:2
EStatLevels
Определения EStatLevels.c:2
bool IsPluginManagerExists()
Определения PluginManager.c:306
float m_TotalAgentCount
Определения PlayerAgentPool.c:14
PluginTransmissionAgents m_PluginTransmissionAgents
Определения PlayerAgentPool.c:21
PlayerBase m_Player
Определения PlayerAgentPool.c:15
ref map< int, float > m_VirusPool
Определения PlayerAgentPool.c:17
float GetTemporaryResistance(int agentId)
Returns remaining temporary resistance time for specified agent.
Определения PlayerAgentPool.c:374
void SetAgentCount(int agent_id, float count)
Directly set the count of agents for give id in pool.
Определения PlayerAgentPool.c:297

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

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