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)
329 float delta = attack_value * resistance;
331 float newAgentCount = actualAgentCount - delta;
353 float newAgentCount = actualAgentCount - attackValue;
407 for (
int i = 0; i < count; i++)
410 string agentName = agent.
GetName();
417 object_out.Insert(
new Param4<string,string, int, float>(agentName, amount, agentId, tempResistance));
420 object_out.InsertAt(
new Param1<int>(count) ,0);
PluginBase GetPlugin(typename plugin_type)
bool IsPluginManagerExists()
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 OnStoreSave(ParamsWriteContext ctx)
void DrugsAttack(EMedicalDrugsType drugType, float attackValue)
Drugs treatment logic.
void RemoteGrowRequestDebug(ParamsReadContext ctx)
void RemoveAllAgents()
Remove all agents from Agent Pool.
float GetTotalAgentCount()
Total number of agents active.
void SetTemporaryResistance(int agentId, float time)
Sets temporary resistance time against specified agent contraction.
void PlayerAgentPool(PlayerBase player)
PluginTransmissionAgents m_PluginTransmissionAgents
void RemoveAgent(int agent_id)
Remove agent from Agent Pool.
ref array< int > m_VirusPoolArray
DEPRECATED.
void AddAgent(int agent_id, float count)
Add agent into Agent Pool.
ref map< int, float > m_AgentTemporaryResistance
ref map< int, float > m_VirusPool
int GetAgents()
Reduce bitmask of currently active agents.
float GetTemporaryResistance(int agentId)
Returns remaining temporary resistance time for specified agent.
void ImmuneSystemTick(float value, float deltaT)
Agent pool simulation entry point.
void AntibioticsAttack(float attack_value)
Antibiotics treatment agains agents which are not resistent to it (see agent attributes)
void ProcessTemporaryResistance(float deltaTime)
Temporary resistance simulation.
void ReduceAgent(int id, float percent)
Reduce count of specified agent by a given percentage from Agent Pool.
bool OnStoreLoad(ParamsReadContext ctx, int version)
void ResetTemporaryResistance()
Resets temporary resistance for all agents (internal usage only)
void DigestAgent(int agent_id, float count)
Digest (add) agent from food/drink in PlayerStomach into Agent Pool.
const int STORAGE_VERSION
void SetAgentCount(int agent_id, float count)
Directly set the count of agents for give id in pool.
void GetDebugObject(array< ref Param > object_out)
int GetSingleAgentCount(int agent_id)
Number of agents of specified id.
void SpawnAgents(float deltaT)
Autoinfection mechanism for agents with that attribute enabled.
void GrowAgents(float deltaT)
Agent's growth/death simulation.
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 int AbsInt(int i)
Returns absolute value.
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'.