2158{
2160
2168
2178
2180
2182 {
2184 {
2186
2188 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
2189
2193 RegisterNetSyncVariableBool("m_MakeCookingSounds");
2194 }
2195 }
2196
2198 {
2200
2202 }
2203
2205 {
2206 super.EEDelete(parent);
2207
2209
2212 }
2213
2215 {
2216 super.EEItemLocationChanged(oldLoc, newLoc);
2217
2220 {
2221 switch (oldLoc.GetParent().GetType())
2222 {
2223 case "FryingPan":
2224 case "Pot":
2225 case "Cauldron":
2226 case "SharpWoodenStick":
2228 break;
2229 }
2230
2233 {
2235 }
2236 }
2237
2238 if (oldLoc.IsValid())
2240
2243 }
2244
2246 {
2249 }
2250
2252 {
2255
2256 return true;
2257 }
2258
2260 {
2262 {
2264 }
2265 }
2266
2269 {
2270 int foodStageType;
2271
2273 if (foodStage)
2274 foodStageType = foodStage.GetFoodStageType();
2275
2280
2281 return agentsIn;
2282 }
2283
2284
2286 {
2287 return false;
2288 }
2289
2291 {
2292 return false;
2293 }
2294
2296 {
2298 {
2300 {
2303
2306
2307 default:
2308 return super.GetTemperatureFreezeTime();
2309 }
2310 }
2311
2312 return super.GetTemperatureFreezeTime();
2313 }
2314
2316 {
2318 {
2320 {
2323
2326
2327 default:
2328 return super.GetTemperatureThawTime();
2329 }
2330 }
2331
2332 return super.GetTemperatureThawTime();
2333 }
2334
2336 {
2338 }
2339
2340
2341
2342
2344 {
2345 SetSynchDirty();
2346 }
2347
2349 {
2350 super.OnVariablesSynchronized();
2351
2352
2353
2354
2356 {
2358 }
2359 else
2360 {
2362 }
2363
2366 }
2367
2368
2369
2370
2372 {
2375
2377 }
2378
2380 {
2381 string soundName = "";
2382
2385
2387 {
2389 }
2390 else
2391 {
2393 {
2395 {
2400 else
2401 soundName = "";
2402 break;
2403 }
2404
2406 {
2411 else
2412 soundName = "";
2413 break;
2414 }
2415
2417 {
2422 else
2423 soundName = "";
2424 break;
2425 }
2426
2427 default:
2428 soundName = "";
2429 break;
2430 }
2431
2433 {
2434 if (soundName == "")
2435 {
2437 }
2438 else
2439 {
2441 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2442 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2444 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2445 {
2447 }
2448 }
2449 }
2450 }
2451
2453 }
2454
2456 {
2459 }
2460
2461
2462
2463
2465 {
2466 super.OnStoreSave(ctx);
2467
2469 {
2471 }
2472
2473
2476 }
2477
2479 {
2480 if (!super.OnStoreLoad(ctx, version))
2481 return false;
2482
2484 {
2486 return false;
2487 }
2488
2489 if (version >= 115)
2490 {
2492 {
2494 return false;
2495 }
2497 {
2499 return false;
2500 }
2501 }
2502
2505
2506 return true;
2507 }
2508
2510 {
2511 super.AfterStoreLoad();
2512
2514 }
2515
2516
2518 {
2520 }
2521
2522
2524 {
2525 return false;
2526 }
2527
2529 {
2530 return false;
2531 }
2532
2534 {
2535 return false;
2536 }
2537
2539 {
2540 return false;
2541 }
2542
2543
2544
2545
2546
2548 {
2551 {
2552 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2553 }
2554 else if (classname != "" && food_stage)
2555 {
2556 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2557 }
2558 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2560
2561 }
2562
2564 {
2567 {
2569 }
2570 else if (classname != "" && food_stage)
2571 {
2572 return FoodStage.GetEnergy(null, food_stage, classname);
2573 }
2574 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2576 }
2577
2579 {
2582 {
2584 }
2585 else if (classname != "" && food_stage)
2586 {
2587 return FoodStage.GetWater(null, food_stage, classname);
2588 }
2589 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2591 }
2592
2594 {
2597 {
2598 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2599 }
2600 else if (classname != "" && food_stage)
2601 {
2602 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2603 }
2604 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2606
2607 }
2608
2610 {
2613 {
2614 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2615 }
2616 else if (classname != "" && food_stage)
2617 {
2618 return FoodStage.GetToxicity(null, food_stage, classname);
2619 }
2620 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2622 }
2623
2625 {
2628 {
2630 }
2631 else if (classname != "" && food_stage)
2632 {
2633 return FoodStage.GetAgents(null, food_stage, classname);
2634 }
2635 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2637 }
2638
2640 {
2643 {
2644 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2645 }
2646 else if (classname != "" && food_stage)
2647 {
2648 return FoodStage.GetDigestibility(null, food_stage, classname);
2649 }
2650 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2652 }
2653
2655 {
2658 {
2659 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2660 }
2661 else if (className != "" && foodStage)
2662 {
2663 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2664 }
2665 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2667 }
2668
2670 {
2680
2681 return profile;
2682 }
2683
2684
2685
2686
2688 {
2690 }
2691
2692
2694 {
2696 {
2698 }
2699
2700 return false;
2701 }
2702
2704 {
2706 {
2708 }
2709
2710 return false;
2711 }
2712
2714 {
2716 {
2718 }
2719
2720 return false;
2721 }
2722
2724 {
2726 {
2728 }
2729
2730 return false;
2731 }
2732
2734 {
2736 {
2738 }
2739
2740 return false;
2741 }
2742
2744 {
2746 {
2748 }
2749
2750 return false;
2751 }
2752
2753
2755 {
2757 }
2758
2760 {
2761 return GetFoodStage().GetNextFoodStageType( cooking_method );
2762 }
2763
2765 {
2766 return GetFoodStage().GetFoodStageName( food_stage_type );
2767 }
2768
2770 {
2771 return GetFoodStage().CanChangeToNewStage( cooking_method );
2772 }
2773
2774
2776 {
2777 if ( !source.GetFoodStage())
2778 return;
2783 }
2784
2787 {
2790 }
2791
2794 {
2795 switch (stageNew)
2796 {
2801 break;
2802
2805 break;
2806 }
2807 }
2808
2809
2810
2811
2812
2814 {
2816 }
2817
2819 {
2821
2822
2824 }
2825
2827 {
2829 {
2832 }
2833 }
2834
2835
2837 {
2839 if (player)
2840 {
2842 player.ServerReplaceItemInHandsWithNew(lambda);
2843 }
2844 else
2845 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2846 }
2847
2849 {
2851 }
2852
2854 {
2855 super.SetActions();
2856
2859 }
2860
2862 {
2863 #ifndef SERVER
2865 {
2867
2870 }
2871 #endif
2872 }
2873
2875 {
2876 #ifndef SERVER
2878 {
2882 }
2883 #endif
2884 }
2885
2887 {
2888 return false;
2889 }
2890
2892 {
2894 }
2895
2896 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2897 {
2899
2900 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2902 if ( hasRootAsPlayer )
2904
2905
2906
2907
2908
2909
2910
2912 {
2913
2915 {
2917 {
2921 break;
2922
2926 break;
2927
2931 break;
2932
2936 default:
2939 return;
2940 }
2941
2942
2943 }
2944
2946
2948 {
2950 {
2951
2953 {
2955 }
2957 {
2960 {
2962 }
2963 else
2964 {
2966 {
2968 }
2969 else
2970 {
2972 }
2973 }
2974 }
2975 }
2976 }
2977
2978 }
2980 {
2981
2983 {
2985 {
2989 break;
2990
2994 break;
2995
2999 break;
3000
3004 break;
3005
3008 default:
3011 return;
3012 }
3013 }
3014
3016
3018 {
3020 {
3021
3023 {
3025 }
3026 }
3027 }
3028 }
3030 {
3031
3033 {
3035 {
3039 break;
3040
3043 default:
3046 return;
3047 }
3048 }
3049
3051
3053 {
3055 {
3056
3058 {
3060 }
3061 }
3062 }
3063 }
3064 else
3065 {
3066
3068
3070 {
3073
3074 }
3075 else
3076 {
3078 {
3081 }
3082 }
3083 }
3084 }
3085
3087 {
3088 if (
GetGame().IsDedicatedServer())
3089 return;
3090
3092 {
3094 GetInventory().GetCurrentInventoryLocation(invLoc);
3096 {
3098 if (ptcMgr)
3099 {
3104 }
3105 }
3106 }
3108 {
3110 {
3113 return;
3114 }
3115
3117 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
3119 {
3122 }
3123 }
3124 }
3125
3126 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
3127 {
3128 super.GetDebugActions(outputList);
3129
3131 {
3135 }
3136 }
3137
3139 {
3140 super.OnAction(action_id, player, ctx);
3141
3143 {
3144 if ( action_id ==
EActions.FOOD_STAGE_PREV )
3145 {
3147 if (food_stage_prev <= 0)
3148 {
3150 }
3152 return true;
3153 }
3154 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
3155 {
3158 {
3160 }
3162 return true;
3163 }
3164
3165 }
3166
3167 #ifdef DIAG_DEVELOPER
3168 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
3169 {
3170 PrintNutritionsData();
3171 return true;
3172 }
3173 #endif
3174
3175 return false;
3176 }
3177
3179 {
3180 string debug_output;
3181
3182 debug_output = super.GetDebugText();
3183
3186
3187 return debug_output;
3188 }
3189
3190
3191
3192
3193
3195 {
3196 float ret = super.GetBaitEffectivity();
3197
3199 {
3200 ret *= 0.5;
3201 }
3202
3203 return ret;
3204 }
3205
3207 {
3209 }
3210
3212 {
3214 }
3215
3217 {
3219 }
3220
3221 #ifdef DIAG_DEVELOPER
3222 private void PrintNutritionsData()
3223 {
3224 string nutritionsData = "";
3225
3228
3230 if (profile)
3231 {
3232 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
3234 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
3238 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
3240
3243
3244 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
3246 }
3247
3248 nutritionsData += "-----\n";
3249
3251 }
3252 #endif
3253
3255
3258 {
3260 }
3261}
3262
3264{
3266};
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.