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

◆ InjectAgentsWithPlayerCount()

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

Injects agents to a given target, with no probability, but the dose size is modified by m_TransferabilityOut of the agent.

Аргументы
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 строка 429

430 {
431 if(target && (agents != 0) && target.IsEntityAI() )
432 {
433 int bit_count = Math.GetNumberOfSetBits(agents);
434
435 for (int i = 0; i < bit_count; i++)
436 {
437 int agent_bit = Math.Pow(2,Math.GetNthBitSet(agents,i));
438 float count = CalculateAgentsToTransmit(agent_bit, protection, dose_size, inject_type);
439 target.InsertAgent(agent_bit,count);
440 }
441 }
442 }
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)
Определения PluginTransmissionAgents.c:516

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

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