1156{
1158
1166
1176
1178
1180 {
1182 {
1184
1186 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1187
1191 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1192 }
1193 }
1194
1196 {
1198
1200 }
1201
1203 {
1204 super.EEDelete(parent);
1205
1207
1210 }
1211
1213 {
1214 super.EEItemLocationChanged(oldLoc, newLoc);
1215
1218 {
1219 switch (oldLoc.GetParent().GetType())
1220 {
1221 case "FryingPan":
1222 case "Pot":
1223 case "Cauldron":
1224 case "SharpWoodenStick":
1226 break;
1227 }
1228
1231 {
1233 }
1234 }
1235
1236 if (oldLoc.IsValid())
1238
1241 }
1242
1244 {
1247 }
1248
1250 {
1253
1254 return true;
1255 }
1256
1258 {
1260 {
1262 }
1263 }
1264
1267 {
1268 int foodStageType;
1269
1271 if (foodStage)
1272 foodStageType = foodStage.GetFoodStageType();
1273
1278
1279 return agentsIn;
1280 }
1281
1282
1284 {
1285 return false;
1286 }
1287
1289 {
1290 return false;
1291 }
1292
1294 {
1296 {
1298 {
1301
1304
1305 default:
1306 return super.GetTemperatureFreezeTime();
1307 }
1308 }
1309
1310 return super.GetTemperatureFreezeTime();
1311 }
1312
1314 {
1316 {
1318 {
1321
1324
1325 default:
1326 return super.GetTemperatureThawTime();
1327 }
1328 }
1329
1330 return super.GetTemperatureThawTime();
1331 }
1332
1334 {
1336 }
1337
1338
1339
1340
1342 {
1343 SetSynchDirty();
1344 }
1345
1347 {
1348 super.OnVariablesSynchronized();
1349
1350
1351
1352
1354 {
1356 }
1357 else
1358 {
1360 }
1361
1364 }
1365
1366
1367
1368
1370 {
1373
1375 }
1376
1378 {
1379 string soundName = "";
1380
1383
1385 {
1387 }
1388 else
1389 {
1391 {
1393 {
1398 else
1399 soundName = "";
1400 break;
1401 }
1402
1404 {
1409 else
1410 soundName = "";
1411 break;
1412 }
1413
1415 {
1420 else
1421 soundName = "";
1422 break;
1423 }
1424
1425 default:
1426 soundName = "";
1427 break;
1428 }
1429
1431 {
1432 if (soundName == "")
1433 {
1435 }
1436 else
1437 {
1439 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1440 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1442 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1443 {
1445 }
1446 }
1447 }
1448 }
1449
1451 }
1452
1454 {
1457 }
1458
1459
1460
1461
1463 {
1464 super.OnStoreSave(ctx);
1465
1467 {
1469 }
1470
1471
1474 }
1475
1477 {
1478 if (!super.OnStoreLoad(ctx, version))
1479 return false;
1480
1482 {
1484 return false;
1485 }
1486
1487 if (version >= 115)
1488 {
1490 {
1492 return false;
1493 }
1495 {
1497 return false;
1498 }
1499 }
1500
1503
1504 return true;
1505 }
1506
1508 {
1509 super.AfterStoreLoad();
1510
1512 }
1513
1514
1516 {
1518 }
1519
1520
1522 {
1523 return false;
1524 }
1525
1527 {
1528 return false;
1529 }
1530
1532 {
1533 return false;
1534 }
1535
1537 {
1538 return false;
1539 }
1540
1541
1542
1543
1544
1546 {
1549 {
1550 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1551 }
1552 else if (classname != "" && food_stage)
1553 {
1554 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1555 }
1556 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1558
1559 }
1560
1562 {
1565 {
1567 }
1568 else if (classname != "" && food_stage)
1569 {
1570 return FoodStage.GetEnergy(null, food_stage, classname);
1571 }
1572 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1574 }
1575
1577 {
1580 {
1582 }
1583 else if (classname != "" && food_stage)
1584 {
1585 return FoodStage.GetWater(null, food_stage, classname);
1586 }
1587 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1589 }
1590
1592 {
1595 {
1596 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1597 }
1598 else if (classname != "" && food_stage)
1599 {
1600 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1601 }
1602 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1604
1605 }
1606
1608 {
1611 {
1612 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1613 }
1614 else if (classname != "" && food_stage)
1615 {
1616 return FoodStage.GetToxicity(null, food_stage, classname);
1617 }
1618 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1620 }
1621
1623 {
1626 {
1628 }
1629 else if (classname != "" && food_stage)
1630 {
1631 return FoodStage.GetAgents(null, food_stage, classname);
1632 }
1633 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1635 }
1636
1638 {
1641 {
1642 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1643 }
1644 else if (classname != "" && food_stage)
1645 {
1646 return FoodStage.GetDigestibility(null, food_stage, classname);
1647 }
1648 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1650 }
1651
1653 {
1656 {
1657 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1658 }
1659 else if (className != "" && foodStage)
1660 {
1661 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1662 }
1663 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1665 }
1666
1668 {
1678
1679 return profile;
1680 }
1681
1682
1683
1684
1686 {
1688 }
1689
1690
1692 {
1694 {
1696 }
1697
1698 return false;
1699 }
1700
1702 {
1704 {
1706 }
1707
1708 return false;
1709 }
1710
1712 {
1714 {
1716 }
1717
1718 return false;
1719 }
1720
1722 {
1724 {
1726 }
1727
1728 return false;
1729 }
1730
1732 {
1734 {
1736 }
1737
1738 return false;
1739 }
1740
1742 {
1744 {
1746 }
1747
1748 return false;
1749 }
1750
1751
1753 {
1755 }
1756
1758 {
1759 return GetFoodStage().GetNextFoodStageType( cooking_method );
1760 }
1761
1763 {
1764 return GetFoodStage().GetFoodStageName( food_stage_type );
1765 }
1766
1768 {
1769 return GetFoodStage().CanChangeToNewStage( cooking_method );
1770 }
1771
1772
1774 {
1775 if ( !source.GetFoodStage())
1776 return;
1781 }
1782
1785 {
1788 }
1789
1792 {
1793 switch (stageNew)
1794 {
1799 break;
1800
1803 break;
1804 }
1805 }
1806
1807
1808
1809
1810
1812 {
1814 }
1815
1817 {
1819
1820
1822 }
1823
1825 {
1827 {
1830 }
1831 }
1832
1833
1835 {
1837 if (player)
1838 {
1840 player.ServerReplaceItemInHandsWithNew(lambda);
1841 }
1842 else
1843 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1844 }
1845
1847 {
1849 }
1850
1852 {
1853 super.SetActions();
1854
1857 }
1858
1860 {
1861 #ifndef SERVER
1863 {
1865
1868 }
1869 #endif
1870 }
1871
1873 {
1874 #ifndef SERVER
1876 {
1880 }
1881 #endif
1882 }
1883
1885 {
1886 return false;
1887 }
1888
1890 {
1892 }
1893
1894 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
1895 {
1897
1898 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
1900 if ( hasRootAsPlayer )
1902
1903
1904
1905
1906
1907
1908
1910 {
1911
1913 {
1915 {
1919 break;
1920
1924 break;
1925
1929 break;
1930
1934 default:
1937 return;
1938 }
1939
1940
1941 }
1942
1944
1946 {
1948 {
1949
1951 {
1953 }
1955 {
1958 {
1960 }
1961 else
1962 {
1964 {
1966 }
1967 else
1968 {
1970 }
1971 }
1972 }
1973 }
1974 }
1975
1976 }
1978 {
1979
1981 {
1983 {
1987 break;
1988
1992 break;
1993
1997 break;
1998
2002 break;
2003
2006 default:
2009 return;
2010 }
2011 }
2012
2014
2016 {
2018 {
2019
2021 {
2023 }
2024 }
2025 }
2026 }
2028 {
2029
2031 {
2033 {
2037 break;
2038
2041 default:
2044 return;
2045 }
2046 }
2047
2049
2051 {
2053 {
2054
2056 {
2058 }
2059 }
2060 }
2061 }
2062 else
2063 {
2064
2066
2068 {
2071
2072 }
2073 else
2074 {
2076 {
2079 }
2080 }
2081 }
2082 }
2083
2085 {
2086 if (
GetGame().IsDedicatedServer())
2087 return;
2088
2090 {
2092 GetInventory().GetCurrentInventoryLocation(invLoc);
2094 {
2096 if (ptcMgr)
2097 {
2102 }
2103 }
2104 }
2106 {
2108 {
2111 return;
2112 }
2113
2115 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2117 {
2120 }
2121 }
2122 }
2123
2124 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2125 {
2126 super.GetDebugActions(outputList);
2127
2129 {
2133 }
2134 }
2135
2137 {
2138 super.OnAction(action_id, player, ctx);
2139
2141 {
2142 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2143 {
2145 if (food_stage_prev <= 0)
2146 {
2148 }
2150 return true;
2151 }
2152 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2153 {
2156 {
2158 }
2160 return true;
2161 }
2162
2163 }
2164
2165 #ifdef DIAG_DEVELOPER
2166 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2167 {
2168 PrintNutritionsData();
2169 return true;
2170 }
2171 #endif
2172
2173 return false;
2174 }
2175
2177 {
2178 string debug_output;
2179
2180 debug_output = super.GetDebugText();
2181
2184
2185 return debug_output;
2186 }
2187
2188
2189
2190
2191
2193 {
2194 float ret = super.GetBaitEffectivity();
2195
2197 {
2198 ret *= 0.5;
2199 }
2200
2201 return ret;
2202 }
2203
2205 {
2207 }
2208
2210 {
2212 }
2213
2215 {
2217 }
2218
2219 #ifdef DIAG_DEVELOPER
2220 private void PrintNutritionsData()
2221 {
2222 string nutritionsData = "";
2223
2226
2228 if (profile)
2229 {
2230 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2232 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2236 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2238
2241
2242 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2244 }
2245
2246 nutritionsData += "-----\n";
2247
2249 }
2250 #endif
2251
2253
2256 {
2258 }
2259}
2260
2262{
2264};
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.