1788{
1790
1798
1808
1810
1812 {
1814 {
1816
1818 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1819
1823 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1824 }
1825 }
1826
1828 {
1830
1832 }
1833
1835 {
1836 super.EEDelete(parent);
1837
1839
1842 }
1843
1845 {
1846 super.EEItemLocationChanged(oldLoc, newLoc);
1847
1850 {
1851 switch (oldLoc.GetParent().GetType())
1852 {
1853 case "FryingPan":
1854 case "Pot":
1855 case "Cauldron":
1856 case "SharpWoodenStick":
1858 break;
1859 }
1860
1863 {
1865 }
1866 }
1867
1868 if (oldLoc.IsValid())
1870
1873 }
1874
1876 {
1879 }
1880
1882 {
1885
1886 return true;
1887 }
1888
1890 {
1892 {
1894 }
1895 }
1896
1899 {
1900 int foodStageType;
1901
1903 if (foodStage)
1904 foodStageType = foodStage.GetFoodStageType();
1905
1910
1911 return agentsIn;
1912 }
1913
1914
1916 {
1917 return false;
1918 }
1919
1921 {
1922 return false;
1923 }
1924
1926 {
1928 {
1930 {
1933
1936
1937 default:
1938 return super.GetTemperatureFreezeTime();
1939 }
1940 }
1941
1942 return super.GetTemperatureFreezeTime();
1943 }
1944
1946 {
1948 {
1950 {
1953
1956
1957 default:
1958 return super.GetTemperatureThawTime();
1959 }
1960 }
1961
1962 return super.GetTemperatureThawTime();
1963 }
1964
1966 {
1968 }
1969
1970
1971
1972
1974 {
1975 SetSynchDirty();
1976 }
1977
1979 {
1980 super.OnVariablesSynchronized();
1981
1982
1983
1984
1986 {
1988 }
1989 else
1990 {
1992 }
1993
1996 }
1997
1998
1999
2000
2002 {
2005
2007 }
2008
2010 {
2011 string soundName = "";
2012
2015
2017 {
2019 }
2020 else
2021 {
2023 {
2025 {
2030 else
2031 soundName = "";
2032 break;
2033 }
2034
2036 {
2041 else
2042 soundName = "";
2043 break;
2044 }
2045
2047 {
2052 else
2053 soundName = "";
2054 break;
2055 }
2056
2057 default:
2058 soundName = "";
2059 break;
2060 }
2061
2063 {
2064 if (soundName == "")
2065 {
2067 }
2068 else
2069 {
2071 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2072 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2074 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2075 {
2077 }
2078 }
2079 }
2080 }
2081
2083 }
2084
2086 {
2089 }
2090
2091
2092
2093
2095 {
2096 super.OnStoreSave(ctx);
2097
2099 {
2101 }
2102
2103
2106 }
2107
2109 {
2110 if (!super.OnStoreLoad(ctx, version))
2111 return false;
2112
2114 {
2116 return false;
2117 }
2118
2119 if (version >= 115)
2120 {
2122 {
2124 return false;
2125 }
2127 {
2129 return false;
2130 }
2131 }
2132
2135
2136 return true;
2137 }
2138
2140 {
2141 super.AfterStoreLoad();
2142
2144 }
2145
2146
2148 {
2150 }
2151
2152
2154 {
2155 return false;
2156 }
2157
2159 {
2160 return false;
2161 }
2162
2164 {
2165 return false;
2166 }
2167
2169 {
2170 return false;
2171 }
2172
2173
2174
2175
2176
2178 {
2181 {
2182 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2183 }
2184 else if (classname != "" && food_stage)
2185 {
2186 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2187 }
2188 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2190
2191 }
2192
2194 {
2197 {
2199 }
2200 else if (classname != "" && food_stage)
2201 {
2202 return FoodStage.GetEnergy(null, food_stage, classname);
2203 }
2204 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2206 }
2207
2209 {
2212 {
2214 }
2215 else if (classname != "" && food_stage)
2216 {
2217 return FoodStage.GetWater(null, food_stage, classname);
2218 }
2219 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2221 }
2222
2224 {
2227 {
2228 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2229 }
2230 else if (classname != "" && food_stage)
2231 {
2232 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2233 }
2234 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2236
2237 }
2238
2240 {
2243 {
2244 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2245 }
2246 else if (classname != "" && food_stage)
2247 {
2248 return FoodStage.GetToxicity(null, food_stage, classname);
2249 }
2250 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2252 }
2253
2255 {
2258 {
2260 }
2261 else if (classname != "" && food_stage)
2262 {
2263 return FoodStage.GetAgents(null, food_stage, classname);
2264 }
2265 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2267 }
2268
2270 {
2273 {
2274 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2275 }
2276 else if (classname != "" && food_stage)
2277 {
2278 return FoodStage.GetDigestibility(null, food_stage, classname);
2279 }
2280 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2282 }
2283
2285 {
2288 {
2289 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2290 }
2291 else if (className != "" && foodStage)
2292 {
2293 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2294 }
2295 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2297 }
2298
2300 {
2310
2311 return profile;
2312 }
2313
2314
2315
2316
2318 {
2320 }
2321
2322
2324 {
2326 {
2328 }
2329
2330 return false;
2331 }
2332
2334 {
2336 {
2338 }
2339
2340 return false;
2341 }
2342
2344 {
2346 {
2348 }
2349
2350 return false;
2351 }
2352
2354 {
2356 {
2358 }
2359
2360 return false;
2361 }
2362
2364 {
2366 {
2368 }
2369
2370 return false;
2371 }
2372
2374 {
2376 {
2378 }
2379
2380 return false;
2381 }
2382
2383
2385 {
2387 }
2388
2390 {
2391 return GetFoodStage().GetNextFoodStageType( cooking_method );
2392 }
2393
2395 {
2396 return GetFoodStage().GetFoodStageName( food_stage_type );
2397 }
2398
2400 {
2401 return GetFoodStage().CanChangeToNewStage( cooking_method );
2402 }
2403
2404
2406 {
2407 if ( !source.GetFoodStage())
2408 return;
2413 }
2414
2417 {
2420 }
2421
2424 {
2425 switch (stageNew)
2426 {
2431 break;
2432
2435 break;
2436 }
2437 }
2438
2439
2440
2441
2442
2444 {
2446 }
2447
2449 {
2451
2452
2454 }
2455
2457 {
2459 {
2462 }
2463 }
2464
2465
2467 {
2469 if (player)
2470 {
2472 player.ServerReplaceItemInHandsWithNew(lambda);
2473 }
2474 else
2475 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2476 }
2477
2479 {
2481 }
2482
2484 {
2485 super.SetActions();
2486
2489 }
2490
2492 {
2493 #ifndef SERVER
2495 {
2497
2500 }
2501 #endif
2502 }
2503
2505 {
2506 #ifndef SERVER
2508 {
2512 }
2513 #endif
2514 }
2515
2517 {
2518 return false;
2519 }
2520
2522 {
2524 }
2525
2526 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2527 {
2529
2530 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2532 if ( hasRootAsPlayer )
2534
2535
2536
2537
2538
2539
2540
2542 {
2543
2545 {
2547 {
2551 break;
2552
2556 break;
2557
2561 break;
2562
2566 default:
2569 return;
2570 }
2571
2572
2573 }
2574
2576
2578 {
2580 {
2581
2583 {
2585 }
2587 {
2590 {
2592 }
2593 else
2594 {
2596 {
2598 }
2599 else
2600 {
2602 }
2603 }
2604 }
2605 }
2606 }
2607
2608 }
2610 {
2611
2613 {
2615 {
2619 break;
2620
2624 break;
2625
2629 break;
2630
2634 break;
2635
2638 default:
2641 return;
2642 }
2643 }
2644
2646
2648 {
2650 {
2651
2653 {
2655 }
2656 }
2657 }
2658 }
2660 {
2661
2663 {
2665 {
2669 break;
2670
2673 default:
2676 return;
2677 }
2678 }
2679
2681
2683 {
2685 {
2686
2688 {
2690 }
2691 }
2692 }
2693 }
2694 else
2695 {
2696
2698
2700 {
2703
2704 }
2705 else
2706 {
2708 {
2711 }
2712 }
2713 }
2714 }
2715
2717 {
2718 if (
GetGame().IsDedicatedServer())
2719 return;
2720
2722 {
2724 GetInventory().GetCurrentInventoryLocation(invLoc);
2726 {
2728 if (ptcMgr)
2729 {
2734 }
2735 }
2736 }
2738 {
2740 {
2743 return;
2744 }
2745
2747 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2749 {
2752 }
2753 }
2754 }
2755
2756 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2757 {
2758 super.GetDebugActions(outputList);
2759
2761 {
2765 }
2766 }
2767
2769 {
2770 super.OnAction(action_id, player, ctx);
2771
2773 {
2774 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2775 {
2777 if (food_stage_prev <= 0)
2778 {
2780 }
2782 return true;
2783 }
2784 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2785 {
2788 {
2790 }
2792 return true;
2793 }
2794
2795 }
2796
2797 #ifdef DIAG_DEVELOPER
2798 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2799 {
2800 PrintNutritionsData();
2801 return true;
2802 }
2803 #endif
2804
2805 return false;
2806 }
2807
2809 {
2810 string debug_output;
2811
2812 debug_output = super.GetDebugText();
2813
2816
2817 return debug_output;
2818 }
2819
2820
2821
2822
2823
2825 {
2826 float ret = super.GetBaitEffectivity();
2827
2829 {
2830 ret *= 0.5;
2831 }
2832
2833 return ret;
2834 }
2835
2837 {
2839 }
2840
2842 {
2844 }
2845
2847 {
2849 }
2850
2851 #ifdef DIAG_DEVELOPER
2852 private void PrintNutritionsData()
2853 {
2854 string nutritionsData = "";
2855
2858
2860 if (profile)
2861 {
2862 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2864 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2868 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2870
2873
2874 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2876 }
2877
2878 nutritionsData += "-----\n";
2879
2881 }
2882 #endif
2883
2885
2888 {
2890 }
2891}
2892
2894{
2896};
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.