2078{
2080
2088
2098
2100
2102 {
2104 {
2106
2108 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
2109
2113 RegisterNetSyncVariableBool("m_MakeCookingSounds");
2114 }
2115 }
2116
2118 {
2120
2122 }
2123
2125 {
2126 super.EEDelete(parent);
2127
2129
2132 }
2133
2135 {
2136 super.EEItemLocationChanged(oldLoc, newLoc);
2137
2140 {
2141 switch (oldLoc.GetParent().GetType())
2142 {
2143 case "FryingPan":
2144 case "Pot":
2145 case "Cauldron":
2146 case "SharpWoodenStick":
2148 break;
2149 }
2150
2153 {
2155 }
2156 }
2157
2158 if (oldLoc.IsValid())
2160
2163 }
2164
2166 {
2169 }
2170
2172 {
2175
2176 return true;
2177 }
2178
2180 {
2182 {
2184 }
2185 }
2186
2189 {
2190 int foodStageType;
2191
2193 if (foodStage)
2194 foodStageType = foodStage.GetFoodStageType();
2195
2200
2201 return agentsIn;
2202 }
2203
2204
2206 {
2207 return false;
2208 }
2209
2211 {
2212 return false;
2213 }
2214
2216 {
2218 {
2220 {
2223
2226
2227 default:
2228 return super.GetTemperatureFreezeTime();
2229 }
2230 }
2231
2232 return super.GetTemperatureFreezeTime();
2233 }
2234
2236 {
2238 {
2240 {
2243
2246
2247 default:
2248 return super.GetTemperatureThawTime();
2249 }
2250 }
2251
2252 return super.GetTemperatureThawTime();
2253 }
2254
2256 {
2258 }
2259
2260
2261
2262
2264 {
2265 SetSynchDirty();
2266 }
2267
2269 {
2270 super.OnVariablesSynchronized();
2271
2272
2273
2274
2276 {
2278 }
2279 else
2280 {
2282 }
2283
2286 }
2287
2288
2289
2290
2292 {
2295
2297 }
2298
2300 {
2301 string soundName = "";
2302
2305
2307 {
2309 }
2310 else
2311 {
2313 {
2315 {
2320 else
2321 soundName = "";
2322 break;
2323 }
2324
2326 {
2331 else
2332 soundName = "";
2333 break;
2334 }
2335
2337 {
2342 else
2343 soundName = "";
2344 break;
2345 }
2346
2347 default:
2348 soundName = "";
2349 break;
2350 }
2351
2353 {
2354 if (soundName == "")
2355 {
2357 }
2358 else
2359 {
2361 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2362 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2364 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2365 {
2367 }
2368 }
2369 }
2370 }
2371
2373 }
2374
2376 {
2379 }
2380
2381
2382
2383
2385 {
2386 super.OnStoreSave(ctx);
2387
2389 {
2391 }
2392
2393
2396 }
2397
2399 {
2400 if (!super.OnStoreLoad(ctx, version))
2401 return false;
2402
2404 {
2406 return false;
2407 }
2408
2409 if (version >= 115)
2410 {
2412 {
2414 return false;
2415 }
2417 {
2419 return false;
2420 }
2421 }
2422
2425
2426 return true;
2427 }
2428
2430 {
2431 super.AfterStoreLoad();
2432
2434 }
2435
2436
2438 {
2440 }
2441
2442
2444 {
2445 return false;
2446 }
2447
2449 {
2450 return false;
2451 }
2452
2454 {
2455 return false;
2456 }
2457
2459 {
2460 return false;
2461 }
2462
2463
2464
2465
2466
2468 {
2471 {
2472 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2473 }
2474 else if (classname != "" && food_stage)
2475 {
2476 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2477 }
2478 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2480
2481 }
2482
2484 {
2487 {
2489 }
2490 else if (classname != "" && food_stage)
2491 {
2492 return FoodStage.GetEnergy(null, food_stage, classname);
2493 }
2494 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2496 }
2497
2499 {
2502 {
2504 }
2505 else if (classname != "" && food_stage)
2506 {
2507 return FoodStage.GetWater(null, food_stage, classname);
2508 }
2509 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2511 }
2512
2514 {
2517 {
2518 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2519 }
2520 else if (classname != "" && food_stage)
2521 {
2522 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2523 }
2524 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2526
2527 }
2528
2530 {
2533 {
2534 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2535 }
2536 else if (classname != "" && food_stage)
2537 {
2538 return FoodStage.GetToxicity(null, food_stage, classname);
2539 }
2540 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2542 }
2543
2545 {
2548 {
2550 }
2551 else if (classname != "" && food_stage)
2552 {
2553 return FoodStage.GetAgents(null, food_stage, classname);
2554 }
2555 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2557 }
2558
2560 {
2563 {
2564 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2565 }
2566 else if (classname != "" && food_stage)
2567 {
2568 return FoodStage.GetDigestibility(null, food_stage, classname);
2569 }
2570 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2572 }
2573
2575 {
2578 {
2579 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2580 }
2581 else if (className != "" && foodStage)
2582 {
2583 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2584 }
2585 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2587 }
2588
2590 {
2600
2601 return profile;
2602 }
2603
2604
2605
2606
2608 {
2610 }
2611
2612
2614 {
2616 {
2618 }
2619
2620 return false;
2621 }
2622
2624 {
2626 {
2628 }
2629
2630 return false;
2631 }
2632
2634 {
2636 {
2638 }
2639
2640 return false;
2641 }
2642
2644 {
2646 {
2648 }
2649
2650 return false;
2651 }
2652
2654 {
2656 {
2658 }
2659
2660 return false;
2661 }
2662
2664 {
2666 {
2668 }
2669
2670 return false;
2671 }
2672
2673
2675 {
2677 }
2678
2680 {
2681 return GetFoodStage().GetNextFoodStageType( cooking_method );
2682 }
2683
2685 {
2686 return GetFoodStage().GetFoodStageName( food_stage_type );
2687 }
2688
2690 {
2691 return GetFoodStage().CanChangeToNewStage( cooking_method );
2692 }
2693
2694
2696 {
2697 if ( !source.GetFoodStage())
2698 return;
2703 }
2704
2707 {
2710 }
2711
2714 {
2715 switch (stageNew)
2716 {
2721 break;
2722
2725 break;
2726 }
2727 }
2728
2729
2730
2731
2732
2734 {
2736 }
2737
2739 {
2741
2742
2744 }
2745
2747 {
2749 {
2752 }
2753 }
2754
2755
2757 {
2759 if (player)
2760 {
2762 player.ServerReplaceItemInHandsWithNew(lambda);
2763 }
2764 else
2765 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2766 }
2767
2769 {
2771 }
2772
2774 {
2775 super.SetActions();
2776
2779 }
2780
2782 {
2783 #ifndef SERVER
2785 {
2787
2790 }
2791 #endif
2792 }
2793
2795 {
2796 #ifndef SERVER
2798 {
2802 }
2803 #endif
2804 }
2805
2807 {
2808 return false;
2809 }
2810
2812 {
2814 }
2815
2816 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2817 {
2819
2820 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2822 if ( hasRootAsPlayer )
2824
2825
2826
2827
2828
2829
2830
2832 {
2833
2835 {
2837 {
2841 break;
2842
2846 break;
2847
2851 break;
2852
2856 default:
2859 return;
2860 }
2861
2862
2863 }
2864
2866
2868 {
2870 {
2871
2873 {
2875 }
2877 {
2880 {
2882 }
2883 else
2884 {
2886 {
2888 }
2889 else
2890 {
2892 }
2893 }
2894 }
2895 }
2896 }
2897
2898 }
2900 {
2901
2903 {
2905 {
2909 break;
2910
2914 break;
2915
2919 break;
2920
2924 break;
2925
2928 default:
2931 return;
2932 }
2933 }
2934
2936
2938 {
2940 {
2941
2943 {
2945 }
2946 }
2947 }
2948 }
2950 {
2951
2953 {
2955 {
2959 break;
2960
2963 default:
2966 return;
2967 }
2968 }
2969
2971
2973 {
2975 {
2976
2978 {
2980 }
2981 }
2982 }
2983 }
2984 else
2985 {
2986
2988
2990 {
2993
2994 }
2995 else
2996 {
2998 {
3001 }
3002 }
3003 }
3004 }
3005
3007 {
3008 if (
GetGame().IsDedicatedServer())
3009 return;
3010
3012 {
3014 GetInventory().GetCurrentInventoryLocation(invLoc);
3016 {
3018 if (ptcMgr)
3019 {
3024 }
3025 }
3026 }
3028 {
3030 {
3033 return;
3034 }
3035
3037 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
3039 {
3042 }
3043 }
3044 }
3045
3046 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
3047 {
3048 super.GetDebugActions(outputList);
3049
3051 {
3055 }
3056 }
3057
3059 {
3060 super.OnAction(action_id, player, ctx);
3061
3063 {
3064 if ( action_id ==
EActions.FOOD_STAGE_PREV )
3065 {
3067 if (food_stage_prev <= 0)
3068 {
3070 }
3072 return true;
3073 }
3074 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
3075 {
3078 {
3080 }
3082 return true;
3083 }
3084
3085 }
3086
3087 #ifdef DIAG_DEVELOPER
3088 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
3089 {
3090 PrintNutritionsData();
3091 return true;
3092 }
3093 #endif
3094
3095 return false;
3096 }
3097
3099 {
3100 string debug_output;
3101
3102 debug_output = super.GetDebugText();
3103
3106
3107 return debug_output;
3108 }
3109
3110
3111
3112
3113
3115 {
3116 float ret = super.GetBaitEffectivity();
3117
3119 {
3120 ret *= 0.5;
3121 }
3122
3123 return ret;
3124 }
3125
3127 {
3129 }
3130
3132 {
3134 }
3135
3137 {
3139 }
3140
3141 #ifdef DIAG_DEVELOPER
3142 private void PrintNutritionsData()
3143 {
3144 string nutritionsData = "";
3145
3148
3150 if (profile)
3151 {
3152 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
3154 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
3158 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
3160
3163
3164 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
3166 }
3167
3168 nutritionsData += "-----\n";
3169
3171 }
3172 #endif
3173
3175
3178 {
3180 }
3181}
3182
3184{
3186};
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.