1646{
1648
1656
1666
1668
1670 {
1672 {
1674
1676 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1677
1681 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1682 }
1683 }
1684
1686 {
1688
1690 }
1691
1693 {
1694 super.EEDelete(parent);
1695
1697
1700 }
1701
1703 {
1704 super.EEItemLocationChanged(oldLoc, newLoc);
1705
1708 {
1709 switch (oldLoc.GetParent().GetType())
1710 {
1711 case "FryingPan":
1712 case "Pot":
1713 case "Cauldron":
1714 case "SharpWoodenStick":
1716 break;
1717 }
1718
1721 {
1723 }
1724 }
1725
1726 if (oldLoc.IsValid())
1728
1731 }
1732
1734 {
1737 }
1738
1740 {
1743
1744 return true;
1745 }
1746
1748 {
1750 {
1752 }
1753 }
1754
1757 {
1758 int foodStageType;
1759
1761 if (foodStage)
1762 foodStageType = foodStage.GetFoodStageType();
1763
1768
1769 return agentsIn;
1770 }
1771
1772
1774 {
1775 return false;
1776 }
1777
1779 {
1780 return false;
1781 }
1782
1784 {
1786 {
1788 {
1791
1794
1795 default:
1796 return super.GetTemperatureFreezeTime();
1797 }
1798 }
1799
1800 return super.GetTemperatureFreezeTime();
1801 }
1802
1804 {
1806 {
1808 {
1811
1814
1815 default:
1816 return super.GetTemperatureThawTime();
1817 }
1818 }
1819
1820 return super.GetTemperatureThawTime();
1821 }
1822
1824 {
1826 }
1827
1828
1829
1830
1832 {
1833 SetSynchDirty();
1834 }
1835
1837 {
1838 super.OnVariablesSynchronized();
1839
1840
1841
1842
1844 {
1846 }
1847 else
1848 {
1850 }
1851
1854 }
1855
1856
1857
1858
1860 {
1863
1865 }
1866
1868 {
1869 string soundName = "";
1870
1873
1875 {
1877 }
1878 else
1879 {
1881 {
1883 {
1888 else
1889 soundName = "";
1890 break;
1891 }
1892
1894 {
1899 else
1900 soundName = "";
1901 break;
1902 }
1903
1905 {
1910 else
1911 soundName = "";
1912 break;
1913 }
1914
1915 default:
1916 soundName = "";
1917 break;
1918 }
1919
1921 {
1922 if (soundName == "")
1923 {
1925 }
1926 else
1927 {
1929 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1930 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1932 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1933 {
1935 }
1936 }
1937 }
1938 }
1939
1941 }
1942
1944 {
1947 }
1948
1949
1950
1951
1953 {
1954 super.OnStoreSave(ctx);
1955
1957 {
1959 }
1960
1961
1964 }
1965
1967 {
1968 if (!super.OnStoreLoad(ctx, version))
1969 return false;
1970
1972 {
1974 return false;
1975 }
1976
1977 if (version >= 115)
1978 {
1980 {
1982 return false;
1983 }
1985 {
1987 return false;
1988 }
1989 }
1990
1993
1994 return true;
1995 }
1996
1998 {
1999 super.AfterStoreLoad();
2000
2002 }
2003
2004
2006 {
2008 }
2009
2010
2012 {
2013 return false;
2014 }
2015
2017 {
2018 return false;
2019 }
2020
2022 {
2023 return false;
2024 }
2025
2027 {
2028 return false;
2029 }
2030
2031
2032
2033
2034
2036 {
2039 {
2040 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2041 }
2042 else if (classname != "" && food_stage)
2043 {
2044 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2045 }
2046 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2048
2049 }
2050
2052 {
2055 {
2057 }
2058 else if (classname != "" && food_stage)
2059 {
2060 return FoodStage.GetEnergy(null, food_stage, classname);
2061 }
2062 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2064 }
2065
2067 {
2070 {
2072 }
2073 else if (classname != "" && food_stage)
2074 {
2075 return FoodStage.GetWater(null, food_stage, classname);
2076 }
2077 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2079 }
2080
2082 {
2085 {
2086 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2087 }
2088 else if (classname != "" && food_stage)
2089 {
2090 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2091 }
2092 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2094
2095 }
2096
2098 {
2101 {
2102 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2103 }
2104 else if (classname != "" && food_stage)
2105 {
2106 return FoodStage.GetToxicity(null, food_stage, classname);
2107 }
2108 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2110 }
2111
2113 {
2116 {
2118 }
2119 else if (classname != "" && food_stage)
2120 {
2121 return FoodStage.GetAgents(null, food_stage, classname);
2122 }
2123 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2125 }
2126
2128 {
2131 {
2132 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2133 }
2134 else if (classname != "" && food_stage)
2135 {
2136 return FoodStage.GetDigestibility(null, food_stage, classname);
2137 }
2138 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2140 }
2141
2143 {
2146 {
2147 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2148 }
2149 else if (className != "" && foodStage)
2150 {
2151 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2152 }
2153 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2155 }
2156
2158 {
2168
2169 return profile;
2170 }
2171
2172
2173
2174
2176 {
2178 }
2179
2180
2182 {
2184 {
2186 }
2187
2188 return false;
2189 }
2190
2192 {
2194 {
2196 }
2197
2198 return false;
2199 }
2200
2202 {
2204 {
2206 }
2207
2208 return false;
2209 }
2210
2212 {
2214 {
2216 }
2217
2218 return false;
2219 }
2220
2222 {
2224 {
2226 }
2227
2228 return false;
2229 }
2230
2232 {
2234 {
2236 }
2237
2238 return false;
2239 }
2240
2241
2243 {
2245 }
2246
2248 {
2249 return GetFoodStage().GetNextFoodStageType( cooking_method );
2250 }
2251
2253 {
2254 return GetFoodStage().GetFoodStageName( food_stage_type );
2255 }
2256
2258 {
2259 return GetFoodStage().CanChangeToNewStage( cooking_method );
2260 }
2261
2262
2264 {
2265 if ( !source.GetFoodStage())
2266 return;
2271 }
2272
2275 {
2278 }
2279
2282 {
2283 switch (stageNew)
2284 {
2289 break;
2290
2293 break;
2294 }
2295 }
2296
2297
2298
2299
2300
2302 {
2304 }
2305
2307 {
2309
2310
2312 }
2313
2315 {
2317 {
2320 }
2321 }
2322
2323
2325 {
2327 if (player)
2328 {
2330 player.ServerReplaceItemInHandsWithNew(lambda);
2331 }
2332 else
2333 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2334 }
2335
2337 {
2339 }
2340
2342 {
2343 super.SetActions();
2344
2347 }
2348
2350 {
2351 #ifndef SERVER
2353 {
2355
2358 }
2359 #endif
2360 }
2361
2363 {
2364 #ifndef SERVER
2366 {
2370 }
2371 #endif
2372 }
2373
2375 {
2376 return false;
2377 }
2378
2380 {
2382 }
2383
2384 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2385 {
2387
2388 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2390 if ( hasRootAsPlayer )
2392
2393
2394
2395
2396
2397
2398
2400 {
2401
2403 {
2405 {
2409 break;
2410
2414 break;
2415
2419 break;
2420
2424 default:
2427 return;
2428 }
2429
2430
2431 }
2432
2434
2436 {
2438 {
2439
2441 {
2443 }
2445 {
2448 {
2450 }
2451 else
2452 {
2454 {
2456 }
2457 else
2458 {
2460 }
2461 }
2462 }
2463 }
2464 }
2465
2466 }
2468 {
2469
2471 {
2473 {
2477 break;
2478
2482 break;
2483
2487 break;
2488
2492 break;
2493
2496 default:
2499 return;
2500 }
2501 }
2502
2504
2506 {
2508 {
2509
2511 {
2513 }
2514 }
2515 }
2516 }
2518 {
2519
2521 {
2523 {
2527 break;
2528
2531 default:
2534 return;
2535 }
2536 }
2537
2539
2541 {
2543 {
2544
2546 {
2548 }
2549 }
2550 }
2551 }
2552 else
2553 {
2554
2556
2558 {
2561
2562 }
2563 else
2564 {
2566 {
2569 }
2570 }
2571 }
2572 }
2573
2575 {
2576 if (
GetGame().IsDedicatedServer())
2577 return;
2578
2580 {
2582 GetInventory().GetCurrentInventoryLocation(invLoc);
2584 {
2586 if (ptcMgr)
2587 {
2592 }
2593 }
2594 }
2596 {
2598 {
2601 return;
2602 }
2603
2605 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2607 {
2610 }
2611 }
2612 }
2613
2614 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2615 {
2617 {
2622 }
2623
2624 super.GetDebugActions(outputList);
2625 }
2626
2628 {
2629 super.OnAction(action_id, player, ctx);
2630
2632 {
2633 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2634 {
2636 if (food_stage_prev <= 0)
2637 {
2639 }
2641 return true;
2642 }
2643 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2644 {
2647 {
2649 }
2651 return true;
2652 }
2653
2654 }
2655
2656 #ifdef DIAG_DEVELOPER
2657 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2658 {
2659 PrintNutritionsData();
2660 return true;
2661 }
2662 #endif
2663
2664 return false;
2665 }
2666
2668 {
2669 string debug_output;
2670
2671 debug_output = super.GetDebugText();
2672
2675
2676 return debug_output;
2677 }
2678
2679
2680
2681
2682
2684 {
2685 float ret = super.GetBaitEffectivity();
2686
2688 {
2689 ret *= 0.5;
2690 }
2691
2692 return ret;
2693 }
2694
2696 {
2698 }
2699
2701 {
2703 }
2704
2706 {
2708 }
2709
2710 #ifdef DIAG_DEVELOPER
2711 private void PrintNutritionsData()
2712 {
2713 string nutritionsData = "";
2714
2717
2719 if (profile)
2720 {
2721 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2723 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2727 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2729
2732
2733 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2735 }
2736
2737 nutritionsData += "-----\n";
2738
2740 }
2741 #endif
2742
2744
2747 {
2749 }
2750}
2751
2753{
2755};
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.