1408{
1410
1418
1428
1430
1432 {
1434 {
1436
1438 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1439
1443 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1444 }
1445 }
1446
1448 {
1450
1452 }
1453
1455 {
1456 super.EEDelete(parent);
1457
1459
1462 }
1463
1465 {
1466 super.EEItemLocationChanged(oldLoc, newLoc);
1467
1470 {
1471 switch (oldLoc.GetParent().GetType())
1472 {
1473 case "FryingPan":
1474 case "Pot":
1475 case "Cauldron":
1476 case "SharpWoodenStick":
1478 break;
1479 }
1480
1483 {
1485 }
1486 }
1487
1488 if (oldLoc.IsValid())
1490
1493 }
1494
1496 {
1499 }
1500
1502 {
1505
1506 return true;
1507 }
1508
1510 {
1512 {
1514 }
1515 }
1516
1519 {
1520 int foodStageType;
1521
1523 if (foodStage)
1524 foodStageType = foodStage.GetFoodStageType();
1525
1530
1531 return agentsIn;
1532 }
1533
1534
1536 {
1537 return false;
1538 }
1539
1541 {
1542 return false;
1543 }
1544
1546 {
1548 {
1550 {
1553
1556
1557 default:
1558 return super.GetTemperatureFreezeTime();
1559 }
1560 }
1561
1562 return super.GetTemperatureFreezeTime();
1563 }
1564
1566 {
1568 {
1570 {
1573
1576
1577 default:
1578 return super.GetTemperatureThawTime();
1579 }
1580 }
1581
1582 return super.GetTemperatureThawTime();
1583 }
1584
1586 {
1588 }
1589
1590
1591
1592
1594 {
1595 SetSynchDirty();
1596 }
1597
1599 {
1600 super.OnVariablesSynchronized();
1601
1602
1603
1604
1606 {
1608 }
1609 else
1610 {
1612 }
1613
1616 }
1617
1618
1619
1620
1622 {
1625
1627 }
1628
1630 {
1631 string soundName = "";
1632
1635
1637 {
1639 }
1640 else
1641 {
1643 {
1645 {
1650 else
1651 soundName = "";
1652 break;
1653 }
1654
1656 {
1661 else
1662 soundName = "";
1663 break;
1664 }
1665
1667 {
1672 else
1673 soundName = "";
1674 break;
1675 }
1676
1677 default:
1678 soundName = "";
1679 break;
1680 }
1681
1683 {
1684 if (soundName == "")
1685 {
1687 }
1688 else
1689 {
1691 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1692 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1694 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1695 {
1697 }
1698 }
1699 }
1700 }
1701
1703 }
1704
1706 {
1709 }
1710
1711
1712
1713
1715 {
1716 super.OnStoreSave(ctx);
1717
1719 {
1721 }
1722
1723
1726 }
1727
1729 {
1730 if (!super.OnStoreLoad(ctx, version))
1731 return false;
1732
1734 {
1736 return false;
1737 }
1738
1739 if (version >= 115)
1740 {
1742 {
1744 return false;
1745 }
1747 {
1749 return false;
1750 }
1751 }
1752
1755
1756 return true;
1757 }
1758
1760 {
1761 super.AfterStoreLoad();
1762
1764 }
1765
1766
1768 {
1770 }
1771
1772
1774 {
1775 return false;
1776 }
1777
1779 {
1780 return false;
1781 }
1782
1784 {
1785 return false;
1786 }
1787
1789 {
1790 return false;
1791 }
1792
1793
1794
1795
1796
1798 {
1801 {
1802 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1803 }
1804 else if (classname != "" && food_stage)
1805 {
1806 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1807 }
1808 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1810
1811 }
1812
1814 {
1817 {
1819 }
1820 else if (classname != "" && food_stage)
1821 {
1822 return FoodStage.GetEnergy(null, food_stage, classname);
1823 }
1824 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1826 }
1827
1829 {
1832 {
1834 }
1835 else if (classname != "" && food_stage)
1836 {
1837 return FoodStage.GetWater(null, food_stage, classname);
1838 }
1839 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1841 }
1842
1844 {
1847 {
1848 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1849 }
1850 else if (classname != "" && food_stage)
1851 {
1852 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1853 }
1854 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1856
1857 }
1858
1860 {
1863 {
1864 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1865 }
1866 else if (classname != "" && food_stage)
1867 {
1868 return FoodStage.GetToxicity(null, food_stage, classname);
1869 }
1870 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1872 }
1873
1875 {
1878 {
1880 }
1881 else if (classname != "" && food_stage)
1882 {
1883 return FoodStage.GetAgents(null, food_stage, classname);
1884 }
1885 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1887 }
1888
1890 {
1893 {
1894 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1895 }
1896 else if (classname != "" && food_stage)
1897 {
1898 return FoodStage.GetDigestibility(null, food_stage, classname);
1899 }
1900 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1902 }
1903
1905 {
1908 {
1909 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1910 }
1911 else if (className != "" && foodStage)
1912 {
1913 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1914 }
1915 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1917 }
1918
1920 {
1930
1931 return profile;
1932 }
1933
1934
1935
1936
1938 {
1940 }
1941
1942
1944 {
1946 {
1948 }
1949
1950 return false;
1951 }
1952
1954 {
1956 {
1958 }
1959
1960 return false;
1961 }
1962
1964 {
1966 {
1968 }
1969
1970 return false;
1971 }
1972
1974 {
1976 {
1978 }
1979
1980 return false;
1981 }
1982
1984 {
1986 {
1988 }
1989
1990 return false;
1991 }
1992
1994 {
1996 {
1998 }
1999
2000 return false;
2001 }
2002
2003
2005 {
2007 }
2008
2010 {
2011 return GetFoodStage().GetNextFoodStageType( cooking_method );
2012 }
2013
2015 {
2016 return GetFoodStage().GetFoodStageName( food_stage_type );
2017 }
2018
2020 {
2021 return GetFoodStage().CanChangeToNewStage( cooking_method );
2022 }
2023
2024
2026 {
2027 if ( !source.GetFoodStage())
2028 return;
2033 }
2034
2037 {
2040 }
2041
2044 {
2045 switch (stageNew)
2046 {
2051 break;
2052
2055 break;
2056 }
2057 }
2058
2059
2060
2061
2062
2064 {
2066 }
2067
2069 {
2071
2072
2074 }
2075
2077 {
2079 {
2082 }
2083 }
2084
2085
2087 {
2089 if (player)
2090 {
2092 player.ServerReplaceItemInHandsWithNew(lambda);
2093 }
2094 else
2095 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2096 }
2097
2099 {
2101 }
2102
2104 {
2105 super.SetActions();
2106
2109 }
2110
2112 {
2113 #ifndef SERVER
2115 {
2117
2120 }
2121 #endif
2122 }
2123
2125 {
2126 #ifndef SERVER
2128 {
2132 }
2133 #endif
2134 }
2135
2137 {
2138 return false;
2139 }
2140
2142 {
2144 }
2145
2146 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2147 {
2149
2150 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2152 if ( hasRootAsPlayer )
2154
2155
2156
2157
2158
2159
2160
2162 {
2163
2165 {
2167 {
2171 break;
2172
2176 break;
2177
2181 break;
2182
2186 default:
2189 return;
2190 }
2191
2192
2193 }
2194
2196
2198 {
2200 {
2201
2203 {
2205 }
2207 {
2210 {
2212 }
2213 else
2214 {
2216 {
2218 }
2219 else
2220 {
2222 }
2223 }
2224 }
2225 }
2226 }
2227
2228 }
2230 {
2231
2233 {
2235 {
2239 break;
2240
2244 break;
2245
2249 break;
2250
2254 break;
2255
2258 default:
2261 return;
2262 }
2263 }
2264
2266
2268 {
2270 {
2271
2273 {
2275 }
2276 }
2277 }
2278 }
2280 {
2281
2283 {
2285 {
2289 break;
2290
2293 default:
2296 return;
2297 }
2298 }
2299
2301
2303 {
2305 {
2306
2308 {
2310 }
2311 }
2312 }
2313 }
2314 else
2315 {
2316
2318
2320 {
2323
2324 }
2325 else
2326 {
2328 {
2331 }
2332 }
2333 }
2334 }
2335
2337 {
2338 if (
GetGame().IsDedicatedServer())
2339 return;
2340
2342 {
2344 GetInventory().GetCurrentInventoryLocation(invLoc);
2346 {
2348 if (ptcMgr)
2349 {
2354 }
2355 }
2356 }
2358 {
2360 {
2363 return;
2364 }
2365
2367 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2369 {
2372 }
2373 }
2374 }
2375
2376 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2377 {
2379 {
2384 }
2385
2386 super.GetDebugActions(outputList);
2387 }
2388
2390 {
2391 super.OnAction(action_id, player, ctx);
2392
2394 {
2395 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2396 {
2398 if (food_stage_prev <= 0)
2399 {
2401 }
2403 return true;
2404 }
2405 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2406 {
2409 {
2411 }
2413 return true;
2414 }
2415
2416 }
2417
2418 #ifdef DIAG_DEVELOPER
2419 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2420 {
2421 PrintNutritionsData();
2422 return true;
2423 }
2424 #endif
2425
2426 return false;
2427 }
2428
2430 {
2431 string debug_output;
2432
2433 debug_output = super.GetDebugText();
2434
2437
2438 return debug_output;
2439 }
2440
2441
2442
2443
2444
2446 {
2447 float ret = super.GetBaitEffectivity();
2448
2450 {
2451 ret *= 0.5;
2452 }
2453
2454 return ret;
2455 }
2456
2458 {
2460 }
2461
2463 {
2465 }
2466
2468 {
2470 }
2471
2472 #ifdef DIAG_DEVELOPER
2473 private void PrintNutritionsData()
2474 {
2475 string nutritionsData = "";
2476
2479
2481 if (profile)
2482 {
2483 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2485 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2489 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2491
2494
2495 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2497 }
2498
2499 nutritionsData += "-----\n";
2500
2502 }
2503 #endif
2504
2506
2509 {
2511 }
2512}
2513
2515{
2517};
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.