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

◆ DetermineChanceToTransmit()

bool PluginBase::DetermineChanceToTransmit ( int agent_id,
float protection,
int inject_type )
inlineprotected

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

413 {
414
415 //Debug.Log("protection: "+protection.ToString());
416 float prot = 1 - protection; //reverse the value (in config, the higher the value, the higher the protection: 0 - 1) so that we can easily interpolate between 0 and 1 by multiplication
417 //Debug.Log("prot: "+prot.ToString(), "Agents");
418 float transf;
419
420 if( inject_type == InjectTypes.PLAYER_TO_ITEM )
421 {
422 transf = GetAgentTransferabilityOut(agent_id);
423 }
424 else if( inject_type == InjectTypes.ITEM_TO_PLAYER )
425 {
426 transf = GetAgentTransferabilityIn(agent_id);
427 }
428 else if( inject_type == InjectTypes.PLAYER_AIR_PLAYER )
429 {
430 transf = GetAgentTransferabilityAirOut(agent_id);
431 }
432 #ifdef DEVELOPER
433 //Debug.Log("transf: "+transf.ToString(), "Agents");
434 #endif
435 //float result = GetAgentInitialCount(agent_id) * prot * transf * dose_size;//final formula
436 bool dice = Math.RandomFloat01() < (prot * transf);
437 //result = Math.Ceil(result);
438
439 return dice;
440 }
InjectTypes
Определения PluginTransmissionAgents.c:2
float GetAgentTransferabilityAirOut(int agent_id)
Определения PluginTransmissionAgents.c:134
float GetAgentTransferabilityIn(int agent_id)
Определения PluginTransmissionAgents.c:79
float GetAgentTransferabilityOut(int agent_id)
Определения PluginTransmissionAgents.c:128

Перекрестные ссылки GetAgentTransferabilityAirOut(), GetAgentTransferabilityIn(), GetAgentTransferabilityOut() и Math::RandomFloat01().

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