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

◆ Heating()

void Heating ( )
protected

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

1826 {
1827 float temperature;
1828 float temperatureModifier = 0;
1829
1830 if (IsOpen() && !IsOven())
1832
1833 //check burning conditions
1835 {
1836 StopFire(FireplaceFireState.EXTINGUISHED_FIRE);
1837 return;
1838 }
1839 else
1840 {
1841 if (m_FireConsumables.Count() == 0)
1842 {
1843 StopFire();
1844 return;
1845 }
1846 }
1847
1848 //spend actual fire consumable
1850 SpendFireConsumable(amount);
1851
1852 //set wetness and alter temperature modifier (which will lower temperature increase because of soaking)
1853 float rain = g_Game.GetWeather().GetRain().GetActual();
1854 float combinedWindAndSnowfall = MiscGameplayFunctions.GetCombinedSnowfallWindValue();
1855
1856 if ((rain >= RAIN_EFFECT_LIMIT || combinedWindAndSnowfall >= SNOWFALL_EFFECT_LIMIT) && !IsRoofAbove() && IsOpen() && !IsOven())
1857 {
1858 if (rain > combinedWindAndSnowfall)
1859 {
1861 temperatureModifier = PARAM_TEMPERATURE_DECREASE * rain;
1862 }
1863 else
1864 {
1865 AddWetnessToFireplace(SNOWFALL_WETNESS_INCREASE * combinedWindAndSnowfall);
1866 temperatureModifier = PARAM_TEMPERATURE_DECREASE * combinedWindAndSnowfall;
1867 }
1868 }
1869 //subtract wetness when heating and not raining above
1870 else
1871 {
1873 }
1874
1875 if (m_SurfaceUnderWetnessModifier > 0.0)
1876 AddWetnessToFireplace(m_SurfaceUnderWetnessModifier * WET_SURFACE_INCREMENT);
1877
1878 // FLAT temperature increase
1879 temperature = GetTemperature() + (PARAM_TEMPERATURE_INCREASE * TIMER_HEATING_UPDATE_INTERVAL) - temperatureModifier;
1880 temperature = Math.Clamp(temperature, g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(this), m_UTSLFireplace.m_NormalFireplaceTemperatureMax);
1881 SetTemperatureDirect(temperature); //direct heating (non-systematic approach), freezing, overheating, and other stuff inside 'SetTemperatureEx' are therefore UNHANDLED here!
1882 m_UTSLFireplace.SetFuelCount(GetFuelCount()); //legacy reasons
1883 m_UTSLFireplace.SetCurrentTemperature(temperature); //legacy reasons
1885
1886 //get newly changed temperature
1887 temperature = GetTemperature();
1888
1889 //check fire state
1890 if (GetFireState() != FireplaceFireState.EXTINGUISHING_FIRE)
1891 {
1893 }
1894
1895 //damage cargo items
1897
1898 //manage cooking equipment (this applies only for case of cooking pot on a tripod)
1900 {
1902 }
1903
1904 float cookingItemTemperature;
1905 int i;
1906 // manage cooking on direct cooking slots
1908 {
1909 for (i = 0; i < DIRECT_COOKING_SLOT_COUNT; i++)
1910 {
1911 if (m_DirectCookingSlots[i])
1912 {
1913 cookingItemTemperature = m_DirectCookingSlots[i].GetTemperature();
1914 CookOnDirectSlot(m_DirectCookingSlots[i], cookingItemTemperature, temperature);
1915 }
1916 }
1917 }
1918
1919 // manage smoking slots
1920 if (SmokingSlotsInUse())
1921 {
1922 for (i = 0; i < SMOKING_SLOT_COUNT; i++)
1923 {
1924 if (m_SmokingSlots[i])
1925 {
1926 SmokeOnSmokingSlot(m_SmokingSlots[i], cookingItemTemperature, temperature);
1927 }
1928 }
1929 }
1930
1931 //Make noise for AI, only at night
1932 if (g_Game.GetWorld().IsNight() && m_CanNoise)
1933 {
1934 NoiseSystem noise = g_Game.GetNoiseSystem();
1935 if (noise && m_NoisePar)
1936 {
1937 noise.AddNoisePos(this, GetPosition(), m_NoisePar);
1938 }
1939 m_CanNoise = false;
1940 }
1941 else
1942 m_CanNoise = true;
1943
1944 Synchronize();
1945 }
ref NoiseParams m_NoisePar
Определения ActionOpenDoors.c:104
DayZGame g_Game
Определения DayZGame.c:4074
float GetFuelBurnRateMP()
Определения FireplaceBase.c:1720
override bool IsOpen()
Определения FireplaceBase.c:2421
ref UniversalTemperatureSourceSettings m_UTSSettings
Определения FireplaceBase.c:222
bool SmokingSlotsInUse()
Определения FireplaceBase.c:639
const float WET_SURFACE_INCREMENT
Определения FireplaceBase.c:226
bool DirectCookingSlotsInUse()
Определения FireplaceBase.c:627
const int DIRECT_COOKING_SLOT_COUNT
direct cooking slots
Определения FireplaceBase.c:77
const int TIMER_HEATING_UPDATE_INTERVAL
timer constants
Определения FireplaceBase.c:74
const float PARAM_TEMPERATURE_DECREASE
how much will temperature increase when fireplace is burning (degree Celsius per second)
Определения FireplaceBase.c:46
const float PARAM_TEMPERATURE_INCREASE
minimum fireplace temperature under which the fireplace is inactive (degree Celsius)
Определения FireplaceBase.c:45
const float PARAM_FIRE_CONSUM_RATE_AMOUNT
value for calculating wetness loss during cooling process
Определения FireplaceBase.c:53
bool m_CanNoise
Определения FireplaceBase.c:218
bool HasCookingStand()
Определения FireplaceBase.c:2501
void StopFire(FireplaceFireState fire_state=FireplaceFireState.END_FIRE)
Определения FireplaceBase.c:1951
void BurnItemsInFireplace()
Определения FireplaceBase.c:2192
void CookOnDirectSlot(ItemBase slot_item, float temp_equip, float temp_ext)
Определения FireplaceBase.c:2169
void CookWithEquipment()
Определения FireplaceBase.c:2153
void SpendFireConsumable(float amount)
Определения FireplaceBase.c:1488
const float SNOWFALL_EFFECT_LIMIT
rain level that triggers fireplace to start soaking
Определения FireplaceBase.c:88
void RefreshFireState()
Определения FireplaceBase.c:1072
const int SMOKING_SLOT_COUNT
Определения FireplaceBase.c:78
void SmokeOnSmokingSlot(ItemBase slot_item, float temp_equip, float temp_ext)
Определения FireplaceBase.c:2177
const float SNOWFALL_WETNESS_INCREASE
value for calculating of wetness that fireplace gain when raining
Определения FireplaceBase.c:90
ItemBase m_DirectCookingSlots[DIRECT_COOKING_SLOT_COUNT]
Определения FireplaceBase.c:102
void Synchronize()
Определения FireplaceBase.c:502
int GetFireState()
Определения FireplaceBase.c:1731
const float PARAM_BURN_WET_THRESHOLD
maximum rain value when the fireplace can be ignited
Определения FireplaceBase.c:50
ref UniversalTemperatureSourceLambdaFireplace m_UTSLFireplace
Определения FireplaceBase.c:223
ref UniversalTemperatureSource m_UTSource
Определения FireplaceBase.c:221
ref map< ItemBase, ref FireConsumable > m_FireConsumables
Определения FireplaceBase.c:144
FireplaceFireState
Определения FireplaceBase.c:2
bool IsOven()
Определения FireplaceBase.c:1669
ItemBase m_CookingEquipment
Определения FireplaceBase.c:101
ItemBase m_SmokingSlots[SMOKING_SLOT_COUNT]
Определения FireplaceBase.c:103
int GetFuelCount()
Returns count of all fuel type items (define in 'm_FuelTypes') attached to fireplace.
Определения FireplaceBase.c:1557
const float PARAM_WET_HEATING_DECREASE_COEF
maximum wetness value when the fireplace is able to burn
Определения FireplaceBase.c:51
const float RAIN_WETNESS_INCREASE
snowfall level that triggers fireplace to start soaking
Определения FireplaceBase.c:89
const float RAIN_EFFECT_LIMIT
Определения FireplaceBase.c:87
void AddWetnessToFireplace(float amount)
Определения FireplaceBase.c:2323
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
Определения ItemBase.c:4060
override float GetWet()
Определения ItemBase.c:3717
Определения EnMath.c:7
proto void AddNoisePos(EntityAI source_entity, vector pos, NoiseParams noise_params, float external_strenght_multiplier=1.0)
Определения Noise.c:2
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'.
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473

Перекрестные ссылки NoiseSystem::AddNoisePos(), AddWetnessToFireplace(), BurnItemsInFireplace(), CheckForRoofLimited(), Math::Clamp(), CookOnDirectSlot(), CookWithEquipment(), DIRECT_COOKING_SLOT_COUNT, DirectCookingSlotsInUse(), g_Game, GetFireState(), GetFuelBurnRateMP(), GetFuelCount(), GetPosition(), GetWet(), HasCookingStand(), FireplaceBase::IsOpen(), IsOven(), m_CanNoise, m_CookingEquipment, m_DirectCookingSlots, m_FireConsumables, m_NoisePar, m_SmokingSlots, m_UTSLFireplace, m_UTSource, m_UTSSettings, PARAM_BURN_WET_THRESHOLD, PARAM_FIRE_CONSUM_RATE_AMOUNT, PARAM_TEMPERATURE_DECREASE, PARAM_TEMPERATURE_INCREASE, PARAM_WET_HEATING_DECREASE_COEF, RAIN_EFFECT_LIMIT, RAIN_WETNESS_INCREASE, RefreshFireState(), SmokeOnSmokingSlot(), SMOKING_SLOT_COUNT, SmokingSlotsInUse(), SNOWFALL_EFFECT_LIMIT, SNOWFALL_WETNESS_INCREASE, SpendFireConsumable(), StopFire(), Synchronize(), TIMER_HEATING_UPDATE_INTERVAL и WET_SURFACE_INCREMENT.