1461{
1463
1471
1481
1483
1485 {
1487 {
1489
1491 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1492
1496 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1497 }
1498 }
1499
1501 {
1503
1505 }
1506
1508 {
1509 super.EEDelete(parent);
1510
1512
1515 }
1516
1518 {
1519 super.EEItemLocationChanged(oldLoc, newLoc);
1520
1523 {
1524 switch (oldLoc.GetParent().GetType())
1525 {
1526 case "FryingPan":
1527 case "Pot":
1528 case "Cauldron":
1529 case "SharpWoodenStick":
1531 break;
1532 }
1533
1536 {
1538 }
1539 }
1540
1541 if (oldLoc.IsValid())
1543
1546 }
1547
1549 {
1552 }
1553
1555 {
1558
1559 return true;
1560 }
1561
1563 {
1565 {
1567 }
1568 }
1569
1572 {
1573 int foodStageType;
1574
1576 if (foodStage)
1577 foodStageType = foodStage.GetFoodStageType();
1578
1583
1584 return agentsIn;
1585 }
1586
1587
1589 {
1590 return false;
1591 }
1592
1594 {
1595 return false;
1596 }
1597
1599 {
1601 {
1603 {
1606
1609
1610 default:
1611 return super.GetTemperatureFreezeTime();
1612 }
1613 }
1614
1615 return super.GetTemperatureFreezeTime();
1616 }
1617
1619 {
1621 {
1623 {
1626
1629
1630 default:
1631 return super.GetTemperatureThawTime();
1632 }
1633 }
1634
1635 return super.GetTemperatureThawTime();
1636 }
1637
1639 {
1641 }
1642
1643
1644
1645
1647 {
1648 SetSynchDirty();
1649 }
1650
1652 {
1653 super.OnVariablesSynchronized();
1654
1655
1656
1657
1659 {
1661 }
1662 else
1663 {
1665 }
1666
1669 }
1670
1671
1672
1673
1675 {
1678
1680 }
1681
1683 {
1684 string soundName = "";
1685
1688
1690 {
1692 }
1693 else
1694 {
1696 {
1698 {
1703 else
1704 soundName = "";
1705 break;
1706 }
1707
1709 {
1714 else
1715 soundName = "";
1716 break;
1717 }
1718
1720 {
1725 else
1726 soundName = "";
1727 break;
1728 }
1729
1730 default:
1731 soundName = "";
1732 break;
1733 }
1734
1736 {
1737 if (soundName == "")
1738 {
1740 }
1741 else
1742 {
1744 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1745 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1747 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1748 {
1750 }
1751 }
1752 }
1753 }
1754
1756 }
1757
1759 {
1762 }
1763
1764
1765
1766
1768 {
1769 super.OnStoreSave(ctx);
1770
1772 {
1774 }
1775
1776
1779 }
1780
1782 {
1783 if (!super.OnStoreLoad(ctx, version))
1784 return false;
1785
1787 {
1789 return false;
1790 }
1791
1792 if (version >= 115)
1793 {
1795 {
1797 return false;
1798 }
1800 {
1802 return false;
1803 }
1804 }
1805
1808
1809 return true;
1810 }
1811
1813 {
1814 super.AfterStoreLoad();
1815
1817 }
1818
1819
1821 {
1823 }
1824
1825
1827 {
1828 return false;
1829 }
1830
1832 {
1833 return false;
1834 }
1835
1837 {
1838 return false;
1839 }
1840
1842 {
1843 return false;
1844 }
1845
1846
1847
1848
1849
1851 {
1854 {
1855 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1856 }
1857 else if (classname != "" && food_stage)
1858 {
1859 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1860 }
1861 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1863
1864 }
1865
1867 {
1870 {
1872 }
1873 else if (classname != "" && food_stage)
1874 {
1875 return FoodStage.GetEnergy(null, food_stage, classname);
1876 }
1877 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1879 }
1880
1882 {
1885 {
1887 }
1888 else if (classname != "" && food_stage)
1889 {
1890 return FoodStage.GetWater(null, food_stage, classname);
1891 }
1892 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1894 }
1895
1897 {
1900 {
1901 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1902 }
1903 else if (classname != "" && food_stage)
1904 {
1905 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1906 }
1907 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1909
1910 }
1911
1913 {
1916 {
1917 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1918 }
1919 else if (classname != "" && food_stage)
1920 {
1921 return FoodStage.GetToxicity(null, food_stage, classname);
1922 }
1923 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1925 }
1926
1928 {
1931 {
1933 }
1934 else if (classname != "" && food_stage)
1935 {
1936 return FoodStage.GetAgents(null, food_stage, classname);
1937 }
1938 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1940 }
1941
1943 {
1946 {
1947 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1948 }
1949 else if (classname != "" && food_stage)
1950 {
1951 return FoodStage.GetDigestibility(null, food_stage, classname);
1952 }
1953 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1955 }
1956
1958 {
1961 {
1962 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1963 }
1964 else if (className != "" && foodStage)
1965 {
1966 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1967 }
1968 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1970 }
1971
1973 {
1983
1984 return profile;
1985 }
1986
1987
1988
1989
1991 {
1993 }
1994
1995
1997 {
1999 {
2001 }
2002
2003 return false;
2004 }
2005
2007 {
2009 {
2011 }
2012
2013 return false;
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
2056
2058 {
2060 }
2061
2063 {
2064 return GetFoodStage().GetNextFoodStageType( cooking_method );
2065 }
2066
2068 {
2069 return GetFoodStage().GetFoodStageName( food_stage_type );
2070 }
2071
2073 {
2074 return GetFoodStage().CanChangeToNewStage( cooking_method );
2075 }
2076
2077
2079 {
2080 if ( !source.GetFoodStage())
2081 return;
2086 }
2087
2090 {
2093 }
2094
2097 {
2098 switch (stageNew)
2099 {
2104 break;
2105
2108 break;
2109 }
2110 }
2111
2112
2113
2114
2115
2117 {
2119 }
2120
2122 {
2124
2125
2127 }
2128
2130 {
2132 {
2135 }
2136 }
2137
2138
2140 {
2142 if (player)
2143 {
2145 player.ServerReplaceItemInHandsWithNew(lambda);
2146 }
2147 else
2148 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2149 }
2150
2152 {
2154 }
2155
2157 {
2158 super.SetActions();
2159
2162 }
2163
2165 {
2166 #ifndef SERVER
2168 {
2170
2173 }
2174 #endif
2175 }
2176
2178 {
2179 #ifndef SERVER
2181 {
2185 }
2186 #endif
2187 }
2188
2190 {
2191 return false;
2192 }
2193
2195 {
2197 }
2198
2199 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2200 {
2202
2203 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2205 if ( hasRootAsPlayer )
2207
2208
2209
2210
2211
2212
2213
2215 {
2216
2218 {
2220 {
2224 break;
2225
2229 break;
2230
2234 break;
2235
2239 default:
2242 return;
2243 }
2244
2245
2246 }
2247
2249
2251 {
2253 {
2254
2256 {
2258 }
2260 {
2263 {
2265 }
2266 else
2267 {
2269 {
2271 }
2272 else
2273 {
2275 }
2276 }
2277 }
2278 }
2279 }
2280
2281 }
2283 {
2284
2286 {
2288 {
2292 break;
2293
2297 break;
2298
2302 break;
2303
2307 break;
2308
2311 default:
2314 return;
2315 }
2316 }
2317
2319
2321 {
2323 {
2324
2326 {
2328 }
2329 }
2330 }
2331 }
2333 {
2334
2336 {
2338 {
2342 break;
2343
2346 default:
2349 return;
2350 }
2351 }
2352
2354
2356 {
2358 {
2359
2361 {
2363 }
2364 }
2365 }
2366 }
2367 else
2368 {
2369
2371
2373 {
2376
2377 }
2378 else
2379 {
2381 {
2384 }
2385 }
2386 }
2387 }
2388
2390 {
2391 if (
GetGame().IsDedicatedServer())
2392 return;
2393
2395 {
2397 GetInventory().GetCurrentInventoryLocation(invLoc);
2399 {
2401 if (ptcMgr)
2402 {
2407 }
2408 }
2409 }
2411 {
2413 {
2416 return;
2417 }
2418
2420 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2422 {
2425 }
2426 }
2427 }
2428
2429 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2430 {
2431 super.GetDebugActions(outputList);
2432
2434 {
2438 }
2439 }
2440
2442 {
2443 super.OnAction(action_id, player, ctx);
2444
2446 {
2447 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2448 {
2450 if (food_stage_prev <= 0)
2451 {
2453 }
2455 return true;
2456 }
2457 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2458 {
2461 {
2463 }
2465 return true;
2466 }
2467
2468 }
2469
2470 #ifdef DIAG_DEVELOPER
2471 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2472 {
2473 PrintNutritionsData();
2474 return true;
2475 }
2476 #endif
2477
2478 return false;
2479 }
2480
2482 {
2483 string debug_output;
2484
2485 debug_output = super.GetDebugText();
2486
2489
2490 return debug_output;
2491 }
2492
2493
2494
2495
2496
2498 {
2499 float ret = super.GetBaitEffectivity();
2500
2502 {
2503 ret *= 0.5;
2504 }
2505
2506 return ret;
2507 }
2508
2510 {
2512 }
2513
2515 {
2517 }
2518
2520 {
2522 }
2523
2524 #ifdef DIAG_DEVELOPER
2525 private void PrintNutritionsData()
2526 {
2527 string nutritionsData = "";
2528
2531
2533 if (profile)
2534 {
2535 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2537 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2541 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2543
2546
2547 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2549 }
2550
2551 nutritionsData += "-----\n";
2552
2554 }
2555 #endif
2556
2558
2561 {
2563 }
2564}
2565
2567{
2569};
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.