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

555 {
556
557 //Debug.Log("protection: "+protection.ToString());
558 //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
559 float prot = 1 - protection;
560 //Debug.Log("prot: "+prot.ToString(), "Agents");
561 float transf;
562
563 if( inject_type == InjectTypes.PLAYER_TO_ITEM )
564 {
565 transf = GetAgentTransferabilityOut(agent_id);
566 }
567 else if( inject_type == InjectTypes.ITEM_TO_PLAYER )
568 {
569 transf = GetAgentTransferabilityIn(agent_id);
570 }
571 else if( inject_type == InjectTypes.PLAYER_AIR_PLAYER )
572 {
573 transf = GetAgentTransferabilityAirOut(agent_id);
574 }
575 #ifdef DEVELOPER
576 //Debug.Log("transf: "+transf.ToString(), "Agents");
577 #endif
578 //float result = GetAgentInitialCount(agent_id) * prot * transf * dose_size;//final formula
579 bool dice = Math.RandomFloat01() < (prot * transf);
580 //result = Math.Ceil(result);
581
582 return dice;
583 }
InjectTypes
Определения PluginTransmissionAgents.c:2
float GetAgentTransferabilityAirOut(int agent_id)
Returns transferabilitAiryOut attribute for given agent.
Определения PluginTransmissionAgents.c:225
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:214

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

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