1849{
1851
1859
1869
1871
1873 {
1875 {
1877
1879 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1880
1884 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1885 }
1886 }
1887
1889 {
1891
1893 }
1894
1896 {
1897 super.EEDelete(parent);
1898
1900
1903 }
1904
1906 {
1907 super.EEItemLocationChanged(oldLoc, newLoc);
1908
1911 {
1912 switch (oldLoc.GetParent().GetType())
1913 {
1914 case "FryingPan":
1915 case "Pot":
1916 case "Cauldron":
1917 case "SharpWoodenStick":
1919 break;
1920 }
1921
1924 {
1926 }
1927 }
1928
1929 if (oldLoc.IsValid())
1931
1934 }
1935
1937 {
1940 }
1941
1943 {
1946
1947 return true;
1948 }
1949
1951 {
1953 {
1955 }
1956 }
1957
1960 {
1961 int foodStageType;
1962
1964 if (foodStage)
1965 foodStageType = foodStage.GetFoodStageType();
1966
1971
1972 return agentsIn;
1973 }
1974
1975
1977 {
1978 return false;
1979 }
1980
1982 {
1983 return false;
1984 }
1985
1987 {
1989 {
1991 {
1994
1997
1998 default:
1999 return super.GetTemperatureFreezeTime();
2000 }
2001 }
2002
2003 return super.GetTemperatureFreezeTime();
2004 }
2005
2007 {
2009 {
2011 {
2014
2017
2018 default:
2019 return super.GetTemperatureThawTime();
2020 }
2021 }
2022
2023 return super.GetTemperatureThawTime();
2024 }
2025
2027 {
2029 }
2030
2031
2032
2033
2035 {
2036 SetSynchDirty();
2037 }
2038
2040 {
2041 super.OnVariablesSynchronized();
2042
2043
2044
2045
2047 {
2049 }
2050 else
2051 {
2053 }
2054
2057 }
2058
2059
2060
2061
2063 {
2066
2068 }
2069
2071 {
2072 string soundName = "";
2073
2076
2078 {
2080 }
2081 else
2082 {
2084 {
2086 {
2091 else
2092 soundName = "";
2093 break;
2094 }
2095
2097 {
2102 else
2103 soundName = "";
2104 break;
2105 }
2106
2108 {
2113 else
2114 soundName = "";
2115 break;
2116 }
2117
2118 default:
2119 soundName = "";
2120 break;
2121 }
2122
2124 {
2125 if (soundName == "")
2126 {
2128 }
2129 else
2130 {
2132 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2133 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2135 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2136 {
2138 }
2139 }
2140 }
2141 }
2142
2144 }
2145
2147 {
2150 }
2151
2152
2153
2154
2156 {
2157 super.OnStoreSave(ctx);
2158
2160 {
2162 }
2163
2164
2167 }
2168
2170 {
2171 if (!super.OnStoreLoad(ctx, version))
2172 return false;
2173
2175 {
2177 return false;
2178 }
2179
2180 if (version >= 115)
2181 {
2183 {
2185 return false;
2186 }
2188 {
2190 return false;
2191 }
2192 }
2193
2196
2197 return true;
2198 }
2199
2201 {
2202 super.AfterStoreLoad();
2203
2205 }
2206
2207
2209 {
2211 }
2212
2213
2215 {
2216 return false;
2217 }
2218
2220 {
2221 return false;
2222 }
2223
2225 {
2226 return false;
2227 }
2228
2230 {
2231 return false;
2232 }
2233
2234
2235
2236
2237
2239 {
2242 {
2243 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2244 }
2245 else if (classname != "" && food_stage)
2246 {
2247 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2248 }
2249 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2251
2252 }
2253
2255 {
2258 {
2260 }
2261 else if (classname != "" && food_stage)
2262 {
2263 return FoodStage.GetEnergy(null, food_stage, classname);
2264 }
2265 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2267 }
2268
2270 {
2273 {
2275 }
2276 else if (classname != "" && food_stage)
2277 {
2278 return FoodStage.GetWater(null, food_stage, classname);
2279 }
2280 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2282 }
2283
2285 {
2288 {
2289 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2290 }
2291 else if (classname != "" && food_stage)
2292 {
2293 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2294 }
2295 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2297
2298 }
2299
2301 {
2304 {
2305 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2306 }
2307 else if (classname != "" && food_stage)
2308 {
2309 return FoodStage.GetToxicity(null, food_stage, classname);
2310 }
2311 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2313 }
2314
2316 {
2319 {
2321 }
2322 else if (classname != "" && food_stage)
2323 {
2324 return FoodStage.GetAgents(null, food_stage, classname);
2325 }
2326 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2328 }
2329
2331 {
2334 {
2335 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2336 }
2337 else if (classname != "" && food_stage)
2338 {
2339 return FoodStage.GetDigestibility(null, food_stage, classname);
2340 }
2341 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2343 }
2344
2346 {
2349 {
2350 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2351 }
2352 else if (className != "" && foodStage)
2353 {
2354 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2355 }
2356 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2358 }
2359
2361 {
2371
2372 return profile;
2373 }
2374
2375
2376
2377
2379 {
2381 }
2382
2383
2385 {
2387 {
2389 }
2390
2391 return false;
2392 }
2393
2395 {
2397 {
2399 }
2400
2401 return false;
2402 }
2403
2405 {
2407 {
2409 }
2410
2411 return false;
2412 }
2413
2415 {
2417 {
2419 }
2420
2421 return false;
2422 }
2423
2425 {
2427 {
2429 }
2430
2431 return false;
2432 }
2433
2435 {
2437 {
2439 }
2440
2441 return false;
2442 }
2443
2444
2446 {
2448 }
2449
2451 {
2452 return GetFoodStage().GetNextFoodStageType( cooking_method );
2453 }
2454
2456 {
2457 return GetFoodStage().GetFoodStageName( food_stage_type );
2458 }
2459
2461 {
2462 return GetFoodStage().CanChangeToNewStage( cooking_method );
2463 }
2464
2465
2467 {
2468 if ( !source.GetFoodStage())
2469 return;
2474 }
2475
2478 {
2481 }
2482
2485 {
2486 switch (stageNew)
2487 {
2492 break;
2493
2496 break;
2497 }
2498 }
2499
2500
2501
2502
2503
2505 {
2507 }
2508
2510 {
2512
2513
2515 }
2516
2518 {
2520 {
2523 }
2524 }
2525
2526
2528 {
2530 if (player)
2531 {
2533 player.ServerReplaceItemInHandsWithNew(lambda);
2534 }
2535 else
2536 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2537 }
2538
2540 {
2542 }
2543
2545 {
2546 super.SetActions();
2547
2550 }
2551
2553 {
2554 #ifndef SERVER
2556 {
2558
2561 }
2562 #endif
2563 }
2564
2566 {
2567 #ifndef SERVER
2569 {
2573 }
2574 #endif
2575 }
2576
2578 {
2579 return false;
2580 }
2581
2583 {
2585 }
2586
2587 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2588 {
2590
2591 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2593 if ( hasRootAsPlayer )
2595
2596
2597
2598
2599
2600
2601
2603 {
2604
2606 {
2608 {
2612 break;
2613
2617 break;
2618
2622 break;
2623
2627 default:
2630 return;
2631 }
2632
2633
2634 }
2635
2637
2639 {
2641 {
2642
2644 {
2646 }
2648 {
2651 {
2653 }
2654 else
2655 {
2657 {
2659 }
2660 else
2661 {
2663 }
2664 }
2665 }
2666 }
2667 }
2668
2669 }
2671 {
2672
2674 {
2676 {
2680 break;
2681
2685 break;
2686
2690 break;
2691
2695 break;
2696
2699 default:
2702 return;
2703 }
2704 }
2705
2707
2709 {
2711 {
2712
2714 {
2716 }
2717 }
2718 }
2719 }
2721 {
2722
2724 {
2726 {
2730 break;
2731
2734 default:
2737 return;
2738 }
2739 }
2740
2742
2744 {
2746 {
2747
2749 {
2751 }
2752 }
2753 }
2754 }
2755 else
2756 {
2757
2759
2761 {
2764
2765 }
2766 else
2767 {
2769 {
2772 }
2773 }
2774 }
2775 }
2776
2778 {
2779 if (
GetGame().IsDedicatedServer())
2780 return;
2781
2783 {
2785 GetInventory().GetCurrentInventoryLocation(invLoc);
2787 {
2789 if (ptcMgr)
2790 {
2795 }
2796 }
2797 }
2799 {
2801 {
2804 return;
2805 }
2806
2808 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2810 {
2813 }
2814 }
2815 }
2816
2817 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2818 {
2820 {
2825 }
2826
2827 super.GetDebugActions(outputList);
2828 }
2829
2831 {
2832 super.OnAction(action_id, player, ctx);
2833
2835 {
2836 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2837 {
2839 if (food_stage_prev <= 0)
2840 {
2842 }
2844 return true;
2845 }
2846 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2847 {
2850 {
2852 }
2854 return true;
2855 }
2856
2857 }
2858
2859 #ifdef DIAG_DEVELOPER
2860 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2861 {
2862 PrintNutritionsData();
2863 return true;
2864 }
2865 #endif
2866
2867 return false;
2868 }
2869
2871 {
2872 string debug_output;
2873
2874 debug_output = super.GetDebugText();
2875
2878
2879 return debug_output;
2880 }
2881
2882
2883
2884
2885
2887 {
2888 float ret = super.GetBaitEffectivity();
2889
2891 {
2892 ret *= 0.5;
2893 }
2894
2895 return ret;
2896 }
2897
2899 {
2901 }
2902
2904 {
2906 }
2907
2909 {
2911 }
2912
2913 #ifdef DIAG_DEVELOPER
2914 private void PrintNutritionsData()
2915 {
2916 string nutritionsData = "";
2917
2920
2922 if (profile)
2923 {
2924 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2926 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2930 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2932
2935
2936 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2938 }
2939
2940 nutritionsData += "-----\n";
2941
2943 }
2944 #endif
2945
2947
2950 {
2952 }
2953}
2954
2956{
2958};
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.