1475{
1477
1485
1495
1497
1499 {
1501 {
1503
1505 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1506
1510 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1511 }
1512 }
1513
1515 {
1517
1519 }
1520
1522 {
1523 super.EEDelete(parent);
1524
1526
1529 }
1530
1532 {
1533 super.EEItemLocationChanged(oldLoc, newLoc);
1534
1537 {
1538 switch (oldLoc.GetParent().GetType())
1539 {
1540 case "FryingPan":
1541 case "Pot":
1542 case "Cauldron":
1543 case "SharpWoodenStick":
1545 break;
1546 }
1547
1550 {
1552 }
1553 }
1554
1555 if (oldLoc.IsValid())
1557
1560 }
1561
1563 {
1566 }
1567
1569 {
1572
1573 return true;
1574 }
1575
1577 {
1579 {
1581 }
1582 }
1583
1586 {
1587 int foodStageType;
1588
1590 if (foodStage)
1591 foodStageType = foodStage.GetFoodStageType();
1592
1597
1598 return agentsIn;
1599 }
1600
1601
1603 {
1604 return false;
1605 }
1606
1608 {
1609 return false;
1610 }
1611
1613 {
1615 {
1617 {
1620
1623
1624 default:
1625 return super.GetTemperatureFreezeTime();
1626 }
1627 }
1628
1629 return super.GetTemperatureFreezeTime();
1630 }
1631
1633 {
1635 {
1637 {
1640
1643
1644 default:
1645 return super.GetTemperatureThawTime();
1646 }
1647 }
1648
1649 return super.GetTemperatureThawTime();
1650 }
1651
1653 {
1655 }
1656
1657
1658
1659
1661 {
1662 SetSynchDirty();
1663 }
1664
1666 {
1667 super.OnVariablesSynchronized();
1668
1669
1670
1671
1673 {
1675 }
1676 else
1677 {
1679 }
1680
1683 }
1684
1685
1686
1687
1689 {
1692
1694 }
1695
1697 {
1698 string soundName = "";
1699
1702
1704 {
1706 }
1707 else
1708 {
1710 {
1712 {
1717 else
1718 soundName = "";
1719 break;
1720 }
1721
1723 {
1728 else
1729 soundName = "";
1730 break;
1731 }
1732
1734 {
1739 else
1740 soundName = "";
1741 break;
1742 }
1743
1744 default:
1745 soundName = "";
1746 break;
1747 }
1748
1750 {
1751 if (soundName == "")
1752 {
1754 }
1755 else
1756 {
1758 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1759 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1761 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1762 {
1764 }
1765 }
1766 }
1767 }
1768
1770 }
1771
1773 {
1776 }
1777
1778
1779
1780
1782 {
1783 super.OnStoreSave(ctx);
1784
1786 {
1788 }
1789
1790
1793 }
1794
1796 {
1797 if (!super.OnStoreLoad(ctx, version))
1798 return false;
1799
1801 {
1803 return false;
1804 }
1805
1806 if (version >= 115)
1807 {
1809 {
1811 return false;
1812 }
1814 {
1816 return false;
1817 }
1818 }
1819
1822
1823 return true;
1824 }
1825
1827 {
1828 super.AfterStoreLoad();
1829
1831 }
1832
1833
1835 {
1837 }
1838
1839
1841 {
1842 return false;
1843 }
1844
1846 {
1847 return false;
1848 }
1849
1851 {
1852 return false;
1853 }
1854
1856 {
1857 return false;
1858 }
1859
1860
1861
1862
1863
1865 {
1868 {
1869 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1870 }
1871 else if (classname != "" && food_stage)
1872 {
1873 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1874 }
1875 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1877
1878 }
1879
1881 {
1884 {
1886 }
1887 else if (classname != "" && food_stage)
1888 {
1889 return FoodStage.GetEnergy(null, food_stage, classname);
1890 }
1891 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1893 }
1894
1896 {
1899 {
1901 }
1902 else if (classname != "" && food_stage)
1903 {
1904 return FoodStage.GetWater(null, food_stage, classname);
1905 }
1906 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1908 }
1909
1911 {
1914 {
1915 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1916 }
1917 else if (classname != "" && food_stage)
1918 {
1919 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1920 }
1921 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1923
1924 }
1925
1927 {
1930 {
1931 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1932 }
1933 else if (classname != "" && food_stage)
1934 {
1935 return FoodStage.GetToxicity(null, food_stage, classname);
1936 }
1937 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1939 }
1940
1942 {
1945 {
1947 }
1948 else if (classname != "" && food_stage)
1949 {
1950 return FoodStage.GetAgents(null, food_stage, classname);
1951 }
1952 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1954 }
1955
1957 {
1960 {
1961 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1962 }
1963 else if (classname != "" && food_stage)
1964 {
1965 return FoodStage.GetDigestibility(null, food_stage, classname);
1966 }
1967 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1969 }
1970
1972 {
1975 {
1976 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1977 }
1978 else if (className != "" && foodStage)
1979 {
1980 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1981 }
1982 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1984 }
1985
1987 {
1997
1998 return profile;
1999 }
2000
2001
2002
2003
2005 {
2007 }
2008
2009
2011 {
2013 {
2015 }
2016
2017 return false;
2018 }
2019
2021 {
2023 {
2025 }
2026
2027 return false;
2028 }
2029
2031 {
2033 {
2035 }
2036
2037 return false;
2038 }
2039
2041 {
2043 {
2045 }
2046
2047 return false;
2048 }
2049
2051 {
2053 {
2055 }
2056
2057 return false;
2058 }
2059
2061 {
2063 {
2065 }
2066
2067 return false;
2068 }
2069
2070
2072 {
2074 }
2075
2077 {
2078 return GetFoodStage().GetNextFoodStageType( cooking_method );
2079 }
2080
2082 {
2083 return GetFoodStage().GetFoodStageName( food_stage_type );
2084 }
2085
2087 {
2088 return GetFoodStage().CanChangeToNewStage( cooking_method );
2089 }
2090
2091
2093 {
2094 if ( !source.GetFoodStage())
2095 return;
2100 }
2101
2104 {
2107 }
2108
2111 {
2112 switch (stageNew)
2113 {
2118 break;
2119
2122 break;
2123 }
2124 }
2125
2126
2127
2128
2129
2131 {
2133 }
2134
2136 {
2138
2139
2141 }
2142
2144 {
2146 {
2149 }
2150 }
2151
2152
2154 {
2156 if (player)
2157 {
2159 player.ServerReplaceItemInHandsWithNew(lambda);
2160 }
2161 else
2162 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2163 }
2164
2166 {
2168 }
2169
2171 {
2172 super.SetActions();
2173
2176 }
2177
2179 {
2180 #ifndef SERVER
2182 {
2184
2187 }
2188 #endif
2189 }
2190
2192 {
2193 #ifndef SERVER
2195 {
2199 }
2200 #endif
2201 }
2202
2204 {
2205 return false;
2206 }
2207
2209 {
2211 }
2212
2213 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2214 {
2216
2217 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2219 if ( hasRootAsPlayer )
2221
2222
2223
2224
2225
2226
2227
2229 {
2230
2232 {
2234 {
2238 break;
2239
2243 break;
2244
2248 break;
2249
2253 default:
2256 return;
2257 }
2258
2259
2260 }
2261
2263
2265 {
2267 {
2268
2270 {
2272 }
2274 {
2277 {
2279 }
2280 else
2281 {
2283 {
2285 }
2286 else
2287 {
2289 }
2290 }
2291 }
2292 }
2293 }
2294
2295 }
2297 {
2298
2300 {
2302 {
2306 break;
2307
2311 break;
2312
2316 break;
2317
2321 break;
2322
2325 default:
2328 return;
2329 }
2330 }
2331
2333
2335 {
2337 {
2338
2340 {
2342 }
2343 }
2344 }
2345 }
2347 {
2348
2350 {
2352 {
2356 break;
2357
2360 default:
2363 return;
2364 }
2365 }
2366
2368
2370 {
2372 {
2373
2375 {
2377 }
2378 }
2379 }
2380 }
2381 else
2382 {
2383
2385
2387 {
2390
2391 }
2392 else
2393 {
2395 {
2398 }
2399 }
2400 }
2401 }
2402
2404 {
2405 if (
GetGame().IsDedicatedServer())
2406 return;
2407
2409 {
2411 GetInventory().GetCurrentInventoryLocation(invLoc);
2413 {
2415 if (ptcMgr)
2416 {
2421 }
2422 }
2423 }
2425 {
2427 {
2430 return;
2431 }
2432
2434 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2436 {
2439 }
2440 }
2441 }
2442
2443 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2444 {
2445 super.GetDebugActions(outputList);
2446
2448 {
2452 }
2453 }
2454
2456 {
2457 super.OnAction(action_id, player, ctx);
2458
2460 {
2461 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2462 {
2464 if (food_stage_prev <= 0)
2465 {
2467 }
2469 return true;
2470 }
2471 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2472 {
2475 {
2477 }
2479 return true;
2480 }
2481
2482 }
2483
2484 #ifdef DIAG_DEVELOPER
2485 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2486 {
2487 PrintNutritionsData();
2488 return true;
2489 }
2490 #endif
2491
2492 return false;
2493 }
2494
2496 {
2497 string debug_output;
2498
2499 debug_output = super.GetDebugText();
2500
2503
2504 return debug_output;
2505 }
2506
2507
2508
2509
2510
2512 {
2513 float ret = super.GetBaitEffectivity();
2514
2516 {
2517 ret *= 0.5;
2518 }
2519
2520 return ret;
2521 }
2522
2524 {
2526 }
2527
2529 {
2531 }
2532
2534 {
2536 }
2537
2538 #ifdef DIAG_DEVELOPER
2539 private void PrintNutritionsData()
2540 {
2541 string nutritionsData = "";
2542
2545
2547 if (profile)
2548 {
2549 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2551 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2555 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2557
2560
2561 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2563 }
2564
2565 nutritionsData += "-----\n";
2566
2568 }
2569 #endif
2570
2572
2575 {
2577 }
2578}
2579
2581{
2583};
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.