8class PluginTransmissionAgents
extends PluginBase
69 target.RemoveAllAgents();
74 target.RemoveAgent( agent_id );
82 return m_AgentList.Get(agent_id).GetTransferabilityIn();
97 return m_AgentList.Get(agent_id).GetDieOffSpeedEx(player);
103 return m_AgentList.Get(agent_id).GetPotencyEx(player);
109 return m_AgentList.Get(agent_id).GetInvasibilityEx(player);
118 return m_AgentList.Get(agent_id).GetAntiboticsResistance();
125 return m_AgentList.Get(agent_id).GetAntibioticsResistanceEx(player);
131 return m_AgentList.Get(agent_id).GetTransferabilityOut();
137 return m_AgentList.Get(agent_id).GetTransferabilityAirOut();
149 return m_AgentList.Get(agent_id).GetInvasibility();
157 return m_AgentList.Get(agent_id).GetDigestibilityEx(player);
164 return m_AgentList.Get(agent_id).GetDigestibility();
204 int sourceAgents = agents;
206 if(!sourceAgents && source) sourceAgents = source.GetAgents();
207 if(target) targetAgents = target.GetAgents();
225 if (pollution & EPollution.HEAVYMETAL)
227 sourceAgents = sourceAgents |
eAgents.HEAVYMETAL;
229 sourceAgents = sourceAgents |
eAgents.CHOLERA;
234 sourceAgents = sourceAgents |
eAgents.FOOD_POISON |
eAgents.HEAVYMETAL;
239 if (pollution & EPollution.HEAVYMETAL)
241 sourceAgents = sourceAgents |
eAgents.HEAVYMETAL;
272 float prot_level_target =
Math.
Max(prot_level_mask_target, prot_level_headgear_target);
273 float prot_level_source =
Math.
Max(prot_level_mask_source, prot_level_headgear_source);
274 float prot_level_combined = 1 - (1 - prot_level_target) * (1 - prot_level_source);
296 if( target.IsItemBase() )
299 ib_target.TransferAgents(agents);
306 if(target && (agents != 0) && target.IsEntityAI() )
310 for (
int i = 0; i < bit_count; i++)
315 target.InsertAgent(agent_bit,dose_size);
324 if(target && (agents != 0) && target.IsEntityAI() )
328 for (
int i = 0; i < bit_count; i++)
332 target.InsertAgent(agent_bit,count);
344 target.InsertAgent(agent, count);
358 agents_out.Insert(mask);
366 ItemBase attachment =
ItemBase.Cast(player.GetInventory().FindAttachment(slot));
371 return attachment.GetProtectionLevel(type, consider_filter, system);
386 float prot = 1 - protection;
394 else if( inject_type ==
InjectTypes.ITEM_TO_PLAYER )
398 else if( inject_type ==
InjectTypes.PLAYER_AIR_PLAYER )
405 float result = 1 * prot * transf * dose_size;
416 float prot = 1 - protection;
424 else if( inject_type ==
InjectTypes.ITEM_TO_PLAYER )
428 else if( inject_type ==
InjectTypes.PLAYER_AIR_PLAYER )
bool GrowDuringMedicalDrugsAttack(EMedicalDrugsType drugType, PlayerBase player)
should this agent grow based on invasibility even during usage of specific medical drugs attack
proto native Mission GetMission()
provides access to slot configuration
float InjectAgentWithPlayerDose(EntityAI target, int agent, float protection, float dose_size, int inject_type)
will add agent to a given target
bool GrowDuringMedicalDrugsAttack(int agentId, EMedicalDrugsType drugType, PlayerBase player)
static int GetAgentMaxCount(int agent_id)
void RemoveAllAgents(EntityAI target)
static float GetProtectionLevelEx(int type, int slot, Man player, bool consider_filter=true, int system=0)
map< int, string > GetSimpleAgentList()
float GetAgentInvasibilityEx(int agent_id, PlayerBase player)
float CalculateAgentsToTransmit(int agent_id, float protection, int dose_size, int inject_type)
void ConstructSimpleAgentList()
bool DetermineChanceToTransmit(int agent_id, float protection, int inject_type)
void TransmitAgents(EntityAI source, EntityAI target, int pathway, int dose_size=1000)
float GetAgentDigestibility(int agent_id)
float GetDieOffSpeed(int agent_id)
static void RemoveAgent(EntityAI target, int agent_id)
void InjectAgentsWithPlayer(EntityAI target, int agents, float protection, int dose_size, int inject_type)
will add 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)
float GetAgentInvasibility(int agent_id)
EStatLevels GetPotency(int agent_id)
void InjectAgentsWithPlayerCount(EntityAI target, int agents, float protection, int dose_size, int inject_type)
will add agents to a given target, with no probability, but the dose size is modified by m_Transferab...
void InjectAgentsWithoutPlayer(EntityAI target, int agents)
float GetAgentDieOffSpeedEx(int agent_id, PlayerBase player)
float GetProtectionLevel(int type, int slot, Man player)
float GetAgentDigestibilityEx(int agent_id, PlayerBase player)
bool GrowDuringAntibioticsAttack(int agent_id, PlayerBase player)
DEPRECATED.
static void BuildAgentArray(int agents, array< int > agents_out)
void RegisterAgent(AgentBase agent)
map< int, ref AgentBase > GetAgentList()
float GetAgentAntiboticsResistanceEx(int agent_id, PlayerBase player)
float TransmitAgentsEx(EntityAI source, EntityAI target, int pathway, int dose_size=1000, int agents=0)
float GetAgentAntiboticsResistance(int agent_id)
EStatLevels GetAgentPotencyEx(int agent_id, PlayerBase player)
void PluginTransmissionAgents()
static string GetNameByID(int agent_id)
float GetAgentTransferabilityIn(int agent_id)
ref map< int, string > m_SimpleAgentList
float GetAgentTransferabilityOut(int agent_id)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
const int AGT_UACTION_CONSUME
const int AGT_ITEM_TO_FLESH
const int AGT_UACTION_TOUCH
const int AGT_AIRBOURNE_BIOLOGICAL
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
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