DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ InjectAgentsWithPlayer()

void PluginBase::InjectAgentsWithPlayer ( EntityAI target,
int agents,
float protection,
int dose_size,
int inject_type )
inlineprotected

Injects agents to a given target, using chance of transmission and full dose size if chance succeeds.

Аргументы
targetEntity to inject agents to
agentsBit mask with information about agents
protectionProtection size used for chance generation <0.0; 1.0>
dose_sizeNumber of agents to be transmitted
inject_typeType of transmission

См. определение в файле PluginTransmissionAgents.c строка 474

475 {
476 if(target && (agents != 0) && target.IsEntityAI() )
477 {
478 int bit_count = Math.GetNumberOfSetBits(agents);
479
480 for (int i = 0; i < bit_count; i++)
481 {
482 int agent_bit = Math.Pow(2,Math.GetNthBitSet(agents,i));
483 if( DetermineChanceToTransmit(agent_bit, protection, inject_type))
484 {
485 target.InsertAgent(agent_bit,dose_size);
486 }
487 }
488 }
489 }
bool DetermineChanceToTransmit(int agent_id, float protection, int inject_type)
Agent transmission chance processing.
Определения PluginTransmissionAgents.c:652

Перекрестные ссылки DetermineChanceToTransmit(), Math::GetNthBitSet(), Math::GetNumberOfSetBits() и Math::Pow().

Используется в TransmitAgentsEx().