1133{
1135
1143
1153
1155
1157 {
1159 {
1161
1163 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1164
1168 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1169 }
1170 }
1171
1173 {
1175
1177 }
1178
1180 {
1181 super.EEDelete(parent);
1182
1184
1187 }
1188
1190 {
1191 super.EEItemLocationChanged(oldLoc, newLoc);
1192
1195 {
1196 switch (oldLoc.GetParent().GetType())
1197 {
1198 case "FryingPan":
1199 case "Pot":
1200 case "Cauldron":
1201 case "SharpWoodenStick":
1203 break;
1204 }
1205
1208 {
1210 }
1211 }
1212
1213 if (oldLoc.IsValid())
1215
1218 }
1219
1221 {
1224 }
1225
1227 {
1230
1231 return true;
1232 }
1233
1235 {
1237 {
1239 }
1240 }
1241
1244 {
1245 int foodStageType;
1246
1248 if (foodStage)
1249 foodStageType = foodStage.GetFoodStageType();
1250
1255
1256 return agentsIn;
1257 }
1258
1259
1261 {
1262 return false;
1263 }
1264
1266 {
1267 return false;
1268 }
1269
1271 {
1273 {
1275 {
1278
1281
1282 default:
1283 return super.GetTemperatureFreezeTime();
1284 }
1285 }
1286
1287 return super.GetTemperatureFreezeTime();
1288 }
1289
1291 {
1293 {
1295 {
1298
1301
1302 default:
1303 return super.GetTemperatureThawTime();
1304 }
1305 }
1306
1307 return super.GetTemperatureThawTime();
1308 }
1309
1311 {
1313 }
1314
1315
1316
1317
1319 {
1320 SetSynchDirty();
1321 }
1322
1324 {
1325 super.OnVariablesSynchronized();
1326
1327
1328
1329
1331 {
1333 }
1334 else
1335 {
1337 }
1338
1341 }
1342
1343
1344
1345
1347 {
1350
1352 }
1353
1355 {
1356 string soundName = "";
1357
1360
1362 {
1364 }
1365 else
1366 {
1368 {
1370 {
1375 else
1376 soundName = "";
1377 break;
1378 }
1379
1381 {
1386 else
1387 soundName = "";
1388 break;
1389 }
1390
1392 {
1397 else
1398 soundName = "";
1399 break;
1400 }
1401
1402 default:
1403 soundName = "";
1404 break;
1405 }
1406
1408 {
1409 if (soundName == "")
1410 {
1412 }
1413 else
1414 {
1416 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1417 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1419 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1420 {
1422 }
1423 }
1424 }
1425 }
1426
1428 }
1429
1431 {
1434 }
1435
1436
1437
1438
1440 {
1441 super.OnStoreSave(ctx);
1442
1444 {
1446 }
1447
1448
1451 }
1452
1454 {
1455 if (!super.OnStoreLoad(ctx, version))
1456 return false;
1457
1459 {
1461 return false;
1462 }
1463
1464 if (version >= 115)
1465 {
1467 {
1469 return false;
1470 }
1472 {
1474 return false;
1475 }
1476 }
1477
1480
1481 return true;
1482 }
1483
1485 {
1486 super.AfterStoreLoad();
1487
1489 }
1490
1491
1493 {
1495 }
1496
1497
1499 {
1500 return false;
1501 }
1502
1504 {
1505 return false;
1506 }
1507
1509 {
1510 return false;
1511 }
1512
1514 {
1515 return false;
1516 }
1517
1518
1519
1520
1521
1523 {
1526 {
1527 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1528 }
1529 else if (classname != "" && food_stage)
1530 {
1531 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1532 }
1533 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1535
1536 }
1537
1539 {
1542 {
1544 }
1545 else if (classname != "" && food_stage)
1546 {
1547 return FoodStage.GetEnergy(null, food_stage, classname);
1548 }
1549 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1551 }
1552
1554 {
1557 {
1559 }
1560 else if (classname != "" && food_stage)
1561 {
1562 return FoodStage.GetWater(null, food_stage, classname);
1563 }
1564 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1566 }
1567
1569 {
1572 {
1573 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1574 }
1575 else if (classname != "" && food_stage)
1576 {
1577 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1578 }
1579 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1581
1582 }
1583
1585 {
1588 {
1589 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1590 }
1591 else if (classname != "" && food_stage)
1592 {
1593 return FoodStage.GetToxicity(null, food_stage, classname);
1594 }
1595 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1597 }
1598
1600 {
1603 {
1605 }
1606 else if (classname != "" && food_stage)
1607 {
1608 return FoodStage.GetAgents(null, food_stage, classname);
1609 }
1610 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1612 }
1613
1615 {
1618 {
1619 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1620 }
1621 else if (classname != "" && food_stage)
1622 {
1623 return FoodStage.GetDigestibility(null, food_stage, classname);
1624 }
1625 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1627 }
1628
1630 {
1633 {
1634 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1635 }
1636 else if (className != "" && foodStage)
1637 {
1638 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1639 }
1640 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1642 }
1643
1645 {
1655
1656 return profile;
1657 }
1658
1659
1660
1661
1663 {
1665 }
1666
1667
1669 {
1671 {
1673 }
1674
1675 return false;
1676 }
1677
1679 {
1681 {
1683 }
1684
1685 return false;
1686 }
1687
1689 {
1691 {
1693 }
1694
1695 return false;
1696 }
1697
1699 {
1701 {
1703 }
1704
1705 return false;
1706 }
1707
1709 {
1711 {
1713 }
1714
1715 return false;
1716 }
1717
1719 {
1721 {
1723 }
1724
1725 return false;
1726 }
1727
1728
1730 {
1732 }
1733
1735 {
1736 return GetFoodStage().GetNextFoodStageType( cooking_method );
1737 }
1738
1740 {
1741 return GetFoodStage().GetFoodStageName( food_stage_type );
1742 }
1743
1745 {
1746 return GetFoodStage().CanChangeToNewStage( cooking_method );
1747 }
1748
1749
1751 {
1752 if ( !source.GetFoodStage())
1753 return;
1758 }
1759
1762 {
1765 }
1766
1769 {
1770 switch (stageNew)
1771 {
1776 break;
1777
1780 break;
1781 }
1782 }
1783
1784
1785
1786
1787
1789 {
1791 }
1792
1794 {
1796
1797
1799 }
1800
1802 {
1804 {
1807 }
1808 }
1809
1810
1812 {
1814 if (player)
1815 {
1817 player.ServerReplaceItemInHandsWithNew(lambda);
1818 }
1819 else
1820 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1821 }
1822
1824 {
1826 }
1827
1829 {
1830 super.SetActions();
1831
1834 }
1835
1837 {
1838 #ifndef SERVER
1840 {
1842
1845 }
1846 #endif
1847 }
1848
1850 {
1851 #ifndef SERVER
1853 {
1857 }
1858 #endif
1859 }
1860
1862 {
1863 return false;
1864 }
1865
1867 {
1869 }
1870
1871 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
1872 {
1874
1875 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
1877 if ( hasRootAsPlayer )
1879
1880
1881
1882
1883
1884
1885
1887 {
1888
1890 {
1892 {
1896 break;
1897
1901 break;
1902
1906 break;
1907
1911 default:
1914 return;
1915 }
1916
1917
1918 }
1919
1921
1923 {
1925 {
1926
1928 {
1930 }
1932 {
1935 {
1937 }
1938 else
1939 {
1941 {
1943 }
1944 else
1945 {
1947 }
1948 }
1949 }
1950 }
1951 }
1952
1953 }
1955 {
1956
1958 {
1960 {
1964 break;
1965
1969 break;
1970
1974 break;
1975
1979 break;
1980
1983 default:
1986 return;
1987 }
1988 }
1989
1991
1993 {
1995 {
1996
1998 {
2000 }
2001 }
2002 }
2003 }
2005 {
2006
2008 {
2010 {
2014 break;
2015
2018 default:
2021 return;
2022 }
2023 }
2024
2026
2028 {
2030 {
2031
2033 {
2035 }
2036 }
2037 }
2038 }
2039 else
2040 {
2041
2043
2045 {
2048
2049 }
2050 else
2051 {
2053 {
2056 }
2057 }
2058 }
2059 }
2060
2062 {
2063 if (
GetGame().IsDedicatedServer())
2064 return;
2065
2067 {
2069 GetInventory().GetCurrentInventoryLocation(invLoc);
2071 {
2073 if (ptcMgr)
2074 {
2079 }
2080 }
2081 }
2083 {
2085 {
2088 return;
2089 }
2090
2092 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2094 {
2097 }
2098 }
2099 }
2100
2101 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2102 {
2103 super.GetDebugActions(outputList);
2104
2106 {
2110 }
2111 }
2112
2114 {
2115 super.OnAction(action_id, player, ctx);
2116
2118 {
2119 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2120 {
2122 if (food_stage_prev <= 0)
2123 {
2125 }
2127 return true;
2128 }
2129 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2130 {
2133 {
2135 }
2137 return true;
2138 }
2139
2140 }
2141
2142 #ifdef DIAG_DEVELOPER
2143 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2144 {
2145 PrintNutritionsData();
2146 return true;
2147 }
2148 #endif
2149
2150 return false;
2151 }
2152
2154 {
2155 string debug_output;
2156
2157 debug_output = super.GetDebugText();
2158
2161
2162 return debug_output;
2163 }
2164
2165
2166
2167
2168
2170 {
2171 float ret = super.GetBaitEffectivity();
2172
2174 {
2175 ret *= 0.5;
2176 }
2177
2178 return ret;
2179 }
2180
2182 {
2184 }
2185
2187 {
2189 }
2190
2192 {
2194 }
2195
2196 #ifdef DIAG_DEVELOPER
2197 private void PrintNutritionsData()
2198 {
2199 string nutritionsData = "";
2200
2203
2205 if (profile)
2206 {
2207 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2209 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2213 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2215
2218
2219 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2221 }
2222
2223 nutritionsData += "-----\n";
2224
2226 }
2227 #endif
2228
2230
2233 {
2235 }
2236}
2237
2239{
2241};
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.