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

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

void Environment (PlayerBase pPlayer)
 
void Init (PlayerBase pPlayer)
 
void Update (float pDelta)
 
bool IsTemperatureSet ()
 
void AddToEnvironmentTemperature (float pTemperature)
 
float GetPlayerHeat ()
 Returns heat player generated based on player's movement speed (for now)
 
bool IsUnderRoof ()
 
bool IsWaterContact ()
 
bool IsInsideBuilding ()
 
bool IsInsideVehicle ()
 
bool IsRaining ()
 
void CheckUnderRoof ()
 Checks whether Player is sheltered.
 
void CheckWaterContact (out float pWaterLevel)
 
float GetTemperatureHeightCorrection ()
 
float GetWindModifierPerSurface ()
 
float GetTemperature ()
 
float GetEnvironmentTemperature ()
 
float GetWetDelta ()
 
void CollectAndSetPlayerData ()
 
void CollectAndSetEnvironmentData ()
 
void SetEnvironmentTemperature ()
 
void ProcessWetnessByRain ()
 
void ProcessWetnessByWaterLevel (float pWaterLevel)
 
void ProcessItemsWetness (array< int > pSlotIds)
 
void ProcessItemsDryness ()
 
void ApplyWetnessToItem (ItemBase pItem)
 
void ApplyDrynessToItem (ItemBase pItem)
 
void ApplyDrynessToItemEx (ItemBase pItem, EnvironmentDrynessData pDrynessData)
 
void ProcessItemsHeat ()
 Calculates and process temperature of items.
 
bool OverridenHeatComfort (out float value)
 DEPRECATED.
 
float EnvTempToCoef (float pTemp)
 
void BodyPartHeatProperties (array< int > pBodyPartIds, float pCoef, out float pHeatComfort, out float pHeat)
 returns weighted avg heat comfort for bodypart
 
void GatherTemperatureSources ()
 
void ProcessTemperatureSources ()
 
float GetUniversalSourcesTemperageAverage ()
 
float CalcTemperatureFromTemperatureSource (notnull UTemperatureSource uts)
 
string GetDebugMessage ()
 debug
 
int GetNextRoofCheck ()
 
float GetWaterLevel ()
 
float GetDayOrNight ()
 

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

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_Rain = 0
 
float m_Wind = 0
 
float m_Fog = 0
 
float m_DayOrNight = 0
 
float m_Clouds = 0
 
float m_EnvironmentTemperature = 0
 
float m_Time = 0
 
string m_SurfaceType
 
float m_WaterLevel
 
bool m_IsUnderRoof
 
bool m_IsInWater
 
bool m_IsTempSet
 
float m_HeatSourceTemp
 
float m_HeatBufferTimer
 DEPRECATED.
 
ref array< intm_SlotIdsComplete
 
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 SimpleMovingAverage< floatm_WindAverageBuffer
 
bool m_HasTemperatureSources
 
float m_UTSAverageTemperature
 
ref array< UTemperatureSourcem_UTemperatureSources
 
ref SimpleMovingAverage< floatm_UTSAverageTemperatureBuffer
 

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

bool IsUnderRoofBuilding ()
 
void LogDryWetProcess (string message, bool indented=false)
 

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

const float RAIN_LIMIT_LOW = 0.05
 
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
 
bool m_IsUnderRoofBuilding
 

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

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

◆ Environment()

void Environment ( PlayerBase pPlayer)
inlineprotected
65 {
67 }
override Widget Init()
Definition DayZGame.c:122
Definition EntityAI.c:95

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

Методы

◆ AddToEnvironmentTemperature()

void AddToEnvironmentTemperature ( float pTemperature)
protected

◆ ApplyDrynessToItem()

void ApplyDrynessToItem ( ItemBase pItem)
inlineprotected
666 {
669 }
void ApplyDrynessToItemEx(ItemBase pItem, EnvironmentDrynessData pDrynessData)
Definition Environment.c:671

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

672 {
673 if (pItem)
674 {
675 float dryingIncrement = pItem.GetDryingIncrement("player");
676 if (pDrynessData.m_UseTemperatureSources)
677 dryingIncrement = pItem.GetDryingIncrement("playerHeatSource");
678
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 {
693 isParentWet = true;
694
695 if ((parentItem.GetLiquidType() != 0) && (parentItem.GetQuantity() > 0))
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
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 {
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 (ItemBase.CastTo(itemAtt, attachment))
738 }
739 }
740
742 }
743
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);
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
764 }
765 }
766 }
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:1128
PlayerBase m_Player
Definition Environment.c:15
float m_ItemsWetnessMax
Definition Environment.c:11
Definition constants.c:615
InventoryLocation.
Definition InventoryLocation.c:28
Definition InventoryItem.c:731
const float TEMPERATURE_RATE_COOLING_PLAYER
Definition constants.c:814
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:674
const float STATE_SOAKING_WET
Definition constants.c:785
const float STATE_DAMP
Definition constants.c:787

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

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

◆ ApplyWetnessToItem()

void ApplyWetnessToItem ( ItemBase pItem)
inlineprotected
584 {
585 if (pItem)
586 {
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 {
601 isParentWet = true;
602
603 if ((parentItem.GetLiquidType() != 0) && (parentItem.GetQuantity() > 0))
605 }
606 else
607 isParentWet = true;
608
609 if ((pItem.GetWet() > m_ItemsWetnessMax) && (parent == m_Player))
610 m_ItemsWetnessMax = pItem.GetWet();
611 }
612 }
613
615 {
616 float soakingCoef = 0;
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 {
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 {
645 if (Class.CastTo(inItem, pItem.GetInventory().GetCargo().GetItem(i)))
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);
657 if (itemAtt)
659 }
660 }
661 }
662 }
663 }
float GetWetDelta()
Definition Environment.c:395
void ApplyWetnessToItem(ItemBase pItem)
Definition Environment.c:583

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

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

◆ BodyPartHeatProperties()

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)

859 {
860 int attCount;
861
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 {
885 }
886
887 if (attachmentSlot == InventorySlots.BACK)
888 {
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);
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 {
915 if (Class.CastTo(inItem, item.GetInventory().GetCargo().GetItem(j)))
916 {
917 pHeat += inItem.GetTemperature();
918 }
919 }
920 }
921 }
922 }
923 }
924 }
925
927 pHeat = (pHeat / pBodyPartIds.Count()) * pCoef;
928 }
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:701
const float ENVIRO_HEATISOLATION_VEST_WEIGHT
weight of back for the sum of heat isolation
Definition constants.c:702

Перекрестные ссылки Class::CastTo(), GameConstants::ENVIRO_HEATISOLATION_BACK_WEIGHT, GameConstants::ENVIRO_HEATISOLATION_VEST_WEIGHT и m_Player.

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

◆ CalcTemperatureFromTemperatureSource()

float CalcTemperatureFromTemperatureSource ( notnull UTemperatureSource uts)
inlineprotected

heat transfer through air to player (env temperature)

dist factor minimum should be at 0

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 }
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.

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

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

◆ CheckUnderRoof()

void CheckUnderRoof ( )
inlineprotected

Checks whether Player is sheltered.

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;
278 vector from = m_Player.GetPosition();
279 vector to = from + "0 25 0";
282
284
286 }
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:35
bool m_IsUnderRoof
Definition Environment.c:34
bool IsInsideVehicle()
Definition Environment.c:250
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

289 {
290 m_IsInWater = false;
291 if (m_Player.IsSwimming())
292 {
293 m_IsInWater = true;
295 m_Player.GetMovementState(hms);
297 if (hms.m_iMovement >= DayZPlayerConstants.MOVEMENTIDX_WALK)
299
300 return;
301 }
302
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:
320 pWaterLevel = m_Player.GetCurrentWaterLevel();
321 m_IsInWater = true;
322 break;
323 }
324
326 m_Player.SetInWater(m_IsInWater);
327
330 }
DayZGame g_Game
Definition DayZGame.c:3746
bool m_IsInWater
Definition Environment.c:36
const float WATER_LEVEL_MID
Definition Environment.c:6
const float WATER_LEVEL_HIGH
Definition Environment.c:5
string m_SurfaceType
Definition Environment.c:30
bool IsUnderRoofBuilding()
Definition Environment.c:255
Definition human.c:1126
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
const int LIQUID_WATER
Definition constants.c:505
const int LIQUID_RIVERWATER
Definition constants.c:506

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

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

◆ CollectAndSetEnvironmentData()

void CollectAndSetEnvironmentData ( )
inlineprotected
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
471 }
float m_Rain
Definition Environment.c:23
float m_Wind
Definition Environment.c:24
float m_DayOrNight
Definition Environment.c:26
ref SimpleMovingAverage< float > m_WindAverageBuffer
Definition Environment.c:51
void SetEnvironmentTemperature()
Definition Environment.c:473
float m_Fog
Definition Environment.c:25
float m_Clouds
Definition Environment.c:27
Definition Weather.c:155

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

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

◆ CollectAndSetPlayerData()

void CollectAndSetPlayerData ( )
inlineprotected
447 {
448 vector playerPos = m_Player.GetPosition();
450
451 HumanCommandMove hcm = m_Player.GetCommand_Move();
452 if (hcm)
453 {
454 m_PlayerSpeed = hcm.GetCurrentMovementSpeed();
455 }
456
458 }
float m_PlayerSpeed
Definition Environment.c:17
float m_PlayerHeat
Definition Environment.c:19
float m_PlayerHeightPos
Definition Environment.c:16
float GetPlayerHeat()
Returns heat player generated based on player's movement speed (for now)
Definition Environment.c:229
Definition human.c:434

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

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

◆ EnvTempToCoef()

float EnvTempToCoef ( float pTemp)
inlineprotected
843 {
845 {
846 return 1;
847 }
848
850 {
851 return -1;
852 }
853
855 }
const float ENVIRO_TEMP_EFFECT_ON_PLAYER
comfort temperature of environment for the player
Definition constants.c:706
const float ENVIRO_PLAYER_COMFORT_TEMP
highest temperature(deg Celsius) where the player gets highest possible heat comfort (1)
Definition constants.c:705
const float ENVIRO_HIGH_TEMP_LIMIT
lowest temperature(deg Celsius) where the player gets lowest possible heat comfort (-1)
Definition constants.c:704
const float ENVIRO_LOW_TEMP_LIMIT
weight of vest for the sum of heat isolation
Definition constants.c:703

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

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

◆ GatherTemperatureSources()

void GatherTemperatureSources ( )
inlineprotected

next temp source is too far

931 {
932 m_UTemperatureSources.Clear();
933
936
938 {
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 }
ref array< UTemperatureSource > m_UTemperatureSources
Definition Environment.c:55
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:724
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().

◆ GetDayOrNight()

float GetDayOrNight ( )
inlineprotected
1124 {
1125 return m_DayOrNight;
1126 }

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

◆ GetDebugMessage()

string GetDebugMessage ( )
inlineprotected

debug

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() + ")";
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 }
int GetNextRoofCheck()
Definition Environment.c:1106
float GetTemperatureHeightCorrection()
Definition Environment.c:334
bool IsWaterContact()
Definition Environment.c:240
bool IsInsideBuilding()
Definition Environment.c:245
float m_EnvironmentTemperature
Definition Environment.c:28
float GetWindModifierPerSurface()
Definition Environment.c:340
float m_HeatComfort
Definition Environment.c:20
const float WATER_LEVEL_NONE
Definition Environment.c:8
float m_WaterLevel
Definition Environment.c:33
string ToString()
Definition EnConvert.c:3
proto string ToString()

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

◆ GetEnvironmentTemperature()

float GetEnvironmentTemperature ( )
inlineprotected
355 {
356 float temperature;
357 temperature = g_Game.GetMission().GetWorldData().GetBaseEnvTemperature();
359
360 if (IsWaterContact())
361 {
363 }
364
366 {
368 }
369 else if (IsInsideVehicle())
370 {
372 }
373 else if (IsUnderRoof() && !m_IsUnderRoofBuilding)
374 {
377 }
378 else
379 {
383 }
384
385 // incorporate temperature from temperature sources (buffer)
387 {
389 }
390
391 return temperature;
392 }
float m_UTSAverageTemperature
Definition Environment.c:54
bool IsUnderRoof()
Definition Environment.c:235
const float ENVIRO_WATER_TEMPERATURE_COEF
converts temperature of items to entities heatcomfort gain
Definition constants.c:688
const float ENVIRO_TEMPERATURE_WIND_COEF
Definition constants.c:694
const float ENVIRO_TEMPERATURE_INSIDE_COEF
amount of ?C reduced for each 100 meteres of height above water level
Definition constants.c:691
const float ENVIRO_FOG_TEMP_EFFECT
how many % of environment temperature can be lowered by clouds
Definition constants.c:684
const float ENVIRO_CLOUDS_TEMP_EFFECT
how many % of ENVIRO_SUN_INCREMENT is reduced by fog
Definition constants.c:683
const float ENVIRO_TEMPERATURE_UNDERROOF_COEF
increases temp inside vehicles
Definition constants.c:693
const float ENVIRO_TEMPERATURE_INSIDE_VEHICLE_COEF
increases temp in interiors
Definition constants.c:692
static proto float AbsFloat(float f)
Returns absolute value.

Перекрестные ссылки Math::AbsFloat(), GameConstants::ENVIRO_CLOUDS_TEMP_EFFECT, GameConstants::ENVIRO_FOG_TEMP_EFFECT, GameConstants::ENVIRO_TEMPERATURE_INSIDE_COEF, GameConstants::ENVIRO_TEMPERATURE_INSIDE_VEHICLE_COEF, GameConstants::ENVIRO_TEMPERATURE_UNDERROOF_COEF, GameConstants::ENVIRO_TEMPERATURE_WIND_COEF, GameConstants::ENVIRO_WATER_TEMPERATURE_COEF, g_Game, GetTemperatureHeightCorrection(), GetWindModifierPerSurface(), IsInsideBuilding(), IsInsideVehicle(), IsUnderRoof(), IsWaterContact(), m_Clouds, m_Fog, m_IsUnderRoofBuilding, m_UTSAverageTemperature и m_Wind.

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

◆ GetNextRoofCheck()

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

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

230 {
232 return heat;
233 }
const float ENVIRO_DEFAULT_ENTITY_HEAT
how many time is water colder than air
Definition constants.c:689

Перекрестные ссылки GameConstants::ENVIRO_DEFAULT_ENTITY_HEAT, m_PlayerSpeed и Math::Max().

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

◆ GetTemperature()

float GetTemperature ( )
inlineprotected
349 {
351 }

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

◆ GetTemperatureHeightCorrection()

float GetTemperatureHeightCorrection ( )
inlineprotected
335 {
338 }
const float ENVIRO_TEMPERATURE_HEIGHT_REDUCTION
heat entity generates if not moving
Definition constants.c:690

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

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

◆ GetUniversalSourcesTemperageAverage()

float GetUniversalSourcesTemperageAverage ( )
inlineprotected
986 {
988 }

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

◆ GetWaterLevel()

float GetWaterLevel ( )
inlineprotected
1112 {
1114 {
1115 return m_WaterLevel;
1116 }
1117 else
1118 {
1119 return 0;
1120 }
1121 }

Перекрестные ссылки 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 getting wet from rain

player is drying

396 {
397 float wetDelta = 0;
398 if ( IsWaterContact() )
399 {
402 {
403 wetDelta = 1;
404 }
406 {
407 wetDelta = 0.66;
408 }
410 {
411 wetDelta = 0.66;
412 }
414 {
415 wetDelta = 0.33;
416 }
417 }
418 else if (IsRaining() && !IsInsideBuilding() && !IsUnderRoof() && !IsInsideVehicle())
419 {
422 }
423 else
424 {
427
429 if (weatherEffect <= 0)
430 {
431 weatherEffect = 1.0;
432 }
433
435 if (!IsInsideBuilding())
436 {
438 }
439 }
440
441 return wetDelta;
442 }
const float WATER_LEVEL_LOW
Definition Environment.c:7
bool IsRaining()
Definition Environment.c:260
float GetEnvironmentTemperature()
Definition Environment.c:354
const float ENVIRO_DRY_INCREMENT
amount of wetness added to items wet value each tick if is raining
Definition constants.c:678
const float ENVIRO_TICKS_TO_WETNESS_CALCULATION
in secs. how often should enviro effet process
Definition constants.c:675
const float ENVIRO_CLOUD_DRY_EFFECT
how much is the generic temp effect increased when player is next to a fireplace
Definition constants.c:681
const float ENVIRO_WET_INCREMENT
in secs. how often we should check if player is under the roof (raycast)
Definition constants.c:677
const float ENVIRO_WIND_EFFECT
windchill effect on base temperature
Definition constants.c:695
const float ENVIRO_FOG_DRY_EFFECT
how many % of ENVIRO_SUN_INCREMENT is reduced by cloudy sky
Definition constants.c:682

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

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

◆ GetWindModifierPerSurface()

float GetWindModifierPerSurface ( )
inlineprotected
341 {
343 return 0.0;
344
345 return g_Game.ConfigGetFloat("CfgSurfaces " + m_SurfaceType + " windModifier");
346 }

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

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

◆ Init()

void Init ( PlayerBase pPlayer)
inlineprotected

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

70 {
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
83
85
89
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 };
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 };
120 InventorySlots.HIPS,
121 InventorySlots.LEGS,
122 InventorySlots.FEET
123 };
127 InventorySlots.FEET,
128 };
129
133 m_HeadParts = {
134 InventorySlots.HEADGEAR,
135 InventorySlots.MASK,
136 };
137
139 m_BodyParts = {
140 InventorySlots.GLOVES,
141
142 InventorySlots.BODY,
143 InventorySlots.BACK,
144 InventorySlots.VEST,
145 };
146
148 m_FeetParts = {
149 InventorySlots.LEGS,
150 InventorySlots.FEET,
151 };
152 }
ref SimpleMovingAverage< float > m_UTSAverageTemperatureBuffer
Definition Environment.c:56
ref array< int > m_SlotIdsComplete
Definition Environment.c:42
float m_HeatBufferTimer
DEPRECATED.
Definition Environment.c:40
ref array< int > m_HeadParts
Definition Environment.c:47
ref array< int > m_SlotIdsUpper
Definition Environment.c:43
ref array< int > m_SlotIdsLower
Definition Environment.c:45
ref array< int > m_BodyParts
Definition Environment.c:48
ref array< int > m_FeetParts
Definition Environment.c:49
float m_WetDryTick
Definition Environment.c:10
ref array< int > m_SlotIdsBottom
Definition Environment.c:44

Перекрестные ссылки m_BodyParts, m_FeetParts, m_HeadParts, m_HeatBufferTimer, m_HeatComfort, 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_WindAverageBuffer.

◆ IsInsideBuilding()

bool IsInsideBuilding ( )
inlineprotected
246 {
247 return m_Player && m_Player.IsSoundInsideBuilding();
248 }

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

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

◆ IsInsideVehicle()

bool IsInsideVehicle ( )
inlineprotected
251 {
252 return m_Player && m_Player.IsInVehicle();
253 }

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

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

◆ IsRaining()

bool IsRaining ( )
inlineprotected
261 {
262 return m_Rain > RAIN_LIMIT_LOW;
263 }
const float RAIN_LIMIT_LOW
Definition Environment.c:3

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

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

◆ IsTemperatureSet()

bool IsTemperatureSet ( )
inlineprotected
221 {
222 return m_IsTempSet;
223 }
bool m_IsTempSet
Definition Environment.c:37

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

◆ IsUnderRoof()

bool IsUnderRoof ( )
inlineprotected
236 {
237 return m_IsUnderRoof;
238 }

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

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

◆ IsUnderRoofBuilding()

bool IsUnderRoofBuilding ( )
inlineprivate
256 {
258 }

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

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

◆ IsWaterContact()

bool IsWaterContact ( )
inlineprotected
241 {
242 return m_IsInWater;
243 }

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

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

◆ LogDryWetProcess()

void LogDryWetProcess ( string message,
bool indented = false )
inlineprivate
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 }
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().

◆ OverridenHeatComfort()

bool OverridenHeatComfort ( out float value)
protected

DEPRECATED.

◆ ProcessItemsDryness()

void ProcessItemsDryness ( )
inlineprotected
546 {
549
550 int attCount = m_Player.GetInventory().AttachmentCount();
551
552 LogDryWetProcess(string.Format("Environment :: ProcessItemsDryness (update interval=%1s)", GameConstants.ENVIRO_TICK_RATE));
554 drynessData.m_UseTemperatureSources = m_HasTemperatureSources;
555
557 {
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)
572 }
573 }
574
575 if (m_Player.GetItemInHands())
576 {
577 ApplyDrynessToItemEx(m_Player.GetItemInHands(), drynessData);
578 }
579
580 LogDryWetProcess("==========");
581 }
class JsonUndergroundAreaTriggerData GetPosition
Definition UndergroundAreaLoader.c:9
bool m_HasTemperatureSources
Definition Environment.c:53

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

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

◆ ProcessItemsHeat()

void ProcessItemsHeat ( )
inlineprotected

Calculates and process temperature of items.

Heat Comfort

Heat (from items);

771 {
772 float hcHead, hcBody, hcFeet;
773 float hHead, hBody, hFeet;
774
775 float heatComfortAvg;
776 float heatAvg;
777
781
783 heatAvg = (hHead + hBody + hFeet) / 3;
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 {
796 }
797 else
798 {
800 }
801 }
802 else
803 {
804 m_HeatBufferTimer = 0.0;
805 }
806 }
807 else
808 {
809 applicableHB = m_Player.GetStatHeatBuffer().Get() / 30.0;
811 {
813 m_HeatBufferTimer = 0.0;
814 }
815 else
816 {
817 m_HeatBufferTimer = 0.0;
818 }
819 }
820
823 {
825 }
826 else
827 {
829 {
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 }
float EnvTempToCoef(float pTemp)
Definition Environment.c:842
void BodyPartHeatProperties(array< int > pBodyPartIds, float pCoef, out float pHeatComfort, out float pHeat)
returns weighted avg heat comfort for bodypart
Definition Environment.c:858
Definition PlayerConstants.c:2
static const float THRESHOLD_HEAT_COMFORT_MINUS_WARNING
Definition PlayerConstants.c:84
static const float THRESHOLD_HEAT_COMFORT_PLUS_WARNING
Definition PlayerConstants.c:80
const float ENVIRO_HEATCOMFORT_FEETPARTS_WEIGHT
how much this body parts (clothing) affects final heatcomfort
Definition constants.c:700
const float ENVIRO_HEATCOMFORT_BODYPARTS_WEIGHT
how much this head parts (clothing) affects final heatcomfort
Definition constants.c:699
const float ENVIRO_HEATCOMFORT_HEADPARTS_WEIGHT
when is sun highest on sky
Definition constants.c:698
const float ENVIRO_PLAYER_HEATBUFFER_TICK
How much heat buffer increases per one enviro tick.
Definition constants.c:709
const float ENVIRO_PLAYER_HEATBUFFER_INCREASE
Multiplier of enviro temperature for heat buffer decrease (after its static timer runs out)
Definition constants.c:708
const float ENVIRO_PLAYER_HEATBUFFER_DECREASE
impact of enviro temperature on player (lower value = higher, cannot be zero or below!...
Definition constants.c:707
const float ENVIRO_ITEM_HEAT_TRANSFER_COEF
how many times slower is wetting/drying items in backpacks
Definition constants.c:687
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'.
static proto float Min(float x, float y)
Returns smaller of two given values.

Перекрестные ссылки BodyPartHeatProperties(), Math::Clamp(), GameConstants::ENVIRO_HEATCOMFORT_BODYPARTS_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_FEETPARTS_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_HEADPARTS_WEIGHT, GameConstants::ENVIRO_ITEM_HEAT_TRANSFER_COEF, GameConstants::ENVIRO_PLAYER_HEATBUFFER_DECREASE, GameConstants::ENVIRO_PLAYER_HEATBUFFER_INCREASE, GameConstants::ENVIRO_PLAYER_HEATBUFFER_TICK, EnvTempToCoef(), GetPlayerHeat(), m_BodyParts, m_EnvironmentTemperature, m_FeetParts, m_HeadParts, m_HeatBufferTimer, m_HeatComfort, m_Player, m_UTSAverageTemperature, Math::Min(), PlayerConstants::THRESHOLD_HEAT_COMFORT_MINUS_WARNING и PlayerConstants::THRESHOLD_HEAT_COMFORT_PLUS_WARNING.

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

◆ ProcessItemsWetness()

void ProcessItemsWetness ( array< int > pSlotIds)
inlineprotected
511 {
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();
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 {
531 break;
532 }
533 }
534 }
535 }
536 }
537
538 if (m_Player.GetItemInHands())
539 ApplyWetnessToItem(m_Player.GetItemInHands());
540
541 LogDryWetProcess("==========");
542
543 }

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

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

◆ ProcessTemperatureSources()

void ProcessTemperatureSources ( )
inlineprotected

adds average of 2 most significat sources to buffer

955 {
956 if (m_UTemperatureSources.Count() == 0)
957 {
960 return;
961 }
962
964
965 // get temperature from the source (based on distance), save it for min/max filtering
968
969 float min = MiscGameplayFunctions.GetMinValue(utsTemperatures);
970 float max = MiscGameplayFunctions.GetMaxValue(utsTemperatures);
971
972 if (max > 0 && min < 0)
973 {
976 }
977 else
978 {
980 }
981
983 }
float CalcTemperatureFromTemperatureSource(notnull UTemperatureSource uts)
Definition Environment.c:990

Перекрестные ссылки CalcTemperatureFromTemperatureSource(), m_HasTemperatureSources, m_UTemperatureSources, m_UTSAverageTemperature и m_UTSAverageTemperatureBuffer.

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

◆ ProcessWetnessByRain()

void ProcessWetnessByRain ( )
inlineprotected
480 {
482 }
void ProcessItemsWetness(array< int > pSlotIds)
Definition Environment.c:510

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

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

◆ ProcessWetnessByWaterLevel()

void ProcessWetnessByWaterLevel ( float pWaterLevel)
inlineprotected

complete

upper part

bottom part

feet

485 {
486 // process attachments by water depth
488 {
491 }
493 {
496 }
498 {
501 }
503 {
506 }
507 }

Перекрестные ссылки m_SlotIdsBottom, m_SlotIdsComplete, m_SlotIdsLower, m_SlotIdsUpper, ProcessItemsWetness(), WATER_LEVEL_HIGH, WATER_LEVEL_LOW, WATER_LEVEL_MID и WATER_LEVEL_NONE.

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

◆ SetEnvironmentTemperature()

void SetEnvironmentTemperature ( )
inlineprotected

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

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

◆ Update()

void Update ( float pDelta)
inlineprotected

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

Updates data

Process temperature

Process item wetness/dryness

setting of wetness/dryiness of player

reset item wetness counter;

157 {
158 if (m_Player)
159 {
163 {
164 if ( !IsInsideBuilding() )
166
168 }
169
170 m_Time += pDelta;
172 {
173 m_Time = 0;
174 m_WetDryTick++; // Sets whether it is time to add wetness to items and clothing
175
181
183
186
189 {
190 if ( IsWaterContact() )
191 {
193 }
194 else if ( IsRaining() && !IsInsideBuilding() && !IsUnderRoof() && !IsInsideVehicle() )
195 {
197 }
198 else
199 {
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;
215 }
216 }
217 }
218 }
void CollectAndSetEnvironmentData()
Definition Environment.c:461
float m_Time
Definition Environment.c:29
void ProcessTemperatureSources()
Definition Environment.c:954
void CheckUnderRoof()
Checks whether Player is sheltered.
Definition Environment.c:266
void ProcessWetnessByWaterLevel(float pWaterLevel)
Definition Environment.c:484
void CollectAndSetPlayerData()
Definition Environment.c:446
void GatherTemperatureSources()
Definition Environment.c:930
void ProcessItemsHeat()
Calculates and process temperature of items.
Definition Environment.c:770
void ProcessWetnessByRain()
Definition Environment.c:479
void ProcessItemsDryness()
Definition Environment.c:545
void CheckWaterContact(out float pWaterLevel)
Definition Environment.c:288
const float STATE_WET
Definition constants.c:786

Перекрестные ссылки CheckUnderRoof(), CheckWaterContact(), CollectAndSetEnvironmentData(), CollectAndSetPlayerData(), GameConstants::ENVIRO_TICK_RATE, GameConstants::ENVIRO_TICK_ROOF_RC_CHECK, GameConstants::ENVIRO_TICKS_TO_WETNESS_CALCULATION, GatherTemperatureSources(), IsInsideBuilding(), IsInsideVehicle(), IsRaining(), IsUnderRoof(), IsWaterContact(), m_ItemsWetnessMax, m_Player, m_RoofCheckTimer, m_Time, m_WaterLevel, m_WetDryTick, ProcessItemsDryness(), ProcessItemsHeat(), ProcessTemperatureSources(), ProcessWetnessByRain(), ProcessWetnessByWaterLevel() и GameConstants::STATE_WET.

Поля

◆ m_BodyParts

ref array<int> m_BodyParts
protected

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

◆ m_Clouds

float m_Clouds = 0
protected

◆ m_DayOrNight

float m_DayOrNight = 0
protected

◆ m_EnvironmentTemperature

float m_EnvironmentTemperature = 0
protected

◆ m_FeetParts

ref array<int> m_FeetParts
protected

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

◆ m_Fog

◆ m_HasTemperatureSources

bool m_HasTemperatureSources
protected

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

◆ m_HeadParts

ref array<int> m_HeadParts
protected

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

◆ m_HeatBufferTimer

float m_HeatBufferTimer
protected

DEPRECATED.

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

◆ m_HeatComfort

float m_HeatComfort
protected

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

◆ m_HeatSourceTemp

float m_HeatSourceTemp
protected

◆ m_IsInWater

bool m_IsInWater
protected

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

◆ 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_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

◆ 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

◆ m_SlotIdsLower

ref array<int> m_SlotIdsLower
protected

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

◆ m_SlotIdsUpper

ref array<int> m_SlotIdsUpper
protected

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

◆ m_SurfaceType

string m_SurfaceType
protected

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

◆ 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

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

◆ m_WetDryTick

float m_WetDryTick
protected

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

◆ m_Wind

◆ m_WindAverageBuffer

ref SimpleMovingAverage<float> m_WindAverageBuffer
protected

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

◆ RAIN_LIMIT_LOW

const float RAIN_LIMIT_LOW = 0.05
private

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

◆ WATER_LEVEL_HIGH

const float WATER_LEVEL_HIGH = 1.5
private

◆ WATER_LEVEL_LOW

const float WATER_LEVEL_LOW = 0.5
private

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

◆ WATER_LEVEL_MID

const float WATER_LEVEL_MID = 1.2
private

◆ WATER_LEVEL_NONE

const float WATER_LEVEL_NONE = 0.15
private

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