2079{
2081
2089
2099
2101
2103 {
2105 {
2107
2109 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
2110
2114 RegisterNetSyncVariableBool("m_MakeCookingSounds");
2115 }
2116 }
2117
2119 {
2121
2123 }
2124
2126 {
2127 super.EEDelete(parent);
2128
2130
2133 }
2134
2136 {
2137 super.EEItemLocationChanged(oldLoc, newLoc);
2138
2141 {
2142 switch (oldLoc.GetParent().GetType())
2143 {
2144 case "FryingPan":
2145 case "Pot":
2146 case "Cauldron":
2147 case "SharpWoodenStick":
2149 break;
2150 }
2151
2154 {
2156 }
2157 }
2158
2159 if (oldLoc.IsValid())
2161
2164 }
2165
2167 {
2170 }
2171
2173 {
2176
2177 return true;
2178 }
2179
2181 {
2183 {
2185 }
2186 }
2187
2190 {
2191 int foodStageType;
2192
2194 if (foodStage)
2195 foodStageType = foodStage.GetFoodStageType();
2196
2201
2202 return agentsIn;
2203 }
2204
2205
2207 {
2208 return false;
2209 }
2210
2212 {
2213 return false;
2214 }
2215
2217 {
2219 {
2221 {
2224
2227
2228 default:
2229 return super.GetTemperatureFreezeTime();
2230 }
2231 }
2232
2233 return super.GetTemperatureFreezeTime();
2234 }
2235
2237 {
2239 {
2241 {
2244
2247
2248 default:
2249 return super.GetTemperatureThawTime();
2250 }
2251 }
2252
2253 return super.GetTemperatureThawTime();
2254 }
2255
2257 {
2259 }
2260
2261
2262
2263
2265 {
2266 SetSynchDirty();
2267 }
2268
2270 {
2271 super.OnVariablesSynchronized();
2272
2273
2274
2275
2277 {
2279 }
2280 else
2281 {
2283 }
2284
2287 }
2288
2289
2290
2291
2293 {
2296
2298 }
2299
2301 {
2302 string soundName = "";
2303
2306
2308 {
2310 }
2311 else
2312 {
2314 {
2316 {
2321 else
2322 soundName = "";
2323 break;
2324 }
2325
2327 {
2332 else
2333 soundName = "";
2334 break;
2335 }
2336
2338 {
2343 else
2344 soundName = "";
2345 break;
2346 }
2347
2348 default:
2349 soundName = "";
2350 break;
2351 }
2352
2354 {
2355 if (soundName == "")
2356 {
2358 }
2359 else
2360 {
2362 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2363 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2365 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2366 {
2368 }
2369 }
2370 }
2371 }
2372
2374 }
2375
2377 {
2380 }
2381
2382
2383
2384
2386 {
2387 super.OnStoreSave(ctx);
2388
2390 {
2392 }
2393
2394
2397 }
2398
2400 {
2401 if (!super.OnStoreLoad(ctx, version))
2402 return false;
2403
2405 {
2407 return false;
2408 }
2409
2410 if (version >= 115)
2411 {
2413 {
2415 return false;
2416 }
2418 {
2420 return false;
2421 }
2422 }
2423
2426
2427 return true;
2428 }
2429
2431 {
2432 super.AfterStoreLoad();
2433
2435 }
2436
2437
2439 {
2441 }
2442
2443
2445 {
2446 return false;
2447 }
2448
2450 {
2451 return false;
2452 }
2453
2455 {
2456 return false;
2457 }
2458
2460 {
2461 return false;
2462 }
2463
2464
2465
2466
2467
2469 {
2472 {
2473 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2474 }
2475 else if (classname != "" && food_stage)
2476 {
2477 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2478 }
2479 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2481
2482 }
2483
2485 {
2488 {
2490 }
2491 else if (classname != "" && food_stage)
2492 {
2493 return FoodStage.GetEnergy(null, food_stage, classname);
2494 }
2495 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2497 }
2498
2500 {
2503 {
2505 }
2506 else if (classname != "" && food_stage)
2507 {
2508 return FoodStage.GetWater(null, food_stage, classname);
2509 }
2510 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2512 }
2513
2515 {
2518 {
2519 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2520 }
2521 else if (classname != "" && food_stage)
2522 {
2523 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2524 }
2525 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2527
2528 }
2529
2531 {
2534 {
2535 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2536 }
2537 else if (classname != "" && food_stage)
2538 {
2539 return FoodStage.GetToxicity(null, food_stage, classname);
2540 }
2541 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2543 }
2544
2546 {
2549 {
2551 }
2552 else if (classname != "" && food_stage)
2553 {
2554 return FoodStage.GetAgents(null, food_stage, classname);
2555 }
2556 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2558 }
2559
2561 {
2564 {
2565 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2566 }
2567 else if (classname != "" && food_stage)
2568 {
2569 return FoodStage.GetDigestibility(null, food_stage, classname);
2570 }
2571 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2573 }
2574
2576 {
2579 {
2580 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2581 }
2582 else if (className != "" && foodStage)
2583 {
2584 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2585 }
2586 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2588 }
2589
2591 {
2601
2602 return profile;
2603 }
2604
2605
2606
2607
2609 {
2611 }
2612
2613
2615 {
2617 {
2619 }
2620
2621 return false;
2622 }
2623
2625 {
2627 {
2629 }
2630
2631 return false;
2632 }
2633
2635 {
2637 {
2639 }
2640
2641 return false;
2642 }
2643
2645 {
2647 {
2649 }
2650
2651 return false;
2652 }
2653
2655 {
2657 {
2659 }
2660
2661 return false;
2662 }
2663
2665 {
2667 {
2669 }
2670
2671 return false;
2672 }
2673
2674
2676 {
2678 }
2679
2681 {
2682 return GetFoodStage().GetNextFoodStageType( cooking_method );
2683 }
2684
2686 {
2687 return GetFoodStage().GetFoodStageName( food_stage_type );
2688 }
2689
2691 {
2692 return GetFoodStage().CanChangeToNewStage( cooking_method );
2693 }
2694
2695
2697 {
2698 if ( !source.GetFoodStage())
2699 return;
2704 }
2705
2708 {
2711 }
2712
2715 {
2716 switch (stageNew)
2717 {
2722 break;
2723
2726 break;
2727 }
2728 }
2729
2730
2731
2732
2733
2735 {
2737 }
2738
2740 {
2742
2743
2745 }
2746
2748 {
2750 {
2753 }
2754 }
2755
2756
2758 {
2760 if (player)
2761 {
2763 player.ServerReplaceItemInHandsWithNew(lambda);
2764 }
2765 else
2766 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2767 }
2768
2770 {
2772 }
2773
2775 {
2776 super.SetActions();
2777
2780 }
2781
2783 {
2784 #ifndef SERVER
2786 {
2788
2791 }
2792 #endif
2793 }
2794
2796 {
2797 #ifndef SERVER
2799 {
2803 }
2804 #endif
2805 }
2806
2808 {
2809 return false;
2810 }
2811
2813 {
2815 }
2816
2817 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2818 {
2820
2821 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2823 if ( hasRootAsPlayer )
2825
2826
2827
2828
2829
2830
2831
2833 {
2834
2836 {
2838 {
2842 break;
2843
2847 break;
2848
2852 break;
2853
2857 default:
2860 return;
2861 }
2862
2863
2864 }
2865
2867
2869 {
2871 {
2872
2874 {
2876 }
2878 {
2881 {
2883 }
2884 else
2885 {
2887 {
2889 }
2890 else
2891 {
2893 }
2894 }
2895 }
2896 }
2897 }
2898
2899 }
2901 {
2902
2904 {
2906 {
2910 break;
2911
2915 break;
2916
2920 break;
2921
2925 break;
2926
2929 default:
2932 return;
2933 }
2934 }
2935
2937
2939 {
2941 {
2942
2944 {
2946 }
2947 }
2948 }
2949 }
2951 {
2952
2954 {
2956 {
2960 break;
2961
2964 default:
2967 return;
2968 }
2969 }
2970
2972
2974 {
2976 {
2977
2979 {
2981 }
2982 }
2983 }
2984 }
2985 else
2986 {
2987
2989
2991 {
2994
2995 }
2996 else
2997 {
2999 {
3002 }
3003 }
3004 }
3005 }
3006
3008 {
3009 if (
GetGame().IsDedicatedServer())
3010 return;
3011
3013 {
3015 GetInventory().GetCurrentInventoryLocation(invLoc);
3017 {
3019 if (ptcMgr)
3020 {
3025 }
3026 }
3027 }
3029 {
3031 {
3034 return;
3035 }
3036
3038 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
3040 {
3043 }
3044 }
3045 }
3046
3047 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
3048 {
3050 {
3055 }
3056
3057 super.GetDebugActions(outputList);
3058 }
3059
3061 {
3062 super.OnAction(action_id, player, ctx);
3063
3065 {
3066 if ( action_id ==
EActions.FOOD_STAGE_PREV )
3067 {
3069 if (food_stage_prev <= 0)
3070 {
3072 }
3074 return true;
3075 }
3076 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
3077 {
3080 {
3082 }
3084 return true;
3085 }
3086
3087 }
3088
3089 #ifdef DIAG_DEVELOPER
3090 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
3091 {
3092 PrintNutritionsData();
3093 return true;
3094 }
3095 #endif
3096
3097 return false;
3098 }
3099
3101 {
3102 string debug_output;
3103
3104 debug_output = super.GetDebugText();
3105
3108
3109 return debug_output;
3110 }
3111
3112
3113
3114
3115
3117 {
3118 float ret = super.GetBaitEffectivity();
3119
3121 {
3122 ret *= 0.5;
3123 }
3124
3125 return ret;
3126 }
3127
3129 {
3131 }
3132
3134 {
3136 }
3137
3139 {
3141 }
3142
3143 #ifdef DIAG_DEVELOPER
3144 private void PrintNutritionsData()
3145 {
3146 string nutritionsData = "";
3147
3150
3152 if (profile)
3153 {
3154 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
3156 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
3160 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
3162
3165
3166 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
3168 }
3169
3170 nutritionsData += "-----\n";
3171
3173 }
3174 #endif
3175
3177
3180 {
3182 }
3183}
3184
3186{
3188};
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.