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

517 {
518
519 //Debug.Log("protection: "+protection.ToString());
520 //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
521 float prot = 1 - protection;
522 //Debug.Log("prot: "+prot.ToString(), "Agents");
523 float transf;
524
525 if( inject_type == InjectTypes.PLAYER_TO_ITEM )
526 {
527 transf = GetAgentTransferabilityOut(agent_id);
528 }
529 else if( inject_type == InjectTypes.ITEM_TO_PLAYER )
530 {
531 transf = GetAgentTransferabilityIn(agent_id);
532 }
533 else if( inject_type == InjectTypes.PLAYER_AIR_PLAYER )
534 {
535 transf = GetAgentTransferabilityAirOut(agent_id);
536 }
537
538 //Debug.Log("transf: "+transf.ToString(), "Agents");
539 //float result = GetAgentInitialCount(agent_id) * prot * transf * dose_size;//final formula
540 float result = 1 * prot * transf * dose_size;//final formula
541 //result = Math.Ceil(result);
542 //Debug.Log("result: "+result.ToString(), "Agents");
543 return result;
544 }
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().

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