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);
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);
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);
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);
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);
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);
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);
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);
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
2477 {
2479
2482 }
2483 #endif
2484 }
2485
2487 {
2488 #ifndef SERVER
2490 {
2494 }
2495 #endif
2496 }
2497
2499 {
2500 return false;
2501 }
2502
2504 {
2506 }
2507
2508 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2509 {
2511
2512 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2514 if ( hasRootAsPlayer )
2516
2517
2518
2519
2520
2521
2522
2524 {
2525
2527 {
2529 {
2533 break;
2534
2538 break;
2539
2543 break;
2544
2548 default:
2551 return;
2552 }
2553
2554
2555 }
2556
2558
2560 {
2562 {
2563
2565 {
2567 }
2569 {
2572 {
2574 }
2575 else
2576 {
2578 {
2580 }
2581 else
2582 {
2584 }
2585 }
2586 }
2587 }
2588 }
2589
2590 }
2592 {
2593
2595 {
2597 {
2601 break;
2602
2606 break;
2607
2611 break;
2612
2616 break;
2617
2620 default:
2623 return;
2624 }
2625 }
2626
2628
2630 {
2632 {
2633
2635 {
2637 }
2638 }
2639 }
2640 }
2642 {
2643
2645 {
2647 {
2651 break;
2652
2655 default:
2658 return;
2659 }
2660 }
2661
2663
2665 {
2667 {
2668
2670 {
2672 }
2673 }
2674 }
2675 }
2676 else
2677 {
2678
2680
2682 {
2685
2686 }
2687 else
2688 {
2690 {
2693 }
2694 }
2695 }
2696 }
2697
2699 {
2700 if (
GetGame().IsDedicatedServer())
2701 return;
2702
2704 {
2706 GetInventory().GetCurrentInventoryLocation(invLoc);
2708 {
2710 if (ptcMgr)
2711 {
2716 }
2717 }
2718 }
2720 {
2722 {
2725 return;
2726 }
2727
2729 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2731 {
2734 }
2735 }
2736 }
2737
2738 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2739 {
2740 super.GetDebugActions(outputList);
2741
2743 {
2747 }
2748 }
2749
2751 {
2752 super.OnAction(action_id, player, ctx);
2753
2755 {
2756 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2757 {
2759 if (food_stage_prev <= 0)
2760 {
2762 }
2764 return true;
2765 }
2766 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2767 {
2770 {
2772 }
2774 return true;
2775 }
2776
2777 }
2778
2779 #ifdef DIAG_DEVELOPER
2780 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2781 {
2782 PrintNutritionsData();
2783 return true;
2784 }
2785 #endif
2786
2787 return false;
2788 }
2789
2791 {
2792 string debug_output;
2793
2794 debug_output = super.GetDebugText();
2795
2798
2799 return debug_output;
2800 }
2801
2802
2803
2804
2805
2807 {
2808 float ret = super.GetBaitEffectivity();
2809
2811 {
2812 ret *= 0.5;
2813 }
2814
2815 return ret;
2816 }
2817
2819 {
2821 }
2822
2824 {
2826 }
2827
2829 {
2831 }
2832
2833 #ifdef DIAG_DEVELOPER
2834 private void PrintNutritionsData()
2835 {
2836 string nutritionsData = "";
2837
2840
2842 if (profile)
2843 {
2844 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2846 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2850 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2852
2855
2856 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2858 }
2859
2860 nutritionsData += "-----\n";
2861
2863 }
2864 #endif
2865
2867
2870 {
2872 }
2873}
2874
2876{
2878};
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.