Calculates and process player's heatcomfort related to defined body parts.
971 {
972 float hcPenaltyTotal
973
974
975 float hcBodyPartTotal, hcBodyPart;
976 float hBodyPartTotal, hBodyPart;
977
978 float heatComfortSum = 0.0;
979 float heatItems = 0.0;
980
981 #ifdef ENABLE_LOGGING
982 LogItemHeat("====================");
983 #endif
985 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
987 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
989 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
991 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
993 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
995 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
997 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
999 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
1001 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
1002
1009
1010 heatItems = hBodyPartTotal;
1011 heatComfortSum = hcBodyPartTotal;
1012 heatComfortSum += hcPenaltyTotal;
1013
1015 {
1016 if (
m_Player.GetStomach().GetStomachVolume() > 0.0)
1017 {
1018 float stomachContentTemperature =
m_Player.GetStomach().GetStomachTemperature();
1020 {
1022 -10.0,
1025 0.0,
1026 stomachContentTemperature,
1027 );
1028 }
1030 {
1033 70.0,
1034 0.0,
1036 stomachContentTemperature,
1037 );
1038 }
1039 else
1040 stomachContentTemperature = 0.0;
1041
1043 }
1044 }
1045
1047
1052
1054 targetHeatComfort =
Math.
Clamp(targetHeatComfort, 0.0,
m_Player.GetStatHeatComfort().GetMax());
1055 else
1056 targetHeatComfort =
Math.
Clamp(targetHeatComfort,
m_Player.GetStatHeatComfort().GetMin(),
m_Player.GetStatHeatComfort().GetMax());
1057
1058 targetHeatComfort =
Math.
Round(targetHeatComfort * 100) * 0.01;
1059
1060 float dynamicHeatComfort;
1061
1062 {
1063 float direction = 1.0;
1064 if (targetHeatComfort < 0.0)
1065 direction = -1.0;
1066
1069 else
1071 }
1072
1073 dynamicHeatComfort =
Math.
Round(dynamicHeatComfort * 100) * 0.01;
1074
1076
1079 }
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.