Keeps track of agents and their simulation. More...
Private Member Functions | |
void | PlayerAgentPool (PlayerBase player) |
int | GetStorageVersion () |
void | ImmuneSystemTick (float value, float deltaT) |
Agent pool simulation entry point. | |
void | GrowAgents (float deltaT) |
Agent's growth/death simulation. | |
protected void | ProcessTemporaryResistance (float deltaTime) |
Temporary resistance simulation. | |
void | OnStoreSave (ParamsWriteContext ctx) |
bool | OnStoreLoad (ParamsReadContext ctx, int version) |
void | DigestAgent (int agent_id, float count) |
Digest (add) agent from food/drink in PlayerStomach into Agent Pool. | |
void | AddAgent (int agent_id, float count) |
Add agent into Agent Pool. | |
void | RemoveAgent (int agent_id) |
Remove agent from Agent Pool. | |
void | RemoveAllAgents () |
Remove all agents from Agent Pool. | |
void | ReduceAgent (int id, float percent) |
Reduce count of specified agent by a given percentage from Agent Pool. | |
int | GetAgents () |
Reduce bitmask of currently active agents. | |
int | GetSingleAgentCount (int agent_id) |
Number of agents of specified id. | |
float | GetTotalAgentCount () |
Total number of agents active. | |
void | SpawnAgents (float deltaT) |
Autoinfection mechanism for agents with that attribute enabled. | |
void | SetAgentCount (int agent_id, float count) |
Directly set the count of agents for give id in pool. | |
void | AntibioticsAttack (float attack_value) |
Antibiotics treatment agains agents which are not resistent to it (see agent attributes) | |
void | DrugsAttack (EMedicalDrugsType drugType, float attackValue) |
Drugs treatment logic. | |
void | SetTemporaryResistance (int agentId, float time) |
Sets temporary resistance time against specified agent contraction. | |
float | GetTemporaryResistance (int agentId) |
Returns remaining temporary resistance time for specified agent. | |
private void | ResetTemporaryResistance () |
Resets temporary resistance for all agents (internal usage only) | |
void | RemoteGrowRequestDebug (ParamsReadContext ctx) |
void | GetDebugObject (array< ref Param > object_out) |
void | PrintAgents () |
Private Attributes | |
const int | STORAGE_VERSION = 137 |
int | m_AgentMask |
float | m_LastTicked |
float | m_TotalAgentCount |
PlayerBase | m_Player |
ref map< int, float > | m_VirusPool |
protected ref map< int, float > | m_AgentTemporaryResistance |
PluginTransmissionAgents | m_PluginTransmissionAgents = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents)) |
ref array< int > | m_VirusPoolArray = new array<int>() |
DEPRECATED. | |
Keeps track of agents and their simulation.
|
inlineprivate |
References m_AgentTemporaryResistance, m_LastTicked, m_Player, and m_VirusPool.
Add agent into Agent Pool.
agent_id | Id of agent (see eAgents enum) |
count | Amount of agents to add |
References GetTemporaryResistance(), m_PluginTransmissionAgents, m_VirusPool, and SetAgentCount().
Referenced by DigestAgent(), RemoteGrowRequestDebug(), and SpawnAgents().
|
inlineprivate |
Antibiotics treatment agains agents which are not resistent to it (see agent attributes)
attack_value | Strength of the anitibiotics attack |
References m_Player, m_PluginTransmissionAgents, m_VirusPool, and SetAgentCount().
Referenced by DrugsAttack().
Digest (add) agent from food/drink in PlayerStomach into Agent Pool.
agent_id | Id of agent (see eAgents enum) |
count | Amount of agents to add |
References AddAgent(), m_Player, and m_PluginTransmissionAgents.
|
inlineprivate |
Drugs treatment logic.
drugType | Type of drug used (see EMedicalDrugsType enum) |
attack_value | Strength of the drug attack |
References AntibioticsAttack(), m_VirusPool, and SetAgentCount().
|
inlineprivate |
Reduce bitmask of currently active agents.
References m_AgentMask.
Number of agents of specified id.
agent_id | Id of agent to add into pool (see eAgents) |
References m_VirusPool.
Referenced by GetDebugObject(), OnStoreSave(), ReduceAgent(), and SpawnAgents().
|
inlineprivate |
References STORAGE_VERSION.
Returns remaining temporary resistance time for specified agent.
param agent_id Id of agent to add into pool (see eAgents)
References m_AgentTemporaryResistance.
Referenced by AddAgent(), GetDebugObject(), GrowAgents(), OnStoreSave(), and ProcessTemporaryResistance().
|
inlineprivate |
|
inlineprivate |
Agent's growth/death simulation.
deltaT | tick |
References Math::Clamp(), GetTemporaryResistance(), IsPluginManagerExists(), m_Player, m_PluginTransmissionAgents, m_TotalAgentCount, m_VirusPool, and SetAgentCount().
Referenced by ImmuneSystemTick().
Agent pool simulation entry point.
value | Immunity value (deprecated, used in previous versions) |
deltaT | tick |
References GrowAgents(), ProcessTemporaryResistance(), and SpawnAgents().
|
inlineprivate |
References m_PluginTransmissionAgents, Serializer::Read(), SetAgentCount(), and SetTemporaryResistance().
|
inlineprivate |
|
inlineprivate |
References Debug::Log(), and m_VirusPool.
|
inlineprivate |
Temporary resistance simulation.
References GetTemporaryResistance(), m_AgentTemporaryResistance, and SetTemporaryResistance().
Referenced by ImmuneSystemTick().
Reduce count of specified agent by a given percentage from Agent Pool.
agent_id | Id of agent (see eAgents enum) |
percent | How many percents of the agents should be reduced |
References Math::Clamp(), GetSingleAgentCount(), and SetAgentCount().
|
inlineprivate |
|
inlineprivate |
Remove agent from Agent Pool.
agent_id | Id of agent (see eAgents enum) |
References SetAgentCount().
|
inlineprivate |
Remove all agents from Agent Pool.
agent_id | Id of agent (see eAgents enum) |
References m_AgentMask, m_VirusPool, and ResetTemporaryResistance().
|
inlineprivate |
Resets temporary resistance for all agents (internal usage only)
References m_AgentTemporaryResistance, and SetTemporaryResistance().
Referenced by RemoveAllAgents().
Directly set the count of agents for give id in pool.
agent_id | Id of agent to add into pool (see eAgents) |
count | Number of agents to be set |
References m_AgentMask, m_Player, and m_VirusPool.
Referenced by AddAgent(), AntibioticsAttack(), DrugsAttack(), GrowAgents(), OnStoreLoad(), ReduceAgent(), and RemoveAgent().
Sets temporary resistance time against specified agent contraction.
param agent_id Id of agent to add into pool (see eAgents)
time | Length of resistance in seconds |
References Math::Clamp(), m_AgentTemporaryResistance, and MAX.
Referenced by OnStoreLoad(), ProcessTemporaryResistance(), and ResetTemporaryResistance().
|
inlineprivate |
Autoinfection mechanism for agents with that attribute enabled.
deltaT | tick |
References AddAgent(), AgentBase::AutoinfectCheck(), AgentBase::GetAgentType(), AgentBase::GetAutoinfectCount(), GetSingleAgentCount(), m_Player, and m_PluginTransmissionAgents.
Referenced by ImmuneSystemTick().
|
private |
Referenced by GetAgents(), RemoveAllAgents(), and SetAgentCount().
|
private |
Referenced by PlayerAgentPool().
|
private |
Referenced by AntibioticsAttack(), DigestAgent(), GrowAgents(), PlayerAgentPool(), SetAgentCount(), and SpawnAgents().
|
private |
Referenced by AddAgent(), AntibioticsAttack(), DigestAgent(), GetDebugObject(), GrowAgents(), OnStoreLoad(), OnStoreSave(), RemoteGrowRequestDebug(), and SpawnAgents().
|
private |
Referenced by GrowAgents().
|
private |
Referenced by GetStorageVersion().