2163{
2165
2173
2183
2185
2187 {
2189 {
2191
2193 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
2194
2198 RegisterNetSyncVariableBool("m_MakeCookingSounds");
2199 }
2200 }
2201
2203 {
2205
2207 }
2208
2210 {
2211 super.EEDelete(parent);
2212
2214
2217 }
2218
2220 {
2221 super.EEItemLocationChanged(oldLoc, newLoc);
2222
2225 {
2226 switch (oldLoc.GetParent().GetType())
2227 {
2228 case "FryingPan":
2229 case "Pot":
2230 case "Cauldron":
2231 case "SharpWoodenStick":
2233 break;
2234 }
2235
2238 {
2240 }
2241 }
2242
2243 if (oldLoc.IsValid())
2245
2248 }
2249
2251 {
2254 }
2255
2257 {
2260
2261 return true;
2262 }
2263
2265 {
2267 {
2269 }
2270 }
2271
2274 {
2275 int foodStageType;
2276
2278 if (foodStage)
2279 foodStageType = foodStage.GetFoodStageType();
2280
2285
2286 return agentsIn;
2287 }
2288
2289
2291 {
2292 return false;
2293 }
2294
2296 {
2297 return false;
2298 }
2299
2301 {
2303 {
2305 {
2308
2311
2312 default:
2313 return super.GetTemperatureFreezeTime();
2314 }
2315 }
2316
2317 return super.GetTemperatureFreezeTime();
2318 }
2319
2321 {
2323 {
2325 {
2328
2331
2332 default:
2333 return super.GetTemperatureThawTime();
2334 }
2335 }
2336
2337 return super.GetTemperatureThawTime();
2338 }
2339
2341 {
2343 }
2344
2345
2346
2347
2349 {
2350 SetSynchDirty();
2351 }
2352
2354 {
2355 super.OnVariablesSynchronized();
2356
2357
2358
2359
2361 {
2363 }
2364 else
2365 {
2367 }
2368
2371 }
2372
2373
2374
2375
2377 {
2380
2382 }
2383
2385 {
2386 string soundName = "";
2387
2390
2392 {
2394 }
2395 else
2396 {
2398 {
2400 {
2405 else
2406 soundName = "";
2407 break;
2408 }
2409
2411 {
2416 else
2417 soundName = "";
2418 break;
2419 }
2420
2422 {
2427 else
2428 soundName = "";
2429 break;
2430 }
2431
2432 default:
2433 soundName = "";
2434 break;
2435 }
2436
2438 {
2439 if (soundName == "")
2440 {
2442 }
2443 else
2444 {
2446 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2447 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2449 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2450 {
2452 }
2453 }
2454 }
2455 }
2456
2458 }
2459
2461 {
2464 }
2465
2466
2467
2468
2470 {
2471 super.OnStoreSave(ctx);
2472
2474 {
2476 }
2477
2478
2481 }
2482
2484 {
2485 if (!super.OnStoreLoad(ctx, version))
2486 return false;
2487
2489 {
2491 return false;
2492 }
2493
2494 if (version >= 115)
2495 {
2497 {
2499 return false;
2500 }
2502 {
2504 return false;
2505 }
2506 }
2507
2510
2511 return true;
2512 }
2513
2515 {
2516 super.AfterStoreLoad();
2517
2519 }
2520
2521
2523 {
2525 }
2526
2527
2529 {
2530 return false;
2531 }
2532
2534 {
2535 return false;
2536 }
2537
2539 {
2540 return false;
2541 }
2542
2544 {
2545 return false;
2546 }
2547
2548
2549
2550
2551
2553 {
2556 {
2557 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2558 }
2559 else if (classname != "" && food_stage)
2560 {
2561 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2562 }
2563 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2565
2566 }
2567
2569 {
2572 {
2574 }
2575 else if (classname != "" && food_stage)
2576 {
2577 return FoodStage.GetEnergy(null, food_stage, classname);
2578 }
2579 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2581 }
2582
2584 {
2587 {
2589 }
2590 else if (classname != "" && food_stage)
2591 {
2592 return FoodStage.GetWater(null, food_stage, classname);
2593 }
2594 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2596 }
2597
2599 {
2602 {
2603 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2604 }
2605 else if (classname != "" && food_stage)
2606 {
2607 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2608 }
2609 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2611
2612 }
2613
2615 {
2618 {
2619 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2620 }
2621 else if (classname != "" && food_stage)
2622 {
2623 return FoodStage.GetToxicity(null, food_stage, classname);
2624 }
2625 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2627 }
2628
2630 {
2633 {
2635 }
2636 else if (classname != "" && food_stage)
2637 {
2638 return FoodStage.GetAgents(null, food_stage, classname);
2639 }
2640 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2642 }
2643
2645 {
2648 {
2649 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2650 }
2651 else if (classname != "" && food_stage)
2652 {
2653 return FoodStage.GetDigestibility(null, food_stage, classname);
2654 }
2655 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2657 }
2658
2660 {
2663 {
2664 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2665 }
2666 else if (className != "" && foodStage)
2667 {
2668 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2669 }
2670 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2672 }
2673
2675 {
2685
2686 return profile;
2687 }
2688
2689
2690
2691
2693 {
2695 }
2696
2697
2699 {
2701 {
2703 }
2704
2705 return false;
2706 }
2707
2709 {
2711 {
2713 }
2714
2715 return false;
2716 }
2717
2719 {
2721 {
2723 }
2724
2725 return false;
2726 }
2727
2729 {
2731 {
2733 }
2734
2735 return false;
2736 }
2737
2739 {
2741 {
2743 }
2744
2745 return false;
2746 }
2747
2749 {
2751 {
2753 }
2754
2755 return false;
2756 }
2757
2758
2760 {
2762 }
2763
2765 {
2766 return GetFoodStage().GetNextFoodStageType( cooking_method );
2767 }
2768
2770 {
2771 return GetFoodStage().GetFoodStageName( food_stage_type );
2772 }
2773
2775 {
2776 return GetFoodStage().CanChangeToNewStage( cooking_method );
2777 }
2778
2779
2781 {
2782 if ( !source.GetFoodStage())
2783 return;
2788 }
2789
2792 {
2795 }
2796
2799 {
2800 switch (stageNew)
2801 {
2806 break;
2807
2810 break;
2811 }
2812 }
2813
2814
2815
2816
2817
2819 {
2821 }
2822
2824 {
2826
2827
2829 }
2830
2832 {
2834 {
2837 }
2838 }
2839
2840
2842 {
2844 if (player)
2845 {
2847 player.ServerReplaceItemInHandsWithNew(lambda);
2848 }
2849 else
2850 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2851 }
2852
2854 {
2856 }
2857
2859 {
2860 super.SetActions();
2861
2864 }
2865
2867 {
2868 #ifndef SERVER
2870 {
2872
2875 }
2876 #endif
2877 }
2878
2880 {
2881 #ifndef SERVER
2883 {
2887 }
2888 #endif
2889 }
2890
2892 {
2893 return false;
2894 }
2895
2897 {
2899 }
2900
2901 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2902 {
2904
2905 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2907 if ( hasRootAsPlayer )
2909
2910
2911
2912
2913
2914
2915
2917 {
2918
2920 {
2922 {
2926 break;
2927
2931 break;
2932
2936 break;
2937
2941 default:
2944 return;
2945 }
2946
2947
2948 }
2949
2951
2953 {
2955 {
2956
2958 {
2960 }
2962 {
2965 {
2967 }
2968 else
2969 {
2971 {
2973 }
2974 else
2975 {
2977 }
2978 }
2979 }
2980 }
2981 }
2982
2983 }
2985 {
2986
2988 {
2990 {
2994 break;
2995
2999 break;
3000
3004 break;
3005
3009 break;
3010
3013 default:
3016 return;
3017 }
3018 }
3019
3021
3023 {
3025 {
3026
3028 {
3030 }
3031 }
3032 }
3033 }
3035 {
3036
3038 {
3040 {
3044 break;
3045
3048 default:
3051 return;
3052 }
3053 }
3054
3056
3058 {
3060 {
3061
3063 {
3065 }
3066 }
3067 }
3068 }
3069 else
3070 {
3071
3073
3075 {
3078
3079 }
3080 else
3081 {
3083 {
3086 }
3087 }
3088 }
3089 }
3090
3092 {
3093 if (
GetGame().IsDedicatedServer())
3094 return;
3095
3097 {
3099 GetInventory().GetCurrentInventoryLocation(invLoc);
3101 {
3103 if (ptcMgr)
3104 {
3109 }
3110 }
3111 }
3113 {
3115 {
3118 return;
3119 }
3120
3122 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
3124 {
3127 }
3128 }
3129 }
3130
3131 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
3132 {
3133 super.GetDebugActions(outputList);
3134
3136 {
3140 }
3141 }
3142
3144 {
3145 super.OnAction(action_id, player, ctx);
3146
3148 {
3149 if ( action_id ==
EActions.FOOD_STAGE_PREV )
3150 {
3152 if (food_stage_prev <= 0)
3153 {
3155 }
3157 return true;
3158 }
3159 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
3160 {
3163 {
3165 }
3167 return true;
3168 }
3169
3170 }
3171
3172 #ifdef DIAG_DEVELOPER
3173 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
3174 {
3175 PrintNutritionsData();
3176 return true;
3177 }
3178 #endif
3179
3180 return false;
3181 }
3182
3184 {
3185 string debug_output;
3186
3187 debug_output = super.GetDebugText();
3188
3191
3192 return debug_output;
3193 }
3194
3195
3196
3197
3198
3200 {
3201 float ret = super.GetBaitEffectivity();
3202
3204 {
3205 ret *= 0.5;
3206 }
3207
3208 return ret;
3209 }
3210
3212 {
3214 }
3215
3217 {
3219 }
3220
3222 {
3224 }
3225
3226 #ifdef DIAG_DEVELOPER
3227 private void PrintNutritionsData()
3228 {
3229 string nutritionsData = "";
3230
3233
3235 if (profile)
3236 {
3237 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
3239 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
3243 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
3245
3248
3249 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
3251 }
3252
3253 nutritionsData += "-----\n";
3254
3256 }
3257 #endif
3258
3260
3263 {
3265 }
3266}
3267
3269{
3271};
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.