DayZ 1.28
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 строка 404

405 {
406 if(target && (agents != 0) && target.IsEntityAI() )
407 {
408 int bit_count = Math.GetNumberOfSetBits(agents);
409
410 for (int i = 0; i < bit_count; i++)
411 {
412 int agent_bit = Math.Pow(2,Math.GetNthBitSet(agents,i));
413 if( DetermineChanceToTransmit(agent_bit, protection, inject_type))
414 {
415 target.InsertAgent(agent_bit,dose_size);
416 }
417 }
418 }
419 }
bool DetermineChanceToTransmit(int agent_id, float protection, int inject_type)
Agent transmission chance processing.
Определения PluginTransmissionAgents.c:554

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

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