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

◆ CalculateAgentsToTransmit()

float PluginBase::CalculateAgentsToTransmit ( int agent_id,
float protection,
int dose_size,
int inject_type )
inlineprotected

Calculates number of agents that can be transmitted (based on given dose_size)

Аргументы
agent_idId of agent (see eAgents enum)
protectionProtection size used for chance generation <0.0; 1.0>
dose_sizeNumber of agents to be transmitted
inject_typeType of transmission
Возвращает
Number of agents that will be transmitted based on the processing of attributes

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

615 {
616
617 //Debug.Log("protection: "+protection.ToString());
618 //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
619 float prot = 1 - protection;
620 //Debug.Log("prot: "+prot.ToString(), "Agents");
621 float transf;
622
623 if( inject_type == InjectTypes.PLAYER_TO_ITEM )
624 {
625 transf = GetAgentTransferabilityOut(agent_id);
626 }
627 else if( inject_type == InjectTypes.ITEM_TO_PLAYER )
628 {
629 transf = GetAgentTransferabilityIn(agent_id);
630 }
631 else if( inject_type == InjectTypes.PLAYER_AIR_PLAYER )
632 {
633 transf = GetAgentTransferabilityAirOut(agent_id);
634 }
635
636 //Debug.Log("transf: "+transf.ToString(), "Agents");
637 //float result = GetAgentInitialCount(agent_id) * prot * transf * dose_size;//final formula
638 float result = 1 * prot * transf * dose_size;//final formula
639 //result = Math.Ceil(result);
640 //Debug.Log("result: "+result.ToString(), "Agents");
641 return result;
642 }
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().

Используется в InjectAgentsWithPlayerCount() и InjectAgentWithPlayerDose().