DIFF

class EnvironmentSource

Constructors 1

void Environment(PlayerBase pPlayer)
References m_Player
Referenced by PlayerBase.Init()

Constants 7

const float RAIN_LIMIT_LOW = 0.05
Referenced by IsRaining()
protected const float SNOWFALL_LIMIT_LOW = 0.5
Referenced by GetWetDelta(), and IsSnowing()
protected const float SNOWFALL_WIND_COMBINED_THRESHOLD = 1.3
Referenced by GetWetDelta(), and Update()
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

Members 49

protected float m_WetDryTick

ticks passed since last clothing wetting or drying

Referenced by Init(), and Update()
protected float m_ItemsWetnessMax

keeps wetness of most wet item in player's possesion

protected float m_RoofCheckTimer

keeps info about tick time

Referenced by GetNextRoofCheck(), Init(), and Update()
protected float m_PlayerHeightPos

y position of player above water level (meters)

protected float m_PlayerSpeed

1-3 speed of player movement

protected float m_PlayerTemperature

34-44

protected float m_PlayerHeat

3-9 heatcomfort generated by entites movement

protected float m_HeatComfort

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

protected float m_TargetHeatComfort

target value of heatcomfort (non-buffered)

protected float m_Rain = 0

0-1 amount of rain

protected float m_Snowfall = 0

0-1 amount of rain

protected float m_Wind = 0

strength of wind

protected float m_Fog = 0

0-1 how foggy it is

protected float m_DayOrNight = 0

0-1 day(0) or night(1)

protected float m_Clouds = 0

0-1 how cloudy it is

protected float m_EnvironmentTemperature

temperature of environment player is in

protected float m_Time = 0
Referenced by Update()
protected string m_SurfaceType
protected float m_ItemTemperatureCoef
protected float m_WaterLevel
protected bool m_IsUnderRoof
Referenced by CheckUnderRoof(), GetDebugMessage(), Init()
Show 1 more, IsUnderRoof()
private bool m_IsUnderRoofBuilding
protected bool m_IsInWater
Referenced by CheckWaterContact(), Init(), IsWaterContact()
Show 1 more, ProcessHeatBuffer()
protected bool m_IsTempSet
protected float m_HeatBufferTimer

reused as state toggle

Referenced by Init(), and ProcessHeatBuffer()
protected float m_HeatBufferCapPrevious
Referenced by ProcessHeatBuffer()
protected ref array<int> m_SlotIdsComplete
protected ref array<int> m_SlotIdsUpper
protected ref array<int> m_SlotIdsBottom
protected ref array<int> m_SlotIdsLower
protected ref array<int> m_HeadParts
Referenced by Init(), and Update()
protected ref array<int> m_BodyParts
Referenced by Init(), and Update()
protected ref array<int> m_FeetParts
Referenced by Init(), and Update()
protected bool m_HasTemperatureSources
protected float m_UTSAverageTemperature
protected ref array<UTemperatureSource> m_UTemperatureSources
protected ref SimpleMovingAverage<float> m_UTSAverageTemperatureBuffer
protected ref SimpleMovingAverage<float> m_AverageHeatComfortBuffer
protected int m_HeatComfortBehaviorCategory
private bool m_Initialized
Referenced by Init(), and Update()
bool m_Debug = falseDIAG_DEVELOPER
bool m_DebugLogDryWet = falseENABLE_LOGGING
Referenced by LogDryWetProcess()
bool m_DebugLogItemHeat = falseENABLE_LOGGING
Referenced by LogItemHeat()
protected float m_HeatSourceTemp

DEPRECATED

protected ref SimpleMovingAverage<float> m_WindAverageBuffer
protected ref EnvironmentSnapshotData m_EnvironmentSnapshot

used for calculations before the data modification

Methods 71

bool IsTemperatureSet()

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

References m_IsTempSet
protected float GetPlayerHeat()

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

Returns: generated heat value

bool IsUnderRoof()

Is character under roof (periodically checked - GameConstants.ENVIRO_TICK_ROOF_RC_CHECK). Runs when player is not inside of building

References m_IsUnderRoof
bool IsInsideBuilding()

Is character inside building? (periodically checked - GameConstants.ENVIRO_TICK_ROOF_RC_CHECK).

protected bool IsWaterContact()

Is character in contact with water body? (periodically checked - GameConstants.ENVIRO_TICK_RATE).

References m_IsInWater
private bool IsChildOfType(array<typename> typenames)

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

typenames
list of types to check against
private bool IsUnderRoofBuilding()

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

protected bool IsRaining()

Rain phenomenon actual value > RAIN_LIMIT_LOW

References m_Rain, and RAIN_LIMIT_LOW
Referenced by GetWetDelta(), and Update()
protected bool IsSnowing()

Snowfall phenomenon actual value > SNOWFALL_LIMIT_LOW

Referenced by GetWetDelta(), and Update()
protected bool DetermineHeatcomfortBehavior()

Changes Heat Comfort curve behavior based on where the character is

Returns: true if the behavior is altered otherwise false

Referenced by Update()
protected void CheckUnderRoof()

Checks whether character is sheltered and sets the information

Referenced by Update()
float GetWindModifierPerSurface()

Wind intensity (influence) modifier of temperature value

Returns: float modifier used in temperature calculations

protected void CollectAndSetPlayerData()

Sets character related value for furher use - position - movement speed - player heat (actual speed * heat constant)

Referenced by Update()
void SetEnvironmentTemperature()
void SetAreaGenericColdness()

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

protected void ProcessWetnessByWaterLevel(float pWaterLevel)

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

pWaterLevel
Water level height
Referenced by Update()
protected void ApplyDrynessToItem(ItemBase pItem)
protected void ProcessHeatComfort()

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

Referenced by ProcessItemsHeat(), and Update()
protected void SetTargetHeatComfort(float value)

uses the raw targetHeatComfort data

protected float GetApplicableHeatbuffer()

deplete the heat buffer if there is difference in HB capacity (eg.: cloths were removed)

Referenced by ProcessHeatBuffer()
protected void ProcessItemsTemperature(array<int> pBodyPartIds)

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

pBodyPartIds
List of body parts to iterate through (see InventorySlots)
Referenced by Update()
protected void ProcessItemsInHandsTemperature()

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

Referenced by Update()
protected float EnvTempToCoef(float pTemp)

swimming special behavior

Referenced by ProcessHeatComfort()
protected float NakedBodyPartHeatComfortPenalty(int pBodyPartSlotId, float pCoef)

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

pBodyPartSlotId
InventorySlot ID to check
pCoef
external coefficient used for that slot

Returns: Value of penalty for given slot ID

Referenced by ProcessHeatComfort()
protected void SetItemHeatingCoef(float val)

adds average of 2 most significat sources to buffer

protected void OnTemperatureSourcesEnter()

Event fired when characters enters into UTSource proximity

protected void OnTemperatureSourcesLeft()

Event fired when characters leave the UTSource proximity

float GetUniversalSourcesTemperageAverage()
void ShowEnvDebugPlayerInfo(bool enabled)DIAG_DEVELOPER
float GetWaterLevel()
private bool IsNeutralTemperature(float temperature, float lowerLimit = GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT, float upperLimit = GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT)
private float NormalizedTemperature(float temperature, float lowerLimit = GameConstants.ENVIRO_LOW_TEMP_LIMIT, float upperLimit = GameConstants.ENVIRO_HIGH_TEMP_LIMIT)
private void LogDryWetProcess(string message, bool indented = false)ENABLE_LOGGING
private void LogItemHeat(string message, bool indented = false)ENABLE_LOGGING
void Init(PlayerBase pPlayer)
protected bool OverridenHeatComfort(out float value)
void AddToEnvironmentTemperature(float pTemperature)
protected void ProcessItemsHeat()
protected void ProcessWetnessByRain()
float GetTemperatureHeightCorrection()
protected void SetEnvironmentSnapshotData()

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

protected void ProcessHeatBuffer(float heatComfortCloths)

backward compatibility [<1.27]

Referenced by ProcessHeatComfort()
protected float WindEffectTemperatureValue(float temperatureInput)

backward compatibility [<1.28]

float GetDayOrNight()
References m_DayOrNight
protected bool IsInsideVehicle()
References IsChildOfType()