1504{
1506
1514
1524
1526
1528 {
1530 {
1532
1534 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1535
1539 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1540 }
1541 }
1542
1544 {
1546
1548 }
1549
1551 {
1552 super.EEDelete(parent);
1553
1555
1558 }
1559
1561 {
1562 super.EEItemLocationChanged(oldLoc, newLoc);
1563
1566 {
1567 switch (oldLoc.GetParent().GetType())
1568 {
1569 case "FryingPan":
1570 case "Pot":
1571 case "Cauldron":
1572 case "SharpWoodenStick":
1574 break;
1575 }
1576
1579 {
1581 }
1582 }
1583
1584 if (oldLoc.IsValid())
1586
1589 }
1590
1592 {
1595 }
1596
1598 {
1601
1602 return true;
1603 }
1604
1606 {
1608 {
1610 }
1611 }
1612
1615 {
1616 int foodStageType;
1617
1619 if (foodStage)
1620 foodStageType = foodStage.GetFoodStageType();
1621
1626
1627 return agentsIn;
1628 }
1629
1630
1632 {
1633 return false;
1634 }
1635
1637 {
1638 return false;
1639 }
1640
1642 {
1644 {
1646 {
1649
1652
1653 default:
1654 return super.GetTemperatureFreezeTime();
1655 }
1656 }
1657
1658 return super.GetTemperatureFreezeTime();
1659 }
1660
1662 {
1664 {
1666 {
1669
1672
1673 default:
1674 return super.GetTemperatureThawTime();
1675 }
1676 }
1677
1678 return super.GetTemperatureThawTime();
1679 }
1680
1682 {
1684 }
1685
1686
1687
1688
1690 {
1691 SetSynchDirty();
1692 }
1693
1695 {
1696 super.OnVariablesSynchronized();
1697
1698
1699
1700
1702 {
1704 }
1705 else
1706 {
1708 }
1709
1712 }
1713
1714
1715
1716
1718 {
1721
1723 }
1724
1726 {
1727 string soundName = "";
1728
1731
1733 {
1735 }
1736 else
1737 {
1739 {
1741 {
1746 else
1747 soundName = "";
1748 break;
1749 }
1750
1752 {
1757 else
1758 soundName = "";
1759 break;
1760 }
1761
1763 {
1768 else
1769 soundName = "";
1770 break;
1771 }
1772
1773 default:
1774 soundName = "";
1775 break;
1776 }
1777
1779 {
1780 if (soundName == "")
1781 {
1783 }
1784 else
1785 {
1787 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1788 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1790 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1791 {
1793 }
1794 }
1795 }
1796 }
1797
1799 }
1800
1802 {
1805 }
1806
1807
1808
1809
1811 {
1812 super.OnStoreSave(ctx);
1813
1815 {
1817 }
1818
1819
1822 }
1823
1825 {
1826 if (!super.OnStoreLoad(ctx, version))
1827 return false;
1828
1830 {
1832 return false;
1833 }
1834
1835 if (version >= 115)
1836 {
1838 {
1840 return false;
1841 }
1843 {
1845 return false;
1846 }
1847 }
1848
1851
1852 return true;
1853 }
1854
1856 {
1857 super.AfterStoreLoad();
1858
1860 }
1861
1862
1864 {
1866 }
1867
1868
1870 {
1871 return false;
1872 }
1873
1875 {
1876 return false;
1877 }
1878
1880 {
1881 return false;
1882 }
1883
1885 {
1886 return false;
1887 }
1888
1889
1890
1891
1892
1894 {
1897 {
1898 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1899 }
1900 else if (classname != "" && food_stage)
1901 {
1902 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1903 }
1904 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1905 return g_Game.ConfigGetFloat( class_path +
" fullnessIndex" );
1906
1907 }
1908
1910 {
1913 {
1915 }
1916 else if (classname != "" && food_stage)
1917 {
1918 return FoodStage.GetEnergy(null, food_stage, classname);
1919 }
1920 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1921 return g_Game.ConfigGetFloat( class_path +
" energy" );
1922 }
1923
1925 {
1928 {
1930 }
1931 else if (classname != "" && food_stage)
1932 {
1933 return FoodStage.GetWater(null, food_stage, classname);
1934 }
1935 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1936 return g_Game.ConfigGetFloat( class_path +
" water" );
1937 }
1938
1940 {
1943 {
1944 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1945 }
1946 else if (classname != "" && food_stage)
1947 {
1948 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1949 }
1950 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1951 return g_Game.ConfigGetFloat( class_path +
" nutritionalIndex" );
1952
1953 }
1954
1956 {
1959 {
1960 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1961 }
1962 else if (classname != "" && food_stage)
1963 {
1964 return FoodStage.GetToxicity(null, food_stage, classname);
1965 }
1966 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1967 return g_Game.ConfigGetFloat( class_path +
" toxicity" );
1968 }
1969
1971 {
1974 {
1976 }
1977 else if (classname != "" && food_stage)
1978 {
1979 return FoodStage.GetAgents(null, food_stage, classname);
1980 }
1981 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1982 return g_Game.ConfigGetInt( class_path +
" agents" );
1983 }
1984
1986 {
1989 {
1990 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
1991 }
1992 else if (classname != "" && food_stage)
1993 {
1994 return FoodStage.GetDigestibility(null, food_stage, classname);
1995 }
1996 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1997 return g_Game.ConfigGetInt( class_path +
" digestibility" );
1998 }
1999
2001 {
2004 {
2005 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2006 }
2007 else if (className != "" && foodStage)
2008 {
2009 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2010 }
2011 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2012 return g_Game.ConfigGetInt(classPath +
" agentsPerDigest");
2013 }
2014
2016 {
2026
2027 return profile;
2028 }
2029
2030
2031
2032
2034 {
2036 }
2037
2038
2040 {
2042 {
2044 }
2045
2046 return false;
2047 }
2048
2050 {
2052 {
2054 }
2055
2056 return false;
2057 }
2058
2060 {
2062 {
2064 }
2065
2066 return false;
2067 }
2068
2070 {
2072 {
2074 }
2075
2076 return false;
2077 }
2078
2080 {
2082 {
2084 }
2085
2086 return false;
2087 }
2088
2090 {
2092 {
2094 }
2095
2096 return false;
2097 }
2098
2099
2101 {
2103 }
2104
2106 {
2107 return GetFoodStage().GetNextFoodStageType( cooking_method );
2108 }
2109
2111 {
2112 return GetFoodStage().GetFoodStageName( food_stage_type );
2113 }
2114
2116 {
2117 return GetFoodStage().CanChangeToNewStage( cooking_method );
2118 }
2119
2120
2122 {
2123 if ( !source.GetFoodStage())
2124 return;
2129 }
2130
2133 {
2136 }
2137
2140 {
2141 switch (stageNew)
2142 {
2147 break;
2148
2151 break;
2152 }
2153 }
2154
2155
2156
2157
2158
2160 {
2162 }
2163
2165 {
2167
2168
2170 }
2171
2173 {
2175 {
2178 }
2179 }
2180
2181
2183 {
2185 if (player)
2186 {
2188 player.ServerReplaceItemInHandsWithNew(lambda);
2189 }
2190 else
2191 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2192 }
2193
2195 {
2197 }
2198
2200 {
2201 super.SetActions();
2202
2205 }
2206
2208 {
2209 #ifndef SERVER
2210 #ifndef NO_GUI
2212 {
2214
2217 }
2218 #endif
2219 #endif
2220 }
2221
2223 {
2224 #ifndef SERVER
2225 #ifndef NO_GUI
2227 {
2231 }
2232 #endif
2233 #endif
2234 }
2235
2237 {
2238 return false;
2239 }
2240
2242 {
2244 }
2245
2246 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2247 {
2249
2250 delta *= DayZGame.Cast(
g_Game).GetFoodDecayModifier();
2252 if ( hasRootAsPlayer )
2254
2255
2256
2257
2258
2259
2260
2262 {
2263
2265 {
2267 {
2271 break;
2272
2276 break;
2277
2281 break;
2282
2286 default:
2289 return;
2290 }
2291
2292
2293 }
2294
2296
2298 {
2300 {
2301
2303 {
2305 }
2307 {
2310 {
2312 }
2313 else
2314 {
2316 {
2318 }
2319 else
2320 {
2322 }
2323 }
2324 }
2325 }
2326 }
2327
2328 }
2330 {
2331
2333 {
2335 {
2339 break;
2340
2344 break;
2345
2349 break;
2350
2354 break;
2355
2358 default:
2361 return;
2362 }
2363 }
2364
2366
2368 {
2370 {
2371
2373 {
2375 }
2376 }
2377 }
2378 }
2380 {
2381
2383 {
2385 {
2389 break;
2390
2393 default:
2396 return;
2397 }
2398 }
2399
2401
2403 {
2405 {
2406
2408 {
2410 }
2411 }
2412 }
2413 }
2414 else
2415 {
2416
2418
2420 {
2423
2424 }
2425 else
2426 {
2428 {
2431 }
2432 }
2433 }
2434 }
2435
2437 {
2438 if (
g_Game.IsHeadlessOrDedicatedServer())
2439 return;
2440
2442 {
2444 GetInventory().GetCurrentInventoryLocation(invLoc);
2446 {
2448 if (ptcMgr)
2449 {
2454 }
2455 }
2456 }
2458 {
2460 {
2463 return;
2464 }
2465
2467 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2469 {
2472 }
2473 }
2474 }
2475
2476 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2477 {
2479 {
2484 }
2485
2486 super.GetDebugActions(outputList);
2487 }
2488
2490 {
2491 super.OnAction(action_id, player, ctx);
2492
2494 {
2495 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2496 {
2498 if (food_stage_prev <= 0)
2499 {
2501 }
2503 return true;
2504 }
2505 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2506 {
2509 {
2511 }
2513 return true;
2514 }
2515
2516 }
2517
2518 #ifdef DIAG_DEVELOPER
2519 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2520 {
2521 PrintNutritionsData();
2522 return true;
2523 }
2524 #endif
2525
2526 return false;
2527 }
2528
2530 {
2531 string debug_output;
2532
2533 debug_output = super.GetDebugText();
2534
2537
2538 return debug_output;
2539 }
2540
2541
2542
2543
2544
2546 {
2547 float ret = super.GetBaitEffectivity();
2548
2550 {
2551 ret *= 0.5;
2552 }
2553
2554 return ret;
2555 }
2556
2558 {
2560 }
2561
2563 {
2565 }
2566
2568 {
2570 }
2571
2572 #ifdef DIAG_DEVELOPER
2573 private void PrintNutritionsData()
2574 {
2575 string nutritionsData = "";
2576
2579
2581 if (profile)
2582 {
2583 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2585 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2589 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2591
2594
2595 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2597 }
2598
2599 nutritionsData += "-----\n";
2600
2602 }
2603 #endif
2604
2606
2609 {
2611 }
2612}
2613
2615{
2617};
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.