2170{
2172
2180
2190
2192
2194 {
2196 {
2198
2200 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
2201
2205 RegisterNetSyncVariableBool("m_MakeCookingSounds");
2206 }
2207 }
2208
2210 {
2212
2214 }
2215
2217 {
2218 super.EEDelete(parent);
2219
2221
2224 }
2225
2227 {
2228 super.EEItemLocationChanged(oldLoc, newLoc);
2229
2232 {
2233 switch (oldLoc.GetParent().GetType())
2234 {
2235 case "FryingPan":
2236 case "Pot":
2237 case "Cauldron":
2238 case "SharpWoodenStick":
2240 break;
2241 }
2242
2245 {
2247 }
2248 }
2249
2250 if (oldLoc.IsValid())
2252
2255 }
2256
2258 {
2261 }
2262
2264 {
2267
2268 return true;
2269 }
2270
2272 {
2274 {
2276 }
2277 }
2278
2281 {
2282 int foodStageType;
2283
2285 if (foodStage)
2286 foodStageType = foodStage.GetFoodStageType();
2287
2292
2293 return agentsIn;
2294 }
2295
2296
2298 {
2299 return false;
2300 }
2301
2303 {
2304 return false;
2305 }
2306
2308 {
2310 {
2312 {
2315
2318
2319 default:
2320 return super.GetTemperatureFreezeTime();
2321 }
2322 }
2323
2324 return super.GetTemperatureFreezeTime();
2325 }
2326
2328 {
2330 {
2332 {
2335
2338
2339 default:
2340 return super.GetTemperatureThawTime();
2341 }
2342 }
2343
2344 return super.GetTemperatureThawTime();
2345 }
2346
2348 {
2350 }
2351
2352
2353
2354
2356 {
2357 SetSynchDirty();
2358 }
2359
2361 {
2362 super.OnVariablesSynchronized();
2363
2364
2365
2366
2368 {
2370 }
2371 else
2372 {
2374 }
2375
2378 }
2379
2380
2381
2382
2384 {
2387
2389 }
2390
2392 {
2393 string soundName = "";
2394
2397
2399 {
2401 }
2402 else
2403 {
2405 {
2407 {
2412 else
2413 soundName = "";
2414 break;
2415 }
2416
2418 {
2423 else
2424 soundName = "";
2425 break;
2426 }
2427
2429 {
2434 else
2435 soundName = "";
2436 break;
2437 }
2438
2439 default:
2440 soundName = "";
2441 break;
2442 }
2443
2445 {
2446 if (soundName == "")
2447 {
2449 }
2450 else
2451 {
2453 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2454 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2456 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2457 {
2459 }
2460 }
2461 }
2462 }
2463
2465 }
2466
2468 {
2471 }
2472
2473
2474
2475
2477 {
2478 super.OnStoreSave(ctx);
2479
2481 {
2483 }
2484
2485
2488 }
2489
2491 {
2492 if (!super.OnStoreLoad(ctx, version))
2493 return false;
2494
2496 {
2498 return false;
2499 }
2500
2501 if (version >= 115)
2502 {
2504 {
2506 return false;
2507 }
2509 {
2511 return false;
2512 }
2513 }
2514
2517
2518 return true;
2519 }
2520
2522 {
2523 super.AfterStoreLoad();
2524
2526 }
2527
2528
2530 {
2532 }
2533
2534
2536 {
2537 return false;
2538 }
2539
2541 {
2542 return false;
2543 }
2544
2546 {
2547 return false;
2548 }
2549
2551 {
2552 return false;
2553 }
2554
2555
2556
2557
2558
2560 {
2563 {
2564 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2565 }
2566 else if (classname != "" && food_stage)
2567 {
2568 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2569 }
2570 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2572
2573 }
2574
2576 {
2579 {
2581 }
2582 else if (classname != "" && food_stage)
2583 {
2584 return FoodStage.GetEnergy(null, food_stage, classname);
2585 }
2586 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2588 }
2589
2591 {
2594 {
2596 }
2597 else if (classname != "" && food_stage)
2598 {
2599 return FoodStage.GetWater(null, food_stage, classname);
2600 }
2601 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2603 }
2604
2606 {
2609 {
2610 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2611 }
2612 else if (classname != "" && food_stage)
2613 {
2614 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2615 }
2616 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2618
2619 }
2620
2622 {
2625 {
2626 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2627 }
2628 else if (classname != "" && food_stage)
2629 {
2630 return FoodStage.GetToxicity(null, food_stage, classname);
2631 }
2632 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2634 }
2635
2637 {
2640 {
2642 }
2643 else if (classname != "" && food_stage)
2644 {
2645 return FoodStage.GetAgents(null, food_stage, classname);
2646 }
2647 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2649 }
2650
2652 {
2655 {
2656 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2657 }
2658 else if (classname != "" && food_stage)
2659 {
2660 return FoodStage.GetDigestibility(null, food_stage, classname);
2661 }
2662 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2664 }
2665
2667 {
2670 {
2671 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2672 }
2673 else if (className != "" && foodStage)
2674 {
2675 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2676 }
2677 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2679 }
2680
2682 {
2692
2693 return profile;
2694 }
2695
2696
2697
2698
2700 {
2702 }
2703
2704
2706 {
2708 {
2710 }
2711
2712 return false;
2713 }
2714
2716 {
2718 {
2720 }
2721
2722 return false;
2723 }
2724
2726 {
2728 {
2730 }
2731
2732 return false;
2733 }
2734
2736 {
2738 {
2740 }
2741
2742 return false;
2743 }
2744
2746 {
2748 {
2750 }
2751
2752 return false;
2753 }
2754
2756 {
2758 {
2760 }
2761
2762 return false;
2763 }
2764
2765
2767 {
2769 }
2770
2772 {
2773 return GetFoodStage().GetNextFoodStageType( cooking_method );
2774 }
2775
2777 {
2778 return GetFoodStage().GetFoodStageName( food_stage_type );
2779 }
2780
2782 {
2783 return GetFoodStage().CanChangeToNewStage( cooking_method );
2784 }
2785
2786
2788 {
2789 if ( !source.GetFoodStage())
2790 return;
2795 }
2796
2799 {
2802 }
2803
2806 {
2807 switch (stageNew)
2808 {
2813 break;
2814
2817 break;
2818 }
2819 }
2820
2821
2822
2823
2824
2826 {
2828 }
2829
2831 {
2833
2834
2836 }
2837
2839 {
2841 {
2844 }
2845 }
2846
2847
2849 {
2851 if (player)
2852 {
2854 player.ServerReplaceItemInHandsWithNew(lambda);
2855 }
2856 else
2857 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2858 }
2859
2861 {
2863 }
2864
2866 {
2867 super.SetActions();
2868
2871 }
2872
2874 {
2875 #ifndef SERVER
2877 {
2879
2882 }
2883 #endif
2884 }
2885
2887 {
2888 #ifndef SERVER
2890 {
2894 }
2895 #endif
2896 }
2897
2899 {
2900 return false;
2901 }
2902
2904 {
2906 }
2907
2908 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2909 {
2911
2912 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2914 if ( hasRootAsPlayer )
2916
2917
2918
2919
2920
2921
2922
2924 {
2925
2927 {
2929 {
2933 break;
2934
2938 break;
2939
2943 break;
2944
2948 default:
2951 return;
2952 }
2953
2954
2955 }
2956
2958
2960 {
2962 {
2963
2965 {
2967 }
2969 {
2972 {
2974 }
2975 else
2976 {
2978 {
2980 }
2981 else
2982 {
2984 }
2985 }
2986 }
2987 }
2988 }
2989
2990 }
2992 {
2993
2995 {
2997 {
3001 break;
3002
3006 break;
3007
3011 break;
3012
3016 break;
3017
3020 default:
3023 return;
3024 }
3025 }
3026
3028
3030 {
3032 {
3033
3035 {
3037 }
3038 }
3039 }
3040 }
3042 {
3043
3045 {
3047 {
3051 break;
3052
3055 default:
3058 return;
3059 }
3060 }
3061
3063
3065 {
3067 {
3068
3070 {
3072 }
3073 }
3074 }
3075 }
3076 else
3077 {
3078
3080
3082 {
3085
3086 }
3087 else
3088 {
3090 {
3093 }
3094 }
3095 }
3096 }
3097
3099 {
3100 if (
GetGame().IsDedicatedServer())
3101 return;
3102
3104 {
3106 GetInventory().GetCurrentInventoryLocation(invLoc);
3108 {
3110 if (ptcMgr)
3111 {
3116 }
3117 }
3118 }
3120 {
3122 {
3125 return;
3126 }
3127
3129 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
3131 {
3134 }
3135 }
3136 }
3137
3138 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
3139 {
3141 {
3146 }
3147
3148 super.GetDebugActions(outputList);
3149 }
3150
3152 {
3153 super.OnAction(action_id, player, ctx);
3154
3156 {
3157 if ( action_id ==
EActions.FOOD_STAGE_PREV )
3158 {
3160 if (food_stage_prev <= 0)
3161 {
3163 }
3165 return true;
3166 }
3167 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
3168 {
3171 {
3173 }
3175 return true;
3176 }
3177
3178 }
3179
3180 #ifdef DIAG_DEVELOPER
3181 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
3182 {
3183 PrintNutritionsData();
3184 return true;
3185 }
3186 #endif
3187
3188 return false;
3189 }
3190
3192 {
3193 string debug_output;
3194
3195 debug_output = super.GetDebugText();
3196
3199
3200 return debug_output;
3201 }
3202
3203
3204
3205
3206
3208 {
3209 float ret = super.GetBaitEffectivity();
3210
3212 {
3213 ret *= 0.5;
3214 }
3215
3216 return ret;
3217 }
3218
3220 {
3222 }
3223
3225 {
3227 }
3228
3230 {
3232 }
3233
3234 #ifdef DIAG_DEVELOPER
3235 private void PrintNutritionsData()
3236 {
3237 string nutritionsData = "";
3238
3241
3243 if (profile)
3244 {
3245 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
3247 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
3251 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
3253
3256
3257 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
3259 }
3260
3261 nutritionsData += "-----\n";
3262
3264 }
3265 #endif
3266
3268
3271 {
3273 }
3274}
3275
3277{
3279};
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.