1268{
1270
1278
1288
1290
1292 {
1294 {
1296
1298 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1299
1303 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1304 }
1305 }
1306
1308 {
1310
1312 }
1313
1315 {
1316 super.EEDelete(parent);
1317
1319
1322 }
1323
1325 {
1326 super.EEItemLocationChanged(oldLoc, newLoc);
1327
1330 {
1331 switch (oldLoc.GetParent().GetType())
1332 {
1333 case "FryingPan":
1334 case "Pot":
1335 case "Cauldron":
1336 case "SharpWoodenStick":
1338 break;
1339 }
1340
1343 {
1345 }
1346 }
1347
1348 if (oldLoc.IsValid())
1350
1353 }
1354
1356 {
1359 }
1360
1362 {
1365
1366 return true;
1367 }
1368
1370 {
1372 {
1374 }
1375 }
1376
1379 {
1380 int foodStageType;
1381
1383 if (foodStage)
1384 foodStageType = foodStage.GetFoodStageType();
1385
1390
1391 return agentsIn;
1392 }
1393
1394
1396 {
1397 return false;
1398 }
1399
1401 {
1402 return false;
1403 }
1404
1406 {
1408 {
1410 {
1413
1416
1417 default:
1418 return super.GetTemperatureFreezeTime();
1419 }
1420 }
1421
1422 return super.GetTemperatureFreezeTime();
1423 }
1424
1426 {
1428 {
1430 {
1433
1436
1437 default:
1438 return super.GetTemperatureThawTime();
1439 }
1440 }
1441
1442 return super.GetTemperatureThawTime();
1443 }
1444
1446 {
1448 }
1449
1450
1451
1452
1454 {
1455 SetSynchDirty();
1456 }
1457
1459 {
1460 super.OnVariablesSynchronized();
1461
1462
1463
1464
1466 {
1468 }
1469 else
1470 {
1472 }
1473
1476 }
1477
1478
1479
1480
1482 {
1485
1487 }
1488
1490 {
1491 string soundName = "";
1492
1495
1497 {
1499 }
1500 else
1501 {
1503 {
1505 {
1510 else
1511 soundName = "";
1512 break;
1513 }
1514
1516 {
1521 else
1522 soundName = "";
1523 break;
1524 }
1525
1527 {
1532 else
1533 soundName = "";
1534 break;
1535 }
1536
1537 default:
1538 soundName = "";
1539 break;
1540 }
1541
1543 {
1544 if (soundName == "")
1545 {
1547 }
1548 else
1549 {
1551 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1552 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1554 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1555 {
1557 }
1558 }
1559 }
1560 }
1561
1563 }
1564
1566 {
1569 }
1570
1571
1572
1573
1575 {
1576 super.OnStoreSave(ctx);
1577
1579 {
1581 }
1582
1583
1586 }
1587
1589 {
1590 if (!super.OnStoreLoad(ctx, version))
1591 return false;
1592
1594 {
1596 return false;
1597 }
1598
1599 if (version >= 115)
1600 {
1602 {
1604 return false;
1605 }
1607 {
1609 return false;
1610 }
1611 }
1612
1615
1616 return true;
1617 }
1618
1620 {
1621 super.AfterStoreLoad();
1622
1624 }
1625
1626
1628 {
1630 }
1631
1632
1634 {
1635 return false;
1636 }
1637
1639 {
1640 return false;
1641 }
1642
1644 {
1645 return false;
1646 }
1647
1649 {
1650 return false;
1651 }
1652
1653
1654
1655
1656
1658 {
1661 {
1662 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1663 }
1664 else if (classname != "" && food_stage)
1665 {
1666 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1667 }
1668 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1670
1671 }
1672
1674 {
1677 {
1679 }
1680 else if (classname != "" && food_stage)
1681 {
1682 return FoodStage.GetEnergy(null, food_stage, classname);
1683 }
1684 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1686 }
1687
1689 {
1692 {
1694 }
1695 else if (classname != "" && food_stage)
1696 {
1697 return FoodStage.GetWater(null, food_stage, classname);
1698 }
1699 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1701 }
1702
1704 {
1707 {
1708 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1709 }
1710 else if (classname != "" && food_stage)
1711 {
1712 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1713 }
1714 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1716
1717 }
1718
1720 {
1723 {
1724 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1725 }
1726 else if (classname != "" && food_stage)
1727 {
1728 return FoodStage.GetToxicity(null, food_stage, classname);
1729 }
1730 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1732 }
1733
1735 {
1738 {
1740 }
1741 else if (classname != "" && food_stage)
1742 {
1743 return FoodStage.GetAgents(null, food_stage, classname);
1744 }
1745 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1747 }
1748
1750 {
1753 {
1754 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1755 }
1756 else if (classname != "" && food_stage)
1757 {
1758 return FoodStage.GetDigestibility(null, food_stage, classname);
1759 }
1760 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1762 }
1763
1765 {
1768 {
1769 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1770 }
1771 else if (className != "" && foodStage)
1772 {
1773 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1774 }
1775 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1777 }
1778
1780 {
1790
1791 return profile;
1792 }
1793
1794
1795
1796
1798 {
1800 }
1801
1802
1804 {
1806 {
1808 }
1809
1810 return false;
1811 }
1812
1814 {
1816 {
1818 }
1819
1820 return false;
1821 }
1822
1824 {
1826 {
1828 }
1829
1830 return false;
1831 }
1832
1834 {
1836 {
1838 }
1839
1840 return false;
1841 }
1842
1844 {
1846 {
1848 }
1849
1850 return false;
1851 }
1852
1854 {
1856 {
1858 }
1859
1860 return false;
1861 }
1862
1863
1865 {
1867 }
1868
1870 {
1871 return GetFoodStage().GetNextFoodStageType( cooking_method );
1872 }
1873
1875 {
1876 return GetFoodStage().GetFoodStageName( food_stage_type );
1877 }
1878
1880 {
1881 return GetFoodStage().CanChangeToNewStage( cooking_method );
1882 }
1883
1884
1886 {
1887 if ( !source.GetFoodStage())
1888 return;
1893 }
1894
1897 {
1900 }
1901
1904 {
1905 switch (stageNew)
1906 {
1911 break;
1912
1915 break;
1916 }
1917 }
1918
1919
1920
1921
1922
1924 {
1926 }
1927
1929 {
1931
1932
1934 }
1935
1937 {
1939 {
1942 }
1943 }
1944
1945
1947 {
1949 if (player)
1950 {
1952 player.ServerReplaceItemInHandsWithNew(lambda);
1953 }
1954 else
1955 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1956 }
1957
1959 {
1961 }
1962
1964 {
1965 super.SetActions();
1966
1969 }
1970
1972 {
1973 #ifndef SERVER
1975 {
1977
1980 }
1981 #endif
1982 }
1983
1985 {
1986 #ifndef SERVER
1988 {
1992 }
1993 #endif
1994 }
1995
1997 {
1998 return false;
1999 }
2000
2002 {
2004 }
2005
2006 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2007 {
2009
2010 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2012 if ( hasRootAsPlayer )
2014
2015
2016
2017
2018
2019
2020
2022 {
2023
2025 {
2027 {
2031 break;
2032
2036 break;
2037
2041 break;
2042
2046 default:
2049 return;
2050 }
2051
2052
2053 }
2054
2056
2058 {
2060 {
2061
2063 {
2065 }
2067 {
2070 {
2072 }
2073 else
2074 {
2076 {
2078 }
2079 else
2080 {
2082 }
2083 }
2084 }
2085 }
2086 }
2087
2088 }
2090 {
2091
2093 {
2095 {
2099 break;
2100
2104 break;
2105
2109 break;
2110
2114 break;
2115
2118 default:
2121 return;
2122 }
2123 }
2124
2126
2128 {
2130 {
2131
2133 {
2135 }
2136 }
2137 }
2138 }
2140 {
2141
2143 {
2145 {
2149 break;
2150
2153 default:
2156 return;
2157 }
2158 }
2159
2161
2163 {
2165 {
2166
2168 {
2170 }
2171 }
2172 }
2173 }
2174 else
2175 {
2176
2178
2180 {
2183
2184 }
2185 else
2186 {
2188 {
2191 }
2192 }
2193 }
2194 }
2195
2197 {
2198 if (
GetGame().IsDedicatedServer())
2199 return;
2200
2202 {
2204 GetInventory().GetCurrentInventoryLocation(invLoc);
2206 {
2208 if (ptcMgr)
2209 {
2214 }
2215 }
2216 }
2218 {
2220 {
2223 return;
2224 }
2225
2227 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2229 {
2232 }
2233 }
2234 }
2235
2236 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2237 {
2239 {
2244 }
2245
2246 super.GetDebugActions(outputList);
2247 }
2248
2250 {
2251 super.OnAction(action_id, player, ctx);
2252
2254 {
2255 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2256 {
2258 if (food_stage_prev <= 0)
2259 {
2261 }
2263 return true;
2264 }
2265 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2266 {
2269 {
2271 }
2273 return true;
2274 }
2275
2276 }
2277
2278 #ifdef DIAG_DEVELOPER
2279 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2280 {
2281 PrintNutritionsData();
2282 return true;
2283 }
2284 #endif
2285
2286 return false;
2287 }
2288
2290 {
2291 string debug_output;
2292
2293 debug_output = super.GetDebugText();
2294
2297
2298 return debug_output;
2299 }
2300
2301
2302
2303
2304
2306 {
2307 float ret = super.GetBaitEffectivity();
2308
2310 {
2311 ret *= 0.5;
2312 }
2313
2314 return ret;
2315 }
2316
2318 {
2320 }
2321
2323 {
2325 }
2326
2328 {
2330 }
2331
2332 #ifdef DIAG_DEVELOPER
2333 private void PrintNutritionsData()
2334 {
2335 string nutritionsData = "";
2336
2339
2341 if (profile)
2342 {
2343 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2345 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2349 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2351
2354
2355 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2357 }
2358
2359 nutritionsData += "-----\n";
2360
2362 }
2363 #endif
2364
2366
2369 {
2371 }
2372}
2373
2375{
2377};
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.