1562{
1564
1572
1582
1584
1586 {
1588 {
1590
1592 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1593
1597 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1598 }
1599 }
1600
1602 {
1604
1606 }
1607
1609 {
1610 super.EEDelete(parent);
1611
1613
1616 }
1617
1619 {
1620 super.EEItemLocationChanged(oldLoc, newLoc);
1621
1624 {
1625 switch (oldLoc.GetParent().GetType())
1626 {
1627 case "FryingPan":
1628 case "Pot":
1629 case "Cauldron":
1630 case "SharpWoodenStick":
1632 break;
1633 }
1634
1637 {
1639 }
1640 }
1641
1642 if (oldLoc.IsValid())
1644
1647 }
1648
1650 {
1653 }
1654
1656 {
1659
1660 return true;
1661 }
1662
1664 {
1666 {
1668 }
1669 }
1670
1673 {
1674 int foodStageType;
1675
1677 if (foodStage)
1678 foodStageType = foodStage.GetFoodStageType();
1679
1684
1685 return agentsIn;
1686 }
1687
1688
1690 {
1691 return false;
1692 }
1693
1695 {
1696 return false;
1697 }
1698
1700 {
1702 {
1704 {
1707
1710
1711 default:
1712 return super.GetTemperatureFreezeTime();
1713 }
1714 }
1715
1716 return super.GetTemperatureFreezeTime();
1717 }
1718
1720 {
1722 {
1724 {
1727
1730
1731 default:
1732 return super.GetTemperatureThawTime();
1733 }
1734 }
1735
1736 return super.GetTemperatureThawTime();
1737 }
1738
1740 {
1742 }
1743
1744
1745
1746
1748 {
1749 SetSynchDirty();
1750 }
1751
1753 {
1754 super.OnVariablesSynchronized();
1755
1756
1757
1758
1760 {
1762 }
1763 else
1764 {
1766 }
1767
1770 }
1771
1772
1773
1774
1776 {
1779
1781 }
1782
1784 {
1785 string soundName = "";
1786
1789
1791 {
1793 }
1794 else
1795 {
1797 {
1799 {
1804 else
1805 soundName = "";
1806 break;
1807 }
1808
1810 {
1815 else
1816 soundName = "";
1817 break;
1818 }
1819
1821 {
1826 else
1827 soundName = "";
1828 break;
1829 }
1830
1831 default:
1832 soundName = "";
1833 break;
1834 }
1835
1837 {
1838 if (soundName == "")
1839 {
1841 }
1842 else
1843 {
1845 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1846 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1848 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1849 {
1851 }
1852 }
1853 }
1854 }
1855
1857 }
1858
1860 {
1863 }
1864
1865
1866
1867
1869 {
1870 super.OnStoreSave(ctx);
1871
1873 {
1875 }
1876
1877
1880 }
1881
1883 {
1884 if (!super.OnStoreLoad(ctx, version))
1885 return false;
1886
1888 {
1890 return false;
1891 }
1892
1893 if (version >= 115)
1894 {
1896 {
1898 return false;
1899 }
1901 {
1903 return false;
1904 }
1905 }
1906
1909
1910 return true;
1911 }
1912
1914 {
1915 super.AfterStoreLoad();
1916
1918 }
1919
1920
1922 {
1924 }
1925
1926
1928 {
1929 return false;
1930 }
1931
1933 {
1934 return false;
1935 }
1936
1938 {
1939 return false;
1940 }
1941
1943 {
1944 return false;
1945 }
1946
1947
1948
1949
1950
1952 {
1955 {
1956 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1957 }
1958 else if (classname != "" && food_stage)
1959 {
1960 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1961 }
1962 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1964
1965 }
1966
1968 {
1971 {
1973 }
1974 else if (classname != "" && food_stage)
1975 {
1976 return FoodStage.GetEnergy(null, food_stage, classname);
1977 }
1978 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1980 }
1981
1983 {
1986 {
1988 }
1989 else if (classname != "" && food_stage)
1990 {
1991 return FoodStage.GetWater(null, food_stage, classname);
1992 }
1993 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1995 }
1996
1998 {
2001 {
2002 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2003 }
2004 else if (classname != "" && food_stage)
2005 {
2006 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2007 }
2008 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2010
2011 }
2012
2014 {
2017 {
2018 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2019 }
2020 else if (classname != "" && food_stage)
2021 {
2022 return FoodStage.GetToxicity(null, food_stage, classname);
2023 }
2024 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2026 }
2027
2029 {
2032 {
2034 }
2035 else if (classname != "" && food_stage)
2036 {
2037 return FoodStage.GetAgents(null, food_stage, classname);
2038 }
2039 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2041 }
2042
2044 {
2047 {
2048 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2049 }
2050 else if (classname != "" && food_stage)
2051 {
2052 return FoodStage.GetDigestibility(null, food_stage, classname);
2053 }
2054 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2056 }
2057
2059 {
2062 {
2063 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2064 }
2065 else if (className != "" && foodStage)
2066 {
2067 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2068 }
2069 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2071 }
2072
2074 {
2084
2085 return profile;
2086 }
2087
2088
2089
2090
2092 {
2094 }
2095
2096
2098 {
2100 {
2102 }
2103
2104 return false;
2105 }
2106
2108 {
2110 {
2112 }
2113
2114 return false;
2115 }
2116
2118 {
2120 {
2122 }
2123
2124 return false;
2125 }
2126
2128 {
2130 {
2132 }
2133
2134 return false;
2135 }
2136
2138 {
2140 {
2142 }
2143
2144 return false;
2145 }
2146
2148 {
2150 {
2152 }
2153
2154 return false;
2155 }
2156
2157
2159 {
2161 }
2162
2164 {
2165 return GetFoodStage().GetNextFoodStageType( cooking_method );
2166 }
2167
2169 {
2170 return GetFoodStage().GetFoodStageName( food_stage_type );
2171 }
2172
2174 {
2175 return GetFoodStage().CanChangeToNewStage( cooking_method );
2176 }
2177
2178
2180 {
2181 if ( !source.GetFoodStage())
2182 return;
2187 }
2188
2191 {
2194 }
2195
2198 {
2199 switch (stageNew)
2200 {
2205 break;
2206
2209 break;
2210 }
2211 }
2212
2213
2214
2215
2216
2218 {
2220 }
2221
2223 {
2225
2226
2228 }
2229
2231 {
2233 {
2236 }
2237 }
2238
2239
2241 {
2243 if (player)
2244 {
2246 player.ServerReplaceItemInHandsWithNew(lambda);
2247 }
2248 else
2249 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2250 }
2251
2253 {
2255 }
2256
2258 {
2259 super.SetActions();
2260
2263 }
2264
2266 {
2267 #ifndef SERVER
2269 {
2271
2274 }
2275 #endif
2276 }
2277
2279 {
2280 #ifndef SERVER
2282 {
2286 }
2287 #endif
2288 }
2289
2291 {
2292 return false;
2293 }
2294
2296 {
2298 }
2299
2300 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2301 {
2303
2304 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2306 if ( hasRootAsPlayer )
2308
2309
2310
2311
2312
2313
2314
2316 {
2317
2319 {
2321 {
2325 break;
2326
2330 break;
2331
2335 break;
2336
2340 default:
2343 return;
2344 }
2345
2346
2347 }
2348
2350
2352 {
2354 {
2355
2357 {
2359 }
2361 {
2364 {
2366 }
2367 else
2368 {
2370 {
2372 }
2373 else
2374 {
2376 }
2377 }
2378 }
2379 }
2380 }
2381
2382 }
2384 {
2385
2387 {
2389 {
2393 break;
2394
2398 break;
2399
2403 break;
2404
2408 break;
2409
2412 default:
2415 return;
2416 }
2417 }
2418
2420
2422 {
2424 {
2425
2427 {
2429 }
2430 }
2431 }
2432 }
2434 {
2435
2437 {
2439 {
2443 break;
2444
2447 default:
2450 return;
2451 }
2452 }
2453
2455
2457 {
2459 {
2460
2462 {
2464 }
2465 }
2466 }
2467 }
2468 else
2469 {
2470
2472
2474 {
2477
2478 }
2479 else
2480 {
2482 {
2485 }
2486 }
2487 }
2488 }
2489
2491 {
2492 if (
GetGame().IsDedicatedServer())
2493 return;
2494
2496 {
2498 GetInventory().GetCurrentInventoryLocation(invLoc);
2500 {
2502 if (ptcMgr)
2503 {
2508 }
2509 }
2510 }
2512 {
2514 {
2517 return;
2518 }
2519
2521 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2523 {
2526 }
2527 }
2528 }
2529
2530 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2531 {
2533 {
2538 }
2539
2540 super.GetDebugActions(outputList);
2541 }
2542
2544 {
2545 super.OnAction(action_id, player, ctx);
2546
2548 {
2549 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2550 {
2552 if (food_stage_prev <= 0)
2553 {
2555 }
2557 return true;
2558 }
2559 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2560 {
2563 {
2565 }
2567 return true;
2568 }
2569
2570 }
2571
2572 #ifdef DIAG_DEVELOPER
2573 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2574 {
2575 PrintNutritionsData();
2576 return true;
2577 }
2578 #endif
2579
2580 return false;
2581 }
2582
2584 {
2585 string debug_output;
2586
2587 debug_output = super.GetDebugText();
2588
2591
2592 return debug_output;
2593 }
2594
2595
2596
2597
2598
2600 {
2601 float ret = super.GetBaitEffectivity();
2602
2604 {
2605 ret *= 0.5;
2606 }
2607
2608 return ret;
2609 }
2610
2612 {
2614 }
2615
2617 {
2619 }
2620
2622 {
2624 }
2625
2626 #ifdef DIAG_DEVELOPER
2627 private void PrintNutritionsData()
2628 {
2629 string nutritionsData = "";
2630
2633
2635 if (profile)
2636 {
2637 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2639 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2643 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2645
2648
2649 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2651 }
2652
2653 nutritionsData += "-----\n";
2654
2656 }
2657 #endif
2658
2660
2663 {
2665 }
2666}
2667
2669{
2671};
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.