2148{
2150
2158
2168
2170
2172 {
2174 {
2176
2178 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
2179
2183 RegisterNetSyncVariableBool("m_MakeCookingSounds");
2184 }
2185 }
2186
2188 {
2190
2192 }
2193
2195 {
2196 super.EEDelete(parent);
2197
2199
2202 }
2203
2205 {
2206 super.EEItemLocationChanged(oldLoc, newLoc);
2207
2210 {
2211 switch (oldLoc.GetParent().GetType())
2212 {
2213 case "FryingPan":
2214 case "Pot":
2215 case "Cauldron":
2216 case "SharpWoodenStick":
2218 break;
2219 }
2220
2223 {
2225 }
2226 }
2227
2228 if (oldLoc.IsValid())
2230
2233 }
2234
2236 {
2239 }
2240
2242 {
2245
2246 return true;
2247 }
2248
2250 {
2252 {
2254 }
2255 }
2256
2259 {
2260 int foodStageType;
2261
2263 if (foodStage)
2264 foodStageType = foodStage.GetFoodStageType();
2265
2270
2271 return agentsIn;
2272 }
2273
2274
2276 {
2277 return false;
2278 }
2279
2281 {
2282 return false;
2283 }
2284
2286 {
2288 {
2290 {
2293
2296
2297 default:
2298 return super.GetTemperatureFreezeTime();
2299 }
2300 }
2301
2302 return super.GetTemperatureFreezeTime();
2303 }
2304
2306 {
2308 {
2310 {
2313
2316
2317 default:
2318 return super.GetTemperatureThawTime();
2319 }
2320 }
2321
2322 return super.GetTemperatureThawTime();
2323 }
2324
2326 {
2328 }
2329
2330
2331
2332
2334 {
2335 SetSynchDirty();
2336 }
2337
2339 {
2340 super.OnVariablesSynchronized();
2341
2342
2343
2344
2346 {
2348 }
2349 else
2350 {
2352 }
2353
2356 }
2357
2358
2359
2360
2362 {
2365
2367 }
2368
2370 {
2371 string soundName = "";
2372
2375
2377 {
2379 }
2380 else
2381 {
2383 {
2385 {
2390 else
2391 soundName = "";
2392 break;
2393 }
2394
2396 {
2401 else
2402 soundName = "";
2403 break;
2404 }
2405
2407 {
2412 else
2413 soundName = "";
2414 break;
2415 }
2416
2417 default:
2418 soundName = "";
2419 break;
2420 }
2421
2423 {
2424 if (soundName == "")
2425 {
2427 }
2428 else
2429 {
2431 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2432 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2434 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2435 {
2437 }
2438 }
2439 }
2440 }
2441
2443 }
2444
2446 {
2449 }
2450
2451
2452
2453
2455 {
2456 super.OnStoreSave(ctx);
2457
2459 {
2461 }
2462
2463
2466 }
2467
2469 {
2470 if (!super.OnStoreLoad(ctx, version))
2471 return false;
2472
2474 {
2476 return false;
2477 }
2478
2479 if (version >= 115)
2480 {
2482 {
2484 return false;
2485 }
2487 {
2489 return false;
2490 }
2491 }
2492
2495
2496 return true;
2497 }
2498
2500 {
2501 super.AfterStoreLoad();
2502
2504 }
2505
2506
2508 {
2510 }
2511
2512
2514 {
2515 return false;
2516 }
2517
2519 {
2520 return false;
2521 }
2522
2524 {
2525 return false;
2526 }
2527
2529 {
2530 return false;
2531 }
2532
2533
2534
2535
2536
2538 {
2541 {
2542 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2543 }
2544 else if (classname != "" && food_stage)
2545 {
2546 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2547 }
2548 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2550
2551 }
2552
2554 {
2557 {
2559 }
2560 else if (classname != "" && food_stage)
2561 {
2562 return FoodStage.GetEnergy(null, food_stage, classname);
2563 }
2564 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2566 }
2567
2569 {
2572 {
2574 }
2575 else if (classname != "" && food_stage)
2576 {
2577 return FoodStage.GetWater(null, food_stage, classname);
2578 }
2579 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2581 }
2582
2584 {
2587 {
2588 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2589 }
2590 else if (classname != "" && food_stage)
2591 {
2592 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2593 }
2594 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2596
2597 }
2598
2600 {
2603 {
2604 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2605 }
2606 else if (classname != "" && food_stage)
2607 {
2608 return FoodStage.GetToxicity(null, food_stage, classname);
2609 }
2610 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2612 }
2613
2615 {
2618 {
2620 }
2621 else if (classname != "" && food_stage)
2622 {
2623 return FoodStage.GetAgents(null, food_stage, classname);
2624 }
2625 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2627 }
2628
2630 {
2633 {
2634 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2635 }
2636 else if (classname != "" && food_stage)
2637 {
2638 return FoodStage.GetDigestibility(null, food_stage, classname);
2639 }
2640 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2642 }
2643
2645 {
2648 {
2649 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2650 }
2651 else if (className != "" && foodStage)
2652 {
2653 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2654 }
2655 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2657 }
2658
2660 {
2670
2671 return profile;
2672 }
2673
2674
2675
2676
2678 {
2680 }
2681
2682
2684 {
2686 {
2688 }
2689
2690 return false;
2691 }
2692
2694 {
2696 {
2698 }
2699
2700 return false;
2701 }
2702
2704 {
2706 {
2708 }
2709
2710 return false;
2711 }
2712
2714 {
2716 {
2718 }
2719
2720 return false;
2721 }
2722
2724 {
2726 {
2728 }
2729
2730 return false;
2731 }
2732
2734 {
2736 {
2738 }
2739
2740 return false;
2741 }
2742
2743
2745 {
2747 }
2748
2750 {
2751 return GetFoodStage().GetNextFoodStageType( cooking_method );
2752 }
2753
2755 {
2756 return GetFoodStage().GetFoodStageName( food_stage_type );
2757 }
2758
2760 {
2761 return GetFoodStage().CanChangeToNewStage( cooking_method );
2762 }
2763
2764
2766 {
2767 if ( !source.GetFoodStage())
2768 return;
2773 }
2774
2777 {
2780 }
2781
2784 {
2785 switch (stageNew)
2786 {
2791 break;
2792
2795 break;
2796 }
2797 }
2798
2799
2800
2801
2802
2804 {
2806 }
2807
2809 {
2811
2812
2814 }
2815
2817 {
2819 {
2822 }
2823 }
2824
2825
2827 {
2829 if (player)
2830 {
2832 player.ServerReplaceItemInHandsWithNew(lambda);
2833 }
2834 else
2835 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2836 }
2837
2839 {
2841 }
2842
2844 {
2845 super.SetActions();
2846
2849 }
2850
2852 {
2853 #ifndef SERVER
2855 {
2857
2860 }
2861 #endif
2862 }
2863
2865 {
2866 #ifndef SERVER
2868 {
2872 }
2873 #endif
2874 }
2875
2877 {
2878 return false;
2879 }
2880
2882 {
2884 }
2885
2886 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2887 {
2889
2890 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2892 if ( hasRootAsPlayer )
2894
2895
2896
2897
2898
2899
2900
2902 {
2903
2905 {
2907 {
2911 break;
2912
2916 break;
2917
2921 break;
2922
2926 default:
2929 return;
2930 }
2931
2932
2933 }
2934
2936
2938 {
2940 {
2941
2943 {
2945 }
2947 {
2950 {
2952 }
2953 else
2954 {
2956 {
2958 }
2959 else
2960 {
2962 }
2963 }
2964 }
2965 }
2966 }
2967
2968 }
2970 {
2971
2973 {
2975 {
2979 break;
2980
2984 break;
2985
2989 break;
2990
2994 break;
2995
2998 default:
3001 return;
3002 }
3003 }
3004
3006
3008 {
3010 {
3011
3013 {
3015 }
3016 }
3017 }
3018 }
3020 {
3021
3023 {
3025 {
3029 break;
3030
3033 default:
3036 return;
3037 }
3038 }
3039
3041
3043 {
3045 {
3046
3048 {
3050 }
3051 }
3052 }
3053 }
3054 else
3055 {
3056
3058
3060 {
3063
3064 }
3065 else
3066 {
3068 {
3071 }
3072 }
3073 }
3074 }
3075
3077 {
3078 if (
GetGame().IsDedicatedServer())
3079 return;
3080
3082 {
3084 GetInventory().GetCurrentInventoryLocation(invLoc);
3086 {
3088 if (ptcMgr)
3089 {
3094 }
3095 }
3096 }
3098 {
3100 {
3103 return;
3104 }
3105
3107 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
3109 {
3112 }
3113 }
3114 }
3115
3116 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
3117 {
3119 {
3124 }
3125
3126 super.GetDebugActions(outputList);
3127 }
3128
3130 {
3131 super.OnAction(action_id, player, ctx);
3132
3134 {
3135 if ( action_id ==
EActions.FOOD_STAGE_PREV )
3136 {
3138 if (food_stage_prev <= 0)
3139 {
3141 }
3143 return true;
3144 }
3145 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
3146 {
3149 {
3151 }
3153 return true;
3154 }
3155
3156 }
3157
3158 #ifdef DIAG_DEVELOPER
3159 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
3160 {
3161 PrintNutritionsData();
3162 return true;
3163 }
3164 #endif
3165
3166 return false;
3167 }
3168
3170 {
3171 string debug_output;
3172
3173 debug_output = super.GetDebugText();
3174
3177
3178 return debug_output;
3179 }
3180
3181
3182
3183
3184
3186 {
3187 float ret = super.GetBaitEffectivity();
3188
3190 {
3191 ret *= 0.5;
3192 }
3193
3194 return ret;
3195 }
3196
3198 {
3200 }
3201
3203 {
3205 }
3206
3208 {
3210 }
3211
3212 #ifdef DIAG_DEVELOPER
3213 private void PrintNutritionsData()
3214 {
3215 string nutritionsData = "";
3216
3219
3221 if (profile)
3222 {
3223 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
3225 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
3229 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
3231
3234
3235 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
3237 }
3238
3239 nutritionsData += "-----\n";
3240
3242 }
3243 #endif
3244
3246
3249 {
3251 }
3252}
3253
3255{
3257};
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.