2039{
2041
2049
2059
2061
2063 {
2065 {
2067
2069 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
2070
2074 RegisterNetSyncVariableBool("m_MakeCookingSounds");
2075 }
2076 }
2077
2079 {
2081
2083 }
2084
2086 {
2087 super.EEDelete(parent);
2088
2090
2093 }
2094
2096 {
2097 super.EEItemLocationChanged(oldLoc, newLoc);
2098
2101 {
2102 switch (oldLoc.GetParent().GetType())
2103 {
2104 case "FryingPan":
2105 case "Pot":
2106 case "Cauldron":
2107 case "SharpWoodenStick":
2109 break;
2110 }
2111
2114 {
2116 }
2117 }
2118
2119 if (oldLoc.IsValid())
2121
2124 }
2125
2127 {
2130 }
2131
2133 {
2136
2137 return true;
2138 }
2139
2141 {
2143 {
2145 }
2146 }
2147
2150 {
2151 int foodStageType;
2152
2154 if (foodStage)
2155 foodStageType = foodStage.GetFoodStageType();
2156
2161
2162 return agentsIn;
2163 }
2164
2165
2167 {
2168 return false;
2169 }
2170
2172 {
2173 return false;
2174 }
2175
2177 {
2179 {
2181 {
2184
2187
2188 default:
2189 return super.GetTemperatureFreezeTime();
2190 }
2191 }
2192
2193 return super.GetTemperatureFreezeTime();
2194 }
2195
2197 {
2199 {
2201 {
2204
2207
2208 default:
2209 return super.GetTemperatureThawTime();
2210 }
2211 }
2212
2213 return super.GetTemperatureThawTime();
2214 }
2215
2217 {
2219 }
2220
2221
2222
2223
2225 {
2226 SetSynchDirty();
2227 }
2228
2230 {
2231 super.OnVariablesSynchronized();
2232
2233
2234
2235
2237 {
2239 }
2240 else
2241 {
2243 }
2244
2247 }
2248
2249
2250
2251
2253 {
2256
2258 }
2259
2261 {
2262 string soundName = "";
2263
2266
2268 {
2270 }
2271 else
2272 {
2274 {
2276 {
2281 else
2282 soundName = "";
2283 break;
2284 }
2285
2287 {
2292 else
2293 soundName = "";
2294 break;
2295 }
2296
2298 {
2303 else
2304 soundName = "";
2305 break;
2306 }
2307
2308 default:
2309 soundName = "";
2310 break;
2311 }
2312
2314 {
2315 if (soundName == "")
2316 {
2318 }
2319 else
2320 {
2322 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2323 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2325 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2326 {
2328 }
2329 }
2330 }
2331 }
2332
2334 }
2335
2337 {
2340 }
2341
2342
2343
2344
2346 {
2347 super.OnStoreSave(ctx);
2348
2350 {
2352 }
2353
2354
2357 }
2358
2360 {
2361 if (!super.OnStoreLoad(ctx, version))
2362 return false;
2363
2365 {
2367 return false;
2368 }
2369
2370 if (version >= 115)
2371 {
2373 {
2375 return false;
2376 }
2378 {
2380 return false;
2381 }
2382 }
2383
2386
2387 return true;
2388 }
2389
2391 {
2392 super.AfterStoreLoad();
2393
2395 }
2396
2397
2399 {
2401 }
2402
2403
2405 {
2406 return false;
2407 }
2408
2410 {
2411 return false;
2412 }
2413
2415 {
2416 return false;
2417 }
2418
2420 {
2421 return false;
2422 }
2423
2424
2425
2426
2427
2429 {
2432 {
2433 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2434 }
2435 else if (classname != "" && food_stage)
2436 {
2437 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2438 }
2439 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2441
2442 }
2443
2445 {
2448 {
2450 }
2451 else if (classname != "" && food_stage)
2452 {
2453 return FoodStage.GetEnergy(null, food_stage, classname);
2454 }
2455 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2457 }
2458
2460 {
2463 {
2465 }
2466 else if (classname != "" && food_stage)
2467 {
2468 return FoodStage.GetWater(null, food_stage, classname);
2469 }
2470 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2472 }
2473
2475 {
2478 {
2479 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2480 }
2481 else if (classname != "" && food_stage)
2482 {
2483 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2484 }
2485 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2487
2488 }
2489
2491 {
2494 {
2495 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2496 }
2497 else if (classname != "" && food_stage)
2498 {
2499 return FoodStage.GetToxicity(null, food_stage, classname);
2500 }
2501 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2503 }
2504
2506 {
2509 {
2511 }
2512 else if (classname != "" && food_stage)
2513 {
2514 return FoodStage.GetAgents(null, food_stage, classname);
2515 }
2516 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2518 }
2519
2521 {
2524 {
2525 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2526 }
2527 else if (classname != "" && food_stage)
2528 {
2529 return FoodStage.GetDigestibility(null, food_stage, classname);
2530 }
2531 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2533 }
2534
2536 {
2539 {
2540 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2541 }
2542 else if (className != "" && foodStage)
2543 {
2544 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2545 }
2546 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2548 }
2549
2551 {
2561
2562 return profile;
2563 }
2564
2565
2566
2567
2569 {
2571 }
2572
2573
2575 {
2577 {
2579 }
2580
2581 return false;
2582 }
2583
2585 {
2587 {
2589 }
2590
2591 return false;
2592 }
2593
2595 {
2597 {
2599 }
2600
2601 return false;
2602 }
2603
2605 {
2607 {
2609 }
2610
2611 return false;
2612 }
2613
2615 {
2617 {
2619 }
2620
2621 return false;
2622 }
2623
2625 {
2627 {
2629 }
2630
2631 return false;
2632 }
2633
2634
2636 {
2638 }
2639
2641 {
2642 return GetFoodStage().GetNextFoodStageType( cooking_method );
2643 }
2644
2646 {
2647 return GetFoodStage().GetFoodStageName( food_stage_type );
2648 }
2649
2651 {
2652 return GetFoodStage().CanChangeToNewStage( cooking_method );
2653 }
2654
2655
2657 {
2658 if ( !source.GetFoodStage())
2659 return;
2664 }
2665
2668 {
2671 }
2672
2675 {
2676 switch (stageNew)
2677 {
2682 break;
2683
2686 break;
2687 }
2688 }
2689
2690
2691
2692
2693
2695 {
2697 }
2698
2700 {
2702
2703
2705 }
2706
2708 {
2710 {
2713 }
2714 }
2715
2716
2718 {
2720 if (player)
2721 {
2723 player.ServerReplaceItemInHandsWithNew(lambda);
2724 }
2725 else
2726 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2727 }
2728
2730 {
2732 }
2733
2735 {
2736 super.SetActions();
2737
2740 }
2741
2743 {
2744 #ifndef SERVER
2746 {
2748
2751 }
2752 #endif
2753 }
2754
2756 {
2757 #ifndef SERVER
2759 {
2763 }
2764 #endif
2765 }
2766
2768 {
2769 return false;
2770 }
2771
2773 {
2775 }
2776
2777 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2778 {
2780
2781 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2783 if ( hasRootAsPlayer )
2785
2786
2787
2788
2789
2790
2791
2793 {
2794
2796 {
2798 {
2802 break;
2803
2807 break;
2808
2812 break;
2813
2817 default:
2820 return;
2821 }
2822
2823
2824 }
2825
2827
2829 {
2831 {
2832
2834 {
2836 }
2838 {
2841 {
2843 }
2844 else
2845 {
2847 {
2849 }
2850 else
2851 {
2853 }
2854 }
2855 }
2856 }
2857 }
2858
2859 }
2861 {
2862
2864 {
2866 {
2870 break;
2871
2875 break;
2876
2880 break;
2881
2885 break;
2886
2889 default:
2892 return;
2893 }
2894 }
2895
2897
2899 {
2901 {
2902
2904 {
2906 }
2907 }
2908 }
2909 }
2911 {
2912
2914 {
2916 {
2920 break;
2921
2924 default:
2927 return;
2928 }
2929 }
2930
2932
2934 {
2936 {
2937
2939 {
2941 }
2942 }
2943 }
2944 }
2945 else
2946 {
2947
2949
2951 {
2954
2955 }
2956 else
2957 {
2959 {
2962 }
2963 }
2964 }
2965 }
2966
2968 {
2969 if (
GetGame().IsDedicatedServer())
2970 return;
2971
2973 {
2975 GetInventory().GetCurrentInventoryLocation(invLoc);
2977 {
2979 if (ptcMgr)
2980 {
2985 }
2986 }
2987 }
2989 {
2991 {
2994 return;
2995 }
2996
2998 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
3000 {
3003 }
3004 }
3005 }
3006
3007 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
3008 {
3010 {
3015 }
3016
3017 super.GetDebugActions(outputList);
3018 }
3019
3021 {
3022 super.OnAction(action_id, player, ctx);
3023
3025 {
3026 if ( action_id ==
EActions.FOOD_STAGE_PREV )
3027 {
3029 if (food_stage_prev <= 0)
3030 {
3032 }
3034 return true;
3035 }
3036 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
3037 {
3040 {
3042 }
3044 return true;
3045 }
3046
3047 }
3048
3049 #ifdef DIAG_DEVELOPER
3050 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
3051 {
3052 PrintNutritionsData();
3053 return true;
3054 }
3055 #endif
3056
3057 return false;
3058 }
3059
3061 {
3062 string debug_output;
3063
3064 debug_output = super.GetDebugText();
3065
3068
3069 return debug_output;
3070 }
3071
3072
3073
3074
3075
3077 {
3078 float ret = super.GetBaitEffectivity();
3079
3081 {
3082 ret *= 0.5;
3083 }
3084
3085 return ret;
3086 }
3087
3089 {
3091 }
3092
3094 {
3096 }
3097
3099 {
3101 }
3102
3103 #ifdef DIAG_DEVELOPER
3104 private void PrintNutritionsData()
3105 {
3106 string nutritionsData = "";
3107
3110
3112 if (profile)
3113 {
3114 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
3116 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
3120 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
3122
3125
3126 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
3128 }
3129
3130 nutritionsData += "-----\n";
3131
3133 }
3134 #endif
3135
3137
3140 {
3142 }
3143}
3144
3146{
3148};
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.