2160{
2162
2170
2180
2182
2184 {
2186 {
2188
2190 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
2191
2195 RegisterNetSyncVariableBool("m_MakeCookingSounds");
2196 }
2197 }
2198
2200 {
2202
2204 }
2205
2207 {
2208 super.EEDelete(parent);
2209
2211
2214 }
2215
2217 {
2218 super.EEItemLocationChanged(oldLoc, newLoc);
2219
2222 {
2223 switch (oldLoc.GetParent().GetType())
2224 {
2225 case "FryingPan":
2226 case "Pot":
2227 case "Cauldron":
2228 case "SharpWoodenStick":
2230 break;
2231 }
2232
2235 {
2237 }
2238 }
2239
2240 if (oldLoc.IsValid())
2242
2245 }
2246
2248 {
2251 }
2252
2254 {
2257
2258 return true;
2259 }
2260
2262 {
2264 {
2266 }
2267 }
2268
2271 {
2272 int foodStageType;
2273
2275 if (foodStage)
2276 foodStageType = foodStage.GetFoodStageType();
2277
2282
2283 return agentsIn;
2284 }
2285
2286
2288 {
2289 return false;
2290 }
2291
2293 {
2294 return false;
2295 }
2296
2298 {
2300 {
2302 {
2305
2308
2309 default:
2310 return super.GetTemperatureFreezeTime();
2311 }
2312 }
2313
2314 return super.GetTemperatureFreezeTime();
2315 }
2316
2318 {
2320 {
2322 {
2325
2328
2329 default:
2330 return super.GetTemperatureThawTime();
2331 }
2332 }
2333
2334 return super.GetTemperatureThawTime();
2335 }
2336
2338 {
2340 }
2341
2342
2343
2344
2346 {
2347 SetSynchDirty();
2348 }
2349
2351 {
2352 super.OnVariablesSynchronized();
2353
2354
2355
2356
2358 {
2360 }
2361 else
2362 {
2364 }
2365
2368 }
2369
2370
2371
2372
2374 {
2377
2379 }
2380
2382 {
2383 string soundName = "";
2384
2387
2389 {
2391 }
2392 else
2393 {
2395 {
2397 {
2402 else
2403 soundName = "";
2404 break;
2405 }
2406
2408 {
2413 else
2414 soundName = "";
2415 break;
2416 }
2417
2419 {
2424 else
2425 soundName = "";
2426 break;
2427 }
2428
2429 default:
2430 soundName = "";
2431 break;
2432 }
2433
2435 {
2436 if (soundName == "")
2437 {
2439 }
2440 else
2441 {
2443 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2444 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2446 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2447 {
2449 }
2450 }
2451 }
2452 }
2453
2455 }
2456
2458 {
2461 }
2462
2463
2464
2465
2467 {
2468 super.OnStoreSave(ctx);
2469
2471 {
2473 }
2474
2475
2478 }
2479
2481 {
2482 if (!super.OnStoreLoad(ctx, version))
2483 return false;
2484
2486 {
2488 return false;
2489 }
2490
2491 if (version >= 115)
2492 {
2494 {
2496 return false;
2497 }
2499 {
2501 return false;
2502 }
2503 }
2504
2507
2508 return true;
2509 }
2510
2512 {
2513 super.AfterStoreLoad();
2514
2516 }
2517
2518
2520 {
2522 }
2523
2524
2526 {
2527 return false;
2528 }
2529
2531 {
2532 return false;
2533 }
2534
2536 {
2537 return false;
2538 }
2539
2541 {
2542 return false;
2543 }
2544
2545
2546
2547
2548
2550 {
2553 {
2554 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2555 }
2556 else if (classname != "" && food_stage)
2557 {
2558 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2559 }
2560 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2562
2563 }
2564
2566 {
2569 {
2571 }
2572 else if (classname != "" && food_stage)
2573 {
2574 return FoodStage.GetEnergy(null, food_stage, classname);
2575 }
2576 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2578 }
2579
2581 {
2584 {
2586 }
2587 else if (classname != "" && food_stage)
2588 {
2589 return FoodStage.GetWater(null, food_stage, classname);
2590 }
2591 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2593 }
2594
2596 {
2599 {
2600 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2601 }
2602 else if (classname != "" && food_stage)
2603 {
2604 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2605 }
2606 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2608
2609 }
2610
2612 {
2615 {
2616 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2617 }
2618 else if (classname != "" && food_stage)
2619 {
2620 return FoodStage.GetToxicity(null, food_stage, classname);
2621 }
2622 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2624 }
2625
2627 {
2630 {
2632 }
2633 else if (classname != "" && food_stage)
2634 {
2635 return FoodStage.GetAgents(null, food_stage, classname);
2636 }
2637 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2639 }
2640
2642 {
2645 {
2646 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2647 }
2648 else if (classname != "" && food_stage)
2649 {
2650 return FoodStage.GetDigestibility(null, food_stage, classname);
2651 }
2652 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2654 }
2655
2657 {
2660 {
2661 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2662 }
2663 else if (className != "" && foodStage)
2664 {
2665 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2666 }
2667 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2669 }
2670
2672 {
2682
2683 return profile;
2684 }
2685
2686
2687
2688
2690 {
2692 }
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
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
2755
2757 {
2759 }
2760
2762 {
2763 return GetFoodStage().GetNextFoodStageType( cooking_method );
2764 }
2765
2767 {
2768 return GetFoodStage().GetFoodStageName( food_stage_type );
2769 }
2770
2772 {
2773 return GetFoodStage().CanChangeToNewStage( cooking_method );
2774 }
2775
2776
2778 {
2779 if ( !source.GetFoodStage())
2780 return;
2785 }
2786
2789 {
2792 }
2793
2796 {
2797 switch (stageNew)
2798 {
2803 break;
2804
2807 break;
2808 }
2809 }
2810
2811
2812
2813
2814
2816 {
2818 }
2819
2821 {
2823
2824
2826 }
2827
2829 {
2831 {
2834 }
2835 }
2836
2837
2839 {
2841 if (player)
2842 {
2844 player.ServerReplaceItemInHandsWithNew(lambda);
2845 }
2846 else
2847 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2848 }
2849
2851 {
2853 }
2854
2856 {
2857 super.SetActions();
2858
2861 }
2862
2864 {
2865 #ifndef SERVER
2867 {
2869
2872 }
2873 #endif
2874 }
2875
2877 {
2878 #ifndef SERVER
2880 {
2884 }
2885 #endif
2886 }
2887
2889 {
2890 return false;
2891 }
2892
2894 {
2896 }
2897
2898 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2899 {
2901
2902 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2904 if ( hasRootAsPlayer )
2906
2907
2908
2909
2910
2911
2912
2914 {
2915
2917 {
2919 {
2923 break;
2924
2928 break;
2929
2933 break;
2934
2938 default:
2941 return;
2942 }
2943
2944
2945 }
2946
2948
2950 {
2952 {
2953
2955 {
2957 }
2959 {
2962 {
2964 }
2965 else
2966 {
2968 {
2970 }
2971 else
2972 {
2974 }
2975 }
2976 }
2977 }
2978 }
2979
2980 }
2982 {
2983
2985 {
2987 {
2991 break;
2992
2996 break;
2997
3001 break;
3002
3006 break;
3007
3010 default:
3013 return;
3014 }
3015 }
3016
3018
3020 {
3022 {
3023
3025 {
3027 }
3028 }
3029 }
3030 }
3032 {
3033
3035 {
3037 {
3041 break;
3042
3045 default:
3048 return;
3049 }
3050 }
3051
3053
3055 {
3057 {
3058
3060 {
3062 }
3063 }
3064 }
3065 }
3066 else
3067 {
3068
3070
3072 {
3075
3076 }
3077 else
3078 {
3080 {
3083 }
3084 }
3085 }
3086 }
3087
3089 {
3090 if (
GetGame().IsDedicatedServer())
3091 return;
3092
3094 {
3096 GetInventory().GetCurrentInventoryLocation(invLoc);
3098 {
3100 if (ptcMgr)
3101 {
3106 }
3107 }
3108 }
3110 {
3112 {
3115 return;
3116 }
3117
3119 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
3121 {
3124 }
3125 }
3126 }
3127
3128 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
3129 {
3131 {
3136 }
3137
3138 super.GetDebugActions(outputList);
3139 }
3140
3142 {
3143 super.OnAction(action_id, player, ctx);
3144
3146 {
3147 if ( action_id ==
EActions.FOOD_STAGE_PREV )
3148 {
3150 if (food_stage_prev <= 0)
3151 {
3153 }
3155 return true;
3156 }
3157 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
3158 {
3161 {
3163 }
3165 return true;
3166 }
3167
3168 }
3169
3170 #ifdef DIAG_DEVELOPER
3171 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
3172 {
3173 PrintNutritionsData();
3174 return true;
3175 }
3176 #endif
3177
3178 return false;
3179 }
3180
3182 {
3183 string debug_output;
3184
3185 debug_output = super.GetDebugText();
3186
3189
3190 return debug_output;
3191 }
3192
3193
3194
3195
3196
3198 {
3199 float ret = super.GetBaitEffectivity();
3200
3202 {
3203 ret *= 0.5;
3204 }
3205
3206 return ret;
3207 }
3208
3210 {
3212 }
3213
3215 {
3217 }
3218
3220 {
3222 }
3223
3224 #ifdef DIAG_DEVELOPER
3225 private void PrintNutritionsData()
3226 {
3227 string nutritionsData = "";
3228
3231
3233 if (profile)
3234 {
3235 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
3237 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
3241 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
3243
3246
3247 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
3249 }
3250
3251 nutritionsData += "-----\n";
3252
3254 }
3255 #endif
3256
3258
3261 {
3263 }
3264}
3265
3267{
3269};
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.