DayZ 1.30
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 строка 306

307 {
308 //Debug.Log("Transmitting agents for source: " +source.ToString()+", target: " +target.ToString(),"Agents");
309 int sourceAgents = agents;
310 int targetAgents;
311
312 if (!sourceAgents && source)
313 sourceAgents = source.GetAgents();//do not set sourceAgents again if already set
314
315 if (target)
316 targetAgents = target.GetAgents();
317
318 int pollution = g_Game.GetMission().GetWorldData().GetPollution();
319
320 float count = 0;
321
322 switch (pathway)
323 {
324 case AGT_INV_OUT: //item leaving inventory
325 break;
326
327 case AGT_INV_IN: //item entering inventory
328 break;
329
330 case AGT_UACTION_TOUCH: //player touched the item
331 //InjectAgents( source, targetAgents ,GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.GLOVES, player) );
332 break;
333
334 case AGT_WATER_POND:
335 if (pollution & EPollution.HEAVYMETAL)
336 {
337 sourceAgents = sourceAgents | eAgents.HEAVYMETAL;
338 }
339 sourceAgents = sourceAgents | eAgents.CHOLERA;
340 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
341 break;
342
344 sourceAgents = sourceAgents | eAgents.FOOD_POISON | eAgents.HEAVYMETAL;
345 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
346 break;
347
348 case AGT_SNOW:
349 if (pollution & EPollution.HEAVYMETAL)
350 {
351 sourceAgents = sourceAgents | eAgents.HEAVYMETAL;
352 }
353 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
354 break;
355
357 //InjectAgentsWithPlayer( target, sourceAgents , 0, dose_size, InjectTypes.ITEM_TO_PLAYER );
358 InjectAgentsWithPlayer( source, targetAgents , 0, 1, InjectTypes.PLAYER_TO_ITEM );
359 break;
360
361 case AGT_UACTION_TO_PLAYER: //user action of a consumption, only from item to player
362 InjectAgentsWithPlayerCount( target, sourceAgents , 0, dose_size, InjectTypes.ITEM_TO_PLAYER );
363 break;
364
365 case AGT_UACTION_TO_ITEM: //to transfer from the player to the consumed item
366 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.PLAYER_TO_ITEM );
367 break;
368
369 case AGT_TRANSFER_COPY: //transferring liquid
370 InjectAgentsWithoutPlayer( target, sourceAgents );
371 break;
372
373 case AGT_ITEM_TO_FLESH: //transferring liquid
374 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER);
375 break;
376
378 Man manTarget = Man.Cast(target);
379 Man manSource = Man.Cast(source);
380 float targetMaskProtection = GetProtectionLevelCachedEquipment(
383 manTarget,
384 );
385 float sourceMaskProtection = GetProtectionLevelCachedEquipment(
388 manSource,
389 );
390 float targetHeadgearProtection = GetProtectionLevelCachedEquipment(
393 manTarget,
394 );
395 float sourceHeadgearProtection = GetProtectionLevelCachedEquipment(
398 manSource,
399 );
400 float targetProtection = Math.Max(targetMaskProtection, targetHeadgearProtection);
401 float sourceProtection = Math.Max(sourceMaskProtection, sourceHeadgearProtection);
402 float combinedProtection = 1 - (1 - targetProtection) * (1 - sourceProtection);
403 InjectAgentsWithPlayer(target, sourceAgents , combinedProtection, 1, InjectTypes.PLAYER_AIR_PLAYER);
404 break;
406 float targetMaskProtectionChemical = GetProtectionLevelCachedEquipment(
409 Man.Cast(target),
410 );
411
412 count = InjectAgentWithPlayerDose(target, agents, targetMaskProtectionChemical, dose_size, InjectTypes.PLAYER_AIR_PLAYER);
413 break;
415 switch (sourceAgents)
416 {
417 float protectionLevel = 0.0;
418 Man man = Man.Cast(target);
419
420 case eAgents.SILICOSIS:
421 protectionLevel = GetProtectionLevelCachedEquipment(
424 man,
425 );
426 break;
427 case eAgents.EYES_IRRITATION:
428 protectionLevel = GetProtectionLevelCachedEquipment(
431 man,
432 );
433 break;
434 }
435
436 count = InjectAgentWithPlayerDose(target, sourceAgents , protectionLevel, dose_size, InjectTypes.ITEM_TO_PLAYER);
437 break;
438 default:
439 break;
440 }
441 return count;
442 }
DayZGame g_Game
Определения DayZGame.c:4074
eAgents
Определения EAgents.c:3
ECachedEquipmentItemCategory
Определения ECachedEquipmentItemCategory.c:2
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:523
static float GetProtectionLevelCachedEquipment(int type, int cachedEquipmentStorageMask, Man player)
Protection level of an attachment against enviromental hazard (mask/filters for example) based on res...
Определения PluginTransmissionAgents.c:577
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:474
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:499
void InjectAgentsWithoutPlayer(EntityAI target, int agents)
Injects specified agents directly to target.
Определения PluginTransmissionAgents.c:457
const int AGT_UACTION_CONSUME
Определения 3_Game/DayZ/constants.c:533
const int DEF_DUST_PARTICLE_BREATH
Определения 3_Game/DayZ/constants.c:549
const int AGT_ITEM_TO_FLESH
Определения 3_Game/DayZ/constants.c:540
const int AGT_UACTION_TOUCH
Определения 3_Game/DayZ/constants.c:535
const int DEF_BIOLOGICAL
Определения 3_Game/DayZ/constants.c:547
const int DEF_CHEMICAL
Определения 3_Game/DayZ/constants.c:548
const int AGT_AIRBOURNE_BIOLOGICAL
Определения 3_Game/DayZ/constants.c:537
const int DEF_DUST_PARTICLE_EYES
Определения 3_Game/DayZ/constants.c:550
const int AGT_TRANSFER_COPY
Определения 3_Game/DayZ/constants.c:534
const int AGT_WATER_HOT_SPRING
Определения 3_Game/DayZ/constants.c:544
const int AGT_WATER_POND
Определения 3_Game/DayZ/constants.c:536
const int AGT_INV_OUT
Определения 3_Game/DayZ/constants.c:532
const int AGT_UACTION_TO_PLAYER
Определения 3_Game/DayZ/constants.c:538
const int AGT_AIRBOURNE_CHEMICAL
Определения 3_Game/DayZ/constants.c:541
const int AGT_UACTION_TO_ITEM
Определения 3_Game/DayZ/constants.c:539
const int AGT_AIRBOURNE_SOLID
Определения 3_Game/DayZ/constants.c:545
const int AGT_SNOW
Определения 3_Game/DayZ/constants.c:542
const int AGT_INV_IN
Определения 3_Game/DayZ/constants.c:531

Перекрестные ссылки AGT_AIRBOURNE_BIOLOGICAL, AGT_AIRBOURNE_CHEMICAL, AGT_AIRBOURNE_SOLID, 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, DEF_DUST_PARTICLE_BREATH, DEF_DUST_PARTICLE_EYES, g_Game, GetProtectionLevelCachedEquipment(), InjectAgentsWithoutPlayer(), InjectAgentsWithPlayer(), InjectAgentsWithPlayerCount(), InjectAgentWithPlayerDose() и Math::Max().

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