1746{
1748
1756
1766
1768
1770 {
1772 {
1774
1776 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1777
1781 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1782 }
1783 }
1784
1786 {
1788
1790 }
1791
1793 {
1794 super.EEDelete(parent);
1795
1797
1800 }
1801
1803 {
1804 super.EEItemLocationChanged(oldLoc, newLoc);
1805
1808 {
1809 switch (oldLoc.GetParent().GetType())
1810 {
1811 case "FryingPan":
1812 case "Pot":
1813 case "Cauldron":
1814 case "SharpWoodenStick":
1816 break;
1817 }
1818
1821 {
1823 }
1824 }
1825
1826 if (oldLoc.IsValid())
1828
1831 }
1832
1834 {
1837 }
1838
1840 {
1843
1844 return true;
1845 }
1846
1848 {
1850 {
1852 }
1853 }
1854
1857 {
1858 int foodStageType;
1859
1861 if (foodStage)
1862 foodStageType = foodStage.GetFoodStageType();
1863
1868
1869 return agentsIn;
1870 }
1871
1872
1874 {
1875 return false;
1876 }
1877
1879 {
1880 return false;
1881 }
1882
1884 {
1886 {
1888 {
1891
1894
1895 default:
1896 return super.GetTemperatureFreezeTime();
1897 }
1898 }
1899
1900 return super.GetTemperatureFreezeTime();
1901 }
1902
1904 {
1906 {
1908 {
1911
1914
1915 default:
1916 return super.GetTemperatureThawTime();
1917 }
1918 }
1919
1920 return super.GetTemperatureThawTime();
1921 }
1922
1924 {
1926 }
1927
1928
1929
1930
1932 {
1933 SetSynchDirty();
1934 }
1935
1937 {
1938 super.OnVariablesSynchronized();
1939
1940
1941
1942
1944 {
1946 }
1947 else
1948 {
1950 }
1951
1954 }
1955
1956
1957
1958
1960 {
1963
1965 }
1966
1968 {
1969 string soundName = "";
1970
1973
1975 {
1977 }
1978 else
1979 {
1981 {
1983 {
1988 else
1989 soundName = "";
1990 break;
1991 }
1992
1994 {
1999 else
2000 soundName = "";
2001 break;
2002 }
2003
2005 {
2010 else
2011 soundName = "";
2012 break;
2013 }
2014
2015 default:
2016 soundName = "";
2017 break;
2018 }
2019
2021 {
2022 if (soundName == "")
2023 {
2025 }
2026 else
2027 {
2029 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2030 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2032 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2033 {
2035 }
2036 }
2037 }
2038 }
2039
2041 }
2042
2044 {
2047 }
2048
2049
2050
2051
2053 {
2054 super.OnStoreSave(ctx);
2055
2057 {
2059 }
2060
2061
2064 }
2065
2067 {
2068 if (!super.OnStoreLoad(ctx, version))
2069 return false;
2070
2072 {
2074 return false;
2075 }
2076
2077 if (version >= 115)
2078 {
2080 {
2082 return false;
2083 }
2085 {
2087 return false;
2088 }
2089 }
2090
2093
2094 return true;
2095 }
2096
2098 {
2099 super.AfterStoreLoad();
2100
2102 }
2103
2104
2106 {
2108 }
2109
2110
2112 {
2113 return false;
2114 }
2115
2117 {
2118 return false;
2119 }
2120
2122 {
2123 return false;
2124 }
2125
2127 {
2128 return false;
2129 }
2130
2131
2132
2133
2134
2136 {
2139 {
2140 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2141 }
2142 else if (classname != "" && food_stage)
2143 {
2144 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2145 }
2146 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2148
2149 }
2150
2152 {
2155 {
2157 }
2158 else if (classname != "" && food_stage)
2159 {
2160 return FoodStage.GetEnergy(null, food_stage, classname);
2161 }
2162 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2164 }
2165
2167 {
2170 {
2172 }
2173 else if (classname != "" && food_stage)
2174 {
2175 return FoodStage.GetWater(null, food_stage, classname);
2176 }
2177 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2179 }
2180
2182 {
2185 {
2186 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2187 }
2188 else if (classname != "" && food_stage)
2189 {
2190 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2191 }
2192 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2194
2195 }
2196
2198 {
2201 {
2202 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2203 }
2204 else if (classname != "" && food_stage)
2205 {
2206 return FoodStage.GetToxicity(null, food_stage, classname);
2207 }
2208 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2210 }
2211
2213 {
2216 {
2218 }
2219 else if (classname != "" && food_stage)
2220 {
2221 return FoodStage.GetAgents(null, food_stage, classname);
2222 }
2223 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2225 }
2226
2228 {
2231 {
2232 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2233 }
2234 else if (classname != "" && food_stage)
2235 {
2236 return FoodStage.GetDigestibility(null, food_stage, classname);
2237 }
2238 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2240 }
2241
2243 {
2246 {
2247 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2248 }
2249 else if (className != "" && foodStage)
2250 {
2251 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2252 }
2253 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2255 }
2256
2258 {
2268
2269 return profile;
2270 }
2271
2272
2273
2274
2276 {
2278 }
2279
2280
2282 {
2284 {
2286 }
2287
2288 return false;
2289 }
2290
2292 {
2294 {
2296 }
2297
2298 return false;
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
2341
2343 {
2345 }
2346
2348 {
2349 return GetFoodStage().GetNextFoodStageType( cooking_method );
2350 }
2351
2353 {
2354 return GetFoodStage().GetFoodStageName( food_stage_type );
2355 }
2356
2358 {
2359 return GetFoodStage().CanChangeToNewStage( cooking_method );
2360 }
2361
2362
2364 {
2365 if ( !source.GetFoodStage())
2366 return;
2371 }
2372
2375 {
2378 }
2379
2382 {
2383 switch (stageNew)
2384 {
2389 break;
2390
2393 break;
2394 }
2395 }
2396
2397
2398
2399
2400
2402 {
2404 }
2405
2407 {
2409
2410
2412 }
2413
2415 {
2417 {
2420 }
2421 }
2422
2423
2425 {
2427 if (player)
2428 {
2430 player.ServerReplaceItemInHandsWithNew(lambda);
2431 }
2432 else
2433 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2434 }
2435
2437 {
2439 }
2440
2442 {
2443 super.SetActions();
2444
2447 }
2448
2450 {
2451 #ifndef SERVER
2453 {
2455
2458 }
2459 #endif
2460 }
2461
2463 {
2464 #ifndef SERVER
2466 {
2470 }
2471 #endif
2472 }
2473
2475 {
2476 return false;
2477 }
2478
2480 {
2482 }
2483
2484 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2485 {
2487
2488 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2490 if ( hasRootAsPlayer )
2492
2493
2494
2495
2496
2497
2498
2500 {
2501
2503 {
2505 {
2509 break;
2510
2514 break;
2515
2519 break;
2520
2524 default:
2527 return;
2528 }
2529
2530
2531 }
2532
2534
2536 {
2538 {
2539
2541 {
2543 }
2545 {
2548 {
2550 }
2551 else
2552 {
2554 {
2556 }
2557 else
2558 {
2560 }
2561 }
2562 }
2563 }
2564 }
2565
2566 }
2568 {
2569
2571 {
2573 {
2577 break;
2578
2582 break;
2583
2587 break;
2588
2592 break;
2593
2596 default:
2599 return;
2600 }
2601 }
2602
2604
2606 {
2608 {
2609
2611 {
2613 }
2614 }
2615 }
2616 }
2618 {
2619
2621 {
2623 {
2627 break;
2628
2631 default:
2634 return;
2635 }
2636 }
2637
2639
2641 {
2643 {
2644
2646 {
2648 }
2649 }
2650 }
2651 }
2652 else
2653 {
2654
2656
2658 {
2661
2662 }
2663 else
2664 {
2666 {
2669 }
2670 }
2671 }
2672 }
2673
2675 {
2676 if (
GetGame().IsDedicatedServer())
2677 return;
2678
2680 {
2682 GetInventory().GetCurrentInventoryLocation(invLoc);
2684 {
2686 if (ptcMgr)
2687 {
2692 }
2693 }
2694 }
2696 {
2698 {
2701 return;
2702 }
2703
2705 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2707 {
2710 }
2711 }
2712 }
2713
2714 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2715 {
2717 {
2722 }
2723
2724 super.GetDebugActions(outputList);
2725 }
2726
2728 {
2729 super.OnAction(action_id, player, ctx);
2730
2732 {
2733 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2734 {
2736 if (food_stage_prev <= 0)
2737 {
2739 }
2741 return true;
2742 }
2743 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2744 {
2747 {
2749 }
2751 return true;
2752 }
2753
2754 }
2755
2756 #ifdef DIAG_DEVELOPER
2757 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2758 {
2759 PrintNutritionsData();
2760 return true;
2761 }
2762 #endif
2763
2764 return false;
2765 }
2766
2768 {
2769 string debug_output;
2770
2771 debug_output = super.GetDebugText();
2772
2775
2776 return debug_output;
2777 }
2778
2779
2780
2781
2782
2784 {
2785 float ret = super.GetBaitEffectivity();
2786
2788 {
2789 ret *= 0.5;
2790 }
2791
2792 return ret;
2793 }
2794
2796 {
2798 }
2799
2801 {
2803 }
2804
2806 {
2808 }
2809
2810 #ifdef DIAG_DEVELOPER
2811 private void PrintNutritionsData()
2812 {
2813 string nutritionsData = "";
2814
2817
2819 if (profile)
2820 {
2821 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2823 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2827 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2829
2832
2833 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2835 }
2836
2837 nutritionsData += "-----\n";
2838
2840 }
2841 #endif
2842
2844
2847 {
2849 }
2850}
2851
2853{
2855};
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.