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

Защищенные члены

float GetPlayerHeat ()
 Returns heat player generated based on player's movement speed (for now)
 
bool IsUnderRoof ()
 
bool IsWaterContact ()
 
bool IsInsideBuilding ()
 
bool IsInsideVehicle ()
 
bool IsRaining ()
 
bool IsSnowing ()
 
bool DetermineHeatcomfortBehavior ()
 
void CheckUnderRoof ()
 Checks whether Player is sheltered.
 
void CheckWaterContact (out float pWaterLevel)
 
float GetWindModifierPerSurface ()
 
float GetTemperature ()
 
float GetTargetHeatComfort ()
 
float GetEnvironmentTemperature ()
 
float GetWetDelta ()
 
void CollectAndSetPlayerData ()
 
void CollectAndSetEnvironmentData ()
 
void SetEnvironmentTemperature ()
 
void SetAreaGenericColdness ()
 Determines whether player is in cold area which restricts use of some actions (digging)
 
float WindEffectTemperatureValue (float temperatureInput)
 
void ProcessWetnessByWaterLevel (float pWaterLevel)
 process attachments by water depth
 
void ProcessItemsWetness (array< int > pSlotIds)
 
void ProcessItemsDryness ()
 
void ApplyWetnessToItem (ItemBase pItem)
 
void ApplyDrynessToItem (ItemBase pItem)
 
void ApplyDrynessToItemEx (ItemBase pItem, EnvironmentDrynessData pDrynessData)
 
void ProcessHeatComfort ()
 Calculates and process player's heatcomfort related to body parts.
 
void SetTargetHeatComfort (float value)
 
void SetHeatcomfortDirectly ()
 
void ProcessHeatBuffer (float heatComfortCloths)
 
float GetApplicableHeatbuffer ()
 
void ProcessItemsTemperature (array< int > pBodyPartIds)
 go through all items in player's possession cool/warm them to neutral temperature
 
void ProcessItemsInHandsTemperature ()
 
void ProcessItemHierarchyRecursive (ItemBase item, float heatPermeabilityCoef=1.0)
 
void SetProcessedItemTemperature (ItemBase item, float heatPermeabilityCoef=1.0)
 
float EnvTempToCoef (float pTemp)
 
void BodyPartHeatProperties (int pBodyPartId, float pCoef, out float pHeatComfort, out float pHeat)
 returns enhanced heat comfort for given body part
 
float NakedBodyPartHeatComfortPenalty (int pBodyPartSlotId, float pCoef)
 
void GatherTemperatureSources ()
 
void SetItemHeatingCoef (float val)
 
void ProcessTemperatureSources ()
 
void OnTemperatureSourcesEnter ()
 
void OnTemperatureSourcesLeft ()
 
void SetEnvironmentSnapshotData ()
 
float GetUniversalSourcesTemperageAverage ()
 
float CalcTemperatureFromTemperatureSource (notnull UTemperatureSource uts)
 
string GetDebugMessage ()
 debug
 
int GetNextRoofCheck ()
 
float GetWaterLevel ()
 
void Init (PlayerBase pPlayer)
 
bool OverridenHeatComfort (out float value)
 
void AddToEnvironmentTemperature (float pTemperature)
 
void ProcessItemsHeat ()
 
void ProcessWetnessByRain ()
 
float GetTemperatureHeightCorrection ()
 
void BodyPartHeatProperties (array< int > pBodyPartIds, float pCoef, out float pHeatComfort, out float pHeat)
 returns weighted avg heat comfort for bodypart
 
float GetDayOrNight ()
 

Защищенные данные

const float SNOWFALL_LIMIT_LOW = 0.5
 
const float SNOWFALL_WIND_COMBINED_THRESHOLD = 1.3
 
const float WATER_LEVEL_HIGH = 1.5
 
const float WATER_LEVEL_MID = 1.2
 
const float WATER_LEVEL_LOW = 0.5
 
const float WATER_LEVEL_NONE = 0.15
 
float m_WetDryTick
 
float m_ItemsWetnessMax
 
float m_RoofCheckTimer
 keeps wetness of most wet item in player's possesion
 
PlayerBase m_Player
 
float m_PlayerHeightPos
 
float m_PlayerSpeed
 
float m_PlayerTemperature
 
float m_PlayerHeat
 
float m_HeatComfort
 
float m_TargetHeatComfort
 player's heatcomfort (buffered, stored in player stats)
 
float m_Rain = 0
 target value of heatcomfort (non-buffered)
 
float m_Snowfall = 0
 
float m_Wind = 0
 
float m_Fog = 0
 
float m_DayOrNight = 0
 
float m_Clouds = 0
 
float m_EnvironmentTemperature
 
float m_Time = 0
 
string m_SurfaceType
 
int m_LiquidType
 
float m_ItemTemperatureCoef
 
float m_WaterLevel
 
bool m_IsUnderRoof
 
bool m_IsInWater
 
bool m_IsTempSet
 
float m_HeatBufferTimer
 
ref array< intm_SlotIdsComplete
 reused as state toggle
 
ref array< intm_SlotIdsUpper
 
ref array< intm_SlotIdsBottom
 
ref array< intm_SlotIdsLower
 
ref array< intm_HeadParts
 
ref array< intm_BodyParts
 
ref array< intm_FeetParts
 
ref WorldData m_WorldData
 
bool m_HasTemperatureSources
 
float m_UTSAverageTemperature
 
ref array< UTemperatureSourcem_UTemperatureSources
 
ref SimpleMovingAverage< floatm_UTSAverageTemperatureBuffer
 
ref SimpleMovingAverage< floatm_AverageHeatComfortBuffer
 
int m_HeatComfortBehaviorCategory
 
ref EnvironmentSnapshotData m_EnvironmentSnapshot
 
float m_HeatSourceTemp
 DEPRECATED.
 
ref SimpleMovingAverage< floatm_WindAverageBuffer
 

Закрытые члены

void Environment (PlayerBase pPlayer)
 
void Init ()
 
void Update (float pDelta)
 
bool IsTemperatureSet ()
 
bool IsUnderRoofBuilding ()
 
bool IsNeutralTemperature (float temperature, float lowerLimit=GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT, float upperLimit=GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT)
 
float NormalizedTemperature (float temperature, float lowerLimit=GameConstants.ENVIRO_LOW_TEMP_LIMIT, float upperLimit=GameConstants.ENVIRO_HIGH_TEMP_LIMIT)
 
void LogDryWetProcess (string message, bool indented=false)
 
void LogItemHeat (string message, bool indented=false)
 

Закрытые данные

const float RAIN_LIMIT_LOW = 0.05
 
bool m_IsUnderRoofBuilding
 
bool m_Initialized
 used for calculations before the data modification
 

Подробное описание

Конструктор(ы)

◆ Environment()

void Environment ( PlayerBase pPlayer)
inlineprivate
92 {
94 }
PlayerBase m_Player
Definition Environment.c:29
Definition EntityAI.c:95

Перекрестные ссылки m_Player.

Методы

◆ AddToEnvironmentTemperature()

void AddToEnvironmentTemperature ( float pTemperature)
protected

◆ ApplyDrynessToItem()

void ApplyDrynessToItem ( ItemBase pItem)
inlineprotected
745 {
748 }
void ApplyDrynessToItemEx(ItemBase pItem, EnvironmentDrynessData pDrynessData)
Definition Environment.c:750

Перекрестные ссылки ApplyDrynessToItemEx().

◆ ApplyDrynessToItemEx()

void ApplyDrynessToItemEx ( ItemBase pItem,
EnvironmentDrynessData pDrynessData )
inlineprotected

adds wetness to item inside parent item containing liquid

adds wetness to item inside wet parent item

751 {
752 if (pItem)
753 {
754 float dryingIncrement = pItem.GetDryingIncrement("player");
755 if (pDrynessData.m_UseTemperatureSources)
756 dryingIncrement = pItem.GetDryingIncrement("playerHeatSource");
757
759 bool isParentWet = false;
760 bool parentContainsLiquid = false;
761
763 if (pItem.GetInventory().GetCurrentInventoryLocation(iLoc))
764 {
765 EntityAI parent = iLoc.GetParent();
766 if (parent)
767 {
768 parentItem = ItemBase.Cast(parent);
769 if (parentItem)
770 {
772 isParentWet = true;
773
774 if ((parentItem.GetLiquidType() != 0) && (parentItem.GetQuantity() > 0))
776 }
777
778 if ((pItem.GetWet() > m_ItemsWetnessMax) && (parent == m_Player))
779 m_ItemsWetnessMax = pItem.GetWet();
780 }
781 }
782
783 float dryingCoef = 0;
784
786 {
787
788 dryingCoef = (-1 * GameConstants.ENVIRO_TICK_RATE * dryingIncrement) / pDrynessData.m_TemperatureSourceDistance;
789 if (pItem.GetWet() >= GameConstants.STATE_DAMP)
790 {
791 LogDryWetProcess(string.Format("%1 (dry coef=%2/s, current wetness=%3) [normal]", pItem.GetDisplayName(), dryingCoef / GameConstants.ENVIRO_TICK_RATE, pItem.GetWet()), parentItem != null);
792 pItem.AddWet(dryingCoef);
793 }
794
795 if (pItem.GetInventory().GetCargo())
796 {
797 int inItemCount = pItem.GetInventory().GetCargo().GetItemCount();
798 for (int i = 0; i < inItemCount; ++i)
799 {
801 if (Class.CastTo(inItem, pItem.GetInventory().GetCargo().GetItem(i)))
803 }
804 }
805
806 int attCount = pItem.GetInventory().AttachmentCount();
807 if (attCount > 0)
808 {
809 for (int attIdx = 0; attIdx < attCount; ++attIdx)
810 {
811 EntityAI attachment = pItem.GetInventory().GetAttachmentFromIndex(attIdx);
813 if (ItemBase.CastTo(itemAtt, attachment))
815 }
816 }
817 }
818
820 {
822 dryingCoef = (GameConstants.ENVIRO_TICK_RATE * pItem.GetSoakingIncrement("parentWithLiquid")) / pDrynessData.m_TemperatureSourceDistance;
823 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);
824 pItem.AddWet(dryingCoef);
825 }
826
827 if (isParentWet)
828 {
829 if (pItem.GetWet() < parentItem.GetWet())
830 {
832 dryingCoef = (GameConstants.ENVIRO_TICK_RATE * pItem.GetSoakingIncrement("wetParent")) / pDrynessData.m_TemperatureSourceDistance;
833 LogDryWetProcess(string.Format("%1 (dry coef=%2/s, current wetness=%3) [parent wet]", pItem.GetDisplayName(), dryingCoef / GameConstants.ENVIRO_TICK_RATE, pItem.GetWet()), parentItem != null);
834 pItem.AddWet(dryingCoef);
835 }
836 }
837 }
838 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Building.c:6
void LogDryWetProcess(string message, bool indented=false)
Definition Environment.c:1462
float m_ItemsWetnessMax
Definition Environment.c:25
Definition constants.c:638
InventoryLocation.
Definition InventoryLocation.c:29
Definition InventoryItem.c:731
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const float ENVIRO_TICK_RATE
Definition constants.c:697
const float STATE_SOAKING_WET
Definition constants.c:832
const float STATE_DAMP
Definition constants.c:834

Перекрестные ссылки ApplyDrynessToItemEx(), Class::CastTo(), GameConstants::ENVIRO_TICK_RATE, LogDryWetProcess(), m_ItemsWetnessMax, m_Player, GameConstants::STATE_DAMP и GameConstants::STATE_SOAKING_WET.

Используется в ApplyDrynessToItem(), ApplyDrynessToItemEx() и ProcessItemsDryness().

◆ ApplyWetnessToItem()

void ApplyWetnessToItem ( ItemBase pItem)
inlineprotected
664 {
665 if (pItem)
666 {
668 bool isParentWet = false;
669 bool parentContainsLiquid = false;
671
672 if (pItem.GetInventory().GetCurrentInventoryLocation(iLoc))
673 {
674 EntityAI parent = iLoc.GetParent();
675 if (parent)
676 {
677 parentItem = ItemBase.Cast(parent);
678 if (parentItem)
679 {
681 isParentWet = true;
682
683 if ((parentItem.GetLiquidType() != 0) && (parentItem.GetQuantity() > 0))
685 }
686 else
687 isParentWet = true;
688
689 if ((pItem.GetWet() > m_ItemsWetnessMax) && (parent == m_Player))
690 m_ItemsWetnessMax = pItem.GetWet();
691 }
692 }
693
695 {
696 float soakingCoef = 0;
698 {
699 soakingCoef = pItem.GetSoakingIncrement("parentWithLiquid");
700 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);
701 }
702 else if (isParentWet && parentItem)
703 {
704 if (pItem.GetWet() < parentItem.GetWet())
705 {
706 soakingCoef = pItem.GetSoakingIncrement("wetParent");
707 LogDryWetProcess(string.Format("%1 (soak coef=%2/s, current wetness=%3) [parent wet]", pItem.GetDisplayName(), soakingCoef / GameConstants.ENVIRO_TICK_RATE, pItem.GetWet()), parentItem != null);
708 }
709 }
710 else
711 {
713 LogDryWetProcess(string.Format("%1 (soak coef=%2/s, current wetness=%3) [normal]", pItem.GetDisplayName(), soakingCoef / GameConstants.ENVIRO_TICK_RATE, pItem.GetWet()), parentItem != null);
714 }
715
716 pItem.AddWet(soakingCoef);
717
718 if (pItem.GetInventory().GetCargo())
719 {
720 int inItemCount = pItem.GetInventory().GetCargo().GetItemCount();
721 for (int i = 0; i < inItemCount; ++i)
722 {
724 if (Class.CastTo(inItem, pItem.GetInventory().GetCargo().GetItem(i)))
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);
736 if (itemAtt)
738 }
739 }
740 }
741 }
742 }
float GetWetDelta()
Definition Environment.c:470
void ApplyWetnessToItem(ItemBase pItem)
Definition Environment.c:663

Перекрестные ссылки ApplyWetnessToItem(), Class::CastTo(), GameConstants::ENVIRO_TICK_RATE, GetWetDelta(), LogDryWetProcess(), m_ItemsWetnessMax, m_Player и GameConstants::STATE_SOAKING_WET.

Используется в ApplyWetnessToItem() и ProcessItemsWetness().

◆ BodyPartHeatProperties() [1/2]

void BodyPartHeatProperties ( array< int > pBodyPartIds,
float pCoef,
out float pHeatComfort,
out float pHeat )
inlineprotected

returns weighted avg heat comfort for bodypart

go through all body parts we've defined for that zone (ex.: head, body, feet)

1522 {
1523 pHeatComfort = 0;
1524 pHeat = 0;
1525
1526 if (pBodyPartIds.Count() > 0)
1527 {
1528 LogItemHeat(string.Format("BodyPartHeatProperties (%1)", EnumTools.EnumToString(InventorySlots, pBodyPartIds[0])));
1529
1530 int attCount = m_Player.GetInventory().AttachmentCount();
1531 for (int attIdx = 0; attIdx < attCount; ++attIdx)
1532 {
1533 EntityAI attachment = m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
1534 if (attachment.IsClothing())
1535 {
1537 int attachmentSlot = attachment.GetInventory().GetSlotId(0);
1538
1540 for (int i = 0; i < pBodyPartIds.Count(); ++i)
1541 {
1543 {
1544 float heatIsoMult = 1.0;
1545 if (attachmentSlot == InventorySlots.BACK)
1547 else if (attachmentSlot == InventorySlots.VEST)
1549
1550 pHeatComfort += heatIsoMult * MiscGameplayFunctions.GetCurrentItemHeatIsolation(item);
1551
1552 float itemHeatcomfort = 0;
1553 float itemTemperature = 0;
1554
1555 // go through any attachments and cargo (only current level, ignore nested containers - they isolate)
1556 int inventoryAttCount = item.GetInventory().AttachmentCount();
1557 if (inventoryAttCount > 0)
1558 {
1559 LogItemHeat(string.Format("attachments:"), false);
1560 for (int inAttIdx = 0; inAttIdx < inventoryAttCount; ++inAttIdx)
1561 {
1562 EntityAI inAttachment = item.GetInventory().GetAttachmentFromIndex(inAttIdx);
1564 if (attachmentItem && attachmentItem.CanHaveTemperature())
1565 {
1566 itemTemperature = attachmentItem.GetTemperature();
1568 {
1569 itemHeatcomfort = NormalizedTemperature(itemTemperature) * attachmentItem.GetQuantityNormalizedScripted() * attachmentItem.GetTemperaturePerQuantityWeight();
1570 LogItemHeat(string.Format("%1: temperature=%2 heat=%3", attachmentItem, itemTemperature, pHeat), true);
1572 }
1573 }
1574 }
1575 }
1576 if (item.GetInventory().GetCargo())
1577 {
1578 int inventoryItemCount = item.GetInventory().GetCargo().GetItemCount();
1579
1580 if (inventoryItemCount > 0)
1581 {
1582 LogItemHeat(string.Format("cargo:"), false);
1583 for (int j = 0; j < inventoryItemCount; ++j)
1584 {
1585 ItemBase inventoryItem = ItemBase.Cast(item.GetInventory().GetCargo().GetItem(j));
1586 if (inventoryItem && inventoryItem.CanHaveTemperature())
1587 {
1588 itemTemperature = inventoryItem.GetTemperature();
1590 {
1591 itemHeatcomfort = NormalizedTemperature(itemTemperature) * inventoryItem.GetQuantityNormalizedScripted() * inventoryItem.GetTemperaturePerQuantityWeight();
1592 LogItemHeat(string.Format("%1: temperature=%2 heat=%3", inventoryItem, itemTemperature, itemHeatcomfort), true);
1594 }
1595 }
1596 }
1597 }
1598 }
1599 }
1600 }
1601 }
1602 }
1603
1605
1606 LogItemHeat(string.Format("overall heat from items=%1 (coef applied)", pHeat));
1607 LogItemHeat("");
1608 }
1609 }
Definition EnConvert.c:590
static string EnumToString(typename e, int enumValue)
Return string name of enum value.
Definition EnConvert.c:601
void LogItemHeat(string message, bool indented=false)
Definition Environment.c:1476
float NormalizedTemperature(float temperature, float lowerLimit=GameConstants.ENVIRO_LOW_TEMP_LIMIT, float upperLimit=GameConstants.ENVIRO_HIGH_TEMP_LIMIT)
Definition Environment.c:1447
provides access to slot configuration
Definition InventorySlots.c:6
const float ENVIRO_HEATISOLATION_BACK_WEIGHT
how much this feet parts (clothing) affects final heatcomfort
Definition constants.c:1049
const float ENVIRO_HEATISOLATION_VEST_WEIGHT
weight of back for the sum of heat isolation
Definition constants.c:1050
const float ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT
Definition constants.c:773

Перекрестные ссылки EnumTools::EnumToString(), GameConstants::ENVIRO_HEATISOLATION_BACK_WEIGHT, GameConstants::ENVIRO_HEATISOLATION_VEST_WEIGHT, GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT, LogItemHeat(), m_Player и NormalizedTemperature().

◆ BodyPartHeatProperties() [2/2]

void BodyPartHeatProperties ( int pBodyPartId,
float pCoef,
out float pHeatComfort,
out float pHeat )
inlineprotected

returns enhanced heat comfort for given body part

1120 {
1121 pHeatComfort = 0;
1122 pHeat = 0;
1123
1124 int attCount = m_Player.GetInventory().AttachmentCount();
1125 for (int attIdx = 0; attIdx < attCount; ++attIdx)
1126 {
1127 EntityAI attachment = m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
1128 if (attachment.IsClothing())
1129 {
1131 int attachmentSlot = attachment.GetInventory().GetSlotId(0);
1132
1134 {
1135 LogItemHeat(string.Format("BodyPartHeatProperties (%1)", EnumTools.EnumToString(InventorySlots, pBodyPartId)));
1136
1137 float itemHeatcomfort = 0;
1138 float itemTemperature = 0;
1139
1140 // go through any attachments and cargo (only current level, ignore nested containers - they isolate)
1141 int inventoryAttCount = item.GetInventory().AttachmentCount();
1142 if (inventoryAttCount > 0)
1143 {
1144 LogItemHeat(string.Format("attachments:"), false);
1145 for (int inAttIdx = 0; inAttIdx < inventoryAttCount; ++inAttIdx)
1146 {
1147 EntityAI inAttachment = item.GetInventory().GetAttachmentFromIndex(inAttIdx);
1149 if (attachmentItem && attachmentItem.CanHaveTemperature())
1150 {
1151 itemTemperature = attachmentItem.GetTemperature();
1153 {
1154 itemHeatcomfort = NormalizedTemperature(itemTemperature) * attachmentItem.GetQuantityNormalizedScripted() * attachmentItem.GetTemperaturePerQuantityWeight();
1155 LogItemHeat(string.Format("%1: temperature=%2 heat=%3", attachmentItem, itemTemperature, pHeat), true);
1157 }
1158 }
1159 }
1160 }
1161 if (item.GetInventory().GetCargo())
1162 {
1163 int inventoryItemCount = item.GetInventory().GetCargo().GetItemCount();
1164
1165 if (inventoryItemCount > 0)
1166 {
1167 LogItemHeat(string.Format("cargo:"), false);
1168 for (int j = 0; j < inventoryItemCount; ++j)
1169 {
1170 ItemBase inventoryItem = ItemBase.Cast(item.GetInventory().GetCargo().GetItem(j));
1171 if (inventoryItem && inventoryItem.CanHaveTemperature())
1172 {
1173 itemTemperature = inventoryItem.GetTemperature();
1175 {
1176 itemHeatcomfort = NormalizedTemperature(itemTemperature) * inventoryItem.GetQuantityNormalizedScripted() * inventoryItem.GetTemperaturePerQuantityWeight();
1177 LogItemHeat(string.Format("%1: temperature=%2 heat=%3", inventoryItem, itemTemperature, itemHeatcomfort), true);
1179 }
1180 }
1181 }
1182 }
1183 }
1184
1185 pHeatComfort = MiscGameplayFunctions.GetCurrentItemHeatIsolation(item) * pCoef;
1186
1187 LogItemHeat(string.Format("overall heat from items=%1 (coef applied)", pHeat));
1188 LogItemHeat("");
1189
1190 break;
1191 }
1192 }
1193 }
1194 }

Перекрестные ссылки EnumTools::EnumToString(), GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT, LogItemHeat(), m_Player и NormalizedTemperature().

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

◆ CalcTemperatureFromTemperatureSource()

float CalcTemperatureFromTemperatureSource ( notnull UTemperatureSource uts)
inlineprotected

heat transfer through air to player (env temperature)

1305 {
1306 float distance = vector.Distance(m_Player.GetPosition(), uts.GetPosition());
1307 distance = Math.Max(distance, 0.1); //min distance cannot be 0 (division by zero)
1308 float temperature = 0;
1309
1311 if (distance > uts.GetFullRange())
1312 {
1313 float distFactor = Math.InverseLerp(uts.GetMaxRange(), uts.GetFullRange(), distance);
1314 temperature = uts.GetTemperatureCap() * distFactor;
1315 }
1316 else
1317 {
1318 temperature = uts.GetTemperatureCap();
1319 }
1320
1321 return temperature;
1322 }
Definition EnMath.c:7
Definition EnConvert.c:106
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...

Перекрестные ссылки vector::Distance(), Math::InverseLerp(), m_Player и Math::Max().

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

◆ CheckUnderRoof()

void CheckUnderRoof ( )
inlineprotected

Checks whether Player is sheltered.

330 {
331 // if inside vehicle return immediatelly
332 if (IsInsideVehicle())
333 {
334 m_IsUnderRoof = false;
335 m_IsUnderRoofBuilding = false;
336 return;
337 }
338
339 float hitFraction;
341 vector from = m_Player.GetPosition();
342 vector to = from + "0 25 0";
345
347
349 }
PhxInteractionLayers
Definition DayZPhysics.c:2
Definition DayZPhysics.c:124
static proto bool RayCastBullet(vector begPos, vector endPos, PhxInteractionLayers layerMask, Object ignoreObj, out Object hitObject, out vector hitPosition, out vector hitNormal, out float hitFraction)
bool m_IsUnderRoofBuilding
Definition Environment.c:55
bool m_IsUnderRoof
Definition Environment.c:54
bool IsInsideVehicle()
Definition Environment.c:291
Definition CrashBase.c:2
Definition ObjectTyped.c:2

Перекрестные ссылки IsInsideVehicle(), m_IsUnderRoof, m_IsUnderRoofBuilding, m_Player и DayZPhysics::RayCastBullet().

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

◆ CheckWaterContact()

void CheckWaterContact ( out float pWaterLevel)
inlineprotected

no valid surface under character

sync info about water contact to player

update active surface

352 {
353
354 string surfType;
355 int liquidType;
356
357 m_IsInWater = false;
358 if (m_Player.IsSwimming())
359 {
360 g_Game.SurfaceUnderObjectByBoneCorrectedLiquid(m_Player, SurfaceAnimationBone.RightFrontLimb, surfType, liquidType);
363
364 m_IsInWater = true;
365 m_Player.SetInWater(m_IsInWater);
366
368 m_Player.GetMovementState(hms);
369
371 if (hms.m_iMovement >= DayZPlayerConstants.MOVEMENTIDX_WALK)
373
374 return;
375 }
376
379 {
380 m_IsInWater = false;
381 return;
382 }
383
384 string impact;
385 g_Game.SurfaceUnderObjectExCorrectedLiquid(m_Player, surfType, impact, liquidType);
386
387 switch (liquidType)
388 {
389 case LIQUID_SALTWATER:
390 case LIQUID_WATER:
394 case LIQUID_HOTWATER:
395 pWaterLevel = m_Player.GetCurrentWaterLevel();
396 m_IsInWater = true;
397 break;
398 }
399
401 m_Player.SetInWater(m_IsInWater);
402
406
407 }
DayZGame g_Game
Definition DayZGame.c:3815
bool m_IsInWater
Definition Environment.c:56
const float WATER_LEVEL_MID
Definition Environment.c:20
int m_LiquidType
Definition Environment.c:47
const float WATER_LEVEL_HIGH
Definition Environment.c:19
string m_SurfaceType
Definition Environment.c:46
bool IsUnderRoofBuilding()
Definition Environment.c:296
Definition human.c:1139
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
const int LIQUID_STILLWATER
Definition constants.c:529
const int LIQUID_HOTWATER
Definition constants.c:530
const int LIQUID_FRESHWATER
Definition constants.c:528
const int LIQUID_WATER
Definition constants.c:518
const int LIQUID_RIVERWATER
Definition constants.c:519
const int LIQUID_SALTWATER
Definition constants.c:527

Перекрестные ссылки g_Game, IsUnderRoofBuilding(), LIQUID_FRESHWATER, LIQUID_HOTWATER, LIQUID_RIVERWATER, LIQUID_SALTWATER, LIQUID_STILLWATER, LIQUID_WATER, m_IsInWater, m_LiquidType, m_Player, m_SurfaceType, WATER_LEVEL_HIGH и WATER_LEVEL_MID.

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

◆ CollectAndSetEnvironmentData()

void CollectAndSetEnvironmentData ( )
inlineprotected
540 {
541 Weather weather = g_Game.GetWeather();
542 m_Rain = weather.GetRain().GetActual();
543 m_Snowfall = weather.GetSnowfall().GetActual();
544 m_DayOrNight = g_Game.GetMission().GetWorldData().GetDaytime();
545 m_Fog = weather.GetFog().GetActual();
546 m_Clouds = weather.GetOvercast().GetActual();
547 m_Wind = g_Game.GetWeather().GetWindMagnitude().GetActual();
548
551 }
void SetAreaGenericColdness()
Determines whether player is in cold area which restricts use of some actions (digging)
Definition Environment.c:560
float m_Rain
target value of heatcomfort (non-buffered)
Definition Environment.c:38
float m_Snowfall
Definition Environment.c:39
float m_Wind
Definition Environment.c:40
float m_DayOrNight
Definition Environment.c:42
void SetEnvironmentTemperature()
Definition Environment.c:553
float m_Fog
Definition Environment.c:41
float m_Clouds
Definition Environment.c:43
Definition Weather.c:165

Перекрестные ссылки g_Game, m_Clouds, m_DayOrNight, m_Fog, m_Rain, m_Snowfall, m_Wind, SetAreaGenericColdness() и SetEnvironmentTemperature().

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

◆ CollectAndSetPlayerData()

void CollectAndSetPlayerData ( )
inlineprotected
525 {
526 vector playerPos = m_Player.GetPosition();
528
529 HumanCommandMove hcm = m_Player.GetCommand_Move();
530 if (hcm)
531 {
532 m_PlayerSpeed = hcm.GetCurrentMovementSpeed();
533 }
534
536 }
float m_PlayerSpeed
Definition Environment.c:31
float m_PlayerHeat
Definition Environment.c:33
float m_PlayerHeightPos
Definition Environment.c:30
float GetPlayerHeat()
Returns heat player generated based on player's movement speed (for now)
Definition Environment.c:270
Definition human.c:434

Перекрестные ссылки GetPlayerHeat(), m_Player, m_PlayerHeat, m_PlayerHeightPos и m_PlayerSpeed.

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

◆ DetermineHeatcomfortBehavior()

bool DetermineHeatcomfortBehavior ( )
inlineprotected
312 {
313 if (IsInsideVehicle())
314 {
315 CarScript car = CarScript.Cast(m_Player.GetParent());
316 if (car && car.EngineIsOn())
317 {
319 return true;
320 }
321 }
322
324
325 return false;
326 }
EEnvironmentHeatcomfortBehaviorCategory
Definition Environment.c:2
Definition CivilianSedan.c:2
int m_HeatComfortBehaviorCategory
Definition Environment.c:78

Перекрестные ссылки IsInsideVehicle(), m_HeatComfortBehaviorCategory и m_Player.

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

◆ EnvTempToCoef()

float EnvTempToCoef ( float pTemp)
inlineprotected
1114 {
1116 }
const float ENVIRO_TEMP_EFFECT_ON_PLAYER
comfort temperature of environment for the player
Definition constants.c:734
const float ENVIRO_PLAYER_COMFORT_TEMP
highest temperature(deg Celsius) where the player gets highest possible heat comfort (1)
Definition constants.c:733

Перекрестные ссылки GameConstants::ENVIRO_PLAYER_COMFORT_TEMP и GameConstants::ENVIRO_TEMP_EFFECT_ON_PLAYER.

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

◆ GatherTemperatureSources()

void GatherTemperatureSources ( )
inlineprotected

next temp source is too far

skip - this TS is not affecting player entities

1213 {
1214 m_UTemperatureSources.Clear();
1215
1217 GetGame().GetObjectsAtPosition(m_Player.GetPosition(), GameConstants.ENVIRO_TEMP_SOURCES_LOOKUP_RADIUS, nearestObjects, null);
1218
1220 {
1222 if (ent && ent.IsUniversalTemperatureSource() && ent != m_Player)
1223 {
1225 if (vector.DistanceSq(m_Player.GetPosition(), ent.GetPosition()) > Math.SqrFloat(ent.GetUniversalTemperatureSource().GetMaxRange()))
1226 continue;
1227
1229 if (ent.GetUniversalTemperatureSource().GetLambda().AffectsPlayer())
1230 m_UTemperatureSources.Insert(ent.GetUniversalTemperatureSource());
1231 }
1232 }
1233
1234 if (m_Player.GetItemInHands() && m_Player.GetItemInHands().IsUniversalTemperatureSource())
1235 m_UTemperatureSources.Insert(m_Player.GetItemInHands().GetUniversalTemperatureSource());
1236 }
ref array< UTemperatureSource > m_UTemperatureSources
Definition Environment.c:74
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
proto native CGame GetGame()
const float ENVIRO_TEMP_SOURCES_LOOKUP_RADIUS
Definition constants.c:754
static proto float SqrFloat(float f)
Returns squared value.

Перекрестные ссылки vector::DistanceSq(), GameConstants::ENVIRO_TEMP_SOURCES_LOOKUP_RADIUS, GetGame(), m_Player, m_UTemperatureSources и Math::SqrFloat().

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

◆ GetApplicableHeatbuffer()

float GetApplicableHeatbuffer ( )
inlineprotected
1007 {
1008 float applicableHeatbuffer = Math.Round((m_Player.GetStatHeatBuffer().Get() / m_Player.GetStatHeatBuffer().GetMax()) * 1000) * 0.001;
1009 return applicableHeatbuffer;
1010 }
static proto float Round(float f)
Returns mathematical round of value.

Перекрестные ссылки m_Player и Math::Round().

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

◆ GetDayOrNight()

float GetDayOrNight ( )
inlineprotected
1612 {
1613 return m_DayOrNight;
1614 }

Перекрестные ссылки m_DayOrNight.

◆ GetDebugMessage()

string GetDebugMessage ( )
inlineprotected

debug

1390 {
1391 string message;
1392 message += "Player stats";
1393 message += "\nHeat comfort(target): " + GetTargetHeatComfort().ToString();
1394 message += "\nHeat comfort(dynamic): " + m_HeatComfort.ToString();
1395
1396 int liquidType;
1397 string impact, surfaceType;
1398 g_Game.SurfaceUnderObjectExCorrectedLiquid(m_Player, surfaceType, impact, liquidType);
1399
1400 message += "\nInside: " + IsInsideBuilding().ToString();
1401 message += "\nSurface: " + surfaceType;
1402 message += "\nLiquid: " + liquidType;
1403 message += "\nUnder roof: " + m_IsUnderRoof.ToString() + " (" + GetNextRoofCheck() + ")";
1405 {
1406 message += "\nWater Level: " + m_WaterLevel;
1407 }
1408
1409 message += "\n\nWeather stats";
1410 message += "\nEnv temperature (base): " + m_WorldData.GetBaseEnvTemperature().ToString();
1411 message += "\nEnv temperature (height corrected): " + m_WorldData.GetBaseEnvTemperatureAtObject(m_Player);
1412 message += "\nEnv temperature (modified): " + m_EnvironmentTemperature.ToString();
1413 message += "\nWind: " + m_Wind.ToString() + " (x" + GetWindModifierPerSurface() + ")";
1414 message += "\nRain: " + m_Rain.ToString();
1415 message += "\nSnow: " + m_Snowfall.ToString();
1416 message += "\nDatetime: " + WorldDataDaytime.ToString(m_DayOrNight);
1417 message += "\nFog: " + m_Fog.ToString();
1418 message += "\nClouds: " + m_Clouds.ToString();
1419 message += "\nWet delta: " + GetWetDelta().ToString();
1420
1421 return message;
1422 }
int GetNextRoofCheck()
Definition Environment.c:1424
bool IsWaterContact()
Definition Environment.c:281
bool IsInsideBuilding()
Definition Environment.c:286
float m_EnvironmentTemperature
Definition Environment.c:44
float GetWindModifierPerSurface()
Definition Environment.c:409
float m_HeatComfort
Definition Environment.c:34
ref WorldData m_WorldData
Definition Environment.c:70
const float WATER_LEVEL_NONE
Definition Environment.c:22
float m_WaterLevel
Definition Environment.c:53
float GetTargetHeatComfort()
Definition Environment.c:422
Definition WorldData.c:406
static string ToString(int value)
Definition WorldData.c:413
string ToString()
Definition EnConvert.c:3
proto string ToString()

Перекрестные ссылки g_Game, GetNextRoofCheck(), GetTargetHeatComfort(), GetWetDelta(), GetWindModifierPerSurface(), IsInsideBuilding(), IsWaterContact(), m_Clouds, m_DayOrNight, m_EnvironmentTemperature, m_Fog, m_HeatComfort, m_IsUnderRoof, m_Player, m_Rain, m_Snowfall, m_WaterLevel, m_Wind, m_WorldData, bool::ToString(), float::ToString(), WorldDataDaytime::ToString() и WATER_LEVEL_NONE.

◆ GetEnvironmentTemperature()

float GetEnvironmentTemperature ( )
inlineprotected
429 {
430 float temperature;
431 temperature = m_WorldData.GetBaseEnvTemperatureAtObject(m_Player);
432 temperature += m_Clouds * m_WorldData.m_CloudsTemperatureEffectModifier;
433
434 if (IsWaterContact())
435 {
436 float waterBodyTemperature = m_WorldData.GetLiquidTypeEnviroTemperature(m_LiquidType);
437 temperature = waterBodyTemperature - m_WorldData.m_WaterContactTemperatureModifier;
438
439 return temperature;
440 }
441
443 {
444 temperature += m_WorldData.m_TemperatureInsideBuildingsModifier;
445 }
446 else if (IsInsideVehicle())
447 {
449 return temperature;
450 }
451 else if (IsUnderRoof() && !m_IsUnderRoofBuilding)
452 {
455 }
456 else
457 {
460 }
461
462 // incorporate temperature from temperature sources (buffer)
465
466 return temperature;
467 }
float m_UTSAverageTemperature
Definition Environment.c:73
bool IsUnderRoof()
Definition Environment.c:276
float WindEffectTemperatureValue(float temperatureInput)
Definition Environment.c:566
const float ENVIRO_FOG_TEMP_EFFECT
how many % of ENVIRO_SUN_INCREMENT is reduced by fog
Definition constants.c:706
const float ENVIRO_TEMPERATURE_UNDERROOF_COEF
increases temp inside vehicles
Definition constants.c:711
const float ENVIRO_TEMPERATURE_INSIDE_VEHICLE_COEF
heat entity generates if not moving
Definition constants.c:710
static proto float AbsFloat(float f)
Returns absolute value.

Перекрестные ссылки Math::AbsFloat(), GameConstants::ENVIRO_FOG_TEMP_EFFECT, GameConstants::ENVIRO_TEMPERATURE_INSIDE_VEHICLE_COEF, GameConstants::ENVIRO_TEMPERATURE_UNDERROOF_COEF, GetWindModifierPerSurface(), IsInsideBuilding(), IsInsideVehicle(), IsUnderRoof(), IsWaterContact(), m_Clouds, m_Fog, m_IsUnderRoofBuilding, m_LiquidType, m_Player, m_UTSAverageTemperature, m_WorldData и WindEffectTemperatureValue().

Используется в GetWetDelta() и SetEnvironmentTemperature().

◆ GetNextRoofCheck()

int GetNextRoofCheck ( )
inlineprotected
1425 {
1427 }
float m_RoofCheckTimer
keeps wetness of most wet item in player's possesion
Definition Environment.c:26
const float ENVIRO_TICK_ROOF_RC_CHECK
each X (ticks) is processed wetness on items on player
Definition constants.c:699

Перекрестные ссылки GameConstants::ENVIRO_TICK_ROOF_RC_CHECK и m_RoofCheckTimer.

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

◆ GetPlayerHeat()

float GetPlayerHeat ( )
inlineprotected

Returns heat player generated based on player's movement speed (for now)

271 {
273 return heat;
274 }
const float ENVIRO_DEFAULT_ENTITY_HEAT
how many times slower is wetting/drying items in backpacks
Definition constants.c:709

Перекрестные ссылки GameConstants::ENVIRO_DEFAULT_ENTITY_HEAT и m_PlayerSpeed.

Используется в CollectAndSetPlayerData() и ProcessHeatComfort().

◆ GetTargetHeatComfort()

float GetTargetHeatComfort ( )
inlineprotected
423 {
424 return m_TargetHeatComfort;
425 }
float m_TargetHeatComfort
player's heatcomfort (buffered, stored in player stats)
Definition Environment.c:35

Перекрестные ссылки m_TargetHeatComfort.

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

◆ GetTemperature()

float GetTemperature ( )
inlineprotected
418 {
420 }

Перекрестные ссылки m_EnvironmentTemperature.

◆ GetTemperatureHeightCorrection()

float GetTemperatureHeightCorrection ( )
inlineprotected
1515 {
1516 float temperature_reduction = Math.Max(0, (m_PlayerHeightPos * m_WorldData.m_TemperaturePerHeightReductionModifier));
1517 return temperature_reduction;
1518 }

Перекрестные ссылки m_PlayerHeightPos, m_WorldData и Math::Max().

◆ GetUniversalSourcesTemperageAverage()

float GetUniversalSourcesTemperageAverage ( )
inlineprotected
1300 {
1302 }

Перекрестные ссылки m_UTSAverageTemperature.

◆ GetWaterLevel()

float GetWaterLevel ( )
inlineprotected
1430 {
1432 {
1433 return m_WaterLevel;
1434 }
1435
1436 return 0.0;
1437 }

Перекрестные ссылки IsWaterContact(), m_WaterLevel и WATER_LEVEL_NONE.

◆ GetWetDelta()

float GetWetDelta ( )
inlineprotected

player is getting wet by movement/swimming in water (+differentiate wetDelta by water level)

player is drying

471 {
472 float wetDelta = 0;
473 if ( IsWaterContact() )
474 {
477 {
478 wetDelta = 1;
479 }
481 {
482 wetDelta = 0.66;
483 }
485 {
486 wetDelta = 0.66;
487 }
489 {
490 wetDelta = 0.33;
491 }
492 }
493 else if (!IsInsideBuilding() && !IsUnderRoof() && !IsInsideVehicle())
494 {
495 if (IsRaining())
497
498 if (IsSnowing() && MiscGameplayFunctions.GetCombinedSnowfallWindValue() > SNOWFALL_WIND_COMBINED_THRESHOLD)
500 }
501 else
502 {
505
507 if (weatherEffect <= 0)
508 {
509 weatherEffect = 1.0;
510 }
511
513 if (!IsInsideBuilding())
514 {
516 }
517 }
518
519 return wetDelta;
520 }
const float SNOWFALL_LIMIT_LOW
Definition Environment.c:16
const float SNOWFALL_WIND_COMBINED_THRESHOLD
Definition Environment.c:17
const float WATER_LEVEL_LOW
Definition Environment.c:21
bool IsRaining()
Definition Environment.c:301
float GetEnvironmentTemperature()
Definition Environment.c:428
bool IsSnowing()
Definition Environment.c:306
const float ENVIRO_DRY_INCREMENT
amount of wetness added to items wet value each tick if is raining
Definition constants.c:701
const float ENVIRO_TICKS_TO_WETNESS_CALCULATION
in secs. how often should enviro effet process
Definition constants.c:698
const float ENVIRO_CLOUD_DRY_EFFECT
how much is the generic temp effect increased when player is next to a fireplace
Definition constants.c:704
const float ENVIRO_WET_INCREMENT
in secs. how often we should check if player is under the roof (raycast)
Definition constants.c:700
const float ENVIRO_WIND_EFFECT
windchill effect on base temperature
Definition constants.c:713
const float ENVIRO_SNOW_WET_COEF
Above this value, the wind effect increases the modified temperature.
Definition constants.c:766
const float ENVIRO_FOG_DRY_EFFECT
how many % of ENVIRO_SUN_INCREMENT is reduced by cloudy sky
Definition constants.c:705

Перекрестные ссылки GameConstants::ENVIRO_CLOUD_DRY_EFFECT, GameConstants::ENVIRO_DRY_INCREMENT, GameConstants::ENVIRO_FOG_DRY_EFFECT, GameConstants::ENVIRO_SNOW_WET_COEF, GameConstants::ENVIRO_TICKS_TO_WETNESS_CALCULATION, GameConstants::ENVIRO_WET_INCREMENT, GameConstants::ENVIRO_WIND_EFFECT, GetEnvironmentTemperature(), IsInsideBuilding(), IsInsideVehicle(), IsRaining(), IsSnowing(), IsUnderRoof(), IsWaterContact(), m_Clouds, m_Fog, m_PlayerHeat, m_Rain, m_Snowfall, m_WaterLevel, m_Wind, Math::Max(), SNOWFALL_LIMIT_LOW, SNOWFALL_WIND_COMBINED_THRESHOLD, WATER_LEVEL_HIGH, WATER_LEVEL_LOW, WATER_LEVEL_MID и WATER_LEVEL_NONE.

Используется в ApplyWetnessToItem() и GetDebugMessage().

◆ GetWindModifierPerSurface()

float GetWindModifierPerSurface ( )
inlineprotected
410 {
412 return 0.0;
413
414 return g_Game.ConfigGetFloat("CfgSurfaces " + m_SurfaceType + " windModifier");
415 }

Перекрестные ссылки g_Game, IsUnderRoofBuilding() и m_SurfaceType.

Используется в GetDebugMessage() и GetEnvironmentTemperature().

◆ Init() [1/2]

void Init ( )
inlineprivate

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

97 {
98 m_PlayerSpeed = 0.0;
99 m_WetDryTick = 0.0;
100 m_RoofCheckTimer = 0.0;
101 m_WaterLevel = 0.0;
102 m_HeatComfort = m_Player.GetStatHeatComfort().Get();
103 m_WorldData = g_Game.GetMission().GetWorldData();
104 m_EnvironmentTemperature = m_WorldData.GetBaseEnvTemperatureAtObject(m_Player);
105
106 m_IsUnderRoof = false;
107 m_IsInWater = false;
108 m_SurfaceType = "cp_dirt";
109
110 m_HeatBufferTimer = 0.0;
111
116
120 InventorySlots.HEADGEAR,
121 InventorySlots.MASK,
122 InventorySlots.EYEWEAR,
123 InventorySlots.GLOVES,
124 InventorySlots.ARMBAND,
125 InventorySlots.BODY,
126 InventorySlots.HIPS,
127 InventorySlots.VEST,
128 InventorySlots.BACK,
129 InventorySlots.LEGS,
130 InventorySlots.FEET
131 };
135 InventorySlots.GLOVES,
136 InventorySlots.ARMBAND,
137 InventorySlots.BODY,
138 InventorySlots.HIPS,
139 InventorySlots.VEST,
140 InventorySlots.BACK,
141 InventorySlots.LEGS,
142 InventorySlots.FEET
143 };
147 InventorySlots.HIPS,
148 InventorySlots.LEGS,
149 InventorySlots.FEET
150 };
154 InventorySlots.FEET,
155 };
156
159 m_HeadParts = new array<int>();
160 m_HeadParts = {
161 InventorySlots.HEADGEAR,
162 InventorySlots.MASK,
163 };
164
165 m_BodyParts = new array<int>();
166 m_BodyParts = {
167 InventorySlots.GLOVES,
168 InventorySlots.HIPS,
169 InventorySlots.BODY,
170 InventorySlots.BACK,
171 InventorySlots.VEST,
172 InventorySlots.MELEE,
173 InventorySlots.SHOULDER
174 };
175
176 m_FeetParts = new array<int>();
177 m_FeetParts = {
178 InventorySlots.LEGS,
179 InventorySlots.FEET,
180 };
181
183
185
186 m_Initialized = true;
187 }
ref SimpleMovingAverage< float > m_UTSAverageTemperatureBuffer
Definition Environment.c:75
ref array< int > m_SlotIdsComplete
reused as state toggle
Definition Environment.c:61
float m_HeatBufferTimer
Definition Environment.c:59
ref array< int > m_HeadParts
Definition Environment.c:66
ref array< int > m_SlotIdsUpper
Definition Environment.c:62
ref array< int > m_SlotIdsLower
Definition Environment.c:64
void SetEnvironmentSnapshotData()
Definition Environment.c:1291
bool m_Initialized
used for calculations before the data modification
Definition Environment.c:82
ref SimpleMovingAverage< float > m_AverageHeatComfortBuffer
Definition Environment.c:76
ref array< int > m_BodyParts
Definition Environment.c:67
ref array< int > m_FeetParts
Definition Environment.c:68
float m_WetDryTick
Definition Environment.c:24
ref array< int > m_SlotIdsBottom
Definition Environment.c:63

Перекрестные ссылки g_Game, m_AverageHeatComfortBuffer, m_BodyParts, m_EnvironmentTemperature, m_FeetParts, m_HeadParts, m_HeatBufferTimer, m_HeatComfort, m_HeatComfortBehaviorCategory, m_Initialized, m_IsInWater, m_IsUnderRoof, m_Player, m_PlayerSpeed, m_RoofCheckTimer, m_SlotIdsBottom, m_SlotIdsComplete, m_SlotIdsLower, m_SlotIdsUpper, m_SurfaceType, m_UTemperatureSources, m_UTSAverageTemperature, m_UTSAverageTemperatureBuffer, m_WaterLevel, m_WetDryTick, m_WorldData и SetEnvironmentSnapshotData().

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

◆ Init() [2/2]

void Init ( PlayerBase pPlayer)
inlineprotected
1495 {
1496 Init();
1497 }
void Init()
Definition Environment.c:96

Перекрестные ссылки Init().

◆ IsInsideBuilding()

bool IsInsideBuilding ( )
inlineprotected
287 {
288 return m_Player && m_Player.IsSoundInsideBuilding();
289 }

Перекрестные ссылки m_Player.

Используется в GetDebugMessage(), GetEnvironmentTemperature(), GetWetDelta(), NakedBodyPartHeatComfortPenalty() и Update().

◆ IsInsideVehicle()

bool IsInsideVehicle ( )
inlineprotected
292 {
293 return m_Player && m_Player.IsInVehicle();
294 }

Перекрестные ссылки m_Player.

Используется в CheckUnderRoof(), DetermineHeatcomfortBehavior(), GetEnvironmentTemperature(), GetWetDelta(), NakedBodyPartHeatComfortPenalty() и Update().

◆ IsNeutralTemperature()

bool IsNeutralTemperature ( float temperature,
float lowerLimit = GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT,
float upperLimit = GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT )
inlineprivate
1440 {
1442 return true;
1443
1444 return false;
1445 }

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

◆ IsRaining()

bool IsRaining ( )
inlineprotected
302 {
303 return m_Rain > RAIN_LIMIT_LOW;
304 }
const float RAIN_LIMIT_LOW
Definition Environment.c:14

Перекрестные ссылки m_Rain и RAIN_LIMIT_LOW.

Используется в GetWetDelta() и Update().

◆ IsSnowing()

bool IsSnowing ( )
inlineprotected
307 {
309 }

Перекрестные ссылки m_Snowfall и SNOWFALL_LIMIT_LOW.

Используется в GetWetDelta() и Update().

◆ IsTemperatureSet()

bool IsTemperatureSet ( )
inlineprivate
265 {
266 return m_IsTempSet;
267 }
bool m_IsTempSet
Definition Environment.c:57

Перекрестные ссылки m_IsTempSet.

◆ IsUnderRoof()

bool IsUnderRoof ( )
inlineprotected
277 {
278 return m_IsUnderRoof;
279 }

Перекрестные ссылки m_IsUnderRoof.

Используется в GetEnvironmentTemperature(), GetWetDelta(), NakedBodyPartHeatComfortPenalty() и Update().

◆ IsUnderRoofBuilding()

bool IsUnderRoofBuilding ( )
inlineprivate
297 {
299 }

Перекрестные ссылки m_IsUnderRoofBuilding.

Используется в CheckWaterContact() и GetWindModifierPerSurface().

◆ IsWaterContact()

bool IsWaterContact ( )
inlineprotected
282 {
283 return m_IsInWater;
284 }

Перекрестные ссылки m_IsInWater.

Используется в GetDebugMessage(), GetEnvironmentTemperature(), GetWaterLevel(), GetWetDelta(), NakedBodyPartHeatComfortPenalty() и Update().

◆ LogDryWetProcess()

void LogDryWetProcess ( string message,
bool indented = false )
inlineprivate
1463 {
1464 #ifdef DIAG_DEVELOPER
1465 if (m_DebugLogDryWet)
1466 {
1467 string indentation = "";
1468 if (indented)
1469 indentation = "|--";
1470
1471 Debug.Log(string.Format("%1 %2", indentation, message));
1472 }
1473 #endif
1474 }
Definition Debug.c:14
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:136

Перекрестные ссылки Debug::Log().

Используется в ApplyDrynessToItemEx(), ApplyWetnessToItem(), ProcessItemsDryness() и ProcessItemsWetness().

◆ LogItemHeat()

void LogItemHeat ( string message,
bool indented = false )
inlineprivate
1477 {
1478 #ifdef DIAG_DEVELOPER
1480 {
1481 string indentation = "";
1482 if (indented)
1483 indentation = "|--";
1484
1485 Debug.Log(string.Format("%1 %2", indentation, message));
1486 }
1487 #endif
1488 }

Перекрестные ссылки Debug::Log().

Используется в BodyPartHeatProperties(), BodyPartHeatProperties() и ProcessHeatComfort().

◆ NakedBodyPartHeatComfortPenalty()

float NakedBodyPartHeatComfortPenalty ( int pBodyPartSlotId,
float pCoef )
inlineprotected
1197 {
1198 float penalty = 0.0;
1199
1201 {
1203 {
1205 penalty *= pCoef;
1206 }
1207 }
1208
1209 return penalty;
1210 }
const float ENVIRO_NAKED_BODY_PENALTY_RAIN_MIN_VALUE
Definition constants.c:756
const float ENVIRO_ISOLATION_WETFACTOR_DRENCHED
Definition constants.c:746
const float ENVIRO_NAKED_BODY_PENALTY_SNOWFALL_MIN_VALUE
how intensive a rain should be to enable rain penalty on naked body
Definition constants.c:757

Перекрестные ссылки GameConstants::ENVIRO_ISOLATION_WETFACTOR_DRENCHED, GameConstants::ENVIRO_NAKED_BODY_PENALTY_RAIN_MIN_VALUE, GameConstants::ENVIRO_NAKED_BODY_PENALTY_SNOWFALL_MIN_VALUE, IsInsideBuilding(), IsInsideVehicle(), IsUnderRoof(), IsWaterContact(), m_Rain и m_Snowfall.

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

◆ NormalizedTemperature()

float NormalizedTemperature ( float temperature,
float lowerLimit = GameConstants.ENVIRO_LOW_TEMP_LIMIT,
float upperLimit = GameConstants.ENVIRO_HIGH_TEMP_LIMIT )
inlineprivate
1448 {
1450 return 0.0;
1451
1454
1457
1458 // neutral zone
1459 return 0.0;
1460 }
const float ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT
damage per second dealt to attachment by fire
Definition constants.c:772
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

Перекрестные ссылки Math::Clamp(), Math::InverseLerp(), GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT и GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT.

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

◆ OnTemperatureSourcesEnter()

void OnTemperatureSourcesEnter ( )
protected

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

◆ OnTemperatureSourcesLeft()

void OnTemperatureSourcesLeft ( )
protected

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

◆ OverridenHeatComfort()

bool OverridenHeatComfort ( out float value)
protected

◆ ProcessHeatBuffer()

void ProcessHeatBuffer ( float heatComfortCloths)
inlineprotected

dynamic HB cap based on actual heatcomfort (from cloths)

948 {
950 {
953
957 m_Player.SetHeatBufferDynamicMax(heatBufferMax);
958
959 float increaseRate = 0.0;
960 float decreaseRate = 0.0;
961
963 {
966
967 if (m_IsInWater)
969 }
970
972 {
973 if (m_Player.GetModifiersManager().IsModifierActive(eModifiers.MDF_HEATBUFFER))
974 {
975 if (m_HeatBufferTimer >= 1.0)
976 m_Player.GetStatHeatBuffer().Add(-decreaseRate);
977 else
978 m_HeatBufferTimer = 1.0;
979 }
980 else
981 {
982 m_HeatBufferTimer = 0.0;
983 if (applicableHeatbuffer > 0.0)
984 m_Player.GetStatHeatBuffer().Add(-decreaseRate);
985 else if (applicableHeatbuffer != 0.0 && !m_Player.GetModifiersManager().IsModifierActive(eModifiers.MDF_HEATBUFFER))
986 m_Player.GetStatHeatBuffer().Set(0.0);
987 }
988 }
989 else
990 {
991 if (m_HeatComfort > PlayerConstants.THRESHOLD_HEAT_COMFORT_MINUS_WARNING && m_UTSAverageTemperature > 0) // m_UTSAverageTemperature can be negative
992 {
994 m_Player.GetStatHeatBuffer().Add(increaseRate);
995 }
996 else if (applicableHeatbuffer > 0.0)
997 m_Player.GetStatHeatBuffer().Add(-decreaseRate);
998 else if (applicableHeatbuffer != 0.0 && !m_Player.GetModifiersManager().IsModifierActive(eModifiers.MDF_HEATBUFFER))
999 m_Player.GetStatHeatBuffer().Set(0.0);
1000
1001 m_HeatBufferTimer = 0.0;
1002 }
1003 }
1004 }
ref EnvironmentSnapshotData m_EnvironmentSnapshot
Definition Environment.c:80
float GetApplicableHeatbuffer()
Definition Environment.c:1006
bool m_HasTemperatureSources
Definition Environment.c:72
Definition PlayerConstants.c:2
static const float THRESHOLD_HEAT_COMFORT_MINUS_WARNING
Definition PlayerConstants.c:84
eModifiers
Definition eModifiers.c:2
const float ENVIRO_PLAYER_HEATBUFFER_CAPACITY_MIN
How much heat buffer change rates are affected by temperature.
Definition constants.c:739
static const float ENVIRO_HEATCOMFORT_WEIGHT_SUMMARY
don't forget to update the weights from above if you are adding/removing them
Definition constants.c:728
const float ENVIRO_PLAYER_HEATBUFFER_TEMP_AFFECT
How much heat buffer increases per one enviro tick.
Definition constants.c:738
const float ENVIRO_PLAYER_HEATBUFFER_INCREASE
How much heat buffer decreases per one enviro tick.
Definition constants.c:737
const float ENVIRO_PLAYER_HEATBUFFER_DECREASE
impact of water contact on player's heatbuffer
Definition constants.c:736
const float ENVIRO_PLAYER_HEATBUFFER_WATEREFFECT
impact of enviro temperature on player (lower value = higher, cannot be zero or below!...
Definition constants.c:735

Перекрестные ссылки GameConstants::ENVIRO_HEATCOMFORT_WEIGHT_SUMMARY, GameConstants::ENVIRO_PLAYER_HEATBUFFER_CAPACITY_MIN, GameConstants::ENVIRO_PLAYER_HEATBUFFER_DECREASE, GameConstants::ENVIRO_PLAYER_HEATBUFFER_INCREASE, GameConstants::ENVIRO_PLAYER_HEATBUFFER_TEMP_AFFECT, GameConstants::ENVIRO_PLAYER_HEATBUFFER_WATEREFFECT, GetApplicableHeatbuffer(), Math::InverseLerp(), m_EnvironmentSnapshot, m_HasTemperatureSources, m_HeatBufferTimer, m_HeatComfort, m_HeatComfortBehaviorCategory, m_IsInWater, m_Player, m_UTSAverageTemperature, m_WaterLevel и PlayerConstants::THRESHOLD_HEAT_COMFORT_MINUS_WARNING.

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

◆ ProcessHeatComfort()

void ProcessHeatComfort ( )
inlineprotected

Calculates and process player's heatcomfort related to body parts.

Heat Comfort Penalty

heatcomfort body parts penalties

843 {
844 float hcPenaltyTotal
845
846 // NEW body parts => splitted
849
850 float heatComfortSum = 0.0;
851 float heatItems = 0.0;
852
853 LogItemHeat("====================");
872
879
883
884 {
885 float stomachContentTemperature = m_Player.GetStomach().GetStomachTemperature();
887 {
888 stomachContentTemperature = m_Player.GetStomach().GetStomachTemperature() * GameConstants.ENVIRO_STOMACH_WEIGHT;
890
892 }
893 }
894
896
899
900 if (m_Player.GetModifiersManager().IsModifierActive(eModifiers.MDF_HEATBUFFER))
901 targetHeatComfort = Math.Clamp(targetHeatComfort, 0.0, m_Player.GetStatHeatComfort().GetMax());
902 else
903 targetHeatComfort = Math.Clamp(targetHeatComfort, m_Player.GetStatHeatComfort().GetMin(), m_Player.GetStatHeatComfort().GetMax());
904
906
907 float dynamicHeatComfort;
908
909 {
910 float direction = 1.0;
911 if (targetHeatComfort < 0.0)
912 direction = -1.0;
913
916 else
918 }
919
921
923
925 m_Player.GetStatHeatComfort().Set(m_HeatComfort);
926 }
bool IsNeutralTemperature(float temperature, float lowerLimit=GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT, float upperLimit=GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT)
Definition Environment.c:1439
void SetTargetHeatComfort(float value)
Definition Environment.c:928
void ProcessHeatBuffer(float heatComfortCloths)
Definition Environment.c:947
float EnvTempToCoef(float pTemp)
Definition Environment.c:1113
void BodyPartHeatProperties(int pBodyPartId, float pCoef, out float pHeatComfort, out float pHeat)
returns enhanced heat comfort for given body part
Definition Environment.c:1119
float NakedBodyPartHeatComfortPenalty(int pBodyPartSlotId, float pCoef)
Definition Environment.c:1196
static const float ENVIRO_HEATCOMFORT_HEADGEAR_WEIGHT
max step of dynamic heatcomfort change (applies if diff between target and dynamic HC is bigger than ...
Definition constants.c:718
static const float ENVIRO_HEATCOMFORT_BACK_WEIGHT
Definition constants.c:722
const float ENVIRO_STOMACH_WEIGHT
Definition constants.c:730
const float ENVIRO_HEATCOMFORT_MAX_STEP_SIZE
when is sun highest on sky
Definition constants.c:716
static const float ENVIRO_HEATCOMFORT_FEET_WEIGHT
Definition constants.c:725
static const float ENVIRO_HEATCOMFORT_VEST_WEIGHT
Definition constants.c:720
static const float ENVIRO_HEATCOMFORT_MASK_WEIGHT
how much this body part affects final heatcomfort
Definition constants.c:719
static const float ENVIRO_HEATCOMFORT_HIPS_WEIGHT
Definition constants.c:726
static const float ENVIRO_HEATCOMFORT_GLOVES_WEIGHT
Definition constants.c:723
static const float ENVIRO_HEATCOMFORT_LEGS_WEIGHT
Definition constants.c:724
static const float ENVIRO_HEATCOMFORT_BODY_WEIGHT
Definition constants.c:721

Перекрестные ссылки Math::AbsFloat(), BodyPartHeatProperties(), Math::Clamp(), GameConstants::ENVIRO_HEATCOMFORT_BACK_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_BODY_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_FEET_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_GLOVES_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_HEADGEAR_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_HIPS_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_LEGS_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_MASK_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_MAX_STEP_SIZE, GameConstants::ENVIRO_HEATCOMFORT_VEST_WEIGHT, GameConstants::ENVIRO_STOMACH_WEIGHT, EnvTempToCoef(), GetPlayerHeat(), IsNeutralTemperature(), LogItemHeat(), m_AverageHeatComfortBuffer, m_EnvironmentTemperature, m_HeatComfort, m_Player, NakedBodyPartHeatComfortPenalty(), ProcessHeatBuffer(), Math::Round(), SetEnvironmentSnapshotData() и SetTargetHeatComfort().

Используется в ProcessItemsHeat() и Update().

◆ ProcessItemHierarchyRecursive()

void ProcessItemHierarchyRecursive ( ItemBase item,
float heatPermeabilityCoef = 1.0 )
inlineprotected
1057 {
1059
1060 // go through any attachments and cargo, recursive
1061 int inventoryAttCount = item.GetInventory().AttachmentCount();
1062 if (inventoryAttCount > 0)
1063 {
1065 for (int inAttIdx = 0; inAttIdx < inventoryAttCount; ++inAttIdx)
1066 {
1067 if (Class.CastTo(attachmentItem,item.GetInventory().GetAttachmentFromIndex(inAttIdx)))
1068 {
1070 heatPermCoef *= attachmentItem.GetHeatPermeabilityCoef();
1071
1072 if (attachmentItem.CanHaveTemperature() && !attachmentItem.IsSelfAdjustingTemperature())
1073 {
1075 }
1076
1078 }
1079 }
1080 }
1081
1082 if (item.GetInventory().GetCargo())
1083 {
1084 int inventoryItemCount = item.GetInventory().GetCargo().GetItemCount();
1085 if (inventoryItemCount > 0)
1086 {
1088 for (int j = 0; j < inventoryItemCount; ++j)
1089 {
1090 if (Class.CastTo(inventoryItem,item.GetInventory().GetCargo().GetItem(j)))
1091 {
1093 heatPermCoef *= inventoryItem.GetHeatPermeabilityCoef();
1094
1095 if (inventoryItem.CanHaveTemperature() && !inventoryItem.IsSelfAdjustingTemperature())
1096 {
1098 }
1099
1101 }
1102 }
1103 }
1104 }
1105 }
void SetProcessedItemTemperature(ItemBase item, float heatPermeabilityCoef=1.0)
Definition Environment.c:1107
void ProcessItemHierarchyRecursive(ItemBase item, float heatPermeabilityCoef=1.0)
Definition Environment.c:1056

Перекрестные ссылки Class::CastTo(), ProcessItemHierarchyRecursive() и SetProcessedItemTemperature().

Используется в ProcessItemHierarchyRecursive(), ProcessItemsInHandsTemperature() и ProcessItemsTemperature().

◆ ProcessItemsDryness()

void ProcessItemsDryness ( )
inlineprotected
626 {
629
630 int attCount = m_Player.GetInventory().AttachmentCount();
631
632 LogDryWetProcess(string.Format("Environment :: ProcessItemsDryness (update interval=%1s)", GameConstants.ENVIRO_TICK_RATE));
634 drynessData.m_UseTemperatureSources = m_HasTemperatureSources;
635
637 {
639 distance = Math.Max(distance, 0.1);
640 drynessData.m_TemperatureSourceDistance = distance;
641 LogDryWetProcess(string.Format("distance to heatsource: %1 m", distance));
642 }
643
644 for (int attIdx = 0; attIdx < attCount; ++attIdx)
645 {
646 attachment = m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
647 if (attachment && attachment.IsItemBase())
648 {
649 item = ItemBase.Cast(attachment);
650 if (item)
652 }
653 }
654
655 if (m_Player.GetItemInHands())
656 {
657 ApplyDrynessToItemEx(m_Player.GetItemInHands(), drynessData);
658 }
659
660 LogDryWetProcess("==========");
661 }
class JsonUndergroundAreaTriggerData GetPosition
Definition UndergroundAreaLoader.c:9

Перекрестные ссылки ApplyDrynessToItemEx(), vector::Distance(), GameConstants::ENVIRO_TICK_RATE, GetPosition, LogDryWetProcess(), m_HasTemperatureSources, m_Player, m_UTemperatureSources и Math::Max().

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

◆ ProcessItemsHeat()

void ProcessItemsHeat ( )
inlineprotected
1503 {
1504 // for backward combatibility only
1506 }
void ProcessHeatComfort()
Calculates and process player's heatcomfort related to body parts.
Definition Environment.c:842

Перекрестные ссылки ProcessHeatComfort().

◆ ProcessItemsInHandsTemperature()

void ProcessItemsInHandsTemperature ( )
inlineprotected
1043 {
1044 ItemBase item = m_Player.GetItemInHands();
1045 if (item)
1046 {
1047 float heatPermCoef = item.GetHeatPermeabilityCoef();
1048 //first handle the item itself, if necessary
1049 if (item.CanHaveTemperature() && !item.IsSelfAdjustingTemperature())
1051
1053 }
1054 }

Перекрестные ссылки m_Player, ProcessItemHierarchyRecursive() и SetProcessedItemTemperature().

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

◆ ProcessItemsTemperature()

void ProcessItemsTemperature ( array< int > pBodyPartIds)
inlineprotected

go through all items in player's possession cool/warm them to neutral temperature

go through all body parts we've defined for that zone (ex.: head, body, feet)

1015 {
1017 ItemBase item;
1018
1019 int attCount = m_Player.GetInventory().AttachmentCount();
1020 for (int attIdx = 0; attIdx < attCount; ++attIdx)
1021 {
1022 attachment = m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
1023 item = ItemBase.Cast(attachment);
1024 int attachmentSlot = attachment.GetInventory().GetSlotId(0);
1025
1027 for (int i = 0; i < pBodyPartIds.Count(); ++i)
1028 {
1030 {
1031 float heatPermCoef = item.GetHeatPermeabilityCoef();
1032 //first handle the item itself, if necessary
1033 if (item.CanHaveTemperature() && !item.IsSelfAdjustingTemperature())
1035
1037 }
1038 }
1039 }
1040 }

Перекрестные ссылки m_Player, ProcessItemHierarchyRecursive() и SetProcessedItemTemperature().

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

◆ ProcessItemsWetness()

void ProcessItemsWetness ( array< int > pSlotIds)
inlineprotected
591 {
593
594 int playerAttachmentCount = m_Player.GetInventory().AttachmentCount();
595
596 LogDryWetProcess(string.Format("Environment :: ProcessItemsWetness (update interval=%1s)", GameConstants.ENVIRO_TICK_RATE));
597 for (int attIdx = 0; attIdx < playerAttachmentCount; ++attIdx)
598 {
599 attachment = m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
600 if (attachment.IsItemBase())
601 {
602 int attachmentSlotsCount = attachment.GetInventory().GetSlotIdCount();
604 {
605 int attachmentSlot = attachment.GetInventory().GetSlotId(attachmentSlotId);
606 for (int i = 0; i < pSlotIds.Count(); ++i)
607 {
608 if (attachmentSlot == pSlotIds.Get(i))
609 {
611 break;
612 }
613 }
614 }
615 }
616 }
617
618 if (m_Player.GetItemInHands())
619 ApplyWetnessToItem(m_Player.GetItemInHands());
620
621 LogDryWetProcess("==========");
622
623 }

Перекрестные ссылки ApplyWetnessToItem(), GameConstants::ENVIRO_TICK_RATE, LogDryWetProcess() и m_Player.

Используется в ProcessWetnessByRain(), ProcessWetnessByWaterLevel() и Update().

◆ ProcessTemperatureSources()

void ProcessTemperatureSources ( )
inlineprotected

adds average of 2 most significat sources to buffer

1244 {
1245 int UTScount = m_UTemperatureSources.Count();
1246 if (UTScount == 0)
1247 {
1253
1254 return;
1255 }
1256
1258
1259 // get temperature from the source (based on distance), save it for min/max filtering
1260 float itemCoefAverage = 0.0;
1262 {
1264 itemCoefAverage += tempSource.GetTemperatureItemCoef();
1265 }
1268
1269 float min = MiscGameplayFunctions.GetMinValue(utsTemperatures);
1270 float max = MiscGameplayFunctions.GetMaxValue(utsTemperatures);
1271
1272 if (max > 0 && min < 0)
1273 {
1276 }
1277 else
1278 {
1280 }
1281
1282 if (m_HasTemperatureSources == false)
1284
1286 }
float CalcTemperatureFromTemperatureSource(notnull UTemperatureSource uts)
Definition Environment.c:1304
void SetItemHeatingCoef(float val)
Definition Environment.c:1238
void OnTemperatureSourcesLeft()
void OnTemperatureSourcesEnter()
const float TEMP_COEF_INVENTORY
Definition constants.c:901

Перекрестные ссылки CalcTemperatureFromTemperatureSource(), m_HasTemperatureSources, m_UTemperatureSources, m_UTSAverageTemperature, m_UTSAverageTemperatureBuffer, OnTemperatureSourcesEnter(), OnTemperatureSourcesLeft(), SetItemHeatingCoef() и GameConstants::TEMP_COEF_INVENTORY.

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

◆ ProcessWetnessByRain()

void ProcessWetnessByRain ( )
inlineprotected
1509 {
1511 }
void ProcessItemsWetness(array< int > pSlotIds)
Definition Environment.c:590

Перекрестные ссылки m_SlotIdsComplete и ProcessItemsWetness().

◆ ProcessWetnessByWaterLevel()

◆ SetAreaGenericColdness()

void SetAreaGenericColdness ( )
inlineprotected

Determines whether player is in cold area which restricts use of some actions (digging)

561 {
562 float heigthCorrectedTemp = m_WorldData.GetBaseEnvTemperatureAtObject(m_Player);
564 }
const float COLD_AREA_TEMPERATURE_THRESHOLD
Definition constants.c:760

Перекрестные ссылки GameConstants::COLD_AREA_TEMPERATURE_THRESHOLD, m_Player и m_WorldData.

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

◆ SetEnvironmentSnapshotData()

void SetEnvironmentSnapshotData ( )
inlineprotected
1292 {
1294 data.m_TargetHeatComfort = m_TargetHeatComfort;
1295
1297 }

Перекрестные ссылки m_EnvironmentSnapshot и m_TargetHeatComfort.

Используется в Init() и ProcessHeatComfort().

◆ SetEnvironmentTemperature()

void SetEnvironmentTemperature ( )
inlineprotected

Перекрестные ссылки GetEnvironmentTemperature(), m_EnvironmentTemperature и m_IsTempSet.

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

◆ SetHeatcomfortDirectly()

void SetHeatcomfortDirectly ( )
inlineprotected
934 {
936 {
937 float targetHeatComfort = 0.0;
939
941
943 m_Player.GetStatHeatComfort().Set(dynamicHeatComfort);
944 }
945 }

Перекрестные ссылки m_AverageHeatComfortBuffer, m_HeatComfort, m_HeatComfortBehaviorCategory, m_Player и SetTargetHeatComfort().

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

◆ SetItemHeatingCoef()

void SetItemHeatingCoef ( float val)
inlineprotected
1239 {
1241 }
float m_ItemTemperatureCoef
Definition Environment.c:50

Перекрестные ссылки m_ItemTemperatureCoef.

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

◆ SetProcessedItemTemperature()

void SetProcessedItemTemperature ( ItemBase item,
float heatPermeabilityCoef = 1.0 )
inlineprotected
1108 {
1111 }
ETemperatureAccessTypes
Definition TemperatureAccessConstants.c:2
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
Definition constants.c:777

Перекрестные ссылки GameConstants::ENVIRO_TICK_RATE, GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE и m_ItemTemperatureCoef.

Используется в ProcessItemHierarchyRecursive(), ProcessItemsInHandsTemperature() и ProcessItemsTemperature().

◆ SetTargetHeatComfort()

void SetTargetHeatComfort ( float value)
inlineprotected
929 {
931 }

Перекрестные ссылки m_TargetHeatComfort.

Используется в ProcessHeatComfort() и SetHeatcomfortDirectly().

◆ Update()

void Update ( float pDelta)
inlineprivate

check if player is under roof (only if the Building check is false)

Updates data

Process temperatures

heat comfort calculation

Process item wetness/dryness

setting of wetness/dryiness of player

reset item wetness counter;

192 {
193 if (m_Player && m_Initialized)
194 {
198 {
199 if ( !IsInsideBuilding() )
201
203 }
204
205 m_Time += pDelta;
207 {
208 m_Time = 0;
209 m_WetDryTick++; // Sets whether it is time to add wetness to items and clothing
210
216
218
224
228 else
230
233 {
234 if (IsWaterContact())
235 {
237 }
238 else if ((IsRaining() || (IsSnowing() && MiscGameplayFunctions.GetCombinedSnowfallWindValue() > SNOWFALL_WIND_COMBINED_THRESHOLD)) && !IsInsideBuilding() && !IsUnderRoof() && !IsInsideVehicle())
239 {
241 }
242 else
243 {
245 }
246
248 if ((m_ItemsWetnessMax < GameConstants.STATE_WET) && (m_Player.GetStatWet().Get() == 1))
249 {
250 m_Player.GetStatWet().Set(0);
251 }
252 else if ((m_ItemsWetnessMax >= GameConstants.STATE_WET) && (m_Player.GetStatWet().Get() == 0))
253 {
254 m_Player.GetStatWet().Set(1);
255 }
256
257 m_WetDryTick = 0;
259 }
260 }
261 }
262 }
void CollectAndSetEnvironmentData()
Definition Environment.c:539
float m_Time
Definition Environment.c:45
void ProcessTemperatureSources()
Definition Environment.c:1243
void CheckUnderRoof()
Checks whether Player is sheltered.
Definition Environment.c:329
void ProcessItemsInHandsTemperature()
Definition Environment.c:1042
void ProcessWetnessByWaterLevel(float pWaterLevel)
process attachments by water depth
Definition Environment.c:577
void CollectAndSetPlayerData()
Definition Environment.c:524
void GatherTemperatureSources()
Definition Environment.c:1212
bool DetermineHeatcomfortBehavior()
Definition Environment.c:311
void SetHeatcomfortDirectly()
Definition Environment.c:933
void ProcessItemsDryness()
Definition Environment.c:625
void ProcessItemsTemperature(array< int > pBodyPartIds)
go through all items in player's possession cool/warm them to neutral temperature
Definition Environment.c:1014
void CheckWaterContact(out float pWaterLevel)
Definition Environment.c:351
const float STATE_WET
Definition constants.c:833

Перекрестные ссылки CheckUnderRoof(), CheckWaterContact(), CollectAndSetEnvironmentData(), CollectAndSetPlayerData(), DetermineHeatcomfortBehavior(), GameConstants::ENVIRO_TICK_RATE, GameConstants::ENVIRO_TICK_ROOF_RC_CHECK, GameConstants::ENVIRO_TICKS_TO_WETNESS_CALCULATION, GatherTemperatureSources(), IsInsideBuilding(), IsInsideVehicle(), IsRaining(), IsSnowing(), IsUnderRoof(), IsWaterContact(), m_BodyParts, m_FeetParts, m_HeadParts, m_Initialized, m_ItemsWetnessMax, m_Player, m_RoofCheckTimer, m_SlotIdsComplete, m_Time, m_WaterLevel, m_WetDryTick, ProcessHeatComfort(), ProcessItemsDryness(), ProcessItemsInHandsTemperature(), ProcessItemsTemperature(), ProcessItemsWetness(), ProcessTemperatureSources(), ProcessWetnessByWaterLevel(), SetHeatcomfortDirectly(), SNOWFALL_WIND_COMBINED_THRESHOLD и GameConstants::STATE_WET.

◆ WindEffectTemperatureValue()

float WindEffectTemperatureValue ( float temperatureInput)
inlineprotected
567 {
568 float output = 0.0;
569
571 output = output * m_Wind * m_WorldData.GetWindCoef();
572
573 return -output;
574 }
const float ENVIRO_WIND_EFFECT_SLOPE
time modifier, how much longer it takes to dig up worms while in a cold area
Definition constants.c:763
const float ENVIRO_WIND_CHILL_LIMIT
Affects the slope of calculation.
Definition constants.c:764

Перекрестные ссылки GameConstants::ENVIRO_WIND_CHILL_LIMIT, GameConstants::ENVIRO_WIND_EFFECT_SLOPE, m_Wind и m_WorldData.

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

Поля

◆ m_AverageHeatComfortBuffer

ref SimpleMovingAverage<float> m_AverageHeatComfortBuffer
protected

Используется в Init(), ProcessHeatComfort() и SetHeatcomfortDirectly().

◆ m_BodyParts

ref array<int> m_BodyParts
protected

Используется в Init() и Update().

◆ m_Clouds

float m_Clouds = 0
protected

◆ m_DayOrNight

float m_DayOrNight = 0
protected

◆ m_EnvironmentSnapshot

ref EnvironmentSnapshotData m_EnvironmentSnapshot
protected

Используется в ProcessHeatBuffer() и SetEnvironmentSnapshotData().

◆ m_EnvironmentTemperature

float m_EnvironmentTemperature
protected

◆ m_FeetParts

ref array<int> m_FeetParts
protected

Используется в Init() и Update().

◆ m_Fog

◆ m_HasTemperatureSources

bool m_HasTemperatureSources
protected

◆ m_HeadParts

ref array<int> m_HeadParts
protected

Используется в Init() и Update().

◆ m_HeatBufferTimer

float m_HeatBufferTimer
protected

Используется в Init() и ProcessHeatBuffer().

◆ m_HeatComfort

float m_HeatComfort
protected

◆ m_HeatComfortBehaviorCategory

int m_HeatComfortBehaviorCategory
protected

◆ m_HeatSourceTemp

float m_HeatSourceTemp
protected

DEPRECATED.

◆ m_Initialized

bool m_Initialized
private

used for calculations before the data modification

Используется в Init() и Update().

◆ m_IsInWater

bool m_IsInWater
protected

◆ m_IsTempSet

bool m_IsTempSet
protected

Используется в IsTemperatureSet() и SetEnvironmentTemperature().

◆ m_IsUnderRoof

bool m_IsUnderRoof
protected

Используется в CheckUnderRoof(), GetDebugMessage(), Init() и IsUnderRoof().

◆ m_IsUnderRoofBuilding

bool m_IsUnderRoofBuilding
private

◆ m_ItemsWetnessMax

float m_ItemsWetnessMax
protected

Используется в ApplyDrynessToItemEx(), ApplyWetnessToItem() и Update().

◆ m_ItemTemperatureCoef

float m_ItemTemperatureCoef
protected

Используется в SetItemHeatingCoef() и SetProcessedItemTemperature().

◆ m_LiquidType

int m_LiquidType
protected

Используется в CheckWaterContact() и GetEnvironmentTemperature().

◆ m_Player

◆ m_PlayerHeat

float m_PlayerHeat
protected

Используется в CollectAndSetPlayerData() и GetWetDelta().

◆ m_PlayerHeightPos

float m_PlayerHeightPos
protected

◆ m_PlayerSpeed

float m_PlayerSpeed
protected

Используется в CollectAndSetPlayerData(), GetPlayerHeat() и Init().

◆ m_PlayerTemperature

float m_PlayerTemperature
protected

◆ m_Rain

float m_Rain = 0
protected

target value of heatcomfort (non-buffered)

Используется в CollectAndSetEnvironmentData(), GetDebugMessage(), GetWetDelta(), IsRaining() и NakedBodyPartHeatComfortPenalty().

◆ m_RoofCheckTimer

float m_RoofCheckTimer
protected

keeps wetness of most wet item in player's possesion

Используется в GetNextRoofCheck(), Init() и Update().

◆ m_SlotIdsBottom

ref array<int> m_SlotIdsBottom
protected

Используется в Init() и ProcessWetnessByWaterLevel().

◆ m_SlotIdsComplete

ref array<int> m_SlotIdsComplete
protected

reused as state toggle

Используется в Init(), ProcessWetnessByRain(), ProcessWetnessByWaterLevel() и Update().

◆ m_SlotIdsLower

ref array<int> m_SlotIdsLower
protected

Используется в Init() и ProcessWetnessByWaterLevel().

◆ m_SlotIdsUpper

ref array<int> m_SlotIdsUpper
protected

Используется в Init() и ProcessWetnessByWaterLevel().

◆ m_Snowfall

◆ m_SurfaceType

string m_SurfaceType
protected

Используется в CheckWaterContact(), GetWindModifierPerSurface() и Init().

◆ m_TargetHeatComfort

float m_TargetHeatComfort
protected

player's heatcomfort (buffered, stored in player stats)

Используется в GetTargetHeatComfort(), SetEnvironmentSnapshotData() и SetTargetHeatComfort().

◆ m_Time

float m_Time = 0
protected

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

◆ m_UTemperatureSources

ref array<UTemperatureSource> m_UTemperatureSources
protected

◆ m_UTSAverageTemperature

◆ m_UTSAverageTemperatureBuffer

ref SimpleMovingAverage<float> m_UTSAverageTemperatureBuffer
protected

Используется в Init() и ProcessTemperatureSources().

◆ m_WaterLevel

float m_WaterLevel
protected

◆ m_WetDryTick

float m_WetDryTick
protected

Используется в Init() и Update().

◆ m_Wind

◆ m_WindAverageBuffer

ref SimpleMovingAverage<float> m_WindAverageBuffer
protected

◆ m_WorldData

◆ RAIN_LIMIT_LOW

const float RAIN_LIMIT_LOW = 0.05
private

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

◆ SNOWFALL_LIMIT_LOW

const float SNOWFALL_LIMIT_LOW = 0.5
protected

Используется в GetWetDelta() и IsSnowing().

◆ SNOWFALL_WIND_COMBINED_THRESHOLD

const float SNOWFALL_WIND_COMBINED_THRESHOLD = 1.3
protected

Используется в GetWetDelta() и Update().

◆ WATER_LEVEL_HIGH

const float WATER_LEVEL_HIGH = 1.5
protected

◆ WATER_LEVEL_LOW

const float WATER_LEVEL_LOW = 0.5
protected

Используется в GetWetDelta() и ProcessWetnessByWaterLevel().

◆ WATER_LEVEL_MID

const float WATER_LEVEL_MID = 1.2
protected

◆ WATER_LEVEL_NONE

const float WATER_LEVEL_NONE = 0.15
protected

Объявления и описания членов класса находятся в файле: