1792 {
1793 pHeatComfort = 0;
1794 pHeat = 0;
1795
1796 if (pBodyPartIds.Count() > 0)
1797 {
1798 #ifdef ENABLE_LOGGING
1800 #endif
1801
1802 int attCount =
m_Player.GetInventory().AttachmentCount();
1803 for (int attIdx = 0; attIdx < attCount; ++attIdx)
1804 {
1805 EntityAI attachment =
m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
1806 if (attachment.IsClothing())
1807 {
1809 int attachmentSlot = attachment.GetInventory().GetSlotId(0);
1810
1812 for (int i = 0; i < pBodyPartIds.Count(); ++i)
1813 {
1814 if (attachmentSlot == pBodyPartIds[i])
1815 {
1816 float heatIsoMult = 1.0;
1821
1822 pHeatComfort += heatIsoMult * MiscGameplayFunctions.GetCurrentItemHeatIsolation(item);
1823
1824 float itemHeatcomfort = 0;
1825 float itemTemperature = 0;
1826
1827
1828 int inventoryAttCount = item.GetInventory().AttachmentCount();
1829 if (inventoryAttCount > 0)
1830 {
1831 #ifdef ENABLE_LOGGING
1832 LogItemHeat(string.Format("attachments:"), false);
1833 #endif
1834 for (int inAttIdx = 0; inAttIdx < inventoryAttCount; ++inAttIdx)
1835 {
1836 EntityAI inAttachment = item.GetInventory().GetAttachmentFromIndex(inAttIdx);
1838 if (attachmentItem && attachmentItem.CanHaveTemperature())
1839 {
1840 itemTemperature = attachmentItem.GetTemperature();
1842 {
1843 itemHeatcomfort =
NormalizedTemperature(itemTemperature) * attachmentItem.GetQuantityNormalizedScripted() * attachmentItem.GetTemperaturePerQuantityWeight();
1844 #ifdef ENABLE_LOGGING
1845 LogItemHeat(string.Format("%1: temperature=%2 heat=%3", attachmentItem, itemTemperature, pHeat), true);
1846 pHeat += itemHeatcomfort;
1847 #endif
1848 }
1849 }
1850 }
1851 }
1852 if (item.GetInventory().GetCargo())
1853 {
1854 int inventoryItemCount = item.GetInventory().GetCargo().GetItemCount();
1855
1856 if (inventoryItemCount > 0)
1857 {
1858 #ifdef ENABLE_LOGGING
1859 LogItemHeat(string.Format("cargo:"), false);
1860 #endif
1861 for (int j = 0; j < inventoryItemCount; ++j)
1862 {
1863 ItemBase inventoryItem =
ItemBase.Cast(item.GetInventory().GetCargo().GetItem(j));
1864 if (inventoryItem && inventoryItem.CanHaveTemperature())
1865 {
1866 itemTemperature = inventoryItem.GetTemperature();
1868 {
1869 itemHeatcomfort =
NormalizedTemperature(itemTemperature) * inventoryItem.GetQuantityNormalizedScripted() * inventoryItem.GetTemperaturePerQuantityWeight();
1870 #ifdef ENABLE_LOGGING
1871 LogItemHeat(string.Format("%1: temperature=%2 heat=%3", inventoryItem, itemTemperature, itemHeatcomfort), true);
1872 #endif
1873 pHeat += itemHeatcomfort;
1874 }
1875 }
1876 }
1877 }
1878 }
1879 }
1880 }
1881 }
1882 }
1883
1884 pHeatComfort += (pHeatComfort / pBodyPartIds.Count()) * pCoef;
1885
1886 #ifdef ENABLE_LOGGING
1887 LogItemHeat(string.Format("overall heat from items=%1 (coef applied)", pHeat));
1888 LogItemHeat("");
1889 #endif
1890 }
1891 }
float NormalizedTemperature(float temperature, float lowerLimit=GameConstants.ENVIRO_LOW_TEMP_LIMIT, float upperLimit=GameConstants.ENVIRO_HIGH_TEMP_LIMIT)
provides access to slot configuration
const float ENVIRO_HEATISOLATION_VEST_WEIGHT
weight of back for the sum of heat isolation
const float ENVIRO_HEATISOLATION_BACK_WEIGHT
how much this feet parts (clothing) affects final heatcomfort
const float ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT