Calculates and process player's heatcomfort related to defined body parts.
974 {
975 float hcPenaltyTotal
976
977
978 float hcBodyPartTotal, hcBodyPart;
979 float hBodyPartTotal, hBodyPart;
980
981 float heatComfortSum = 0.0;
982 float heatItems = 0.0;
983
984 #ifdef ENABLE_LOGGING
985 LogItemHeat("====================");
986 #endif
988 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
990 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
992 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
994 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
996 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
998 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
1000 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
1002 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
1004 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
1005
1012
1013 heatItems = hBodyPartTotal;
1014 heatComfortSum = hcBodyPartTotal;
1015 heatComfortSum += hcPenaltyTotal;
1016
1018 {
1019 if (
m_Player.GetStomach().GetStomachVolume() > 0.0)
1020 {
1021 float stomachContentTemperature =
m_Player.GetStomach().GetStomachTemperature();
1023 {
1025 -10.0,
1028 0.0,
1029 stomachContentTemperature,
1030 );
1031 }
1033 {
1036 70.0,
1037 0.0,
1039 stomachContentTemperature,
1040 );
1041 }
1042 else
1043 stomachContentTemperature = 0.0;
1044
1046 }
1047 }
1048
1050
1055
1057 targetHeatComfort =
Math.
Clamp(targetHeatComfort, 0.0,
m_Player.GetStatHeatComfort().GetMax());
1058 else
1059 targetHeatComfort =
Math.
Clamp(targetHeatComfort,
m_Player.GetStatHeatComfort().GetMin(),
m_Player.GetStatHeatComfort().GetMax());
1060
1061 targetHeatComfort =
Math.
Round(targetHeatComfort * 100) * 0.01;
1062
1063 float dynamicHeatComfort;
1064
1065 {
1066 float direction = 1.0;
1067 if (targetHeatComfort < 0.0)
1068 direction = -1.0;
1069
1072 else
1074 }
1075
1076 dynamicHeatComfort =
Math.
Round(dynamicHeatComfort * 100) * 0.01;
1077
1079
1082 }
ref EnvironmentSnapshotData m_EnvironmentSnapshot
void SetTargetHeatComfort(float value)
float m_EnvironmentTemperature
ref SimpleMovingAverage< float > m_AverageHeatComfortBuffer
float EnvTempToCoef(float pTemp)
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 NakedBodyPartHeatComfortPenalty(int pBodyPartSlotId, float pCoef)
Calculates penalty value for heatcomfort - this simulates uncovered body part reaction.
float GetPlayerHeat()
Character's heat (calculated from movement speed multiplied by constant)
void ProcessHeatBuffer(EnvironmentSnapshotData data)
provides access to slot configuration
static const float ENVIRO_HEATCOMFORT_VEST_WEIGHT
const float ENVIRO_HEATCOMFORT_MAX_STEP_SIZE
when is sun highest on sky
static const float ENVIRO_HEATCOMFORT_HIPS_WEIGHT
const float ENVIRO_STOMACH_WEIGHT
static const float ENVIRO_HEATCOMFORT_LEGS_WEIGHT
static const float ENVIRO_HEATCOMFORT_GLOVES_WEIGHT
static const float ENVIRO_HEATCOMFORT_FEET_WEIGHT
const float ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT
const float ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT
damage per second dealt to attachment by fire
static const float ENVIRO_HEATCOMFORT_BODY_WEIGHT
static const float ENVIRO_HEATCOMFORT_BACK_WEIGHT
static const float ENVIRO_HEATCOMFORT_HEADGEAR_WEIGHT
max step of dynamic heatcomfort change (applies if diff between target and dynamic HC is bigger than ...
static const float ENVIRO_HEATCOMFORT_MASK_WEIGHT
how much this body part affects final heatcomfort
static proto float Round(float f)
Returns mathematical round of value.
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 float Remap(float inputMin, float inputMax, float outputMin, float outputMax, float inputValue, bool clampedOutput=true)
Returns given value remaped from input range into output range.
static proto float AbsFloat(float f)
Returns absolute value.