1198{
1200
1208
1218
1220
1222 {
1224 {
1226
1228 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1229
1233 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1234 }
1235 }
1236
1238 {
1240
1242 }
1243
1245 {
1246 super.EEDelete(parent);
1247
1249
1252 }
1253
1255 {
1256 super.EEItemLocationChanged(oldLoc, newLoc);
1257
1260 {
1261 switch (oldLoc.GetParent().GetType())
1262 {
1263 case "FryingPan":
1264 case "Pot":
1265 case "Cauldron":
1266 case "SharpWoodenStick":
1268 break;
1269 }
1270
1273 {
1275 }
1276 }
1277
1278 if (oldLoc.IsValid())
1280
1283 }
1284
1286 {
1289 }
1290
1292 {
1295
1296 return true;
1297 }
1298
1300 {
1302 {
1304 }
1305 }
1306
1309 {
1310 int foodStageType;
1311
1313 if (foodStage)
1314 foodStageType = foodStage.GetFoodStageType();
1315
1320
1321 return agentsIn;
1322 }
1323
1324
1326 {
1327 return false;
1328 }
1329
1331 {
1332 return false;
1333 }
1334
1336 {
1338 {
1340 {
1343
1346
1347 default:
1348 return super.GetTemperatureFreezeTime();
1349 }
1350 }
1351
1352 return super.GetTemperatureFreezeTime();
1353 }
1354
1356 {
1358 {
1360 {
1363
1366
1367 default:
1368 return super.GetTemperatureThawTime();
1369 }
1370 }
1371
1372 return super.GetTemperatureThawTime();
1373 }
1374
1376 {
1378 }
1379
1380
1381
1382
1384 {
1385 SetSynchDirty();
1386 }
1387
1389 {
1390 super.OnVariablesSynchronized();
1391
1392
1393
1394
1396 {
1398 }
1399 else
1400 {
1402 }
1403
1406 }
1407
1408
1409
1410
1412 {
1415
1417 }
1418
1420 {
1421 string soundName = "";
1422
1425
1427 {
1429 }
1430 else
1431 {
1433 {
1435 {
1440 else
1441 soundName = "";
1442 break;
1443 }
1444
1446 {
1451 else
1452 soundName = "";
1453 break;
1454 }
1455
1457 {
1462 else
1463 soundName = "";
1464 break;
1465 }
1466
1467 default:
1468 soundName = "";
1469 break;
1470 }
1471
1473 {
1474 if (soundName == "")
1475 {
1477 }
1478 else
1479 {
1481 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1482 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1484 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1485 {
1487 }
1488 }
1489 }
1490 }
1491
1493 }
1494
1496 {
1499 }
1500
1501
1502
1503
1505 {
1506 super.OnStoreSave(ctx);
1507
1509 {
1511 }
1512
1513
1516 }
1517
1519 {
1520 if (!super.OnStoreLoad(ctx, version))
1521 return false;
1522
1524 {
1526 return false;
1527 }
1528
1529 if (version >= 115)
1530 {
1532 {
1534 return false;
1535 }
1537 {
1539 return false;
1540 }
1541 }
1542
1545
1546 return true;
1547 }
1548
1550 {
1551 super.AfterStoreLoad();
1552
1554 }
1555
1556
1558 {
1560 }
1561
1562
1564 {
1565 return false;
1566 }
1567
1569 {
1570 return false;
1571 }
1572
1574 {
1575 return false;
1576 }
1577
1579 {
1580 return false;
1581 }
1582
1583
1584
1585
1586
1588 {
1591 {
1592 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1593 }
1594 else if (classname != "" && food_stage)
1595 {
1596 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1597 }
1598 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1600
1601 }
1602
1604 {
1607 {
1609 }
1610 else if (classname != "" && food_stage)
1611 {
1612 return FoodStage.GetEnergy(null, food_stage, classname);
1613 }
1614 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1616 }
1617
1619 {
1622 {
1624 }
1625 else if (classname != "" && food_stage)
1626 {
1627 return FoodStage.GetWater(null, food_stage, classname);
1628 }
1629 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1631 }
1632
1634 {
1637 {
1638 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1639 }
1640 else if (classname != "" && food_stage)
1641 {
1642 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1643 }
1644 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1646
1647 }
1648
1650 {
1653 {
1654 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1655 }
1656 else if (classname != "" && food_stage)
1657 {
1658 return FoodStage.GetToxicity(null, food_stage, classname);
1659 }
1660 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1662 }
1663
1665 {
1668 {
1670 }
1671 else if (classname != "" && food_stage)
1672 {
1673 return FoodStage.GetAgents(null, food_stage, classname);
1674 }
1675 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1677 }
1678
1680 {
1683 {
1684 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1685 }
1686 else if (classname != "" && food_stage)
1687 {
1688 return FoodStage.GetDigestibility(null, food_stage, classname);
1689 }
1690 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1692 }
1693
1695 {
1698 {
1699 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1700 }
1701 else if (className != "" && foodStage)
1702 {
1703 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1704 }
1705 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1707 }
1708
1710 {
1720
1721 return profile;
1722 }
1723
1724
1725
1726
1728 {
1730 }
1731
1732
1734 {
1736 {
1738 }
1739
1740 return false;
1741 }
1742
1744 {
1746 {
1748 }
1749
1750 return false;
1751 }
1752
1754 {
1756 {
1758 }
1759
1760 return false;
1761 }
1762
1764 {
1766 {
1768 }
1769
1770 return false;
1771 }
1772
1774 {
1776 {
1778 }
1779
1780 return false;
1781 }
1782
1784 {
1786 {
1788 }
1789
1790 return false;
1791 }
1792
1793
1795 {
1797 }
1798
1800 {
1801 return GetFoodStage().GetNextFoodStageType( cooking_method );
1802 }
1803
1805 {
1806 return GetFoodStage().GetFoodStageName( food_stage_type );
1807 }
1808
1810 {
1811 return GetFoodStage().CanChangeToNewStage( cooking_method );
1812 }
1813
1814
1816 {
1817 if ( !source.GetFoodStage())
1818 return;
1823 }
1824
1827 {
1830 }
1831
1834 {
1835 switch (stageNew)
1836 {
1841 break;
1842
1845 break;
1846 }
1847 }
1848
1849
1850
1851
1852
1854 {
1856 }
1857
1859 {
1861
1862
1864 }
1865
1867 {
1869 {
1872 }
1873 }
1874
1875
1877 {
1879 if (player)
1880 {
1882 player.ServerReplaceItemInHandsWithNew(lambda);
1883 }
1884 else
1885 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1886 }
1887
1889 {
1891 }
1892
1894 {
1895 super.SetActions();
1896
1899 }
1900
1902 {
1903 #ifndef SERVER
1905 {
1907
1910 }
1911 #endif
1912 }
1913
1915 {
1916 #ifndef SERVER
1918 {
1922 }
1923 #endif
1924 }
1925
1927 {
1928 return false;
1929 }
1930
1932 {
1934 }
1935
1936 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
1937 {
1939
1940 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
1942 if ( hasRootAsPlayer )
1944
1945
1946
1947
1948
1949
1950
1952 {
1953
1955 {
1957 {
1961 break;
1962
1966 break;
1967
1971 break;
1972
1976 default:
1979 return;
1980 }
1981
1982
1983 }
1984
1986
1988 {
1990 {
1991
1993 {
1995 }
1997 {
2000 {
2002 }
2003 else
2004 {
2006 {
2008 }
2009 else
2010 {
2012 }
2013 }
2014 }
2015 }
2016 }
2017
2018 }
2020 {
2021
2023 {
2025 {
2029 break;
2030
2034 break;
2035
2039 break;
2040
2044 break;
2045
2048 default:
2051 return;
2052 }
2053 }
2054
2056
2058 {
2060 {
2061
2063 {
2065 }
2066 }
2067 }
2068 }
2070 {
2071
2073 {
2075 {
2079 break;
2080
2083 default:
2086 return;
2087 }
2088 }
2089
2091
2093 {
2095 {
2096
2098 {
2100 }
2101 }
2102 }
2103 }
2104 else
2105 {
2106
2108
2110 {
2113
2114 }
2115 else
2116 {
2118 {
2121 }
2122 }
2123 }
2124 }
2125
2127 {
2128 if (
GetGame().IsDedicatedServer())
2129 return;
2130
2132 {
2134 GetInventory().GetCurrentInventoryLocation(invLoc);
2136 {
2138 if (ptcMgr)
2139 {
2144 }
2145 }
2146 }
2148 {
2150 {
2153 return;
2154 }
2155
2157 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2159 {
2162 }
2163 }
2164 }
2165
2166 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2167 {
2169 {
2174 }
2175
2176 super.GetDebugActions(outputList);
2177 }
2178
2180 {
2181 super.OnAction(action_id, player, ctx);
2182
2184 {
2185 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2186 {
2188 if (food_stage_prev <= 0)
2189 {
2191 }
2193 return true;
2194 }
2195 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2196 {
2199 {
2201 }
2203 return true;
2204 }
2205
2206 }
2207
2208 #ifdef DIAG_DEVELOPER
2209 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2210 {
2211 PrintNutritionsData();
2212 return true;
2213 }
2214 #endif
2215
2216 return false;
2217 }
2218
2220 {
2221 string debug_output;
2222
2223 debug_output = super.GetDebugText();
2224
2227
2228 return debug_output;
2229 }
2230
2231
2232
2233
2234
2236 {
2237 float ret = super.GetBaitEffectivity();
2238
2240 {
2241 ret *= 0.5;
2242 }
2243
2244 return ret;
2245 }
2246
2248 {
2250 }
2251
2253 {
2255 }
2256
2258 {
2260 }
2261
2262 #ifdef DIAG_DEVELOPER
2263 private void PrintNutritionsData()
2264 {
2265 string nutritionsData = "";
2266
2269
2271 if (profile)
2272 {
2273 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2275 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2279 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2281
2284
2285 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2287 }
2288
2289 nutritionsData += "-----\n";
2290
2292 }
2293 #endif
2294
2296
2299 {
2301 }
2302}
2303
2305{
2307};
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.