2165{
2167
2175
2185
2187
2189 {
2191 {
2193
2195 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
2196
2200 RegisterNetSyncVariableBool("m_MakeCookingSounds");
2201 }
2202 }
2203
2205 {
2207
2209 }
2210
2212 {
2213 super.EEDelete(parent);
2214
2216
2219 }
2220
2222 {
2223 super.EEItemLocationChanged(oldLoc, newLoc);
2224
2227 {
2228 switch (oldLoc.GetParent().GetType())
2229 {
2230 case "FryingPan":
2231 case "Pot":
2232 case "Cauldron":
2233 case "SharpWoodenStick":
2235 break;
2236 }
2237
2240 {
2242 }
2243 }
2244
2245 if (oldLoc.IsValid())
2247
2250 }
2251
2253 {
2256 }
2257
2259 {
2262
2263 return true;
2264 }
2265
2267 {
2269 {
2271 }
2272 }
2273
2276 {
2277 int foodStageType;
2278
2280 if (foodStage)
2281 foodStageType = foodStage.GetFoodStageType();
2282
2287
2288 return agentsIn;
2289 }
2290
2291
2293 {
2294 return false;
2295 }
2296
2298 {
2299 return false;
2300 }
2301
2303 {
2305 {
2307 {
2310
2313
2314 default:
2315 return super.GetTemperatureFreezeTime();
2316 }
2317 }
2318
2319 return super.GetTemperatureFreezeTime();
2320 }
2321
2323 {
2325 {
2327 {
2330
2333
2334 default:
2335 return super.GetTemperatureThawTime();
2336 }
2337 }
2338
2339 return super.GetTemperatureThawTime();
2340 }
2341
2343 {
2345 }
2346
2347
2348
2349
2351 {
2352 SetSynchDirty();
2353 }
2354
2356 {
2357 super.OnVariablesSynchronized();
2358
2359
2360
2361
2363 {
2365 }
2366 else
2367 {
2369 }
2370
2373 }
2374
2375
2376
2377
2379 {
2382
2384 }
2385
2387 {
2388 string soundName = "";
2389
2392
2394 {
2396 }
2397 else
2398 {
2400 {
2402 {
2407 else
2408 soundName = "";
2409 break;
2410 }
2411
2413 {
2418 else
2419 soundName = "";
2420 break;
2421 }
2422
2424 {
2429 else
2430 soundName = "";
2431 break;
2432 }
2433
2434 default:
2435 soundName = "";
2436 break;
2437 }
2438
2440 {
2441 if (soundName == "")
2442 {
2444 }
2445 else
2446 {
2448 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2449 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2451 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2452 {
2454 }
2455 }
2456 }
2457 }
2458
2460 }
2461
2463 {
2466 }
2467
2468
2469
2470
2472 {
2473 super.OnStoreSave(ctx);
2474
2476 {
2478 }
2479
2480
2483 }
2484
2486 {
2487 if (!super.OnStoreLoad(ctx, version))
2488 return false;
2489
2491 {
2493 return false;
2494 }
2495
2496 if (version >= 115)
2497 {
2499 {
2501 return false;
2502 }
2504 {
2506 return false;
2507 }
2508 }
2509
2512
2513 return true;
2514 }
2515
2517 {
2518 super.AfterStoreLoad();
2519
2521 }
2522
2523
2525 {
2527 }
2528
2529
2531 {
2532 return false;
2533 }
2534
2536 {
2537 return false;
2538 }
2539
2541 {
2542 return false;
2543 }
2544
2546 {
2547 return false;
2548 }
2549
2550
2551
2552
2553
2555 {
2558 {
2559 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2560 }
2561 else if (classname != "" && food_stage)
2562 {
2563 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2564 }
2565 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2567
2568 }
2569
2571 {
2574 {
2576 }
2577 else if (classname != "" && food_stage)
2578 {
2579 return FoodStage.GetEnergy(null, food_stage, classname);
2580 }
2581 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2583 }
2584
2586 {
2589 {
2591 }
2592 else if (classname != "" && food_stage)
2593 {
2594 return FoodStage.GetWater(null, food_stage, classname);
2595 }
2596 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2598 }
2599
2601 {
2604 {
2605 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2606 }
2607 else if (classname != "" && food_stage)
2608 {
2609 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2610 }
2611 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2613
2614 }
2615
2617 {
2620 {
2621 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2622 }
2623 else if (classname != "" && food_stage)
2624 {
2625 return FoodStage.GetToxicity(null, food_stage, classname);
2626 }
2627 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2629 }
2630
2632 {
2635 {
2637 }
2638 else if (classname != "" && food_stage)
2639 {
2640 return FoodStage.GetAgents(null, food_stage, classname);
2641 }
2642 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2644 }
2645
2647 {
2650 {
2651 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2652 }
2653 else if (classname != "" && food_stage)
2654 {
2655 return FoodStage.GetDigestibility(null, food_stage, classname);
2656 }
2657 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2659 }
2660
2662 {
2665 {
2666 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2667 }
2668 else if (className != "" && foodStage)
2669 {
2670 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2671 }
2672 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2674 }
2675
2677 {
2687
2688 return profile;
2689 }
2690
2691
2692
2693
2695 {
2697 }
2698
2699
2701 {
2703 {
2705 }
2706
2707 return false;
2708 }
2709
2711 {
2713 {
2715 }
2716
2717 return false;
2718 }
2719
2721 {
2723 {
2725 }
2726
2727 return false;
2728 }
2729
2731 {
2733 {
2735 }
2736
2737 return false;
2738 }
2739
2741 {
2743 {
2745 }
2746
2747 return false;
2748 }
2749
2751 {
2753 {
2755 }
2756
2757 return false;
2758 }
2759
2760
2762 {
2764 }
2765
2767 {
2768 return GetFoodStage().GetNextFoodStageType( cooking_method );
2769 }
2770
2772 {
2773 return GetFoodStage().GetFoodStageName( food_stage_type );
2774 }
2775
2777 {
2778 return GetFoodStage().CanChangeToNewStage( cooking_method );
2779 }
2780
2781
2783 {
2784 if ( !source.GetFoodStage())
2785 return;
2790 }
2791
2794 {
2797 }
2798
2801 {
2802 switch (stageNew)
2803 {
2808 break;
2809
2812 break;
2813 }
2814 }
2815
2816
2817
2818
2819
2821 {
2823 }
2824
2826 {
2828
2829
2831 }
2832
2834 {
2836 {
2839 }
2840 }
2841
2842
2844 {
2846 if (player)
2847 {
2849 player.ServerReplaceItemInHandsWithNew(lambda);
2850 }
2851 else
2852 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2853 }
2854
2856 {
2858 }
2859
2861 {
2862 super.SetActions();
2863
2866 }
2867
2869 {
2870 #ifndef SERVER
2872 {
2874
2877 }
2878 #endif
2879 }
2880
2882 {
2883 #ifndef SERVER
2885 {
2889 }
2890 #endif
2891 }
2892
2894 {
2895 return false;
2896 }
2897
2899 {
2901 }
2902
2903 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2904 {
2906
2907 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2909 if ( hasRootAsPlayer )
2911
2912
2913
2914
2915
2916
2917
2919 {
2920
2922 {
2924 {
2928 break;
2929
2933 break;
2934
2938 break;
2939
2943 default:
2946 return;
2947 }
2948
2949
2950 }
2951
2953
2955 {
2957 {
2958
2960 {
2962 }
2964 {
2967 {
2969 }
2970 else
2971 {
2973 {
2975 }
2976 else
2977 {
2979 }
2980 }
2981 }
2982 }
2983 }
2984
2985 }
2987 {
2988
2990 {
2992 {
2996 break;
2997
3001 break;
3002
3006 break;
3007
3011 break;
3012
3015 default:
3018 return;
3019 }
3020 }
3021
3023
3025 {
3027 {
3028
3030 {
3032 }
3033 }
3034 }
3035 }
3037 {
3038
3040 {
3042 {
3046 break;
3047
3050 default:
3053 return;
3054 }
3055 }
3056
3058
3060 {
3062 {
3063
3065 {
3067 }
3068 }
3069 }
3070 }
3071 else
3072 {
3073
3075
3077 {
3080
3081 }
3082 else
3083 {
3085 {
3088 }
3089 }
3090 }
3091 }
3092
3094 {
3095 if (
GetGame().IsDedicatedServer())
3096 return;
3097
3099 {
3101 GetInventory().GetCurrentInventoryLocation(invLoc);
3103 {
3105 if (ptcMgr)
3106 {
3111 }
3112 }
3113 }
3115 {
3117 {
3120 return;
3121 }
3122
3124 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
3126 {
3129 }
3130 }
3131 }
3132
3133 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
3134 {
3136 {
3141 }
3142
3143 super.GetDebugActions(outputList);
3144 }
3145
3147 {
3148 super.OnAction(action_id, player, ctx);
3149
3151 {
3152 if ( action_id ==
EActions.FOOD_STAGE_PREV )
3153 {
3155 if (food_stage_prev <= 0)
3156 {
3158 }
3160 return true;
3161 }
3162 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
3163 {
3166 {
3168 }
3170 return true;
3171 }
3172
3173 }
3174
3175 #ifdef DIAG_DEVELOPER
3176 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
3177 {
3178 PrintNutritionsData();
3179 return true;
3180 }
3181 #endif
3182
3183 return false;
3184 }
3185
3187 {
3188 string debug_output;
3189
3190 debug_output = super.GetDebugText();
3191
3194
3195 return debug_output;
3196 }
3197
3198
3199
3200
3201
3203 {
3204 float ret = super.GetBaitEffectivity();
3205
3207 {
3208 ret *= 0.5;
3209 }
3210
3211 return ret;
3212 }
3213
3215 {
3217 }
3218
3220 {
3222 }
3223
3225 {
3227 }
3228
3229 #ifdef DIAG_DEVELOPER
3230 private void PrintNutritionsData()
3231 {
3232 string nutritionsData = "";
3233
3236
3238 if (profile)
3239 {
3240 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
3242 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
3246 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
3248
3251
3252 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
3254 }
3255
3256 nutritionsData += "-----\n";
3257
3259 }
3260 #endif
3261
3263
3266 {
3268 }
3269}
3270
3272{
3274};
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.