DayZ 1.30
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 строка 652

653 {
654
655 //Debug.Log("protection: "+protection.ToString());
656 //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
657 float prot = 1 - protection;
658 //Debug.Log("prot: "+prot.ToString(), "Agents");
659 float transf;
660
661 if( inject_type == InjectTypes.PLAYER_TO_ITEM )
662 {
663 transf = GetAgentTransferabilityOut(agent_id);
664 }
665 else if( inject_type == InjectTypes.ITEM_TO_PLAYER )
666 {
667 transf = GetAgentTransferabilityIn(agent_id);
668 }
669 else if( inject_type == InjectTypes.PLAYER_AIR_PLAYER )
670 {
671 transf = GetAgentTransferabilityAirOut(agent_id);
672 }
673 #ifdef DEVELOPER
674 //Debug.Log("transf: "+transf.ToString(), "Agents");
675 #endif
676 //float result = GetAgentInitialCount(agent_id) * prot * transf * dose_size;//final formula
677 bool dice = Math.RandomFloat01() < (prot * transf);
678 //result = Math.Ceil(result);
679
680 return dice;
681 }
InjectTypes
Определения PluginTransmissionAgents.c:2
float GetAgentTransferabilityAirOut(int agent_id)
Returns transferabilitAiryOut attribute for given agent.
Определения PluginTransmissionAgents.c:243
float GetAgentTransferabilityIn(int agent_id)
Returns transferabilityIn attribute for given agent.
Определения PluginTransmissionAgents.c:118
float GetAgentTransferabilityOut(int agent_id)
Returns transferabilityOut attribute for given agent.
Определения PluginTransmissionAgents.c:231

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

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