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

7468 {
7469 if (Math.RandomFloat01() > chance)
7470 return;
7471
7473 float dist_check = distance * distance;//make it sq
7474 PluginTransmissionAgents plugin = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
7475
7476 foreach (Man target: m_ServerPlayers)
7477 {
7478 if (vector.DistanceSq(GetWorldPosition(), target.GetWorldPosition()) < dist_check && target != this)
7479 {
7480 plugin.TransmitAgents(this, target, AGT_AIRBOURNE_BIOLOGICAL, 1);
7481 }
7482 }
7483 }
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
Определения 3_Game/constants.c:503

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

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