72 if (agentPotency <= immunityLevel)
75 if (temporaryResistance > 1.0)
85 growDelta = invasibility * deltaT;
90 growDelta = -dieOffSpeed * deltaT;
94 float newCount = oldCount + growDelta;
95 newCount =
Math.
Clamp(newCount, 0, maxCount);
111 if (temporaryResistance > 1.0)
113 float newResistanceValue = temporaryResistance - deltaTime;
125 foreach (
int agentId : agentList)
142 if (!ctx.
Read(count))
147 for (
int i = 0; i < count; ++i)
150 if (!ctx.
Read(agentId))
154 if (!ctx.
Read(agentCount))
159 float agentTemporaryResistanceTime;
160 if (!ctx.
Read(agentTemporaryResistanceTime))
200 float newValue =
m_VirusPool.Get(agent_id) + count;
234 float reduction = percent * 0.01;
237 agentCount -= agentCount * reduction;
282 for (
int i = 0; i < count; ++i)
334 float delta = attack_value * resistance;
336 float newAgentCount = actualAgentCount - delta;
353 float delta = attackValue * resistance;
355 float newAgentCount = actualAgentCount - delta;
408 for (
int i = 0; i < count; i++)
411 string agentName = agent.
GetName();
418 object_out.Insert(
new Param4<string,string, int, float>(agentName, amount, agentId, tempResistance));
421 object_out.InsertAt(
new Param1<int>(count) ,0);
bool AutoinfectCheck(float deltaT, PlayerBase player)
static ref Param1< int > PARAM1_INT
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.
void SetAgentCount(int agent_id, float count)
Directly set the count of agents for give id in pool.
ref map< int, float > m_AgentTemporaryResistance
void RemoveAgent(int agent_id)
Remove agent from Agent Pool.
void ProcessTemporaryResistance(float deltaTime)
Temporary resistance simulation.
const int STORAGE_VERSION
void SpawnAgents(float deltaT)
Autoinfection mechanism for agents with that attribute enabled.
ref array< int > m_VirusPoolArray
DEPRECATED.
void AddAgent(int agent_id, float count)
Add agent into Agent Pool.
void ImmuneSystemTick(float value, float deltaT)
Agent pool simulation entry point.
void AntibioticsAttackEx(float attack_value, EMedicalDrugsType drugType)
void RemoteGrowRequestDebug(ParamsReadContext ctx)
void ResetTemporaryResistance()
Resets temporary resistance for all agents (internal usage only).
void SetTemporaryResistance(int agentId, float time)
Sets temporary resistance time against specified agent contraction.
void DigestAgent(int agent_id, float count)
Digest (add) agent from food/drink in PlayerStomach into Agent Pool.
void ReduceAgent(int id, float percent)
Reduce count of specified agent by a given percentage from Agent Pool.
void AntibioticsAttack(float attack_value)
Antibiotics treatment agains agents which are not resistent to it (see agent attributes).
void GrowAgents(float deltaT)
Agent's growth/death simulation.
bool OnStoreLoad(ParamsReadContext ctx, int version)
PluginTransmissionAgents m_PluginTransmissionAgents
void PlayerAgentPool(PlayerBase player)
void RemoveAllAgents()
Remove all agents from Agent Pool.
void DrugsAttack(EMedicalDrugsType drugType, float attackValue)
Drugs attack calculation.
void OnStoreSave(ParamsWriteContext ctx)
int GetAgents()
Reduce bitmask of currently active agents.
int GetSingleAgentCount(int agent_id)
Number of agents of specified id.
void GetDebugObject(array< ref Param > object_out)
float GetTemporaryResistance(int agentId)
Returns remaining temporary resistance time for specified agent.
float GetTotalAgentCount()
Total number of agents active.
ref map< int, float > m_VirusPool
proto bool Write(void value_out)
proto bool Read(void value_in)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Serializer ParamsReadContext
Serializer ParamsWriteContext
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'.
static proto int AbsInt(int i)
Returns absolute value.
PluginBase GetPlugin(typename plugin_type)
bool IsPluginManagerExists()