1203{
1205
1213
1223
1225
1227 {
1229 {
1231
1233 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1234
1238 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1239 }
1240 }
1241
1243 {
1245
1247 }
1248
1250 {
1251 super.EEDelete(parent);
1252
1254
1257 }
1258
1260 {
1261 super.EEItemLocationChanged(oldLoc, newLoc);
1262
1265 {
1266 switch (oldLoc.GetParent().GetType())
1267 {
1268 case "FryingPan":
1269 case "Pot":
1270 case "Cauldron":
1271 case "SharpWoodenStick":
1273 break;
1274 }
1275
1278 {
1280 }
1281 }
1282
1283 if (oldLoc.IsValid())
1285
1288 }
1289
1291 {
1294 }
1295
1297 {
1300
1301 return true;
1302 }
1303
1305 {
1307 {
1309 }
1310 }
1311
1314 {
1315 int foodStageType;
1316
1318 if (foodStage)
1319 foodStageType = foodStage.GetFoodStageType();
1320
1325
1326 return agentsIn;
1327 }
1328
1329
1331 {
1332 return false;
1333 }
1334
1336 {
1337 return false;
1338 }
1339
1341 {
1343 {
1345 {
1348
1351
1352 default:
1353 return super.GetTemperatureFreezeTime();
1354 }
1355 }
1356
1357 return super.GetTemperatureFreezeTime();
1358 }
1359
1361 {
1363 {
1365 {
1368
1371
1372 default:
1373 return super.GetTemperatureThawTime();
1374 }
1375 }
1376
1377 return super.GetTemperatureThawTime();
1378 }
1379
1381 {
1383 }
1384
1385
1386
1387
1389 {
1390 SetSynchDirty();
1391 }
1392
1394 {
1395 super.OnVariablesSynchronized();
1396
1397
1398
1399
1401 {
1403 }
1404 else
1405 {
1407 }
1408
1411 }
1412
1413
1414
1415
1417 {
1420
1422 }
1423
1425 {
1426 string soundName = "";
1427
1430
1432 {
1434 }
1435 else
1436 {
1438 {
1440 {
1445 else
1446 soundName = "";
1447 break;
1448 }
1449
1451 {
1456 else
1457 soundName = "";
1458 break;
1459 }
1460
1462 {
1467 else
1468 soundName = "";
1469 break;
1470 }
1471
1472 default:
1473 soundName = "";
1474 break;
1475 }
1476
1478 {
1479 if (soundName == "")
1480 {
1482 }
1483 else
1484 {
1486 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1487 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1489 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1490 {
1492 }
1493 }
1494 }
1495 }
1496
1498 }
1499
1501 {
1504 }
1505
1506
1507
1508
1510 {
1511 super.OnStoreSave(ctx);
1512
1514 {
1516 }
1517
1518
1521 }
1522
1524 {
1525 if (!super.OnStoreLoad(ctx, version))
1526 return false;
1527
1529 {
1531 return false;
1532 }
1533
1534 if (version >= 115)
1535 {
1537 {
1539 return false;
1540 }
1542 {
1544 return false;
1545 }
1546 }
1547
1550
1551 return true;
1552 }
1553
1555 {
1556 super.AfterStoreLoad();
1557
1559 }
1560
1561
1563 {
1565 }
1566
1567
1569 {
1570 return false;
1571 }
1572
1574 {
1575 return false;
1576 }
1577
1579 {
1580 return false;
1581 }
1582
1584 {
1585 return false;
1586 }
1587
1588
1589
1590
1591
1593 {
1596 {
1597 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1598 }
1599 else if (classname != "" && food_stage)
1600 {
1601 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1602 }
1603 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1605
1606 }
1607
1609 {
1612 {
1614 }
1615 else if (classname != "" && food_stage)
1616 {
1617 return FoodStage.GetEnergy(null, food_stage, classname);
1618 }
1619 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1621 }
1622
1624 {
1627 {
1629 }
1630 else if (classname != "" && food_stage)
1631 {
1632 return FoodStage.GetWater(null, food_stage, classname);
1633 }
1634 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1636 }
1637
1639 {
1642 {
1643 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1644 }
1645 else if (classname != "" && food_stage)
1646 {
1647 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1648 }
1649 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1651
1652 }
1653
1655 {
1658 {
1659 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1660 }
1661 else if (classname != "" && food_stage)
1662 {
1663 return FoodStage.GetToxicity(null, food_stage, classname);
1664 }
1665 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1667 }
1668
1670 {
1673 {
1675 }
1676 else if (classname != "" && food_stage)
1677 {
1678 return FoodStage.GetAgents(null, food_stage, classname);
1679 }
1680 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1682 }
1683
1685 {
1688 {
1689 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1690 }
1691 else if (classname != "" && food_stage)
1692 {
1693 return FoodStage.GetDigestibility(null, food_stage, classname);
1694 }
1695 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1697 }
1698
1700 {
1703 {
1704 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1705 }
1706 else if (className != "" && foodStage)
1707 {
1708 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1709 }
1710 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1712 }
1713
1715 {
1725
1726 return profile;
1727 }
1728
1729
1730
1731
1733 {
1735 }
1736
1737
1739 {
1741 {
1743 }
1744
1745 return false;
1746 }
1747
1749 {
1751 {
1753 }
1754
1755 return false;
1756 }
1757
1759 {
1761 {
1763 }
1764
1765 return false;
1766 }
1767
1769 {
1771 {
1773 }
1774
1775 return false;
1776 }
1777
1779 {
1781 {
1783 }
1784
1785 return false;
1786 }
1787
1789 {
1791 {
1793 }
1794
1795 return false;
1796 }
1797
1798
1800 {
1802 }
1803
1805 {
1806 return GetFoodStage().GetNextFoodStageType( cooking_method );
1807 }
1808
1810 {
1811 return GetFoodStage().GetFoodStageName( food_stage_type );
1812 }
1813
1815 {
1816 return GetFoodStage().CanChangeToNewStage( cooking_method );
1817 }
1818
1819
1821 {
1822 if ( !source.GetFoodStage())
1823 return;
1828 }
1829
1832 {
1835 }
1836
1839 {
1840 switch (stageNew)
1841 {
1846 break;
1847
1850 break;
1851 }
1852 }
1853
1854
1855
1856
1857
1859 {
1861 }
1862
1864 {
1866
1867
1869 }
1870
1872 {
1874 {
1877 }
1878 }
1879
1880
1882 {
1884 if (player)
1885 {
1887 player.ServerReplaceItemInHandsWithNew(lambda);
1888 }
1889 else
1890 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1891 }
1892
1894 {
1896 }
1897
1899 {
1900 super.SetActions();
1901
1904 }
1905
1907 {
1908 #ifndef SERVER
1910 {
1912
1915 }
1916 #endif
1917 }
1918
1920 {
1921 #ifndef SERVER
1923 {
1927 }
1928 #endif
1929 }
1930
1932 {
1933 return false;
1934 }
1935
1937 {
1939 }
1940
1941 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
1942 {
1944
1945 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
1947 if ( hasRootAsPlayer )
1949
1950
1951
1952
1953
1954
1955
1957 {
1958
1960 {
1962 {
1966 break;
1967
1971 break;
1972
1976 break;
1977
1981 default:
1984 return;
1985 }
1986
1987
1988 }
1989
1991
1993 {
1995 {
1996
1998 {
2000 }
2002 {
2005 {
2007 }
2008 else
2009 {
2011 {
2013 }
2014 else
2015 {
2017 }
2018 }
2019 }
2020 }
2021 }
2022
2023 }
2025 {
2026
2028 {
2030 {
2034 break;
2035
2039 break;
2040
2044 break;
2045
2049 break;
2050
2053 default:
2056 return;
2057 }
2058 }
2059
2061
2063 {
2065 {
2066
2068 {
2070 }
2071 }
2072 }
2073 }
2075 {
2076
2078 {
2080 {
2084 break;
2085
2088 default:
2091 return;
2092 }
2093 }
2094
2096
2098 {
2100 {
2101
2103 {
2105 }
2106 }
2107 }
2108 }
2109 else
2110 {
2111
2113
2115 {
2118
2119 }
2120 else
2121 {
2123 {
2126 }
2127 }
2128 }
2129 }
2130
2132 {
2133 if (
GetGame().IsDedicatedServer())
2134 return;
2135
2137 {
2139 GetInventory().GetCurrentInventoryLocation(invLoc);
2141 {
2143 if (ptcMgr)
2144 {
2149 }
2150 }
2151 }
2153 {
2155 {
2158 return;
2159 }
2160
2162 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2164 {
2167 }
2168 }
2169 }
2170
2171 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2172 {
2173 super.GetDebugActions(outputList);
2174
2176 {
2180 }
2181 }
2182
2184 {
2185 super.OnAction(action_id, player, ctx);
2186
2188 {
2189 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2190 {
2192 if (food_stage_prev <= 0)
2193 {
2195 }
2197 return true;
2198 }
2199 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2200 {
2203 {
2205 }
2207 return true;
2208 }
2209
2210 }
2211
2212 #ifdef DIAG_DEVELOPER
2213 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2214 {
2215 PrintNutritionsData();
2216 return true;
2217 }
2218 #endif
2219
2220 return false;
2221 }
2222
2224 {
2225 string debug_output;
2226
2227 debug_output = super.GetDebugText();
2228
2231
2232 return debug_output;
2233 }
2234
2235
2236
2237
2238
2240 {
2241 float ret = super.GetBaitEffectivity();
2242
2244 {
2245 ret *= 0.5;
2246 }
2247
2248 return ret;
2249 }
2250
2252 {
2254 }
2255
2257 {
2259 }
2260
2262 {
2264 }
2265
2266 #ifdef DIAG_DEVELOPER
2267 private void PrintNutritionsData()
2268 {
2269 string nutritionsData = "";
2270
2273
2275 if (profile)
2276 {
2277 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2279 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2283 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2285
2288
2289 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2291 }
2292
2293 nutritionsData += "-----\n";
2294
2296 }
2297 #endif
2298
2300
2303 {
2305 }
2306}
2307
2309{
2311};
Param4< int, int, string, int > TSelectableActionInfoWithColor
eBleedingSourceType GetType()
AttachActionData ActionData ActionAttach()
void AddAction(typename actionName)
DamageType
exposed from C++ (do not change)
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.