1739{
1741
1749
1759
1761
1763 {
1765 {
1767
1769 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1770
1774 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1775 }
1776 }
1777
1779 {
1781
1783 }
1784
1786 {
1787 super.EEDelete(parent);
1788
1790
1793 }
1794
1796 {
1797 super.EEItemLocationChanged(oldLoc, newLoc);
1798
1801 {
1802 switch (oldLoc.GetParent().GetType())
1803 {
1804 case "FryingPan":
1805 case "Pot":
1806 case "Cauldron":
1807 case "SharpWoodenStick":
1809 break;
1810 }
1811
1814 {
1816 }
1817 }
1818
1819 if (oldLoc.IsValid())
1821
1824 }
1825
1827 {
1830 }
1831
1833 {
1836
1837 return true;
1838 }
1839
1841 {
1843 {
1845 }
1846 }
1847
1850 {
1851 int foodStageType;
1852
1854 if (foodStage)
1855 foodStageType = foodStage.GetFoodStageType();
1856
1861
1862 return agentsIn;
1863 }
1864
1865
1867 {
1868 return false;
1869 }
1870
1872 {
1873 return false;
1874 }
1875
1877 {
1879 {
1881 {
1884
1887
1888 default:
1889 return super.GetTemperatureFreezeTime();
1890 }
1891 }
1892
1893 return super.GetTemperatureFreezeTime();
1894 }
1895
1897 {
1899 {
1901 {
1904
1907
1908 default:
1909 return super.GetTemperatureThawTime();
1910 }
1911 }
1912
1913 return super.GetTemperatureThawTime();
1914 }
1915
1917 {
1919 }
1920
1921
1922
1923
1925 {
1926 SetSynchDirty();
1927 }
1928
1930 {
1931 super.OnVariablesSynchronized();
1932
1933
1934
1935
1937 {
1939 }
1940 else
1941 {
1943 }
1944
1947 }
1948
1949
1950
1951
1953 {
1956
1958 }
1959
1961 {
1962 string soundName = "";
1963
1966
1968 {
1970 }
1971 else
1972 {
1974 {
1976 {
1981 else
1982 soundName = "";
1983 break;
1984 }
1985
1987 {
1992 else
1993 soundName = "";
1994 break;
1995 }
1996
1998 {
2003 else
2004 soundName = "";
2005 break;
2006 }
2007
2008 default:
2009 soundName = "";
2010 break;
2011 }
2012
2014 {
2015 if (soundName == "")
2016 {
2018 }
2019 else
2020 {
2022 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2023 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2025 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2026 {
2028 }
2029 }
2030 }
2031 }
2032
2034 }
2035
2037 {
2040 }
2041
2042
2043
2044
2046 {
2047 super.OnStoreSave(ctx);
2048
2050 {
2052 }
2053
2054
2057 }
2058
2060 {
2061 if (!super.OnStoreLoad(ctx, version))
2062 return false;
2063
2065 {
2067 return false;
2068 }
2069
2070 if (version >= 115)
2071 {
2073 {
2075 return false;
2076 }
2078 {
2080 return false;
2081 }
2082 }
2083
2086
2087 return true;
2088 }
2089
2091 {
2092 super.AfterStoreLoad();
2093
2095 }
2096
2097
2099 {
2101 }
2102
2103
2105 {
2106 return false;
2107 }
2108
2110 {
2111 return false;
2112 }
2113
2115 {
2116 return false;
2117 }
2118
2120 {
2121 return false;
2122 }
2123
2124
2125
2126
2127
2129 {
2132 {
2133 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2134 }
2135 else if (classname != "" && food_stage)
2136 {
2137 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2138 }
2139 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2141
2142 }
2143
2145 {
2148 {
2150 }
2151 else if (classname != "" && food_stage)
2152 {
2153 return FoodStage.GetEnergy(null, food_stage, classname);
2154 }
2155 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2157 }
2158
2160 {
2163 {
2165 }
2166 else if (classname != "" && food_stage)
2167 {
2168 return FoodStage.GetWater(null, food_stage, classname);
2169 }
2170 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2172 }
2173
2175 {
2178 {
2179 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2180 }
2181 else if (classname != "" && food_stage)
2182 {
2183 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2184 }
2185 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2187
2188 }
2189
2191 {
2194 {
2195 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2196 }
2197 else if (classname != "" && food_stage)
2198 {
2199 return FoodStage.GetToxicity(null, food_stage, classname);
2200 }
2201 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2203 }
2204
2206 {
2209 {
2211 }
2212 else if (classname != "" && food_stage)
2213 {
2214 return FoodStage.GetAgents(null, food_stage, classname);
2215 }
2216 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2218 }
2219
2221 {
2224 {
2225 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2226 }
2227 else if (classname != "" && food_stage)
2228 {
2229 return FoodStage.GetDigestibility(null, food_stage, classname);
2230 }
2231 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2233 }
2234
2236 {
2239 {
2240 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2241 }
2242 else if (className != "" && foodStage)
2243 {
2244 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2245 }
2246 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2248 }
2249
2251 {
2261
2262 return profile;
2263 }
2264
2265
2266
2267
2269 {
2271 }
2272
2273
2275 {
2277 {
2279 }
2280
2281 return false;
2282 }
2283
2285 {
2287 {
2289 }
2290
2291 return false;
2292 }
2293
2295 {
2297 {
2299 }
2300
2301 return false;
2302 }
2303
2305 {
2307 {
2309 }
2310
2311 return false;
2312 }
2313
2315 {
2317 {
2319 }
2320
2321 return false;
2322 }
2323
2325 {
2327 {
2329 }
2330
2331 return false;
2332 }
2333
2334
2336 {
2338 }
2339
2341 {
2342 return GetFoodStage().GetNextFoodStageType( cooking_method );
2343 }
2344
2346 {
2347 return GetFoodStage().GetFoodStageName( food_stage_type );
2348 }
2349
2351 {
2352 return GetFoodStage().CanChangeToNewStage( cooking_method );
2353 }
2354
2355
2357 {
2358 if ( !source.GetFoodStage())
2359 return;
2364 }
2365
2368 {
2371 }
2372
2375 {
2376 switch (stageNew)
2377 {
2382 break;
2383
2386 break;
2387 }
2388 }
2389
2390
2391
2392
2393
2395 {
2397 }
2398
2400 {
2402
2403
2405 }
2406
2408 {
2410 {
2413 }
2414 }
2415
2416
2418 {
2420 if (player)
2421 {
2423 player.ServerReplaceItemInHandsWithNew(lambda);
2424 }
2425 else
2426 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2427 }
2428
2430 {
2432 }
2433
2435 {
2436 super.SetActions();
2437
2440 }
2441
2443 {
2444 #ifndef SERVER
2446 {
2448
2451 }
2452 #endif
2453 }
2454
2456 {
2457 #ifndef SERVER
2459 {
2463 }
2464 #endif
2465 }
2466
2468 {
2469 return false;
2470 }
2471
2473 {
2475 }
2476
2477 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2478 {
2480
2481 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2483 if ( hasRootAsPlayer )
2485
2486
2487
2488
2489
2490
2491
2493 {
2494
2496 {
2498 {
2502 break;
2503
2507 break;
2508
2512 break;
2513
2517 default:
2520 return;
2521 }
2522
2523
2524 }
2525
2527
2529 {
2531 {
2532
2534 {
2536 }
2538 {
2541 {
2543 }
2544 else
2545 {
2547 {
2549 }
2550 else
2551 {
2553 }
2554 }
2555 }
2556 }
2557 }
2558
2559 }
2561 {
2562
2564 {
2566 {
2570 break;
2571
2575 break;
2576
2580 break;
2581
2585 break;
2586
2589 default:
2592 return;
2593 }
2594 }
2595
2597
2599 {
2601 {
2602
2604 {
2606 }
2607 }
2608 }
2609 }
2611 {
2612
2614 {
2616 {
2620 break;
2621
2624 default:
2627 return;
2628 }
2629 }
2630
2632
2634 {
2636 {
2637
2639 {
2641 }
2642 }
2643 }
2644 }
2645 else
2646 {
2647
2649
2651 {
2654
2655 }
2656 else
2657 {
2659 {
2662 }
2663 }
2664 }
2665 }
2666
2668 {
2669 if (
GetGame().IsDedicatedServer())
2670 return;
2671
2673 {
2675 GetInventory().GetCurrentInventoryLocation(invLoc);
2677 {
2679 if (ptcMgr)
2680 {
2685 }
2686 }
2687 }
2689 {
2691 {
2694 return;
2695 }
2696
2698 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2700 {
2703 }
2704 }
2705 }
2706
2707 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2708 {
2710 {
2715 }
2716
2717 super.GetDebugActions(outputList);
2718 }
2719
2721 {
2722 super.OnAction(action_id, player, ctx);
2723
2725 {
2726 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2727 {
2729 if (food_stage_prev <= 0)
2730 {
2732 }
2734 return true;
2735 }
2736 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2737 {
2740 {
2742 }
2744 return true;
2745 }
2746
2747 }
2748
2749 #ifdef DIAG_DEVELOPER
2750 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2751 {
2752 PrintNutritionsData();
2753 return true;
2754 }
2755 #endif
2756
2757 return false;
2758 }
2759
2761 {
2762 string debug_output;
2763
2764 debug_output = super.GetDebugText();
2765
2768
2769 return debug_output;
2770 }
2771
2772
2773
2774
2775
2777 {
2778 float ret = super.GetBaitEffectivity();
2779
2781 {
2782 ret *= 0.5;
2783 }
2784
2785 return ret;
2786 }
2787
2789 {
2791 }
2792
2794 {
2796 }
2797
2799 {
2801 }
2802
2803 #ifdef DIAG_DEVELOPER
2804 private void PrintNutritionsData()
2805 {
2806 string nutritionsData = "";
2807
2810
2812 if (profile)
2813 {
2814 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2816 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2820 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2822
2825
2826 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2828 }
2829
2830 nutritionsData += "-----\n";
2831
2833 }
2834 #endif
2835
2837
2840 {
2842 }
2843}
2844
2846{
2848};
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.