1771{
1773
1781
1791
1793
1795 {
1797 {
1799
1801 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1802
1806 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1807 }
1808 }
1809
1811 {
1813
1815 }
1816
1818 {
1819 super.EEDelete(parent);
1820
1822
1825 }
1826
1828 {
1829 super.EEItemLocationChanged(oldLoc, newLoc);
1830
1833 {
1834 switch (oldLoc.GetParent().GetType())
1835 {
1836 case "FryingPan":
1837 case "Pot":
1838 case "Cauldron":
1839 case "SharpWoodenStick":
1841 break;
1842 }
1843
1846 {
1848 }
1849 }
1850
1851 if (oldLoc.IsValid())
1853
1856 }
1857
1859 {
1862 }
1863
1865 {
1868
1869 return true;
1870 }
1871
1873 {
1875 {
1877 }
1878 }
1879
1882 {
1883 int foodStageType;
1884
1886 if (foodStage)
1887 foodStageType = foodStage.GetFoodStageType();
1888
1893
1894 return agentsIn;
1895 }
1896
1897
1899 {
1900 return false;
1901 }
1902
1904 {
1905 return false;
1906 }
1907
1909 {
1911 {
1913 {
1916
1919
1920 default:
1921 return super.GetTemperatureFreezeTime();
1922 }
1923 }
1924
1925 return super.GetTemperatureFreezeTime();
1926 }
1927
1929 {
1931 {
1933 {
1936
1939
1940 default:
1941 return super.GetTemperatureThawTime();
1942 }
1943 }
1944
1945 return super.GetTemperatureThawTime();
1946 }
1947
1949 {
1951 }
1952
1953
1954
1955
1957 {
1958 SetSynchDirty();
1959 }
1960
1962 {
1963 super.OnVariablesSynchronized();
1964
1965
1966
1967
1969 {
1971 }
1972 else
1973 {
1975 }
1976
1979 }
1980
1981
1982
1983
1985 {
1988
1990 }
1991
1993 {
1994 string soundName = "";
1995
1998
2000 {
2002 }
2003 else
2004 {
2006 {
2008 {
2013 else
2014 soundName = "";
2015 break;
2016 }
2017
2019 {
2024 else
2025 soundName = "";
2026 break;
2027 }
2028
2030 {
2035 else
2036 soundName = "";
2037 break;
2038 }
2039
2040 default:
2041 soundName = "";
2042 break;
2043 }
2044
2046 {
2047 if (soundName == "")
2048 {
2050 }
2051 else
2052 {
2054 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2055 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2057 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2058 {
2060 }
2061 }
2062 }
2063 }
2064
2066 }
2067
2069 {
2072 }
2073
2074
2075
2076
2078 {
2079 super.OnStoreSave(ctx);
2080
2082 {
2084 }
2085
2086
2089 }
2090
2092 {
2093 if (!super.OnStoreLoad(ctx, version))
2094 return false;
2095
2097 {
2099 return false;
2100 }
2101
2102 if (version >= 115)
2103 {
2105 {
2107 return false;
2108 }
2110 {
2112 return false;
2113 }
2114 }
2115
2118
2119 return true;
2120 }
2121
2123 {
2124 super.AfterStoreLoad();
2125
2127 }
2128
2129
2131 {
2133 }
2134
2135
2137 {
2138 return false;
2139 }
2140
2142 {
2143 return false;
2144 }
2145
2147 {
2148 return false;
2149 }
2150
2152 {
2153 return false;
2154 }
2155
2156
2157
2158
2159
2161 {
2164 {
2165 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2166 }
2167 else if (classname != "" && food_stage)
2168 {
2169 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2170 }
2171 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2173
2174 }
2175
2177 {
2180 {
2182 }
2183 else if (classname != "" && food_stage)
2184 {
2185 return FoodStage.GetEnergy(null, food_stage, classname);
2186 }
2187 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2189 }
2190
2192 {
2195 {
2197 }
2198 else if (classname != "" && food_stage)
2199 {
2200 return FoodStage.GetWater(null, food_stage, classname);
2201 }
2202 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2204 }
2205
2207 {
2210 {
2211 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2212 }
2213 else if (classname != "" && food_stage)
2214 {
2215 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2216 }
2217 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2219
2220 }
2221
2223 {
2226 {
2227 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2228 }
2229 else if (classname != "" && food_stage)
2230 {
2231 return FoodStage.GetToxicity(null, food_stage, classname);
2232 }
2233 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2235 }
2236
2238 {
2241 {
2243 }
2244 else if (classname != "" && food_stage)
2245 {
2246 return FoodStage.GetAgents(null, food_stage, classname);
2247 }
2248 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2250 }
2251
2253 {
2256 {
2257 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2258 }
2259 else if (classname != "" && food_stage)
2260 {
2261 return FoodStage.GetDigestibility(null, food_stage, classname);
2262 }
2263 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2265 }
2266
2268 {
2271 {
2272 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2273 }
2274 else if (className != "" && foodStage)
2275 {
2276 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2277 }
2278 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2280 }
2281
2283 {
2293
2294 return profile;
2295 }
2296
2297
2298
2299
2301 {
2303 }
2304
2305
2307 {
2309 {
2311 }
2312
2313 return false;
2314 }
2315
2317 {
2319 {
2321 }
2322
2323 return false;
2324 }
2325
2327 {
2329 {
2331 }
2332
2333 return false;
2334 }
2335
2337 {
2339 {
2341 }
2342
2343 return false;
2344 }
2345
2347 {
2349 {
2351 }
2352
2353 return false;
2354 }
2355
2357 {
2359 {
2361 }
2362
2363 return false;
2364 }
2365
2366
2368 {
2370 }
2371
2373 {
2374 return GetFoodStage().GetNextFoodStageType( cooking_method );
2375 }
2376
2378 {
2379 return GetFoodStage().GetFoodStageName( food_stage_type );
2380 }
2381
2383 {
2384 return GetFoodStage().CanChangeToNewStage( cooking_method );
2385 }
2386
2387
2389 {
2390 if ( !source.GetFoodStage())
2391 return;
2396 }
2397
2400 {
2403 }
2404
2407 {
2408 switch (stageNew)
2409 {
2414 break;
2415
2418 break;
2419 }
2420 }
2421
2422
2423
2424
2425
2427 {
2429 }
2430
2432 {
2434
2435
2437 }
2438
2440 {
2442 {
2445 }
2446 }
2447
2448
2450 {
2452 if (player)
2453 {
2455 player.ServerReplaceItemInHandsWithNew(lambda);
2456 }
2457 else
2458 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2459 }
2460
2462 {
2464 }
2465
2467 {
2468 super.SetActions();
2469
2472 }
2473
2475 {
2476 #ifndef SERVER
2478 {
2480
2483 }
2484 #endif
2485 }
2486
2488 {
2489 #ifndef SERVER
2491 {
2495 }
2496 #endif
2497 }
2498
2500 {
2501 return false;
2502 }
2503
2505 {
2507 }
2508
2509 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2510 {
2512
2513 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2515 if ( hasRootAsPlayer )
2517
2518
2519
2520
2521
2522
2523
2525 {
2526
2528 {
2530 {
2534 break;
2535
2539 break;
2540
2544 break;
2545
2549 default:
2552 return;
2553 }
2554
2555
2556 }
2557
2559
2561 {
2563 {
2564
2566 {
2568 }
2570 {
2573 {
2575 }
2576 else
2577 {
2579 {
2581 }
2582 else
2583 {
2585 }
2586 }
2587 }
2588 }
2589 }
2590
2591 }
2593 {
2594
2596 {
2598 {
2602 break;
2603
2607 break;
2608
2612 break;
2613
2617 break;
2618
2621 default:
2624 return;
2625 }
2626 }
2627
2629
2631 {
2633 {
2634
2636 {
2638 }
2639 }
2640 }
2641 }
2643 {
2644
2646 {
2648 {
2652 break;
2653
2656 default:
2659 return;
2660 }
2661 }
2662
2664
2666 {
2668 {
2669
2671 {
2673 }
2674 }
2675 }
2676 }
2677 else
2678 {
2679
2681
2683 {
2686
2687 }
2688 else
2689 {
2691 {
2694 }
2695 }
2696 }
2697 }
2698
2700 {
2701 if (
GetGame().IsDedicatedServer())
2702 return;
2703
2705 {
2707 GetInventory().GetCurrentInventoryLocation(invLoc);
2709 {
2711 if (ptcMgr)
2712 {
2717 }
2718 }
2719 }
2721 {
2723 {
2726 return;
2727 }
2728
2730 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2732 {
2735 }
2736 }
2737 }
2738
2739 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2740 {
2742 {
2747 }
2748
2749 super.GetDebugActions(outputList);
2750 }
2751
2753 {
2754 super.OnAction(action_id, player, ctx);
2755
2757 {
2758 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2759 {
2761 if (food_stage_prev <= 0)
2762 {
2764 }
2766 return true;
2767 }
2768 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2769 {
2772 {
2774 }
2776 return true;
2777 }
2778
2779 }
2780
2781 #ifdef DIAG_DEVELOPER
2782 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2783 {
2784 PrintNutritionsData();
2785 return true;
2786 }
2787 #endif
2788
2789 return false;
2790 }
2791
2793 {
2794 string debug_output;
2795
2796 debug_output = super.GetDebugText();
2797
2800
2801 return debug_output;
2802 }
2803
2804
2805
2806
2807
2809 {
2810 float ret = super.GetBaitEffectivity();
2811
2813 {
2814 ret *= 0.5;
2815 }
2816
2817 return ret;
2818 }
2819
2821 {
2823 }
2824
2826 {
2828 }
2829
2831 {
2833 }
2834
2835 #ifdef DIAG_DEVELOPER
2836 private void PrintNutritionsData()
2837 {
2838 string nutritionsData = "";
2839
2842
2844 if (profile)
2845 {
2846 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2848 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2852 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2854
2857
2858 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2860 }
2861
2862 nutritionsData += "-----\n";
2863
2865 }
2866 #endif
2867
2869
2872 {
2874 }
2875}
2876
2878{
2880};
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.