DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ProcessHeatComfort()

void ProcessHeatComfort ( )
protected

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

Heat Comfort Penalty

heatcomfort body parts penalties

Stomach temperature influence to heatcomfort

uses the raw targetHeatComfort data

См. определение в файле Environment.c строка 970

971 {
972 float hcPenaltyTotal
973
974 // NEW body parts => splitted
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();
1019 if (stomachContentTemperature < GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT)
1020 {
1021 stomachContentTemperature = Math.Remap(
1022 -10.0,
1025 0.0,
1026 stomachContentTemperature,
1027 );
1028 }
1029 else if (stomachContentTemperature > GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT)
1030 {
1031 stomachContentTemperature = Math.Remap(
1033 70.0,
1034 0.0,
1036 stomachContentTemperature,
1037 );
1038 }
1039 else
1040 stomachContentTemperature = 0.0;
1041
1042 heatComfortSum += stomachContentTemperature * GameConstants.ENVIRO_STOMACH_WEIGHT;
1043 }
1044 }
1045
1046 float targetHeatComfort = (heatComfortSum + heatItems + (GetPlayerHeat() / 100)) + EnvTempToCoef(m_EnvironmentTemperature);
1047
1049 m_EnvironmentSnapshot.m_ClothingHeatComfort = hcBodyPartTotal;
1050 m_EnvironmentSnapshot.m_TargetHeatComfort = targetHeatComfort;
1052
1053 if (m_Player.GetModifiersManager().IsModifierActive(eModifiers.MDF_HEATBUFFER))
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
1068 dynamicHeatComfort = m_AverageHeatComfortBuffer.Add(targetHeatComfort);
1069 else
1070 dynamicHeatComfort = m_AverageHeatComfortBuffer.Add((Math.AbsFloat(targetHeatComfort) - GameConstants.ENVIRO_HEATCOMFORT_MAX_STEP_SIZE) * direction);
1071 }
1072
1073 dynamicHeatComfort = Math.Round(dynamicHeatComfort * 100) * 0.01;
1074
1075 m_HeatComfort = dynamicHeatComfort;
1076
1077 SetTargetHeatComfort(targetHeatComfort);
1078 m_Player.GetStatHeatComfort().Set(m_HeatComfort);
1079 }
ref EnvironmentSnapshotData m_EnvironmentSnapshot
Определения Environment.c:1762
void SetTargetHeatComfort(float value)
Определения Environment.c:1081
float m_EnvironmentTemperature
Определения Environment.c:58
ref SimpleMovingAverage< float > m_AverageHeatComfortBuffer
Определения Environment.c:91
float m_HeatComfort
Определения Environment.c:48
float EnvTempToCoef(float pTemp)
Определения Environment.c:1341
void BodyPartHeatProperties(int pBodyPartId, float pCoef, out float pHeatComfort, out float pHeat)
Iterate through given body part and calculates heatcofort and item heat value.
Определения Environment.c:1353
float NakedBodyPartHeatComfortPenalty(int pBodyPartSlotId, float pCoef)
Calculates penalty value for heatcomfort - this simulates uncovered body part reaction.
Определения Environment.c:1448
float GetPlayerHeat()
Character's heat (calculated from movement speed multiplied by constant)
Определения Environment.c:295
void ProcessHeatBuffer(EnvironmentSnapshotData data)
Определения Environment.c:1102
DayZPlayer m_Player
Определения Hand_Events.c:42
provides access to slot configuration
Определения InventorySlots.c:6
Определения EnMath.c:7
eModifiers
Определения eModifiers.c:2
static const float ENVIRO_HEATCOMFORT_VEST_WEIGHT
Определения 3_Game/constants.c:743
const float ENVIRO_HEATCOMFORT_MAX_STEP_SIZE
when is sun highest on sky
Определения 3_Game/constants.c:739
static const float ENVIRO_HEATCOMFORT_HIPS_WEIGHT
Определения 3_Game/constants.c:749
const float ENVIRO_STOMACH_WEIGHT
Определения 3_Game/constants.c:753
static const float ENVIRO_HEATCOMFORT_LEGS_WEIGHT
Определения 3_Game/constants.c:747
static const float ENVIRO_HEATCOMFORT_GLOVES_WEIGHT
Определения 3_Game/constants.c:746
static const float ENVIRO_HEATCOMFORT_FEET_WEIGHT
Определения 3_Game/constants.c:748
const float ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT
Определения 3_Game/constants.c:804
const float ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT
damage per second dealt to attachment by fire
Определения 3_Game/constants.c:803
static const float ENVIRO_HEATCOMFORT_BODY_WEIGHT
Определения 3_Game/constants.c:744
static const float ENVIRO_HEATCOMFORT_BACK_WEIGHT
Определения 3_Game/constants.c:745
static const float ENVIRO_HEATCOMFORT_HEADGEAR_WEIGHT
max step of dynamic heatcomfort change (applies if diff between target and dynamic HC is bigger than ...
Определения 3_Game/constants.c:741
static const float ENVIRO_HEATCOMFORT_MASK_WEIGHT
how much this body part affects final heatcomfort
Определения 3_Game/constants.c:742
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.
Определения EnMath.c:740
static proto float AbsFloat(float f)
Returns absolute value.

Перекрестные ссылки Math::AbsFloat(), BodyPartHeatProperties(), Math::Clamp(), GameConstants::ENVIRO_HEATCOMFORT_BACK_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_BODY_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_FEET_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_GLOVES_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_HEADGEAR_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_HIPS_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_LEGS_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_MASK_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_MAX_STEP_SIZE, GameConstants::ENVIRO_HEATCOMFORT_VEST_WEIGHT, GameConstants::ENVIRO_STOMACH_WEIGHT, EnvTempToCoef(), GetPlayerHeat(), GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT, GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT, m_AverageHeatComfortBuffer, m_EnvironmentSnapshot, m_EnvironmentTemperature, m_HeatComfort, m_Player, NakedBodyPartHeatComfortPenalty(), ProcessHeatBuffer(), Math::Remap(), Math::Round() и SetTargetHeatComfort().

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