Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
environment.c
Go to the documentation of this file.
2 {
3  const float RAIN_LIMIT_LOW = 0.05;
4 
5  const float WATER_LEVEL_HIGH = 1.5;
6  const float WATER_LEVEL_MID = 1.2;
7  const float WATER_LEVEL_LOW = 0.5;
8  const float WATER_LEVEL_NONE = 0.15;
9 
10  protected float m_WetDryTick; //ticks passed since last clothing wetting or drying
11  protected float m_ItemsWetnessMax;
12  protected float m_RoofCheckTimer; // keeps info about tick time
13 
14  //player
15  protected PlayerBase m_Player;
16  protected float m_PlayerHeightPos; // y position of player above water level (meters)
17  protected float m_PlayerSpeed; // 1-3 speed of player movement
18  protected float m_PlayerTemperature; //34-44
19  protected float m_PlayerHeat; //3-9 heatcomfort generated by entites movement
20  protected float m_HeatComfort; //delta that changes entitys temperature
21 
22  //environment
23  protected float m_Rain = 0; // 0-1 amount of rain
24  protected float m_Wind = 0; // strength of wind
25  protected float m_Fog = 0; // 0-1 how foggy it is
26  protected float m_DayOrNight = 0; // 0-1 day(1) or night(0)
27  protected float m_Clouds = 0; // 0-1 how cloudy it is
28  protected float m_EnvironmentTemperature = 0; //temperature of environment player is in
29  protected float m_Time = 0;
30  protected string m_SurfaceType;
31 
32  //
33  protected float m_WaterLevel;
34  protected bool m_IsUnderRoof;
35  private bool m_IsUnderRoofBuilding;
36  protected bool m_IsInWater;
37  protected bool m_IsTempSet;
38  //
39  protected float m_HeatSourceTemp;
40  protected float m_HeatBufferTimer;
41 
42  protected ref array<int> m_SlotIdsComplete;
43  protected ref array<int> m_SlotIdsUpper;
44  protected ref array<int> m_SlotIdsBottom;
45  protected ref array<int> m_SlotIdsLower;
46 
47  protected ref array<int> m_HeadParts;
48  protected ref array<int> m_BodyParts;
49  protected ref array<int> m_FeetParts;
50 
51  protected ref SimpleMovingAverage<float> m_WindAverageBuffer;
52 
53  protected bool m_HasTemperatureSources;
54  protected float m_UTSAverageTemperature;
55  protected ref array<UTemperatureSource> m_UTemperatureSources;
56  protected ref SimpleMovingAverage<float> m_UTSAverageTemperatureBuffer;
57 
58  #ifdef DIAG_DEVELOPER
59  bool m_Debug = false;
60 
61  bool m_DebugLogDryWet = false;
62  #endif
63 
64  void Environment(PlayerBase pPlayer)
65  {
66  Init(pPlayer);
67  }
68 
69  void Init(PlayerBase pPlayer)
70  {
71  m_Player = pPlayer;
72  m_PlayerSpeed = 0.0;
73  m_WetDryTick = 0.0;
74  m_RoofCheckTimer = 0.0;
75  m_WaterLevel = 0.0;
76  m_HeatComfort = 0.0;
77 
78  m_IsUnderRoof = false;
79  m_IsInWater = false;
80  m_SurfaceType = "cp_dirt";
81 
82  m_HeatBufferTimer = 0.0;
83 
84  m_WindAverageBuffer = new SimpleMovingAverage<float>(30, 0.5);
85 
86  m_UTSAverageTemperature = 0.0;
87  m_UTemperatureSources = new array<UTemperatureSource>();
88  m_UTSAverageTemperatureBuffer = new SimpleMovingAverage<float>(10, 0);
89 
91  m_SlotIdsComplete = new array<int>;
92  m_SlotIdsComplete = {
93  InventorySlots.HEADGEAR,
94  InventorySlots.MASK,
95  InventorySlots.EYEWEAR,
96  InventorySlots.GLOVES,
97  InventorySlots.ARMBAND,
98  InventorySlots.BODY,
99  InventorySlots.HIPS,
100  InventorySlots.VEST,
101  InventorySlots.BACK,
102  InventorySlots.LEGS,
103  InventorySlots.FEET
104  };
106  m_SlotIdsUpper = new array<int>;
107  m_SlotIdsUpper = {
108  InventorySlots.GLOVES,
109  InventorySlots.ARMBAND,
110  InventorySlots.BODY,
111  InventorySlots.HIPS,
112  InventorySlots.VEST,
113  InventorySlots.BACK,
114  InventorySlots.LEGS,
115  InventorySlots.FEET
116  };
118  m_SlotIdsBottom = new array<int>;
119  m_SlotIdsBottom = {
120  InventorySlots.HIPS,
121  InventorySlots.LEGS,
122  InventorySlots.FEET
123  };
125  m_SlotIdsLower = new array<int>;
126  m_SlotIdsLower = {
127  InventorySlots.FEET,
128  };
129 
132  m_HeadParts = new array<int>;
133  m_HeadParts = {
134  InventorySlots.HEADGEAR,
135  InventorySlots.MASK,
136  };
137 
138  m_BodyParts = new array<int>;
139  m_BodyParts = {
140  InventorySlots.GLOVES,
141 
142  InventorySlots.BODY,
143  InventorySlots.BACK,
144  InventorySlots.VEST,
145  };
146 
147  m_FeetParts = new array<int>;
148  m_FeetParts = {
149  InventorySlots.LEGS,
150  InventorySlots.FEET,
151  };
152  }
153 
154 
155  // Calculates heatisolation of clothing, process its wetness, collects heat from heated items and calculates player's heat comfort
156  void Update(float pDelta)
157  {
158  if (m_Player)
159  {
160  m_RoofCheckTimer += pDelta;
162  if ( m_RoofCheckTimer >= GameConstants.ENVIRO_TICK_ROOF_RC_CHECK )
163  {
164  if ( !IsInsideBuilding() )
165  CheckUnderRoof();
166 
167  m_RoofCheckTimer = 0;
168  }
169 
170  m_Time += pDelta;
171  if ( m_Time >= GameConstants.ENVIRO_TICK_RATE )
172  {
173  m_Time = 0;
174  m_WetDryTick++; // Sets whether it is time to add wetness to items and clothing
175 
177  CheckWaterContact(m_WaterLevel);
178  CollectAndSetPlayerData();
179  CollectAndSetEnvironmentData();
180  GatherTemperatureSources();
181 
182  ProcessTemperatureSources();
183 
185  ProcessItemsHeat();
186 
188  if ( m_WetDryTick >= GameConstants.ENVIRO_TICKS_TO_WETNESS_CALCULATION )
189  {
190  if ( IsWaterContact() )
191  {
192  ProcessWetnessByWaterLevel(m_WaterLevel);
193  }
194  else if ( IsRaining() && !IsInsideBuilding() && !IsUnderRoof() && !IsInsideVehicle() )
195  {
196  ProcessWetnessByRain();
197  }
198  else
199  {
200  ProcessItemsDryness();
201  }
202 
204  if ( ( m_ItemsWetnessMax < GameConstants.STATE_WET ) && ( m_Player.GetStatWet().Get() == 1 ) )
205  {
206  m_Player.GetStatWet().Set( 0 );
207  }
208  else if ( ( m_ItemsWetnessMax >= GameConstants.STATE_WET ) && ( m_Player.GetStatWet().Get() == 0 ) )
209  {
210  m_Player.GetStatWet().Set( 1 );
211  }
212 
213  m_WetDryTick = 0;
214  m_ItemsWetnessMax = 0;
215  }
216  }
217  }
218  }
219 
220  bool IsTemperatureSet()
221  {
222  return m_IsTempSet;
223  }
224 
225  // DEPRECATED
226  void AddToEnvironmentTemperature(float pTemperature);
227 
229  protected float GetPlayerHeat()
230  {
231  float heat = Math.Max(m_PlayerSpeed * GameConstants.ENVIRO_DEFAULT_ENTITY_HEAT, GameConstants.ENVIRO_DEFAULT_ENTITY_HEAT);
232  return heat;
233  }
234 
235  bool IsUnderRoof()
236  {
237  return m_IsUnderRoof;
238  }
239 
240  protected bool IsWaterContact()
241  {
242  return m_IsInWater;
243  }
244 
245  bool IsInsideBuilding()
246  {
247  return m_Player && m_Player.IsSoundInsideBuilding();
248  }
249 
250  protected bool IsInsideVehicle()
251  {
252  return m_Player && m_Player.IsInVehicle();
253  }
254 
255  private bool IsUnderRoofBuilding()
256  {
257  return m_IsUnderRoofBuilding;
258  }
259 
260  protected bool IsRaining()
261  {
262  return m_Rain > RAIN_LIMIT_LOW;
263  }
264 
266  protected void CheckUnderRoof()
267  {
268  // if inside vehicle return immediatelly
269  if (IsInsideVehicle())
270  {
271  m_IsUnderRoof = false;
272  m_IsUnderRoofBuilding = false;
273  return;
274  }
275 
276  float hitFraction;
277  vector hitPosition, hitNormal;
278  vector from = m_Player.GetPosition();
279  vector to = from + "0 25 0";
280  Object hitObject;
281  PhxInteractionLayers collisionLayerMask = PhxInteractionLayers.ITEM_LARGE|PhxInteractionLayers.BUILDING|PhxInteractionLayers.VEHICLE;
282 
283  m_IsUnderRoof = DayZPhysics.RayCastBullet(from, to, collisionLayerMask, null, hitObject, hitPosition, hitNormal, hitFraction);
284 
285  m_IsUnderRoofBuilding = hitObject && hitObject.IsInherited(House);
286  }
287 
288  protected void CheckWaterContact(out float pWaterLevel)
289  {
290  m_IsInWater = false;
291  if (m_Player.IsSwimming())
292  {
293  m_IsInWater = true;
295  m_Player.GetMovementState(hms);
296  pWaterLevel = WATER_LEVEL_MID;
297  if (hms.m_iMovement >= DayZPlayerConstants.MOVEMENTIDX_WALK)
298  pWaterLevel = WATER_LEVEL_HIGH;
299 
300  return;
301  }
302 
304  if (IsUnderRoofBuilding())
305  {
306  m_IsInWater = false;
307  return;
308  }
309 
310  string surfType;
311  int liquidType;
312 
313  g_Game.SurfaceUnderObject(m_Player, surfType, liquidType);
314 
315  switch ( liquidType )
316  {
317  case 0: // sea
318  case LIQUID_WATER:
319  case LIQUID_RIVERWATER:
320  pWaterLevel = m_Player.GetCurrentWaterLevel();
321  m_IsInWater = true;
322  break;
323  }
324 
326  m_Player.SetInWater(m_IsInWater);
327 
329  m_SurfaceType = surfType;
330  }
331 
332  // ENVIRONMENT
333  // Returns amount of deg C air temperature should be lowered by, based on player's height above water level
334  float GetTemperatureHeightCorrection()
335  {
336  float temperature_reduction = Math.Max(0, (m_PlayerHeightPos * GameConstants.ENVIRO_TEMPERATURE_HEIGHT_REDUCTION));
337  return temperature_reduction;
338  }
339 
340  float GetWindModifierPerSurface()
341  {
342  if (IsUnderRoofBuilding())
343  return 0.0;
344 
345  return g_Game.ConfigGetFloat("CfgSurfaces " + m_SurfaceType + " windModifier");
346  }
347 
348  float GetTemperature()
349  {
350  return m_EnvironmentTemperature;
351  }
352 
353  // Calculates and return temperature of environment
354  protected float GetEnvironmentTemperature()
355  {
356  float temperature;
357  temperature = g_Game.GetMission().GetWorldData().GetBaseEnvTemperature();
358  temperature += Math.AbsFloat(temperature * m_Clouds * GameConstants.ENVIRO_CLOUDS_TEMP_EFFECT);
359 
360  if (IsWaterContact())
361  {
362  temperature -= Math.AbsFloat(temperature * GameConstants.ENVIRO_WATER_TEMPERATURE_COEF);
363  }
364 
365  if (IsInsideBuilding() || m_IsUnderRoofBuilding)
366  {
367  temperature += Math.AbsFloat(temperature * GameConstants.ENVIRO_TEMPERATURE_INSIDE_COEF);
368  }
369  else if (IsInsideVehicle())
370  {
371  temperature += Math.AbsFloat(temperature * GameConstants.ENVIRO_TEMPERATURE_INSIDE_VEHICLE_COEF);
372  }
373  else if (IsUnderRoof() && !m_IsUnderRoofBuilding)
374  {
375  temperature += Math.AbsFloat(temperature * GameConstants.ENVIRO_TEMPERATURE_UNDERROOF_COEF);
376  temperature -= GameConstants.ENVIRO_TEMPERATURE_WIND_COEF * GetWindModifierPerSurface() * m_Wind;
377  }
378  else
379  {
380  temperature -= GameConstants.ENVIRO_TEMPERATURE_WIND_COEF * GetWindModifierPerSurface() * m_Wind;
381  temperature -= Math.AbsFloat(temperature * m_Fog * GameConstants.ENVIRO_FOG_TEMP_EFFECT);
382  temperature -= GetTemperatureHeightCorrection();
383  }
384 
385  // incorporate temperature from temperature sources (buffer)
386  if (Math.AbsFloat(m_UTSAverageTemperature) > 0.001)
387  {
388  temperature += m_UTSAverageTemperature;
389  }
390 
391  return temperature;
392  }
393 
394  // Calculats wet/drying delta based on player's location and weather
395  float GetWetDelta()
396  {
397  float wetDelta = 0;
398  if ( IsWaterContact() )
399  {
401  if (m_WaterLevel >= WATER_LEVEL_HIGH)
402  {
403  wetDelta = 1;
404  }
405  else if (m_WaterLevel >= WATER_LEVEL_MID && m_WaterLevel < WATER_LEVEL_HIGH)
406  {
407  wetDelta = 0.66;
408  }
409  else if (m_WaterLevel >= WATER_LEVEL_LOW && m_WaterLevel < WATER_LEVEL_MID)
410  {
411  wetDelta = 0.66;
412  }
413  else if (m_WaterLevel >= WATER_LEVEL_NONE && m_WaterLevel < WATER_LEVEL_LOW)
414  {
415  wetDelta = 0.33;
416  }
417  }
418  else if (IsRaining() && !IsInsideBuilding() && !IsUnderRoof() && !IsInsideVehicle())
419  {
421  wetDelta = GameConstants.ENVIRO_WET_INCREMENT * GameConstants.ENVIRO_TICKS_TO_WETNESS_CALCULATION * (m_Rain) * (1 + (GameConstants.ENVIRO_WIND_EFFECT * m_Wind));
422  }
423  else
424  {
426  float tempEffect = Math.Max(m_PlayerHeat + GetEnvironmentTemperature(), 1.0);
427 
428  float weatherEffect = ((1 - (m_Fog * GameConstants.ENVIRO_FOG_DRY_EFFECT))) * (1 - (m_Clouds * GameConstants.ENVIRO_CLOUD_DRY_EFFECT));
429  if (weatherEffect <= 0)
430  {
431  weatherEffect = 1.0;
432  }
433 
434  wetDelta = -(GameConstants.ENVIRO_DRY_INCREMENT * weatherEffect * tempEffect);
435  if (!IsInsideBuilding())
436  {
437  wetDelta *= 1 + (GameConstants.ENVIRO_WIND_EFFECT * m_Wind);
438  }
439  }
440 
441  return wetDelta;
442  }
443 
444  // EXPOSURE
445  // Each tick updates current entity member variables
446  protected void CollectAndSetPlayerData()
447  {
448  vector playerPos = m_Player.GetPosition();
449  m_PlayerHeightPos = playerPos[1];
450 
451  HumanCommandMove hcm = m_Player.GetCommand_Move();
452  if (hcm)
453  {
454  m_PlayerSpeed = hcm.GetCurrentMovementSpeed();
455  }
456 
457  m_PlayerHeat = GetPlayerHeat();
458  }
459 
460  // Each tick updates current environment member variables
461  protected void CollectAndSetEnvironmentData()
462  {
463  Weather weather = g_Game.GetWeather();
464  m_Rain = weather.GetRain().GetActual();
465  m_DayOrNight = g_Game.GetWorld().GetSunOrMoon();
466  m_Fog = weather.GetFog().GetActual();
467  m_Clouds = weather.GetOvercast().GetActual();
468  m_Wind = m_WindAverageBuffer.Add(weather.GetWindSpeed() / weather.GetWindMaximumSpeed());
469 
470  SetEnvironmentTemperature();
471  }
472 
473  void SetEnvironmentTemperature()
474  {
475  m_IsTempSet = true;
476  m_EnvironmentTemperature = GetEnvironmentTemperature();
477  }
478 
479  protected void ProcessWetnessByRain()
480  {
481  ProcessItemsWetness(m_SlotIdsComplete);
482  }
483 
484  protected void ProcessWetnessByWaterLevel(float pWaterLevel)
485  {
486  // process attachments by water depth
487  if (pWaterLevel >= WATER_LEVEL_HIGH)
488  {
490  ProcessItemsWetness(m_SlotIdsComplete);
491  }
492  else if (pWaterLevel >= WATER_LEVEL_MID && pWaterLevel < WATER_LEVEL_HIGH)
493  {
495  ProcessItemsWetness(m_SlotIdsUpper);
496  }
497  else if (pWaterLevel >= WATER_LEVEL_LOW && pWaterLevel < WATER_LEVEL_MID)
498  {
500  ProcessItemsWetness(m_SlotIdsBottom);
501  }
502  else if (pWaterLevel >= WATER_LEVEL_NONE && pWaterLevel < WATER_LEVEL_LOW)
503  {
505  ProcessItemsWetness(m_SlotIdsLower);
506  }
507  }
508 
509  // Wets or dry items once in given time
510  protected void ProcessItemsWetness(array<int> pSlotIds)
511  {
512  EntityAI attachment;
513 
514  int playerAttachmentCount = m_Player.GetInventory().AttachmentCount();
515 
516  LogDryWetProcess(string.Format("Environment :: ProcessItemsWetness (update interval=%1s)", GameConstants.ENVIRO_TICK_RATE));
517  for (int attIdx = 0; attIdx < playerAttachmentCount; ++attIdx)
518  {
519  attachment = m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
520  if (attachment.IsItemBase())
521  {
522  int attachmentSlotsCount = attachment.GetInventory().GetSlotIdCount();
523  for (int attachmentSlotId = 0; attachmentSlotId < attachmentSlotsCount; ++attachmentSlotId)
524  {
525  int attachmentSlot = attachment.GetInventory().GetSlotId(attachmentSlotId);
526  for (int i = 0; i < pSlotIds.Count(); ++i)
527  {
528  if (attachmentSlot == pSlotIds.Get(i))
529  {
530  ApplyWetnessToItem(ItemBase.Cast(attachment));
531  break;
532  }
533  }
534  }
535  }
536  }
537 
538  if (m_Player.GetItemInHands())
539  ApplyWetnessToItem(m_Player.GetItemInHands());
540 
541  LogDryWetProcess("==========");
542 
543  }
544 
545  protected void ProcessItemsDryness()
546  {
547  EntityAI attachment;
548  ItemBase item;
549 
550  int attCount = m_Player.GetInventory().AttachmentCount();
551 
552  LogDryWetProcess(string.Format("Environment :: ProcessItemsDryness (update interval=%1s)", GameConstants.ENVIRO_TICK_RATE));
553  EnvironmentDrynessData drynessData = new EnvironmentDrynessData();
554  drynessData.m_UseTemperatureSources = m_HasTemperatureSources;
555 
556  if (m_HasTemperatureSources)
557  {
558  float distance = vector.Distance(m_UTemperatureSources[0].GetPosition(), m_Player.GetPosition());
559  distance = Math.Max(distance, 0.1);
560  drynessData.m_TemperatureSourceDistance = distance;
561  LogDryWetProcess(string.Format("distance to heatsource: %1 m", distance));
562  }
563 
564  for (int attIdx = 0; attIdx < attCount; attIdx++)
565  {
566  attachment = m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
567  if (attachment && attachment.IsItemBase())
568  {
569  item = ItemBase.Cast(attachment);
570  if (item)
571  ApplyDrynessToItemEx(item, drynessData);
572  }
573  }
574 
575  if (m_Player.GetItemInHands())
576  {
577  ApplyDrynessToItemEx(m_Player.GetItemInHands(), drynessData);
578  }
579 
580  LogDryWetProcess("==========");
581  }
582 
583  protected void ApplyWetnessToItem(ItemBase pItem)
584  {
585  if (pItem)
586  {
587  ItemBase parentItem;
588  bool isParentWet = false;
589  bool parentContainsLiquid = false;
591 
592  if (pItem.GetInventory().GetCurrentInventoryLocation(iLoc))
593  {
594  EntityAI parent = iLoc.GetParent();
595  if (parent)
596  {
597  parentItem = ItemBase.Cast(parent);
598  if (parentItem)
599  {
600  if (parentItem.GetWet() >= GameConstants.STATE_SOAKING_WET)
601  isParentWet = true;
602 
603  if ((parentItem.GetLiquidType() != 0) && (parentItem.GetQuantity() > 0))
604  parentContainsLiquid = true;
605  }
606  else
607  isParentWet = true;
608 
609  if ((pItem.GetWet() > m_ItemsWetnessMax) && (parent == m_Player))
610  m_ItemsWetnessMax = pItem.GetWet();
611  }
612  }
613 
614  if (isParentWet || parentContainsLiquid)
615  {
616  float soakingCoef = 0;
617  if (parentContainsLiquid)
618  {
619  soakingCoef = pItem.GetSoakingIncrement("parentWithLiquid");
620  LogDryWetProcess(string.Format("%1 (soak coef=%2/s, current wetness=%3) [parent contains liquid]", pItem.GetDisplayName(), soakingCoef / GameConstants.ENVIRO_TICK_RATE, pItem.GetWet()), parentItem != null);
621  }
622  else if (isParentWet && parentItem)
623  {
624  if (pItem.GetWet() < parentItem.GetWet())
625  {
626  soakingCoef = pItem.GetSoakingIncrement("wetParent");
627  LogDryWetProcess(string.Format("%1 (soak coef=%2/s, current wetness=%3) [parent wet]", pItem.GetDisplayName(), soakingCoef / GameConstants.ENVIRO_TICK_RATE, pItem.GetWet()), parentItem != null);
628  }
629  }
630  else
631  {
632  soakingCoef = GetWetDelta();
633  LogDryWetProcess(string.Format("%1 (soak coef=%2/s, current wetness=%3) [normal]", pItem.GetDisplayName(), soakingCoef / GameConstants.ENVIRO_TICK_RATE, pItem.GetWet()), parentItem != null);
634  }
635 
636  pItem.AddWet(soakingCoef);
637  pItem.AddTemperature(GameConstants.ENVIRO_TICK_RATE * GameConstants.TEMPERATURE_RATE_COOLING_PLAYER * pItem.GetSoakingIncrement("wetParent"));
638 
639  if (pItem.GetInventory().GetCargo())
640  {
641  int inItemCount = pItem.GetInventory().GetCargo().GetItemCount();
642  for (int i = 0; i < inItemCount; i++)
643  {
644  ItemBase inItem;
645  if (Class.CastTo(inItem, pItem.GetInventory().GetCargo().GetItem(i)))
646  ApplyWetnessToItem(inItem);
647  }
648  }
649 
650  int attCount = pItem.GetInventory().AttachmentCount();
651  if (attCount > 0)
652  {
653  for (int attIdx = 0; attIdx < attCount; attIdx++)
654  {
655  EntityAI attachment = pItem.GetInventory().GetAttachmentFromIndex(attIdx);
656  ItemBase itemAtt = ItemBase.Cast(attachment);
657  if (itemAtt)
658  ApplyWetnessToItem(itemAtt);
659  }
660  }
661  }
662  }
663  }
664 
665  protected void ApplyDrynessToItem(ItemBase pItem)
666  {
667  EnvironmentDrynessData drynessData = new EnvironmentDrynessData();
668  ApplyDrynessToItemEx(pItem, drynessData);
669  }
670 
671  protected void ApplyDrynessToItemEx(ItemBase pItem, EnvironmentDrynessData pDrynessData)
672  {
673  if (pItem)
674  {
675  float dryingIncrement = pItem.GetDryingIncrement("player");
676  if (pDrynessData.m_UseTemperatureSources)
677  dryingIncrement = pItem.GetDryingIncrement("playerHeatSource");
678 
679  ItemBase parentItem;
680  bool isParentWet = false;
681  bool parentContainsLiquid = false;
682 
684  if (pItem.GetInventory().GetCurrentInventoryLocation(iLoc))
685  {
686  EntityAI parent = iLoc.GetParent();
687  if (parent)
688  {
689  parentItem = ItemBase.Cast(parent);
690  if (parentItem)
691  {
692  if (parentItem.GetWet() >= GameConstants.STATE_SOAKING_WET)
693  isParentWet = true;
694 
695  if ((parentItem.GetLiquidType() != 0) && (parentItem.GetQuantity() > 0))
696  parentContainsLiquid = true;
697  }
698 
699  if ((pItem.GetWet() > m_ItemsWetnessMax) && (parent == m_Player))
700  {
701  m_ItemsWetnessMax = pItem.GetWet();
702  }
703  }
704  }
705 
706  float dryingCoef = 0;
707 
708  if (!isParentWet && !parentContainsLiquid)
709  {
710 
711  dryingCoef = (-1 * GameConstants.ENVIRO_TICK_RATE * dryingIncrement) / pDrynessData.m_TemperatureSourceDistance;
712  if (pItem.GetWet() >= GameConstants.STATE_DAMP)
713  {
714  LogDryWetProcess(string.Format("%1 (dry coef=%2/s, current wetness=%3) [normal]", pItem.GetDisplayName(), dryingCoef / GameConstants.ENVIRO_TICK_RATE, pItem.GetWet()), parentItem != null);
715  pItem.AddWet(dryingCoef);
716  }
717 
718  if (pItem.GetInventory().GetCargo())
719  {
720  int inItemCount = pItem.GetInventory().GetCargo().GetItemCount();
721  for (int i = 0; i < inItemCount; i++)
722  {
723  ItemBase inItem;
724  if (Class.CastTo(inItem, pItem.GetInventory().GetCargo().GetItem(i)))
725  ApplyDrynessToItemEx(inItem, pDrynessData);
726  }
727  }
728 
729  int attCount = pItem.GetInventory().AttachmentCount();
730  if (attCount > 0)
731  {
732  for (int attIdx = 0; attIdx < attCount; attIdx++)
733  {
734  EntityAI attachment = pItem.GetInventory().GetAttachmentFromIndex(attIdx);
735  ItemBase itemAtt;
736  if (ItemBase.CastTo(itemAtt, attachment))
737  ApplyDrynessToItemEx(itemAtt, pDrynessData);
738  }
739  }
740 
741  pItem.AddTemperature(GameConstants.ENVIRO_TICK_RATE * GameConstants.TEMPERATURE_RATE_COOLING_PLAYER);
742  }
743 
744  if (parentContainsLiquid)
745  {
747  dryingCoef = (GameConstants.ENVIRO_TICK_RATE * pItem.GetSoakingIncrement("parentWithLiquid")) / pDrynessData.m_TemperatureSourceDistance;
748  LogDryWetProcess(string.Format("%1 (dry coef=%2/s, current wetness=%3) [parent contains liquid]", pItem.GetDisplayName(), dryingCoef / GameConstants.ENVIRO_TICK_RATE, pItem.GetWet()), parentItem != null);
749  pItem.AddWet(dryingCoef);
750  pItem.AddTemperature(GameConstants.ENVIRO_TICK_RATE * GameConstants.TEMPERATURE_RATE_COOLING_PLAYER);
751  }
752 
753  if (isParentWet)
754  {
755  if (pItem.GetWet() < parentItem.GetWet())
756  {
758  dryingCoef = (GameConstants.ENVIRO_TICK_RATE * pItem.GetSoakingIncrement("wetParent")) / pDrynessData.m_TemperatureSourceDistance;
759  LogDryWetProcess(string.Format("%1 (dry coef=%2/s, current wetness=%3) [parent wet]", pItem.GetDisplayName(), dryingCoef / GameConstants.ENVIRO_TICK_RATE, pItem.GetWet()), parentItem != null);
760  pItem.AddWet(dryingCoef);
761  }
762 
763  pItem.AddTemperature(GameConstants.ENVIRO_TICK_RATE * GameConstants.TEMPERATURE_RATE_COOLING_PLAYER * 3.5);
764  }
765  }
766  }
767 
768  // HEAT COMFORT
770  protected void ProcessItemsHeat()
771  {
772  float hcHead, hcBody, hcFeet;
773  float hHead, hBody, hFeet;
774 
775  float heatComfortAvg;
776  float heatAvg;
777 
778  BodyPartHeatProperties(m_HeadParts, GameConstants.ENVIRO_HEATCOMFORT_HEADPARTS_WEIGHT, hcHead, hHead);
779  BodyPartHeatProperties(m_BodyParts, GameConstants.ENVIRO_HEATCOMFORT_BODYPARTS_WEIGHT, hcBody, hBody);
780  BodyPartHeatProperties(m_FeetParts, GameConstants.ENVIRO_HEATCOMFORT_FEETPARTS_WEIGHT, hcFeet, hFeet);
781 
782  heatComfortAvg = (hcHead + hcBody + hcFeet) / 3;
783  heatAvg = (hHead + hBody + hFeet) / 3;
784  heatAvg = heatAvg * GameConstants.ENVIRO_ITEM_HEAT_TRANSFER_COEF;
785 
786  // heat buffer
787  float applicableHB = 0.0;
788  if (m_UTSAverageTemperature < 0.001)
789  {
790  applicableHB = m_Player.GetStatHeatBuffer().Get() / 30.0;
791  if (applicableHB > 0.0)
792  {
793  if (m_HeatBufferTimer > 1.0)
794  {
795  m_Player.GetStatHeatBuffer().Add(Math.Min(EnvTempToCoef(m_EnvironmentTemperature), -0.1) * GameConstants.ENVIRO_PLAYER_HEATBUFFER_DECREASE);
796  }
797  else
798  {
799  m_HeatBufferTimer += GameConstants.ENVIRO_PLAYER_HEATBUFFER_TICK;
800  }
801  }
802  else
803  {
804  m_HeatBufferTimer = 0.0;
805  }
806  }
807  else
808  {
809  applicableHB = m_Player.GetStatHeatBuffer().Get() / 30.0;
810  if (m_HeatComfort > PlayerConstants.THRESHOLD_HEAT_COMFORT_MINUS_WARNING)
811  {
812  m_Player.GetStatHeatBuffer().Add(GameConstants.ENVIRO_PLAYER_HEATBUFFER_INCREASE);
813  m_HeatBufferTimer = 0.0;
814  }
815  else
816  {
817  m_HeatBufferTimer = 0.0;
818  }
819  }
820 
821  m_HeatComfort = (heatComfortAvg + heatAvg + (GetPlayerHeat() / 100)) + EnvTempToCoef(m_EnvironmentTemperature);
822  if ((m_HeatComfort + applicableHB) < (PlayerConstants.THRESHOLD_HEAT_COMFORT_PLUS_WARNING - 0.01))
823  {
824  m_HeatComfort += applicableHB;
825  }
826  else
827  {
828  if (m_HeatComfort <= (PlayerConstants.THRESHOLD_HEAT_COMFORT_PLUS_WARNING - 0.01))
829  {
830  m_HeatComfort = PlayerConstants.THRESHOLD_HEAT_COMFORT_PLUS_WARNING - 0.01;
831  }
832  }
833 
834  m_HeatComfort = Math.Clamp(m_HeatComfort, m_Player.GetStatHeatComfort().GetMin(), m_Player.GetStatHeatComfort().GetMax());
835 
836  m_Player.GetStatHeatComfort().Set(m_HeatComfort);
837  }
838 
840  protected bool OverridenHeatComfort(out float value);
841 
842  protected float EnvTempToCoef(float pTemp)
843  {
844  if (pTemp >= GameConstants.ENVIRO_HIGH_TEMP_LIMIT)
845  {
846  return 1;
847  }
848 
849  if (pTemp <= GameConstants.ENVIRO_LOW_TEMP_LIMIT)
850  {
851  return -1;
852  }
853 
854  return (pTemp - GameConstants.ENVIRO_PLAYER_COMFORT_TEMP) / GameConstants.ENVIRO_TEMP_EFFECT_ON_PLAYER;
855  }
856 
858  protected void BodyPartHeatProperties(array<int> pBodyPartIds, float pCoef, out float pHeatComfort, out float pHeat)
859  {
860  int attCount;
861 
862  EntityAI attachment;
863  ItemBase item;
864 
865  pHeatComfort = -1;
866  attCount = m_Player.GetInventory().AttachmentCount();
867 
868  for (int attIdx = 0; attIdx < attCount; attIdx++)
869  {
870  attachment = m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
871  if (attachment.IsClothing())
872  {
873  item = ItemBase.Cast(attachment);
874  int attachmentSlot = attachment.GetInventory().GetSlotId(0);
875 
877  for (int i = 0; i < pBodyPartIds.Count(); i++)
878  {
879  if (attachmentSlot == pBodyPartIds.Get(i))
880  {
881  float heatIsoMult = 1.0;
882  if (attachmentSlot == InventorySlots.VEST)
883  {
884  heatIsoMult = GameConstants.ENVIRO_HEATISOLATION_VEST_WEIGHT;
885  }
886 
887  if (attachmentSlot == InventorySlots.BACK)
888  {
889  heatIsoMult = GameConstants.ENVIRO_HEATISOLATION_BACK_WEIGHT;
890  }
891 
892  pHeatComfort += heatIsoMult * MiscGameplayFunctions.GetCurrentItemHeatIsolation(item);
893 
894  // go through any attachments and cargo (only current level, ignore nested containers - they isolate)
895  int inAttCount = item.GetInventory().AttachmentCount();
896  if (inAttCount > 0)
897  {
898  for (int inAttIdx = 0; inAttIdx < inAttCount; inAttIdx++)
899  {
900  EntityAI inAttachment = item.GetInventory().GetAttachmentFromIndex(inAttIdx);
901  ItemBase itemAtt = ItemBase.Cast(inAttachment);
902  if (itemAtt)
903  {
904  pHeat += itemAtt.GetTemperature();
905  }
906  }
907  }
908  if (item.GetInventory().GetCargo())
909  {
910  int inItemCount = item.GetInventory().GetCargo().GetItemCount();
911 
912  for (int j = 0; j < inItemCount; j++)
913  {
914  ItemBase inItem;
915  if (Class.CastTo(inItem, item.GetInventory().GetCargo().GetItem(j)))
916  {
917  pHeat += inItem.GetTemperature();
918  }
919  }
920  }
921  }
922  }
923  }
924  }
925 
926  pHeatComfort = (pHeatComfort / pBodyPartIds.Count()) * pCoef;
927  pHeat = (pHeat / pBodyPartIds.Count()) * pCoef;
928  }
929 
930  protected void GatherTemperatureSources()
931  {
932  m_UTemperatureSources.Clear();
933 
934  array<Object> nearestObjects = new array<Object>;
935  GetGame().GetObjectsAtPosition(m_Player.GetPosition(), GameConstants.ENVIRO_TEMP_SOURCES_LOOKUP_RADIUS, nearestObjects, null);
936 
937  foreach (Object nearestObject : nearestObjects)
938  {
939  EntityAI ent = EntityAI.Cast(nearestObject);
940  if (ent && ent.IsUniversalTemperatureSource() && ent != m_Player)
941  {
943  if (vector.DistanceSq(m_Player.GetPosition(), ent.GetPosition()) > Math.SqrFloat(ent.GetUniversalTemperatureSource().GetMaxRange()))
944  continue;
945 
946  m_UTemperatureSources.Insert(ent.GetUniversalTemperatureSource());
947  }
948  }
949 
950  if (m_Player.GetItemInHands() && m_Player.GetItemInHands().IsUniversalTemperatureSource())
951  m_UTemperatureSources.Insert(m_Player.GetItemInHands().GetUniversalTemperatureSource());
952  }
953 
954  protected void ProcessTemperatureSources()
955  {
956  if (m_UTemperatureSources.Count() == 0)
957  {
958  m_HasTemperatureSources = false;
959  m_UTSAverageTemperature = m_UTSAverageTemperatureBuffer.Add(0);
960  return;
961  }
962 
963  array<float> utsTemperatures = new array<float>();
964 
965  // get temperature from the source (based on distance), save it for min/max filtering
966  foreach (UTemperatureSource tempSource : m_UTemperatureSources)
967  utsTemperatures.Insert(CalcTemperatureFromTemperatureSource(tempSource));
968 
969  float min = MiscGameplayFunctions.GetMinValue(utsTemperatures);
970  float max = MiscGameplayFunctions.GetMaxValue(utsTemperatures);
971 
972  if (max > 0 && min < 0)
973  {
975  m_UTSAverageTemperature = m_UTSAverageTemperatureBuffer.Add((max + min) * 0.5);
976  }
977  else
978  {
979  m_UTSAverageTemperature = m_UTSAverageTemperatureBuffer.Add(max);
980  }
981 
982  m_HasTemperatureSources = true;
983  }
984 
985  float GetUniversalSourcesTemperageAverage()
986  {
987  return m_UTSAverageTemperature;
988  }
989 
990  float CalcTemperatureFromTemperatureSource(notnull UTemperatureSource uts)
991  {
992  float distance = vector.Distance(m_Player.GetPosition(), uts.GetPosition());
993  distance = Math.Max(distance, 0.1); //min distance cannot be 0 (division by zero)
994  float temperature = 0;
995 
996  //Debug.Log(string.Format("CalcTemperatureFromTemperatureSource::distance: %1", distance), "Environment");
997 
999  if (distance > uts.GetFullRange())
1000  {
1001  float distFactor = 1 - (distance / uts.GetMaxRange());
1002  distFactor = Math.Max(distFactor, 0.0);
1003  temperature = uts.GetTemperature() * distFactor;
1004  //temperature = Math.Clamp(temperature, uts.GetTemperatureMin(), uts.GetTemperatureMax());
1005  //Debug.Log(string.Format("CalcTemperatureFromTemperatureSource::distFactor: %1", distFactor), "Environment");
1006  //Debug.Log(string.Format("CalcTemperatureFromTemperatureSource::temperatureXX: %1", temperature), "Environment");
1007  }
1008  else
1009  {
1010  temperature = uts.GetTemperature();
1011  }
1012 
1013  //Debug.Log(string.Format("CalcTemperatureFromTemperatureSource::temperature: %1", temperature), "Environment");
1014 
1015  return temperature;
1016  }
1017 
1019 #ifdef DIAG_DEVELOPER
1020  EnvDebugData GetEnvDebugData()
1021  {
1022  EnvDebugData data = new EnvDebugData();
1023  data.Synch(this, m_Player);
1024  return data;
1025  }
1026 
1027  void ShowEnvDebugPlayerInfo(bool enabled)
1028  {
1029  EnvDebugData data = GetEnvDebugData();
1030  DisplayEnvDebugPlayerInfo(enabled, data);
1031  }
1032 
1033  static void DisplayEnvDebugPlayerInfo(bool enabled, EnvDebugData data)
1034  {
1035  int windowPosX = 10;
1036  int windowPosY = 200;
1037 
1038  Object obj;
1039 
1040  DbgUI.Begin("Player stats", windowPosX, windowPosY);
1041  if ( enabled )
1042  {
1043  DbgUI.Text(string.Format("Heat comfort: %1", data.m_PlayerData.m_HeatComfort));
1044  DbgUI.Text(string.Format("Inside: %1 (%2)", data.m_PlayerData.m_Inside, data.m_PlayerData.m_Surface));
1045  DbgUI.Text(string.Format("Under roof: %1 (%2)", data.m_PlayerData.m_UnderRoof, data.m_PlayerData.m_UnderRoofTimer));
1046  if ( data.m_PlayerData.m_WaterLevel > 0 )
1047  {
1048  DbgUI.Text(string.Format("Water Level: %1", data.m_PlayerData.m_WaterLevel));
1049  }
1050 
1051  }
1052  DbgUI.End();
1053 
1054  DbgUI.Begin("Weather stats:", windowPosX, windowPosY + 200);
1055  if ( enabled )
1056  {
1057  DbgUI.Text(string.Format("Env temperature (base): %1", data.m_MiscData.m_TemperatureBase));
1058  DbgUI.Text(string.Format("Env temperature (modfied): %1", data.m_MiscData.m_TemperatureModified));
1059  DbgUI.Text(string.Format("Wind: %1 (x%2)", data.m_WeatherData.m_Wind, data.m_WeatherData.m_WindModifier));
1060  DbgUI.Text(string.Format("Rain: %1", data.m_WeatherData.m_Rain));
1061  DbgUI.Text(string.Format("Day/Night (1/0): %1", data.m_MiscData.m_DayOrNight));
1062  DbgUI.Text(string.Format("Fog: %1", data.m_WeatherData.m_Fog));
1063  DbgUI.Text(string.Format("Clouds: %1", data.m_WeatherData.m_Clouds));
1064  DbgUI.Text(string.Format("Height: %1", data.m_MiscData.m_Height));
1065  DbgUI.Text(string.Format("Wet delta: %1", data.m_MiscData.m_WetDelta));
1066  }
1067  DbgUI.End();
1068  }
1069 
1070  void FillDebugWeatherData(EnvDebugWeatherData data)
1071  {
1072  data.m_Wind = m_Wind;
1073  data.m_WindModifier = GetWindModifierPerSurface();
1074  data.m_Rain = m_Rain;
1075  data.m_Fog = m_Fog;
1076  data.m_Clouds = m_Clouds;
1077  }
1078 #endif
1079 
1080  string GetDebugMessage()
1081  {
1082  string message;
1083  message += "Player stats";
1084  message += "\nHeat comfort: " + m_HeatComfort.ToString();
1085  message += "\nInside: " + IsInsideBuilding().ToString() + " (" + m_Player.GetSurfaceType() + ")";
1086  message += "\nUnder roof: " + m_IsUnderRoof.ToString() + " (" + GetNextRoofCheck() + ")";
1087  if (IsWaterContact() && m_WaterLevel > WATER_LEVEL_NONE)
1088  {
1089  message += "\nWater Level: " + m_WaterLevel;
1090  }
1091 
1092  message += "\n\nWeather stats";
1093  message += "\nEnv temperature (base): " + g_Game.GetMission().GetWorldData().GetBaseEnvTemperature().ToString();
1094  message += "\nEnv temperature (modified): " + m_EnvironmentTemperature.ToString();
1095  message += "\nWind: " + m_Wind.ToString() + " (x" + GetWindModifierPerSurface() + ")";
1096  message += "\nRain: " + m_Rain.ToString();
1097  message += "\nDay/Night (1/0): " + m_DayOrNight.ToString();
1098  message += "\nFog: " + m_Fog.ToString();
1099  message += "\nClouds: " + m_Clouds.ToString();
1100  message += "\nHeight: " + GetTemperatureHeightCorrection().ToString();
1101  message += "\nWet delta: " + GetWetDelta().ToString();
1102 
1103  return message;
1104  }
1105 
1106  int GetNextRoofCheck()
1107  {
1108  return (GameConstants.ENVIRO_TICK_ROOF_RC_CHECK - m_RoofCheckTimer) + 1;
1109  }
1110 
1111  float GetWaterLevel()
1112  {
1113  if (IsWaterContact() && m_WaterLevel > WATER_LEVEL_NONE)
1114  {
1115  return m_WaterLevel;
1116  }
1117  else
1118  {
1119  return 0;
1120  }
1121  }
1122 
1123  float GetDayOrNight()
1124  {
1125  return m_DayOrNight;
1126  }
1127 
1128  private void LogDryWetProcess(string message, bool indented = false)
1129  {
1130  #ifdef DIAG_DEVELOPER
1131  if (m_DebugLogDryWet)
1132  {
1133  string indentation = "";
1134  if (indented)
1135  indentation = "|--";
1136 
1137  Debug.Log(string.Format("%1 %2", indentation, message));
1138  }
1139  #endif
1140  }
1141 }
1142 
1143 class EnvironmentDrynessData
1144 {
1145  bool m_UseTemperatureSources = false;
1147 }
1148 
1149 #ifdef DIAG_DEVELOPER
1150 class EnvDebugPlayerData : Param
1151 {
1152  float m_HeatComfort;
1153  bool m_Inside;
1154  string m_Surface;
1155  bool m_UnderRoof;
1156  int m_UnderRoofTimer;
1157  float m_WaterLevel;
1158 
1159  void Synch(Environment env, PlayerBase player)
1160  {
1161  m_HeatComfort = player.GetStatHeatComfort().Get();
1162  m_Inside = env.IsInsideBuilding();
1163  m_Surface = player.GetSurfaceType();
1164  m_UnderRoof = env.IsUnderRoof();
1165  m_UnderRoofTimer = env.GetNextRoofCheck();
1166  m_WaterLevel = env.GetWaterLevel();
1167  }
1168 
1169  override bool Serialize(Serializer ctx)
1170  {
1171  return (
1172  ctx.Write(m_HeatComfort) && ctx.Write(m_Inside) && ctx.Write(m_Surface) && ctx.Write(m_UnderRoof) && ctx.Write(m_UnderRoofTimer) && ctx.Write(m_WaterLevel));
1173  }
1174 
1175  override bool Deserializer(Serializer ctx)
1176  {
1177  return ctx.Read(m_HeatComfort) && ctx.Read(m_Inside) && ctx.Read(m_Surface) && ctx.Read(m_UnderRoof) && ctx.Read(m_UnderRoofTimer) && ctx.Read(m_WaterLevel);
1178  }
1179 }
1180 
1181 class EnvDebugMiscData : Param
1182 {
1183  float m_TemperatureBase;
1184  float m_TemperatureModified;
1185  float m_DayOrNight;
1186  float m_Height;
1187  float m_WetDelta;
1188 
1189  void Synch(Environment env)
1190  {
1191  m_TemperatureBase = g_Game.GetMission().GetWorldData().GetBaseEnvTemperature();
1192  m_TemperatureModified = env.GetTemperature();
1193  m_DayOrNight = env.GetDayOrNight();
1194  m_Height = env.GetTemperatureHeightCorrection();
1195  m_WetDelta = env.GetWetDelta();
1196  }
1197 
1198  override bool Serialize(Serializer ctx)
1199  {
1200  return ctx.Write(m_TemperatureBase) && ctx.Write(m_TemperatureModified) && ctx.Write(m_DayOrNight) && ctx.Write(m_Height) && ctx.Write(m_WetDelta);
1201  }
1202 
1203  override bool Deserializer(Serializer ctx)
1204  {
1205  return ctx.Read(m_TemperatureBase) && ctx.Read(m_TemperatureModified) && ctx.Read(m_DayOrNight) && ctx.Read(m_Height) && ctx.Read(m_WetDelta);
1206  }
1207 }
1208 
1209 class EnvDebugWeatherData : Param
1210 {
1211  float m_Wind;
1212  float m_WindModifier;
1213  float m_Rain;
1214  float m_Fog;
1215  float m_Clouds;
1216 
1217  void Synch(Environment env)
1218  {
1219  env.FillDebugWeatherData(this);
1220  }
1221 
1222  override bool Serialize(Serializer ctx)
1223  {
1224  return ctx.Write(m_Wind) && ctx.Write(m_WindModifier) && ctx.Write(m_Rain) && ctx.Write(m_Fog) && ctx.Write(m_Clouds);
1225  }
1226 
1227  override bool Deserializer(Serializer ctx)
1228  {
1229  return ctx.Read(m_Wind) && ctx.Read(m_WindModifier) && ctx.Read(m_Rain) && ctx.Read(m_Fog) && ctx.Read(m_Clouds);
1230  }
1231 }
1232 
1233 class EnvDebugData : Param
1234 {
1235  ref EnvDebugPlayerData m_PlayerData = new EnvDebugPlayerData();
1236  ref EnvDebugMiscData m_MiscData = new EnvDebugMiscData();
1237  ref EnvDebugWeatherData m_WeatherData = new EnvDebugWeatherData();
1238 
1239  void Synch(Environment env, PlayerBase player)
1240  {
1241  m_PlayerData.Synch(env, player);
1242  m_MiscData.Synch(env);
1243  m_WeatherData.Synch(env);
1244  }
1245 
1246  override bool Serialize(Serializer ctx)
1247  {
1248  return m_PlayerData.Serialize(ctx) && m_MiscData.Serialize(ctx) && m_WeatherData.Serialize(ctx);
1249  }
1250 
1251  override bool Deserializer(Serializer ctx)
1252  {
1253  return m_PlayerData.Deserializer(ctx) && m_MiscData.Deserializer(ctx) && m_WeatherData.Deserializer(ctx);
1254  }
1255 }
1256 #endif
ItemBase
Definition: inventoryitem.c:730
GetGame
proto native CGame GetGame()
m_Time
protected float m_Time
Definition: carscript.c:146
LIQUID_RIVERWATER
const int LIQUID_RIVERWATER
Definition: constants.c:506
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition: param.c:11
DbgUI
Definition: dbgui.c:59
InventorySlots
provides access to slot configuration
Definition: inventoryslots.c:5
InventoryLocation
InventoryLocation.
Definition: inventorylocation.c:27
LIQUID_WATER
const int LIQUID_WATER
Definition: constants.c:505
HumanMovementState
Definition: human.c:1125
Serializer
Serialization general interface. Serializer API works with:
Definition: serializer.c:55
m_UseTemperatureSources
class Environment m_UseTemperatureSources
GetPosition
class JsonUndergroundAreaTriggerData GetPosition
Definition: undergroundarealoader.c:9
PlayerBase
Definition: playerbaseclient.c:1
PlayerConstants
Definition: playerconstants.c:1
vector
Definition: enconvert.c:105
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
windowPosX
class PresenceNotifierNoiseEvents windowPosX
dbgUI settings
windowPosY
const int windowPosY
Definition: pluginpresencenotifier.c:80
HumanCommandMove
Definition: human.c:433
g_Game
DayZGame g_Game
Definition: dayzgame.c:3727
Serialize
void Serialize()
Definition: inventory.c:193
Object
Definition: objecttyped.c:1
m_Player
DayZPlayer m_Player
Definition: hand_events.c:42
m_Surface
string m_Surface
Definition: impacteffects.c:17
Environment
Definition: environment.c:1
House
Definition: crashbase.c:1
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition: isboxcollidinggeometryproxyclasses.c:27
Synch
protected void Synch(EntityAI victim)
keeping "step" here for consistency only
Definition: trapbase.c:298
GameConstants
Definition: constants.c:612
Debug
Definition: debug.c:13
DayZPhysics
Definition: dayzphysics.c:123
m_TemperatureSourceDistance
float m_TemperatureSourceDistance
Definition: environment.c:1146
Math
Definition: enmath.c:6
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
Weather
Definition: weather.c:154
EntityAI
Definition: building.c:5
PhxInteractionLayers
PhxInteractionLayers
Definition: dayzphysics.c:1