1591{
1593
1601
1611
1613
1615 {
1617 {
1619
1621 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1622
1626 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1627 }
1628 }
1629
1631 {
1633
1635 }
1636
1638 {
1639 super.EEDelete(parent);
1640
1642
1645 }
1646
1648 {
1649 super.EEItemLocationChanged(oldLoc, newLoc);
1650
1653 {
1654 switch (oldLoc.GetParent().GetType())
1655 {
1656 case "FryingPan":
1657 case "Pot":
1658 case "Cauldron":
1659 case "SharpWoodenStick":
1661 break;
1662 }
1663
1666 {
1668 }
1669 }
1670
1671 if (oldLoc.IsValid())
1673
1676 }
1677
1679 {
1682 }
1683
1685 {
1688
1689 return true;
1690 }
1691
1693 {
1695 {
1697 }
1698 }
1699
1702 {
1703 int foodStageType;
1704
1706 if (foodStage)
1707 foodStageType = foodStage.GetFoodStageType();
1708
1713
1714 return agentsIn;
1715 }
1716
1717
1719 {
1720 return false;
1721 }
1722
1724 {
1725 return false;
1726 }
1727
1729 {
1731 {
1733 {
1736
1739
1740 default:
1741 return super.GetTemperatureFreezeTime();
1742 }
1743 }
1744
1745 return super.GetTemperatureFreezeTime();
1746 }
1747
1749 {
1751 {
1753 {
1756
1759
1760 default:
1761 return super.GetTemperatureThawTime();
1762 }
1763 }
1764
1765 return super.GetTemperatureThawTime();
1766 }
1767
1769 {
1771 }
1772
1773
1774
1775
1777 {
1778 SetSynchDirty();
1779 }
1780
1782 {
1783 super.OnVariablesSynchronized();
1784
1785
1786
1787
1789 {
1791 }
1792 else
1793 {
1795 }
1796
1799 }
1800
1801
1802
1803
1805 {
1808
1810 }
1811
1813 {
1814 string soundName = "";
1815
1818
1820 {
1822 }
1823 else
1824 {
1826 {
1828 {
1833 else
1834 soundName = "";
1835 break;
1836 }
1837
1839 {
1844 else
1845 soundName = "";
1846 break;
1847 }
1848
1850 {
1855 else
1856 soundName = "";
1857 break;
1858 }
1859
1860 default:
1861 soundName = "";
1862 break;
1863 }
1864
1866 {
1867 if (soundName == "")
1868 {
1870 }
1871 else
1872 {
1874 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1875 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1877 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1878 {
1880 }
1881 }
1882 }
1883 }
1884
1886 }
1887
1889 {
1892 }
1893
1894
1895
1896
1898 {
1899 super.OnStoreSave(ctx);
1900
1902 {
1904 }
1905
1906
1909 }
1910
1912 {
1913 if (!super.OnStoreLoad(ctx, version))
1914 return false;
1915
1917 {
1919 return false;
1920 }
1921
1922 if (version >= 115)
1923 {
1925 {
1927 return false;
1928 }
1930 {
1932 return false;
1933 }
1934 }
1935
1938
1939 return true;
1940 }
1941
1943 {
1944 super.AfterStoreLoad();
1945
1947 }
1948
1949
1951 {
1953 }
1954
1955
1957 {
1958 return false;
1959 }
1960
1962 {
1963 return false;
1964 }
1965
1967 {
1968 return false;
1969 }
1970
1972 {
1973 return false;
1974 }
1975
1976
1977
1978
1979
1981 {
1984 {
1985 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1986 }
1987 else if (classname != "" && food_stage)
1988 {
1989 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1990 }
1991 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1993
1994 }
1995
1997 {
2000 {
2002 }
2003 else if (classname != "" && food_stage)
2004 {
2005 return FoodStage.GetEnergy(null, food_stage, classname);
2006 }
2007 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2009 }
2010
2012 {
2015 {
2017 }
2018 else if (classname != "" && food_stage)
2019 {
2020 return FoodStage.GetWater(null, food_stage, classname);
2021 }
2022 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2024 }
2025
2027 {
2030 {
2031 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2032 }
2033 else if (classname != "" && food_stage)
2034 {
2035 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2036 }
2037 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2039
2040 }
2041
2043 {
2046 {
2047 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2048 }
2049 else if (classname != "" && food_stage)
2050 {
2051 return FoodStage.GetToxicity(null, food_stage, classname);
2052 }
2053 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2055 }
2056
2058 {
2061 {
2063 }
2064 else if (classname != "" && food_stage)
2065 {
2066 return FoodStage.GetAgents(null, food_stage, classname);
2067 }
2068 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2070 }
2071
2073 {
2076 {
2077 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2078 }
2079 else if (classname != "" && food_stage)
2080 {
2081 return FoodStage.GetDigestibility(null, food_stage, classname);
2082 }
2083 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2085 }
2086
2088 {
2091 {
2092 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2093 }
2094 else if (className != "" && foodStage)
2095 {
2096 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2097 }
2098 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2100 }
2101
2103 {
2113
2114 return profile;
2115 }
2116
2117
2118
2119
2121 {
2123 }
2124
2125
2127 {
2129 {
2131 }
2132
2133 return false;
2134 }
2135
2137 {
2139 {
2141 }
2142
2143 return false;
2144 }
2145
2147 {
2149 {
2151 }
2152
2153 return false;
2154 }
2155
2157 {
2159 {
2161 }
2162
2163 return false;
2164 }
2165
2167 {
2169 {
2171 }
2172
2173 return false;
2174 }
2175
2177 {
2179 {
2181 }
2182
2183 return false;
2184 }
2185
2186
2188 {
2190 }
2191
2193 {
2194 return GetFoodStage().GetNextFoodStageType( cooking_method );
2195 }
2196
2198 {
2199 return GetFoodStage().GetFoodStageName( food_stage_type );
2200 }
2201
2203 {
2204 return GetFoodStage().CanChangeToNewStage( cooking_method );
2205 }
2206
2207
2209 {
2210 if ( !source.GetFoodStage())
2211 return;
2216 }
2217
2220 {
2223 }
2224
2227 {
2228 switch (stageNew)
2229 {
2234 break;
2235
2238 break;
2239 }
2240 }
2241
2242
2243
2244
2245
2247 {
2249 }
2250
2252 {
2254
2255
2257 }
2258
2260 {
2262 {
2265 }
2266 }
2267
2268
2270 {
2272 if (player)
2273 {
2275 player.ServerReplaceItemInHandsWithNew(lambda);
2276 }
2277 else
2278 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2279 }
2280
2282 {
2284 }
2285
2287 {
2288 super.SetActions();
2289
2292 }
2293
2295 {
2296 #ifndef SERVER
2298 {
2300
2303 }
2304 #endif
2305 }
2306
2308 {
2309 #ifndef SERVER
2311 {
2315 }
2316 #endif
2317 }
2318
2320 {
2321 return false;
2322 }
2323
2325 {
2327 }
2328
2329 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2330 {
2332
2333 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2335 if ( hasRootAsPlayer )
2337
2338
2339
2340
2341
2342
2343
2345 {
2346
2348 {
2350 {
2354 break;
2355
2359 break;
2360
2364 break;
2365
2369 default:
2372 return;
2373 }
2374
2375
2376 }
2377
2379
2381 {
2383 {
2384
2386 {
2388 }
2390 {
2393 {
2395 }
2396 else
2397 {
2399 {
2401 }
2402 else
2403 {
2405 }
2406 }
2407 }
2408 }
2409 }
2410
2411 }
2413 {
2414
2416 {
2418 {
2422 break;
2423
2427 break;
2428
2432 break;
2433
2437 break;
2438
2441 default:
2444 return;
2445 }
2446 }
2447
2449
2451 {
2453 {
2454
2456 {
2458 }
2459 }
2460 }
2461 }
2463 {
2464
2466 {
2468 {
2472 break;
2473
2476 default:
2479 return;
2480 }
2481 }
2482
2484
2486 {
2488 {
2489
2491 {
2493 }
2494 }
2495 }
2496 }
2497 else
2498 {
2499
2501
2503 {
2506
2507 }
2508 else
2509 {
2511 {
2514 }
2515 }
2516 }
2517 }
2518
2520 {
2521 if (
GetGame().IsDedicatedServer())
2522 return;
2523
2525 {
2527 GetInventory().GetCurrentInventoryLocation(invLoc);
2529 {
2531 if (ptcMgr)
2532 {
2537 }
2538 }
2539 }
2541 {
2543 {
2546 return;
2547 }
2548
2550 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2552 {
2555 }
2556 }
2557 }
2558
2559 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2560 {
2561 super.GetDebugActions(outputList);
2562
2564 {
2568 }
2569 }
2570
2572 {
2573 super.OnAction(action_id, player, ctx);
2574
2576 {
2577 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2578 {
2580 if (food_stage_prev <= 0)
2581 {
2583 }
2585 return true;
2586 }
2587 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2588 {
2591 {
2593 }
2595 return true;
2596 }
2597
2598 }
2599
2600 #ifdef DIAG_DEVELOPER
2601 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2602 {
2603 PrintNutritionsData();
2604 return true;
2605 }
2606 #endif
2607
2608 return false;
2609 }
2610
2612 {
2613 string debug_output;
2614
2615 debug_output = super.GetDebugText();
2616
2619
2620 return debug_output;
2621 }
2622
2623
2624
2625
2626
2628 {
2629 float ret = super.GetBaitEffectivity();
2630
2632 {
2633 ret *= 0.5;
2634 }
2635
2636 return ret;
2637 }
2638
2640 {
2642 }
2643
2645 {
2647 }
2648
2650 {
2652 }
2653
2654 #ifdef DIAG_DEVELOPER
2655 private void PrintNutritionsData()
2656 {
2657 string nutritionsData = "";
2658
2661
2663 if (profile)
2664 {
2665 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2667 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2671 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2673
2676
2677 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2679 }
2680
2681 nutritionsData += "-----\n";
2682
2684 }
2685 #endif
2686
2688
2691 {
2693 }
2694}
2695
2697{
2699};
Param4< int, int, string, int > TSelectableActionInfoWithColor
eBleedingSourceType GetType()
AttachActionData ActionData ActionAttach()
void AddAction(typename actionName)
DamageType
exposed from C++ (do not change)
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.