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

◆ DetermineChanceToTransmit()

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

Agent transmission chance processing.

Аргументы
agent_idId of agent (see eAgents enum)
protectionProtection size used for chance generation <0.0; 1.0>
inject_typeType of transmission
Возвращает
true if there is a chance to transmit agent

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

572 {
573
574 //Debug.Log("protection: "+protection.ToString());
575 //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
576 float prot = 1 - protection;
577 //Debug.Log("prot: "+prot.ToString(), "Agents");
578 float transf;
579
580 if( inject_type == InjectTypes.PLAYER_TO_ITEM )
581 {
582 transf = GetAgentTransferabilityOut(agent_id);
583 }
584 else if( inject_type == InjectTypes.ITEM_TO_PLAYER )
585 {
586 transf = GetAgentTransferabilityIn(agent_id);
587 }
588 else if( inject_type == InjectTypes.PLAYER_AIR_PLAYER )
589 {
590 transf = GetAgentTransferabilityAirOut(agent_id);
591 }
592 #ifdef DEVELOPER
593 //Debug.Log("transf: "+transf.ToString(), "Agents");
594 #endif
595 //float result = GetAgentInitialCount(agent_id) * prot * transf * dose_size;//final formula
596 bool dice = Math.RandomFloat01() < (prot * transf);
597 //result = Math.Ceil(result);
598
599 return dice;
600 }
InjectTypes
Определения PluginTransmissionAgents.c:2
float GetAgentTransferabilityAirOut(int agent_id)
Returns transferabilitAiryOut attribute for given agent.
Определения PluginTransmissionAgents.c:241
float GetAgentTransferabilityIn(int agent_id)
Returns transferabilityIn attribute for given agent.
Определения PluginTransmissionAgents.c:116
float GetAgentTransferabilityOut(int agent_id)
Returns transferabilityOut attribute for given agent.
Определения PluginTransmissionAgents.c:229

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

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