DayZ 1.29
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 строка 533

534 {
535
536 //Debug.Log("protection: "+protection.ToString());
537 //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
538 float prot = 1 - protection;
539 //Debug.Log("prot: "+prot.ToString(), "Agents");
540 float transf;
541
542 if( inject_type == InjectTypes.PLAYER_TO_ITEM )
543 {
544 transf = GetAgentTransferabilityOut(agent_id);
545 }
546 else if( inject_type == InjectTypes.ITEM_TO_PLAYER )
547 {
548 transf = GetAgentTransferabilityIn(agent_id);
549 }
550 else if( inject_type == InjectTypes.PLAYER_AIR_PLAYER )
551 {
552 transf = GetAgentTransferabilityAirOut(agent_id);
553 }
554
555 //Debug.Log("transf: "+transf.ToString(), "Agents");
556 //float result = GetAgentInitialCount(agent_id) * prot * transf * dose_size;//final formula
557 float result = 1 * prot * transf * dose_size;//final formula
558 //result = Math.Ceil(result);
559 //Debug.Log("result: "+result.ToString(), "Agents");
560 return result;
561 }
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().

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