1814{
1816
1824
1834
1836
1838 {
1840 {
1842
1844 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1845
1849 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1850 }
1851 }
1852
1854 {
1856
1858 }
1859
1861 {
1862 super.EEDelete(parent);
1863
1865
1868 }
1869
1871 {
1872 super.EEItemLocationChanged(oldLoc, newLoc);
1873
1876 {
1877 switch (oldLoc.GetParent().GetType())
1878 {
1879 case "FryingPan":
1880 case "Pot":
1881 case "Cauldron":
1882 case "SharpWoodenStick":
1884 break;
1885 }
1886
1889 {
1891 }
1892 }
1893
1894 if (oldLoc.IsValid())
1896
1899 }
1900
1902 {
1905 }
1906
1908 {
1911
1912 return true;
1913 }
1914
1916 {
1918 {
1920 }
1921 }
1922
1925 {
1926 int foodStageType;
1927
1929 if (foodStage)
1930 foodStageType = foodStage.GetFoodStageType();
1931
1936
1937 return agentsIn;
1938 }
1939
1940
1942 {
1943 return false;
1944 }
1945
1947 {
1948 return false;
1949 }
1950
1952 {
1954 {
1956 {
1959
1962
1963 default:
1964 return super.GetTemperatureFreezeTime();
1965 }
1966 }
1967
1968 return super.GetTemperatureFreezeTime();
1969 }
1970
1972 {
1974 {
1976 {
1979
1982
1983 default:
1984 return super.GetTemperatureThawTime();
1985 }
1986 }
1987
1988 return super.GetTemperatureThawTime();
1989 }
1990
1992 {
1994 }
1995
1996
1997
1998
2000 {
2001 SetSynchDirty();
2002 }
2003
2005 {
2006 super.OnVariablesSynchronized();
2007
2008
2009
2010
2012 {
2014 }
2015 else
2016 {
2018 }
2019
2022 }
2023
2024
2025
2026
2028 {
2031
2033 }
2034
2036 {
2037 string soundName = "";
2038
2041
2043 {
2045 }
2046 else
2047 {
2049 {
2051 {
2056 else
2057 soundName = "";
2058 break;
2059 }
2060
2062 {
2067 else
2068 soundName = "";
2069 break;
2070 }
2071
2073 {
2078 else
2079 soundName = "";
2080 break;
2081 }
2082
2083 default:
2084 soundName = "";
2085 break;
2086 }
2087
2089 {
2090 if (soundName == "")
2091 {
2093 }
2094 else
2095 {
2097 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2098 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2100 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2101 {
2103 }
2104 }
2105 }
2106 }
2107
2109 }
2110
2112 {
2115 }
2116
2117
2118
2119
2121 {
2122 super.OnStoreSave(ctx);
2123
2125 {
2127 }
2128
2129
2132 }
2133
2135 {
2136 if (!super.OnStoreLoad(ctx, version))
2137 return false;
2138
2140 {
2142 return false;
2143 }
2144
2145 if (version >= 115)
2146 {
2148 {
2150 return false;
2151 }
2153 {
2155 return false;
2156 }
2157 }
2158
2161
2162 return true;
2163 }
2164
2166 {
2167 super.AfterStoreLoad();
2168
2170 }
2171
2172
2174 {
2176 }
2177
2178
2180 {
2181 return false;
2182 }
2183
2185 {
2186 return false;
2187 }
2188
2190 {
2191 return false;
2192 }
2193
2195 {
2196 return false;
2197 }
2198
2199
2200
2201
2202
2204 {
2207 {
2208 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2209 }
2210 else if (classname != "" && food_stage)
2211 {
2212 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2213 }
2214 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2216
2217 }
2218
2220 {
2223 {
2225 }
2226 else if (classname != "" && food_stage)
2227 {
2228 return FoodStage.GetEnergy(null, food_stage, classname);
2229 }
2230 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2232 }
2233
2235 {
2238 {
2240 }
2241 else if (classname != "" && food_stage)
2242 {
2243 return FoodStage.GetWater(null, food_stage, classname);
2244 }
2245 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2247 }
2248
2250 {
2253 {
2254 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2255 }
2256 else if (classname != "" && food_stage)
2257 {
2258 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2259 }
2260 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2262
2263 }
2264
2266 {
2269 {
2270 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2271 }
2272 else if (classname != "" && food_stage)
2273 {
2274 return FoodStage.GetToxicity(null, food_stage, classname);
2275 }
2276 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2278 }
2279
2281 {
2284 {
2286 }
2287 else if (classname != "" && food_stage)
2288 {
2289 return FoodStage.GetAgents(null, food_stage, classname);
2290 }
2291 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2293 }
2294
2296 {
2299 {
2300 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2301 }
2302 else if (classname != "" && food_stage)
2303 {
2304 return FoodStage.GetDigestibility(null, food_stage, classname);
2305 }
2306 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2308 }
2309
2311 {
2314 {
2315 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2316 }
2317 else if (className != "" && foodStage)
2318 {
2319 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2320 }
2321 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2323 }
2324
2326 {
2336
2337 return profile;
2338 }
2339
2340
2341
2342
2344 {
2346 }
2347
2348
2350 {
2352 {
2354 }
2355
2356 return false;
2357 }
2358
2360 {
2362 {
2364 }
2365
2366 return false;
2367 }
2368
2370 {
2372 {
2374 }
2375
2376 return false;
2377 }
2378
2380 {
2382 {
2384 }
2385
2386 return false;
2387 }
2388
2390 {
2392 {
2394 }
2395
2396 return false;
2397 }
2398
2400 {
2402 {
2404 }
2405
2406 return false;
2407 }
2408
2409
2411 {
2413 }
2414
2416 {
2417 return GetFoodStage().GetNextFoodStageType( cooking_method );
2418 }
2419
2421 {
2422 return GetFoodStage().GetFoodStageName( food_stage_type );
2423 }
2424
2426 {
2427 return GetFoodStage().CanChangeToNewStage( cooking_method );
2428 }
2429
2430
2432 {
2433 if ( !source.GetFoodStage())
2434 return;
2439 }
2440
2443 {
2446 }
2447
2450 {
2451 switch (stageNew)
2452 {
2457 break;
2458
2461 break;
2462 }
2463 }
2464
2465
2466
2467
2468
2470 {
2472 }
2473
2475 {
2477
2478
2480 }
2481
2483 {
2485 {
2488 }
2489 }
2490
2491
2493 {
2495 if (player)
2496 {
2498 player.ServerReplaceItemInHandsWithNew(lambda);
2499 }
2500 else
2501 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2502 }
2503
2505 {
2507 }
2508
2510 {
2511 super.SetActions();
2512
2515 }
2516
2518 {
2519 #ifndef SERVER
2521 {
2523
2526 }
2527 #endif
2528 }
2529
2531 {
2532 #ifndef SERVER
2534 {
2538 }
2539 #endif
2540 }
2541
2543 {
2544 return false;
2545 }
2546
2548 {
2550 }
2551
2552 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2553 {
2555
2556 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2558 if ( hasRootAsPlayer )
2560
2561
2562
2563
2564
2565
2566
2568 {
2569
2571 {
2573 {
2577 break;
2578
2582 break;
2583
2587 break;
2588
2592 default:
2595 return;
2596 }
2597
2598
2599 }
2600
2602
2604 {
2606 {
2607
2609 {
2611 }
2613 {
2616 {
2618 }
2619 else
2620 {
2622 {
2624 }
2625 else
2626 {
2628 }
2629 }
2630 }
2631 }
2632 }
2633
2634 }
2636 {
2637
2639 {
2641 {
2645 break;
2646
2650 break;
2651
2655 break;
2656
2660 break;
2661
2664 default:
2667 return;
2668 }
2669 }
2670
2672
2674 {
2676 {
2677
2679 {
2681 }
2682 }
2683 }
2684 }
2686 {
2687
2689 {
2691 {
2695 break;
2696
2699 default:
2702 return;
2703 }
2704 }
2705
2707
2709 {
2711 {
2712
2714 {
2716 }
2717 }
2718 }
2719 }
2720 else
2721 {
2722
2724
2726 {
2729
2730 }
2731 else
2732 {
2734 {
2737 }
2738 }
2739 }
2740 }
2741
2743 {
2744 if (
GetGame().IsDedicatedServer())
2745 return;
2746
2748 {
2750 GetInventory().GetCurrentInventoryLocation(invLoc);
2752 {
2754 if (ptcMgr)
2755 {
2760 }
2761 }
2762 }
2764 {
2766 {
2769 return;
2770 }
2771
2773 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2775 {
2778 }
2779 }
2780 }
2781
2782 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2783 {
2785 {
2790 }
2791
2792 super.GetDebugActions(outputList);
2793 }
2794
2796 {
2797 super.OnAction(action_id, player, ctx);
2798
2800 {
2801 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2802 {
2804 if (food_stage_prev <= 0)
2805 {
2807 }
2809 return true;
2810 }
2811 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2812 {
2815 {
2817 }
2819 return true;
2820 }
2821
2822 }
2823
2824 #ifdef DIAG_DEVELOPER
2825 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2826 {
2827 PrintNutritionsData();
2828 return true;
2829 }
2830 #endif
2831
2832 return false;
2833 }
2834
2836 {
2837 string debug_output;
2838
2839 debug_output = super.GetDebugText();
2840
2843
2844 return debug_output;
2845 }
2846
2847
2848
2849
2850
2852 {
2853 float ret = super.GetBaitEffectivity();
2854
2856 {
2857 ret *= 0.5;
2858 }
2859
2860 return ret;
2861 }
2862
2864 {
2866 }
2867
2869 {
2871 }
2872
2874 {
2876 }
2877
2878 #ifdef DIAG_DEVELOPER
2879 private void PrintNutritionsData()
2880 {
2881 string nutritionsData = "";
2882
2885
2887 if (profile)
2888 {
2889 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2891 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2895 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2897
2900
2901 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2903 }
2904
2905 nutritionsData += "-----\n";
2906
2908 }
2909 #endif
2910
2912
2915 {
2917 }
2918}
2919
2921{
2923};
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.