13class PluginTransmissionAgents
extends PluginBase
100 target.RemoveAllAgents();
110 target.RemoveAgent(agent_id);
121 return m_AgentList.Get(agent_id).GetTransferabilityIn();
153 return m_AgentList.Get(agent_id).GetDieOffSpeedEx(player);
176 return m_AgentList.Get(agent_id).GetPotencyEx(player);
189 return m_AgentList.Get(agent_id).GetInvasibilityEx(player);
199 return m_AgentList.Get(agent_id).GetDrugResistance(drugType, player);
210 return m_AgentList.Get(agent_id).GetAntiboticsResistance();
223 return m_AgentList.Get(agent_id).GetAntibioticsResistanceEx(player);
235 return m_AgentList.Get(agent_id).GetTransferabilityOut();
247 return m_AgentList.Get(agent_id).GetTransferabilityAirOut();
259 return m_AgentList.Get(agent_id).GetInvasibility();
269 return m_AgentList.Get(agent_id).GetDigestibility();
282 return m_AgentList.Get(agent_id).GetDigestibilityEx(player);
309 int sourceAgents = agents;
312 if (!sourceAgents && source)
313 sourceAgents = source.GetAgents();
316 targetAgents = target.GetAgents();
318 int pollution =
g_Game.GetMission().GetWorldData().GetPollution();
335 if (pollution & EPollution.HEAVYMETAL)
337 sourceAgents = sourceAgents |
eAgents.HEAVYMETAL;
339 sourceAgents = sourceAgents |
eAgents.CHOLERA;
344 sourceAgents = sourceAgents |
eAgents.FOOD_POISON |
eAgents.HEAVYMETAL;
349 if (pollution & EPollution.HEAVYMETAL)
351 sourceAgents = sourceAgents |
eAgents.HEAVYMETAL;
378 Man manTarget = Man.Cast(target);
379 Man manSource = Man.Cast(source);
400 float targetProtection =
Math.
Max(targetMaskProtection, targetHeadgearProtection);
401 float sourceProtection =
Math.
Max(sourceMaskProtection, sourceHeadgearProtection);
402 float combinedProtection = 1 - (1 - targetProtection) * (1 - sourceProtection);
415 switch (sourceAgents)
417 float protectionLevel = 0.0;
418 Man man = Man.Cast(target);
459 if( target.IsItemBase() )
462 ib_target.TransferAgents(agents);
476 if(target && (agents != 0) && target.IsEntityAI() )
480 for (
int i = 0; i < bit_count; i++)
485 target.InsertAgent(agent_bit,dose_size);
501 if(target && (agents != 0) && target.IsEntityAI() )
505 for (
int i = 0; i < bit_count; i++)
509 target.InsertAgent(agent_bit,count);
529 target.InsertAgent(agent, count);
543 agents_out.Insert(mask);
559 ItemBase attachment =
ItemBase.Cast(player.GetInventory().FindAttachment(slot));
564 return attachment.GetProtectionLevel(type, consider_filter, system);
580 query.
m_Category = cachedEquipmentStorageMask;
584 float protectionLevel = 0.0;
585 array<Entity> attachments = player.GetCachedEquipment().GetEntitiesByCategory(query);
586 foreach (
Entity attachmentEntity : attachments)
589 protectionLevel += attachment.GetProtectionLevel(type);
592 return protectionLevel;
619 float prot = 1 - protection;
627 else if( inject_type ==
InjectTypes.ITEM_TO_PLAYER )
631 else if( inject_type ==
InjectTypes.PLAYER_AIR_PLAYER )
638 float result = 1 * prot * transf * dose_size;
657 float prot = 1 - protection;
665 else if( inject_type ==
InjectTypes.ITEM_TO_PLAYER )
669 else if( inject_type ==
InjectTypes.PLAYER_AIR_PLAYER )
685 [
Obsolete(
"replaced by GrowDuringMedicalDrugsAttack")]
ECachedEquipmentItemCategory
ECachedEquipmentPlacement
bool GrowDuringMedicalDrugsAttack(EMedicalDrugsType drugType, PlayerBase player)
should this agent grow based on invasibility even during usage of specific medical drugs attack
ECachedEquipmentItemCategory m_Category
ECachedEquipmentPlacement m_Placement
float InjectAgentWithPlayerDose(EntityAI target, int agent, float protection, float dose_size, int inject_type)
Injects agent to a given target.
bool GrowDuringMedicalDrugsAttack(int agentId, EMedicalDrugsType drugType, PlayerBase player)
static int GetAgentMaxCount(int agent_id)
Returns max count attribute for given agent.
void RemoveAllAgents(EntityAI target)
Removes all agents from given entity.
static float GetProtectionLevelEx(int type, int slot, Man player, bool consider_filter=true, int system=0)
Protection level of an attachment against enviromental hazard (mask/filters for example)
int GetAgentSpecificDrugResistance(int agent_id, EMedicalDrugsType drugType, PlayerBase player)
map< int, string > GetSimpleAgentList()
Returns map of all registered agents in simplified format(for non-gameplay purposas mainly)
float GetAgentInvasibilityEx(int agent_id, PlayerBase player)
Returns invasibility attribute for given agent.
float CalculateAgentsToTransmit(int agent_id, float protection, int dose_size, int inject_type)
Calculates number of agents that can be transmitted (based on given dose_size)
void ConstructSimpleAgentList()
Builds simplified list of agents in <id, name> format.
static float GetProtectionLevelCachedEquipment(int type, int cachedEquipmentStorageMask, Man player)
Protection level of an attachment against enviromental hazard (mask/filters for example) based on res...
bool DetermineChanceToTransmit(int agent_id, float protection, int inject_type)
Agent transmission chance processing.
void TransmitAgents(EntityAI source, EntityAI target, int pathway, int dose_size=1000)
Process transmission of agents between entities (for specified transmission type) (see TransmitAgents...
float GetAgentDigestibility(int agent_id)
Returns stomach digetibility attribute for given agent (see GetAgentDigestibilityEx())
float GetDieOffSpeed(int agent_id)
Returns dieOfSpeed attribute for given agent (see GetDieOffSpeedEx())
static void RemoveAgent(EntityAI target, int agent_id)
Removes given agent from given entity.
void InjectAgentsWithPlayer(EntityAI target, int agents, float protection, int dose_size, int inject_type)
Injects agents to a given target, using chance of transmission and full dose size if chance succeeds.
static ref map< int, ref AgentBase > m_AgentList
float GetAgentTransferabilityAirOut(int agent_id)
Returns transferabilitAiryOut attribute for given agent.
float GetAgentInvasibility(int agent_id)
Returns invasibility attribute for given agent.
EStatLevels GetPotency(int agent_id)
Returns potency attribute for given agent (see GetAgentPotencyEx())
void InjectAgentsWithPlayerCount(EntityAI target, int agents, float protection, int dose_size, int inject_type)
Injects agents to a given target, with no probability, but the dose size is modified by m_Transferabi...
void InjectAgentsWithoutPlayer(EntityAI target, int agents)
Injects specified agents directly to target.
float GetAgentDieOffSpeedEx(int agent_id, PlayerBase player)
Returns dieOfSpeed attribute for given agent.
bool m_IsConstructed
simple <eAgents, agentName> pair
float GetProtectionLevel(int type, int slot, Man player)
Protection level of an attachment against enviromental hazard (mask/filters for example) (see GetProt...
float GetAgentDigestibilityEx(int agent_id, PlayerBase player)
Returns stomach digetibility attribute for given agent.
bool GrowDuringAntibioticsAttack(int agent_id, PlayerBase player)
static void BuildAgentArray(int agents, array< int > agents_out)
void RegisterAgent(AgentBase agent)
Registers new agent into system.
map< int, ref AgentBase > GetAgentList()
Returns map of all registered agent classes.
float GetAgentAntiboticsResistanceEx(int agent_id, PlayerBase player)
Returns antibiotics resistance attribute for given agent.
float TransmitAgentsEx(EntityAI source, EntityAI target, int pathway, int dose_size=1000, int agents=0)
Process transmission of agents between entities (for specified transmission type)
float GetAgentAntiboticsResistance(int agent_id)
Returns antibiotics resistance attribute for given agent see GetAgentAntiboticsResistanceEx()
EStatLevels GetAgentPotencyEx(int agent_id, PlayerBase player)
Returns potency attribute for given agent.
void PluginTransmissionAgents()
static string GetNameByID(int agent_id)
Returns agent's name from given id.
float GetAgentTransferabilityIn(int agent_id)
Returns transferabilityIn attribute for given agent.
ref map< int, string > m_SimpleAgentList
float GetAgentTransferabilityOut(int agent_id)
Returns transferabilityOut attribute for given agent.
Plugin interface for controlling of agent pool system.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
const int AGT_UACTION_CONSUME
const int DEF_DUST_PARTICLE_BREATH
const int AGT_ITEM_TO_FLESH
const int AGT_UACTION_TOUCH
const int AGT_AIRBOURNE_BIOLOGICAL
const int DEF_DUST_PARTICLE_EYES
const int AGT_TRANSFER_COPY
const int AGT_WATER_HOT_SPRING
const int AGT_UACTION_TO_PLAYER
const int AGT_AIRBOURNE_CHEMICAL
const int AGT_UACTION_TO_ITEM
const int AGT_AIRBOURNE_SOLID
void Obsolete(string msg="")
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto int GetNthBitSet(int value, int n)
returns the the index of n-th bit set in a bit mask counting from the right, for instance,...
static proto float Pow(float v, float power)
Return power of v ^ power.
static proto int GetNumberOfSetBits(int i)
returns the number of bits set in a bitmask i