1247{
1249
1257
1267
1269
1271 {
1273 {
1275
1277 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1278
1282 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1283 }
1284 }
1285
1287 {
1289
1291 }
1292
1294 {
1295 super.EEDelete(parent);
1296
1298
1301 }
1302
1304 {
1305 super.EEItemLocationChanged(oldLoc, newLoc);
1306
1309 {
1310 switch (oldLoc.GetParent().GetType())
1311 {
1312 case "FryingPan":
1313 case "Pot":
1314 case "Cauldron":
1315 case "SharpWoodenStick":
1317 break;
1318 }
1319
1322 {
1324 }
1325 }
1326
1327 if (oldLoc.IsValid())
1329
1332 }
1333
1335 {
1338 }
1339
1341 {
1344
1345 return true;
1346 }
1347
1349 {
1351 {
1353 }
1354 }
1355
1358 {
1359 int foodStageType;
1360
1362 if (foodStage)
1363 foodStageType = foodStage.GetFoodStageType();
1364
1369
1370 return agentsIn;
1371 }
1372
1373
1375 {
1376 return false;
1377 }
1378
1380 {
1381 return false;
1382 }
1383
1385 {
1387 {
1389 {
1392
1395
1396 default:
1397 return super.GetTemperatureFreezeTime();
1398 }
1399 }
1400
1401 return super.GetTemperatureFreezeTime();
1402 }
1403
1405 {
1407 {
1409 {
1412
1415
1416 default:
1417 return super.GetTemperatureThawTime();
1418 }
1419 }
1420
1421 return super.GetTemperatureThawTime();
1422 }
1423
1425 {
1427 }
1428
1429
1430
1431
1433 {
1434 SetSynchDirty();
1435 }
1436
1438 {
1439 super.OnVariablesSynchronized();
1440
1441
1442
1443
1445 {
1447 }
1448 else
1449 {
1451 }
1452
1455 }
1456
1457
1458
1459
1461 {
1464
1466 }
1467
1469 {
1470 string soundName = "";
1471
1474
1476 {
1478 }
1479 else
1480 {
1482 {
1484 {
1489 else
1490 soundName = "";
1491 break;
1492 }
1493
1495 {
1500 else
1501 soundName = "";
1502 break;
1503 }
1504
1506 {
1511 else
1512 soundName = "";
1513 break;
1514 }
1515
1516 default:
1517 soundName = "";
1518 break;
1519 }
1520
1522 {
1523 if (soundName == "")
1524 {
1526 }
1527 else
1528 {
1530 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1531 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1533 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1534 {
1536 }
1537 }
1538 }
1539 }
1540
1542 }
1543
1545 {
1548 }
1549
1550
1551
1552
1554 {
1555 super.OnStoreSave(ctx);
1556
1558 {
1560 }
1561
1562
1565 }
1566
1568 {
1569 if (!super.OnStoreLoad(ctx, version))
1570 return false;
1571
1573 {
1575 return false;
1576 }
1577
1578 if (version >= 115)
1579 {
1581 {
1583 return false;
1584 }
1586 {
1588 return false;
1589 }
1590 }
1591
1594
1595 return true;
1596 }
1597
1599 {
1600 super.AfterStoreLoad();
1601
1603 }
1604
1605
1607 {
1609 }
1610
1611
1613 {
1614 return false;
1615 }
1616
1618 {
1619 return false;
1620 }
1621
1623 {
1624 return false;
1625 }
1626
1628 {
1629 return false;
1630 }
1631
1632
1633
1634
1635
1637 {
1640 {
1641 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1642 }
1643 else if (classname != "" && food_stage)
1644 {
1645 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1646 }
1647 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1649
1650 }
1651
1653 {
1656 {
1658 }
1659 else if (classname != "" && food_stage)
1660 {
1661 return FoodStage.GetEnergy(null, food_stage, classname);
1662 }
1663 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1665 }
1666
1668 {
1671 {
1673 }
1674 else if (classname != "" && food_stage)
1675 {
1676 return FoodStage.GetWater(null, food_stage, classname);
1677 }
1678 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1680 }
1681
1683 {
1686 {
1687 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1688 }
1689 else if (classname != "" && food_stage)
1690 {
1691 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1692 }
1693 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1695
1696 }
1697
1699 {
1702 {
1703 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1704 }
1705 else if (classname != "" && food_stage)
1706 {
1707 return FoodStage.GetToxicity(null, food_stage, classname);
1708 }
1709 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1711 }
1712
1714 {
1717 {
1719 }
1720 else if (classname != "" && food_stage)
1721 {
1722 return FoodStage.GetAgents(null, food_stage, classname);
1723 }
1724 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1726 }
1727
1729 {
1732 {
1733 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1734 }
1735 else if (classname != "" && food_stage)
1736 {
1737 return FoodStage.GetDigestibility(null, food_stage, classname);
1738 }
1739 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1741 }
1742
1744 {
1747 {
1748 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1749 }
1750 else if (className != "" && foodStage)
1751 {
1752 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1753 }
1754 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1756 }
1757
1759 {
1769
1770 return profile;
1771 }
1772
1773
1774
1775
1777 {
1779 }
1780
1781
1783 {
1785 {
1787 }
1788
1789 return false;
1790 }
1791
1793 {
1795 {
1797 }
1798
1799 return false;
1800 }
1801
1803 {
1805 {
1807 }
1808
1809 return false;
1810 }
1811
1813 {
1815 {
1817 }
1818
1819 return false;
1820 }
1821
1823 {
1825 {
1827 }
1828
1829 return false;
1830 }
1831
1833 {
1835 {
1837 }
1838
1839 return false;
1840 }
1841
1842
1844 {
1846 }
1847
1849 {
1850 return GetFoodStage().GetNextFoodStageType( cooking_method );
1851 }
1852
1854 {
1855 return GetFoodStage().GetFoodStageName( food_stage_type );
1856 }
1857
1859 {
1860 return GetFoodStage().CanChangeToNewStage( cooking_method );
1861 }
1862
1863
1865 {
1866 if ( !source.GetFoodStage())
1867 return;
1872 }
1873
1876 {
1879 }
1880
1883 {
1884 switch (stageNew)
1885 {
1890 break;
1891
1894 break;
1895 }
1896 }
1897
1898
1899
1900
1901
1903 {
1905 }
1906
1908 {
1910
1911
1913 }
1914
1916 {
1918 {
1921 }
1922 }
1923
1924
1926 {
1928 if (player)
1929 {
1931 player.ServerReplaceItemInHandsWithNew(lambda);
1932 }
1933 else
1934 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1935 }
1936
1938 {
1940 }
1941
1943 {
1944 super.SetActions();
1945
1948 }
1949
1951 {
1952 #ifndef SERVER
1954 {
1956
1959 }
1960 #endif
1961 }
1962
1964 {
1965 #ifndef SERVER
1967 {
1971 }
1972 #endif
1973 }
1974
1976 {
1977 return false;
1978 }
1979
1981 {
1983 }
1984
1985 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
1986 {
1988
1989 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
1991 if ( hasRootAsPlayer )
1993
1994
1995
1996
1997
1998
1999
2001 {
2002
2004 {
2006 {
2010 break;
2011
2015 break;
2016
2020 break;
2021
2025 default:
2028 return;
2029 }
2030
2031
2032 }
2033
2035
2037 {
2039 {
2040
2042 {
2044 }
2046 {
2049 {
2051 }
2052 else
2053 {
2055 {
2057 }
2058 else
2059 {
2061 }
2062 }
2063 }
2064 }
2065 }
2066
2067 }
2069 {
2070
2072 {
2074 {
2078 break;
2079
2083 break;
2084
2088 break;
2089
2093 break;
2094
2097 default:
2100 return;
2101 }
2102 }
2103
2105
2107 {
2109 {
2110
2112 {
2114 }
2115 }
2116 }
2117 }
2119 {
2120
2122 {
2124 {
2128 break;
2129
2132 default:
2135 return;
2136 }
2137 }
2138
2140
2142 {
2144 {
2145
2147 {
2149 }
2150 }
2151 }
2152 }
2153 else
2154 {
2155
2157
2159 {
2162
2163 }
2164 else
2165 {
2167 {
2170 }
2171 }
2172 }
2173 }
2174
2176 {
2177 if (
GetGame().IsDedicatedServer())
2178 return;
2179
2181 {
2183 GetInventory().GetCurrentInventoryLocation(invLoc);
2185 {
2187 if (ptcMgr)
2188 {
2193 }
2194 }
2195 }
2197 {
2199 {
2202 return;
2203 }
2204
2206 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2208 {
2211 }
2212 }
2213 }
2214
2215 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2216 {
2217 super.GetDebugActions(outputList);
2218
2220 {
2224 }
2225 }
2226
2228 {
2229 super.OnAction(action_id, player, ctx);
2230
2232 {
2233 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2234 {
2236 if (food_stage_prev <= 0)
2237 {
2239 }
2241 return true;
2242 }
2243 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2244 {
2247 {
2249 }
2251 return true;
2252 }
2253
2254 }
2255
2256 #ifdef DIAG_DEVELOPER
2257 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2258 {
2259 PrintNutritionsData();
2260 return true;
2261 }
2262 #endif
2263
2264 return false;
2265 }
2266
2268 {
2269 string debug_output;
2270
2271 debug_output = super.GetDebugText();
2272
2275
2276 return debug_output;
2277 }
2278
2279
2280
2281
2282
2284 {
2285 float ret = super.GetBaitEffectivity();
2286
2288 {
2289 ret *= 0.5;
2290 }
2291
2292 return ret;
2293 }
2294
2296 {
2298 }
2299
2301 {
2303 }
2304
2306 {
2308 }
2309
2310 #ifdef DIAG_DEVELOPER
2311 private void PrintNutritionsData()
2312 {
2313 string nutritionsData = "";
2314
2317
2319 if (profile)
2320 {
2321 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2323 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2327 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2329
2332
2333 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2335 }
2336
2337 nutritionsData += "-----\n";
2338
2340 }
2341 #endif
2342
2344
2347 {
2349 }
2350}
2351
2353{
2355};
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.