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

288 {
289 //Debug.Log("Transmitting agents for source: " +source.ToString()+", target: " +target.ToString(),"Agents");
290 int sourceAgents = agents;
291 int targetAgents;
292 if(!sourceAgents && source) sourceAgents = source.GetAgents();//do not set sourceAgents again if already set
293 if(target) targetAgents = target.GetAgents();
294 int pollution = GetGame().GetMission().GetWorldData().GetPollution();
295
296 float count = 0;
297
298 switch (pathway)
299 {
300 case AGT_INV_OUT: //item leaving inventory
301 break;
302
303 case AGT_INV_IN: //item entering inventory
304 break;
305
306 case AGT_UACTION_TOUCH: //player touched the item
307 //InjectAgents( source, targetAgents ,GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.GLOVES, player) );
308 break;
309
310 case AGT_WATER_POND:
311 if (pollution & EPollution.HEAVYMETAL)
312 {
313 sourceAgents = sourceAgents | eAgents.HEAVYMETAL;
314 }
315 sourceAgents = sourceAgents | eAgents.CHOLERA;
316 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
317 break;
318
320 sourceAgents = sourceAgents | eAgents.FOOD_POISON | eAgents.HEAVYMETAL;
321 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
322 break;
323
324 case AGT_SNOW:
325 if (pollution & EPollution.HEAVYMETAL)
326 {
327 sourceAgents = sourceAgents | eAgents.HEAVYMETAL;
328 }
329 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
330 break;
331
333 //InjectAgentsWithPlayer( target, sourceAgents , 0, dose_size, InjectTypes.ITEM_TO_PLAYER );
334 InjectAgentsWithPlayer( source, targetAgents , 0, 1, InjectTypes.PLAYER_TO_ITEM );
335 break;
336
337 case AGT_UACTION_TO_PLAYER: //user action of a consumption, only from item to player
338 InjectAgentsWithPlayerCount( target, sourceAgents , 0, dose_size, InjectTypes.ITEM_TO_PLAYER );
339 break;
340
341 case AGT_UACTION_TO_ITEM: //to transfer from the player to the consumed item
342 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.PLAYER_TO_ITEM );
343 break;
344
345 case AGT_TRANSFER_COPY: //transferring liquid
346 InjectAgentsWithoutPlayer( target, sourceAgents );
347 break;
348
349 case AGT_ITEM_TO_FLESH: //transferring liquid
350 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER);
351 break;
352
354 float prot_level_mask_target = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.MASK, Man.Cast( target ));
355 float prot_level_mask_source = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.MASK, Man.Cast( source ));
356 float prot_level_headgear_target = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.HEADGEAR, Man.Cast( target ));
357 float prot_level_headgear_source = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.HEADGEAR, Man.Cast( source ));
358 float prot_level_target = Math.Max(prot_level_mask_target, prot_level_headgear_target);//find the bigger of the 2, TODO: should be improved
359 float prot_level_source = Math.Max(prot_level_mask_source, prot_level_headgear_source);//find the bigger of the 2, TODO: should be improved
360 float prot_level_combined = 1 - (1 - prot_level_target) * (1 - prot_level_source);
361 InjectAgentsWithPlayer( target, sourceAgents , prot_level_combined, 1, InjectTypes.PLAYER_AIR_PLAYER );
362 break;
364 float prot_level_mask_target2 = GetProtectionLevel(DEF_CHEMICAL,InventorySlots.MASK, Man.Cast( target ));
365
366 count = InjectAgentWithPlayerDose( target, agents , prot_level_mask_target2, dose_size, InjectTypes.PLAYER_AIR_PLAYER );
367 break;
368 default:
369 break;
370 }
371 return count;
372 }
eAgents
Определения EAgents.c:3
InjectTypes
Определения PluginTransmissionAgents.c:2
proto native Mission GetMission()
WorldData GetWorldData()
Определения gameplay.c:743
float InjectAgentWithPlayerDose(EntityAI target, int agent, float protection, float dose_size, int inject_type)
Injects agent to a given target.
Определения PluginTransmissionAgents.c:453
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:404
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:429
void InjectAgentsWithoutPlayer(EntityAI target, int agents)
Injects specified agents directly to target.
Определения PluginTransmissionAgents.c:387
float GetProtectionLevel(int type, int slot, Man player)
Protection level of an attachment against enviromental hazard (mask/filters for example) (see GetProt...
Определения PluginTransmissionAgents.c:501
int GetPollution()
Определения WorldData.c:281
proto native CGame GetGame()
const int AGT_UACTION_CONSUME
Определения 3_Game/constants.c:499
const int AGT_ITEM_TO_FLESH
Определения 3_Game/constants.c:506
const int AGT_UACTION_TOUCH
Определения 3_Game/constants.c:501
const int DEF_BIOLOGICAL
Определения 3_Game/constants.c:512
const int DEF_CHEMICAL
Определения 3_Game/constants.c:513
const int AGT_AIRBOURNE_BIOLOGICAL
Определения 3_Game/constants.c:503
const int AGT_TRANSFER_COPY
Определения 3_Game/constants.c:500
const int AGT_WATER_HOT_SPRING
Определения 3_Game/constants.c:510
const int AGT_WATER_POND
Определения 3_Game/constants.c:502
const int AGT_INV_OUT
Определения 3_Game/constants.c:498
const int AGT_UACTION_TO_PLAYER
Определения 3_Game/constants.c:504
const int AGT_AIRBOURNE_CHEMICAL
Определения 3_Game/constants.c:507
const int AGT_UACTION_TO_ITEM
Определения 3_Game/constants.c:505
const int AGT_SNOW
Определения 3_Game/constants.c:508
const int AGT_INV_IN
Определения 3_Game/constants.c:497

Перекрестные ссылки 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, GetGame(), CGame::GetMission(), WorldData::GetPollution(), GetProtectionLevel(), Mission::GetWorldData(), InjectAgentsWithoutPlayer(), InjectAgentsWithPlayer(), InjectAgentsWithPlayerCount(), InjectAgentWithPlayerDose() и Math::Max().

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