1857{
1859
1867
1877
1879
1881 {
1883 {
1885
1887 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1888
1892 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1893 }
1894 }
1895
1897 {
1899
1901 }
1902
1904 {
1905 super.EEDelete(parent);
1906
1908
1911 }
1912
1914 {
1915 super.EEItemLocationChanged(oldLoc, newLoc);
1916
1919 {
1920 switch (oldLoc.GetParent().GetType())
1921 {
1922 case "FryingPan":
1923 case "Pot":
1924 case "Cauldron":
1925 case "SharpWoodenStick":
1927 break;
1928 }
1929
1932 {
1934 }
1935 }
1936
1937 if (oldLoc.IsValid())
1939
1942 }
1943
1945 {
1948 }
1949
1951 {
1954
1955 return true;
1956 }
1957
1959 {
1961 {
1963 }
1964 }
1965
1968 {
1969 int foodStageType;
1970
1972 if (foodStage)
1973 foodStageType = foodStage.GetFoodStageType();
1974
1979
1980 return agentsIn;
1981 }
1982
1983
1985 {
1986 return false;
1987 }
1988
1990 {
1991 return false;
1992 }
1993
1995 {
1997 {
1999 {
2002
2005
2006 default:
2007 return super.GetTemperatureFreezeTime();
2008 }
2009 }
2010
2011 return super.GetTemperatureFreezeTime();
2012 }
2013
2015 {
2017 {
2019 {
2022
2025
2026 default:
2027 return super.GetTemperatureThawTime();
2028 }
2029 }
2030
2031 return super.GetTemperatureThawTime();
2032 }
2033
2035 {
2037 }
2038
2039
2040
2041
2043 {
2044 SetSynchDirty();
2045 }
2046
2048 {
2049 super.OnVariablesSynchronized();
2050
2051
2052
2053
2055 {
2057 }
2058 else
2059 {
2061 }
2062
2065 }
2066
2067
2068
2069
2071 {
2074
2076 }
2077
2079 {
2080 string soundName = "";
2081
2084
2086 {
2088 }
2089 else
2090 {
2092 {
2094 {
2099 else
2100 soundName = "";
2101 break;
2102 }
2103
2105 {
2110 else
2111 soundName = "";
2112 break;
2113 }
2114
2116 {
2121 else
2122 soundName = "";
2123 break;
2124 }
2125
2126 default:
2127 soundName = "";
2128 break;
2129 }
2130
2132 {
2133 if (soundName == "")
2134 {
2136 }
2137 else
2138 {
2140 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2141 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2143 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2144 {
2146 }
2147 }
2148 }
2149 }
2150
2152 }
2153
2155 {
2158 }
2159
2160
2161
2162
2164 {
2165 super.OnStoreSave(ctx);
2166
2168 {
2170 }
2171
2172
2175 }
2176
2178 {
2179 if (!super.OnStoreLoad(ctx, version))
2180 return false;
2181
2183 {
2185 return false;
2186 }
2187
2188 if (version >= 115)
2189 {
2191 {
2193 return false;
2194 }
2196 {
2198 return false;
2199 }
2200 }
2201
2204
2205 return true;
2206 }
2207
2209 {
2210 super.AfterStoreLoad();
2211
2213 }
2214
2215
2217 {
2219 }
2220
2221
2223 {
2224 return false;
2225 }
2226
2228 {
2229 return false;
2230 }
2231
2233 {
2234 return false;
2235 }
2236
2238 {
2239 return false;
2240 }
2241
2242
2243
2244
2245
2247 {
2250 {
2251 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2252 }
2253 else if (classname != "" && food_stage)
2254 {
2255 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2256 }
2257 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2258 return g_Game.ConfigGetFloat( class_path +
" fullnessIndex" );
2259
2260 }
2261
2263 {
2266 {
2268 }
2269 else if (classname != "" && food_stage)
2270 {
2271 return FoodStage.GetEnergy(null, food_stage, classname);
2272 }
2273 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2274 return g_Game.ConfigGetFloat( class_path +
" energy" );
2275 }
2276
2278 {
2281 {
2283 }
2284 else if (classname != "" && food_stage)
2285 {
2286 return FoodStage.GetWater(null, food_stage, classname);
2287 }
2288 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2289 return g_Game.ConfigGetFloat( class_path +
" water" );
2290 }
2291
2293 {
2296 {
2297 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2298 }
2299 else if (classname != "" && food_stage)
2300 {
2301 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2302 }
2303 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2304 return g_Game.ConfigGetFloat( class_path +
" nutritionalIndex" );
2305
2306 }
2307
2309 {
2312 {
2313 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2314 }
2315 else if (classname != "" && food_stage)
2316 {
2317 return FoodStage.GetToxicity(null, food_stage, classname);
2318 }
2319 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2320 return g_Game.ConfigGetFloat( class_path +
" toxicity" );
2321 }
2322
2324 {
2327 {
2329 }
2330 else if (classname != "" && food_stage)
2331 {
2332 return FoodStage.GetAgents(null, food_stage, classname);
2333 }
2334 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2335 return g_Game.ConfigGetInt( class_path +
" agents" );
2336 }
2337
2339 {
2342 {
2343 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2344 }
2345 else if (classname != "" && food_stage)
2346 {
2347 return FoodStage.GetDigestibility(null, food_stage, classname);
2348 }
2349 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2350 return g_Game.ConfigGetInt( class_path +
" digestibility" );
2351 }
2352
2354 {
2357 {
2358 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2359 }
2360 else if (className != "" && foodStage)
2361 {
2362 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2363 }
2364 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2365 return g_Game.ConfigGetInt(classPath +
" agentsPerDigest");
2366 }
2367
2369 {
2379
2380 return profile;
2381 }
2382
2383
2384
2385
2387 {
2389 }
2390
2391
2393 {
2395 {
2397 }
2398
2399 return false;
2400 }
2401
2403 {
2405 {
2407 }
2408
2409 return false;
2410 }
2411
2413 {
2415 {
2417 }
2418
2419 return false;
2420 }
2421
2423 {
2425 {
2427 }
2428
2429 return false;
2430 }
2431
2433 {
2435 {
2437 }
2438
2439 return false;
2440 }
2441
2443 {
2445 {
2447 }
2448
2449 return false;
2450 }
2451
2452
2454 {
2456 }
2457
2459 {
2460 return GetFoodStage().GetNextFoodStageType( cooking_method );
2461 }
2462
2464 {
2465 return GetFoodStage().GetFoodStageName( food_stage_type );
2466 }
2467
2469 {
2470 return GetFoodStage().CanChangeToNewStage( cooking_method );
2471 }
2472
2473
2475 {
2476 if ( !source.GetFoodStage())
2477 return;
2482 }
2483
2486 {
2489 }
2490
2493 {
2494 switch (stageNew)
2495 {
2500 break;
2501
2504 break;
2505 }
2506 }
2507
2508
2509
2510
2511
2513 {
2515 }
2516
2518 {
2520
2521
2523 }
2524
2526 {
2528 {
2531 }
2532 }
2533
2534
2536 {
2538 if (player)
2539 {
2541 player.ServerReplaceItemInHandsWithNew(lambda);
2542 }
2543 else
2544 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2545 }
2546
2548 {
2550 }
2551
2553 {
2554 super.SetActions();
2555
2558 }
2559
2561 {
2562 #ifndef SERVER
2563 #ifndef NO_GUI
2565 {
2567
2570 }
2571 #endif
2572 #endif
2573 }
2574
2576 {
2577 #ifndef SERVER
2578 #ifndef NO_GUI
2580 {
2584 }
2585 #endif
2586 #endif
2587 }
2588
2590 {
2591 return false;
2592 }
2593
2595 {
2597 }
2598
2599 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2600 {
2602
2603 delta *= DayZGame.Cast(
g_Game).GetFoodDecayModifier();
2605 if ( hasRootAsPlayer )
2607
2608
2609
2610
2611
2612
2613
2615 {
2616
2618 {
2620 {
2624 break;
2625
2629 break;
2630
2634 break;
2635
2639 default:
2642 return;
2643 }
2644
2645
2646 }
2647
2649
2651 {
2653 {
2654
2656 {
2658 }
2660 {
2663 {
2665 }
2666 else
2667 {
2669 {
2671 }
2672 else
2673 {
2675 }
2676 }
2677 }
2678 }
2679 }
2680
2681 }
2683 {
2684
2686 {
2688 {
2692 break;
2693
2697 break;
2698
2702 break;
2703
2707 break;
2708
2711 default:
2714 return;
2715 }
2716 }
2717
2719
2721 {
2723 {
2724
2726 {
2728 }
2729 }
2730 }
2731 }
2733 {
2734
2736 {
2738 {
2742 break;
2743
2746 default:
2749 return;
2750 }
2751 }
2752
2754
2756 {
2758 {
2759
2761 {
2763 }
2764 }
2765 }
2766 }
2767 else
2768 {
2769
2771
2773 {
2776
2777 }
2778 else
2779 {
2781 {
2784 }
2785 }
2786 }
2787 }
2788
2790 {
2791 if (
g_Game.IsHeadlessOrDedicatedServer())
2792 return;
2793
2795 {
2797 GetInventory().GetCurrentInventoryLocation(invLoc);
2799 {
2801 if (ptcMgr)
2802 {
2807 }
2808 }
2809 }
2811 {
2813 {
2816 return;
2817 }
2818
2820 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2822 {
2825 }
2826 }
2827 }
2828
2829 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2830 {
2832 {
2837 }
2838
2839 super.GetDebugActions(outputList);
2840 }
2841
2843 {
2844 super.OnAction(action_id, player, ctx);
2845
2847 {
2848 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2849 {
2851 if (food_stage_prev <= 0)
2852 {
2854 }
2856 return true;
2857 }
2858 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2859 {
2862 {
2864 }
2866 return true;
2867 }
2868
2869 }
2870
2871 #ifdef DIAG_DEVELOPER
2872 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2873 {
2874 PrintNutritionsData();
2875 return true;
2876 }
2877 #endif
2878
2879 return false;
2880 }
2881
2883 {
2884 string debug_output;
2885
2886 debug_output = super.GetDebugText();
2887
2890
2891 return debug_output;
2892 }
2893
2894
2895
2896
2897
2899 {
2900 float ret = super.GetBaitEffectivity();
2901
2903 {
2904 ret *= 0.5;
2905 }
2906
2907 return ret;
2908 }
2909
2911 {
2913 }
2914
2916 {
2918 }
2919
2921 {
2923 }
2924
2925 #ifdef DIAG_DEVELOPER
2926 private void PrintNutritionsData()
2927 {
2928 string nutritionsData = "";
2929
2932
2934 if (profile)
2935 {
2936 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2938 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2942 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2944
2947
2948 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2950 }
2951
2952 nutritionsData += "-----\n";
2953
2955 }
2956 #endif
2957
2959
2962 {
2964 }
2965}
2966
2968{
2970};
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.