Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
environment.c File Reference

Go to the source code of this file.

Data Structures

class  EnvironmentDrynessData

Enumerations

enum  EEnvironmentHeatcomfortBehaviorCategory { DEFAULT , CAR_ENGINE_ON }
 Categories that are changing behavior of Heat comfort processing. More...

Functions

void AddToEnvironmentTemperature (float pTemperature)
void ApplyDrynessToItem (ItemBase pItem)
void ApplyDrynessToItemEx (ItemBase pItem, EnvironmentDrynessData pDrynessData)
void ApplyWetnessToItem (ItemBase pItem)
void BodyPartHeatProperties (array< int > pBodyPartIds, float pCoef, out float pHeatComfort, out float pHeat)
 returns weighted avg heat comfort for bodypart
void BodyPartHeatProperties (int pBodyPartId, float pCoef, out float pHeatComfort, out float pHeat)
 Iterate through given body part and calculates heatcofort and item heat value.
float CalcTemperatureFromTemperatureSource (notnull UTemperatureSource uts)
void CheckUnderRoof ()
 Checks whether character is sheltered and sets the information.
void CheckWaterContact (out float pWaterLevel)
 Checks player's contanct with water.
void CollectAndSetEnvironmentData ()
 Sets actual weather related values for further use (rain, snow, wind, etc.).
void CollectAndSetPlayerData ()
 Sets character related value for furher use.
bool DetermineHeatcomfortBehavior ()
 Changes Heat Comfort curve behavior based on where the character is.
void Environment (PlayerBase pPlayer)
float EnvTempToCoef (float pTemp)
void GatherTemperatureSources ()
 Checks characters proximity for usable Universal Temperature Sources and register them.
float GetApplicableHeatbuffer ()
float GetDayOrNight ()
string GetDebugMessage ()
 debug
float GetEnvironmentTemperature ()
 Calculations of temperarute for different situations.
int GetNextRoofCheck ()
float GetPlayerHeat ()
 Character's heat (calculated from movement speed multiplied by constant).
float GetTargetHeatComfort ()
float GetTemperature ()
float GetTemperatureHeightCorrection ()
float GetUniversalSourcesTemperageAverage ()
float GetWaterLevel ()
float GetWetDelta ()
 Calculates soaking/drying delta based on character's location and weather.
float GetWindModifierPerSurface ()
 Wind intensity (influence) modifier of temperature value.
void Init ()
void Init (PlayerBase pPlayer)
 used for calculations before the data modification
bool IsChildOfType (array< typename > typenames)
 Returns true if character is child of given parent type(s).
bool IsInsideBuilding ()
 Is character inside building?
bool IsInsideVehicle ()
bool IsNeutralTemperature (float temperature, float lowerLimit=GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT, float upperLimit=GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT)
bool IsRaining ()
 Rain phenomenon actual value > RAIN_LIMIT_LOW.
bool IsSnowing ()
 Snowfall phenomenon actual value > SNOWFALL_LIMIT_LOW.
bool IsTemperatureSet ()
 For safe-guards, waiting for the proper temperature to be set.
bool IsUnderRoof ()
 Is character under roof (periodically checked - GameConstants.ENVIRO_TICK_ROOF_RC_CHECK).
bool IsUnderRoofBuilding ()
 Is character under building's roof (periodically checked - GameConstants.ENVIRO_TICK_ROOF_RC_CHECK).
bool IsWaterContact ()
 Is character in contact with water body?
float NakedBodyPartHeatComfortPenalty (int pBodyPartSlotId, float pCoef)
 Calculates penalty value for heatcomfort - this simulates uncovered body part reaction.
float NormalizedTemperature (float temperature, float lowerLimit=GameConstants.ENVIRO_LOW_TEMP_LIMIT, float upperLimit=GameConstants.ENVIRO_HIGH_TEMP_LIMIT)
void OnTemperatureSourcesEnter ()
 Event fired when characters enters into UTSource proximity.
void OnTemperatureSourcesLeft ()
 Event fired when characters leave the UTSource proximity.
bool OverridenHeatComfort (out float value)
void ProcessHeatBuffer (EnvironmentSnapshotData data)
void ProcessHeatBuffer (float heatComfortCloths)
 backward compatibility [<1.27]
void ProcessHeatComfort ()
 Calculates and process player's heatcomfort related to defined body parts.
void ProcessItemHierarchyRecursive (ItemBase item, float heatPermeabilityCoef=1.0)
void ProcessItemsDryness ()
 Dry items in player possession.
void ProcessItemsHeat ()
void ProcessItemsInHandsTemperature ()
 Process temperature of item in character hands and cool/warm it to neutral temparature.
void ProcessItemsTemperature (array< int > pBodyPartIds)
 Iterate through items in player posession (by given body parts) and cool/warm them to neutral temparature.
void ProcessItemsWetness (array< int > pSlotIds)
 Soak items at specific Slot ID(s).
void ProcessTemperatureSources ()
 Processes registered UTSources and calculates resulting m_UTSAverageTemperature.
void ProcessWetnessByRain ()
void ProcessWetnessByWaterLevel (float pWaterLevel)
 Processes items wetness in player possession based on the current water level (the character is in).
void SetAreaGenericColdness ()
 Determines whether player is in cold area which restricts use of some actions (digging).
void SetEnvironmentSnapshotData ()
void SetEnvironmentTemperature ()
void SetHeatcomfortDirectly ()
void SetItemHeatingCoef (float val)
void SetProcessedItemTemperature (ItemBase item, float heatPermeabilityCoef=1.0)
void SetTargetHeatComfort (float value)
void Update (float pDelta)
 Main loop that runs calculations for various Environment parts (wetness, heatcomfort, watercontact, etc.).
float WindEffectTemperatureValue (float temperatureInput)
 backward compatibility [<1.28]

Variables

ref SimpleMovingAverage< floatm_AverageHeatComfortBuffer
ref array< intm_BodyParts
enum EEnvironmentHeatcomfortBehaviorCategory m_ClothingHeatComfort
float m_Clouds = 0
float m_DayOrNight = 0
ref EnvironmentSnapshotData m_EnvironmentSnapshot
float m_EnvironmentTemperature
ref array< intm_FeetParts
float m_Fog = 0
bool m_HasTemperatureSources
ref array< intm_HeadParts
float m_HeatBufferCapPrevious
 reused as state toggle
float m_HeatBufferTimer
float m_HeatComfort
int m_HeatComfortBehaviorCategory
float m_HeatSourceTemp
 DEPRECATED.
bool m_Initialized
bool m_IsInWater
bool m_IsTempSet
bool m_IsUnderRoof
bool m_IsUnderRoofBuilding
float m_ItemsWetnessMax
float m_ItemTemperatureCoef
int m_LiquidType
PlayerBase m_Player
float m_PlayerHeat
float m_PlayerHeightPos
float m_PlayerSpeed
float m_PlayerTemperature
float m_Rain = 0
 target value of heatcomfort (non-buffered)
float m_RoofCheckTimer
 keeps wetness of most wet item in player's possesion
ref array< intm_SlotIdsBottom
ref array< intm_SlotIdsComplete
ref array< intm_SlotIdsLower
ref array< intm_SlotIdsUpper
float m_Snowfall = 0
string m_SurfaceType
float m_TargetHeatComfort
 player's heatcomfort (buffered, stored in player stats)
float m_Time = 0
ref array< UTemperatureSource > m_UTemperatureSources
float m_UTSAverageTemperature
ref SimpleMovingAverage< floatm_UTSAverageTemperatureBuffer
float m_WaterLevel
float m_WetDryTick
float m_Wind = 0
ref SimpleMovingAverage< floatm_WindAverageBuffer
WorldData m_WorldData
class EnvironmentDrynessData RAIN_LIMIT_LOW = 0.05
 Simulates influence of environment to character Takes input data from WorldData, Weather system and entities simulating temperature and wetness.
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_LOW = 0.5
const float WATER_LEVEL_MID = 1.2
const float WATER_LEVEL_NONE = 0.15

Enumeration Type Documentation

◆ EEnvironmentHeatcomfortBehaviorCategory

Categories that are changing behavior of Heat comfort processing.

Enumerator
DEFAULT 
CAR_ENGINE_ON 

Definition at line 4 of file environment.c.

Function Documentation

◆ AddToEnvironmentTemperature()

void AddToEnvironmentTemperature ( float pTemperature)
protected

◆ ApplyDrynessToItem()

void ApplyDrynessToItem ( ItemBase pItem)
protected

Definition at line 869 of file environment.c.

References ApplyDrynessToItemEx().

◆ ApplyDrynessToItemEx()

void ApplyDrynessToItemEx ( ItemBase pItem,
EnvironmentDrynessData pDrynessData )
protected

◆ ApplyWetnessToItem()

◆ BodyPartHeatProperties() [1/2]

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

returns weighted avg heat comfort for bodypart

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

Definition at line 1798 of file environment.c.

References EnumTools::EnumToString(), GameConstants::ENVIRO_HEATISOLATION_BACK_WEIGHT, GameConstants::ENVIRO_HEATISOLATION_VEST_WEIGHT, GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT, and NormalizedTemperature().

◆ BodyPartHeatProperties() [2/2]

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

Iterate through given body part and calculates heatcofort and item heat value.

Parameters
pBodyPartIdsList of body parts to iterate through (see InventorySlots)
pCoefMultiplier used for heatcomfort enhancing
[out]pHeatComfortoverall heatcomfort from items of given body part
[out]pHeatoverall heat from items for given body part

Definition at line 1356 of file environment.c.

References GameInventory::AttachmentCount(), EnumTools::EnumToString(), GameInventory::GetAttachmentFromIndex(), GameInventory::GetCargo(), CargoBase::GetItem(), CargoBase::GetItemCount(), GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT, and NormalizedTemperature().

Referenced by ProcessHeatComfort().

◆ CalcTemperatureFromTemperatureSource()

float CalcTemperatureFromTemperatureSource ( notnull UTemperatureSource uts)
protected

heat transfer through air to player (env temperature)

Definition at line 1576 of file environment.c.

References vector::Distance(), Math::InverseLerp(), and Math::Max().

Referenced by ProcessTemperatureSources().

◆ CheckUnderRoof()

void CheckUnderRoof ( )
protected

Checks whether character is sheltered and sets the information.

if inside vehicle return immediatelly

Definition at line 391 of file environment.c.

References IsChildOfType(), m_IsUnderRoof, m_IsUnderRoofBuilding, and DayZPhysics::RayCastBullet().

Referenced by Update().

◆ CheckWaterContact()

void CheckWaterContact ( out float pWaterLevel)
protected

Checks player's contanct with water.

Parameters
[out]pWaterLevelwater level height
Returns
Nothing

no valid surface under character

sync info about water contact to player

update active surface

Definition at line 421 of file environment.c.

References g_Game, IsChildOfType(), IsUnderRoofBuilding(), LIQUID_FRESHWATER, LIQUID_HOTWATER, LIQUID_RIVERWATER, LIQUID_SALTWATER, LIQUID_STILLWATER, LIQUID_WATER, HumanMovementState::m_iMovement, m_IsInWater, m_LiquidType, m_SurfaceType, WATER_LEVEL_HIGH, and WATER_LEVEL_MID.

Referenced by Update().

◆ CollectAndSetEnvironmentData()

void CollectAndSetEnvironmentData ( )
protected

◆ CollectAndSetPlayerData()

void CollectAndSetPlayerData ( )
protected

Sets character related value for furher use.

  • position

movement speed

  • player heat (actual speed * heat constant)

Definition at line 626 of file environment.c.

References HumanCommandMove::GetCurrentMovementSpeed(), GetPlayerHeat(), m_PlayerHeat, m_PlayerHeightPos, and m_PlayerSpeed.

Referenced by Update().

◆ DetermineHeatcomfortBehavior()

bool DetermineHeatcomfortBehavior ( )
protected

Changes Heat Comfort curve behavior based on where the character is.

Returns
true if the behavior is altered otherwise false

Definition at line 369 of file environment.c.

References IsChildOfType(), and m_HeatComfortBehaviorCategory.

Referenced by Update().

◆ Environment()

void Environment ( PlayerBase pPlayer)
private

Definition at line 106 of file environment.c.

Referenced by ManBase::Init().

◆ EnvTempToCoef()

float EnvTempToCoef ( float pTemp)
protected

◆ GatherTemperatureSources()

void GatherTemperatureSources ( )
protected

Checks characters proximity for usable Universal Temperature Sources and register them.

skip - Temperature Source is not affecting player entities

skip - Temperature Source is too far

Definition at line 1476 of file environment.c.

References DayZPlayerUtils(), vector::DistanceSq(), GameConstants::ENVIRO_TEMP_SOURCES_LOOKUP_RADIUS, m_UTemperatureSources, Math::SqrFloat(), and Vector().

Referenced by PluginBase::SendDebug(), and Update().

◆ GetApplicableHeatbuffer()

float GetApplicableHeatbuffer ( )
protected

Definition at line 1205 of file environment.c.

References PlayerStat(), and Math::Round().

Referenced by ProcessHeatBuffer().

◆ GetDayOrNight()

float GetDayOrNight ( )
protected

Definition at line 1928 of file environment.c.

References m_DayOrNight.

◆ GetDebugMessage()

◆ GetEnvironmentTemperature()

float GetEnvironmentTemperature ( )
protected

Calculations of temperarute for different situations.

Returns
Resulting temperature of the environment

Definition at line 520 of file environment.c.

References Math::AbsFloat(), GameConstants::ENVIRO_TEMPERATURE_INSIDE_VEHICLE_COEF, GameConstants::ENVIRO_TEMPERATURE_UNDERROOF_COEF, GetWindModifierPerSurface(), IsChildOfType(), IsInsideBuilding(), IsUnderRoof(), IsWaterContact(), m_IsUnderRoofBuilding, m_LiquidType, m_UTSAverageTemperature, m_WorldData, and WindEffectTemperatureValue().

Referenced by GetWetDelta(), and SetEnvironmentTemperature().

◆ GetNextRoofCheck()

int GetNextRoofCheck ( )
protected

Definition at line 1698 of file environment.c.

References GameConstants::ENVIRO_TICK_ROOF_RC_CHECK, and m_RoofCheckTimer.

Referenced by GetDebugMessage().

◆ GetPlayerHeat()

float GetPlayerHeat ( )
protected

Character's heat (calculated from movement speed multiplied by constant).

Returns
generated heat value

Definition at line 295 of file environment.c.

References GameConstants::ENVIRO_DEFAULT_ENTITY_HEAT, and m_PlayerSpeed.

Referenced by CollectAndSetPlayerData(), and ProcessHeatComfort().

◆ GetTargetHeatComfort()

float GetTargetHeatComfort ( )
protected

Definition at line 505 of file environment.c.

References m_TargetHeatComfort.

Referenced by GetDebugMessage().

◆ GetTemperature()

◆ GetTemperatureHeightCorrection()

float GetTemperatureHeightCorrection ( )
protected

Definition at line 1791 of file environment.c.

References m_PlayerHeightPos, m_WorldData, and Math::Max().

◆ GetUniversalSourcesTemperageAverage()

float GetUniversalSourcesTemperageAverage ( )
protected

Definition at line 1571 of file environment.c.

References m_UTSAverageTemperature.

◆ GetWaterLevel()

float GetWaterLevel ( )
protected

Definition at line 1703 of file environment.c.

References IsWaterContact(), m_WaterLevel, and WATER_LEVEL_NONE.

◆ GetWetDelta()

◆ GetWindModifierPerSurface()

float GetWindModifierPerSurface ( )
protected

Wind intensity (influence) modifier of temperature value.

Returns
float modifier used in temperature calculations

Definition at line 492 of file environment.c.

References g_Game, IsUnderRoofBuilding(), and m_SurfaceType.

Referenced by GetDebugMessage(), and GetEnvironmentTemperature().

◆ Init() [1/2]

◆ Init() [2/2]

void Init ( PlayerBase pPlayer)
protected

used for calculations before the data modification

Definition at line 1771 of file environment.c.

References Init().

◆ IsChildOfType()

bool IsChildOfType ( array< typename > typenames)
private

Returns true if character is child of given parent type(s).

Parameters
typenameslist of types to check against

Definition at line 330 of file environment.c.

Referenced by CheckUnderRoof(), CheckWaterContact(), DetermineHeatcomfortBehavior(), GetEnvironmentTemperature(), GetWetDelta(), IsInsideVehicle(), NakedBodyPartHeatComfortPenalty(), and Update().

◆ IsInsideBuilding()

bool IsInsideBuilding ( )
protected

Is character inside building?

(periodically checked - GameConstants.ENVIRO_TICK_ROOF_RC_CHECK).

Definition at line 313 of file environment.c.

Referenced by GetDebugMessage(), GetEnvironmentTemperature(), GetWetDelta(), NakedBodyPartHeatComfortPenalty(), and Update().

◆ IsInsideVehicle()

bool IsInsideVehicle ( )
protected

Definition at line 1933 of file environment.c.

References IsChildOfType().

◆ IsNeutralTemperature()

Definition at line 1713 of file environment.c.

◆ IsRaining()

bool IsRaining ( )
protected

Rain phenomenon actual value > RAIN_LIMIT_LOW.

Definition at line 351 of file environment.c.

References m_Rain, and RAIN_LIMIT_LOW.

Referenced by GetWetDelta(), and Update().

◆ IsSnowing()

bool IsSnowing ( )
protected

Snowfall phenomenon actual value > SNOWFALL_LIMIT_LOW.

Definition at line 359 of file environment.c.

References m_Snowfall, and SNOWFALL_LIMIT_LOW.

Referenced by GetWetDelta(), and Update().

◆ IsTemperatureSet()

bool IsTemperatureSet ( )
private

For safe-guards, waiting for the proper temperature to be set.

Definition at line 286 of file environment.c.

References m_IsTempSet.

◆ IsUnderRoof()

bool IsUnderRoof ( )
protected

Is character under roof (periodically checked - GameConstants.ENVIRO_TICK_ROOF_RC_CHECK).

Runs when player is not inside of building

Definition at line 305 of file environment.c.

References m_IsUnderRoof.

Referenced by GetEnvironmentTemperature(), GetWetDelta(), NakedBodyPartHeatComfortPenalty(), and Update().

◆ IsUnderRoofBuilding()

bool IsUnderRoofBuilding ( )
private

Is character under building's roof (periodically checked - GameConstants.ENVIRO_TICK_ROOF_RC_CHECK).

There might be situations where the surface under is external, but character is inside building

Definition at line 343 of file environment.c.

References m_IsUnderRoofBuilding.

Referenced by CheckWaterContact(), and GetWindModifierPerSurface().

◆ IsWaterContact()

bool IsWaterContact ( )
protected

Is character in contact with water body?

(periodically checked - GameConstants.ENVIRO_TICK_RATE).

Definition at line 321 of file environment.c.

References m_IsInWater.

Referenced by GetDebugMessage(), GetEnvironmentTemperature(), GetWaterLevel(), GetWetDelta(), NakedBodyPartHeatComfortPenalty(), and Update().

◆ NakedBodyPartHeatComfortPenalty()

float NakedBodyPartHeatComfortPenalty ( int pBodyPartSlotId,
float pCoef )
protected

Calculates penalty value for heatcomfort - this simulates uncovered body part reaction.

Parameters
pBodyPartSlotIdInventorySlot ID to check
pCoefexternal coefficient used for that slot
Returns
Value of penalty for given slot ID

Definition at line 1455 of file environment.c.

References GameConstants::ENVIRO_ISOLATION_WETFACTOR_DRENCHED, GameConstants::ENVIRO_NAKED_BODY_PENALTY_RAIN_MIN_VALUE, GameConstants::ENVIRO_NAKED_BODY_PENALTY_SNOWFALL_MIN_VALUE, IsChildOfType(), IsInsideBuilding(), IsUnderRoof(), IsWaterContact(), m_Rain, and m_Snowfall.

Referenced by ProcessHeatComfort().

◆ NormalizedTemperature()

◆ OnTemperatureSourcesEnter()

void OnTemperatureSourcesEnter ( )
protected

Event fired when characters enters into UTSource proximity.

Referenced by ProcessTemperatureSources().

◆ OnTemperatureSourcesLeft()

void OnTemperatureSourcesLeft ( )
protected

Event fired when characters leave the UTSource proximity.

Referenced by ProcessTemperatureSources().

◆ OverridenHeatComfort()

bool OverridenHeatComfort ( out float value)
protected

◆ ProcessHeatBuffer() [1/2]

◆ ProcessHeatBuffer() [2/2]

void ProcessHeatBuffer ( float heatComfortCloths)
protected

backward compatibility [<1.27]

Definition at line 1909 of file environment.c.

References m_EnvironmentSnapshot, m_TargetHeatComfort, and ProcessHeatBuffer().

◆ ProcessHeatComfort()

◆ ProcessItemHierarchyRecursive()

void ProcessItemHierarchyRecursive ( ItemBase item,
float heatPermeabilityCoef = 1.0 )
protected

◆ ProcessItemsDryness()

◆ ProcessItemsHeat()

void ProcessItemsHeat ( )
protected

Definition at line 1779 of file environment.c.

References ProcessHeatComfort().

◆ ProcessItemsInHandsTemperature()

void ProcessItemsInHandsTemperature ( )
protected

Process temperature of item in character hands and cool/warm it to neutral temparature.

Definition at line 1250 of file environment.c.

References ItemBase::IsSelfAdjustingTemperature(), ProcessItemHierarchyRecursive(), and SetProcessedItemTemperature().

Referenced by Update().

◆ ProcessItemsTemperature()

void ProcessItemsTemperature ( array< int > pBodyPartIds)
protected

Iterate through items in player posession (by given body parts) and cool/warm them to neutral temparature.

Parameters
pBodyPartIdsList of body parts to iterate through (see InventorySlots)

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

Definition at line 1219 of file environment.c.

References ItemBase::IsSelfAdjustingTemperature(), ProcessItemHierarchyRecursive(), and SetProcessedItemTemperature().

Referenced by Update().

◆ ProcessItemsWetness()

void ProcessItemsWetness ( array< int > pSlotIds)
protected

Soak items at specific Slot ID(s).

Parameters
pSlotIdsInventory Slot IDs to process

Definition at line 697 of file environment.c.

References ApplyWetnessToItem(), and GameConstants::ENVIRO_TICK_RATE.

Referenced by ProcessWetnessByRain(), ProcessWetnessByWaterLevel(), and Update().

◆ ProcessTemperatureSources()

void ProcessTemperatureSources ( )
protected

Processes registered UTSources and calculates resulting m_UTSAverageTemperature.

adds average of 2 most significat sources to buffer

Definition at line 1511 of file environment.c.

References CalcTemperatureFromTemperatureSource(), m_HasTemperatureSources, m_UTemperatureSources, m_UTSAverageTemperature, m_UTSAverageTemperatureBuffer, OnTemperatureSourcesEnter(), OnTemperatureSourcesLeft(), SetItemHeatingCoef(), and GameConstants::TEMP_COEF_INVENTORY.

Referenced by Update().

◆ ProcessWetnessByRain()

void ProcessWetnessByRain ( )
protected

Definition at line 1785 of file environment.c.

References m_SlotIdsComplete, and ProcessItemsWetness().

◆ ProcessWetnessByWaterLevel()

void ProcessWetnessByWaterLevel ( float pWaterLevel)
protected

Processes items wetness in player possession based on the current water level (the character is in).

Parameters
pWaterLevelWater level height

Definition at line 679 of file environment.c.

References m_SlotIdsBottom, m_SlotIdsComplete, m_SlotIdsLower, m_SlotIdsUpper, ProcessItemsWetness(), WATER_LEVEL_HIGH, WATER_LEVEL_LOW, WATER_LEVEL_MID, and WATER_LEVEL_NONE.

Referenced by Update().

◆ SetAreaGenericColdness()

void SetAreaGenericColdness ( )
protected

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

Definition at line 669 of file environment.c.

References GameConstants::COLD_AREA_TEMPERATURE_THRESHOLD, and m_WorldData.

Referenced by CollectAndSetEnvironmentData().

◆ SetEnvironmentSnapshotData()

void SetEnvironmentSnapshotData ( )
protected

Definition at line 1900 of file environment.c.

References m_EnvironmentSnapshot, and m_TargetHeatComfort.

◆ SetEnvironmentTemperature()

void SetEnvironmentTemperature ( )
protected

◆ SetHeatcomfortDirectly()

void SetHeatcomfortDirectly ( )
protected

◆ SetItemHeatingCoef()

void SetItemHeatingCoef ( float val)
protected

Definition at line 1556 of file environment.c.

References m_ItemTemperatureCoef.

Referenced by ProcessTemperatureSources(), and SetProcessedItemTemperature().

◆ SetProcessedItemTemperature()

◆ SetTargetHeatComfort()

void SetTargetHeatComfort ( float value)
protected

Definition at line 1084 of file environment.c.

References m_TargetHeatComfort.

Referenced by ProcessHeatComfort(), and SetHeatcomfortDirectly().

◆ Update()

◆ WindEffectTemperatureValue()

float WindEffectTemperatureValue ( float temperatureInput)
protected

backward compatibility [<1.28]

Definition at line 1918 of file environment.c.

References GameConstants::ENVIRO_WIND_CHILL_LIMIT, GameConstants::ENVIRO_WIND_EFFECT_SLOPE, m_Wind, and m_WorldData.

Referenced by GetEnvironmentTemperature().

Variable Documentation

◆ m_AverageHeatComfortBuffer

ref SimpleMovingAverage<float> m_AverageHeatComfortBuffer
protected

Definition at line 91 of file environment.c.

Referenced by Init(), ProcessHeatComfort(), and SetHeatcomfortDirectly().

◆ m_BodyParts

ref array<int> m_BodyParts
protected

Definition at line 82 of file environment.c.

Referenced by Init(), and Update().

◆ m_ClothingHeatComfort

enum EEnvironmentHeatcomfortBehaviorCategory m_ClothingHeatComfort

◆ m_Clouds

float m_Clouds = 0
protected

Definition at line 57 of file environment.c.

Referenced by CollectAndSetEnvironmentData(), GetDebugMessage(), and GetWetDelta().

◆ m_DayOrNight

float m_DayOrNight = 0
protected

Definition at line 56 of file environment.c.

Referenced by CollectAndSetEnvironmentData(), GetDayOrNight(), and GetDebugMessage().

◆ m_EnvironmentSnapshot

ref EnvironmentSnapshotData m_EnvironmentSnapshot
protected

◆ m_EnvironmentTemperature

float m_EnvironmentTemperature
protected

◆ m_FeetParts

ref array<int> m_FeetParts
protected

Definition at line 83 of file environment.c.

Referenced by Init(), and Update().

◆ m_Fog

float m_Fog = 0
protected

Definition at line 55 of file environment.c.

Referenced by CollectAndSetEnvironmentData(), GetDebugMessage(), and GetWetDelta().

◆ m_HasTemperatureSources

bool m_HasTemperatureSources
protected

Definition at line 87 of file environment.c.

Referenced by ProcessHeatBuffer(), ProcessItemsDryness(), and ProcessTemperatureSources().

◆ m_HeadParts

ref array<int> m_HeadParts
protected

Definition at line 81 of file environment.c.

Referenced by Init(), and Update().

◆ m_HeatBufferCapPrevious

float m_HeatBufferCapPrevious
protected

reused as state toggle

Definition at line 74 of file environment.c.

Referenced by ProcessHeatBuffer().

◆ m_HeatBufferTimer

float m_HeatBufferTimer
protected

Definition at line 73 of file environment.c.

Referenced by Init(), and ProcessHeatBuffer().

◆ m_HeatComfort

float m_HeatComfort
protected

◆ m_HeatComfortBehaviorCategory

int m_HeatComfortBehaviorCategory
protected

◆ m_HeatSourceTemp

float m_HeatSourceTemp
protected

DEPRECATED.

Definition at line 1767 of file environment.c.

◆ m_Initialized

bool m_Initialized
private

Definition at line 95 of file environment.c.

◆ m_IsInWater

bool m_IsInWater
protected

Definition at line 70 of file environment.c.

Referenced by CheckWaterContact(), Init(), IsWaterContact(), and ProcessHeatBuffer().

◆ m_IsTempSet

bool m_IsTempSet
protected

Definition at line 71 of file environment.c.

Referenced by IsTemperatureSet(), and SetEnvironmentTemperature().

◆ m_IsUnderRoof

bool m_IsUnderRoof
protected

Definition at line 68 of file environment.c.

Referenced by CheckUnderRoof(), GetDebugMessage(), Init(), and IsUnderRoof().

◆ m_IsUnderRoofBuilding

bool m_IsUnderRoofBuilding
private

Definition at line 69 of file environment.c.

Referenced by CheckUnderRoof(), GetEnvironmentTemperature(), and IsUnderRoofBuilding().

◆ m_ItemsWetnessMax

float m_ItemsWetnessMax
protected

Definition at line 39 of file environment.c.

Referenced by ApplyDrynessToItemEx(), ApplyWetnessToItem(), and Update().

◆ m_ItemTemperatureCoef

float m_ItemTemperatureCoef
protected

Definition at line 64 of file environment.c.

Referenced by SetItemHeatingCoef(), and SetProcessedItemTemperature().

◆ m_LiquidType

int m_LiquidType
protected

◆ m_Player

PlayerBase m_Player
protected

Definition at line 43 of file environment.c.

◆ m_PlayerHeat

float m_PlayerHeat
protected

Definition at line 47 of file environment.c.

Referenced by CollectAndSetPlayerData(), and GetWetDelta().

◆ m_PlayerHeightPos

float m_PlayerHeightPos
protected

Definition at line 44 of file environment.c.

Referenced by CollectAndSetPlayerData(), and GetTemperatureHeightCorrection().

◆ m_PlayerSpeed

float m_PlayerSpeed
protected

Definition at line 45 of file environment.c.

Referenced by CollectAndSetPlayerData(), GetPlayerHeat(), and Init().

◆ m_PlayerTemperature

float m_PlayerTemperature
protected

Definition at line 46 of file environment.c.

◆ m_Rain

float m_Rain = 0
protected

target value of heatcomfort (non-buffered)

Definition at line 52 of file environment.c.

Referenced by CollectAndSetEnvironmentData(), GetDebugMessage(), GetWetDelta(), IsRaining(), and NakedBodyPartHeatComfortPenalty().

◆ m_RoofCheckTimer

float m_RoofCheckTimer
protected

keeps wetness of most wet item in player's possesion

Definition at line 40 of file environment.c.

Referenced by GetNextRoofCheck(), Init(), and Update().

◆ m_SlotIdsBottom

ref array<int> m_SlotIdsBottom
protected

Definition at line 78 of file environment.c.

Referenced by Init(), and ProcessWetnessByWaterLevel().

◆ m_SlotIdsComplete

ref array<int> m_SlotIdsComplete
protected

Definition at line 76 of file environment.c.

Referenced by Init(), ProcessWetnessByRain(), ProcessWetnessByWaterLevel(), and Update().

◆ m_SlotIdsLower

ref array<int> m_SlotIdsLower
protected

Definition at line 79 of file environment.c.

Referenced by Init(), and ProcessWetnessByWaterLevel().

◆ m_SlotIdsUpper

ref array<int> m_SlotIdsUpper
protected

Definition at line 77 of file environment.c.

Referenced by Init(), and ProcessWetnessByWaterLevel().

◆ m_Snowfall

float m_Snowfall = 0
protected

◆ m_SurfaceType

string m_SurfaceType
protected

Definition at line 60 of file environment.c.

Referenced by CheckWaterContact(), GetWindModifierPerSurface(), and Init().

◆ m_TargetHeatComfort

float m_TargetHeatComfort

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

Definition at line 13 of file environment.c.

Referenced by GetTargetHeatComfort(), ProcessHeatBuffer(), SetEnvironmentSnapshotData(), and SetTargetHeatComfort().

◆ m_Time

float m_Time = 0
protected

Definition at line 59 of file environment.c.

Referenced by OnTick(), and Update().

◆ m_UTemperatureSources

ref array<UTemperatureSource> m_UTemperatureSources
protected

◆ m_UTSAverageTemperature

float m_UTSAverageTemperature
protected

◆ m_UTSAverageTemperatureBuffer

ref SimpleMovingAverage<float> m_UTSAverageTemperatureBuffer
protected

Definition at line 90 of file environment.c.

Referenced by Init(), and ProcessTemperatureSources().

◆ m_WaterLevel

float m_WaterLevel
protected

◆ m_WetDryTick

float m_WetDryTick
protected

Definition at line 38 of file environment.c.

Referenced by Init(), and Update().

◆ m_Wind

float m_Wind = 0
protected

◆ m_WindAverageBuffer

ref SimpleMovingAverage<float> m_WindAverageBuffer
protected

Definition at line 1768 of file environment.c.

◆ m_WorldData

◆ RAIN_LIMIT_LOW

class EnvironmentDrynessData RAIN_LIMIT_LOW = 0.05

Simulates influence of environment to character Takes input data from WorldData, Weather system and entities simulating temperature and wetness.

Referenced by IsRaining().

◆ SNOWFALL_LIMIT_LOW

const float SNOWFALL_LIMIT_LOW = 0.5
protected

Definition at line 30 of file environment.c.

Referenced by GetWetDelta(), and IsSnowing().

◆ SNOWFALL_WIND_COMBINED_THRESHOLD

const float SNOWFALL_WIND_COMBINED_THRESHOLD = 1.3
protected

Definition at line 31 of file environment.c.

Referenced by GetWetDelta(), and Update().

◆ WATER_LEVEL_HIGH

const float WATER_LEVEL_HIGH = 1.5
protected

Definition at line 33 of file environment.c.

Referenced by CheckWaterContact(), GetWetDelta(), and ProcessWetnessByWaterLevel().

◆ WATER_LEVEL_LOW

const float WATER_LEVEL_LOW = 0.5
protected

Definition at line 35 of file environment.c.

Referenced by GetWetDelta(), and ProcessWetnessByWaterLevel().

◆ WATER_LEVEL_MID

const float WATER_LEVEL_MID = 1.2
protected

Definition at line 34 of file environment.c.

Referenced by CheckWaterContact(), GetWetDelta(), and ProcessWetnessByWaterLevel().

◆ WATER_LEVEL_NONE

const float WATER_LEVEL_NONE = 0.15
protected