1766{
1768
1776
1786
1788
1790 {
1792 {
1794
1796 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1797
1801 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1802 }
1803 }
1804
1806 {
1808
1810 }
1811
1813 {
1814 super.EEDelete(parent);
1815
1817
1820 }
1821
1823 {
1824 super.EEItemLocationChanged(oldLoc, newLoc);
1825
1828 {
1829 switch (oldLoc.GetParent().GetType())
1830 {
1831 case "FryingPan":
1832 case "Pot":
1833 case "Cauldron":
1834 case "SharpWoodenStick":
1836 break;
1837 }
1838
1841 {
1843 }
1844 }
1845
1846 if (oldLoc.IsValid())
1848
1851 }
1852
1854 {
1857 }
1858
1860 {
1863
1864 return true;
1865 }
1866
1868 {
1870 {
1872 }
1873 }
1874
1877 {
1878 int foodStageType;
1879
1881 if (foodStage)
1882 foodStageType = foodStage.GetFoodStageType();
1883
1888
1889 return agentsIn;
1890 }
1891
1892
1894 {
1895 return false;
1896 }
1897
1899 {
1900 return false;
1901 }
1902
1904 {
1906 {
1908 {
1911
1914
1915 default:
1916 return super.GetTemperatureFreezeTime();
1917 }
1918 }
1919
1920 return super.GetTemperatureFreezeTime();
1921 }
1922
1924 {
1926 {
1928 {
1931
1934
1935 default:
1936 return super.GetTemperatureThawTime();
1937 }
1938 }
1939
1940 return super.GetTemperatureThawTime();
1941 }
1942
1944 {
1946 }
1947
1948
1949
1950
1952 {
1953 SetSynchDirty();
1954 }
1955
1957 {
1958 super.OnVariablesSynchronized();
1959
1960
1961
1962
1964 {
1966 }
1967 else
1968 {
1970 }
1971
1974 }
1975
1976
1977
1978
1980 {
1983
1985 }
1986
1988 {
1989 string soundName = "";
1990
1993
1995 {
1997 }
1998 else
1999 {
2001 {
2003 {
2008 else
2009 soundName = "";
2010 break;
2011 }
2012
2014 {
2019 else
2020 soundName = "";
2021 break;
2022 }
2023
2025 {
2030 else
2031 soundName = "";
2032 break;
2033 }
2034
2035 default:
2036 soundName = "";
2037 break;
2038 }
2039
2041 {
2042 if (soundName == "")
2043 {
2045 }
2046 else
2047 {
2049 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2050 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2052 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2053 {
2055 }
2056 }
2057 }
2058 }
2059
2061 }
2062
2064 {
2067 }
2068
2069
2070
2071
2073 {
2074 super.OnStoreSave(ctx);
2075
2077 {
2079 }
2080
2081
2084 }
2085
2087 {
2088 if (!super.OnStoreLoad(ctx, version))
2089 return false;
2090
2092 {
2094 return false;
2095 }
2096
2097 if (version >= 115)
2098 {
2100 {
2102 return false;
2103 }
2105 {
2107 return false;
2108 }
2109 }
2110
2113
2114 return true;
2115 }
2116
2118 {
2119 super.AfterStoreLoad();
2120
2122 }
2123
2124
2126 {
2128 }
2129
2130
2132 {
2133 return false;
2134 }
2135
2137 {
2138 return false;
2139 }
2140
2142 {
2143 return false;
2144 }
2145
2147 {
2148 return false;
2149 }
2150
2151
2152
2153
2154
2156 {
2159 {
2160 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2161 }
2162 else if (classname != "" && food_stage)
2163 {
2164 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2165 }
2166 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2168
2169 }
2170
2172 {
2175 {
2177 }
2178 else if (classname != "" && food_stage)
2179 {
2180 return FoodStage.GetEnergy(null, food_stage, classname);
2181 }
2182 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2184 }
2185
2187 {
2190 {
2192 }
2193 else if (classname != "" && food_stage)
2194 {
2195 return FoodStage.GetWater(null, food_stage, classname);
2196 }
2197 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2199 }
2200
2202 {
2205 {
2206 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2207 }
2208 else if (classname != "" && food_stage)
2209 {
2210 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2211 }
2212 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2214
2215 }
2216
2218 {
2221 {
2222 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2223 }
2224 else if (classname != "" && food_stage)
2225 {
2226 return FoodStage.GetToxicity(null, food_stage, classname);
2227 }
2228 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2230 }
2231
2233 {
2236 {
2238 }
2239 else if (classname != "" && food_stage)
2240 {
2241 return FoodStage.GetAgents(null, food_stage, classname);
2242 }
2243 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2245 }
2246
2248 {
2251 {
2252 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2253 }
2254 else if (classname != "" && food_stage)
2255 {
2256 return FoodStage.GetDigestibility(null, food_stage, classname);
2257 }
2258 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2260 }
2261
2263 {
2266 {
2267 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2268 }
2269 else if (className != "" && foodStage)
2270 {
2271 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2272 }
2273 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2275 }
2276
2278 {
2288
2289 return profile;
2290 }
2291
2292
2293
2294
2296 {
2298 }
2299
2300
2302 {
2304 {
2306 }
2307
2308 return false;
2309 }
2310
2312 {
2314 {
2316 }
2317
2318 return false;
2319 }
2320
2322 {
2324 {
2326 }
2327
2328 return false;
2329 }
2330
2332 {
2334 {
2336 }
2337
2338 return false;
2339 }
2340
2342 {
2344 {
2346 }
2347
2348 return false;
2349 }
2350
2352 {
2354 {
2356 }
2357
2358 return false;
2359 }
2360
2361
2363 {
2365 }
2366
2368 {
2369 return GetFoodStage().GetNextFoodStageType( cooking_method );
2370 }
2371
2373 {
2374 return GetFoodStage().GetFoodStageName( food_stage_type );
2375 }
2376
2378 {
2379 return GetFoodStage().CanChangeToNewStage( cooking_method );
2380 }
2381
2382
2384 {
2385 if ( !source.GetFoodStage())
2386 return;
2391 }
2392
2395 {
2398 }
2399
2402 {
2403 switch (stageNew)
2404 {
2409 break;
2410
2413 break;
2414 }
2415 }
2416
2417
2418
2419
2420
2422 {
2424 }
2425
2427 {
2429
2430
2432 }
2433
2435 {
2437 {
2440 }
2441 }
2442
2443
2445 {
2447 if (player)
2448 {
2450 player.ServerReplaceItemInHandsWithNew(lambda);
2451 }
2452 else
2453 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2454 }
2455
2457 {
2459 }
2460
2462 {
2463 super.SetActions();
2464
2467 }
2468
2470 {
2471 #ifndef SERVER
2473 {
2475
2478 }
2479 #endif
2480 }
2481
2483 {
2484 #ifndef SERVER
2486 {
2490 }
2491 #endif
2492 }
2493
2495 {
2496 return false;
2497 }
2498
2500 {
2502 }
2503
2504 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2505 {
2507
2508 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2510 if ( hasRootAsPlayer )
2512
2513
2514
2515
2516
2517
2518
2520 {
2521
2523 {
2525 {
2529 break;
2530
2534 break;
2535
2539 break;
2540
2544 default:
2547 return;
2548 }
2549
2550
2551 }
2552
2554
2556 {
2558 {
2559
2561 {
2563 }
2565 {
2568 {
2570 }
2571 else
2572 {
2574 {
2576 }
2577 else
2578 {
2580 }
2581 }
2582 }
2583 }
2584 }
2585
2586 }
2588 {
2589
2591 {
2593 {
2597 break;
2598
2602 break;
2603
2607 break;
2608
2612 break;
2613
2616 default:
2619 return;
2620 }
2621 }
2622
2624
2626 {
2628 {
2629
2631 {
2633 }
2634 }
2635 }
2636 }
2638 {
2639
2641 {
2643 {
2647 break;
2648
2651 default:
2654 return;
2655 }
2656 }
2657
2659
2661 {
2663 {
2664
2666 {
2668 }
2669 }
2670 }
2671 }
2672 else
2673 {
2674
2676
2678 {
2681
2682 }
2683 else
2684 {
2686 {
2689 }
2690 }
2691 }
2692 }
2693
2695 {
2696 if (
GetGame().IsDedicatedServer())
2697 return;
2698
2700 {
2702 GetInventory().GetCurrentInventoryLocation(invLoc);
2704 {
2706 if (ptcMgr)
2707 {
2712 }
2713 }
2714 }
2716 {
2718 {
2721 return;
2722 }
2723
2725 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2727 {
2730 }
2731 }
2732 }
2733
2734 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2735 {
2737 {
2742 }
2743
2744 super.GetDebugActions(outputList);
2745 }
2746
2748 {
2749 super.OnAction(action_id, player, ctx);
2750
2752 {
2753 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2754 {
2756 if (food_stage_prev <= 0)
2757 {
2759 }
2761 return true;
2762 }
2763 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2764 {
2767 {
2769 }
2771 return true;
2772 }
2773
2774 }
2775
2776 #ifdef DIAG_DEVELOPER
2777 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2778 {
2779 PrintNutritionsData();
2780 return true;
2781 }
2782 #endif
2783
2784 return false;
2785 }
2786
2788 {
2789 string debug_output;
2790
2791 debug_output = super.GetDebugText();
2792
2795
2796 return debug_output;
2797 }
2798
2799
2800
2801
2802
2804 {
2805 float ret = super.GetBaitEffectivity();
2806
2808 {
2809 ret *= 0.5;
2810 }
2811
2812 return ret;
2813 }
2814
2816 {
2818 }
2819
2821 {
2823 }
2824
2826 {
2828 }
2829
2830 #ifdef DIAG_DEVELOPER
2831 private void PrintNutritionsData()
2832 {
2833 string nutritionsData = "";
2834
2837
2839 if (profile)
2840 {
2841 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2843 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2847 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2849
2852
2853 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2855 }
2856
2857 nutritionsData += "-----\n";
2858
2860 }
2861 #endif
2862
2864
2867 {
2869 }
2870}
2871
2873{
2875};
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.