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

◆ SpreadAgentsEx()

void ManBase::SpreadAgentsEx ( float distance = 3,
float chance = 0.25 )
inlineprotected

chance between [0..1] , distance in meters

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

7476 {
7477 if (Math.RandomFloat01() > chance)
7478 return;
7479
7481 float dist_check = distance * distance;//make it sq
7482 PluginTransmissionAgents plugin = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
7483
7484 foreach (Man target: m_ServerPlayers)
7485 {
7486 if (vector.DistanceSq(GetWorldPosition(), target.GetWorldPosition()) < dist_check && target != this)
7487 {
7488 plugin.TransmitAgents(this, target, AGT_AIRBOURNE_BIOLOGICAL, 1);
7489 }
7490 }
7491 }
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:316
proto native void GetPlayers(out array< Man > players)
static ref array< Man > m_ServerPlayers
Определения PlayerBase.c:172
proto native CGame GetGame()
const int AGT_AIRBOURNE_BIOLOGICAL
Определения constants.c:501

Перекрестные ссылки AGT_AIRBOURNE_BIOLOGICAL, vector::DistanceSq(), GetGame(), CGame::GetPlayers(), GetPlugin(), m_ServerPlayers и Math::RandomFloat01().

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