1561{
1563
1571
1581
1583
1585 {
1587 {
1589
1591 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1592
1596 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1597 }
1598 }
1599
1601 {
1603
1605 }
1606
1608 {
1609 super.EEDelete(parent);
1610
1612
1615 }
1616
1618 {
1619 super.EEItemLocationChanged(oldLoc, newLoc);
1620
1623 {
1624 switch (oldLoc.GetParent().GetType())
1625 {
1626 case "FryingPan":
1627 case "Pot":
1628 case "Cauldron":
1629 case "SharpWoodenStick":
1631 break;
1632 }
1633
1636 {
1638 }
1639 }
1640
1641 if (oldLoc.IsValid())
1643
1646 }
1647
1649 {
1652 }
1653
1655 {
1658
1659 return true;
1660 }
1661
1663 {
1665 {
1667 }
1668 }
1669
1672 {
1673 int foodStageType;
1674
1676 if (foodStage)
1677 foodStageType = foodStage.GetFoodStageType();
1678
1683
1684 return agentsIn;
1685 }
1686
1687
1689 {
1690 return false;
1691 }
1692
1694 {
1695 return false;
1696 }
1697
1699 {
1701 {
1703 {
1706
1709
1710 default:
1711 return super.GetTemperatureFreezeTime();
1712 }
1713 }
1714
1715 return super.GetTemperatureFreezeTime();
1716 }
1717
1719 {
1721 {
1723 {
1726
1729
1730 default:
1731 return super.GetTemperatureThawTime();
1732 }
1733 }
1734
1735 return super.GetTemperatureThawTime();
1736 }
1737
1739 {
1741 }
1742
1743
1744
1745
1747 {
1748 SetSynchDirty();
1749 }
1750
1752 {
1753 super.OnVariablesSynchronized();
1754
1755
1756
1757
1759 {
1761 }
1762 else
1763 {
1765 }
1766
1769 }
1770
1771
1772
1773
1775 {
1778
1780 }
1781
1783 {
1784 string soundName = "";
1785
1788
1790 {
1792 }
1793 else
1794 {
1796 {
1798 {
1803 else
1804 soundName = "";
1805 break;
1806 }
1807
1809 {
1814 else
1815 soundName = "";
1816 break;
1817 }
1818
1820 {
1825 else
1826 soundName = "";
1827 break;
1828 }
1829
1830 default:
1831 soundName = "";
1832 break;
1833 }
1834
1836 {
1837 if (soundName == "")
1838 {
1840 }
1841 else
1842 {
1844 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1845 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1847 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1848 {
1850 }
1851 }
1852 }
1853 }
1854
1856 }
1857
1859 {
1862 }
1863
1864
1865
1866
1868 {
1869 super.OnStoreSave(ctx);
1870
1872 {
1874 }
1875
1876
1879 }
1880
1882 {
1883 if (!super.OnStoreLoad(ctx, version))
1884 return false;
1885
1887 {
1889 return false;
1890 }
1891
1892 if (version >= 115)
1893 {
1895 {
1897 return false;
1898 }
1900 {
1902 return false;
1903 }
1904 }
1905
1908
1909 return true;
1910 }
1911
1913 {
1914 super.AfterStoreLoad();
1915
1917 }
1918
1919
1921 {
1923 }
1924
1925
1927 {
1928 return false;
1929 }
1930
1932 {
1933 return false;
1934 }
1935
1937 {
1938 return false;
1939 }
1940
1942 {
1943 return false;
1944 }
1945
1946
1947
1948
1949
1951 {
1954 {
1955 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1956 }
1957 else if (classname != "" && food_stage)
1958 {
1959 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1960 }
1961 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1963
1964 }
1965
1967 {
1970 {
1972 }
1973 else if (classname != "" && food_stage)
1974 {
1975 return FoodStage.GetEnergy(null, food_stage, classname);
1976 }
1977 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1979 }
1980
1982 {
1985 {
1987 }
1988 else if (classname != "" && food_stage)
1989 {
1990 return FoodStage.GetWater(null, food_stage, classname);
1991 }
1992 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1994 }
1995
1997 {
2000 {
2001 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2002 }
2003 else if (classname != "" && food_stage)
2004 {
2005 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2006 }
2007 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2009
2010 }
2011
2013 {
2016 {
2017 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2018 }
2019 else if (classname != "" && food_stage)
2020 {
2021 return FoodStage.GetToxicity(null, food_stage, classname);
2022 }
2023 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2025 }
2026
2028 {
2031 {
2033 }
2034 else if (classname != "" && food_stage)
2035 {
2036 return FoodStage.GetAgents(null, food_stage, classname);
2037 }
2038 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2040 }
2041
2043 {
2046 {
2047 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2048 }
2049 else if (classname != "" && food_stage)
2050 {
2051 return FoodStage.GetDigestibility(null, food_stage, classname);
2052 }
2053 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2055 }
2056
2058 {
2061 {
2062 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2063 }
2064 else if (className != "" && foodStage)
2065 {
2066 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2067 }
2068 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2070 }
2071
2073 {
2083
2084 return profile;
2085 }
2086
2087
2088
2089
2091 {
2093 }
2094
2095
2097 {
2099 {
2101 }
2102
2103 return false;
2104 }
2105
2107 {
2109 {
2111 }
2112
2113 return false;
2114 }
2115
2117 {
2119 {
2121 }
2122
2123 return false;
2124 }
2125
2127 {
2129 {
2131 }
2132
2133 return false;
2134 }
2135
2137 {
2139 {
2141 }
2142
2143 return false;
2144 }
2145
2147 {
2149 {
2151 }
2152
2153 return false;
2154 }
2155
2156
2158 {
2160 }
2161
2163 {
2164 return GetFoodStage().GetNextFoodStageType( cooking_method );
2165 }
2166
2168 {
2169 return GetFoodStage().GetFoodStageName( food_stage_type );
2170 }
2171
2173 {
2174 return GetFoodStage().CanChangeToNewStage( cooking_method );
2175 }
2176
2177
2179 {
2180 if ( !source.GetFoodStage())
2181 return;
2186 }
2187
2190 {
2193 }
2194
2197 {
2198 switch (stageNew)
2199 {
2204 break;
2205
2208 break;
2209 }
2210 }
2211
2212
2213
2214
2215
2217 {
2219 }
2220
2222 {
2224
2225
2227 }
2228
2230 {
2232 {
2235 }
2236 }
2237
2238
2240 {
2242 if (player)
2243 {
2245 player.ServerReplaceItemInHandsWithNew(lambda);
2246 }
2247 else
2248 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2249 }
2250
2252 {
2254 }
2255
2257 {
2258 super.SetActions();
2259
2262 }
2263
2265 {
2266 #ifndef SERVER
2268 {
2270
2273 }
2274 #endif
2275 }
2276
2278 {
2279 #ifndef SERVER
2281 {
2285 }
2286 #endif
2287 }
2288
2290 {
2291 return false;
2292 }
2293
2295 {
2297 }
2298
2299 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2300 {
2302
2303 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2305 if ( hasRootAsPlayer )
2307
2308
2309
2310
2311
2312
2313
2315 {
2316
2318 {
2320 {
2324 break;
2325
2329 break;
2330
2334 break;
2335
2339 default:
2342 return;
2343 }
2344
2345
2346 }
2347
2349
2351 {
2353 {
2354
2356 {
2358 }
2360 {
2363 {
2365 }
2366 else
2367 {
2369 {
2371 }
2372 else
2373 {
2375 }
2376 }
2377 }
2378 }
2379 }
2380
2381 }
2383 {
2384
2386 {
2388 {
2392 break;
2393
2397 break;
2398
2402 break;
2403
2407 break;
2408
2411 default:
2414 return;
2415 }
2416 }
2417
2419
2421 {
2423 {
2424
2426 {
2428 }
2429 }
2430 }
2431 }
2433 {
2434
2436 {
2438 {
2442 break;
2443
2446 default:
2449 return;
2450 }
2451 }
2452
2454
2456 {
2458 {
2459
2461 {
2463 }
2464 }
2465 }
2466 }
2467 else
2468 {
2469
2471
2473 {
2476
2477 }
2478 else
2479 {
2481 {
2484 }
2485 }
2486 }
2487 }
2488
2490 {
2491 if (
GetGame().IsDedicatedServer())
2492 return;
2493
2495 {
2497 GetInventory().GetCurrentInventoryLocation(invLoc);
2499 {
2501 if (ptcMgr)
2502 {
2507 }
2508 }
2509 }
2511 {
2513 {
2516 return;
2517 }
2518
2520 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2522 {
2525 }
2526 }
2527 }
2528
2529 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2530 {
2531 super.GetDebugActions(outputList);
2532
2534 {
2538 }
2539 }
2540
2542 {
2543 super.OnAction(action_id, player, ctx);
2544
2546 {
2547 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2548 {
2550 if (food_stage_prev <= 0)
2551 {
2553 }
2555 return true;
2556 }
2557 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2558 {
2561 {
2563 }
2565 return true;
2566 }
2567
2568 }
2569
2570 #ifdef DIAG_DEVELOPER
2571 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2572 {
2573 PrintNutritionsData();
2574 return true;
2575 }
2576 #endif
2577
2578 return false;
2579 }
2580
2582 {
2583 string debug_output;
2584
2585 debug_output = super.GetDebugText();
2586
2589
2590 return debug_output;
2591 }
2592
2593
2594
2595
2596
2598 {
2599 float ret = super.GetBaitEffectivity();
2600
2602 {
2603 ret *= 0.5;
2604 }
2605
2606 return ret;
2607 }
2608
2610 {
2612 }
2613
2615 {
2617 }
2618
2620 {
2622 }
2623
2624 #ifdef DIAG_DEVELOPER
2625 private void PrintNutritionsData()
2626 {
2627 string nutritionsData = "";
2628
2631
2633 if (profile)
2634 {
2635 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2637 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2641 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2643
2646
2647 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2649 }
2650
2651 nutritionsData += "-----\n";
2652
2654 }
2655 #endif
2656
2658
2661 {
2663 }
2664}
2665
2667{
2669};
Param4< int, int, string, int > TSelectableActionInfoWithColor
eBleedingSourceType GetType()
AttachActionData ActionData ActionAttach()
void AddAction(typename actionName)
DamageType
exposed from C++ (do not change)
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.