1500{
1502
1510
1520
1522
1524 {
1526 {
1528
1530 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1531
1535 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1536 }
1537 }
1538
1540 {
1542
1544 }
1545
1547 {
1548 super.EEDelete(parent);
1549
1551
1554 }
1555
1557 {
1558 super.EEItemLocationChanged(oldLoc, newLoc);
1559
1562 {
1563 switch (oldLoc.GetParent().GetType())
1564 {
1565 case "FryingPan":
1566 case "Pot":
1567 case "Cauldron":
1568 case "SharpWoodenStick":
1570 break;
1571 }
1572
1575 {
1577 }
1578 }
1579
1580 if (oldLoc.IsValid())
1582
1585 }
1586
1588 {
1591 }
1592
1594 {
1597
1598 return true;
1599 }
1600
1602 {
1604 {
1606 }
1607 }
1608
1611 {
1612 int foodStageType;
1613
1615 if (foodStage)
1616 foodStageType = foodStage.GetFoodStageType();
1617
1622
1623 return agentsIn;
1624 }
1625
1626
1628 {
1629 return false;
1630 }
1631
1633 {
1634 return false;
1635 }
1636
1638 {
1640 {
1642 {
1645
1648
1649 default:
1650 return super.GetTemperatureFreezeTime();
1651 }
1652 }
1653
1654 return super.GetTemperatureFreezeTime();
1655 }
1656
1658 {
1660 {
1662 {
1665
1668
1669 default:
1670 return super.GetTemperatureThawTime();
1671 }
1672 }
1673
1674 return super.GetTemperatureThawTime();
1675 }
1676
1678 {
1680 }
1681
1682
1683
1684
1686 {
1687 SetSynchDirty();
1688 }
1689
1691 {
1692 super.OnVariablesSynchronized();
1693
1694
1695
1696
1698 {
1700 }
1701 else
1702 {
1704 }
1705
1708 }
1709
1710
1711
1712
1714 {
1717
1719 }
1720
1722 {
1723 string soundName = "";
1724
1727
1729 {
1731 }
1732 else
1733 {
1735 {
1737 {
1742 else
1743 soundName = "";
1744 break;
1745 }
1746
1748 {
1753 else
1754 soundName = "";
1755 break;
1756 }
1757
1759 {
1764 else
1765 soundName = "";
1766 break;
1767 }
1768
1769 default:
1770 soundName = "";
1771 break;
1772 }
1773
1775 {
1776 if (soundName == "")
1777 {
1779 }
1780 else
1781 {
1783 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1784 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1786 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1787 {
1789 }
1790 }
1791 }
1792 }
1793
1795 }
1796
1798 {
1801 }
1802
1803
1804
1805
1807 {
1808 super.OnStoreSave(ctx);
1809
1811 {
1813 }
1814
1815
1818 }
1819
1821 {
1822 if (!super.OnStoreLoad(ctx, version))
1823 return false;
1824
1826 {
1828 return false;
1829 }
1830
1831 if (version >= 115)
1832 {
1834 {
1836 return false;
1837 }
1839 {
1841 return false;
1842 }
1843 }
1844
1847
1848 return true;
1849 }
1850
1852 {
1853 super.AfterStoreLoad();
1854
1856 }
1857
1858
1860 {
1862 }
1863
1864
1866 {
1867 return false;
1868 }
1869
1871 {
1872 return false;
1873 }
1874
1876 {
1877 return false;
1878 }
1879
1881 {
1882 return false;
1883 }
1884
1885
1886
1887
1888
1890 {
1893 {
1894 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1895 }
1896 else if (classname != "" && food_stage)
1897 {
1898 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1899 }
1900 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1902
1903 }
1904
1906 {
1909 {
1911 }
1912 else if (classname != "" && food_stage)
1913 {
1914 return FoodStage.GetEnergy(null, food_stage, classname);
1915 }
1916 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1918 }
1919
1921 {
1924 {
1926 }
1927 else if (classname != "" && food_stage)
1928 {
1929 return FoodStage.GetWater(null, food_stage, classname);
1930 }
1931 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1933 }
1934
1936 {
1939 {
1940 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1941 }
1942 else if (classname != "" && food_stage)
1943 {
1944 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1945 }
1946 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1948
1949 }
1950
1952 {
1955 {
1956 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1957 }
1958 else if (classname != "" && food_stage)
1959 {
1960 return FoodStage.GetToxicity(null, food_stage, classname);
1961 }
1962 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1964 }
1965
1967 {
1970 {
1972 }
1973 else if (classname != "" && food_stage)
1974 {
1975 return FoodStage.GetAgents(null, food_stage, classname);
1976 }
1977 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1979 }
1980
1982 {
1985 {
1986 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1987 }
1988 else if (classname != "" && food_stage)
1989 {
1990 return FoodStage.GetDigestibility(null, food_stage, classname);
1991 }
1992 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1994 }
1995
1997 {
2000 {
2001 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2002 }
2003 else if (className != "" && foodStage)
2004 {
2005 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2006 }
2007 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2009 }
2010
2012 {
2022
2023 return profile;
2024 }
2025
2026
2027
2028
2030 {
2032 }
2033
2034
2036 {
2038 {
2040 }
2041
2042 return false;
2043 }
2044
2046 {
2048 {
2050 }
2051
2052 return false;
2053 }
2054
2056 {
2058 {
2060 }
2061
2062 return false;
2063 }
2064
2066 {
2068 {
2070 }
2071
2072 return false;
2073 }
2074
2076 {
2078 {
2080 }
2081
2082 return false;
2083 }
2084
2086 {
2088 {
2090 }
2091
2092 return false;
2093 }
2094
2095
2097 {
2099 }
2100
2102 {
2103 return GetFoodStage().GetNextFoodStageType( cooking_method );
2104 }
2105
2107 {
2108 return GetFoodStage().GetFoodStageName( food_stage_type );
2109 }
2110
2112 {
2113 return GetFoodStage().CanChangeToNewStage( cooking_method );
2114 }
2115
2116
2118 {
2119 if ( !source.GetFoodStage())
2120 return;
2125 }
2126
2129 {
2132 }
2133
2136 {
2137 switch (stageNew)
2138 {
2143 break;
2144
2147 break;
2148 }
2149 }
2150
2151
2152
2153
2154
2156 {
2158 }
2159
2161 {
2163
2164
2166 }
2167
2169 {
2171 {
2174 }
2175 }
2176
2177
2179 {
2181 if (player)
2182 {
2184 player.ServerReplaceItemInHandsWithNew(lambda);
2185 }
2186 else
2187 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2188 }
2189
2191 {
2193 }
2194
2196 {
2197 super.SetActions();
2198
2201 }
2202
2204 {
2205 #ifndef SERVER
2207 {
2209
2212 }
2213 #endif
2214 }
2215
2217 {
2218 #ifndef SERVER
2220 {
2224 }
2225 #endif
2226 }
2227
2229 {
2230 return false;
2231 }
2232
2234 {
2236 }
2237
2238 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2239 {
2241
2242 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2244 if ( hasRootAsPlayer )
2246
2247
2248
2249
2250
2251
2252
2254 {
2255
2257 {
2259 {
2263 break;
2264
2268 break;
2269
2273 break;
2274
2278 default:
2281 return;
2282 }
2283
2284
2285 }
2286
2288
2290 {
2292 {
2293
2295 {
2297 }
2299 {
2302 {
2304 }
2305 else
2306 {
2308 {
2310 }
2311 else
2312 {
2314 }
2315 }
2316 }
2317 }
2318 }
2319
2320 }
2322 {
2323
2325 {
2327 {
2331 break;
2332
2336 break;
2337
2341 break;
2342
2346 break;
2347
2350 default:
2353 return;
2354 }
2355 }
2356
2358
2360 {
2362 {
2363
2365 {
2367 }
2368 }
2369 }
2370 }
2372 {
2373
2375 {
2377 {
2381 break;
2382
2385 default:
2388 return;
2389 }
2390 }
2391
2393
2395 {
2397 {
2398
2400 {
2402 }
2403 }
2404 }
2405 }
2406 else
2407 {
2408
2410
2412 {
2415
2416 }
2417 else
2418 {
2420 {
2423 }
2424 }
2425 }
2426 }
2427
2429 {
2430 if (
GetGame().IsDedicatedServer())
2431 return;
2432
2434 {
2436 GetInventory().GetCurrentInventoryLocation(invLoc);
2438 {
2440 if (ptcMgr)
2441 {
2446 }
2447 }
2448 }
2450 {
2452 {
2455 return;
2456 }
2457
2459 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2461 {
2464 }
2465 }
2466 }
2467
2468 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2469 {
2471 {
2476 }
2477
2478 super.GetDebugActions(outputList);
2479 }
2480
2482 {
2483 super.OnAction(action_id, player, ctx);
2484
2486 {
2487 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2488 {
2490 if (food_stage_prev <= 0)
2491 {
2493 }
2495 return true;
2496 }
2497 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2498 {
2501 {
2503 }
2505 return true;
2506 }
2507
2508 }
2509
2510 #ifdef DIAG_DEVELOPER
2511 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2512 {
2513 PrintNutritionsData();
2514 return true;
2515 }
2516 #endif
2517
2518 return false;
2519 }
2520
2522 {
2523 string debug_output;
2524
2525 debug_output = super.GetDebugText();
2526
2529
2530 return debug_output;
2531 }
2532
2533
2534
2535
2536
2538 {
2539 float ret = super.GetBaitEffectivity();
2540
2542 {
2543 ret *= 0.5;
2544 }
2545
2546 return ret;
2547 }
2548
2550 {
2552 }
2553
2555 {
2557 }
2558
2560 {
2562 }
2563
2564 #ifdef DIAG_DEVELOPER
2565 private void PrintNutritionsData()
2566 {
2567 string nutritionsData = "";
2568
2571
2573 if (profile)
2574 {
2575 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2577 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2581 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2583
2586
2587 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2589 }
2590
2591 nutritionsData += "-----\n";
2592
2594 }
2595 #endif
2596
2598
2601 {
2603 }
2604}
2605
2607{
2609};
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.