1301{
1303
1311
1321
1323
1325 {
1327 {
1329
1331 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1332
1336 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1337 }
1338 }
1339
1341 {
1343
1345 }
1346
1348 {
1349 super.EEDelete(parent);
1350
1352
1355 }
1356
1358 {
1359 super.EEItemLocationChanged(oldLoc, newLoc);
1360
1363 {
1364 switch (oldLoc.GetParent().GetType())
1365 {
1366 case "FryingPan":
1367 case "Pot":
1368 case "Cauldron":
1369 case "SharpWoodenStick":
1371 break;
1372 }
1373
1376 {
1378 }
1379 }
1380
1381 if (oldLoc.IsValid())
1383
1386 }
1387
1389 {
1392 }
1393
1395 {
1398
1399 return true;
1400 }
1401
1403 {
1405 {
1407 }
1408 }
1409
1412 {
1413 int foodStageType;
1414
1416 if (foodStage)
1417 foodStageType = foodStage.GetFoodStageType();
1418
1423
1424 return agentsIn;
1425 }
1426
1427
1429 {
1430 return false;
1431 }
1432
1434 {
1435 return false;
1436 }
1437
1439 {
1441 {
1443 {
1446
1449
1450 default:
1451 return super.GetTemperatureFreezeTime();
1452 }
1453 }
1454
1455 return super.GetTemperatureFreezeTime();
1456 }
1457
1459 {
1461 {
1463 {
1466
1469
1470 default:
1471 return super.GetTemperatureThawTime();
1472 }
1473 }
1474
1475 return super.GetTemperatureThawTime();
1476 }
1477
1479 {
1481 }
1482
1483
1484
1485
1487 {
1488 SetSynchDirty();
1489 }
1490
1492 {
1493 super.OnVariablesSynchronized();
1494
1495
1496
1497
1499 {
1501 }
1502 else
1503 {
1505 }
1506
1509 }
1510
1511
1512
1513
1515 {
1518
1520 }
1521
1523 {
1524 string soundName = "";
1525
1528
1530 {
1532 }
1533 else
1534 {
1536 {
1538 {
1543 else
1544 soundName = "";
1545 break;
1546 }
1547
1549 {
1554 else
1555 soundName = "";
1556 break;
1557 }
1558
1560 {
1565 else
1566 soundName = "";
1567 break;
1568 }
1569
1570 default:
1571 soundName = "";
1572 break;
1573 }
1574
1576 {
1577 if (soundName == "")
1578 {
1580 }
1581 else
1582 {
1584 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1585 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1587 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1588 {
1590 }
1591 }
1592 }
1593 }
1594
1596 }
1597
1599 {
1602 }
1603
1604
1605
1606
1608 {
1609 super.OnStoreSave(ctx);
1610
1612 {
1614 }
1615
1616
1619 }
1620
1622 {
1623 if (!super.OnStoreLoad(ctx, version))
1624 return false;
1625
1627 {
1629 return false;
1630 }
1631
1632 if (version >= 115)
1633 {
1635 {
1637 return false;
1638 }
1640 {
1642 return false;
1643 }
1644 }
1645
1648
1649 return true;
1650 }
1651
1653 {
1654 super.AfterStoreLoad();
1655
1657 }
1658
1659
1661 {
1663 }
1664
1665
1667 {
1668 return false;
1669 }
1670
1672 {
1673 return false;
1674 }
1675
1677 {
1678 return false;
1679 }
1680
1682 {
1683 return false;
1684 }
1685
1686
1687
1688
1689
1691 {
1694 {
1695 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1696 }
1697 else if (classname != "" && food_stage)
1698 {
1699 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1700 }
1701 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1703
1704 }
1705
1707 {
1710 {
1712 }
1713 else if (classname != "" && food_stage)
1714 {
1715 return FoodStage.GetEnergy(null, food_stage, classname);
1716 }
1717 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1719 }
1720
1722 {
1725 {
1727 }
1728 else if (classname != "" && food_stage)
1729 {
1730 return FoodStage.GetWater(null, food_stage, classname);
1731 }
1732 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1734 }
1735
1737 {
1740 {
1741 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1742 }
1743 else if (classname != "" && food_stage)
1744 {
1745 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1746 }
1747 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1749
1750 }
1751
1753 {
1756 {
1757 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1758 }
1759 else if (classname != "" && food_stage)
1760 {
1761 return FoodStage.GetToxicity(null, food_stage, classname);
1762 }
1763 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1765 }
1766
1768 {
1771 {
1773 }
1774 else if (classname != "" && food_stage)
1775 {
1776 return FoodStage.GetAgents(null, food_stage, classname);
1777 }
1778 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1780 }
1781
1783 {
1786 {
1787 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1788 }
1789 else if (classname != "" && food_stage)
1790 {
1791 return FoodStage.GetDigestibility(null, food_stage, classname);
1792 }
1793 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1795 }
1796
1798 {
1801 {
1802 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1803 }
1804 else if (className != "" && foodStage)
1805 {
1806 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1807 }
1808 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1810 }
1811
1813 {
1823
1824 return profile;
1825 }
1826
1827
1828
1829
1831 {
1833 }
1834
1835
1837 {
1839 {
1841 }
1842
1843 return false;
1844 }
1845
1847 {
1849 {
1851 }
1852
1853 return false;
1854 }
1855
1857 {
1859 {
1861 }
1862
1863 return false;
1864 }
1865
1867 {
1869 {
1871 }
1872
1873 return false;
1874 }
1875
1877 {
1879 {
1881 }
1882
1883 return false;
1884 }
1885
1887 {
1889 {
1891 }
1892
1893 return false;
1894 }
1895
1896
1898 {
1900 }
1901
1903 {
1904 return GetFoodStage().GetNextFoodStageType( cooking_method );
1905 }
1906
1908 {
1909 return GetFoodStage().GetFoodStageName( food_stage_type );
1910 }
1911
1913 {
1914 return GetFoodStage().CanChangeToNewStage( cooking_method );
1915 }
1916
1917
1919 {
1920 if ( !source.GetFoodStage())
1921 return;
1926 }
1927
1930 {
1933 }
1934
1937 {
1938 switch (stageNew)
1939 {
1944 break;
1945
1948 break;
1949 }
1950 }
1951
1952
1953
1954
1955
1957 {
1959 }
1960
1962 {
1964
1965
1967 }
1968
1970 {
1972 {
1975 }
1976 }
1977
1978
1980 {
1982 if (player)
1983 {
1985 player.ServerReplaceItemInHandsWithNew(lambda);
1986 }
1987 else
1988 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1989 }
1990
1992 {
1994 }
1995
1997 {
1998 super.SetActions();
1999
2002 }
2003
2005 {
2006 #ifndef SERVER
2008 {
2010
2013 }
2014 #endif
2015 }
2016
2018 {
2019 #ifndef SERVER
2021 {
2025 }
2026 #endif
2027 }
2028
2030 {
2031 return false;
2032 }
2033
2035 {
2037 }
2038
2039 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2040 {
2042
2043 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2045 if ( hasRootAsPlayer )
2047
2048
2049
2050
2051
2052
2053
2055 {
2056
2058 {
2060 {
2064 break;
2065
2069 break;
2070
2074 break;
2075
2079 default:
2082 return;
2083 }
2084
2085
2086 }
2087
2089
2091 {
2093 {
2094
2096 {
2098 }
2100 {
2103 {
2105 }
2106 else
2107 {
2109 {
2111 }
2112 else
2113 {
2115 }
2116 }
2117 }
2118 }
2119 }
2120
2121 }
2123 {
2124
2126 {
2128 {
2132 break;
2133
2137 break;
2138
2142 break;
2143
2147 break;
2148
2151 default:
2154 return;
2155 }
2156 }
2157
2159
2161 {
2163 {
2164
2166 {
2168 }
2169 }
2170 }
2171 }
2173 {
2174
2176 {
2178 {
2182 break;
2183
2186 default:
2189 return;
2190 }
2191 }
2192
2194
2196 {
2198 {
2199
2201 {
2203 }
2204 }
2205 }
2206 }
2207 else
2208 {
2209
2211
2213 {
2216
2217 }
2218 else
2219 {
2221 {
2224 }
2225 }
2226 }
2227 }
2228
2230 {
2231 if (
GetGame().IsDedicatedServer())
2232 return;
2233
2235 {
2237 GetInventory().GetCurrentInventoryLocation(invLoc);
2239 {
2241 if (ptcMgr)
2242 {
2247 }
2248 }
2249 }
2251 {
2253 {
2256 return;
2257 }
2258
2260 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2262 {
2265 }
2266 }
2267 }
2268
2269 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2270 {
2272 {
2277 }
2278
2279 super.GetDebugActions(outputList);
2280 }
2281
2283 {
2284 super.OnAction(action_id, player, ctx);
2285
2287 {
2288 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2289 {
2291 if (food_stage_prev <= 0)
2292 {
2294 }
2296 return true;
2297 }
2298 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2299 {
2302 {
2304 }
2306 return true;
2307 }
2308
2309 }
2310
2311 #ifdef DIAG_DEVELOPER
2312 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2313 {
2314 PrintNutritionsData();
2315 return true;
2316 }
2317 #endif
2318
2319 return false;
2320 }
2321
2323 {
2324 string debug_output;
2325
2326 debug_output = super.GetDebugText();
2327
2330
2331 return debug_output;
2332 }
2333
2334
2335
2336
2337
2339 {
2340 float ret = super.GetBaitEffectivity();
2341
2343 {
2344 ret *= 0.5;
2345 }
2346
2347 return ret;
2348 }
2349
2351 {
2353 }
2354
2356 {
2358 }
2359
2361 {
2363 }
2364
2365 #ifdef DIAG_DEVELOPER
2366 private void PrintNutritionsData()
2367 {
2368 string nutritionsData = "";
2369
2372
2374 if (profile)
2375 {
2376 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2378 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2382 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2384
2387
2388 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2390 }
2391
2392 nutritionsData += "-----\n";
2393
2395 }
2396 #endif
2397
2399
2402 {
2404 }
2405}
2406
2408{
2410};
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.