1167{
1169
1177
1187
1189
1191 {
1193 {
1195
1197 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1198
1202 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1203 }
1204 }
1205
1207 {
1209
1211 }
1212
1214 {
1215 super.EEDelete(parent);
1216
1218
1221 }
1222
1224 {
1225 super.EEItemLocationChanged(oldLoc, newLoc);
1226
1229 {
1230 switch (oldLoc.GetParent().GetType())
1231 {
1232 case "FryingPan":
1233 case "Pot":
1234 case "Cauldron":
1235 case "SharpWoodenStick":
1237 break;
1238 }
1239
1242 {
1244 }
1245 }
1246
1247 if (oldLoc.IsValid())
1249
1252 }
1253
1255 {
1258 }
1259
1261 {
1264
1265 return true;
1266 }
1267
1269 {
1271 {
1273 }
1274 }
1275
1278 {
1279 int foodStageType;
1280
1282 if (foodStage)
1283 foodStageType = foodStage.GetFoodStageType();
1284
1289
1290 return agentsIn;
1291 }
1292
1293
1295 {
1296 return false;
1297 }
1298
1300 {
1301 return false;
1302 }
1303
1305 {
1307 {
1309 {
1312
1315
1316 default:
1317 return super.GetTemperatureFreezeTime();
1318 }
1319 }
1320
1321 return super.GetTemperatureFreezeTime();
1322 }
1323
1325 {
1327 {
1329 {
1332
1335
1336 default:
1337 return super.GetTemperatureThawTime();
1338 }
1339 }
1340
1341 return super.GetTemperatureThawTime();
1342 }
1343
1345 {
1347 }
1348
1349
1350
1351
1353 {
1354 SetSynchDirty();
1355 }
1356
1358 {
1359 super.OnVariablesSynchronized();
1360
1361
1362
1363
1365 {
1367 }
1368 else
1369 {
1371 }
1372
1375 }
1376
1377
1378
1379
1381 {
1384
1386 }
1387
1389 {
1390 string soundName = "";
1391
1394
1396 {
1398 }
1399 else
1400 {
1402 {
1404 {
1409 else
1410 soundName = "";
1411 break;
1412 }
1413
1415 {
1420 else
1421 soundName = "";
1422 break;
1423 }
1424
1426 {
1431 else
1432 soundName = "";
1433 break;
1434 }
1435
1436 default:
1437 soundName = "";
1438 break;
1439 }
1440
1442 {
1443 if (soundName == "")
1444 {
1446 }
1447 else
1448 {
1450 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1451 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1453 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1454 {
1456 }
1457 }
1458 }
1459 }
1460
1462 }
1463
1465 {
1468 }
1469
1470
1471
1472
1474 {
1475 super.OnStoreSave(ctx);
1476
1478 {
1480 }
1481
1482
1485 }
1486
1488 {
1489 if (!super.OnStoreLoad(ctx, version))
1490 return false;
1491
1493 {
1495 return false;
1496 }
1497
1498 if (version >= 115)
1499 {
1501 {
1503 return false;
1504 }
1506 {
1508 return false;
1509 }
1510 }
1511
1514
1515 return true;
1516 }
1517
1519 {
1520 super.AfterStoreLoad();
1521
1523 }
1524
1525
1527 {
1529 }
1530
1531
1533 {
1534 return false;
1535 }
1536
1538 {
1539 return false;
1540 }
1541
1543 {
1544 return false;
1545 }
1546
1548 {
1549 return false;
1550 }
1551
1552
1553
1554
1555
1557 {
1560 {
1561 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1562 }
1563 else if (classname != "" && food_stage)
1564 {
1565 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1566 }
1567 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1569
1570 }
1571
1573 {
1576 {
1578 }
1579 else if (classname != "" && food_stage)
1580 {
1581 return FoodStage.GetEnergy(null, food_stage, classname);
1582 }
1583 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1585 }
1586
1588 {
1591 {
1593 }
1594 else if (classname != "" && food_stage)
1595 {
1596 return FoodStage.GetWater(null, food_stage, classname);
1597 }
1598 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1600 }
1601
1603 {
1606 {
1607 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1608 }
1609 else if (classname != "" && food_stage)
1610 {
1611 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1612 }
1613 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1615
1616 }
1617
1619 {
1622 {
1623 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1624 }
1625 else if (classname != "" && food_stage)
1626 {
1627 return FoodStage.GetToxicity(null, food_stage, classname);
1628 }
1629 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1631 }
1632
1634 {
1637 {
1639 }
1640 else if (classname != "" && food_stage)
1641 {
1642 return FoodStage.GetAgents(null, food_stage, classname);
1643 }
1644 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1646 }
1647
1649 {
1652 {
1653 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1654 }
1655 else if (classname != "" && food_stage)
1656 {
1657 return FoodStage.GetDigestibility(null, food_stage, classname);
1658 }
1659 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1661 }
1662
1664 {
1667 {
1668 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1669 }
1670 else if (className != "" && foodStage)
1671 {
1672 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1673 }
1674 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1676 }
1677
1679 {
1689
1690 return profile;
1691 }
1692
1693
1694
1695
1697 {
1699 }
1700
1701
1703 {
1705 {
1707 }
1708
1709 return false;
1710 }
1711
1713 {
1715 {
1717 }
1718
1719 return false;
1720 }
1721
1723 {
1725 {
1727 }
1728
1729 return false;
1730 }
1731
1733 {
1735 {
1737 }
1738
1739 return false;
1740 }
1741
1743 {
1745 {
1747 }
1748
1749 return false;
1750 }
1751
1753 {
1755 {
1757 }
1758
1759 return false;
1760 }
1761
1762
1764 {
1766 }
1767
1769 {
1770 return GetFoodStage().GetNextFoodStageType( cooking_method );
1771 }
1772
1774 {
1775 return GetFoodStage().GetFoodStageName( food_stage_type );
1776 }
1777
1779 {
1780 return GetFoodStage().CanChangeToNewStage( cooking_method );
1781 }
1782
1783
1785 {
1786 if ( !source.GetFoodStage())
1787 return;
1792 }
1793
1796 {
1799 }
1800
1803 {
1804 switch (stageNew)
1805 {
1810 break;
1811
1814 break;
1815 }
1816 }
1817
1818
1819
1820
1821
1823 {
1825 }
1826
1828 {
1830
1831
1833 }
1834
1836 {
1838 {
1841 }
1842 }
1843
1844
1846 {
1848 if (player)
1849 {
1851 player.ServerReplaceItemInHandsWithNew(lambda);
1852 }
1853 else
1854 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1855 }
1856
1858 {
1860 }
1861
1863 {
1864 super.SetActions();
1865
1868 }
1869
1871 {
1872 #ifndef SERVER
1874 {
1876
1879 }
1880 #endif
1881 }
1882
1884 {
1885 #ifndef SERVER
1887 {
1891 }
1892 #endif
1893 }
1894
1896 {
1897 return false;
1898 }
1899
1901 {
1903 }
1904
1905 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
1906 {
1908
1909 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
1911 if ( hasRootAsPlayer )
1913
1914
1915
1916
1917
1918
1919
1921 {
1922
1924 {
1926 {
1930 break;
1931
1935 break;
1936
1940 break;
1941
1945 default:
1948 return;
1949 }
1950
1951
1952 }
1953
1955
1957 {
1959 {
1960
1962 {
1964 }
1966 {
1969 {
1971 }
1972 else
1973 {
1975 {
1977 }
1978 else
1979 {
1981 }
1982 }
1983 }
1984 }
1985 }
1986
1987 }
1989 {
1990
1992 {
1994 {
1998 break;
1999
2003 break;
2004
2008 break;
2009
2013 break;
2014
2017 default:
2020 return;
2021 }
2022 }
2023
2025
2027 {
2029 {
2030
2032 {
2034 }
2035 }
2036 }
2037 }
2039 {
2040
2042 {
2044 {
2048 break;
2049
2052 default:
2055 return;
2056 }
2057 }
2058
2060
2062 {
2064 {
2065
2067 {
2069 }
2070 }
2071 }
2072 }
2073 else
2074 {
2075
2077
2079 {
2082
2083 }
2084 else
2085 {
2087 {
2090 }
2091 }
2092 }
2093 }
2094
2096 {
2097 if (
GetGame().IsDedicatedServer())
2098 return;
2099
2101 {
2103 GetInventory().GetCurrentInventoryLocation(invLoc);
2105 {
2107 if (ptcMgr)
2108 {
2113 }
2114 }
2115 }
2117 {
2119 {
2122 return;
2123 }
2124
2126 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2128 {
2131 }
2132 }
2133 }
2134
2135 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2136 {
2138 {
2143 }
2144
2145 super.GetDebugActions(outputList);
2146 }
2147
2149 {
2150 super.OnAction(action_id, player, ctx);
2151
2153 {
2154 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2155 {
2157 if (food_stage_prev <= 0)
2158 {
2160 }
2162 return true;
2163 }
2164 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2165 {
2168 {
2170 }
2172 return true;
2173 }
2174
2175 }
2176
2177 #ifdef DIAG_DEVELOPER
2178 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2179 {
2180 PrintNutritionsData();
2181 return true;
2182 }
2183 #endif
2184
2185 return false;
2186 }
2187
2189 {
2190 string debug_output;
2191
2192 debug_output = super.GetDebugText();
2193
2196
2197 return debug_output;
2198 }
2199
2200
2201
2202
2203
2205 {
2206 float ret = super.GetBaitEffectivity();
2207
2209 {
2210 ret *= 0.5;
2211 }
2212
2213 return ret;
2214 }
2215
2217 {
2219 }
2220
2222 {
2224 }
2225
2227 {
2229 }
2230
2231 #ifdef DIAG_DEVELOPER
2232 private void PrintNutritionsData()
2233 {
2234 string nutritionsData = "";
2235
2238
2240 if (profile)
2241 {
2242 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2244 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2248 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2250
2253
2254 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2256 }
2257
2258 nutritionsData += "-----\n";
2259
2261 }
2262 #endif
2263
2265
2268 {
2270 }
2271}
2272
2274{
2276};
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.