1166{
1168
1176
1186
1188
1190 {
1192 {
1194
1196 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1197
1201 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1202 }
1203 }
1204
1206 {
1208
1210 }
1211
1213 {
1214 super.EEDelete(parent);
1215
1217
1220 }
1221
1223 {
1224 super.EEItemLocationChanged(oldLoc, newLoc);
1225
1228 {
1229 switch (oldLoc.GetParent().GetType())
1230 {
1231 case "FryingPan":
1232 case "Pot":
1233 case "Cauldron":
1234 case "SharpWoodenStick":
1236 break;
1237 }
1238
1241 {
1243 }
1244 }
1245
1246 if (oldLoc.IsValid())
1248
1251 }
1252
1254 {
1257 }
1258
1260 {
1263
1264 return true;
1265 }
1266
1268 {
1270 {
1272 }
1273 }
1274
1277 {
1278 int foodStageType;
1279
1281 if (foodStage)
1282 foodStageType = foodStage.GetFoodStageType();
1283
1288
1289 return agentsIn;
1290 }
1291
1292
1294 {
1295 return false;
1296 }
1297
1299 {
1300 return false;
1301 }
1302
1304 {
1306 {
1308 {
1311
1314
1315 default:
1316 return super.GetTemperatureFreezeTime();
1317 }
1318 }
1319
1320 return super.GetTemperatureFreezeTime();
1321 }
1322
1324 {
1326 {
1328 {
1331
1334
1335 default:
1336 return super.GetTemperatureThawTime();
1337 }
1338 }
1339
1340 return super.GetTemperatureThawTime();
1341 }
1342
1344 {
1346 }
1347
1348
1349
1350
1352 {
1353 SetSynchDirty();
1354 }
1355
1357 {
1358 super.OnVariablesSynchronized();
1359
1360
1361
1362
1364 {
1366 }
1367 else
1368 {
1370 }
1371
1374 }
1375
1376
1377
1378
1380 {
1383
1385 }
1386
1388 {
1389 string soundName = "";
1390
1393
1395 {
1397 }
1398 else
1399 {
1401 {
1403 {
1408 else
1409 soundName = "";
1410 break;
1411 }
1412
1414 {
1419 else
1420 soundName = "";
1421 break;
1422 }
1423
1425 {
1430 else
1431 soundName = "";
1432 break;
1433 }
1434
1435 default:
1436 soundName = "";
1437 break;
1438 }
1439
1441 {
1442 if (soundName == "")
1443 {
1445 }
1446 else
1447 {
1449 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1450 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1452 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1453 {
1455 }
1456 }
1457 }
1458 }
1459
1461 }
1462
1464 {
1467 }
1468
1469
1470
1471
1473 {
1474 super.OnStoreSave(ctx);
1475
1477 {
1479 }
1480
1481
1484 }
1485
1487 {
1488 if (!super.OnStoreLoad(ctx, version))
1489 return false;
1490
1492 {
1494 return false;
1495 }
1496
1497 if (version >= 115)
1498 {
1500 {
1502 return false;
1503 }
1505 {
1507 return false;
1508 }
1509 }
1510
1513
1514 return true;
1515 }
1516
1518 {
1519 super.AfterStoreLoad();
1520
1522 }
1523
1524
1526 {
1528 }
1529
1530
1532 {
1533 return false;
1534 }
1535
1537 {
1538 return false;
1539 }
1540
1542 {
1543 return false;
1544 }
1545
1547 {
1548 return false;
1549 }
1550
1551
1552
1553
1554
1556 {
1559 {
1560 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1561 }
1562 else if (classname != "" && food_stage)
1563 {
1564 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1565 }
1566 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1568
1569 }
1570
1572 {
1575 {
1577 }
1578 else if (classname != "" && food_stage)
1579 {
1580 return FoodStage.GetEnergy(null, food_stage, classname);
1581 }
1582 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1584 }
1585
1587 {
1590 {
1592 }
1593 else if (classname != "" && food_stage)
1594 {
1595 return FoodStage.GetWater(null, food_stage, classname);
1596 }
1597 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1599 }
1600
1602 {
1605 {
1606 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1607 }
1608 else if (classname != "" && food_stage)
1609 {
1610 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1611 }
1612 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1614
1615 }
1616
1618 {
1621 {
1622 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1623 }
1624 else if (classname != "" && food_stage)
1625 {
1626 return FoodStage.GetToxicity(null, food_stage, classname);
1627 }
1628 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1630 }
1631
1633 {
1636 {
1638 }
1639 else if (classname != "" && food_stage)
1640 {
1641 return FoodStage.GetAgents(null, food_stage, classname);
1642 }
1643 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1645 }
1646
1648 {
1651 {
1652 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1653 }
1654 else if (classname != "" && food_stage)
1655 {
1656 return FoodStage.GetDigestibility(null, food_stage, classname);
1657 }
1658 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1660 }
1661
1663 {
1666 {
1667 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1668 }
1669 else if (className != "" && foodStage)
1670 {
1671 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1672 }
1673 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1675 }
1676
1678 {
1688
1689 return profile;
1690 }
1691
1692
1693
1694
1696 {
1698 }
1699
1700
1702 {
1704 {
1706 }
1707
1708 return false;
1709 }
1710
1712 {
1714 {
1716 }
1717
1718 return false;
1719 }
1720
1722 {
1724 {
1726 }
1727
1728 return false;
1729 }
1730
1732 {
1734 {
1736 }
1737
1738 return false;
1739 }
1740
1742 {
1744 {
1746 }
1747
1748 return false;
1749 }
1750
1752 {
1754 {
1756 }
1757
1758 return false;
1759 }
1760
1761
1763 {
1765 }
1766
1768 {
1769 return GetFoodStage().GetNextFoodStageType( cooking_method );
1770 }
1771
1773 {
1774 return GetFoodStage().GetFoodStageName( food_stage_type );
1775 }
1776
1778 {
1779 return GetFoodStage().CanChangeToNewStage( cooking_method );
1780 }
1781
1782
1784 {
1785 if ( !source.GetFoodStage())
1786 return;
1791 }
1792
1795 {
1798 }
1799
1802 {
1803 switch (stageNew)
1804 {
1809 break;
1810
1813 break;
1814 }
1815 }
1816
1817
1818
1819
1820
1822 {
1824 }
1825
1827 {
1829
1830
1832 }
1833
1835 {
1837 {
1840 }
1841 }
1842
1843
1845 {
1847 if (player)
1848 {
1850 player.ServerReplaceItemInHandsWithNew(lambda);
1851 }
1852 else
1853 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1854 }
1855
1857 {
1859 }
1860
1862 {
1863 super.SetActions();
1864
1867 }
1868
1870 {
1871 #ifndef SERVER
1873 {
1875
1878 }
1879 #endif
1880 }
1881
1883 {
1884 #ifndef SERVER
1886 {
1890 }
1891 #endif
1892 }
1893
1895 {
1896 return false;
1897 }
1898
1900 {
1902 }
1903
1904 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
1905 {
1907
1908 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
1910 if ( hasRootAsPlayer )
1912
1913
1914
1915
1916
1917
1918
1920 {
1921
1923 {
1925 {
1929 break;
1930
1934 break;
1935
1939 break;
1940
1944 default:
1947 return;
1948 }
1949
1950
1951 }
1952
1954
1956 {
1958 {
1959
1961 {
1963 }
1965 {
1968 {
1970 }
1971 else
1972 {
1974 {
1976 }
1977 else
1978 {
1980 }
1981 }
1982 }
1983 }
1984 }
1985
1986 }
1988 {
1989
1991 {
1993 {
1997 break;
1998
2002 break;
2003
2007 break;
2008
2012 break;
2013
2016 default:
2019 return;
2020 }
2021 }
2022
2024
2026 {
2028 {
2029
2031 {
2033 }
2034 }
2035 }
2036 }
2038 {
2039
2041 {
2043 {
2047 break;
2048
2051 default:
2054 return;
2055 }
2056 }
2057
2059
2061 {
2063 {
2064
2066 {
2068 }
2069 }
2070 }
2071 }
2072 else
2073 {
2074
2076
2078 {
2081
2082 }
2083 else
2084 {
2086 {
2089 }
2090 }
2091 }
2092 }
2093
2095 {
2096 if (
GetGame().IsDedicatedServer())
2097 return;
2098
2100 {
2102 GetInventory().GetCurrentInventoryLocation(invLoc);
2104 {
2106 if (ptcMgr)
2107 {
2112 }
2113 }
2114 }
2116 {
2118 {
2121 return;
2122 }
2123
2125 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2127 {
2130 }
2131 }
2132 }
2133
2134 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2135 {
2136 super.GetDebugActions(outputList);
2137
2139 {
2143 }
2144 }
2145
2147 {
2148 super.OnAction(action_id, player, ctx);
2149
2151 {
2152 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2153 {
2155 if (food_stage_prev <= 0)
2156 {
2158 }
2160 return true;
2161 }
2162 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2163 {
2166 {
2168 }
2170 return true;
2171 }
2172
2173 }
2174
2175 #ifdef DIAG_DEVELOPER
2176 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2177 {
2178 PrintNutritionsData();
2179 return true;
2180 }
2181 #endif
2182
2183 return false;
2184 }
2185
2187 {
2188 string debug_output;
2189
2190 debug_output = super.GetDebugText();
2191
2194
2195 return debug_output;
2196 }
2197
2198
2199
2200
2201
2203 {
2204 float ret = super.GetBaitEffectivity();
2205
2207 {
2208 ret *= 0.5;
2209 }
2210
2211 return ret;
2212 }
2213
2215 {
2217 }
2218
2220 {
2222 }
2223
2225 {
2227 }
2228
2229 #ifdef DIAG_DEVELOPER
2230 private void PrintNutritionsData()
2231 {
2232 string nutritionsData = "";
2233
2236
2238 if (profile)
2239 {
2240 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2242 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2246 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2248
2251
2252 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2254 }
2255
2256 nutritionsData += "-----\n";
2257
2259 }
2260 #endif
2261
2263
2266 {
2268 }
2269}
2270
2272{
2274};
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.