1712{
1714
1722
1732
1734
1736 {
1738 {
1740
1742 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1743
1747 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1748 }
1749 }
1750
1752 {
1754
1756 }
1757
1759 {
1760 super.EEDelete(parent);
1761
1763
1766 }
1767
1769 {
1770 super.EEItemLocationChanged(oldLoc, newLoc);
1771
1774 {
1775 switch (oldLoc.GetParent().GetType())
1776 {
1777 case "FryingPan":
1778 case "Pot":
1779 case "Cauldron":
1780 case "SharpWoodenStick":
1782 break;
1783 }
1784
1787 {
1789 }
1790 }
1791
1792 if (oldLoc.IsValid())
1794
1797 }
1798
1800 {
1803 }
1804
1806 {
1809
1810 return true;
1811 }
1812
1814 {
1816 {
1818 }
1819 }
1820
1823 {
1824 int foodStageType;
1825
1827 if (foodStage)
1828 foodStageType = foodStage.GetFoodStageType();
1829
1834
1835 return agentsIn;
1836 }
1837
1838
1840 {
1841 return false;
1842 }
1843
1845 {
1846 return false;
1847 }
1848
1850 {
1852 {
1854 {
1857
1860
1861 default:
1862 return super.GetTemperatureFreezeTime();
1863 }
1864 }
1865
1866 return super.GetTemperatureFreezeTime();
1867 }
1868
1870 {
1872 {
1874 {
1877
1880
1881 default:
1882 return super.GetTemperatureThawTime();
1883 }
1884 }
1885
1886 return super.GetTemperatureThawTime();
1887 }
1888
1890 {
1892 }
1893
1894
1895
1896
1898 {
1899 SetSynchDirty();
1900 }
1901
1903 {
1904 super.OnVariablesSynchronized();
1905
1906
1907
1908
1910 {
1912 }
1913 else
1914 {
1916 }
1917
1920 }
1921
1922
1923
1924
1926 {
1929
1931 }
1932
1934 {
1935 string soundName = "";
1936
1939
1941 {
1943 }
1944 else
1945 {
1947 {
1949 {
1954 else
1955 soundName = "";
1956 break;
1957 }
1958
1960 {
1965 else
1966 soundName = "";
1967 break;
1968 }
1969
1971 {
1976 else
1977 soundName = "";
1978 break;
1979 }
1980
1981 default:
1982 soundName = "";
1983 break;
1984 }
1985
1987 {
1988 if (soundName == "")
1989 {
1991 }
1992 else
1993 {
1995 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
1996 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
1998 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
1999 {
2001 }
2002 }
2003 }
2004 }
2005
2007 }
2008
2010 {
2013 }
2014
2015
2016
2017
2019 {
2020 super.OnStoreSave(ctx);
2021
2023 {
2025 }
2026
2027
2030 }
2031
2033 {
2034 if (!super.OnStoreLoad(ctx, version))
2035 return false;
2036
2038 {
2040 return false;
2041 }
2042
2043 if (version >= 115)
2044 {
2046 {
2048 return false;
2049 }
2051 {
2053 return false;
2054 }
2055 }
2056
2059
2060 return true;
2061 }
2062
2064 {
2065 super.AfterStoreLoad();
2066
2068 }
2069
2070
2072 {
2074 }
2075
2076
2078 {
2079 return false;
2080 }
2081
2083 {
2084 return false;
2085 }
2086
2088 {
2089 return false;
2090 }
2091
2093 {
2094 return false;
2095 }
2096
2097
2098
2099
2100
2102 {
2105 {
2106 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2107 }
2108 else if (classname != "" && food_stage)
2109 {
2110 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2111 }
2112 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2114
2115 }
2116
2118 {
2121 {
2123 }
2124 else if (classname != "" && food_stage)
2125 {
2126 return FoodStage.GetEnergy(null, food_stage, classname);
2127 }
2128 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2130 }
2131
2133 {
2136 {
2138 }
2139 else if (classname != "" && food_stage)
2140 {
2141 return FoodStage.GetWater(null, food_stage, classname);
2142 }
2143 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2145 }
2146
2148 {
2151 {
2152 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2153 }
2154 else if (classname != "" && food_stage)
2155 {
2156 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2157 }
2158 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2160
2161 }
2162
2164 {
2167 {
2168 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2169 }
2170 else if (classname != "" && food_stage)
2171 {
2172 return FoodStage.GetToxicity(null, food_stage, classname);
2173 }
2174 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2176 }
2177
2179 {
2182 {
2184 }
2185 else if (classname != "" && food_stage)
2186 {
2187 return FoodStage.GetAgents(null, food_stage, classname);
2188 }
2189 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2191 }
2192
2194 {
2197 {
2198 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2199 }
2200 else if (classname != "" && food_stage)
2201 {
2202 return FoodStage.GetDigestibility(null, food_stage, classname);
2203 }
2204 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2206 }
2207
2209 {
2212 {
2213 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2214 }
2215 else if (className != "" && foodStage)
2216 {
2217 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2218 }
2219 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2221 }
2222
2224 {
2234
2235 return profile;
2236 }
2237
2238
2239
2240
2242 {
2244 }
2245
2246
2248 {
2250 {
2252 }
2253
2254 return false;
2255 }
2256
2258 {
2260 {
2262 }
2263
2264 return false;
2265 }
2266
2268 {
2270 {
2272 }
2273
2274 return false;
2275 }
2276
2278 {
2280 {
2282 }
2283
2284 return false;
2285 }
2286
2288 {
2290 {
2292 }
2293
2294 return false;
2295 }
2296
2298 {
2300 {
2302 }
2303
2304 return false;
2305 }
2306
2307
2309 {
2311 }
2312
2314 {
2315 return GetFoodStage().GetNextFoodStageType( cooking_method );
2316 }
2317
2319 {
2320 return GetFoodStage().GetFoodStageName( food_stage_type );
2321 }
2322
2324 {
2325 return GetFoodStage().CanChangeToNewStage( cooking_method );
2326 }
2327
2328
2330 {
2331 if ( !source.GetFoodStage())
2332 return;
2337 }
2338
2341 {
2344 }
2345
2348 {
2349 switch (stageNew)
2350 {
2355 break;
2356
2359 break;
2360 }
2361 }
2362
2363
2364
2365
2366
2368 {
2370 }
2371
2373 {
2375
2376
2378 }
2379
2381 {
2383 {
2386 }
2387 }
2388
2389
2391 {
2393 if (player)
2394 {
2396 player.ServerReplaceItemInHandsWithNew(lambda);
2397 }
2398 else
2399 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2400 }
2401
2403 {
2405 }
2406
2408 {
2409 super.SetActions();
2410
2413 }
2414
2416 {
2417 #ifndef SERVER
2419 {
2421
2424 }
2425 #endif
2426 }
2427
2429 {
2430 #ifndef SERVER
2432 {
2436 }
2437 #endif
2438 }
2439
2441 {
2442 return false;
2443 }
2444
2446 {
2448 }
2449
2450 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2451 {
2453
2454 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
2456 if ( hasRootAsPlayer )
2458
2459
2460
2461
2462
2463
2464
2466 {
2467
2469 {
2471 {
2475 break;
2476
2480 break;
2481
2485 break;
2486
2490 default:
2493 return;
2494 }
2495
2496
2497 }
2498
2500
2502 {
2504 {
2505
2507 {
2509 }
2511 {
2514 {
2516 }
2517 else
2518 {
2520 {
2522 }
2523 else
2524 {
2526 }
2527 }
2528 }
2529 }
2530 }
2531
2532 }
2534 {
2535
2537 {
2539 {
2543 break;
2544
2548 break;
2549
2553 break;
2554
2558 break;
2559
2562 default:
2565 return;
2566 }
2567 }
2568
2570
2572 {
2574 {
2575
2577 {
2579 }
2580 }
2581 }
2582 }
2584 {
2585
2587 {
2589 {
2593 break;
2594
2597 default:
2600 return;
2601 }
2602 }
2603
2605
2607 {
2609 {
2610
2612 {
2614 }
2615 }
2616 }
2617 }
2618 else
2619 {
2620
2622
2624 {
2627
2628 }
2629 else
2630 {
2632 {
2635 }
2636 }
2637 }
2638 }
2639
2641 {
2642 if (
GetGame().IsDedicatedServer())
2643 return;
2644
2646 {
2648 GetInventory().GetCurrentInventoryLocation(invLoc);
2650 {
2652 if (ptcMgr)
2653 {
2658 }
2659 }
2660 }
2662 {
2664 {
2667 return;
2668 }
2669
2671 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2673 {
2676 }
2677 }
2678 }
2679
2680 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2681 {
2683 {
2688 }
2689
2690 super.GetDebugActions(outputList);
2691 }
2692
2694 {
2695 super.OnAction(action_id, player, ctx);
2696
2698 {
2699 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2700 {
2702 if (food_stage_prev <= 0)
2703 {
2705 }
2707 return true;
2708 }
2709 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2710 {
2713 {
2715 }
2717 return true;
2718 }
2719
2720 }
2721
2722 #ifdef DIAG_DEVELOPER
2723 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2724 {
2725 PrintNutritionsData();
2726 return true;
2727 }
2728 #endif
2729
2730 return false;
2731 }
2732
2734 {
2735 string debug_output;
2736
2737 debug_output = super.GetDebugText();
2738
2741
2742 return debug_output;
2743 }
2744
2745
2746
2747
2748
2750 {
2751 float ret = super.GetBaitEffectivity();
2752
2754 {
2755 ret *= 0.5;
2756 }
2757
2758 return ret;
2759 }
2760
2762 {
2764 }
2765
2767 {
2769 }
2770
2772 {
2774 }
2775
2776 #ifdef DIAG_DEVELOPER
2777 private void PrintNutritionsData()
2778 {
2779 string nutritionsData = "";
2780
2783
2785 if (profile)
2786 {
2787 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2789 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2793 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2795
2798
2799 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2801 }
2802
2803 nutritionsData += "-----\n";
2804
2806 }
2807 #endif
2808
2810
2813 {
2815 }
2816}
2817
2819{
2821};
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.