2130{
2132
2140
2150
2152
2154 {
2156 {
2158
2160 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
2161
2165 RegisterNetSyncVariableBool("m_MakeCookingSounds");
2166 }
2167 }
2168
2170 {
2172
2174 }
2175
2177 {
2178 super.EEDelete(parent);
2179
2181
2184 }
2185
2187 {
2188 super.EEItemLocationChanged(oldLoc, newLoc);
2189
2192 {
2193 switch (oldLoc.GetParent().GetType())
2194 {
2195 case "FryingPan":
2196 case "Pot":
2197 case "Cauldron":
2198 case "SharpWoodenStick":
2200 break;
2201 }
2202
2205 {
2207 }
2208 }
2209
2210 if (oldLoc.IsValid())
2212
2215 }
2216
2218 {
2221 }
2222
2224 {
2227
2228 return true;
2229 }
2230
2232 {
2234 {
2236 }
2237 }
2238
2241 {
2242 int foodStageType;
2243
2245 if (foodStage)
2246 foodStageType = foodStage.GetFoodStageType();
2247
2252
2253 return agentsIn;
2254 }
2255
2256
2258 {
2259 return false;
2260 }
2261
2263 {
2264 return false;
2265 }
2266
2268 {
2270 {
2272 {
2275
2278
2279 default:
2280 return super.GetTemperatureFreezeTime();
2281 }
2282 }
2283
2284 return super.GetTemperatureFreezeTime();
2285 }
2286
2288 {
2290 {
2292 {
2295
2298
2299 default:
2300 return super.GetTemperatureThawTime();
2301 }
2302 }
2303
2304 return super.GetTemperatureThawTime();
2305 }
2306
2308 {
2310 }
2311
2312
2313
2314
2316 {
2317 SetSynchDirty();
2318 }
2319
2321 {
2322 super.OnVariablesSynchronized();
2323
2324
2325
2326
2328 {
2330 }
2331 else
2332 {
2334 }
2335
2338 }
2339
2340
2341
2342
2344 {
2347
2349 }
2350
2352 {
2353 string soundName = "";
2354
2357
2359 {
2361 }
2362 else
2363 {
2365 {
2367 {
2372 else
2373 soundName = "";
2374 break;
2375 }
2376
2378 {
2383 else
2384 soundName = "";
2385 break;
2386 }
2387
2389 {
2394 else
2395 soundName = "";
2396 break;
2397 }
2398
2399 default:
2400 soundName = "";
2401 break;
2402 }
2403
2405 {
2406 if (soundName == "")
2407 {
2409 }
2410 else
2411 {
2413 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2414 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2416 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2417 {
2419 }
2420 }
2421 }
2422 }
2423
2425 }
2426
2428 {
2431 }
2432
2433
2434
2435
2437 {
2438 super.OnStoreSave(ctx);
2439
2441 {
2443 }
2444
2445
2448 }
2449
2451 {
2452 if (!super.OnStoreLoad(ctx, version))
2453 return false;
2454
2456 {
2458 return false;
2459 }
2460
2461 if (version >= 115)
2462 {
2464 {
2466 return false;
2467 }
2469 {
2471 return false;
2472 }
2473 }
2474
2477
2478 return true;
2479 }
2480
2482 {
2483 super.AfterStoreLoad();
2484
2486 }
2487
2488
2490 {
2492 }
2493
2494
2496 {
2497 return false;
2498 }
2499
2501 {
2502 return false;
2503 }
2504
2506 {
2507 return false;
2508 }
2509
2511 {
2512 return false;
2513 }
2514
2515
2516
2517
2518
2520 {
2523 {
2524 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2525 }
2526 else if (classname != "" && food_stage)
2527 {
2528 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2529 }
2530 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2532
2533 }
2534
2536 {
2539 {
2541 }
2542 else if (classname != "" && food_stage)
2543 {
2544 return FoodStage.GetEnergy(null, food_stage, classname);
2545 }
2546 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2548 }
2549
2551 {
2554 {
2556 }
2557 else if (classname != "" && food_stage)
2558 {
2559 return FoodStage.GetWater(null, food_stage, classname);
2560 }
2561 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2563 }
2564
2566 {
2569 {
2570 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2571 }
2572 else if (classname != "" && food_stage)
2573 {
2574 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2575 }
2576 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2578
2579 }
2580
2582 {
2585 {
2586 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2587 }
2588 else if (classname != "" && food_stage)
2589 {
2590 return FoodStage.GetToxicity(null, food_stage, classname);
2591 }
2592 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2594 }
2595
2597 {
2600 {
2602 }
2603 else if (classname != "" && food_stage)
2604 {
2605 return FoodStage.GetAgents(null, food_stage, classname);
2606 }
2607 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2609 }
2610
2612 {
2615 {
2616 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2617 }
2618 else if (classname != "" && food_stage)
2619 {
2620 return FoodStage.GetDigestibility(null, food_stage, classname);
2621 }
2622 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2624 }
2625
2627 {
2630 {
2631 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2632 }
2633 else if (className != "" && foodStage)
2634 {
2635 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2636 }
2637 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2639 }
2640
2642 {
2652
2653 return profile;
2654 }
2655
2656
2657
2658
2660 {
2662 }
2663
2664
2666 {
2668 {
2670 }
2671
2672 return false;
2673 }
2674
2676 {
2678 {
2680 }
2681
2682 return false;
2683 }
2684
2686 {
2688 {
2690 }
2691
2692 return false;
2693 }
2694
2696 {
2698 {
2700 }
2701
2702 return false;
2703 }
2704
2706 {
2708 {
2710 }
2711
2712 return false;
2713 }
2714
2716 {
2718 {
2720 }
2721
2722 return false;
2723 }
2724
2725
2727 {
2729 }
2730
2732 {
2733 return GetFoodStage().GetNextFoodStageType( cooking_method );
2734 }
2735
2737 {
2738 return GetFoodStage().GetFoodStageName( food_stage_type );
2739 }
2740
2742 {
2743 return GetFoodStage().CanChangeToNewStage( cooking_method );
2744 }
2745
2746
2748 {
2749 if ( !source.GetFoodStage())
2750 return;
2755 }
2756
2759 {
2762 }
2763
2766 {
2767 switch (stageNew)
2768 {
2773 break;
2774
2777 break;
2778 }
2779 }
2780
2781
2782
2783
2784
2786 {
2788 }
2789
2791 {
2793
2794
2796 }
2797
2799 {
2801 {
2804 }
2805 }
2806
2807
2809 {
2811 if (player)
2812 {
2814 player.ServerReplaceItemInHandsWithNew(lambda);
2815 }
2816 else
2817 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2818 }
2819
2821 {
2823 }
2824
2826 {
2827 super.SetActions();
2828
2831 }
2832
2834 {
2835 #ifndef SERVER
2837 {
2839
2842 }
2843 #endif
2844 }
2845
2847 {
2848 #ifndef SERVER
2850 {
2854 }
2855 #endif
2856 }
2857
2859 {
2860 return false;
2861 }
2862
2864 {
2866 }
2867
2868 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2869 {
2871
2872 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2874 if ( hasRootAsPlayer )
2876
2877
2878
2879
2880
2881
2882
2884 {
2885
2887 {
2889 {
2893 break;
2894
2898 break;
2899
2903 break;
2904
2908 default:
2911 return;
2912 }
2913
2914
2915 }
2916
2918
2920 {
2922 {
2923
2925 {
2927 }
2929 {
2932 {
2934 }
2935 else
2936 {
2938 {
2940 }
2941 else
2942 {
2944 }
2945 }
2946 }
2947 }
2948 }
2949
2950 }
2952 {
2953
2955 {
2957 {
2961 break;
2962
2966 break;
2967
2971 break;
2972
2976 break;
2977
2980 default:
2983 return;
2984 }
2985 }
2986
2988
2990 {
2992 {
2993
2995 {
2997 }
2998 }
2999 }
3000 }
3002 {
3003
3005 {
3007 {
3011 break;
3012
3015 default:
3018 return;
3019 }
3020 }
3021
3023
3025 {
3027 {
3028
3030 {
3032 }
3033 }
3034 }
3035 }
3036 else
3037 {
3038
3040
3042 {
3045
3046 }
3047 else
3048 {
3050 {
3053 }
3054 }
3055 }
3056 }
3057
3059 {
3060 if (
GetGame().IsDedicatedServer())
3061 return;
3062
3064 {
3066 GetInventory().GetCurrentInventoryLocation(invLoc);
3068 {
3070 if (ptcMgr)
3071 {
3076 }
3077 }
3078 }
3080 {
3082 {
3085 return;
3086 }
3087
3089 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
3091 {
3094 }
3095 }
3096 }
3097
3098 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
3099 {
3100 super.GetDebugActions(outputList);
3101
3103 {
3107 }
3108 }
3109
3111 {
3112 super.OnAction(action_id, player, ctx);
3113
3115 {
3116 if ( action_id ==
EActions.FOOD_STAGE_PREV )
3117 {
3119 if (food_stage_prev <= 0)
3120 {
3122 }
3124 return true;
3125 }
3126 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
3127 {
3130 {
3132 }
3134 return true;
3135 }
3136
3137 }
3138
3139 #ifdef DIAG_DEVELOPER
3140 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
3141 {
3142 PrintNutritionsData();
3143 return true;
3144 }
3145 #endif
3146
3147 return false;
3148 }
3149
3151 {
3152 string debug_output;
3153
3154 debug_output = super.GetDebugText();
3155
3158
3159 return debug_output;
3160 }
3161
3162
3163
3164
3165
3167 {
3168 float ret = super.GetBaitEffectivity();
3169
3171 {
3172 ret *= 0.5;
3173 }
3174
3175 return ret;
3176 }
3177
3179 {
3181 }
3182
3184 {
3186 }
3187
3189 {
3191 }
3192
3193 #ifdef DIAG_DEVELOPER
3194 private void PrintNutritionsData()
3195 {
3196 string nutritionsData = "";
3197
3200
3202 if (profile)
3203 {
3204 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
3206 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
3210 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
3212
3215
3216 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
3218 }
3219
3220 nutritionsData += "-----\n";
3221
3223 }
3224 #endif
3225
3227
3230 {
3232 }
3233}
3234
3236{
3238};
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.