1516{
1518
1526
1536
1538
1540 {
1542 {
1544
1546 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1547
1551 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1552 }
1553 }
1554
1556 {
1558
1560 }
1561
1563 {
1564 super.EEDelete(parent);
1565
1567
1570 }
1571
1573 {
1574 super.EEItemLocationChanged(oldLoc, newLoc);
1575
1578 {
1579 switch (oldLoc.GetParent().GetType())
1580 {
1581 case "FryingPan":
1582 case "Pot":
1583 case "Cauldron":
1584 case "SharpWoodenStick":
1586 break;
1587 }
1588
1591 {
1593 }
1594 }
1595
1596 if (oldLoc.IsValid())
1598
1601 }
1602
1604 {
1607 }
1608
1610 {
1613
1614 return true;
1615 }
1616
1618 {
1620 {
1622 }
1623 }
1624
1627 {
1628 int foodStageType;
1629
1631 if (foodStage)
1632 foodStageType = foodStage.GetFoodStageType();
1633
1638
1639 return agentsIn;
1640 }
1641
1642
1644 {
1645 return false;
1646 }
1647
1649 {
1650 return false;
1651 }
1652
1654 {
1656 {
1658 {
1661
1664
1665 default:
1666 return super.GetTemperatureFreezeTime();
1667 }
1668 }
1669
1670 return super.GetTemperatureFreezeTime();
1671 }
1672
1674 {
1676 {
1678 {
1681
1684
1685 default:
1686 return super.GetTemperatureThawTime();
1687 }
1688 }
1689
1690 return super.GetTemperatureThawTime();
1691 }
1692
1694 {
1696 }
1697
1698
1699
1700
1702 {
1703 SetSynchDirty();
1704 }
1705
1707 {
1708 super.OnVariablesSynchronized();
1709
1710
1711
1712
1714 {
1716 }
1717 else
1718 {
1720 }
1721
1724 }
1725
1726
1727
1728
1730 {
1733
1735 }
1736
1738 {
1739 string soundName = "";
1740
1743
1745 {
1747 }
1748 else
1749 {
1751 {
1753 {
1758 else
1759 soundName = "";
1760 break;
1761 }
1762
1764 {
1769 else
1770 soundName = "";
1771 break;
1772 }
1773
1775 {
1780 else
1781 soundName = "";
1782 break;
1783 }
1784
1785 default:
1786 soundName = "";
1787 break;
1788 }
1789
1791 {
1792 if (soundName == "")
1793 {
1795 }
1796 else
1797 {
1799 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1800 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1802 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1803 {
1805 }
1806 }
1807 }
1808 }
1809
1811 }
1812
1814 {
1817 }
1818
1819
1820
1821
1823 {
1824 super.OnStoreSave(ctx);
1825
1827 {
1829 }
1830
1831
1834 }
1835
1837 {
1838 if (!super.OnStoreLoad(ctx, version))
1839 return false;
1840
1842 {
1844 return false;
1845 }
1846
1847 if (version >= 115)
1848 {
1850 {
1852 return false;
1853 }
1855 {
1857 return false;
1858 }
1859 }
1860
1863
1864 return true;
1865 }
1866
1868 {
1869 super.AfterStoreLoad();
1870
1872 }
1873
1874
1876 {
1878 }
1879
1880
1882 {
1883 return false;
1884 }
1885
1887 {
1888 return false;
1889 }
1890
1892 {
1893 return false;
1894 }
1895
1897 {
1898 return false;
1899 }
1900
1901
1902
1903
1904
1906 {
1909 {
1910 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
1911 }
1912 else if (classname != "" && food_stage)
1913 {
1914 return FoodStage.GetFullnessIndex(null, food_stage, classname);
1915 }
1916 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
1918
1919 }
1920
1922 {
1925 {
1927 }
1928 else if (classname != "" && food_stage)
1929 {
1930 return FoodStage.GetEnergy(null, food_stage, classname);
1931 }
1932 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1934 }
1935
1937 {
1940 {
1942 }
1943 else if (classname != "" && food_stage)
1944 {
1945 return FoodStage.GetWater(null, food_stage, classname);
1946 }
1947 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1949 }
1950
1952 {
1955 {
1956 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
1957 }
1958 else if (classname != "" && food_stage)
1959 {
1960 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
1961 }
1962 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1964
1965 }
1966
1968 {
1971 {
1972 return FoodStage.GetToxicity(food_item.
GetFoodStage());
1973 }
1974 else if (classname != "" && food_stage)
1975 {
1976 return FoodStage.GetToxicity(null, food_stage, classname);
1977 }
1978 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1980 }
1981
1983 {
1986 {
1988 }
1989 else if (classname != "" && food_stage)
1990 {
1991 return FoodStage.GetAgents(null, food_stage, classname);
1992 }
1993 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
1995 }
1996
1998 {
2001 {
2002 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2003 }
2004 else if (classname != "" && food_stage)
2005 {
2006 return FoodStage.GetDigestibility(null, food_stage, classname);
2007 }
2008 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2010 }
2011
2013 {
2016 {
2017 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2018 }
2019 else if (className != "" && foodStage)
2020 {
2021 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2022 }
2023 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2025 }
2026
2028 {
2038
2039 return profile;
2040 }
2041
2042
2043
2044
2046 {
2048 }
2049
2050
2052 {
2054 {
2056 }
2057
2058 return false;
2059 }
2060
2062 {
2064 {
2066 }
2067
2068 return false;
2069 }
2070
2072 {
2074 {
2076 }
2077
2078 return false;
2079 }
2080
2082 {
2084 {
2086 }
2087
2088 return false;
2089 }
2090
2092 {
2094 {
2096 }
2097
2098 return false;
2099 }
2100
2102 {
2104 {
2106 }
2107
2108 return false;
2109 }
2110
2111
2113 {
2115 }
2116
2118 {
2119 return GetFoodStage().GetNextFoodStageType( cooking_method );
2120 }
2121
2123 {
2124 return GetFoodStage().GetFoodStageName( food_stage_type );
2125 }
2126
2128 {
2129 return GetFoodStage().CanChangeToNewStage( cooking_method );
2130 }
2131
2132
2134 {
2135 if ( !source.GetFoodStage())
2136 return;
2141 }
2142
2145 {
2148 }
2149
2152 {
2153 switch (stageNew)
2154 {
2159 break;
2160
2163 break;
2164 }
2165 }
2166
2167
2168
2169
2170
2172 {
2174 }
2175
2177 {
2179
2180
2182 }
2183
2185 {
2187 {
2190 }
2191 }
2192
2193
2195 {
2197 if (player)
2198 {
2200 player.ServerReplaceItemInHandsWithNew(lambda);
2201 }
2202 else
2203 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2204 }
2205
2207 {
2209 }
2210
2212 {
2213 super.SetActions();
2214
2217 }
2218
2220 {
2221 #ifndef SERVER
2223 {
2225
2228 }
2229 #endif
2230 }
2231
2233 {
2234 #ifndef SERVER
2236 {
2240 }
2241 #endif
2242 }
2243
2245 {
2246 return false;
2247 }
2248
2250 {
2252 }
2253
2254 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2255 {
2257
2258 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2260 if ( hasRootAsPlayer )
2262
2263
2264
2265
2266
2267
2268
2270 {
2271
2273 {
2275 {
2279 break;
2280
2284 break;
2285
2289 break;
2290
2294 default:
2297 return;
2298 }
2299
2300
2301 }
2302
2304
2306 {
2308 {
2309
2311 {
2313 }
2315 {
2318 {
2320 }
2321 else
2322 {
2324 {
2326 }
2327 else
2328 {
2330 }
2331 }
2332 }
2333 }
2334 }
2335
2336 }
2338 {
2339
2341 {
2343 {
2347 break;
2348
2352 break;
2353
2357 break;
2358
2362 break;
2363
2366 default:
2369 return;
2370 }
2371 }
2372
2374
2376 {
2378 {
2379
2381 {
2383 }
2384 }
2385 }
2386 }
2388 {
2389
2391 {
2393 {
2397 break;
2398
2401 default:
2404 return;
2405 }
2406 }
2407
2409
2411 {
2413 {
2414
2416 {
2418 }
2419 }
2420 }
2421 }
2422 else
2423 {
2424
2426
2428 {
2431
2432 }
2433 else
2434 {
2436 {
2439 }
2440 }
2441 }
2442 }
2443
2445 {
2446 if (
GetGame().IsDedicatedServer())
2447 return;
2448
2450 {
2452 GetInventory().GetCurrentInventoryLocation(invLoc);
2454 {
2456 if (ptcMgr)
2457 {
2462 }
2463 }
2464 }
2466 {
2468 {
2471 return;
2472 }
2473
2475 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2477 {
2480 }
2481 }
2482 }
2483
2484 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2485 {
2487 {
2492 }
2493
2494 super.GetDebugActions(outputList);
2495 }
2496
2498 {
2499 super.OnAction(action_id, player, ctx);
2500
2502 {
2503 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2504 {
2506 if (food_stage_prev <= 0)
2507 {
2509 }
2511 return true;
2512 }
2513 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2514 {
2517 {
2519 }
2521 return true;
2522 }
2523
2524 }
2525
2526 #ifdef DIAG_DEVELOPER
2527 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2528 {
2529 PrintNutritionsData();
2530 return true;
2531 }
2532 #endif
2533
2534 return false;
2535 }
2536
2538 {
2539 string debug_output;
2540
2541 debug_output = super.GetDebugText();
2542
2545
2546 return debug_output;
2547 }
2548
2549
2550
2551
2552
2554 {
2555 float ret = super.GetBaitEffectivity();
2556
2558 {
2559 ret *= 0.5;
2560 }
2561
2562 return ret;
2563 }
2564
2566 {
2568 }
2569
2571 {
2573 }
2574
2576 {
2578 }
2579
2580 #ifdef DIAG_DEVELOPER
2581 private void PrintNutritionsData()
2582 {
2583 string nutritionsData = "";
2584
2587
2589 if (profile)
2590 {
2591 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2593 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2597 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2599
2602
2603 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2605 }
2606
2607 nutritionsData += "-----\n";
2608
2610 }
2611 #endif
2612
2614
2617 {
2619 }
2620}
2621
2623{
2625};
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.