1134{
1136
1144
1154
1156
1158 {
1160 {
1162
1164 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1165
1169 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1170 }
1171 }
1172
1174 {
1176
1178 }
1179
1181 {
1182 super.EEDelete(parent);
1183
1185
1188 }
1189
1191 {
1192 super.EEItemLocationChanged(oldLoc, newLoc);
1193
1196 {
1197 switch (oldLoc.GetParent().GetType())
1198 {
1199 case "FryingPan":
1200 case "Pot":
1201 case "Cauldron":
1202 case "SharpWoodenStick":
1204 break;
1205 }
1206
1209 {
1211 }
1212 }
1213
1214 if (oldLoc.IsValid())
1216
1219 }
1220
1222 {
1225 }
1226
1228 {
1231
1232 return true;
1233 }
1234
1236 {
1238 {
1240 }
1241 }
1242
1245 {
1246 int foodStageType;
1247
1249 if (foodStage)
1250 foodStageType = foodStage.GetFoodStageType();
1251
1256
1257 return agentsIn;
1258 }
1259
1260
1262 {
1263 return false;
1264 }
1265
1267 {
1268 return false;
1269 }
1270
1272 {
1274 {
1276 {
1279
1282
1283 default:
1284 return super.GetTemperatureFreezeTime();
1285 }
1286 }
1287
1288 return super.GetTemperatureFreezeTime();
1289 }
1290
1292 {
1294 {
1296 {
1299
1302
1303 default:
1304 return super.GetTemperatureThawTime();
1305 }
1306 }
1307
1308 return super.GetTemperatureThawTime();
1309 }
1310
1312 {
1314 }
1315
1316
1317
1318
1320 {
1321 SetSynchDirty();
1322 }
1323
1325 {
1326 super.OnVariablesSynchronized();
1327
1328
1329
1330
1332 {
1334 }
1335 else
1336 {
1338 }
1339
1342 }
1343
1344
1345
1346
1348 {
1351
1353 }
1354
1356 {
1357 string soundName = "";
1358
1361
1363 {
1365 }
1366 else
1367 {
1369 {
1371 {
1376 else
1377 soundName = "";
1378 break;
1379 }
1380
1382 {
1387 else
1388 soundName = "";
1389 break;
1390 }
1391
1393 {
1398 else
1399 soundName = "";
1400 break;
1401 }
1402
1403 default:
1404 soundName = "";
1405 break;
1406 }
1407
1409 {
1410 if (soundName == "")
1411 {
1413 }
1414 else
1415 {
1417 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1418 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1420 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1421 {
1423 }
1424 }
1425 }
1426 }
1427
1429 }
1430
1432 {
1435 }
1436
1437
1438
1439
1441 {
1442 super.OnStoreSave(ctx);
1443
1445 {
1447 }
1448
1449
1452 }
1453
1455 {
1456 if (!super.OnStoreLoad(ctx, version))
1457 return false;
1458
1460 {
1462 return false;
1463 }
1464
1465 if (version >= 115)
1466 {
1468 {
1470 return false;
1471 }
1473 {
1475 return false;
1476 }
1477 }
1478
1481
1482 return true;
1483 }
1484
1486 {
1487 super.AfterStoreLoad();
1488
1490 }
1491
1492
1494 {
1496 }
1497
1498
1500 {
1501 return false;
1502 }
1503
1505 {
1506 return false;
1507 }
1508
1510 {
1511 return false;
1512 }
1513
1515 {
1516 return false;
1517 }
1518
1519
1520
1521
1522
1524 {
1527 {
1528 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1529 }
1530 else if (classname != "" && food_stage)
1531 {
1532 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1533 }
1534 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1536
1537 }
1538
1540 {
1543 {
1545 }
1546 else if (classname != "" && food_stage)
1547 {
1548 return FoodStage.GetEnergy(null, food_stage, classname);
1549 }
1550 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1552 }
1553
1555 {
1558 {
1560 }
1561 else if (classname != "" && food_stage)
1562 {
1563 return FoodStage.GetWater(null, food_stage, classname);
1564 }
1565 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1567 }
1568
1570 {
1573 {
1574 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1575 }
1576 else if (classname != "" && food_stage)
1577 {
1578 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1579 }
1580 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1582
1583 }
1584
1586 {
1589 {
1590 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1591 }
1592 else if (classname != "" && food_stage)
1593 {
1594 return FoodStage.GetToxicity(null, food_stage, classname);
1595 }
1596 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1598 }
1599
1601 {
1604 {
1606 }
1607 else if (classname != "" && food_stage)
1608 {
1609 return FoodStage.GetAgents(null, food_stage, classname);
1610 }
1611 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1613 }
1614
1616 {
1619 {
1620 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1621 }
1622 else if (classname != "" && food_stage)
1623 {
1624 return FoodStage.GetDigestibility(null, food_stage, classname);
1625 }
1626 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1628 }
1629
1631 {
1634 {
1635 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
1636 }
1637 else if (className != "" && foodStage)
1638 {
1639 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
1640 }
1641 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
1643 }
1644
1646 {
1656
1657 return profile;
1658 }
1659
1660
1661
1662
1664 {
1666 }
1667
1668
1670 {
1672 {
1674 }
1675
1676 return false;
1677 }
1678
1680 {
1682 {
1684 }
1685
1686 return false;
1687 }
1688
1690 {
1692 {
1694 }
1695
1696 return false;
1697 }
1698
1700 {
1702 {
1704 }
1705
1706 return false;
1707 }
1708
1710 {
1712 {
1714 }
1715
1716 return false;
1717 }
1718
1720 {
1722 {
1724 }
1725
1726 return false;
1727 }
1728
1729
1731 {
1733 }
1734
1736 {
1737 return GetFoodStage().GetNextFoodStageType( cooking_method );
1738 }
1739
1741 {
1742 return GetFoodStage().GetFoodStageName( food_stage_type );
1743 }
1744
1746 {
1747 return GetFoodStage().CanChangeToNewStage( cooking_method );
1748 }
1749
1750
1752 {
1753 if ( !source.GetFoodStage())
1754 return;
1759 }
1760
1763 {
1766 }
1767
1770 {
1771 switch (stageNew)
1772 {
1777 break;
1778
1781 break;
1782 }
1783 }
1784
1785
1786
1787
1788
1790 {
1792 }
1793
1795 {
1797
1798
1800 }
1801
1803 {
1805 {
1808 }
1809 }
1810
1811
1813 {
1815 if (player)
1816 {
1818 player.ServerReplaceItemInHandsWithNew(lambda);
1819 }
1820 else
1821 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
1822 }
1823
1825 {
1827 }
1828
1830 {
1831 super.SetActions();
1832
1835 }
1836
1838 {
1839 #ifndef SERVER
1841 {
1843
1846 }
1847 #endif
1848 }
1849
1851 {
1852 #ifndef SERVER
1854 {
1858 }
1859 #endif
1860 }
1861
1863 {
1864 return false;
1865 }
1866
1868 {
1870 }
1871
1872 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
1873 {
1875
1876 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
1878 if ( hasRootAsPlayer )
1880
1881
1882
1883
1884
1885
1886
1888 {
1889
1891 {
1893 {
1897 break;
1898
1902 break;
1903
1907 break;
1908
1912 default:
1915 return;
1916 }
1917
1918
1919 }
1920
1922
1924 {
1926 {
1927
1929 {
1931 }
1933 {
1936 {
1938 }
1939 else
1940 {
1942 {
1944 }
1945 else
1946 {
1948 }
1949 }
1950 }
1951 }
1952 }
1953
1954 }
1956 {
1957
1959 {
1961 {
1965 break;
1966
1970 break;
1971
1975 break;
1976
1980 break;
1981
1984 default:
1987 return;
1988 }
1989 }
1990
1992
1994 {
1996 {
1997
1999 {
2001 }
2002 }
2003 }
2004 }
2006 {
2007
2009 {
2011 {
2015 break;
2016
2019 default:
2022 return;
2023 }
2024 }
2025
2027
2029 {
2031 {
2032
2034 {
2036 }
2037 }
2038 }
2039 }
2040 else
2041 {
2042
2044
2046 {
2049
2050 }
2051 else
2052 {
2054 {
2057 }
2058 }
2059 }
2060 }
2061
2063 {
2064 if (
GetGame().IsDedicatedServer())
2065 return;
2066
2068 {
2070 GetInventory().GetCurrentInventoryLocation(invLoc);
2072 {
2074 if (ptcMgr)
2075 {
2080 }
2081 }
2082 }
2084 {
2086 {
2089 return;
2090 }
2091
2093 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2095 {
2098 }
2099 }
2100 }
2101
2102 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2103 {
2105 {
2110 }
2111
2112 super.GetDebugActions(outputList);
2113 }
2114
2116 {
2117 super.OnAction(action_id, player, ctx);
2118
2120 {
2121 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2122 {
2124 if (food_stage_prev <= 0)
2125 {
2127 }
2129 return true;
2130 }
2131 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2132 {
2135 {
2137 }
2139 return true;
2140 }
2141
2142 }
2143
2144 #ifdef DIAG_DEVELOPER
2145 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2146 {
2147 PrintNutritionsData();
2148 return true;
2149 }
2150 #endif
2151
2152 return false;
2153 }
2154
2156 {
2157 string debug_output;
2158
2159 debug_output = super.GetDebugText();
2160
2163
2164 return debug_output;
2165 }
2166
2167
2168
2169
2170
2172 {
2173 float ret = super.GetBaitEffectivity();
2174
2176 {
2177 ret *= 0.5;
2178 }
2179
2180 return ret;
2181 }
2182
2184 {
2186 }
2187
2189 {
2191 }
2192
2194 {
2196 }
2197
2198 #ifdef DIAG_DEVELOPER
2199 private void PrintNutritionsData()
2200 {
2201 string nutritionsData = "";
2202
2205
2207 if (profile)
2208 {
2209 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2211 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2215 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2217
2220
2221 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2223 }
2224
2225 nutritionsData += "-----\n";
2226
2228 }
2229 #endif
2230
2232
2235 {
2237 }
2238}
2239
2241{
2243};
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.