1491{
1493
1501
1511
1513
1515 {
1517 {
1519
1521 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1522
1526 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1527 }
1528 }
1529
1531 {
1533
1535 }
1536
1538 {
1539 super.EEDelete(parent);
1540
1542
1545 }
1546
1548 {
1549 super.EEItemLocationChanged(oldLoc, newLoc);
1550
1553 {
1554 switch (oldLoc.GetParent().GetType())
1555 {
1556 case "FryingPan":
1557 case "Pot":
1558 case "Cauldron":
1559 case "SharpWoodenStick":
1561 break;
1562 }
1563
1566 {
1568 }
1569 }
1570
1571 if (oldLoc.IsValid())
1573
1576 }
1577
1579 {
1582 }
1583
1585 {
1588
1589 return true;
1590 }
1591
1593 {
1595 {
1597 }
1598 }
1599
1602 {
1603 int foodStageType;
1604
1606 if (foodStage)
1607 foodStageType = foodStage.GetFoodStageType();
1608
1613
1614 return agentsIn;
1615 }
1616
1617
1619 {
1620 return false;
1621 }
1622
1624 {
1625 return false;
1626 }
1627
1629 {
1631 {
1633 {
1636
1639
1640 default:
1641 return super.GetTemperatureFreezeTime();
1642 }
1643 }
1644
1645 return super.GetTemperatureFreezeTime();
1646 }
1647
1649 {
1651 {
1653 {
1656
1659
1660 default:
1661 return super.GetTemperatureThawTime();
1662 }
1663 }
1664
1665 return super.GetTemperatureThawTime();
1666 }
1667
1669 {
1671 }
1672
1673
1674
1675
1677 {
1678 SetSynchDirty();
1679 }
1680
1682 {
1683 super.OnVariablesSynchronized();
1684
1685
1686
1687
1689 {
1691 }
1692 else
1693 {
1695 }
1696
1699 }
1700
1701
1702
1703
1705 {
1708
1710 }
1711
1713 {
1714 string soundName = "";
1715
1718
1720 {
1722 }
1723 else
1724 {
1726 {
1728 {
1733 else
1734 soundName = "";
1735 break;
1736 }
1737
1739 {
1744 else
1745 soundName = "";
1746 break;
1747 }
1748
1750 {
1755 else
1756 soundName = "";
1757 break;
1758 }
1759
1760 default:
1761 soundName = "";
1762 break;
1763 }
1764
1766 {
1767 if (soundName == "")
1768 {
1770 }
1771 else
1772 {
1774 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1775 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1777 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1778 {
1780 }
1781 }
1782 }
1783 }
1784
1786 }
1787
1789 {
1792 }
1793
1794
1795
1796
1798 {
1799 super.OnStoreSave(ctx);
1800
1802 {
1804 }
1805
1806
1809 }
1810
1812 {
1813 if (!super.OnStoreLoad(ctx, version))
1814 return false;
1815
1817 {
1819 return false;
1820 }
1821
1822 if (version >= 115)
1823 {
1825 {
1827 return false;
1828 }
1830 {
1832 return false;
1833 }
1834 }
1835
1838
1839 return true;
1840 }
1841
1843 {
1844 super.AfterStoreLoad();
1845
1847 }
1848
1849
1851 {
1853 }
1854
1855
1857 {
1858 return false;
1859 }
1860
1862 {
1863 return false;
1864 }
1865
1867 {
1868 return false;
1869 }
1870
1872 {
1873 return false;
1874 }
1875
1876
1877
1878
1879
1881 {
1884 {
1885 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1886 }
1887 else if (classname != "" && food_stage)
1888 {
1889 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1890 }
1891 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1893
1894 }
1895
1897 {
1900 {
1902 }
1903 else if (classname != "" && food_stage)
1904 {
1905 return FoodStage.GetEnergy(null, food_stage, classname);
1906 }
1907 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1909 }
1910
1912 {
1915 {
1917 }
1918 else if (classname != "" && food_stage)
1919 {
1920 return FoodStage.GetWater(null, food_stage, classname);
1921 }
1922 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1924 }
1925
1927 {
1930 {
1931 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1932 }
1933 else if (classname != "" && food_stage)
1934 {
1935 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1936 }
1937 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1939
1940 }
1941
1943 {
1946 {
1947 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1948 }
1949 else if (classname != "" && food_stage)
1950 {
1951 return FoodStage.GetToxicity(null, food_stage, classname);
1952 }
1953 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1955 }
1956
1958 {
1961 {
1963 }
1964 else if (classname != "" && food_stage)
1965 {
1966 return FoodStage.GetAgents(null, food_stage, classname);
1967 }
1968 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1970 }
1971
1973 {
1976 {
1977 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1978 }
1979 else if (classname != "" && food_stage)
1980 {
1981 return FoodStage.GetDigestibility(null, food_stage, classname);
1982 }
1983 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1985 }
1986
1988 {
1991 {
1992 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1993 }
1994 else if (className != "" && foodStage)
1995 {
1996 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1997 }
1998 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2000 }
2001
2003 {
2013
2014 return profile;
2015 }
2016
2017
2018
2019
2021 {
2023 }
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
2077 {
2079 {
2081 }
2082
2083 return false;
2084 }
2085
2086
2088 {
2090 }
2091
2093 {
2094 return GetFoodStage().GetNextFoodStageType( cooking_method );
2095 }
2096
2098 {
2099 return GetFoodStage().GetFoodStageName( food_stage_type );
2100 }
2101
2103 {
2104 return GetFoodStage().CanChangeToNewStage( cooking_method );
2105 }
2106
2107
2109 {
2110 if ( !source.GetFoodStage())
2111 return;
2116 }
2117
2120 {
2123 }
2124
2127 {
2128 switch (stageNew)
2129 {
2134 break;
2135
2138 break;
2139 }
2140 }
2141
2142
2143
2144
2145
2147 {
2149 }
2150
2152 {
2154
2155
2157 }
2158
2160 {
2162 {
2165 }
2166 }
2167
2168
2170 {
2172 if (player)
2173 {
2175 player.ServerReplaceItemInHandsWithNew(lambda);
2176 }
2177 else
2178 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2179 }
2180
2182 {
2184 }
2185
2187 {
2188 super.SetActions();
2189
2192 }
2193
2195 {
2196 #ifndef SERVER
2198 {
2200
2203 }
2204 #endif
2205 }
2206
2208 {
2209 #ifndef SERVER
2211 {
2215 }
2216 #endif
2217 }
2218
2220 {
2221 return false;
2222 }
2223
2225 {
2227 }
2228
2229 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2230 {
2232
2233 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2235 if ( hasRootAsPlayer )
2237
2238
2239
2240
2241
2242
2243
2245 {
2246
2248 {
2250 {
2254 break;
2255
2259 break;
2260
2264 break;
2265
2269 default:
2272 return;
2273 }
2274
2275
2276 }
2277
2279
2281 {
2283 {
2284
2286 {
2288 }
2290 {
2293 {
2295 }
2296 else
2297 {
2299 {
2301 }
2302 else
2303 {
2305 }
2306 }
2307 }
2308 }
2309 }
2310
2311 }
2313 {
2314
2316 {
2318 {
2322 break;
2323
2327 break;
2328
2332 break;
2333
2337 break;
2338
2341 default:
2344 return;
2345 }
2346 }
2347
2349
2351 {
2353 {
2354
2356 {
2358 }
2359 }
2360 }
2361 }
2363 {
2364
2366 {
2368 {
2372 break;
2373
2376 default:
2379 return;
2380 }
2381 }
2382
2384
2386 {
2388 {
2389
2391 {
2393 }
2394 }
2395 }
2396 }
2397 else
2398 {
2399
2401
2403 {
2406
2407 }
2408 else
2409 {
2411 {
2414 }
2415 }
2416 }
2417 }
2418
2420 {
2421 if (
GetGame().IsDedicatedServer())
2422 return;
2423
2425 {
2427 GetInventory().GetCurrentInventoryLocation(invLoc);
2429 {
2431 if (ptcMgr)
2432 {
2437 }
2438 }
2439 }
2441 {
2443 {
2446 return;
2447 }
2448
2450 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2452 {
2455 }
2456 }
2457 }
2458
2459 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2460 {
2462 {
2467 }
2468
2469 super.GetDebugActions(outputList);
2470 }
2471
2473 {
2474 super.OnAction(action_id, player, ctx);
2475
2477 {
2478 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2479 {
2481 if (food_stage_prev <= 0)
2482 {
2484 }
2486 return true;
2487 }
2488 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2489 {
2492 {
2494 }
2496 return true;
2497 }
2498
2499 }
2500
2501 #ifdef DIAG_DEVELOPER
2502 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2503 {
2504 PrintNutritionsData();
2505 return true;
2506 }
2507 #endif
2508
2509 return false;
2510 }
2511
2513 {
2514 string debug_output;
2515
2516 debug_output = super.GetDebugText();
2517
2520
2521 return debug_output;
2522 }
2523
2524
2525
2526
2527
2529 {
2530 float ret = super.GetBaitEffectivity();
2531
2533 {
2534 ret *= 0.5;
2535 }
2536
2537 return ret;
2538 }
2539
2541 {
2543 }
2544
2546 {
2548 }
2549
2551 {
2553 }
2554
2555 #ifdef DIAG_DEVELOPER
2556 private void PrintNutritionsData()
2557 {
2558 string nutritionsData = "";
2559
2562
2564 if (profile)
2565 {
2566 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2568 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2572 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2574
2577
2578 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2580 }
2581
2582 nutritionsData += "-----\n";
2583
2585 }
2586 #endif
2587
2589
2592 {
2594 }
2595}
2596
2598{
2600};
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.