1806{
1808
1816
1826
1828
1830 {
1832 {
1834
1836 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1837
1841 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1842 }
1843 }
1844
1846 {
1848
1850 }
1851
1853 {
1854 super.EEDelete(parent);
1855
1857
1860 }
1861
1863 {
1864 super.EEItemLocationChanged(oldLoc, newLoc);
1865
1868 {
1869 switch (oldLoc.GetParent().GetType())
1870 {
1871 case "FryingPan":
1872 case "Pot":
1873 case "Cauldron":
1874 case "SharpWoodenStick":
1876 break;
1877 }
1878
1881 {
1883 }
1884 }
1885
1886 if (oldLoc.IsValid())
1888
1891 }
1892
1894 {
1897 }
1898
1900 {
1903
1904 return true;
1905 }
1906
1908 {
1910 {
1912 }
1913 }
1914
1917 {
1918 int foodStageType;
1919
1921 if (foodStage)
1922 foodStageType = foodStage.GetFoodStageType();
1923
1928
1929 return agentsIn;
1930 }
1931
1932
1934 {
1935 return false;
1936 }
1937
1939 {
1940 return false;
1941 }
1942
1944 {
1946 {
1948 {
1951
1954
1955 default:
1956 return super.GetTemperatureFreezeTime();
1957 }
1958 }
1959
1960 return super.GetTemperatureFreezeTime();
1961 }
1962
1964 {
1966 {
1968 {
1971
1974
1975 default:
1976 return super.GetTemperatureThawTime();
1977 }
1978 }
1979
1980 return super.GetTemperatureThawTime();
1981 }
1982
1984 {
1986 }
1987
1988
1989
1990
1992 {
1993 SetSynchDirty();
1994 }
1995
1997 {
1998 super.OnVariablesSynchronized();
1999
2000
2001
2002
2004 {
2006 }
2007 else
2008 {
2010 }
2011
2014 }
2015
2016
2017
2018
2020 {
2023
2025 }
2026
2028 {
2029 string soundName = "";
2030
2033
2035 {
2037 }
2038 else
2039 {
2041 {
2043 {
2048 else
2049 soundName = "";
2050 break;
2051 }
2052
2054 {
2059 else
2060 soundName = "";
2061 break;
2062 }
2063
2065 {
2070 else
2071 soundName = "";
2072 break;
2073 }
2074
2075 default:
2076 soundName = "";
2077 break;
2078 }
2079
2081 {
2082 if (soundName == "")
2083 {
2085 }
2086 else
2087 {
2089 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2090 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2092 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2093 {
2095 }
2096 }
2097 }
2098 }
2099
2101 }
2102
2104 {
2107 }
2108
2109
2110
2111
2113 {
2114 super.OnStoreSave(ctx);
2115
2117 {
2119 }
2120
2121
2124 }
2125
2127 {
2128 if (!super.OnStoreLoad(ctx, version))
2129 return false;
2130
2132 {
2134 return false;
2135 }
2136
2137 if (version >= 115)
2138 {
2140 {
2142 return false;
2143 }
2145 {
2147 return false;
2148 }
2149 }
2150
2153
2154 return true;
2155 }
2156
2158 {
2159 super.AfterStoreLoad();
2160
2162 }
2163
2164
2166 {
2168 }
2169
2170
2172 {
2173 return false;
2174 }
2175
2177 {
2178 return false;
2179 }
2180
2182 {
2183 return false;
2184 }
2185
2187 {
2188 return false;
2189 }
2190
2191
2192
2193
2194
2196 {
2199 {
2200 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2201 }
2202 else if (classname != "" && food_stage)
2203 {
2204 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2205 }
2206 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2208
2209 }
2210
2212 {
2215 {
2217 }
2218 else if (classname != "" && food_stage)
2219 {
2220 return FoodStage.GetEnergy(null, food_stage, classname);
2221 }
2222 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2224 }
2225
2227 {
2230 {
2232 }
2233 else if (classname != "" && food_stage)
2234 {
2235 return FoodStage.GetWater(null, food_stage, classname);
2236 }
2237 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2239 }
2240
2242 {
2245 {
2246 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2247 }
2248 else if (classname != "" && food_stage)
2249 {
2250 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2251 }
2252 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2254
2255 }
2256
2258 {
2261 {
2262 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2263 }
2264 else if (classname != "" && food_stage)
2265 {
2266 return FoodStage.GetToxicity(null, food_stage, classname);
2267 }
2268 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2270 }
2271
2273 {
2276 {
2278 }
2279 else if (classname != "" && food_stage)
2280 {
2281 return FoodStage.GetAgents(null, food_stage, classname);
2282 }
2283 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2285 }
2286
2288 {
2291 {
2292 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2293 }
2294 else if (classname != "" && food_stage)
2295 {
2296 return FoodStage.GetDigestibility(null, food_stage, classname);
2297 }
2298 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2300 }
2301
2303 {
2306 {
2307 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2308 }
2309 else if (className != "" && foodStage)
2310 {
2311 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2312 }
2313 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2315 }
2316
2318 {
2328
2329 return profile;
2330 }
2331
2332
2333
2334
2336 {
2338 }
2339
2340
2342 {
2344 {
2346 }
2347
2348 return false;
2349 }
2350
2352 {
2354 {
2356 }
2357
2358 return false;
2359 }
2360
2362 {
2364 {
2366 }
2367
2368 return false;
2369 }
2370
2372 {
2374 {
2376 }
2377
2378 return false;
2379 }
2380
2382 {
2384 {
2386 }
2387
2388 return false;
2389 }
2390
2392 {
2394 {
2396 }
2397
2398 return false;
2399 }
2400
2401
2403 {
2405 }
2406
2408 {
2409 return GetFoodStage().GetNextFoodStageType( cooking_method );
2410 }
2411
2413 {
2414 return GetFoodStage().GetFoodStageName( food_stage_type );
2415 }
2416
2418 {
2419 return GetFoodStage().CanChangeToNewStage( cooking_method );
2420 }
2421
2422
2424 {
2425 if ( !source.GetFoodStage())
2426 return;
2431 }
2432
2435 {
2438 }
2439
2442 {
2443 switch (stageNew)
2444 {
2449 break;
2450
2453 break;
2454 }
2455 }
2456
2457
2458
2459
2460
2462 {
2464 }
2465
2467 {
2469
2470
2472 }
2473
2475 {
2477 {
2480 }
2481 }
2482
2483
2485 {
2487 if (player)
2488 {
2490 player.ServerReplaceItemInHandsWithNew(lambda);
2491 }
2492 else
2493 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2494 }
2495
2497 {
2499 }
2500
2502 {
2503 super.SetActions();
2504
2507 }
2508
2510 {
2511 #ifndef SERVER
2513 {
2515
2518 }
2519 #endif
2520 }
2521
2523 {
2524 #ifndef SERVER
2526 {
2530 }
2531 #endif
2532 }
2533
2535 {
2536 return false;
2537 }
2538
2540 {
2542 }
2543
2544 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2545 {
2547
2548 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2550 if ( hasRootAsPlayer )
2552
2553
2554
2555
2556
2557
2558
2560 {
2561
2563 {
2565 {
2569 break;
2570
2574 break;
2575
2579 break;
2580
2584 default:
2587 return;
2588 }
2589
2590
2591 }
2592
2594
2596 {
2598 {
2599
2601 {
2603 }
2605 {
2608 {
2610 }
2611 else
2612 {
2614 {
2616 }
2617 else
2618 {
2620 }
2621 }
2622 }
2623 }
2624 }
2625
2626 }
2628 {
2629
2631 {
2633 {
2637 break;
2638
2642 break;
2643
2647 break;
2648
2652 break;
2653
2656 default:
2659 return;
2660 }
2661 }
2662
2664
2666 {
2668 {
2669
2671 {
2673 }
2674 }
2675 }
2676 }
2678 {
2679
2681 {
2683 {
2687 break;
2688
2691 default:
2694 return;
2695 }
2696 }
2697
2699
2701 {
2703 {
2704
2706 {
2708 }
2709 }
2710 }
2711 }
2712 else
2713 {
2714
2716
2718 {
2721
2722 }
2723 else
2724 {
2726 {
2729 }
2730 }
2731 }
2732 }
2733
2735 {
2736 if (
GetGame().IsDedicatedServer())
2737 return;
2738
2740 {
2742 GetInventory().GetCurrentInventoryLocation(invLoc);
2744 {
2746 if (ptcMgr)
2747 {
2752 }
2753 }
2754 }
2756 {
2758 {
2761 return;
2762 }
2763
2765 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2767 {
2770 }
2771 }
2772 }
2773
2774 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2775 {
2777 {
2782 }
2783
2784 super.GetDebugActions(outputList);
2785 }
2786
2788 {
2789 super.OnAction(action_id, player, ctx);
2790
2792 {
2793 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2794 {
2796 if (food_stage_prev <= 0)
2797 {
2799 }
2801 return true;
2802 }
2803 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2804 {
2807 {
2809 }
2811 return true;
2812 }
2813
2814 }
2815
2816 #ifdef DIAG_DEVELOPER
2817 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2818 {
2819 PrintNutritionsData();
2820 return true;
2821 }
2822 #endif
2823
2824 return false;
2825 }
2826
2828 {
2829 string debug_output;
2830
2831 debug_output = super.GetDebugText();
2832
2835
2836 return debug_output;
2837 }
2838
2839
2840
2841
2842
2844 {
2845 float ret = super.GetBaitEffectivity();
2846
2848 {
2849 ret *= 0.5;
2850 }
2851
2852 return ret;
2853 }
2854
2856 {
2858 }
2859
2861 {
2863 }
2864
2866 {
2868 }
2869
2870 #ifdef DIAG_DEVELOPER
2871 private void PrintNutritionsData()
2872 {
2873 string nutritionsData = "";
2874
2877
2879 if (profile)
2880 {
2881 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2883 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2887 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2889
2892
2893 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2895 }
2896
2897 nutritionsData += "-----\n";
2898
2900 }
2901 #endif
2902
2904
2907 {
2909 }
2910}
2911
2913{
2915};
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.