2038{
2040
2048
2058
2060
2062 {
2064 {
2066
2068 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
2069
2073 RegisterNetSyncVariableBool("m_MakeCookingSounds");
2074 }
2075 }
2076
2078 {
2080
2082 }
2083
2085 {
2086 super.EEDelete(parent);
2087
2089
2092 }
2093
2095 {
2096 super.EEItemLocationChanged(oldLoc, newLoc);
2097
2100 {
2101 switch (oldLoc.GetParent().GetType())
2102 {
2103 case "FryingPan":
2104 case "Pot":
2105 case "Cauldron":
2106 case "SharpWoodenStick":
2108 break;
2109 }
2110
2113 {
2115 }
2116 }
2117
2118 if (oldLoc.IsValid())
2120
2123 }
2124
2126 {
2129 }
2130
2132 {
2135
2136 return true;
2137 }
2138
2140 {
2142 {
2144 }
2145 }
2146
2149 {
2150 int foodStageType;
2151
2153 if (foodStage)
2154 foodStageType = foodStage.GetFoodStageType();
2155
2160
2161 return agentsIn;
2162 }
2163
2164
2166 {
2167 return false;
2168 }
2169
2171 {
2172 return false;
2173 }
2174
2176 {
2178 {
2180 {
2183
2186
2187 default:
2188 return super.GetTemperatureFreezeTime();
2189 }
2190 }
2191
2192 return super.GetTemperatureFreezeTime();
2193 }
2194
2196 {
2198 {
2200 {
2203
2206
2207 default:
2208 return super.GetTemperatureThawTime();
2209 }
2210 }
2211
2212 return super.GetTemperatureThawTime();
2213 }
2214
2216 {
2218 }
2219
2220
2221
2222
2224 {
2225 SetSynchDirty();
2226 }
2227
2229 {
2230 super.OnVariablesSynchronized();
2231
2232
2233
2234
2236 {
2238 }
2239 else
2240 {
2242 }
2243
2246 }
2247
2248
2249
2250
2252 {
2255
2257 }
2258
2260 {
2261 string soundName = "";
2262
2265
2267 {
2269 }
2270 else
2271 {
2273 {
2275 {
2280 else
2281 soundName = "";
2282 break;
2283 }
2284
2286 {
2291 else
2292 soundName = "";
2293 break;
2294 }
2295
2297 {
2302 else
2303 soundName = "";
2304 break;
2305 }
2306
2307 default:
2308 soundName = "";
2309 break;
2310 }
2311
2313 {
2314 if (soundName == "")
2315 {
2317 }
2318 else
2319 {
2321 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2322 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2324 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2325 {
2327 }
2328 }
2329 }
2330 }
2331
2333 }
2334
2336 {
2339 }
2340
2341
2342
2343
2345 {
2346 super.OnStoreSave(ctx);
2347
2349 {
2351 }
2352
2353
2356 }
2357
2359 {
2360 if (!super.OnStoreLoad(ctx, version))
2361 return false;
2362
2364 {
2366 return false;
2367 }
2368
2369 if (version >= 115)
2370 {
2372 {
2374 return false;
2375 }
2377 {
2379 return false;
2380 }
2381 }
2382
2385
2386 return true;
2387 }
2388
2390 {
2391 super.AfterStoreLoad();
2392
2394 }
2395
2396
2398 {
2400 }
2401
2402
2404 {
2405 return false;
2406 }
2407
2409 {
2410 return false;
2411 }
2412
2414 {
2415 return false;
2416 }
2417
2419 {
2420 return false;
2421 }
2422
2423
2424
2425
2426
2428 {
2431 {
2432 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2433 }
2434 else if (classname != "" && food_stage)
2435 {
2436 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2437 }
2438 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2440
2441 }
2442
2444 {
2447 {
2449 }
2450 else if (classname != "" && food_stage)
2451 {
2452 return FoodStage.GetEnergy(null, food_stage, classname);
2453 }
2454 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2456 }
2457
2459 {
2462 {
2464 }
2465 else if (classname != "" && food_stage)
2466 {
2467 return FoodStage.GetWater(null, food_stage, classname);
2468 }
2469 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2471 }
2472
2474 {
2477 {
2478 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2479 }
2480 else if (classname != "" && food_stage)
2481 {
2482 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2483 }
2484 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2486
2487 }
2488
2490 {
2493 {
2494 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2495 }
2496 else if (classname != "" && food_stage)
2497 {
2498 return FoodStage.GetToxicity(null, food_stage, classname);
2499 }
2500 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2502 }
2503
2505 {
2508 {
2510 }
2511 else if (classname != "" && food_stage)
2512 {
2513 return FoodStage.GetAgents(null, food_stage, classname);
2514 }
2515 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2517 }
2518
2520 {
2523 {
2524 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2525 }
2526 else if (classname != "" && food_stage)
2527 {
2528 return FoodStage.GetDigestibility(null, food_stage, classname);
2529 }
2530 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2532 }
2533
2535 {
2538 {
2539 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2540 }
2541 else if (className != "" && foodStage)
2542 {
2543 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2544 }
2545 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2547 }
2548
2550 {
2560
2561 return profile;
2562 }
2563
2564
2565
2566
2568 {
2570 }
2571
2572
2574 {
2576 {
2578 }
2579
2580 return false;
2581 }
2582
2584 {
2586 {
2588 }
2589
2590 return false;
2591 }
2592
2594 {
2596 {
2598 }
2599
2600 return false;
2601 }
2602
2604 {
2606 {
2608 }
2609
2610 return false;
2611 }
2612
2614 {
2616 {
2618 }
2619
2620 return false;
2621 }
2622
2624 {
2626 {
2628 }
2629
2630 return false;
2631 }
2632
2633
2635 {
2637 }
2638
2640 {
2641 return GetFoodStage().GetNextFoodStageType( cooking_method );
2642 }
2643
2645 {
2646 return GetFoodStage().GetFoodStageName( food_stage_type );
2647 }
2648
2650 {
2651 return GetFoodStage().CanChangeToNewStage( cooking_method );
2652 }
2653
2654
2656 {
2657 if ( !source.GetFoodStage())
2658 return;
2663 }
2664
2667 {
2670 }
2671
2674 {
2675 switch (stageNew)
2676 {
2681 break;
2682
2685 break;
2686 }
2687 }
2688
2689
2690
2691
2692
2694 {
2696 }
2697
2699 {
2701
2702
2704 }
2705
2707 {
2709 {
2712 }
2713 }
2714
2715
2717 {
2719 if (player)
2720 {
2722 player.ServerReplaceItemInHandsWithNew(lambda);
2723 }
2724 else
2725 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2726 }
2727
2729 {
2731 }
2732
2734 {
2735 super.SetActions();
2736
2739 }
2740
2742 {
2743 #ifndef SERVER
2745 {
2747
2750 }
2751 #endif
2752 }
2753
2755 {
2756 #ifndef SERVER
2758 {
2762 }
2763 #endif
2764 }
2765
2767 {
2768 return false;
2769 }
2770
2772 {
2774 }
2775
2776 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2777 {
2779
2780 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2782 if ( hasRootAsPlayer )
2784
2785
2786
2787
2788
2789
2790
2792 {
2793
2795 {
2797 {
2801 break;
2802
2806 break;
2807
2811 break;
2812
2816 default:
2819 return;
2820 }
2821
2822
2823 }
2824
2826
2828 {
2830 {
2831
2833 {
2835 }
2837 {
2840 {
2842 }
2843 else
2844 {
2846 {
2848 }
2849 else
2850 {
2852 }
2853 }
2854 }
2855 }
2856 }
2857
2858 }
2860 {
2861
2863 {
2865 {
2869 break;
2870
2874 break;
2875
2879 break;
2880
2884 break;
2885
2888 default:
2891 return;
2892 }
2893 }
2894
2896
2898 {
2900 {
2901
2903 {
2905 }
2906 }
2907 }
2908 }
2910 {
2911
2913 {
2915 {
2919 break;
2920
2923 default:
2926 return;
2927 }
2928 }
2929
2931
2933 {
2935 {
2936
2938 {
2940 }
2941 }
2942 }
2943 }
2944 else
2945 {
2946
2948
2950 {
2953
2954 }
2955 else
2956 {
2958 {
2961 }
2962 }
2963 }
2964 }
2965
2967 {
2968 if (
GetGame().IsDedicatedServer())
2969 return;
2970
2972 {
2974 GetInventory().GetCurrentInventoryLocation(invLoc);
2976 {
2978 if (ptcMgr)
2979 {
2984 }
2985 }
2986 }
2988 {
2990 {
2993 return;
2994 }
2995
2997 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2999 {
3002 }
3003 }
3004 }
3005
3006 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
3007 {
3008 super.GetDebugActions(outputList);
3009
3011 {
3015 }
3016 }
3017
3019 {
3020 super.OnAction(action_id, player, ctx);
3021
3023 {
3024 if ( action_id ==
EActions.FOOD_STAGE_PREV )
3025 {
3027 if (food_stage_prev <= 0)
3028 {
3030 }
3032 return true;
3033 }
3034 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
3035 {
3038 {
3040 }
3042 return true;
3043 }
3044
3045 }
3046
3047 #ifdef DIAG_DEVELOPER
3048 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
3049 {
3050 PrintNutritionsData();
3051 return true;
3052 }
3053 #endif
3054
3055 return false;
3056 }
3057
3059 {
3060 string debug_output;
3061
3062 debug_output = super.GetDebugText();
3063
3066
3067 return debug_output;
3068 }
3069
3070
3071
3072
3073
3075 {
3076 float ret = super.GetBaitEffectivity();
3077
3079 {
3080 ret *= 0.5;
3081 }
3082
3083 return ret;
3084 }
3085
3087 {
3089 }
3090
3092 {
3094 }
3095
3097 {
3099 }
3100
3101 #ifdef DIAG_DEVELOPER
3102 private void PrintNutritionsData()
3103 {
3104 string nutritionsData = "";
3105
3108
3110 if (profile)
3111 {
3112 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
3114 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
3118 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
3120
3123
3124 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
3126 }
3127
3128 nutritionsData += "-----\n";
3129
3131 }
3132 #endif
3133
3135
3138 {
3140 }
3141}
3142
3144{
3146};
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.