1196 {
1197 pHeatComfort = 0;
1198 pHeat = 0;
1199
1200 int attCount =
m_Player.GetInventory().AttachmentCount();
1201 for (int attIdx = 0; attIdx < attCount; ++attIdx)
1202 {
1203 EntityAI attachment =
m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
1204 if (attachment.IsClothing())
1205 {
1207 int attachmentSlot = attachment.GetInventory().GetSlotId(0);
1208
1209 if (attachmentSlot == pBodyPartId)
1210 {
1211 LogItemHeat(
string.Format(
"BodyPartHeatProperties (%1)", EnumTools.EnumToString(InventorySlots, pBodyPartId)));
1212
1213 float itemHeatcomfort = 0;
1214 float itemTemperature = 0;
1215
1216
1217 int inventoryAttCount = item.GetInventory().AttachmentCount();
1218 if (inventoryAttCount > 0)
1219 {
1220 LogItemHeat(
string.Format(
"attachments:"),
false);
1221 for (int inAttIdx = 0; inAttIdx < inventoryAttCount; ++inAttIdx)
1222 {
1223 EntityAI inAttachment = item.GetInventory().GetAttachmentFromIndex(inAttIdx);
1225 if (attachmentItem && attachmentItem.CanHaveTemperature())
1226 {
1227 itemTemperature = attachmentItem.GetTemperature();
1228 if (itemTemperature < GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT || itemTemperature > GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT)
1229 {
1230 itemHeatcomfort =
NormalizedTemperature(itemTemperature) * attachmentItem.GetQuantityNormalizedScripted() * attachmentItem.GetTemperaturePerQuantityWeight();
1231 LogItemHeat(
string.Format(
"%1: temperature=%2 heat=%3", attachmentItem, itemTemperature, pHeat),
true);
1232 pHeat += itemHeatcomfort;
1233 }
1234 }
1235 }
1236 }
1237 if (item.GetInventory().GetCargo())
1238 {
1239 int inventoryItemCount = item.GetInventory().GetCargo().GetItemCount();
1240
1241 if (inventoryItemCount > 0)
1242 {
1244 for (int j = 0; j < inventoryItemCount; ++j)
1245 {
1246 ItemBase inventoryItem =
ItemBase.Cast(item.GetInventory().GetCargo().GetItem(j));
1247 if (inventoryItem && inventoryItem.CanHaveTemperature())
1248 {
1249 itemTemperature = inventoryItem.GetTemperature();
1250 if (itemTemperature < GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT || itemTemperature > GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT)
1251 {
1252 itemHeatcomfort =
NormalizedTemperature(itemTemperature) * inventoryItem.GetQuantityNormalizedScripted() * inventoryItem.GetTemperaturePerQuantityWeight();
1253 LogItemHeat(
string.Format(
"%1: temperature=%2 heat=%3", inventoryItem, itemTemperature, itemHeatcomfort),
true);
1254 pHeat += itemHeatcomfort;
1255 }
1256 }
1257 }
1258 }
1259 }
1260
1261 pHeatComfort = MiscGameplayFunctions.GetCurrentItemHeatIsolation(item) * pCoef;
1262
1263 LogItemHeat(
string.Format(
"overall heat from items=%1 (coef applied)", pHeat));
1265
1266 break;
1267 }
1268 }
1269 }
1270 }
class GP5GasMask extends MaskBase ItemBase
float NormalizedTemperature(float temperature, float lowerLimit=GameConstants.ENVIRO_LOW_TEMP_LIMIT, float upperLimit=GameConstants.ENVIRO_HIGH_TEMP_LIMIT)
void LogItemHeat(string message, bool indented=false)