1481{
1483
1491
1501
1503
1505 {
1507 {
1509
1511 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1512
1516 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1517 }
1518 }
1519
1521 {
1523
1525 }
1526
1528 {
1529 super.EEDelete(parent);
1530
1532
1535 }
1536
1538 {
1539 super.EEItemLocationChanged(oldLoc, newLoc);
1540
1543 {
1544 switch (oldLoc.GetParent().GetType())
1545 {
1546 case "FryingPan":
1547 case "Pot":
1548 case "Cauldron":
1549 case "SharpWoodenStick":
1551 break;
1552 }
1553
1556 {
1558 }
1559 }
1560
1561 if (oldLoc.IsValid())
1563
1566 }
1567
1569 {
1572 }
1573
1575 {
1578
1579 return true;
1580 }
1581
1583 {
1585 {
1587 }
1588 }
1589
1592 {
1593 int foodStageType;
1594
1596 if (foodStage)
1597 foodStageType = foodStage.GetFoodStageType();
1598
1603
1604 return agentsIn;
1605 }
1606
1607
1609 {
1610 return false;
1611 }
1612
1614 {
1615 return false;
1616 }
1617
1619 {
1621 {
1623 {
1626
1629
1630 default:
1631 return super.GetTemperatureFreezeTime();
1632 }
1633 }
1634
1635 return super.GetTemperatureFreezeTime();
1636 }
1637
1639 {
1641 {
1643 {
1646
1649
1650 default:
1651 return super.GetTemperatureThawTime();
1652 }
1653 }
1654
1655 return super.GetTemperatureThawTime();
1656 }
1657
1659 {
1661 }
1662
1663
1664
1665
1667 {
1668 SetSynchDirty();
1669 }
1670
1672 {
1673 super.OnVariablesSynchronized();
1674
1675
1676
1677
1679 {
1681 }
1682 else
1683 {
1685 }
1686
1689 }
1690
1691
1692
1693
1695 {
1698
1700 }
1701
1703 {
1704 string soundName = "";
1705
1708
1710 {
1712 }
1713 else
1714 {
1716 {
1718 {
1723 else
1724 soundName = "";
1725 break;
1726 }
1727
1729 {
1734 else
1735 soundName = "";
1736 break;
1737 }
1738
1740 {
1745 else
1746 soundName = "";
1747 break;
1748 }
1749
1750 default:
1751 soundName = "";
1752 break;
1753 }
1754
1756 {
1757 if (soundName == "")
1758 {
1760 }
1761 else
1762 {
1764 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1765 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1767 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1768 {
1770 }
1771 }
1772 }
1773 }
1774
1776 }
1777
1779 {
1782 }
1783
1784
1785
1786
1788 {
1789 super.OnStoreSave(ctx);
1790
1792 {
1794 }
1795
1796
1799 }
1800
1802 {
1803 if (!super.OnStoreLoad(ctx, version))
1804 return false;
1805
1807 {
1809 return false;
1810 }
1811
1812 if (version >= 115)
1813 {
1815 {
1817 return false;
1818 }
1820 {
1822 return false;
1823 }
1824 }
1825
1828
1829 return true;
1830 }
1831
1833 {
1834 super.AfterStoreLoad();
1835
1837 }
1838
1839
1841 {
1843 }
1844
1845
1847 {
1848 return false;
1849 }
1850
1852 {
1853 return false;
1854 }
1855
1857 {
1858 return false;
1859 }
1860
1862 {
1863 return false;
1864 }
1865
1866
1867
1868
1869
1871 {
1874 {
1875 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1876 }
1877 else if (classname != "" && food_stage)
1878 {
1879 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1880 }
1881 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1883
1884 }
1885
1887 {
1890 {
1892 }
1893 else if (classname != "" && food_stage)
1894 {
1895 return FoodStage.GetEnergy(null, food_stage, classname);
1896 }
1897 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1899 }
1900
1902 {
1905 {
1907 }
1908 else if (classname != "" && food_stage)
1909 {
1910 return FoodStage.GetWater(null, food_stage, classname);
1911 }
1912 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1914 }
1915
1917 {
1920 {
1921 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1922 }
1923 else if (classname != "" && food_stage)
1924 {
1925 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1926 }
1927 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1929
1930 }
1931
1933 {
1936 {
1937 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1938 }
1939 else if (classname != "" && food_stage)
1940 {
1941 return FoodStage.GetToxicity(null, food_stage, classname);
1942 }
1943 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1945 }
1946
1948 {
1951 {
1953 }
1954 else if (classname != "" && food_stage)
1955 {
1956 return FoodStage.GetAgents(null, food_stage, classname);
1957 }
1958 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1960 }
1961
1963 {
1966 {
1967 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1968 }
1969 else if (classname != "" && food_stage)
1970 {
1971 return FoodStage.GetDigestibility(null, food_stage, classname);
1972 }
1973 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1975 }
1976
1978 {
1981 {
1982 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1983 }
1984 else if (className != "" && foodStage)
1985 {
1986 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1987 }
1988 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1990 }
1991
1993 {
2003
2004 return profile;
2005 }
2006
2007
2008
2009
2011 {
2013 }
2014
2015
2017 {
2019 {
2021 }
2022
2023 return false;
2024 }
2025
2027 {
2029 {
2031 }
2032
2033 return false;
2034 }
2035
2037 {
2039 {
2041 }
2042
2043 return false;
2044 }
2045
2047 {
2049 {
2051 }
2052
2053 return false;
2054 }
2055
2057 {
2059 {
2061 }
2062
2063 return false;
2064 }
2065
2067 {
2069 {
2071 }
2072
2073 return false;
2074 }
2075
2076
2078 {
2080 }
2081
2083 {
2084 return GetFoodStage().GetNextFoodStageType( cooking_method );
2085 }
2086
2088 {
2089 return GetFoodStage().GetFoodStageName( food_stage_type );
2090 }
2091
2093 {
2094 return GetFoodStage().CanChangeToNewStage( cooking_method );
2095 }
2096
2097
2099 {
2100 if ( !source.GetFoodStage())
2101 return;
2106 }
2107
2110 {
2113 }
2114
2117 {
2118 switch (stageNew)
2119 {
2124 break;
2125
2128 break;
2129 }
2130 }
2131
2132
2133
2134
2135
2137 {
2139 }
2140
2142 {
2144
2145
2147 }
2148
2150 {
2152 {
2155 }
2156 }
2157
2158
2160 {
2162 if (player)
2163 {
2165 player.ServerReplaceItemInHandsWithNew(lambda);
2166 }
2167 else
2168 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2169 }
2170
2172 {
2174 }
2175
2177 {
2178 super.SetActions();
2179
2182 }
2183
2185 {
2186 #ifndef SERVER
2188 {
2190
2193 }
2194 #endif
2195 }
2196
2198 {
2199 #ifndef SERVER
2201 {
2205 }
2206 #endif
2207 }
2208
2210 {
2211 return false;
2212 }
2213
2215 {
2217 }
2218
2219 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2220 {
2222
2223 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2225 if ( hasRootAsPlayer )
2227
2228
2229
2230
2231
2232
2233
2235 {
2236
2238 {
2240 {
2244 break;
2245
2249 break;
2250
2254 break;
2255
2259 default:
2262 return;
2263 }
2264
2265
2266 }
2267
2269
2271 {
2273 {
2274
2276 {
2278 }
2280 {
2283 {
2285 }
2286 else
2287 {
2289 {
2291 }
2292 else
2293 {
2295 }
2296 }
2297 }
2298 }
2299 }
2300
2301 }
2303 {
2304
2306 {
2308 {
2312 break;
2313
2317 break;
2318
2322 break;
2323
2327 break;
2328
2331 default:
2334 return;
2335 }
2336 }
2337
2339
2341 {
2343 {
2344
2346 {
2348 }
2349 }
2350 }
2351 }
2353 {
2354
2356 {
2358 {
2362 break;
2363
2366 default:
2369 return;
2370 }
2371 }
2372
2374
2376 {
2378 {
2379
2381 {
2383 }
2384 }
2385 }
2386 }
2387 else
2388 {
2389
2391
2393 {
2396
2397 }
2398 else
2399 {
2401 {
2404 }
2405 }
2406 }
2407 }
2408
2410 {
2411 if (
GetGame().IsDedicatedServer())
2412 return;
2413
2415 {
2417 GetInventory().GetCurrentInventoryLocation(invLoc);
2419 {
2421 if (ptcMgr)
2422 {
2427 }
2428 }
2429 }
2431 {
2433 {
2436 return;
2437 }
2438
2440 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2442 {
2445 }
2446 }
2447 }
2448
2449 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2450 {
2452 {
2457 }
2458
2459 super.GetDebugActions(outputList);
2460 }
2461
2463 {
2464 super.OnAction(action_id, player, ctx);
2465
2467 {
2468 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2469 {
2471 if (food_stage_prev <= 0)
2472 {
2474 }
2476 return true;
2477 }
2478 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2479 {
2482 {
2484 }
2486 return true;
2487 }
2488
2489 }
2490
2491 #ifdef DIAG_DEVELOPER
2492 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2493 {
2494 PrintNutritionsData();
2495 return true;
2496 }
2497 #endif
2498
2499 return false;
2500 }
2501
2503 {
2504 string debug_output;
2505
2506 debug_output = super.GetDebugText();
2507
2510
2511 return debug_output;
2512 }
2513
2514
2515
2516
2517
2519 {
2520 float ret = super.GetBaitEffectivity();
2521
2523 {
2524 ret *= 0.5;
2525 }
2526
2527 return ret;
2528 }
2529
2531 {
2533 }
2534
2536 {
2538 }
2539
2541 {
2543 }
2544
2545 #ifdef DIAG_DEVELOPER
2546 private void PrintNutritionsData()
2547 {
2548 string nutritionsData = "";
2549
2552
2554 if (profile)
2555 {
2556 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2558 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2562 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2564
2567
2568 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2570 }
2571
2572 nutritionsData += "-----\n";
2573
2575 }
2576 #endif
2577
2579
2582 {
2584 }
2585}
2586
2588{
2590};
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.