1197{
1199
1207
1217
1219
1221 {
1223 {
1225
1227 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1228
1232 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1233 }
1234 }
1235
1237 {
1239
1241 }
1242
1244 {
1245 super.EEDelete(parent);
1246
1248
1251 }
1252
1254 {
1255 super.EEItemLocationChanged(oldLoc, newLoc);
1256
1259 {
1260 switch (oldLoc.GetParent().GetType())
1261 {
1262 case "FryingPan":
1263 case "Pot":
1264 case "Cauldron":
1265 case "SharpWoodenStick":
1267 break;
1268 }
1269
1272 {
1274 }
1275 }
1276
1277 if (oldLoc.IsValid())
1279
1282 }
1283
1285 {
1288 }
1289
1291 {
1294
1295 return true;
1296 }
1297
1299 {
1301 {
1303 }
1304 }
1305
1308 {
1309 int foodStageType;
1310
1312 if (foodStage)
1313 foodStageType = foodStage.GetFoodStageType();
1314
1319
1320 return agentsIn;
1321 }
1322
1323
1325 {
1326 return false;
1327 }
1328
1330 {
1331 return false;
1332 }
1333
1335 {
1337 {
1339 {
1342
1345
1346 default:
1347 return super.GetTemperatureFreezeTime();
1348 }
1349 }
1350
1351 return super.GetTemperatureFreezeTime();
1352 }
1353
1355 {
1357 {
1359 {
1362
1365
1366 default:
1367 return super.GetTemperatureThawTime();
1368 }
1369 }
1370
1371 return super.GetTemperatureThawTime();
1372 }
1373
1375 {
1377 }
1378
1379
1380
1381
1383 {
1384 SetSynchDirty();
1385 }
1386
1388 {
1389 super.OnVariablesSynchronized();
1390
1391
1392
1393
1395 {
1397 }
1398 else
1399 {
1401 }
1402
1405 }
1406
1407
1408
1409
1411 {
1414
1416 }
1417
1419 {
1420 string soundName = "";
1421
1424
1426 {
1428 }
1429 else
1430 {
1432 {
1434 {
1439 else
1440 soundName = "";
1441 break;
1442 }
1443
1445 {
1450 else
1451 soundName = "";
1452 break;
1453 }
1454
1456 {
1461 else
1462 soundName = "";
1463 break;
1464 }
1465
1466 default:
1467 soundName = "";
1468 break;
1469 }
1470
1472 {
1473 if (soundName == "")
1474 {
1476 }
1477 else
1478 {
1480 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1481 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1483 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1484 {
1486 }
1487 }
1488 }
1489 }
1490
1492 }
1493
1495 {
1498 }
1499
1500
1501
1502
1504 {
1505 super.OnStoreSave(ctx);
1506
1508 {
1510 }
1511
1512
1515 }
1516
1518 {
1519 if (!super.OnStoreLoad(ctx, version))
1520 return false;
1521
1523 {
1525 return false;
1526 }
1527
1528 if (version >= 115)
1529 {
1531 {
1533 return false;
1534 }
1536 {
1538 return false;
1539 }
1540 }
1541
1544
1545 return true;
1546 }
1547
1549 {
1550 super.AfterStoreLoad();
1551
1553 }
1554
1555
1557 {
1559 }
1560
1561
1563 {
1564 return false;
1565 }
1566
1568 {
1569 return false;
1570 }
1571
1573 {
1574 return false;
1575 }
1576
1578 {
1579 return false;
1580 }
1581
1582
1583
1584
1585
1587 {
1590 {
1591 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1592 }
1593 else if (classname != "" && food_stage)
1594 {
1595 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1596 }
1597 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1599
1600 }
1601
1603 {
1606 {
1608 }
1609 else if (classname != "" && food_stage)
1610 {
1611 return FoodStage.GetEnergy(null, food_stage, classname);
1612 }
1613 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1615 }
1616
1618 {
1621 {
1623 }
1624 else if (classname != "" && food_stage)
1625 {
1626 return FoodStage.GetWater(null, food_stage, classname);
1627 }
1628 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1630 }
1631
1633 {
1636 {
1637 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1638 }
1639 else if (classname != "" && food_stage)
1640 {
1641 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1642 }
1643 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1645
1646 }
1647
1649 {
1652 {
1653 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1654 }
1655 else if (classname != "" && food_stage)
1656 {
1657 return FoodStage.GetToxicity(null, food_stage, classname);
1658 }
1659 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1661 }
1662
1664 {
1667 {
1669 }
1670 else if (classname != "" && food_stage)
1671 {
1672 return FoodStage.GetAgents(null, food_stage, classname);
1673 }
1674 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1676 }
1677
1679 {
1682 {
1683 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1684 }
1685 else if (classname != "" && food_stage)
1686 {
1687 return FoodStage.GetDigestibility(null, food_stage, classname);
1688 }
1689 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1691 }
1692
1694 {
1697 {
1698 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1699 }
1700 else if (className != "" && foodStage)
1701 {
1702 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1703 }
1704 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1706 }
1707
1709 {
1719
1720 return profile;
1721 }
1722
1723
1724
1725
1727 {
1729 }
1730
1731
1733 {
1735 {
1737 }
1738
1739 return false;
1740 }
1741
1743 {
1745 {
1747 }
1748
1749 return false;
1750 }
1751
1753 {
1755 {
1757 }
1758
1759 return false;
1760 }
1761
1763 {
1765 {
1767 }
1768
1769 return false;
1770 }
1771
1773 {
1775 {
1777 }
1778
1779 return false;
1780 }
1781
1783 {
1785 {
1787 }
1788
1789 return false;
1790 }
1791
1792
1794 {
1796 }
1797
1799 {
1800 return GetFoodStage().GetNextFoodStageType( cooking_method );
1801 }
1802
1804 {
1805 return GetFoodStage().GetFoodStageName( food_stage_type );
1806 }
1807
1809 {
1810 return GetFoodStage().CanChangeToNewStage( cooking_method );
1811 }
1812
1813
1815 {
1816 if ( !source.GetFoodStage())
1817 return;
1822 }
1823
1826 {
1829 }
1830
1833 {
1834 switch (stageNew)
1835 {
1840 break;
1841
1844 break;
1845 }
1846 }
1847
1848
1849
1850
1851
1853 {
1855 }
1856
1858 {
1860
1861
1863 }
1864
1866 {
1868 {
1871 }
1872 }
1873
1874
1876 {
1878 if (player)
1879 {
1881 player.ServerReplaceItemInHandsWithNew(lambda);
1882 }
1883 else
1884 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1885 }
1886
1888 {
1890 }
1891
1893 {
1894 super.SetActions();
1895
1898 }
1899
1901 {
1902 #ifndef SERVER
1904 {
1906
1909 }
1910 #endif
1911 }
1912
1914 {
1915 #ifndef SERVER
1917 {
1921 }
1922 #endif
1923 }
1924
1926 {
1927 return false;
1928 }
1929
1931 {
1933 }
1934
1935 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
1936 {
1938
1939 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
1941 if ( hasRootAsPlayer )
1943
1944
1945
1946
1947
1948
1949
1951 {
1952
1954 {
1956 {
1960 break;
1961
1965 break;
1966
1970 break;
1971
1975 default:
1978 return;
1979 }
1980
1981
1982 }
1983
1985
1987 {
1989 {
1990
1992 {
1994 }
1996 {
1999 {
2001 }
2002 else
2003 {
2005 {
2007 }
2008 else
2009 {
2011 }
2012 }
2013 }
2014 }
2015 }
2016
2017 }
2019 {
2020
2022 {
2024 {
2028 break;
2029
2033 break;
2034
2038 break;
2039
2043 break;
2044
2047 default:
2050 return;
2051 }
2052 }
2053
2055
2057 {
2059 {
2060
2062 {
2064 }
2065 }
2066 }
2067 }
2069 {
2070
2072 {
2074 {
2078 break;
2079
2082 default:
2085 return;
2086 }
2087 }
2088
2090
2092 {
2094 {
2095
2097 {
2099 }
2100 }
2101 }
2102 }
2103 else
2104 {
2105
2107
2109 {
2112
2113 }
2114 else
2115 {
2117 {
2120 }
2121 }
2122 }
2123 }
2124
2126 {
2127 if (
GetGame().IsDedicatedServer())
2128 return;
2129
2131 {
2133 GetInventory().GetCurrentInventoryLocation(invLoc);
2135 {
2137 if (ptcMgr)
2138 {
2143 }
2144 }
2145 }
2147 {
2149 {
2152 return;
2153 }
2154
2156 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2158 {
2161 }
2162 }
2163 }
2164
2165 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2166 {
2167 super.GetDebugActions(outputList);
2168
2170 {
2174 }
2175 }
2176
2178 {
2179 super.OnAction(action_id, player, ctx);
2180
2182 {
2183 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2184 {
2186 if (food_stage_prev <= 0)
2187 {
2189 }
2191 return true;
2192 }
2193 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2194 {
2197 {
2199 }
2201 return true;
2202 }
2203
2204 }
2205
2206 #ifdef DIAG_DEVELOPER
2207 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2208 {
2209 PrintNutritionsData();
2210 return true;
2211 }
2212 #endif
2213
2214 return false;
2215 }
2216
2218 {
2219 string debug_output;
2220
2221 debug_output = super.GetDebugText();
2222
2225
2226 return debug_output;
2227 }
2228
2229
2230
2231
2232
2234 {
2235 float ret = super.GetBaitEffectivity();
2236
2238 {
2239 ret *= 0.5;
2240 }
2241
2242 return ret;
2243 }
2244
2246 {
2248 }
2249
2251 {
2253 }
2254
2256 {
2258 }
2259
2260 #ifdef DIAG_DEVELOPER
2261 private void PrintNutritionsData()
2262 {
2263 string nutritionsData = "";
2264
2267
2269 if (profile)
2270 {
2271 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2273 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2277 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2279
2282
2283 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2285 }
2286
2287 nutritionsData += "-----\n";
2288
2290 }
2291 #endif
2292
2294
2297 {
2299 }
2300}
2301
2303{
2305};
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.