1838{
1840
1848
1858
1860
1862 {
1864 {
1866
1868 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1869
1873 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1874 }
1875 }
1876
1878 {
1880
1882 }
1883
1885 {
1886 super.EEDelete(parent);
1887
1889
1892 }
1893
1895 {
1896 super.EEItemLocationChanged(oldLoc, newLoc);
1897
1900 {
1901 switch (oldLoc.GetParent().GetType())
1902 {
1903 case "FryingPan":
1904 case "Pot":
1905 case "Cauldron":
1906 case "SharpWoodenStick":
1908 break;
1909 }
1910
1913 {
1915 }
1916 }
1917
1918 if (oldLoc.IsValid())
1920
1923 }
1924
1926 {
1929 }
1930
1932 {
1935
1936 return true;
1937 }
1938
1940 {
1942 {
1944 }
1945 }
1946
1949 {
1950 int foodStageType;
1951
1953 if (foodStage)
1954 foodStageType = foodStage.GetFoodStageType();
1955
1960
1961 return agentsIn;
1962 }
1963
1964
1966 {
1967 return false;
1968 }
1969
1971 {
1972 return false;
1973 }
1974
1976 {
1978 {
1980 {
1983
1986
1987 default:
1988 return super.GetTemperatureFreezeTime();
1989 }
1990 }
1991
1992 return super.GetTemperatureFreezeTime();
1993 }
1994
1996 {
1998 {
2000 {
2003
2006
2007 default:
2008 return super.GetTemperatureThawTime();
2009 }
2010 }
2011
2012 return super.GetTemperatureThawTime();
2013 }
2014
2016 {
2018 }
2019
2020
2021
2022
2024 {
2025 SetSynchDirty();
2026 }
2027
2029 {
2030 super.OnVariablesSynchronized();
2031
2032
2033
2034
2036 {
2038 }
2039 else
2040 {
2042 }
2043
2046 }
2047
2048
2049
2050
2052 {
2055
2057 }
2058
2060 {
2061 string soundName = "";
2062
2065
2067 {
2069 }
2070 else
2071 {
2073 {
2075 {
2080 else
2081 soundName = "";
2082 break;
2083 }
2084
2086 {
2091 else
2092 soundName = "";
2093 break;
2094 }
2095
2097 {
2102 else
2103 soundName = "";
2104 break;
2105 }
2106
2107 default:
2108 soundName = "";
2109 break;
2110 }
2111
2113 {
2114 if (soundName == "")
2115 {
2117 }
2118 else
2119 {
2121 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2122 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2124 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2125 {
2127 }
2128 }
2129 }
2130 }
2131
2133 }
2134
2136 {
2139 }
2140
2141
2142
2143
2145 {
2146 super.OnStoreSave(ctx);
2147
2149 {
2151 }
2152
2153
2156 }
2157
2159 {
2160 if (!super.OnStoreLoad(ctx, version))
2161 return false;
2162
2164 {
2166 return false;
2167 }
2168
2169 if (version >= 115)
2170 {
2172 {
2174 return false;
2175 }
2177 {
2179 return false;
2180 }
2181 }
2182
2185
2186 return true;
2187 }
2188
2190 {
2191 super.AfterStoreLoad();
2192
2194 }
2195
2196
2198 {
2200 }
2201
2202
2204 {
2205 return false;
2206 }
2207
2209 {
2210 return false;
2211 }
2212
2214 {
2215 return false;
2216 }
2217
2219 {
2220 return false;
2221 }
2222
2223
2224
2225
2226
2228 {
2231 {
2232 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2233 }
2234 else if (classname != "" && food_stage)
2235 {
2236 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2237 }
2238 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2240
2241 }
2242
2244 {
2247 {
2249 }
2250 else if (classname != "" && food_stage)
2251 {
2252 return FoodStage.GetEnergy(null, food_stage, classname);
2253 }
2254 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2256 }
2257
2259 {
2262 {
2264 }
2265 else if (classname != "" && food_stage)
2266 {
2267 return FoodStage.GetWater(null, food_stage, classname);
2268 }
2269 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2271 }
2272
2274 {
2277 {
2278 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2279 }
2280 else if (classname != "" && food_stage)
2281 {
2282 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2283 }
2284 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2286
2287 }
2288
2290 {
2293 {
2294 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2295 }
2296 else if (classname != "" && food_stage)
2297 {
2298 return FoodStage.GetToxicity(null, food_stage, classname);
2299 }
2300 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2302 }
2303
2305 {
2308 {
2310 }
2311 else if (classname != "" && food_stage)
2312 {
2313 return FoodStage.GetAgents(null, food_stage, classname);
2314 }
2315 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2317 }
2318
2320 {
2323 {
2324 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2325 }
2326 else if (classname != "" && food_stage)
2327 {
2328 return FoodStage.GetDigestibility(null, food_stage, classname);
2329 }
2330 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2332 }
2333
2335 {
2338 {
2339 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2340 }
2341 else if (className != "" && foodStage)
2342 {
2343 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2344 }
2345 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2347 }
2348
2350 {
2360
2361 return profile;
2362 }
2363
2364
2365
2366
2368 {
2370 }
2371
2372
2374 {
2376 {
2378 }
2379
2380 return false;
2381 }
2382
2384 {
2386 {
2388 }
2389
2390 return false;
2391 }
2392
2394 {
2396 {
2398 }
2399
2400 return false;
2401 }
2402
2404 {
2406 {
2408 }
2409
2410 return false;
2411 }
2412
2414 {
2416 {
2418 }
2419
2420 return false;
2421 }
2422
2424 {
2426 {
2428 }
2429
2430 return false;
2431 }
2432
2433
2435 {
2437 }
2438
2440 {
2441 return GetFoodStage().GetNextFoodStageType( cooking_method );
2442 }
2443
2445 {
2446 return GetFoodStage().GetFoodStageName( food_stage_type );
2447 }
2448
2450 {
2451 return GetFoodStage().CanChangeToNewStage( cooking_method );
2452 }
2453
2454
2456 {
2457 if ( !source.GetFoodStage())
2458 return;
2463 }
2464
2467 {
2470 }
2471
2474 {
2475 switch (stageNew)
2476 {
2481 break;
2482
2485 break;
2486 }
2487 }
2488
2489
2490
2491
2492
2494 {
2496 }
2497
2499 {
2501
2502
2504 }
2505
2507 {
2509 {
2512 }
2513 }
2514
2515
2517 {
2519 if (player)
2520 {
2522 player.ServerReplaceItemInHandsWithNew(lambda);
2523 }
2524 else
2525 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2526 }
2527
2529 {
2531 }
2532
2534 {
2535 super.SetActions();
2536
2539 }
2540
2542 {
2543 #ifndef SERVER
2545 {
2547
2550 }
2551 #endif
2552 }
2553
2555 {
2556 #ifndef SERVER
2558 {
2562 }
2563 #endif
2564 }
2565
2567 {
2568 return false;
2569 }
2570
2572 {
2574 }
2575
2576 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2577 {
2579
2580 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2582 if ( hasRootAsPlayer )
2584
2585
2586
2587
2588
2589
2590
2592 {
2593
2595 {
2597 {
2601 break;
2602
2606 break;
2607
2611 break;
2612
2616 default:
2619 return;
2620 }
2621
2622
2623 }
2624
2626
2628 {
2630 {
2631
2633 {
2635 }
2637 {
2640 {
2642 }
2643 else
2644 {
2646 {
2648 }
2649 else
2650 {
2652 }
2653 }
2654 }
2655 }
2656 }
2657
2658 }
2660 {
2661
2663 {
2665 {
2669 break;
2670
2674 break;
2675
2679 break;
2680
2684 break;
2685
2688 default:
2691 return;
2692 }
2693 }
2694
2696
2698 {
2700 {
2701
2703 {
2705 }
2706 }
2707 }
2708 }
2710 {
2711
2713 {
2715 {
2719 break;
2720
2723 default:
2726 return;
2727 }
2728 }
2729
2731
2733 {
2735 {
2736
2738 {
2740 }
2741 }
2742 }
2743 }
2744 else
2745 {
2746
2748
2750 {
2753
2754 }
2755 else
2756 {
2758 {
2761 }
2762 }
2763 }
2764 }
2765
2767 {
2768 if (
GetGame().IsDedicatedServer())
2769 return;
2770
2772 {
2774 GetInventory().GetCurrentInventoryLocation(invLoc);
2776 {
2778 if (ptcMgr)
2779 {
2784 }
2785 }
2786 }
2788 {
2790 {
2793 return;
2794 }
2795
2797 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2799 {
2802 }
2803 }
2804 }
2805
2806 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2807 {
2808 super.GetDebugActions(outputList);
2809
2811 {
2815 }
2816 }
2817
2819 {
2820 super.OnAction(action_id, player, ctx);
2821
2823 {
2824 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2825 {
2827 if (food_stage_prev <= 0)
2828 {
2830 }
2832 return true;
2833 }
2834 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2835 {
2838 {
2840 }
2842 return true;
2843 }
2844
2845 }
2846
2847 #ifdef DIAG_DEVELOPER
2848 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2849 {
2850 PrintNutritionsData();
2851 return true;
2852 }
2853 #endif
2854
2855 return false;
2856 }
2857
2859 {
2860 string debug_output;
2861
2862 debug_output = super.GetDebugText();
2863
2866
2867 return debug_output;
2868 }
2869
2870
2871
2872
2873
2875 {
2876 float ret = super.GetBaitEffectivity();
2877
2879 {
2880 ret *= 0.5;
2881 }
2882
2883 return ret;
2884 }
2885
2887 {
2889 }
2890
2892 {
2894 }
2895
2897 {
2899 }
2900
2901 #ifdef DIAG_DEVELOPER
2902 private void PrintNutritionsData()
2903 {
2904 string nutritionsData = "";
2905
2908
2910 if (profile)
2911 {
2912 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2914 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2918 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2920
2923
2924 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2926 }
2927
2928 nutritionsData += "-----\n";
2929
2931 }
2932 #endif
2933
2935
2938 {
2940 }
2941}
2942
2944{
2946};
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.