1300{
1302
1310
1320
1322
1324 {
1326 {
1328
1330 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1331
1335 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1336 }
1337 }
1338
1340 {
1342
1344 }
1345
1347 {
1348 super.EEDelete(parent);
1349
1351
1354 }
1355
1357 {
1358 super.EEItemLocationChanged(oldLoc, newLoc);
1359
1362 {
1363 switch (oldLoc.GetParent().GetType())
1364 {
1365 case "FryingPan":
1366 case "Pot":
1367 case "Cauldron":
1368 case "SharpWoodenStick":
1370 break;
1371 }
1372
1375 {
1377 }
1378 }
1379
1380 if (oldLoc.IsValid())
1382
1385 }
1386
1388 {
1391 }
1392
1394 {
1397
1398 return true;
1399 }
1400
1402 {
1404 {
1406 }
1407 }
1408
1411 {
1412 int foodStageType;
1413
1415 if (foodStage)
1416 foodStageType = foodStage.GetFoodStageType();
1417
1422
1423 return agentsIn;
1424 }
1425
1426
1428 {
1429 return false;
1430 }
1431
1433 {
1434 return false;
1435 }
1436
1438 {
1440 {
1442 {
1445
1448
1449 default:
1450 return super.GetTemperatureFreezeTime();
1451 }
1452 }
1453
1454 return super.GetTemperatureFreezeTime();
1455 }
1456
1458 {
1460 {
1462 {
1465
1468
1469 default:
1470 return super.GetTemperatureThawTime();
1471 }
1472 }
1473
1474 return super.GetTemperatureThawTime();
1475 }
1476
1478 {
1480 }
1481
1482
1483
1484
1486 {
1487 SetSynchDirty();
1488 }
1489
1491 {
1492 super.OnVariablesSynchronized();
1493
1494
1495
1496
1498 {
1500 }
1501 else
1502 {
1504 }
1505
1508 }
1509
1510
1511
1512
1514 {
1517
1519 }
1520
1522 {
1523 string soundName = "";
1524
1527
1529 {
1531 }
1532 else
1533 {
1535 {
1537 {
1542 else
1543 soundName = "";
1544 break;
1545 }
1546
1548 {
1553 else
1554 soundName = "";
1555 break;
1556 }
1557
1559 {
1564 else
1565 soundName = "";
1566 break;
1567 }
1568
1569 default:
1570 soundName = "";
1571 break;
1572 }
1573
1575 {
1576 if (soundName == "")
1577 {
1579 }
1580 else
1581 {
1583 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1584 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1586 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1587 {
1589 }
1590 }
1591 }
1592 }
1593
1595 }
1596
1598 {
1601 }
1602
1603
1604
1605
1607 {
1608 super.OnStoreSave(ctx);
1609
1611 {
1613 }
1614
1615
1618 }
1619
1621 {
1622 if (!super.OnStoreLoad(ctx, version))
1623 return false;
1624
1626 {
1628 return false;
1629 }
1630
1631 if (version >= 115)
1632 {
1634 {
1636 return false;
1637 }
1639 {
1641 return false;
1642 }
1643 }
1644
1647
1648 return true;
1649 }
1650
1652 {
1653 super.AfterStoreLoad();
1654
1656 }
1657
1658
1660 {
1662 }
1663
1664
1666 {
1667 return false;
1668 }
1669
1671 {
1672 return false;
1673 }
1674
1676 {
1677 return false;
1678 }
1679
1681 {
1682 return false;
1683 }
1684
1685
1686
1687
1688
1690 {
1693 {
1694 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1695 }
1696 else if (classname != "" && food_stage)
1697 {
1698 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1699 }
1700 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1701 return g_Game.ConfigGetFloat( class_path +
" fullnessIndex" );
1702
1703 }
1704
1706 {
1709 {
1711 }
1712 else if (classname != "" && food_stage)
1713 {
1714 return FoodStage.GetEnergy(null, food_stage, classname);
1715 }
1716 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1717 return g_Game.ConfigGetFloat( class_path +
" energy" );
1718 }
1719
1721 {
1724 {
1726 }
1727 else if (classname != "" && food_stage)
1728 {
1729 return FoodStage.GetWater(null, food_stage, classname);
1730 }
1731 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1732 return g_Game.ConfigGetFloat( class_path +
" water" );
1733 }
1734
1736 {
1739 {
1740 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1741 }
1742 else if (classname != "" && food_stage)
1743 {
1744 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1745 }
1746 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1747 return g_Game.ConfigGetFloat( class_path +
" nutritionalIndex" );
1748
1749 }
1750
1752 {
1755 {
1756 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1757 }
1758 else if (classname != "" && food_stage)
1759 {
1760 return FoodStage.GetToxicity(null, food_stage, classname);
1761 }
1762 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1763 return g_Game.ConfigGetFloat( class_path +
" toxicity" );
1764 }
1765
1767 {
1770 {
1772 }
1773 else if (classname != "" && food_stage)
1774 {
1775 return FoodStage.GetAgents(null, food_stage, classname);
1776 }
1777 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1778 return g_Game.ConfigGetInt( class_path +
" agents" );
1779 }
1780
1782 {
1785 {
1786 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1787 }
1788 else if (classname != "" && food_stage)
1789 {
1790 return FoodStage.GetDigestibility(null, food_stage, classname);
1791 }
1792 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1793 return g_Game.ConfigGetInt( class_path +
" digestibility" );
1794 }
1795
1797 {
1800 {
1801 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1802 }
1803 else if (className != "" && foodStage)
1804 {
1805 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1806 }
1807 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1808 return g_Game.ConfigGetInt(classPath +
" agentsPerDigest");
1809 }
1810
1812 {
1822
1823 return profile;
1824 }
1825
1826
1827
1828
1830 {
1832 }
1833
1834
1836 {
1838 {
1840 }
1841
1842 return false;
1843 }
1844
1846 {
1848 {
1850 }
1851
1852 return false;
1853 }
1854
1856 {
1858 {
1860 }
1861
1862 return false;
1863 }
1864
1866 {
1868 {
1870 }
1871
1872 return false;
1873 }
1874
1876 {
1878 {
1880 }
1881
1882 return false;
1883 }
1884
1886 {
1888 {
1890 }
1891
1892 return false;
1893 }
1894
1895
1897 {
1899 }
1900
1902 {
1903 return GetFoodStage().GetNextFoodStageType( cooking_method );
1904 }
1905
1907 {
1908 return GetFoodStage().GetFoodStageName( food_stage_type );
1909 }
1910
1912 {
1913 return GetFoodStage().CanChangeToNewStage( cooking_method );
1914 }
1915
1916
1918 {
1919 if ( !source.GetFoodStage())
1920 return;
1925 }
1926
1929 {
1932 }
1933
1936 {
1937 switch (stageNew)
1938 {
1943 break;
1944
1947 break;
1948 }
1949 }
1950
1951
1952
1953
1954
1956 {
1958 }
1959
1961 {
1963
1964
1966 }
1967
1969 {
1971 {
1974 }
1975 }
1976
1977
1979 {
1981 if (player)
1982 {
1984 player.ServerReplaceItemInHandsWithNew(lambda);
1985 }
1986 else
1987 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1988 }
1989
1991 {
1993 }
1994
1996 {
1997 super.SetActions();
1998
2001 }
2002
2004 {
2005 #ifndef SERVER
2006 #ifndef NO_GUI
2008 {
2010
2013 }
2014 #endif
2015 #endif
2016 }
2017
2019 {
2020 #ifndef SERVER
2021 #ifndef NO_GUI
2023 {
2027 }
2028 #endif
2029 #endif
2030 }
2031
2033 {
2034 return false;
2035 }
2036
2038 {
2040 }
2041
2042 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2043 {
2045
2046 delta *= DayZGame.Cast(
g_Game).GetFoodDecayModifier();
2048 if ( hasRootAsPlayer )
2050
2051
2052
2053
2054
2055
2056
2058 {
2059
2061 {
2063 {
2067 break;
2068
2072 break;
2073
2077 break;
2078
2082 default:
2085 return;
2086 }
2087
2088
2089 }
2090
2092
2094 {
2096 {
2097
2099 {
2101 }
2103 {
2106 {
2108 }
2109 else
2110 {
2112 {
2114 }
2115 else
2116 {
2118 }
2119 }
2120 }
2121 }
2122 }
2123
2124 }
2126 {
2127
2129 {
2131 {
2135 break;
2136
2140 break;
2141
2145 break;
2146
2150 break;
2151
2154 default:
2157 return;
2158 }
2159 }
2160
2162
2164 {
2166 {
2167
2169 {
2171 }
2172 }
2173 }
2174 }
2176 {
2177
2179 {
2181 {
2185 break;
2186
2189 default:
2192 return;
2193 }
2194 }
2195
2197
2199 {
2201 {
2202
2204 {
2206 }
2207 }
2208 }
2209 }
2210 else
2211 {
2212
2214
2216 {
2219
2220 }
2221 else
2222 {
2224 {
2227 }
2228 }
2229 }
2230 }
2231
2233 {
2234 if (
g_Game.IsHeadlessOrDedicatedServer())
2235 return;
2236
2238 {
2240 GetInventory().GetCurrentInventoryLocation(invLoc);
2242 {
2244 if (ptcMgr)
2245 {
2250 }
2251 }
2252 }
2254 {
2256 {
2259 return;
2260 }
2261
2263 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2265 {
2268 }
2269 }
2270 }
2271
2272 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2273 {
2275 {
2280 }
2281
2282 super.GetDebugActions(outputList);
2283 }
2284
2286 {
2287 super.OnAction(action_id, player, ctx);
2288
2290 {
2291 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2292 {
2294 if (food_stage_prev <= 0)
2295 {
2297 }
2299 return true;
2300 }
2301 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2302 {
2305 {
2307 }
2309 return true;
2310 }
2311
2312 }
2313
2314 #ifdef DIAG_DEVELOPER
2315 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2316 {
2317 PrintNutritionsData();
2318 return true;
2319 }
2320 #endif
2321
2322 return false;
2323 }
2324
2326 {
2327 string debug_output;
2328
2329 debug_output = super.GetDebugText();
2330
2333
2334 return debug_output;
2335 }
2336
2337
2338
2339
2340
2342 {
2343 float ret = super.GetBaitEffectivity();
2344
2346 {
2347 ret *= 0.5;
2348 }
2349
2350 return ret;
2351 }
2352
2354 {
2356 }
2357
2359 {
2361 }
2362
2364 {
2366 }
2367
2368 #ifdef DIAG_DEVELOPER
2369 private void PrintNutritionsData()
2370 {
2371 string nutritionsData = "";
2372
2375
2377 if (profile)
2378 {
2379 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2381 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2385 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2387
2390
2391 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2393 }
2394
2395 nutritionsData += "-----\n";
2396
2398 }
2399 #endif
2400
2402
2405 {
2407 }
2408}
2409
2411{
2413};
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 RemoveAllAgentsExcept(int agent_to_keep)
override void InsertAgent(int agent, float count=1)
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.
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
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
vector GetPosition()
Get the world position of the Effect.
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.