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

◆ TransmitAgentsEx()

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

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

202 {
203 //Debug.Log("Transmitting agents for source: " +source.ToString()+", target: " +target.ToString(),"Agents");
204 int sourceAgents = agents;
205 int targetAgents;
206 if(!sourceAgents && source) sourceAgents = source.GetAgents();//do not set sourceAgents again if already set
207 if(target) targetAgents = target.GetAgents();
208 int pollution = GetGame().GetMission().GetWorldData().GetPollution();
209
210 float count = 0;
211
212 switch (pathway)
213 {
214 case AGT_INV_OUT: //item leaving inventory
215 break;
216
217 case AGT_INV_IN: //item entering inventory
218 break;
219
220 case AGT_UACTION_TOUCH: //player touched the item
221 //InjectAgents( source, targetAgents ,GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.GLOVES, player) );
222 break;
223
224 case AGT_WATER_POND:
225 if (pollution & EPollution.HEAVYMETAL)
226 {
227 sourceAgents = sourceAgents | eAgents.HEAVYMETAL;
228 }
229 sourceAgents = sourceAgents | eAgents.CHOLERA;
230 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
231 break;
232
234 sourceAgents = sourceAgents | eAgents.FOOD_POISON | eAgents.HEAVYMETAL;
235 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
236 break;
237
238 case AGT_SNOW:
239 if (pollution & EPollution.HEAVYMETAL)
240 {
241 sourceAgents = sourceAgents | eAgents.HEAVYMETAL;
242 }
243 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
244 break;
245
247 //InjectAgentsWithPlayer( target, sourceAgents , 0, dose_size, InjectTypes.ITEM_TO_PLAYER );
248 InjectAgentsWithPlayer( source, targetAgents , 0, 1, InjectTypes.PLAYER_TO_ITEM );
249 break;
250
251 case AGT_UACTION_TO_PLAYER: //user action of a consumption, only from item to player
252 InjectAgentsWithPlayerCount( target, sourceAgents , 0, dose_size, InjectTypes.ITEM_TO_PLAYER );
253 break;
254
255 case AGT_UACTION_TO_ITEM: //to transfer from the player to the consumed item
256 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.PLAYER_TO_ITEM );
257 break;
258
259 case AGT_TRANSFER_COPY: //transferring liquid
260 InjectAgentsWithoutPlayer( target, sourceAgents );
261 break;
262
263 case AGT_ITEM_TO_FLESH: //transferring liquid
264 InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER);
265 break;
266
268 float prot_level_mask_target = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.MASK, Man.Cast( target ));
269 float prot_level_mask_source = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.MASK, Man.Cast( source ));
270 float prot_level_headgear_target = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.HEADGEAR, Man.Cast( target ));
271 float prot_level_headgear_source = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.HEADGEAR, Man.Cast( source ));
272 float prot_level_target = Math.Max(prot_level_mask_target, prot_level_headgear_target);//find the bigger of the 2, TODO: should be improved
273 float prot_level_source = Math.Max(prot_level_mask_source, prot_level_headgear_source);//find the bigger of the 2, TODO: should be improved
274 float prot_level_combined = 1 - (1 - prot_level_target) * (1 - prot_level_source);
275 InjectAgentsWithPlayer( target, sourceAgents , prot_level_combined, 1, InjectTypes.PLAYER_AIR_PLAYER );
276 break;
278 float prot_level_mask_target2 = GetProtectionLevel(DEF_CHEMICAL,InventorySlots.MASK, Man.Cast( target ));
279
280 count = InjectAgentWithPlayerDose( target, agents , prot_level_mask_target2, dose_size, InjectTypes.PLAYER_AIR_PLAYER );
281 break;
282 default:
283 break;
284 }
285 return count;
286 }
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)
will add agent to a given target
Определения PluginTransmissionAgents.c:338
void InjectAgentsWithPlayer(EntityAI target, int agents, float protection, int dose_size, int inject_type)
will add agents to a given target, using chance of transmission and full dose size if chance succeeds
Определения PluginTransmissionAgents.c:304
void InjectAgentsWithPlayerCount(EntityAI target, int agents, float protection, int dose_size, int inject_type)
will add agents to a given target, with no probability, but the dose size is modified by m_Transferab...
Определения PluginTransmissionAgents.c:322
void InjectAgentsWithoutPlayer(EntityAI target, int agents)
Определения PluginTransmissionAgents.c:294
float GetProtectionLevel(int type, int slot, Man player)
Определения PluginTransmissionAgents.c:375
int GetPollution()
Определения WorldData.c:281
proto native CGame GetGame()
const int AGT_UACTION_CONSUME
Определения constants.c:497
const int AGT_ITEM_TO_FLESH
Определения constants.c:504
const int AGT_UACTION_TOUCH
Определения constants.c:499
const int DEF_BIOLOGICAL
Определения constants.c:510
const int DEF_CHEMICAL
Определения constants.c:511
const int AGT_AIRBOURNE_BIOLOGICAL
Определения constants.c:501
const int AGT_TRANSFER_COPY
Определения constants.c:498
const int AGT_WATER_HOT_SPRING
Определения constants.c:508
const int AGT_WATER_POND
Определения constants.c:500
const int AGT_INV_OUT
Определения constants.c:496
const int AGT_UACTION_TO_PLAYER
Определения constants.c:502
const int AGT_AIRBOURNE_CHEMICAL
Определения constants.c:505
const int AGT_UACTION_TO_ITEM
Определения constants.c:503
const int AGT_SNOW
Определения constants.c:506
const int AGT_INV_IN
Определения constants.c:495

Перекрестные ссылки 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().