Calculates and process player's heatcomfort related to body parts.
838 {
839 float hcPenaltyTotal
840
841
842 float hcBodyPartTotal, hcBodyPart;
843 float hBodyPartTotal, hBodyPart;
844
845 float heatComfortSum = 0.0;
846 float heatItems = 0.0;
847
849 BodyPartHeatProperties(InventorySlots.HEADGEAR, GameConstants.ENVIRO_HEATCOMFORT_HEADGEAR_WEIGHT, hcBodyPart, hBodyPart);
850 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
851 BodyPartHeatProperties(InventorySlots.MASK, GameConstants.ENVIRO_HEATCOMFORT_MASK_WEIGHT, hcBodyPart, hBodyPart);
852 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
853 BodyPartHeatProperties(InventorySlots.VEST, GameConstants.ENVIRO_HEATCOMFORT_VEST_WEIGHT, hcBodyPart, hBodyPart);
854 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
855 BodyPartHeatProperties(InventorySlots.BODY, GameConstants.ENVIRO_HEATCOMFORT_BODY_WEIGHT, hcBodyPart, hBodyPart);
856 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
857 BodyPartHeatProperties(InventorySlots.BACK, GameConstants.ENVIRO_HEATCOMFORT_BACK_WEIGHT, hcBodyPart, hBodyPart);
858 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
859 BodyPartHeatProperties(InventorySlots.GLOVES, GameConstants.ENVIRO_HEATCOMFORT_GLOVES_WEIGHT, hcBodyPart, hBodyPart);
860 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
861 BodyPartHeatProperties(InventorySlots.LEGS, GameConstants.ENVIRO_HEATCOMFORT_LEGS_WEIGHT, hcBodyPart, hBodyPart);
862 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
863 BodyPartHeatProperties(InventorySlots.FEET, GameConstants.ENVIRO_HEATCOMFORT_FEET_WEIGHT, hcBodyPart, hBodyPart);
864 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
865 BodyPartHeatProperties(InventorySlots.HIPS, GameConstants.ENVIRO_HEATCOMFORT_HIPS_WEIGHT, hcBodyPart, hBodyPart);
866 hcBodyPartTotal += hcBodyPart; hBodyPartTotal += hBodyPart;
867
874
875 heatItems = hBodyPartTotal;
876 heatComfortSum = hcBodyPartTotal;
877 heatComfortSum += hcPenaltyTotal;
878
880 {
881 if (
m_Player.GetStomach().GetStomachVolume() > 0.0)
882 {
883 float stomachContentTemperature =
m_Player.GetStomach().GetStomachTemperature();
884 if (stomachContentTemperature < GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT)
885 {
886 stomachContentTemperature = Math.Remap(
887 -10.0,
888 GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT,
889 -GameConstants.ENVIRO_STOMACH_WEIGHT,
890 0.0,
891 stomachContentTemperature,
892 );
893 }
894 else if (stomachContentTemperature > GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT)
895 {
896 stomachContentTemperature = Math.Remap(
897 GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT,
898 70.0,
899 0.0,
900 GameConstants.ENVIRO_STOMACH_WEIGHT,
901 stomachContentTemperature,
902 );
903 }
904 else
905 stomachContentTemperature = 0.0;
906
907 heatComfortSum += stomachContentTemperature * GameConstants.ENVIRO_STOMACH_WEIGHT;
908 }
909 }
910
912
917
919 targetHeatComfort = Math.Clamp(targetHeatComfort, 0.0,
m_Player.GetStatHeatComfort().GetMax());
920 else
921 targetHeatComfort = Math.Clamp(targetHeatComfort,
m_Player.GetStatHeatComfort().GetMin(),
m_Player.GetStatHeatComfort().GetMax());
922
923 targetHeatComfort = Math.Round(targetHeatComfort * 100) * 0.01;
924
925 float dynamicHeatComfort;
926
927 {
928 float direction = 1.0;
929 if (targetHeatComfort < 0.0)
930 direction = -1.0;
931
932 if (Math.AbsFloat(targetHeatComfort -
m_HeatComfort) <= GameConstants.ENVIRO_HEATCOMFORT_MAX_STEP_SIZE)
934 else
935 dynamicHeatComfort =
m_AverageHeatComfortBuffer.Add((Math.AbsFloat(targetHeatComfort) - GameConstants.ENVIRO_HEATCOMFORT_MAX_STEP_SIZE) * direction);
936 }
937
938 dynamicHeatComfort = Math.Round(dynamicHeatComfort * 100) * 0.01;
939
941
944 }
float GetPlayerHeat()
Returns heat player generated based on player's movement speed (for now)
float NakedBodyPartHeatComfortPenalty(int pBodyPartSlotId, float pCoef)
void LogItemHeat(string message, bool indented=false)
float m_EnvironmentTemperature
float EnvTempToCoef(float pTemp)
ref SimpleMovingAverage< float > m_AverageHeatComfortBuffer
ref EnvironmentSnapshotData m_EnvironmentSnapshot
void BodyPartHeatProperties(int pBodyPartId, float pCoef, out float pHeatComfort, out float pHeat)
returns enhanced heat comfort for given body part
void SetTargetHeatComfort(float value)
void ProcessHeatBuffer(EnvironmentSnapshotData data)