1770{
1772
1780
1790
1792
1794 {
1796 {
1798
1800 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1801
1805 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1806 }
1807 }
1808
1810 {
1812
1814 }
1815
1817 {
1818 super.EEDelete(parent);
1819
1821
1824 }
1825
1827 {
1828 super.EEItemLocationChanged(oldLoc, newLoc);
1829
1832 {
1833 switch (oldLoc.GetParent().GetType())
1834 {
1835 case "FryingPan":
1836 case "Pot":
1837 case "Cauldron":
1838 case "SharpWoodenStick":
1840 break;
1841 }
1842
1845 {
1847 }
1848 }
1849
1850 if (oldLoc.IsValid())
1852
1855 }
1856
1858 {
1861 }
1862
1864 {
1867
1868 return true;
1869 }
1870
1872 {
1874 {
1876 }
1877 }
1878
1881 {
1882 int foodStageType;
1883
1885 if (foodStage)
1886 foodStageType = foodStage.GetFoodStageType();
1887
1892
1893 return agentsIn;
1894 }
1895
1896
1898 {
1899 return false;
1900 }
1901
1903 {
1904 return false;
1905 }
1906
1908 {
1910 {
1912 {
1915
1918
1919 default:
1920 return super.GetTemperatureFreezeTime();
1921 }
1922 }
1923
1924 return super.GetTemperatureFreezeTime();
1925 }
1926
1928 {
1930 {
1932 {
1935
1938
1939 default:
1940 return super.GetTemperatureThawTime();
1941 }
1942 }
1943
1944 return super.GetTemperatureThawTime();
1945 }
1946
1948 {
1950 }
1951
1952
1953
1954
1956 {
1957 SetSynchDirty();
1958 }
1959
1961 {
1962 super.OnVariablesSynchronized();
1963
1964
1965
1966
1968 {
1970 }
1971 else
1972 {
1974 }
1975
1978 }
1979
1980
1981
1982
1984 {
1987
1989 }
1990
1992 {
1993 string soundName = "";
1994
1997
1999 {
2001 }
2002 else
2003 {
2005 {
2007 {
2012 else
2013 soundName = "";
2014 break;
2015 }
2016
2018 {
2023 else
2024 soundName = "";
2025 break;
2026 }
2027
2029 {
2034 else
2035 soundName = "";
2036 break;
2037 }
2038
2039 default:
2040 soundName = "";
2041 break;
2042 }
2043
2045 {
2046 if (soundName == "")
2047 {
2049 }
2050 else
2051 {
2053 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2054 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2056 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2057 {
2059 }
2060 }
2061 }
2062 }
2063
2065 }
2066
2068 {
2071 }
2072
2073
2074
2075
2077 {
2078 super.OnStoreSave(ctx);
2079
2081 {
2083 }
2084
2085
2088 }
2089
2091 {
2092 if (!super.OnStoreLoad(ctx, version))
2093 return false;
2094
2096 {
2098 return false;
2099 }
2100
2101 if (version >= 115)
2102 {
2104 {
2106 return false;
2107 }
2109 {
2111 return false;
2112 }
2113 }
2114
2117
2118 return true;
2119 }
2120
2122 {
2123 super.AfterStoreLoad();
2124
2126 }
2127
2128
2130 {
2132 }
2133
2134
2136 {
2137 return false;
2138 }
2139
2141 {
2142 return false;
2143 }
2144
2146 {
2147 return false;
2148 }
2149
2151 {
2152 return false;
2153 }
2154
2155
2156
2157
2158
2160 {
2163 {
2164 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2165 }
2166 else if (classname != "" && food_stage)
2167 {
2168 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2169 }
2170 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2171 return g_Game.ConfigGetFloat( class_path +
" fullnessIndex" );
2172
2173 }
2174
2176 {
2179 {
2181 }
2182 else if (classname != "" && food_stage)
2183 {
2184 return FoodStage.GetEnergy(null, food_stage, classname);
2185 }
2186 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2187 return g_Game.ConfigGetFloat( class_path +
" energy" );
2188 }
2189
2191 {
2194 {
2196 }
2197 else if (classname != "" && food_stage)
2198 {
2199 return FoodStage.GetWater(null, food_stage, classname);
2200 }
2201 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2202 return g_Game.ConfigGetFloat( class_path +
" water" );
2203 }
2204
2206 {
2209 {
2210 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2211 }
2212 else if (classname != "" && food_stage)
2213 {
2214 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2215 }
2216 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2217 return g_Game.ConfigGetFloat( class_path +
" nutritionalIndex" );
2218
2219 }
2220
2222 {
2225 {
2226 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2227 }
2228 else if (classname != "" && food_stage)
2229 {
2230 return FoodStage.GetToxicity(null, food_stage, classname);
2231 }
2232 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2233 return g_Game.ConfigGetFloat( class_path +
" toxicity" );
2234 }
2235
2237 {
2240 {
2242 }
2243 else if (classname != "" && food_stage)
2244 {
2245 return FoodStage.GetAgents(null, food_stage, classname);
2246 }
2247 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2248 return g_Game.ConfigGetInt( class_path +
" agents" );
2249 }
2250
2252 {
2255 {
2256 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2257 }
2258 else if (classname != "" && food_stage)
2259 {
2260 return FoodStage.GetDigestibility(null, food_stage, classname);
2261 }
2262 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2263 return g_Game.ConfigGetInt( class_path +
" digestibility" );
2264 }
2265
2267 {
2270 {
2271 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2272 }
2273 else if (className != "" && foodStage)
2274 {
2275 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2276 }
2277 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2278 return g_Game.ConfigGetInt(classPath +
" agentsPerDigest");
2279 }
2280
2282 {
2292
2293 return profile;
2294 }
2295
2296
2297
2298
2300 {
2302 }
2303
2304
2306 {
2308 {
2310 }
2311
2312 return false;
2313 }
2314
2316 {
2318 {
2320 }
2321
2322 return false;
2323 }
2324
2326 {
2328 {
2330 }
2331
2332 return false;
2333 }
2334
2336 {
2338 {
2340 }
2341
2342 return false;
2343 }
2344
2346 {
2348 {
2350 }
2351
2352 return false;
2353 }
2354
2356 {
2358 {
2360 }
2361
2362 return false;
2363 }
2364
2365
2367 {
2369 }
2370
2372 {
2373 return GetFoodStage().GetNextFoodStageType( cooking_method );
2374 }
2375
2377 {
2378 return GetFoodStage().GetFoodStageName( food_stage_type );
2379 }
2380
2382 {
2383 return GetFoodStage().CanChangeToNewStage( cooking_method );
2384 }
2385
2386
2388 {
2389 if ( !source.GetFoodStage())
2390 return;
2395 }
2396
2399 {
2402 }
2403
2406 {
2407 switch (stageNew)
2408 {
2413 break;
2414
2417 break;
2418 }
2419 }
2420
2421
2422
2423
2424
2426 {
2428 }
2429
2431 {
2433
2434
2436 }
2437
2439 {
2441 {
2444 }
2445 }
2446
2447
2449 {
2451 if (player)
2452 {
2454 player.ServerReplaceItemInHandsWithNew(lambda);
2455 }
2456 else
2457 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2458 }
2459
2461 {
2463 }
2464
2466 {
2467 super.SetActions();
2468
2471 }
2472
2474 {
2475 #ifndef SERVER
2476 #ifndef NO_GUI
2478 {
2480
2483 }
2484 #endif
2485 #endif
2486 }
2487
2489 {
2490 #ifndef SERVER
2491 #ifndef NO_GUI
2493 {
2497 }
2498 #endif
2499 #endif
2500 }
2501
2503 {
2504 return false;
2505 }
2506
2508 {
2510 }
2511
2512 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2513 {
2515
2516 delta *= DayZGame.Cast(
g_Game).GetFoodDecayModifier();
2518 if ( hasRootAsPlayer )
2520
2521
2522
2523
2524
2525
2526
2528 {
2529
2531 {
2533 {
2537 break;
2538
2542 break;
2543
2547 break;
2548
2552 default:
2555 return;
2556 }
2557
2558
2559 }
2560
2562
2564 {
2566 {
2567
2569 {
2571 }
2573 {
2576 {
2578 }
2579 else
2580 {
2582 {
2584 }
2585 else
2586 {
2588 }
2589 }
2590 }
2591 }
2592 }
2593
2594 }
2596 {
2597
2599 {
2601 {
2605 break;
2606
2610 break;
2611
2615 break;
2616
2620 break;
2621
2624 default:
2627 return;
2628 }
2629 }
2630
2632
2634 {
2636 {
2637
2639 {
2641 }
2642 }
2643 }
2644 }
2646 {
2647
2649 {
2651 {
2655 break;
2656
2659 default:
2662 return;
2663 }
2664 }
2665
2667
2669 {
2671 {
2672
2674 {
2676 }
2677 }
2678 }
2679 }
2680 else
2681 {
2682
2684
2686 {
2689
2690 }
2691 else
2692 {
2694 {
2697 }
2698 }
2699 }
2700 }
2701
2703 {
2704 if (
g_Game.IsHeadlessOrDedicatedServer())
2705 return;
2706
2708 {
2710 GetInventory().GetCurrentInventoryLocation(invLoc);
2712 {
2714 if (ptcMgr)
2715 {
2720 }
2721 }
2722 }
2724 {
2726 {
2729 return;
2730 }
2731
2733 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2735 {
2738 }
2739 }
2740 }
2741
2742 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2743 {
2745 {
2750 }
2751
2752 super.GetDebugActions(outputList);
2753 }
2754
2756 {
2757 super.OnAction(action_id, player, ctx);
2758
2760 {
2761 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2762 {
2764 if (food_stage_prev <= 0)
2765 {
2767 }
2769 return true;
2770 }
2771 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2772 {
2775 {
2777 }
2779 return true;
2780 }
2781
2782 }
2783
2784 #ifdef DIAG_DEVELOPER
2785 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2786 {
2787 PrintNutritionsData();
2788 return true;
2789 }
2790 #endif
2791
2792 return false;
2793 }
2794
2796 {
2797 string debug_output;
2798
2799 debug_output = super.GetDebugText();
2800
2803
2804 return debug_output;
2805 }
2806
2807
2808
2809
2810
2812 {
2813 float ret = super.GetBaitEffectivity();
2814
2816 {
2817 ret *= 0.5;
2818 }
2819
2820 return ret;
2821 }
2822
2824 {
2826 }
2827
2829 {
2831 }
2832
2834 {
2836 }
2837
2838 #ifdef DIAG_DEVELOPER
2839 private void PrintNutritionsData()
2840 {
2841 string nutritionsData = "";
2842
2845
2847 if (profile)
2848 {
2849 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2851 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2855 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2857
2860
2861 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2863 }
2864
2865 nutritionsData += "-----\n";
2866
2868 }
2869 #endif
2870
2872
2875 {
2877 }
2878}
2879
2881{
2883};
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 RemoveAllAgentsExcept(int agent_to_keep)
override void InsertAgent(int agent, float count=1)
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.
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
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
vector GetPosition()
Get the world position of the Effect.
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.