1818{
1820
1828
1838
1840
1842 {
1844 {
1846
1848 RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime", 0, 600, 0);
1849
1853 RegisterNetSyncVariableBool("m_MakeCookingSounds");
1854 }
1855 }
1856
1858 {
1860
1862 }
1863
1865 {
1866 super.EEDelete(parent);
1867
1869
1872 }
1873
1875 {
1876 super.EEItemLocationChanged(oldLoc, newLoc);
1877
1880 {
1881 switch (oldLoc.GetParent().GetType())
1882 {
1883 case "FryingPan":
1884 case "Pot":
1885 case "Cauldron":
1886 case "SharpWoodenStick":
1888 break;
1889 }
1890
1893 {
1895 }
1896 }
1897
1898 if (oldLoc.IsValid())
1900
1903 }
1904
1906 {
1909 }
1910
1912 {
1915
1916 return true;
1917 }
1918
1920 {
1922 {
1924 }
1925 }
1926
1929 {
1930 int foodStageType;
1931
1933 if (foodStage)
1934 foodStageType = foodStage.GetFoodStageType();
1935
1940
1941 return agentsIn;
1942 }
1943
1944
1946 {
1947 return false;
1948 }
1949
1951 {
1952 return false;
1953 }
1954
1956 {
1958 {
1960 {
1963
1966
1967 default:
1968 return super.GetTemperatureFreezeTime();
1969 }
1970 }
1971
1972 return super.GetTemperatureFreezeTime();
1973 }
1974
1976 {
1978 {
1980 {
1983
1986
1987 default:
1988 return super.GetTemperatureThawTime();
1989 }
1990 }
1991
1992 return super.GetTemperatureThawTime();
1993 }
1994
1996 {
1998 }
1999
2000
2001
2002
2004 {
2005 SetSynchDirty();
2006 }
2007
2009 {
2010 super.OnVariablesSynchronized();
2011
2012
2013
2014
2016 {
2018 }
2019 else
2020 {
2022 }
2023
2026 }
2027
2028
2029
2030
2032 {
2035
2037 }
2038
2040 {
2041 string soundName = "";
2042
2045
2047 {
2049 }
2050 else
2051 {
2053 {
2055 {
2060 else
2061 soundName = "";
2062 break;
2063 }
2064
2066 {
2071 else
2072 soundName = "";
2073 break;
2074 }
2075
2077 {
2082 else
2083 soundName = "";
2084 break;
2085 }
2086
2087 default:
2088 soundName = "";
2089 break;
2090 }
2091
2093 {
2094 if (soundName == "")
2095 {
2097 }
2098 else
2099 {
2101 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
2102 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
2104 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
2105 {
2107 }
2108 }
2109 }
2110 }
2111
2113 }
2114
2116 {
2119 }
2120
2121
2122
2123
2125 {
2126 super.OnStoreSave(ctx);
2127
2129 {
2131 }
2132
2133
2136 }
2137
2139 {
2140 if (!super.OnStoreLoad(ctx, version))
2141 return false;
2142
2144 {
2146 return false;
2147 }
2148
2149 if (version >= 115)
2150 {
2152 {
2154 return false;
2155 }
2157 {
2159 return false;
2160 }
2161 }
2162
2165
2166 return true;
2167 }
2168
2170 {
2171 super.AfterStoreLoad();
2172
2174 }
2175
2176
2178 {
2180 }
2181
2182
2184 {
2185 return false;
2186 }
2187
2189 {
2190 return false;
2191 }
2192
2194 {
2195 return false;
2196 }
2197
2199 {
2200 return false;
2201 }
2202
2203
2204
2205
2206
2208 {
2211 {
2212 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
2213 }
2214 else if (classname != "" && food_stage)
2215 {
2216 return FoodStage.GetFullnessIndex(null, food_stage, classname);
2217 }
2218 string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
2219 return g_Game.ConfigGetFloat( class_path +
" fullnessIndex" );
2220
2221 }
2222
2224 {
2227 {
2229 }
2230 else if (classname != "" && food_stage)
2231 {
2232 return FoodStage.GetEnergy(null, food_stage, classname);
2233 }
2234 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2235 return g_Game.ConfigGetFloat( class_path +
" energy" );
2236 }
2237
2239 {
2242 {
2244 }
2245 else if (classname != "" && food_stage)
2246 {
2247 return FoodStage.GetWater(null, food_stage, classname);
2248 }
2249 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2250 return g_Game.ConfigGetFloat( class_path +
" water" );
2251 }
2252
2254 {
2257 {
2258 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
2259 }
2260 else if (classname != "" && food_stage)
2261 {
2262 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
2263 }
2264 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2265 return g_Game.ConfigGetFloat( class_path +
" nutritionalIndex" );
2266
2267 }
2268
2270 {
2273 {
2274 return FoodStage.GetToxicity(food_item.
GetFoodStage());
2275 }
2276 else if (classname != "" && food_stage)
2277 {
2278 return FoodStage.GetToxicity(null, food_stage, classname);
2279 }
2280 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2281 return g_Game.ConfigGetFloat( class_path +
" toxicity" );
2282 }
2283
2285 {
2288 {
2290 }
2291 else if (classname != "" && food_stage)
2292 {
2293 return FoodStage.GetAgents(null, food_stage, classname);
2294 }
2295 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2296 return g_Game.ConfigGetInt( class_path +
" agents" );
2297 }
2298
2300 {
2303 {
2304 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
2305 }
2306 else if (classname != "" && food_stage)
2307 {
2308 return FoodStage.GetDigestibility(null, food_stage, classname);
2309 }
2310 string class_path =
string.
Format(
"cfgVehicles %1 Nutrition", classname);
2311 return g_Game.ConfigGetInt( class_path +
" digestibility" );
2312 }
2313
2315 {
2318 {
2319 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
2320 }
2321 else if (className != "" && foodStage)
2322 {
2323 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
2324 }
2325 string classPath = string.Format("cfgVehicles %1 Nutrition", className);
2326 return g_Game.ConfigGetInt(classPath +
" agentsPerDigest");
2327 }
2328
2330 {
2340
2341 return profile;
2342 }
2343
2344
2345
2346
2348 {
2350 }
2351
2352
2354 {
2356 {
2358 }
2359
2360 return false;
2361 }
2362
2364 {
2366 {
2368 }
2369
2370 return false;
2371 }
2372
2374 {
2376 {
2378 }
2379
2380 return false;
2381 }
2382
2384 {
2386 {
2388 }
2389
2390 return false;
2391 }
2392
2394 {
2396 {
2398 }
2399
2400 return false;
2401 }
2402
2404 {
2406 {
2408 }
2409
2410 return false;
2411 }
2412
2413
2415 {
2417 }
2418
2420 {
2421 return GetFoodStage().GetNextFoodStageType( cooking_method );
2422 }
2423
2425 {
2426 return GetFoodStage().GetFoodStageName( food_stage_type );
2427 }
2428
2430 {
2431 return GetFoodStage().CanChangeToNewStage( cooking_method );
2432 }
2433
2434
2436 {
2437 if ( !source.GetFoodStage())
2438 return;
2443 }
2444
2447 {
2450 }
2451
2454 {
2455 switch (stageNew)
2456 {
2461 break;
2462
2465 break;
2466 }
2467 }
2468
2469
2470
2471
2472
2474 {
2476 }
2477
2479 {
2481
2482
2484 }
2485
2487 {
2489 {
2492 }
2493 }
2494
2495
2497 {
2499 if (player)
2500 {
2502 player.ServerReplaceItemInHandsWithNew(lambda);
2503 }
2504 else
2505 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
2506 }
2507
2509 {
2511 }
2512
2514 {
2515 super.SetActions();
2516
2519 }
2520
2522 {
2523 #ifndef SERVER
2524 #ifndef NO_GUI
2526 {
2528
2531 }
2532 #endif
2533 #endif
2534 }
2535
2537 {
2538 #ifndef SERVER
2539 #ifndef NO_GUI
2541 {
2545 }
2546 #endif
2547 #endif
2548 }
2549
2551 {
2552 return false;
2553 }
2554
2556 {
2558 }
2559
2560 override void ProcessDecay(
float delta,
bool hasRootAsPlayer )
2561 {
2563
2564 delta *= DayZGame.Cast(
g_Game).GetFoodDecayModifier();
2566 if ( hasRootAsPlayer )
2568
2569
2570
2571
2572
2573
2574
2576 {
2577
2579 {
2581 {
2585 break;
2586
2590 break;
2591
2595 break;
2596
2600 default:
2603 return;
2604 }
2605
2606
2607 }
2608
2610
2612 {
2614 {
2615
2617 {
2619 }
2621 {
2624 {
2626 }
2627 else
2628 {
2630 {
2632 }
2633 else
2634 {
2636 }
2637 }
2638 }
2639 }
2640 }
2641
2642 }
2644 {
2645
2647 {
2649 {
2653 break;
2654
2658 break;
2659
2663 break;
2664
2668 break;
2669
2672 default:
2675 return;
2676 }
2677 }
2678
2680
2682 {
2684 {
2685
2687 {
2689 }
2690 }
2691 }
2692 }
2694 {
2695
2697 {
2699 {
2703 break;
2704
2707 default:
2710 return;
2711 }
2712 }
2713
2715
2717 {
2719 {
2720
2722 {
2724 }
2725 }
2726 }
2727 }
2728 else
2729 {
2730
2732
2734 {
2737
2738 }
2739 else
2740 {
2742 {
2745 }
2746 }
2747 }
2748 }
2749
2751 {
2752 if (
g_Game.IsHeadlessOrDedicatedServer())
2753 return;
2754
2756 {
2758 GetInventory().GetCurrentInventoryLocation(invLoc);
2760 {
2762 if (ptcMgr)
2763 {
2768 }
2769 }
2770 }
2772 {
2774 {
2777 return;
2778 }
2779
2781 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
2783 {
2786 }
2787 }
2788 }
2789
2790 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2791 {
2793 {
2798 }
2799
2800 super.GetDebugActions(outputList);
2801 }
2802
2804 {
2805 super.OnAction(action_id, player, ctx);
2806
2808 {
2809 if ( action_id ==
EActions.FOOD_STAGE_PREV )
2810 {
2812 if (food_stage_prev <= 0)
2813 {
2815 }
2817 return true;
2818 }
2819 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
2820 {
2823 {
2825 }
2827 return true;
2828 }
2829
2830 }
2831
2832 #ifdef DIAG_DEVELOPER
2833 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
2834 {
2835 PrintNutritionsData();
2836 return true;
2837 }
2838 #endif
2839
2840 return false;
2841 }
2842
2844 {
2845 string debug_output;
2846
2847 debug_output = super.GetDebugText();
2848
2851
2852 return debug_output;
2853 }
2854
2855
2856
2857
2858
2860 {
2861 float ret = super.GetBaitEffectivity();
2862
2864 {
2865 ret *= 0.5;
2866 }
2867
2868 return ret;
2869 }
2870
2872 {
2874 }
2875
2877 {
2879 }
2880
2882 {
2884 }
2885
2886 #ifdef DIAG_DEVELOPER
2887 private void PrintNutritionsData()
2888 {
2889 string nutritionsData = "";
2890
2893
2895 if (profile)
2896 {
2897 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
2899 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
2903 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
2905
2908
2909 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
2911 }
2912
2913 nutritionsData += "-----\n";
2914
2916 }
2917 #endif
2918
2920
2923 {
2925 }
2926}
2927
2929{
2931};
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.