PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
PlayerAgentPool Class Reference

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, floatm_VirusPool
 
protected ref map< int, floatm_AgentTemporaryResistance
 
PluginTransmissionAgents m_PluginTransmissionAgents = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents))
 
ref array< intm_VirusPoolArray = new array<int>()
 DEPRECATED.
 

Detailed Description

Keeps track of agents and their simulation.

  • adding/reducing of agents
  • autoinfection
  • temporary resistance for agents
  • reaction on drugs

Constructor & Destructor Documentation

◆ PlayerAgentPool()

void PlayerAgentPool ( PlayerBase  player)
inlineprivate

Member Function Documentation

◆ AddAgent()

void AddAgent ( int  agent_id,
float  count 
)
inlineprivate

Add agent into Agent Pool.

Parameters
agent_idId of agent (see eAgents enum)
countAmount of agents to add

References GetTemporaryResistance(), m_PluginTransmissionAgents, m_VirusPool, and SetAgentCount().

Referenced by DigestAgent(), RemoteGrowRequestDebug(), and SpawnAgents().

◆ AntibioticsAttack()

void AntibioticsAttack ( float  attack_value)
inlineprivate

Antibiotics treatment agains agents which are not resistent to it (see agent attributes)

Parameters
attack_valueStrength of the anitibiotics attack

References m_Player, m_PluginTransmissionAgents, m_VirusPool, and SetAgentCount().

Referenced by DrugsAttack().

◆ DigestAgent()

void DigestAgent ( int  agent_id,
float  count 
)
inlineprivate

Digest (add) agent from food/drink in PlayerStomach into Agent Pool.

Parameters
agent_idId of agent (see eAgents enum)
countAmount of agents to add

References AddAgent(), m_Player, and m_PluginTransmissionAgents.

◆ DrugsAttack()

void DrugsAttack ( EMedicalDrugsType  drugType,
float  attackValue 
)
inlineprivate

Drugs treatment logic.

Parameters
drugTypeType of drug used (see EMedicalDrugsType enum)
attack_valueStrength of the drug attack

References AntibioticsAttack(), m_VirusPool, and SetAgentCount().

◆ GetAgents()

int GetAgents ( )
inlineprivate

Reduce bitmask of currently active agents.

References m_AgentMask.

◆ GetDebugObject()

void GetDebugObject ( array< ref Param object_out)
inlineprivate

◆ GetSingleAgentCount()

int GetSingleAgentCount ( int  agent_id)
inlineprivate

Number of agents of specified id.

Parameters
agent_idId of agent to add into pool (see eAgents)
Returns
Count of agents specified in param

References m_VirusPool.

Referenced by GetDebugObject(), OnStoreSave(), ReduceAgent(), and SpawnAgents().

◆ GetStorageVersion()

int GetStorageVersion ( )
inlineprivate

References STORAGE_VERSION.

◆ GetTemporaryResistance()

float GetTemporaryResistance ( int  agentId)
inlineprivate

Returns remaining temporary resistance time for specified agent.

Parameters

param agent_id Id of agent to add into pool (see eAgents)

Returns
time in seconds

References m_AgentTemporaryResistance.

Referenced by AddAgent(), GetDebugObject(), GrowAgents(), OnStoreSave(), and ProcessTemporaryResistance().

◆ GetTotalAgentCount()

float GetTotalAgentCount ( )
inlineprivate

Total number of agents active.

Returns
Agents count

References m_VirusPool.

◆ GrowAgents()

void GrowAgents ( float  deltaT)
inlineprivate

Agent's growth/death simulation.

  • based on the potency, invasibility
    • takes into account the temporary resistance
      Parameters
      deltaTtick

References Math::Clamp(), GetTemporaryResistance(), IsPluginManagerExists(), m_Player, m_PluginTransmissionAgents, m_TotalAgentCount, m_VirusPool, and SetAgentCount().

Referenced by ImmuneSystemTick().

◆ ImmuneSystemTick()

void ImmuneSystemTick ( float  value,
float  deltaT 
)
inlineprivate

Agent pool simulation entry point.

Parameters
valueImmunity value (deprecated, used in previous versions)
deltaTtick

References GrowAgents(), ProcessTemporaryResistance(), and SpawnAgents().

◆ OnStoreLoad()

bool OnStoreLoad ( ParamsReadContext  ctx,
int  version 
)
inlineprivate

◆ OnStoreSave()

◆ PrintAgents()

void PrintAgents ( )
inlineprivate

References Debug::Log(), and m_VirusPool.

◆ ProcessTemporaryResistance()

protected void ProcessTemporaryResistance ( float  deltaTime)
inlineprivate

Temporary resistance simulation.

References GetTemporaryResistance(), m_AgentTemporaryResistance, and SetTemporaryResistance().

Referenced by ImmuneSystemTick().

◆ ReduceAgent()

void ReduceAgent ( int  id,
float  percent 
)
inlineprivate

Reduce count of specified agent by a given percentage from Agent Pool.

Parameters
agent_idId of agent (see eAgents enum)
percentHow many percents of the agents should be reduced

References Math::Clamp(), GetSingleAgentCount(), and SetAgentCount().

◆ RemoteGrowRequestDebug()

void RemoteGrowRequestDebug ( ParamsReadContext  ctx)
inlineprivate

◆ RemoveAgent()

void RemoveAgent ( int  agent_id)
inlineprivate

Remove agent from Agent Pool.

Parameters
agent_idId of agent (see eAgents enum)

References SetAgentCount().

◆ RemoveAllAgents()

void RemoveAllAgents ( )
inlineprivate

Remove all agents from Agent Pool.

Parameters
agent_idId of agent (see eAgents enum)

References m_AgentMask, m_VirusPool, and ResetTemporaryResistance().

◆ ResetTemporaryResistance()

private void ResetTemporaryResistance ( )
inlineprivate

Resets temporary resistance for all agents (internal usage only)

References m_AgentTemporaryResistance, and SetTemporaryResistance().

Referenced by RemoveAllAgents().

◆ SetAgentCount()

void SetAgentCount ( int  agent_id,
float  count 
)
inlineprivate

Directly set the count of agents for give id in pool.

Parameters
agent_idId of agent to add into pool (see eAgents)
countNumber of agents to be set

References m_AgentMask, m_Player, and m_VirusPool.

Referenced by AddAgent(), AntibioticsAttack(), DrugsAttack(), GrowAgents(), OnStoreLoad(), ReduceAgent(), and RemoveAgent().

◆ SetTemporaryResistance()

void SetTemporaryResistance ( int  agentId,
float  time 
)
inlineprivate

Sets temporary resistance time against specified agent contraction.

Parameters

param agent_id Id of agent to add into pool (see eAgents)

Parameters
timeLength of resistance in seconds

References Math::Clamp(), m_AgentTemporaryResistance, and MAX.

Referenced by OnStoreLoad(), ProcessTemporaryResistance(), and ResetTemporaryResistance().

◆ SpawnAgents()

void SpawnAgents ( float  deltaT)
inlineprivate

Autoinfection mechanism for agents with that attribute enabled.

Parameters
deltaTtick

References AddAgent(), AgentBase::AutoinfectCheck(), AgentBase::GetAgentType(), AgentBase::GetAutoinfectCount(), GetSingleAgentCount(), m_Player, and m_PluginTransmissionAgents.

Referenced by ImmuneSystemTick().

Field Documentation

◆ m_AgentMask

int m_AgentMask
private

◆ m_AgentTemporaryResistance

◆ m_LastTicked

float m_LastTicked
private

Referenced by PlayerAgentPool().

◆ m_Player

◆ m_PluginTransmissionAgents

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

◆ m_TotalAgentCount

float m_TotalAgentCount
private

Referenced by GrowAgents().

◆ m_VirusPool

◆ m_VirusPoolArray

ref array<int> m_VirusPoolArray = new array<int>()
private

DEPRECATED.

◆ STORAGE_VERSION

const int STORAGE_VERSION = 137
private

Referenced by GetStorageVersion().


The documentation for this class was generated from the following file: