1607{
1609
1617
1627
1629
1631 {
1633 {
1635
1637 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1638
1642 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1643 }
1644 }
1645
1647 {
1649
1651 }
1652
1654 {
1655 super.EEDelete(parent);
1656
1658
1661 }
1662
1664 {
1665 super.EEItemLocationChanged(oldLoc, newLoc);
1666
1669 {
1670 switch (oldLoc.GetParent().GetType())
1671 {
1672 case "FryingPan":
1673 case "Pot":
1674 case "Cauldron":
1675 case "SharpWoodenStick":
1677 break;
1678 }
1679
1682 {
1684 }
1685 }
1686
1687 if (oldLoc.IsValid())
1689
1692 }
1693
1695 {
1698 }
1699
1701 {
1704
1705 return true;
1706 }
1707
1709 {
1711 {
1713 }
1714 }
1715
1718 {
1719 int foodStageType;
1720
1722 if (foodStage)
1723 foodStageType = foodStage.GetFoodStageType();
1724
1729
1730 return agentsIn;
1731 }
1732
1733
1735 {
1736 return false;
1737 }
1738
1740 {
1741 return false;
1742 }
1743
1745 {
1747 {
1749 {
1752
1755
1756 default:
1757 return super.GetTemperatureFreezeTime();
1758 }
1759 }
1760
1761 return super.GetTemperatureFreezeTime();
1762 }
1763
1765 {
1767 {
1769 {
1772
1775
1776 default:
1777 return super.GetTemperatureThawTime();
1778 }
1779 }
1780
1781 return super.GetTemperatureThawTime();
1782 }
1783
1785 {
1787 }
1788
1789
1790
1791
1793 {
1794 SetSynchDirty();
1795 }
1796
1798 {
1799 super.OnVariablesSynchronized();
1800
1801
1802
1803
1805 {
1807 }
1808 else
1809 {
1811 }
1812
1815 }
1816
1817
1818
1819
1821 {
1824
1826 }
1827
1829 {
1830 string soundName = "";
1831
1834
1836 {
1838 }
1839 else
1840 {
1842 {
1844 {
1849 else
1850 soundName = "";
1851 break;
1852 }
1853
1855 {
1860 else
1861 soundName = "";
1862 break;
1863 }
1864
1866 {
1871 else
1872 soundName = "";
1873 break;
1874 }
1875
1876 default:
1877 soundName = "";
1878 break;
1879 }
1880
1882 {
1883 if (soundName == "")
1884 {
1886 }
1887 else
1888 {
1890 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1891 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1893 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1894 {
1896 }
1897 }
1898 }
1899 }
1900
1902 }
1903
1905 {
1908 }
1909
1910
1911
1912
1914 {
1915 super.OnStoreSave(ctx);
1916
1918 {
1920 }
1921
1922
1925 }
1926
1928 {
1929 if (!super.OnStoreLoad(ctx, version))
1930 return false;
1931
1933 {
1935 return false;
1936 }
1937
1938 if (version >= 115)
1939 {
1941 {
1943 return false;
1944 }
1946 {
1948 return false;
1949 }
1950 }
1951
1954
1955 return true;
1956 }
1957
1959 {
1960 super.AfterStoreLoad();
1961
1963 }
1964
1965
1967 {
1969 }
1970
1971
1973 {
1974 return false;
1975 }
1976
1978 {
1979 return false;
1980 }
1981
1983 {
1984 return false;
1985 }
1986
1988 {
1989 return false;
1990 }
1991
1992
1993
1994
1995
1997 {
2000 {
2001 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2002 }
2003 else if (classname != "" && food_stage)
2004 {
2005 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2006 }
2007 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2009
2010 }
2011
2013 {
2016 {
2018 }
2019 else if (classname != "" && food_stage)
2020 {
2021 return FoodStage.GetEnergy(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.GetWater(null, food_stage, classname);
2037 }
2038 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2040 }
2041
2043 {
2046 {
2047 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2048 }
2049 else if (classname != "" && food_stage)
2050 {
2051 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2052 }
2053 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2055
2056 }
2057
2059 {
2062 {
2063 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2064 }
2065 else if (classname != "" && food_stage)
2066 {
2067 return FoodStage.GetToxicity(null, food_stage, classname);
2068 }
2069 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2071 }
2072
2074 {
2077 {
2079 }
2080 else if (classname != "" && food_stage)
2081 {
2082 return FoodStage.GetAgents(null, food_stage, classname);
2083 }
2084 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2086 }
2087
2089 {
2092 {
2093 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2094 }
2095 else if (classname != "" && food_stage)
2096 {
2097 return FoodStage.GetDigestibility(null, food_stage, classname);
2098 }
2099 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2101 }
2102
2104 {
2107 {
2108 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2109 }
2110 else if (className != "" && foodStage)
2111 {
2112 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2113 }
2114 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2116 }
2117
2119 {
2129
2130 return profile;
2131 }
2132
2133
2134
2135
2137 {
2139 }
2140
2141
2143 {
2145 {
2147 }
2148
2149 return false;
2150 }
2151
2153 {
2155 {
2157 }
2158
2159 return false;
2160 }
2161
2163 {
2165 {
2167 }
2168
2169 return false;
2170 }
2171
2173 {
2175 {
2177 }
2178
2179 return false;
2180 }
2181
2183 {
2185 {
2187 }
2188
2189 return false;
2190 }
2191
2193 {
2195 {
2197 }
2198
2199 return false;
2200 }
2201
2202
2204 {
2206 }
2207
2209 {
2210 return GetFoodStage().GetNextFoodStageType( cooking_method );
2211 }
2212
2214 {
2215 return GetFoodStage().GetFoodStageName( food_stage_type );
2216 }
2217
2219 {
2220 return GetFoodStage().CanChangeToNewStage( cooking_method );
2221 }
2222
2223
2225 {
2226 if ( !source.GetFoodStage())
2227 return;
2232 }
2233
2236 {
2239 }
2240
2243 {
2244 switch (stageNew)
2245 {
2250 break;
2251
2254 break;
2255 }
2256 }
2257
2258
2259
2260
2261
2263 {
2265 }
2266
2268 {
2270
2271
2273 }
2274
2276 {
2278 {
2281 }
2282 }
2283
2284
2286 {
2288 if (player)
2289 {
2291 player.ServerReplaceItemInHandsWithNew(lambda);
2292 }
2293 else
2294 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2295 }
2296
2298 {
2300 }
2301
2303 {
2304 super.SetActions();
2305
2308 }
2309
2311 {
2312 #ifndef SERVER
2314 {
2316
2319 }
2320 #endif
2321 }
2322
2324 {
2325 #ifndef SERVER
2327 {
2331 }
2332 #endif
2333 }
2334
2336 {
2337 return false;
2338 }
2339
2341 {
2343 }
2344
2345 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2346 {
2348
2349 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2351 if ( hasRootAsPlayer )
2353
2354
2355
2356
2357
2358
2359
2361 {
2362
2364 {
2366 {
2370 break;
2371
2375 break;
2376
2380 break;
2381
2385 default:
2388 return;
2389 }
2390
2391
2392 }
2393
2395
2397 {
2399 {
2400
2402 {
2404 }
2406 {
2409 {
2411 }
2412 else
2413 {
2415 {
2417 }
2418 else
2419 {
2421 }
2422 }
2423 }
2424 }
2425 }
2426
2427 }
2429 {
2430
2432 {
2434 {
2438 break;
2439
2443 break;
2444
2448 break;
2449
2453 break;
2454
2457 default:
2460 return;
2461 }
2462 }
2463
2465
2467 {
2469 {
2470
2472 {
2474 }
2475 }
2476 }
2477 }
2479 {
2480
2482 {
2484 {
2488 break;
2489
2492 default:
2495 return;
2496 }
2497 }
2498
2500
2502 {
2504 {
2505
2507 {
2509 }
2510 }
2511 }
2512 }
2513 else
2514 {
2515
2517
2519 {
2522
2523 }
2524 else
2525 {
2527 {
2530 }
2531 }
2532 }
2533 }
2534
2536 {
2537 if (
GetGame().IsDedicatedServer())
2538 return;
2539
2541 {
2543 GetInventory().GetCurrentInventoryLocation(invLoc);
2545 {
2547 if (ptcMgr)
2548 {
2553 }
2554 }
2555 }
2557 {
2559 {
2562 return;
2563 }
2564
2566 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2568 {
2571 }
2572 }
2573 }
2574
2575 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2576 {
2578 {
2583 }
2584
2585 super.GetDebugActions(outputList);
2586 }
2587
2589 {
2590 super.OnAction(action_id, player, ctx);
2591
2593 {
2594 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2595 {
2597 if (food_stage_prev <= 0)
2598 {
2600 }
2602 return true;
2603 }
2604 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2605 {
2608 {
2610 }
2612 return true;
2613 }
2614
2615 }
2616
2617 #ifdef DIAG_DEVELOPER
2618 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2619 {
2620 PrintNutritionsData();
2621 return true;
2622 }
2623 #endif
2624
2625 return false;
2626 }
2627
2629 {
2630 string debug_output;
2631
2632 debug_output = super.GetDebugText();
2633
2636
2637 return debug_output;
2638 }
2639
2640
2641
2642
2643
2645 {
2646 float ret = super.GetBaitEffectivity();
2647
2649 {
2650 ret *= 0.5;
2651 }
2652
2653 return ret;
2654 }
2655
2657 {
2659 }
2660
2662 {
2664 }
2665
2667 {
2669 }
2670
2671 #ifdef DIAG_DEVELOPER
2672 private void PrintNutritionsData()
2673 {
2674 string nutritionsData = "";
2675
2678
2680 if (profile)
2681 {
2682 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2684 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2688 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2690
2693
2694 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2696 }
2697
2698 nutritionsData += "-----\n";
2699
2701 }
2702 #endif
2703
2705
2708 {
2710 }
2711}
2712
2714{
2716};
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.