1462{
1464
1472
1482
1484
1486 {
1488 {
1490
1492 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1493
1497 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1498 }
1499 }
1500
1502 {
1504
1506 }
1507
1509 {
1510 super.EEDelete(parent);
1511
1513
1516 }
1517
1519 {
1520 super.EEItemLocationChanged(oldLoc, newLoc);
1521
1524 {
1525 switch (oldLoc.GetParent().GetType())
1526 {
1527 case "FryingPan":
1528 case "Pot":
1529 case "Cauldron":
1530 case "SharpWoodenStick":
1532 break;
1533 }
1534
1537 {
1539 }
1540 }
1541
1542 if (oldLoc.IsValid())
1544
1547 }
1548
1550 {
1553 }
1554
1556 {
1559
1560 return true;
1561 }
1562
1564 {
1566 {
1568 }
1569 }
1570
1573 {
1574 int foodStageType;
1575
1577 if (foodStage)
1578 foodStageType = foodStage.GetFoodStageType();
1579
1584
1585 return agentsIn;
1586 }
1587
1588
1590 {
1591 return false;
1592 }
1593
1595 {
1596 return false;
1597 }
1598
1600 {
1602 {
1604 {
1607
1610
1611 default:
1612 return super.GetTemperatureFreezeTime();
1613 }
1614 }
1615
1616 return super.GetTemperatureFreezeTime();
1617 }
1618
1620 {
1622 {
1624 {
1627
1630
1631 default:
1632 return super.GetTemperatureThawTime();
1633 }
1634 }
1635
1636 return super.GetTemperatureThawTime();
1637 }
1638
1640 {
1642 }
1643
1644
1645
1646
1648 {
1649 SetSynchDirty();
1650 }
1651
1653 {
1654 super.OnVariablesSynchronized();
1655
1656
1657
1658
1660 {
1662 }
1663 else
1664 {
1666 }
1667
1670 }
1671
1672
1673
1674
1676 {
1679
1681 }
1682
1684 {
1685 string soundName = "";
1686
1689
1691 {
1693 }
1694 else
1695 {
1697 {
1699 {
1704 else
1705 soundName = "";
1706 break;
1707 }
1708
1710 {
1715 else
1716 soundName = "";
1717 break;
1718 }
1719
1721 {
1726 else
1727 soundName = "";
1728 break;
1729 }
1730
1731 default:
1732 soundName = "";
1733 break;
1734 }
1735
1737 {
1738 if (soundName == "")
1739 {
1741 }
1742 else
1743 {
1745 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1746 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1748 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1749 {
1751 }
1752 }
1753 }
1754 }
1755
1757 }
1758
1760 {
1763 }
1764
1765
1766
1767
1769 {
1770 super.OnStoreSave(ctx);
1771
1773 {
1775 }
1776
1777
1780 }
1781
1783 {
1784 if (!super.OnStoreLoad(ctx, version))
1785 return false;
1786
1788 {
1790 return false;
1791 }
1792
1793 if (version >= 115)
1794 {
1796 {
1798 return false;
1799 }
1801 {
1803 return false;
1804 }
1805 }
1806
1809
1810 return true;
1811 }
1812
1814 {
1815 super.AfterStoreLoad();
1816
1818 }
1819
1820
1822 {
1824 }
1825
1826
1828 {
1829 return false;
1830 }
1831
1833 {
1834 return false;
1835 }
1836
1838 {
1839 return false;
1840 }
1841
1843 {
1844 return false;
1845 }
1846
1847
1848
1849
1850
1852 {
1855 {
1856 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1857 }
1858 else if (classname != "" && food_stage)
1859 {
1860 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1861 }
1862 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1864
1865 }
1866
1868 {
1871 {
1873 }
1874 else if (classname != "" && food_stage)
1875 {
1876 return FoodStage.GetEnergy(null, food_stage, classname);
1877 }
1878 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1880 }
1881
1883 {
1886 {
1888 }
1889 else if (classname != "" && food_stage)
1890 {
1891 return FoodStage.GetWater(null, food_stage, classname);
1892 }
1893 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1895 }
1896
1898 {
1901 {
1902 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1903 }
1904 else if (classname != "" && food_stage)
1905 {
1906 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1907 }
1908 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1910
1911 }
1912
1914 {
1917 {
1918 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1919 }
1920 else if (classname != "" && food_stage)
1921 {
1922 return FoodStage.GetToxicity(null, food_stage, classname);
1923 }
1924 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1926 }
1927
1929 {
1932 {
1934 }
1935 else if (classname != "" && food_stage)
1936 {
1937 return FoodStage.GetAgents(null, food_stage, classname);
1938 }
1939 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1941 }
1942
1944 {
1947 {
1948 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1949 }
1950 else if (classname != "" && food_stage)
1951 {
1952 return FoodStage.GetDigestibility(null, food_stage, classname);
1953 }
1954 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1956 }
1957
1959 {
1962 {
1963 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1964 }
1965 else if (className != "" && foodStage)
1966 {
1967 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1968 }
1969 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1971 }
1972
1974 {
1984
1985 return profile;
1986 }
1987
1988
1989
1990
1992 {
1994 }
1995
1996
1998 {
2000 {
2002 }
2003
2004 return false;
2005 }
2006
2008 {
2010 {
2012 }
2013
2014 return false;
2015 }
2016
2018 {
2020 {
2022 }
2023
2024 return false;
2025 }
2026
2028 {
2030 {
2032 }
2033
2034 return false;
2035 }
2036
2038 {
2040 {
2042 }
2043
2044 return false;
2045 }
2046
2048 {
2050 {
2052 }
2053
2054 return false;
2055 }
2056
2057
2059 {
2061 }
2062
2064 {
2065 return GetFoodStage().GetNextFoodStageType( cooking_method );
2066 }
2067
2069 {
2070 return GetFoodStage().GetFoodStageName( food_stage_type );
2071 }
2072
2074 {
2075 return GetFoodStage().CanChangeToNewStage( cooking_method );
2076 }
2077
2078
2080 {
2081 if ( !source.GetFoodStage())
2082 return;
2087 }
2088
2091 {
2094 }
2095
2098 {
2099 switch (stageNew)
2100 {
2105 break;
2106
2109 break;
2110 }
2111 }
2112
2113
2114
2115
2116
2118 {
2120 }
2121
2123 {
2125
2126
2128 }
2129
2131 {
2133 {
2136 }
2137 }
2138
2139
2141 {
2143 if (player)
2144 {
2146 player.ServerReplaceItemInHandsWithNew(lambda);
2147 }
2148 else
2149 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2150 }
2151
2153 {
2155 }
2156
2158 {
2159 super.SetActions();
2160
2163 }
2164
2166 {
2167 #ifndef SERVER
2169 {
2171
2174 }
2175 #endif
2176 }
2177
2179 {
2180 #ifndef SERVER
2182 {
2186 }
2187 #endif
2188 }
2189
2191 {
2192 return false;
2193 }
2194
2196 {
2198 }
2199
2200 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2201 {
2203
2204 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2206 if ( hasRootAsPlayer )
2208
2209
2210
2211
2212
2213
2214
2216 {
2217
2219 {
2221 {
2225 break;
2226
2230 break;
2231
2235 break;
2236
2240 default:
2243 return;
2244 }
2245
2246
2247 }
2248
2250
2252 {
2254 {
2255
2257 {
2259 }
2261 {
2264 {
2266 }
2267 else
2268 {
2270 {
2272 }
2273 else
2274 {
2276 }
2277 }
2278 }
2279 }
2280 }
2281
2282 }
2284 {
2285
2287 {
2289 {
2293 break;
2294
2298 break;
2299
2303 break;
2304
2308 break;
2309
2312 default:
2315 return;
2316 }
2317 }
2318
2320
2322 {
2324 {
2325
2327 {
2329 }
2330 }
2331 }
2332 }
2334 {
2335
2337 {
2339 {
2343 break;
2344
2347 default:
2350 return;
2351 }
2352 }
2353
2355
2357 {
2359 {
2360
2362 {
2364 }
2365 }
2366 }
2367 }
2368 else
2369 {
2370
2372
2374 {
2377
2378 }
2379 else
2380 {
2382 {
2385 }
2386 }
2387 }
2388 }
2389
2391 {
2392 if (
GetGame().IsDedicatedServer())
2393 return;
2394
2396 {
2398 GetInventory().GetCurrentInventoryLocation(invLoc);
2400 {
2402 if (ptcMgr)
2403 {
2408 }
2409 }
2410 }
2412 {
2414 {
2417 return;
2418 }
2419
2421 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2423 {
2426 }
2427 }
2428 }
2429
2430 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2431 {
2433 {
2438 }
2439
2440 super.GetDebugActions(outputList);
2441 }
2442
2444 {
2445 super.OnAction(action_id, player, ctx);
2446
2448 {
2449 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2450 {
2452 if (food_stage_prev <= 0)
2453 {
2455 }
2457 return true;
2458 }
2459 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2460 {
2463 {
2465 }
2467 return true;
2468 }
2469
2470 }
2471
2472 #ifdef DIAG_DEVELOPER
2473 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2474 {
2475 PrintNutritionsData();
2476 return true;
2477 }
2478 #endif
2479
2480 return false;
2481 }
2482
2484 {
2485 string debug_output;
2486
2487 debug_output = super.GetDebugText();
2488
2491
2492 return debug_output;
2493 }
2494
2495
2496
2497
2498
2500 {
2501 float ret = super.GetBaitEffectivity();
2502
2504 {
2505 ret *= 0.5;
2506 }
2507
2508 return ret;
2509 }
2510
2512 {
2514 }
2515
2517 {
2519 }
2520
2522 {
2524 }
2525
2526 #ifdef DIAG_DEVELOPER
2527 private void PrintNutritionsData()
2528 {
2529 string nutritionsData = "";
2530
2533
2535 if (profile)
2536 {
2537 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2539 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2543 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2545
2548
2549 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2551 }
2552
2553 nutritionsData += "-----\n";
2554
2556 }
2557 #endif
2558
2560
2563 {
2565 }
2566}
2567
2569{
2571};
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.