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

◆ TransmitAgentsEx()

float PluginBase::TransmitAgentsEx ( EntityAI source,
EntityAI target,
int pathway,
int dose_size = 1000,
int agents = 0 )
inlineprotected

Process transmission of agents between entities (for specified transmission type)

Аргументы
sourceEntity to transfer agents from
targetEntity to transfer agents to
pathwayType of transmission used
dose_sizeNumber of agents to be transmitted
agentsBit mask specifing agents to transmit
Возвращает
count Number of transmitted agents

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

305 {
306 //Debug.Log("Transmitting agents for source: " +source.ToString()+", target: " +target.ToString(),"Agents");
307 int sourceAgents = agents;
308 int targetAgents;
309 if(!sourceAgents && source) sourceAgents = source.GetAgents();//do not set sourceAgents again if already set
310 if(target) targetAgents = target.GetAgents();
311 int pollution = g_Game.GetMission().GetWorldData().GetPollution();
312
313 float count = 0;
314
315 switch (pathway)
316 {
317 case AGT_INV_OUT: //item leaving inventory
318 break;
319
320 case AGT_INV_IN: //item entering inventory
321 break;
322
323 case AGT_UACTION_TOUCH: //player touched the item
324 //InjectAgents( source, targetAgents ,GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.GLOVES, player) );
325 break;
326
327 case AGT_WATER_POND:
328 if (pollution & EPollution.HEAVYMETAL)
329 {
330 sourceAgents = sourceAgents | eAgents.HEAVYMETAL;
331 }
332 sourceAgents = sourceAgents | eAgents.CHOLERA;
333 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
334 break;
335
337 sourceAgents = sourceAgents | eAgents.FOOD_POISON | eAgents.HEAVYMETAL;
338 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
339 break;
340
341 case AGT_SNOW:
342 if (pollution & EPollution.HEAVYMETAL)
343 {
344 sourceAgents = sourceAgents | eAgents.HEAVYMETAL;
345 }
346 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
347 break;
348
350 //InjectAgentsWithPlayer( target, sourceAgents , 0, dose_size, InjectTypes.ITEM_TO_PLAYER );
351 InjectAgentsWithPlayer( source, targetAgents , 0, 1, InjectTypes.PLAYER_TO_ITEM );
352 break;
353
354 case AGT_UACTION_TO_PLAYER: //user action of a consumption, only from item to player
355 InjectAgentsWithPlayerCount( target, sourceAgents , 0, dose_size, InjectTypes.ITEM_TO_PLAYER );
356 break;
357
358 case AGT_UACTION_TO_ITEM: //to transfer from the player to the consumed item
359 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.PLAYER_TO_ITEM );
360 break;
361
362 case AGT_TRANSFER_COPY: //transferring liquid
363 InjectAgentsWithoutPlayer( target, sourceAgents );
364 break;
365
366 case AGT_ITEM_TO_FLESH: //transferring liquid
367 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER);
368 break;
369
371 float prot_level_mask_target = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.MASK, Man.Cast( target ));
372 float prot_level_mask_source = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.MASK, Man.Cast( source ));
373 float prot_level_headgear_target = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.HEADGEAR, Man.Cast( target ));
374 float prot_level_headgear_source = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.HEADGEAR, Man.Cast( source ));
375 float prot_level_target = Math.Max(prot_level_mask_target, prot_level_headgear_target);//find the bigger of the 2, TODO: should be improved
376 float prot_level_source = Math.Max(prot_level_mask_source, prot_level_headgear_source);//find the bigger of the 2, TODO: should be improved
377 float prot_level_combined = 1 - (1 - prot_level_target) * (1 - prot_level_source);
378 InjectAgentsWithPlayer( target, sourceAgents , prot_level_combined, 1, InjectTypes.PLAYER_AIR_PLAYER );
379 break;
381 float prot_level_mask_target2 = GetProtectionLevel(DEF_CHEMICAL,InventorySlots.MASK, Man.Cast( target ));
382
383 count = InjectAgentWithPlayerDose( target, agents , prot_level_mask_target2, dose_size, InjectTypes.PLAYER_AIR_PLAYER );
384 break;
385 default:
386 break;
387 }
388 return count;
389 }
DayZGame g_Game
Определения DayZGame.c:3942
eAgents
Определения EAgents.c:3
InjectTypes
Определения PluginTransmissionAgents.c:2
float InjectAgentWithPlayerDose(EntityAI target, int agent, float protection, float dose_size, int inject_type)
Injects agent to a given target.
Определения PluginTransmissionAgents.c:470
void InjectAgentsWithPlayer(EntityAI target, int agents, float protection, int dose_size, int inject_type)
Injects agents to a given target, using chance of transmission and full dose size if chance succeeds.
Определения PluginTransmissionAgents.c:421
void InjectAgentsWithPlayerCount(EntityAI target, int agents, float protection, int dose_size, int inject_type)
Injects agents to a given target, with no probability, but the dose size is modified by m_Transferabi...
Определения PluginTransmissionAgents.c:446
void InjectAgentsWithoutPlayer(EntityAI target, int agents)
Injects specified agents directly to target.
Определения PluginTransmissionAgents.c:404
float GetProtectionLevel(int type, int slot, Man player)
Protection level of an attachment against enviromental hazard (mask/filters for example) (see GetProt...
Определения PluginTransmissionAgents.c:518
const int AGT_UACTION_CONSUME
Определения 3_Game/DayZ/constants.c:502
const int AGT_ITEM_TO_FLESH
Определения 3_Game/DayZ/constants.c:509
const int AGT_UACTION_TOUCH
Определения 3_Game/DayZ/constants.c:504
const int DEF_BIOLOGICAL
Определения 3_Game/DayZ/constants.c:515
const int DEF_CHEMICAL
Определения 3_Game/DayZ/constants.c:516
const int AGT_AIRBOURNE_BIOLOGICAL
Определения 3_Game/DayZ/constants.c:506
const int AGT_TRANSFER_COPY
Определения 3_Game/DayZ/constants.c:503
const int AGT_WATER_HOT_SPRING
Определения 3_Game/DayZ/constants.c:513
const int AGT_WATER_POND
Определения 3_Game/DayZ/constants.c:505
const int AGT_INV_OUT
Определения 3_Game/DayZ/constants.c:501
const int AGT_UACTION_TO_PLAYER
Определения 3_Game/DayZ/constants.c:507
const int AGT_AIRBOURNE_CHEMICAL
Определения 3_Game/DayZ/constants.c:510
const int AGT_UACTION_TO_ITEM
Определения 3_Game/DayZ/constants.c:508
const int AGT_SNOW
Определения 3_Game/DayZ/constants.c:511
const int AGT_INV_IN
Определения 3_Game/DayZ/constants.c:500

Перекрестные ссылки AGT_AIRBOURNE_BIOLOGICAL, AGT_AIRBOURNE_CHEMICAL, AGT_INV_IN, AGT_INV_OUT, AGT_ITEM_TO_FLESH, AGT_SNOW, AGT_TRANSFER_COPY, AGT_UACTION_CONSUME, AGT_UACTION_TO_ITEM, AGT_UACTION_TO_PLAYER, AGT_UACTION_TOUCH, AGT_WATER_HOT_SPRING, AGT_WATER_POND, DEF_BIOLOGICAL, DEF_CHEMICAL, g_Game, GetProtectionLevel(), InjectAgentsWithoutPlayer(), InjectAgentsWithPlayer(), InjectAgentsWithPlayerCount(), InjectAgentWithPlayerDose() и Math::Max().

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