1157{
1159
1167
1177
1179
1181 {
1183 {
1185
1187 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1188
1192 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1193 }
1194 }
1195
1197 {
1199
1201 }
1202
1204 {
1205 super.EEDelete(parent);
1206
1208
1211 }
1212
1214 {
1215 super.EEItemLocationChanged(oldLoc, newLoc);
1216
1219 {
1220 switch (oldLoc.GetParent().GetType())
1221 {
1222 case "FryingPan":
1223 case "Pot":
1224 case "Cauldron":
1225 case "SharpWoodenStick":
1227 break;
1228 }
1229
1232 {
1234 }
1235 }
1236
1237 if (oldLoc.IsValid())
1239
1242 }
1243
1245 {
1248 }
1249
1251 {
1254
1255 return true;
1256 }
1257
1259 {
1261 {
1263 }
1264 }
1265
1268 {
1269 int foodStageType;
1270
1272 if (foodStage)
1273 foodStageType = foodStage.GetFoodStageType();
1274
1279
1280 return agentsIn;
1281 }
1282
1283
1285 {
1286 return false;
1287 }
1288
1290 {
1291 return false;
1292 }
1293
1295 {
1297 {
1299 {
1302
1305
1306 default:
1307 return super.GetTemperatureFreezeTime();
1308 }
1309 }
1310
1311 return super.GetTemperatureFreezeTime();
1312 }
1313
1315 {
1317 {
1319 {
1322
1325
1326 default:
1327 return super.GetTemperatureThawTime();
1328 }
1329 }
1330
1331 return super.GetTemperatureThawTime();
1332 }
1333
1335 {
1337 }
1338
1339
1340
1341
1343 {
1344 SetSynchDirty();
1345 }
1346
1348 {
1349 super.OnVariablesSynchronized();
1350
1351
1352
1353
1355 {
1357 }
1358 else
1359 {
1361 }
1362
1365 }
1366
1367
1368
1369
1371 {
1374
1376 }
1377
1379 {
1380 string soundName = "";
1381
1384
1386 {
1388 }
1389 else
1390 {
1392 {
1394 {
1399 else
1400 soundName = "";
1401 break;
1402 }
1403
1405 {
1410 else
1411 soundName = "";
1412 break;
1413 }
1414
1416 {
1421 else
1422 soundName = "";
1423 break;
1424 }
1425
1426 default:
1427 soundName = "";
1428 break;
1429 }
1430
1432 {
1433 if (soundName == "")
1434 {
1436 }
1437 else
1438 {
1440 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1441 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1443 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1444 {
1446 }
1447 }
1448 }
1449 }
1450
1452 }
1453
1455 {
1458 }
1459
1460
1461
1462
1464 {
1465 super.OnStoreSave(ctx);
1466
1468 {
1470 }
1471
1472
1475 }
1476
1478 {
1479 if (!super.OnStoreLoad(ctx, version))
1480 return false;
1481
1483 {
1485 return false;
1486 }
1487
1488 if (version >= 115)
1489 {
1491 {
1493 return false;
1494 }
1496 {
1498 return false;
1499 }
1500 }
1501
1504
1505 return true;
1506 }
1507
1509 {
1510 super.AfterStoreLoad();
1511
1513 }
1514
1515
1517 {
1519 }
1520
1521
1523 {
1524 return false;
1525 }
1526
1528 {
1529 return false;
1530 }
1531
1533 {
1534 return false;
1535 }
1536
1538 {
1539 return false;
1540 }
1541
1542
1543
1544
1545
1547 {
1550 {
1551 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1552 }
1553 else if (classname != "" && food_stage)
1554 {
1555 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1556 }
1557 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1559
1560 }
1561
1563 {
1566 {
1568 }
1569 else if (classname != "" && food_stage)
1570 {
1571 return FoodStage.GetEnergy(null, food_stage, classname);
1572 }
1573 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1575 }
1576
1578 {
1581 {
1583 }
1584 else if (classname != "" && food_stage)
1585 {
1586 return FoodStage.GetWater(null, food_stage, classname);
1587 }
1588 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1590 }
1591
1593 {
1596 {
1597 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1598 }
1599 else if (classname != "" && food_stage)
1600 {
1601 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1602 }
1603 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1605
1606 }
1607
1609 {
1612 {
1613 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1614 }
1615 else if (classname != "" && food_stage)
1616 {
1617 return FoodStage.GetToxicity(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.GetAgents(null, food_stage, classname);
1633 }
1634 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1636 }
1637
1639 {
1642 {
1643 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1644 }
1645 else if (classname != "" && food_stage)
1646 {
1647 return FoodStage.GetDigestibility(null, food_stage, classname);
1648 }
1649 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1651 }
1652
1654 {
1657 {
1658 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1659 }
1660 else if (className != "" && foodStage)
1661 {
1662 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1663 }
1664 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1666 }
1667
1669 {
1679
1680 return profile;
1681 }
1682
1683
1684
1685
1687 {
1689 }
1690
1691
1693 {
1695 {
1697 }
1698
1699 return false;
1700 }
1701
1703 {
1705 {
1707 }
1708
1709 return false;
1710 }
1711
1713 {
1715 {
1717 }
1718
1719 return false;
1720 }
1721
1723 {
1725 {
1727 }
1728
1729 return false;
1730 }
1731
1733 {
1735 {
1737 }
1738
1739 return false;
1740 }
1741
1743 {
1745 {
1747 }
1748
1749 return false;
1750 }
1751
1752
1754 {
1756 }
1757
1759 {
1760 return GetFoodStage().GetNextFoodStageType( cooking_method );
1761 }
1762
1764 {
1765 return GetFoodStage().GetFoodStageName( food_stage_type );
1766 }
1767
1769 {
1770 return GetFoodStage().CanChangeToNewStage( cooking_method );
1771 }
1772
1773
1775 {
1776 if ( !source.GetFoodStage())
1777 return;
1782 }
1783
1786 {
1789 }
1790
1793 {
1794 switch (stageNew)
1795 {
1800 break;
1801
1804 break;
1805 }
1806 }
1807
1808
1809
1810
1811
1813 {
1815 }
1816
1818 {
1820
1821
1823 }
1824
1826 {
1828 {
1831 }
1832 }
1833
1834
1836 {
1838 if (player)
1839 {
1841 player.ServerReplaceItemInHandsWithNew(lambda);
1842 }
1843 else
1844 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1845 }
1846
1848 {
1850 }
1851
1853 {
1854 super.SetActions();
1855
1858 }
1859
1861 {
1862 #ifndef SERVER
1864 {
1866
1869 }
1870 #endif
1871 }
1872
1874 {
1875 #ifndef SERVER
1877 {
1881 }
1882 #endif
1883 }
1884
1886 {
1887 return false;
1888 }
1889
1891 {
1893 }
1894
1895 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
1896 {
1898
1899 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
1901 if ( hasRootAsPlayer )
1903
1904
1905
1906
1907
1908
1909
1911 {
1912
1914 {
1916 {
1920 break;
1921
1925 break;
1926
1930 break;
1931
1935 default:
1938 return;
1939 }
1940
1941
1942 }
1943
1945
1947 {
1949 {
1950
1952 {
1954 }
1956 {
1959 {
1961 }
1962 else
1963 {
1965 {
1967 }
1968 else
1969 {
1971 }
1972 }
1973 }
1974 }
1975 }
1976
1977 }
1979 {
1980
1982 {
1984 {
1988 break;
1989
1993 break;
1994
1998 break;
1999
2003 break;
2004
2007 default:
2010 return;
2011 }
2012 }
2013
2015
2017 {
2019 {
2020
2022 {
2024 }
2025 }
2026 }
2027 }
2029 {
2030
2032 {
2034 {
2038 break;
2039
2042 default:
2045 return;
2046 }
2047 }
2048
2050
2052 {
2054 {
2055
2057 {
2059 }
2060 }
2061 }
2062 }
2063 else
2064 {
2065
2067
2069 {
2072
2073 }
2074 else
2075 {
2077 {
2080 }
2081 }
2082 }
2083 }
2084
2086 {
2087 if (
GetGame().IsDedicatedServer())
2088 return;
2089
2091 {
2093 GetInventory().GetCurrentInventoryLocation(invLoc);
2095 {
2097 if (ptcMgr)
2098 {
2103 }
2104 }
2105 }
2107 {
2109 {
2112 return;
2113 }
2114
2116 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2118 {
2121 }
2122 }
2123 }
2124
2125 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2126 {
2128 {
2133 }
2134
2135 super.GetDebugActions(outputList);
2136 }
2137
2139 {
2140 super.OnAction(action_id, player, ctx);
2141
2143 {
2144 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2145 {
2147 if (food_stage_prev <= 0)
2148 {
2150 }
2152 return true;
2153 }
2154 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2155 {
2158 {
2160 }
2162 return true;
2163 }
2164
2165 }
2166
2167 #ifdef DIAG_DEVELOPER
2168 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2169 {
2170 PrintNutritionsData();
2171 return true;
2172 }
2173 #endif
2174
2175 return false;
2176 }
2177
2179 {
2180 string debug_output;
2181
2182 debug_output = super.GetDebugText();
2183
2186
2187 return debug_output;
2188 }
2189
2190
2191
2192
2193
2195 {
2196 float ret = super.GetBaitEffectivity();
2197
2199 {
2200 ret *= 0.5;
2201 }
2202
2203 return ret;
2204 }
2205
2207 {
2209 }
2210
2212 {
2214 }
2215
2217 {
2219 }
2220
2221 #ifdef DIAG_DEVELOPER
2222 private void PrintNutritionsData()
2223 {
2224 string nutritionsData = "";
2225
2228
2230 if (profile)
2231 {
2232 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2234 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2238 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2240
2243
2244 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2246 }
2247
2248 nutritionsData += "-----\n";
2249
2251 }
2252 #endif
2253
2255
2258 {
2260 }
2261}
2262
2264{
2266};
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.