1204{
1206
1214
1224
1226
1228 {
1230 {
1232
1234 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1235
1239 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1240 }
1241 }
1242
1244 {
1246
1248 }
1249
1251 {
1252 super.EEDelete(parent);
1253
1255
1258 }
1259
1261 {
1262 super.EEItemLocationChanged(oldLoc, newLoc);
1263
1266 {
1267 switch (oldLoc.GetParent().GetType())
1268 {
1269 case "FryingPan":
1270 case "Pot":
1271 case "Cauldron":
1272 case "SharpWoodenStick":
1274 break;
1275 }
1276
1279 {
1281 }
1282 }
1283
1284 if (oldLoc.IsValid())
1286
1289 }
1290
1292 {
1295 }
1296
1298 {
1301
1302 return true;
1303 }
1304
1306 {
1308 {
1310 }
1311 }
1312
1315 {
1316 int foodStageType;
1317
1319 if (foodStage)
1320 foodStageType = foodStage.GetFoodStageType();
1321
1326
1327 return agentsIn;
1328 }
1329
1330
1332 {
1333 return false;
1334 }
1335
1337 {
1338 return false;
1339 }
1340
1342 {
1344 {
1346 {
1349
1352
1353 default:
1354 return super.GetTemperatureFreezeTime();
1355 }
1356 }
1357
1358 return super.GetTemperatureFreezeTime();
1359 }
1360
1362 {
1364 {
1366 {
1369
1372
1373 default:
1374 return super.GetTemperatureThawTime();
1375 }
1376 }
1377
1378 return super.GetTemperatureThawTime();
1379 }
1380
1382 {
1384 }
1385
1386
1387
1388
1390 {
1391 SetSynchDirty();
1392 }
1393
1395 {
1396 super.OnVariablesSynchronized();
1397
1398
1399
1400
1402 {
1404 }
1405 else
1406 {
1408 }
1409
1412 }
1413
1414
1415
1416
1418 {
1421
1423 }
1424
1426 {
1427 string soundName = "";
1428
1431
1433 {
1435 }
1436 else
1437 {
1439 {
1441 {
1446 else
1447 soundName = "";
1448 break;
1449 }
1450
1452 {
1457 else
1458 soundName = "";
1459 break;
1460 }
1461
1463 {
1468 else
1469 soundName = "";
1470 break;
1471 }
1472
1473 default:
1474 soundName = "";
1475 break;
1476 }
1477
1479 {
1480 if (soundName == "")
1481 {
1483 }
1484 else
1485 {
1487 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1488 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1490 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1491 {
1493 }
1494 }
1495 }
1496 }
1497
1499 }
1500
1502 {
1505 }
1506
1507
1508
1509
1511 {
1512 super.OnStoreSave(ctx);
1513
1515 {
1517 }
1518
1519
1522 }
1523
1525 {
1526 if (!super.OnStoreLoad(ctx, version))
1527 return false;
1528
1530 {
1532 return false;
1533 }
1534
1535 if (version >= 115)
1536 {
1538 {
1540 return false;
1541 }
1543 {
1545 return false;
1546 }
1547 }
1548
1551
1552 return true;
1553 }
1554
1556 {
1557 super.AfterStoreLoad();
1558
1560 }
1561
1562
1564 {
1566 }
1567
1568
1570 {
1571 return false;
1572 }
1573
1575 {
1576 return false;
1577 }
1578
1580 {
1581 return false;
1582 }
1583
1585 {
1586 return false;
1587 }
1588
1589
1590
1591
1592
1594 {
1597 {
1598 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1599 }
1600 else if (classname != "" && food_stage)
1601 {
1602 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1603 }
1604 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1606
1607 }
1608
1610 {
1613 {
1615 }
1616 else if (classname != "" && food_stage)
1617 {
1618 return FoodStage.GetEnergy(null, food_stage, classname);
1619 }
1620 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1622 }
1623
1625 {
1628 {
1630 }
1631 else if (classname != "" && food_stage)
1632 {
1633 return FoodStage.GetWater(null, food_stage, classname);
1634 }
1635 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1637 }
1638
1640 {
1643 {
1644 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1645 }
1646 else if (classname != "" && food_stage)
1647 {
1648 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1649 }
1650 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1652
1653 }
1654
1656 {
1659 {
1660 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1661 }
1662 else if (classname != "" && food_stage)
1663 {
1664 return FoodStage.GetToxicity(null, food_stage, classname);
1665 }
1666 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1668 }
1669
1671 {
1674 {
1676 }
1677 else if (classname != "" && food_stage)
1678 {
1679 return FoodStage.GetAgents(null, food_stage, classname);
1680 }
1681 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1683 }
1684
1686 {
1689 {
1690 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1691 }
1692 else if (classname != "" && food_stage)
1693 {
1694 return FoodStage.GetDigestibility(null, food_stage, classname);
1695 }
1696 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1698 }
1699
1701 {
1704 {
1705 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1706 }
1707 else if (className != "" && foodStage)
1708 {
1709 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1710 }
1711 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1713 }
1714
1716 {
1726
1727 return profile;
1728 }
1729
1730
1731
1732
1734 {
1736 }
1737
1738
1740 {
1742 {
1744 }
1745
1746 return false;
1747 }
1748
1750 {
1752 {
1754 }
1755
1756 return false;
1757 }
1758
1760 {
1762 {
1764 }
1765
1766 return false;
1767 }
1768
1770 {
1772 {
1774 }
1775
1776 return false;
1777 }
1778
1780 {
1782 {
1784 }
1785
1786 return false;
1787 }
1788
1790 {
1792 {
1794 }
1795
1796 return false;
1797 }
1798
1799
1801 {
1803 }
1804
1806 {
1807 return GetFoodStage().GetNextFoodStageType( cooking_method );
1808 }
1809
1811 {
1812 return GetFoodStage().GetFoodStageName( food_stage_type );
1813 }
1814
1816 {
1817 return GetFoodStage().CanChangeToNewStage( cooking_method );
1818 }
1819
1820
1822 {
1823 if ( !source.GetFoodStage())
1824 return;
1829 }
1830
1833 {
1836 }
1837
1840 {
1841 switch (stageNew)
1842 {
1847 break;
1848
1851 break;
1852 }
1853 }
1854
1855
1856
1857
1858
1860 {
1862 }
1863
1865 {
1867
1868
1870 }
1871
1873 {
1875 {
1878 }
1879 }
1880
1881
1883 {
1885 if (player)
1886 {
1888 player.ServerReplaceItemInHandsWithNew(lambda);
1889 }
1890 else
1891 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1892 }
1893
1895 {
1897 }
1898
1900 {
1901 super.SetActions();
1902
1905 }
1906
1908 {
1909 #ifndef SERVER
1911 {
1913
1916 }
1917 #endif
1918 }
1919
1921 {
1922 #ifndef SERVER
1924 {
1928 }
1929 #endif
1930 }
1931
1933 {
1934 return false;
1935 }
1936
1938 {
1940 }
1941
1942 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
1943 {
1945
1946 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
1948 if ( hasRootAsPlayer )
1950
1951
1952
1953
1954
1955
1956
1958 {
1959
1961 {
1963 {
1967 break;
1968
1972 break;
1973
1977 break;
1978
1982 default:
1985 return;
1986 }
1987
1988
1989 }
1990
1992
1994 {
1996 {
1997
1999 {
2001 }
2003 {
2006 {
2008 }
2009 else
2010 {
2012 {
2014 }
2015 else
2016 {
2018 }
2019 }
2020 }
2021 }
2022 }
2023
2024 }
2026 {
2027
2029 {
2031 {
2035 break;
2036
2040 break;
2041
2045 break;
2046
2050 break;
2051
2054 default:
2057 return;
2058 }
2059 }
2060
2062
2064 {
2066 {
2067
2069 {
2071 }
2072 }
2073 }
2074 }
2076 {
2077
2079 {
2081 {
2085 break;
2086
2089 default:
2092 return;
2093 }
2094 }
2095
2097
2099 {
2101 {
2102
2104 {
2106 }
2107 }
2108 }
2109 }
2110 else
2111 {
2112
2114
2116 {
2119
2120 }
2121 else
2122 {
2124 {
2127 }
2128 }
2129 }
2130 }
2131
2133 {
2134 if (
GetGame().IsDedicatedServer())
2135 return;
2136
2138 {
2140 GetInventory().GetCurrentInventoryLocation(invLoc);
2142 {
2144 if (ptcMgr)
2145 {
2150 }
2151 }
2152 }
2154 {
2156 {
2159 return;
2160 }
2161
2163 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2165 {
2168 }
2169 }
2170 }
2171
2172 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2173 {
2175 {
2180 }
2181
2182 super.GetDebugActions(outputList);
2183 }
2184
2186 {
2187 super.OnAction(action_id, player, ctx);
2188
2190 {
2191 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2192 {
2194 if (food_stage_prev <= 0)
2195 {
2197 }
2199 return true;
2200 }
2201 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2202 {
2205 {
2207 }
2209 return true;
2210 }
2211
2212 }
2213
2214 #ifdef DIAG_DEVELOPER
2215 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2216 {
2217 PrintNutritionsData();
2218 return true;
2219 }
2220 #endif
2221
2222 return false;
2223 }
2224
2226 {
2227 string debug_output;
2228
2229 debug_output = super.GetDebugText();
2230
2233
2234 return debug_output;
2235 }
2236
2237
2238
2239
2240
2242 {
2243 float ret = super.GetBaitEffectivity();
2244
2246 {
2247 ret *= 0.5;
2248 }
2249
2250 return ret;
2251 }
2252
2254 {
2256 }
2257
2259 {
2261 }
2262
2264 {
2266 }
2267
2268 #ifdef DIAG_DEVELOPER
2269 private void PrintNutritionsData()
2270 {
2271 string nutritionsData = "";
2272
2275
2277 if (profile)
2278 {
2279 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2281 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2285 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2287
2290
2291 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2293 }
2294
2295 nutritionsData += "-----\n";
2296
2298 }
2299 #endif
2300
2302
2305 {
2307 }
2308}
2309
2311{
2313};
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.