1707{
1709
1717
1727
1729
1731 {
1733 {
1735
1737 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1738
1742 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1743 }
1744 }
1745
1747 {
1749
1751 }
1752
1754 {
1755 super.EEDelete(parent);
1756
1758
1761 }
1762
1764 {
1765 super.EEItemLocationChanged(oldLoc, newLoc);
1766
1769 {
1770 switch (oldLoc.GetParent().GetType())
1771 {
1772 case "FryingPan":
1773 case "Pot":
1774 case "Cauldron":
1775 case "SharpWoodenStick":
1777 break;
1778 }
1779
1782 {
1784 }
1785 }
1786
1787 if (oldLoc.IsValid())
1789
1792 }
1793
1795 {
1798 }
1799
1801 {
1804
1805 return true;
1806 }
1807
1809 {
1811 {
1813 }
1814 }
1815
1818 {
1819 int foodStageType;
1820
1822 if (foodStage)
1823 foodStageType = foodStage.GetFoodStageType();
1824
1829
1830 return agentsIn;
1831 }
1832
1833
1835 {
1836 return false;
1837 }
1838
1840 {
1841 return false;
1842 }
1843
1845 {
1847 {
1849 {
1852
1855
1856 default:
1857 return super.GetTemperatureFreezeTime();
1858 }
1859 }
1860
1861 return super.GetTemperatureFreezeTime();
1862 }
1863
1865 {
1867 {
1869 {
1872
1875
1876 default:
1877 return super.GetTemperatureThawTime();
1878 }
1879 }
1880
1881 return super.GetTemperatureThawTime();
1882 }
1883
1885 {
1887 }
1888
1889
1890
1891
1893 {
1894 SetSynchDirty();
1895 }
1896
1898 {
1899 super.OnVariablesSynchronized();
1900
1901
1902
1903
1905 {
1907 }
1908 else
1909 {
1911 }
1912
1915 }
1916
1917
1918
1919
1921 {
1924
1926 }
1927
1929 {
1930 string soundName = "";
1931
1934
1936 {
1938 }
1939 else
1940 {
1942 {
1944 {
1949 else
1950 soundName = "";
1951 break;
1952 }
1953
1955 {
1960 else
1961 soundName = "";
1962 break;
1963 }
1964
1966 {
1971 else
1972 soundName = "";
1973 break;
1974 }
1975
1976 default:
1977 soundName = "";
1978 break;
1979 }
1980
1982 {
1983 if (soundName == "")
1984 {
1986 }
1987 else
1988 {
1990 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1991 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1993 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1994 {
1996 }
1997 }
1998 }
1999 }
2000
2002 }
2003
2005 {
2008 }
2009
2010
2011
2012
2014 {
2015 super.OnStoreSave(ctx);
2016
2018 {
2020 }
2021
2022
2025 }
2026
2028 {
2029 if (!super.OnStoreLoad(ctx, version))
2030 return false;
2031
2033 {
2035 return false;
2036 }
2037
2038 if (version >= 115)
2039 {
2041 {
2043 return false;
2044 }
2046 {
2048 return false;
2049 }
2050 }
2051
2054
2055 return true;
2056 }
2057
2059 {
2060 super.AfterStoreLoad();
2061
2063 }
2064
2065
2067 {
2069 }
2070
2071
2073 {
2074 return false;
2075 }
2076
2078 {
2079 return false;
2080 }
2081
2083 {
2084 return false;
2085 }
2086
2088 {
2089 return false;
2090 }
2091
2092
2093
2094
2095
2097 {
2100 {
2101 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2102 }
2103 else if (classname != "" && food_stage)
2104 {
2105 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2106 }
2107 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2109
2110 }
2111
2113 {
2116 {
2118 }
2119 else if (classname != "" && food_stage)
2120 {
2121 return FoodStage.GetEnergy(null, food_stage, classname);
2122 }
2123 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2125 }
2126
2128 {
2131 {
2133 }
2134 else if (classname != "" && food_stage)
2135 {
2136 return FoodStage.GetWater(null, food_stage, classname);
2137 }
2138 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2140 }
2141
2143 {
2146 {
2147 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2148 }
2149 else if (classname != "" && food_stage)
2150 {
2151 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2152 }
2153 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2155
2156 }
2157
2159 {
2162 {
2163 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2164 }
2165 else if (classname != "" && food_stage)
2166 {
2167 return FoodStage.GetToxicity(null, food_stage, classname);
2168 }
2169 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2171 }
2172
2174 {
2177 {
2179 }
2180 else if (classname != "" && food_stage)
2181 {
2182 return FoodStage.GetAgents(null, food_stage, classname);
2183 }
2184 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2186 }
2187
2189 {
2192 {
2193 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2194 }
2195 else if (classname != "" && food_stage)
2196 {
2197 return FoodStage.GetDigestibility(null, food_stage, classname);
2198 }
2199 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2201 }
2202
2204 {
2207 {
2208 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2209 }
2210 else if (className != "" && foodStage)
2211 {
2212 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2213 }
2214 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2216 }
2217
2219 {
2229
2230 return profile;
2231 }
2232
2233
2234
2235
2237 {
2239 }
2240
2241
2243 {
2245 {
2247 }
2248
2249 return false;
2250 }
2251
2253 {
2255 {
2257 }
2258
2259 return false;
2260 }
2261
2263 {
2265 {
2267 }
2268
2269 return false;
2270 }
2271
2273 {
2275 {
2277 }
2278
2279 return false;
2280 }
2281
2283 {
2285 {
2287 }
2288
2289 return false;
2290 }
2291
2293 {
2295 {
2297 }
2298
2299 return false;
2300 }
2301
2302
2304 {
2306 }
2307
2309 {
2310 return GetFoodStage().GetNextFoodStageType( cooking_method );
2311 }
2312
2314 {
2315 return GetFoodStage().GetFoodStageName( food_stage_type );
2316 }
2317
2319 {
2320 return GetFoodStage().CanChangeToNewStage( cooking_method );
2321 }
2322
2323
2325 {
2326 if ( !source.GetFoodStage())
2327 return;
2332 }
2333
2336 {
2339 }
2340
2343 {
2344 switch (stageNew)
2345 {
2350 break;
2351
2354 break;
2355 }
2356 }
2357
2358
2359
2360
2361
2363 {
2365 }
2366
2368 {
2370
2371
2373 }
2374
2376 {
2378 {
2381 }
2382 }
2383
2384
2386 {
2388 if (player)
2389 {
2391 player.ServerReplaceItemInHandsWithNew(lambda);
2392 }
2393 else
2394 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2395 }
2396
2398 {
2400 }
2401
2403 {
2404 super.SetActions();
2405
2408 }
2409
2411 {
2412 #ifndef SERVER
2414 {
2416
2419 }
2420 #endif
2421 }
2422
2424 {
2425 #ifndef SERVER
2427 {
2431 }
2432 #endif
2433 }
2434
2436 {
2437 return false;
2438 }
2439
2441 {
2443 }
2444
2445 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2446 {
2448
2449 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2451 if ( hasRootAsPlayer )
2453
2454
2455
2456
2457
2458
2459
2461 {
2462
2464 {
2466 {
2470 break;
2471
2475 break;
2476
2480 break;
2481
2485 default:
2488 return;
2489 }
2490
2491
2492 }
2493
2495
2497 {
2499 {
2500
2502 {
2504 }
2506 {
2509 {
2511 }
2512 else
2513 {
2515 {
2517 }
2518 else
2519 {
2521 }
2522 }
2523 }
2524 }
2525 }
2526
2527 }
2529 {
2530
2532 {
2534 {
2538 break;
2539
2543 break;
2544
2548 break;
2549
2553 break;
2554
2557 default:
2560 return;
2561 }
2562 }
2563
2565
2567 {
2569 {
2570
2572 {
2574 }
2575 }
2576 }
2577 }
2579 {
2580
2582 {
2584 {
2588 break;
2589
2592 default:
2595 return;
2596 }
2597 }
2598
2600
2602 {
2604 {
2605
2607 {
2609 }
2610 }
2611 }
2612 }
2613 else
2614 {
2615
2617
2619 {
2622
2623 }
2624 else
2625 {
2627 {
2630 }
2631 }
2632 }
2633 }
2634
2636 {
2637 if (
GetGame().IsDedicatedServer())
2638 return;
2639
2641 {
2643 GetInventory().GetCurrentInventoryLocation(invLoc);
2645 {
2647 if (ptcMgr)
2648 {
2653 }
2654 }
2655 }
2657 {
2659 {
2662 return;
2663 }
2664
2666 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2668 {
2671 }
2672 }
2673 }
2674
2675 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2676 {
2678 {
2683 }
2684
2685 super.GetDebugActions(outputList);
2686 }
2687
2689 {
2690 super.OnAction(action_id, player, ctx);
2691
2693 {
2694 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2695 {
2697 if (food_stage_prev <= 0)
2698 {
2700 }
2702 return true;
2703 }
2704 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2705 {
2708 {
2710 }
2712 return true;
2713 }
2714
2715 }
2716
2717 #ifdef DIAG_DEVELOPER
2718 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2719 {
2720 PrintNutritionsData();
2721 return true;
2722 }
2723 #endif
2724
2725 return false;
2726 }
2727
2729 {
2730 string debug_output;
2731
2732 debug_output = super.GetDebugText();
2733
2736
2737 return debug_output;
2738 }
2739
2740
2741
2742
2743
2745 {
2746 float ret = super.GetBaitEffectivity();
2747
2749 {
2750 ret *= 0.5;
2751 }
2752
2753 return ret;
2754 }
2755
2757 {
2759 }
2760
2762 {
2764 }
2765
2767 {
2769 }
2770
2771 #ifdef DIAG_DEVELOPER
2772 private void PrintNutritionsData()
2773 {
2774 string nutritionsData = "";
2775
2778
2780 if (profile)
2781 {
2782 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2784 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2788 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2790
2793
2794 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2796 }
2797
2798 nutritionsData += "-----\n";
2799
2801 }
2802 #endif
2803
2805
2808 {
2810 }
2811}
2812
2814{
2816};
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.