Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
PlayerAgentPool Class Reference

Keeps track of agents and their simulation. More...

Protected Member Functions

void PlayerAgentPool (PlayerBase player)
void AddAgent (int agent_id, float count)
 Add agent into Agent Pool.
void AntibioticsAttack (float attack_value)
 Antibiotics treatment agains agents which are not resistent to it (see agent attributes).
void AntibioticsAttackEx (float attack_value, EMedicalDrugsType drugType)
void DigestAgent (int agent_id, float count)
 Digest (add) agent from food/drink in PlayerStomach into Agent Pool.
void DrugsAttack (EMedicalDrugsType drugType, float attackValue)
 Drugs attack calculation.
int GetAgents ()
 Reduce bitmask of currently active agents.
int GetSingleAgentCount (int agent_id)
 Number of agents of specified id.
int GetStorageVersion ()
float GetTemporaryResistance (int agentId)
 Returns remaining temporary resistance time for specified agent.
float GetTotalAgentCount ()
 Total number of agents active.
void GrowAgents (float deltaT)
 Agent's growth/death simulation.
void ImmuneSystemTick (float value, float deltaT)
 Agent pool simulation entry point.
bool OnStoreLoad (ParamsReadContext ctx, int version)
void OnStoreSave (ParamsWriteContext ctx)
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.
void RemoveAgent (int agent_id)
 Remove agent from Agent Pool.
void RemoveAllAgents ()
 Remove all agents from Agent Pool.
void SetAgentCount (int agent_id, float count)
 Directly set the count of agents for give id in pool.
void SetTemporaryResistance (int agentId, float time)
 Sets temporary resistance time against specified agent contraction.
void SpawnAgents (float deltaT)
 Autoinfection mechanism for agents with that attribute enabled.

Protected Attributes

ref map< int, floatm_AgentTemporaryResistance
PluginTransmissionAgents m_PluginTransmissionAgents = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents))

Private Member Functions

void GetDebugObject (array< ref Param > object_out)
void PrintAgents ()
void RemoteGrowRequestDebug (ParamsReadContext ctx)
void ResetTemporaryResistance ()
 Resets temporary resistance for all agents (internal usage only).

Private Attributes

int m_AgentMask
float m_LastTicked
PlayerBase m_Player
float m_TotalAgentCount
ref map< int, floatm_VirusPool
ref array< intm_VirusPoolArray = new array<int>()
 DEPRECATED.
const int STORAGE_VERSION = 137

Detailed Description

Keeps track of agents and their simulation.

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

Definition at line 8 of file playeragentpool.c.

Constructor & Destructor Documentation

◆ PlayerAgentPool()

void PlayerAgentPool ( PlayerBase player)
inlineprotected

Definition at line 23 of file playeragentpool.c.

References m_AgentTemporaryResistance, m_LastTicked, m_Player, and m_VirusPool.

Member Function Documentation

◆ AddAgent()

void AddAgent ( int agent_id,
float count )
inlineprotected

Add agent into Agent Pool.

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

Definition at line 187 of file playeragentpool.c.

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

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

◆ AntibioticsAttack()

void AntibioticsAttack ( float attack_value)
inlineprotected

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

Parameters
attack_valueStrength of the anitibiotics attack

Definition at line 323 of file playeragentpool.c.

References AntibioticsAttackEx().

◆ AntibioticsAttackEx()

void AntibioticsAttackEx ( float attack_value,
EMedicalDrugsType drugType )
inlineprotected

Definition at line 328 of file playeragentpool.c.

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

Referenced by AntibioticsAttack().

◆ DigestAgent()

void DigestAgent ( int agent_id,
float count )
inlineprotected

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

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

Definition at line 177 of file playeragentpool.c.

References AddAgent(), m_Player, and m_PluginTransmissionAgents.

◆ DrugsAttack()

void DrugsAttack ( EMedicalDrugsType drugType,
float attackValue )
inlineprotected

Drugs attack calculation.

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

Definition at line 346 of file playeragentpool.c.

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

◆ GetAgents()

int GetAgents ( )
inlineprotected

Reduce bitmask of currently active agents.

Definition at line 244 of file playeragentpool.c.

References m_AgentMask.

◆ GetDebugObject()

void GetDebugObject ( array< ref Param > object_out)
inlineprivate

◆ GetSingleAgentCount()

int GetSingleAgentCount ( int agent_id)
inlineprotected

Number of agents of specified id.

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

Definition at line 254 of file playeragentpool.c.

References m_VirusPool.

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

◆ GetStorageVersion()

int GetStorageVersion ( )
inlineprotected

Definition at line 32 of file playeragentpool.c.

References STORAGE_VERSION.

◆ GetTemporaryResistance()

float GetTemporaryResistance ( int agentId)
inlineprotected

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

Definition at line 375 of file playeragentpool.c.

References m_AgentTemporaryResistance.

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

◆ GetTotalAgentCount()

float GetTotalAgentCount ( )
inlineprotected

Total number of agents active.

Returns
Agents count

Definition at line 266 of file playeragentpool.c.

References m_VirusPool.

◆ GrowAgents()

void GrowAgents ( float deltaT)
inlineprotected

Agent's growth/death simulation.

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

Definition at line 55 of file playeragentpool.c.

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 )
inlineprotected

Agent pool simulation entry point.

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

Definition at line 42 of file playeragentpool.c.

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

◆ OnStoreLoad()

bool OnStoreLoad ( ParamsReadContext ctx,
int version )
inlineprotected

◆ OnStoreSave()

void OnStoreSave ( ParamsWriteContext ctx)
inlineprotected

◆ PrintAgents()

void PrintAgents ( )
inlineprivate

Definition at line 424 of file playeragentpool.c.

References Debug::Log(), and m_VirusPool.

◆ ProcessTemporaryResistance()

void ProcessTemporaryResistance ( float deltaTime)
inlineprotected

Temporary resistance simulation.

Definition at line 105 of file playeragentpool.c.

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

Referenced by ImmuneSystemTick().

◆ ReduceAgent()

void ReduceAgent ( int id,
float percent )
inlineprotected

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

Definition at line 231 of file playeragentpool.c.

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

◆ RemoteGrowRequestDebug()

void RemoteGrowRequestDebug ( ParamsReadContext ctx)
inlineprivate

◆ RemoveAgent()

void RemoveAgent ( int agent_id)
inlineprotected

Remove agent from Agent Pool.

Parameters
agent_idId of agent (see eAgents enum)

Definition at line 209 of file playeragentpool.c.

References SetAgentCount().

◆ RemoveAllAgents()

void RemoveAllAgents ( )
inlineprotected

Remove all agents from Agent Pool.

Parameters
agent_idId of agent (see eAgents enum)

Definition at line 218 of file playeragentpool.c.

References m_AgentMask, m_VirusPool, and ResetTemporaryResistance().

◆ ResetTemporaryResistance()

void ResetTemporaryResistance ( )
inlineprivate

Resets temporary resistance for all agents (internal usage only).

Definition at line 386 of file playeragentpool.c.

References m_AgentTemporaryResistance, and SetTemporaryResistance().

Referenced by RemoveAllAgents().

◆ SetAgentCount()

void SetAgentCount ( int agent_id,
float count )
inlineprotected

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

Definition at line 297 of file playeragentpool.c.

References m_AgentMask, m_Player, and m_VirusPool.

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

◆ SetTemporaryResistance()

void SetTemporaryResistance ( int agentId,
float time )
inlineprotected

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

Definition at line 365 of file playeragentpool.c.

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

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

◆ SpawnAgents()

void SpawnAgents ( float deltaT)
inlineprotected

Autoinfection mechanism for agents with that attribute enabled.

Parameters
deltaTtick

Definition at line 279 of file playeragentpool.c.

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

Definition at line 12 of file playeragentpool.c.

Referenced by GetAgents(), RemoveAllAgents(), and SetAgentCount().

◆ m_AgentTemporaryResistance

ref map<int, float> m_AgentTemporaryResistance
protected

◆ m_LastTicked

float m_LastTicked
private

Definition at line 13 of file playeragentpool.c.

Referenced by PlayerAgentPool().

◆ m_Player

◆ m_PluginTransmissionAgents

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

◆ m_TotalAgentCount

float m_TotalAgentCount
private

Definition at line 14 of file playeragentpool.c.

Referenced by GrowAgents().

◆ m_VirusPool

◆ m_VirusPoolArray

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

DEPRECATED.

Definition at line 437 of file playeragentpool.c.

◆ STORAGE_VERSION

const int STORAGE_VERSION = 137
private

Definition at line 10 of file playeragentpool.c.

Referenced by GetStorageVersion().


The documentation for this class was generated from the following file:
  • F:/Games/Dayz/scripts/4_world/classes/transmissionagents/playeragentpool/playeragentpool.c