1324{
1326
1334
1344
1346
1348 {
1350 {
1352
1354 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1355
1359 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1360 }
1361 }
1362
1364 {
1366
1368 }
1369
1371 {
1372 super.EEDelete(parent);
1373
1375
1378 }
1379
1381 {
1382 super.EEItemLocationChanged(oldLoc, newLoc);
1383
1386 {
1387 switch (oldLoc.GetParent().GetType())
1388 {
1389 case "FryingPan":
1390 case "Pot":
1391 case "Cauldron":
1392 case "SharpWoodenStick":
1394 break;
1395 }
1396
1399 {
1401 }
1402 }
1403
1404 if (oldLoc.IsValid())
1406
1409 }
1410
1412 {
1415 }
1416
1418 {
1421
1422 return true;
1423 }
1424
1426 {
1428 {
1430 }
1431 }
1432
1435 {
1436 int foodStageType;
1437
1439 if (foodStage)
1440 foodStageType = foodStage.GetFoodStageType();
1441
1446
1447 return agentsIn;
1448 }
1449
1450
1452 {
1453 return false;
1454 }
1455
1457 {
1458 return false;
1459 }
1460
1462 {
1464 {
1466 {
1469
1472
1473 default:
1474 return super.GetTemperatureFreezeTime();
1475 }
1476 }
1477
1478 return super.GetTemperatureFreezeTime();
1479 }
1480
1482 {
1484 {
1486 {
1489
1492
1493 default:
1494 return super.GetTemperatureThawTime();
1495 }
1496 }
1497
1498 return super.GetTemperatureThawTime();
1499 }
1500
1502 {
1504 }
1505
1506
1507
1508
1510 {
1511 SetSynchDirty();
1512 }
1513
1515 {
1516 super.OnVariablesSynchronized();
1517
1518
1519
1520
1522 {
1524 }
1525 else
1526 {
1528 }
1529
1532 }
1533
1534
1535
1536
1538 {
1541
1543 }
1544
1546 {
1547 string soundName = "";
1548
1551
1553 {
1555 }
1556 else
1557 {
1559 {
1561 {
1566 else
1567 soundName = "";
1568 break;
1569 }
1570
1572 {
1577 else
1578 soundName = "";
1579 break;
1580 }
1581
1583 {
1588 else
1589 soundName = "";
1590 break;
1591 }
1592
1593 default:
1594 soundName = "";
1595 break;
1596 }
1597
1599 {
1600 if (soundName == "")
1601 {
1603 }
1604 else
1605 {
1607 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1608 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1610 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1611 {
1613 }
1614 }
1615 }
1616 }
1617
1619 }
1620
1622 {
1625 }
1626
1627
1628
1629
1631 {
1632 super.OnStoreSave(ctx);
1633
1635 {
1637 }
1638
1639
1642 }
1643
1645 {
1646 if (!super.OnStoreLoad(ctx, version))
1647 return false;
1648
1650 {
1652 return false;
1653 }
1654
1655 if (version >= 115)
1656 {
1658 {
1660 return false;
1661 }
1663 {
1665 return false;
1666 }
1667 }
1668
1671
1672 return true;
1673 }
1674
1676 {
1677 super.AfterStoreLoad();
1678
1680 }
1681
1682
1684 {
1686 }
1687
1688
1690 {
1691 return false;
1692 }
1693
1695 {
1696 return false;
1697 }
1698
1700 {
1701 return false;
1702 }
1703
1705 {
1706 return false;
1707 }
1708
1709
1710
1711
1712
1714 {
1717 {
1718 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1719 }
1720 else if (classname != "" && food_stage)
1721 {
1722 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1723 }
1724 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1726
1727 }
1728
1730 {
1733 {
1735 }
1736 else if (classname != "" && food_stage)
1737 {
1738 return FoodStage.GetEnergy(null, food_stage, classname);
1739 }
1740 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1742 }
1743
1745 {
1748 {
1750 }
1751 else if (classname != "" && food_stage)
1752 {
1753 return FoodStage.GetWater(null, food_stage, classname);
1754 }
1755 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1757 }
1758
1760 {
1763 {
1764 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1765 }
1766 else if (classname != "" && food_stage)
1767 {
1768 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1769 }
1770 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1772
1773 }
1774
1776 {
1779 {
1780 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1781 }
1782 else if (classname != "" && food_stage)
1783 {
1784 return FoodStage.GetToxicity(null, food_stage, classname);
1785 }
1786 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1788 }
1789
1791 {
1794 {
1796 }
1797 else if (classname != "" && food_stage)
1798 {
1799 return FoodStage.GetAgents(null, food_stage, classname);
1800 }
1801 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1803 }
1804
1806 {
1809 {
1810 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1811 }
1812 else if (classname != "" && food_stage)
1813 {
1814 return FoodStage.GetDigestibility(null, food_stage, classname);
1815 }
1816 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1818 }
1819
1821 {
1824 {
1825 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1826 }
1827 else if (className != "" && foodStage)
1828 {
1829 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1830 }
1831 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1833 }
1834
1836 {
1846
1847 return profile;
1848 }
1849
1850
1851
1852
1854 {
1856 }
1857
1858
1860 {
1862 {
1864 }
1865
1866 return false;
1867 }
1868
1870 {
1872 {
1874 }
1875
1876 return false;
1877 }
1878
1880 {
1882 {
1884 }
1885
1886 return false;
1887 }
1888
1890 {
1892 {
1894 }
1895
1896 return false;
1897 }
1898
1900 {
1902 {
1904 }
1905
1906 return false;
1907 }
1908
1910 {
1912 {
1914 }
1915
1916 return false;
1917 }
1918
1919
1921 {
1923 }
1924
1926 {
1927 return GetFoodStage().GetNextFoodStageType( cooking_method );
1928 }
1929
1931 {
1932 return GetFoodStage().GetFoodStageName( food_stage_type );
1933 }
1934
1936 {
1937 return GetFoodStage().CanChangeToNewStage( cooking_method );
1938 }
1939
1940
1942 {
1943 if ( !source.GetFoodStage())
1944 return;
1949 }
1950
1953 {
1956 }
1957
1960 {
1961 switch (stageNew)
1962 {
1967 break;
1968
1971 break;
1972 }
1973 }
1974
1975
1976
1977
1978
1980 {
1982 }
1983
1985 {
1987
1988
1990 }
1991
1993 {
1995 {
1998 }
1999 }
2000
2001
2003 {
2005 if (player)
2006 {
2008 player.ServerReplaceItemInHandsWithNew(lambda);
2009 }
2010 else
2011 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2012 }
2013
2015 {
2017 }
2018
2020 {
2021 super.SetActions();
2022
2025 }
2026
2028 {
2029 #ifndef SERVER
2031 {
2033
2036 }
2037 #endif
2038 }
2039
2041 {
2042 #ifndef SERVER
2044 {
2048 }
2049 #endif
2050 }
2051
2053 {
2054 return false;
2055 }
2056
2058 {
2060 }
2061
2062 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2063 {
2065
2066 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2068 if ( hasRootAsPlayer )
2070
2071
2072
2073
2074
2075
2076
2078 {
2079
2081 {
2083 {
2087 break;
2088
2092 break;
2093
2097 break;
2098
2102 default:
2105 return;
2106 }
2107
2108
2109 }
2110
2112
2114 {
2116 {
2117
2119 {
2121 }
2123 {
2126 {
2128 }
2129 else
2130 {
2132 {
2134 }
2135 else
2136 {
2138 }
2139 }
2140 }
2141 }
2142 }
2143
2144 }
2146 {
2147
2149 {
2151 {
2155 break;
2156
2160 break;
2161
2165 break;
2166
2170 break;
2171
2174 default:
2177 return;
2178 }
2179 }
2180
2182
2184 {
2186 {
2187
2189 {
2191 }
2192 }
2193 }
2194 }
2196 {
2197
2199 {
2201 {
2205 break;
2206
2209 default:
2212 return;
2213 }
2214 }
2215
2217
2219 {
2221 {
2222
2224 {
2226 }
2227 }
2228 }
2229 }
2230 else
2231 {
2232
2234
2236 {
2239
2240 }
2241 else
2242 {
2244 {
2247 }
2248 }
2249 }
2250 }
2251
2253 {
2254 if (
GetGame().IsDedicatedServer())
2255 return;
2256
2258 {
2260 GetInventory().GetCurrentInventoryLocation(invLoc);
2262 {
2264 if (ptcMgr)
2265 {
2270 }
2271 }
2272 }
2274 {
2276 {
2279 return;
2280 }
2281
2283 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2285 {
2288 }
2289 }
2290 }
2291
2292 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2293 {
2295 {
2300 }
2301
2302 super.GetDebugActions(outputList);
2303 }
2304
2306 {
2307 super.OnAction(action_id, player, ctx);
2308
2310 {
2311 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2312 {
2314 if (food_stage_prev <= 0)
2315 {
2317 }
2319 return true;
2320 }
2321 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2322 {
2325 {
2327 }
2329 return true;
2330 }
2331
2332 }
2333
2334 #ifdef DIAG_DEVELOPER
2335 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2336 {
2337 PrintNutritionsData();
2338 return true;
2339 }
2340 #endif
2341
2342 return false;
2343 }
2344
2346 {
2347 string debug_output;
2348
2349 debug_output = super.GetDebugText();
2350
2353
2354 return debug_output;
2355 }
2356
2357
2358
2359
2360
2362 {
2363 float ret = super.GetBaitEffectivity();
2364
2366 {
2367 ret *= 0.5;
2368 }
2369
2370 return ret;
2371 }
2372
2374 {
2376 }
2377
2379 {
2381 }
2382
2384 {
2386 }
2387
2388 #ifdef DIAG_DEVELOPER
2389 private void PrintNutritionsData()
2390 {
2391 string nutritionsData = "";
2392
2395
2397 if (profile)
2398 {
2399 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2401 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2405 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2407
2410
2411 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2413 }
2414
2415 nutritionsData += "-----\n";
2416
2418 }
2419 #endif
2420
2422
2425 {
2427 }
2428}
2429
2431{
2433};
Param4< int, int, string, int > TSelectableActionInfoWithColor
eBleedingSourceType GetType()
AttachActionData ActionData ActionAttach()
void AddAction(typename actionName)
DamageType
exposed from C++ (do not change)
AbstractWave m_SoundPlaying
EConsumptionPenaltyContext
void ReplaceEdibleWithNew(string typeName)
ref FoodStage m_FoodStage
static float GetFoodWater(ItemBase item, string classname="", int food_stage=0)
override bool CanBeCooked()
override string GetDebugText()
override void AfterStoreLoad()
void OnFoodStageChange(FoodStageType stageOld, FoodStageType stageNew)
called on server
override void OnVariablesSynchronized()
const string SOUND_BURNING_DONE
bool CanChangeToNewStage(CookingMethodType cooking_method)
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override bool CanItemOverheat()
override float GetBaitEffectivity()
override FoodStage GetFoodStage()
override void SetActions()
override float GetTemperatureFreezeTime()
const string DIRECT_COOKING_SLOT_NAME
FoodStageType GetNextFoodStageType(CookingMethodType cooking_method)
void ChangeFoodStage(FoodStageType new_food_stage_type)
void OnConsume(float amount, PlayerBase consumer)
static float GetFoodNutritionalIndex(ItemBase item, string classname="", int food_stage=0)
SoundOnVehicle m_SoundCooking
static float GetFoodToxicity(ItemBase item, string classname="", int food_stage=0)
void UpdateVisualsEx(bool forced=false)
const string SOUND_BAKING_DONE
static NutritionalProfile GetNutritionalProfile(ItemBase item, string classname="", int food_stage=0)
int FilterAgents(int agentsIn)
Filter agents from the item (override on higher implementations)
override void EEDelete(EntityAI parent)
FoodStageType m_LastDecayStage
override bool CanBeCookedOnStick()
FoodStageType GetLastDecayStage()
string GetFoodStageName(FoodStageType food_stage_type)
override float GetTemperatureThawTime()
void UpdateVaporParticle()
static float GetFoodDigestibility(ItemBase item, string classname="", int food_stage=0)
void TransferFoodStage(notnull Edible_Base source)
override void ProcessDecay(float delta, bool hasRootAsPlayer)
const string SOUND_DRYING_START
void SetCookingTime(float time)
void SoundCookingStart(string sound_name)
const string SOUND_BAKING_START
static float GetFoodTotalVolume(ItemBase item, string classname="", int food_stage=0)
const string SOUND_DRYING_DONE
void HandleFoodStageChangeAgents(FoodStageType stageOld, FoodStageType stageNew)
removes select agents on foodstage transitions
Edible_Base ItemBase ReplaceEdibleWithNewLambda(EntityAI old_item, string new_item_type, PlayerBase player)
bool Consume(float amount, PlayerBase consumer)
EffectSound m_SoundEffectCooking
DEPRECATED.
override bool OnStoreLoad(ParamsReadContext ctx, int version)
FoodStageType GetFoodStageType()
override bool CanProcessDecay()
ParticleSource m_HotVaporParticle
void MakeSoundsOnClient(bool soundstate, CookingMethodType cookingMethod=CookingMethodType.NONE)
static int GetFoodAgents(ItemBase item, string classname="", int food_stage=0)
override bool IsMushroom()
static float GetFoodEnergy(ItemBase item, string classname="", int food_stage=0)
static float GetAgentsPerDigest(ItemBase item, string className="", int foodStage=0)
const string SOUND_BOILING_DONE
int GetConsumptionPenaltyContext()
const string SOUND_BOILING_START
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
CookingMethodType m_CookedByMethod
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void OnStoreSave(ParamsWriteContext ctx)
override bool CanHaveTemperature()
InventoryLocationType
types of Inventory Location
override void InsertAgent(int agent, float count=1)
override void RemoveAllAgentsExcept(int agent_to_keep)
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
ParticleAutoDestroyFlags
Flags to pass to ParticleSource.SetParticleAutoDestroyFlags.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto native int ConfigGetInt(string path)
Get int value from config on path.
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
override FoodStage GetFoodStage()
Wrapper class for managing sound through SEffectManager.
proto native int GetType()
returns type of InventoryLocation
static proto native owned string GetSlotName(int id)
converts slot_id to string
provides access to slot configuration
static const int ITEM_HOT_VAPOR
Entity which has the particle instance as an ObjectComponent.
static const float CONSUMPTION_DAMAGE_PER_BITE
static const float CONSUMPTION_DAMAGE_TEMP_THRESHOLD
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
Manager class for managing Effect (EffectParticle, EffectSound)
proto bool Write(void value_out)
proto bool Read(void value_in)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Serializer ParamsReadContext
proto native CGame GetGame()
Serializer ParamsWriteContext
void Error(string err)
Messagebox with error message.
const float DECAY_FOOD_BAKED_FRVG
const float DECAY_FOOD_CAN_OPEN
const float DECAY_FOOD_RAW_FRVG
const int DECAY_TIMER_RANDOM_PERCENTAGE
const int DECAY_FOOD_FRVG_DRIED_CHANCE
const float DECAY_FOOD_RAW_MEAT
const float DECAY_FOOD_BAKED_MEAT
const float DECAY_FOOD_BOILED_MEAT
const float DECAY_FOOD_BOILED_FRVG
const float DECAY_FOOD_DRIED_MEAT
const float DECAY_FOOD_RAW_CORPSE
const float DECAY_RATE_ON_PLAYER
static const float TEMPERATURE_THAW_TIME_COEF_BURNED
static const float TEMPERATURE_FREEZE_TIME_COEF_BURNED
static const float TEMPERATURE_THAW_TIME_COEF_DRIED
static const float TEMPERATURE_FREEZE_TIME_COEF_DRIED
const int STATE_HOT_LVL_TWO
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
bool Contains(string sample)
Returns true if sample is substring of string.
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.