1486{
 1488 
 1496 
 1506    
 1508        
 1510    {
 1512        {
 1514            
 1516            RegisterNetSyncVariableFloat("m_FoodStage.m_CookingTime",  0, 600, 0);
 1517 
 1521            RegisterNetSyncVariableBool("m_MakeCookingSounds");
 1522        }
 1523    }
 1524    
 1526    {
 1528        
 1530    }
 1531    
 1533    {
 1534        super.EEDelete(parent);
 1535        
 1537        
 1540    }
 1541    
 1543    {
 1544        super.EEItemLocationChanged(oldLoc, newLoc);
 1545
 1548        {
 1549            switch (oldLoc.GetParent().GetType())
 1550            {
 1551                case "FryingPan":
 1552                case "Pot":
 1553                case "Cauldron":
 1554                case "SharpWoodenStick":
 1556                break;
 1557            }
 1558            
 1561            {
 1563            }
 1564        }
 1565        
 1566        if (oldLoc.IsValid())
 1568        
 1571    }
 1572 
 1574    {
 1577    }
 1578    
 1580    {
 1583 
 1584        return true;
 1585    }
 1586    
 1588    {
 1590        {
 1592        }
 1593    }
 1594    
 1597    {
 1598        int foodStageType;
 1599 
 1601        if (foodStage)
 1602            foodStageType = foodStage.GetFoodStageType();
 1603
 1608 
 1609        return agentsIn;
 1610    }
 1611    
 1612    
 1614    {
 1615        return false;
 1616    }
 1617    
 1619    {
 1620        return false;
 1621    }
 1622    
 1624    {
 1626        {
 1628            {
 1631                
 1634                
 1635                default:
 1636                    return super.GetTemperatureFreezeTime();
 1637            }
 1638        }
 1639        
 1640        return super.GetTemperatureFreezeTime();
 1641    }
 1642    
 1644    {
 1646        {
 1648            {
 1651                
 1654                
 1655                default:
 1656                    return super.GetTemperatureThawTime();
 1657            }
 1658        }
 1659        
 1660        return super.GetTemperatureThawTime();
 1661    }
 1662    
 1664    {
 1666    }
 1667    
 1668    
 1669    
 1670    
 1672    {
 1673        SetSynchDirty();
 1674    }
 1675    
 1677    {
 1678        super.OnVariablesSynchronized();
 1679        
 1680        
 1681        
 1682        
 1684        {
 1686        }
 1687        else
 1688        {
 1690        }
 1691        
 1694    }
 1695 
 1696    
 1697    
 1698    
 1700    {
 1703 
 1705    }
 1706 
 1708    {
 1709        string soundName = "";
 1710        
 1713 
 1715        {
 1717        }
 1718        else
 1719        {
 1721            {
 1723                {
 1728                    else
 1729                        soundName = "";
 1730                    break;
 1731                }
 1732                
 1734                {
 1739                    else
 1740                        soundName = "";
 1741                    break;
 1742                }
 1743                
 1745                {
 1750                    else
 1751                        soundName = "";
 1752                    break;
 1753                }
 1754                
 1755                default:
 1756                    soundName = "";
 1757                    break;
 1758            }
 1759            
 1761            {
 1762                if (soundName == "") 
 1763                {
 1765                }
 1766                else 
 1767                {
 1769                    nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null, 
GetType());
 
 1770                    float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
 1772                    if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
 1773                    {
 1775                    }
 1776                }
 1777            }
 1778        }
 1779        
 1781    }
 1782 
 1784    {
 1787    }
 1788 
 1789    
 1790    
 1791    
 1793    {   
 1794        super.OnStoreSave(ctx);
 1795 
 1797        {
 1799        }
 1800        
 1801        
 1804    }
 1805    
 1807    {
 1808        if (!super.OnStoreLoad(ctx, version))
 1809            return false;
 1810 
 1812        {
 1814                return false;
 1815        }
 1816        
 1817        if (version >= 115)
 1818        {
 1820            {
 1822                return false;
 1823            }
 1825            {
 1827                return false;
 1828            }
 1829        }
 1830        
 1833        
 1834        return true;
 1835    }
 1836    
 1838    {   
 1839        super.AfterStoreLoad();
 1840        
 1842    }   
 1843 
 1844    
 1846    {
 1848    }
 1849    
 1850    
 1852    {
 1853        return false;
 1854    }
 1855    
 1857    {
 1858        return false;
 1859    }
 1860    
 1862    {
 1863        return false;
 1864    }
 1865    
 1867    {
 1868        return false;
 1869    }   
 1870    
 1871    
 1872    
 1873    
 1874    
 1876    {
 1879        {
 1880             return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
 
 1881        }
 1882        else if (classname != "" && food_stage)
 1883        {
 1884            return FoodStage.GetFullnessIndex(null, food_stage, classname);
 1885        }
 1886        string class_path = string.Format("cfgVehicles %1 Nutrition", classname);
 1888 
 1889    }
 1890    
 1892    {
 1895        {
 1897        }
 1898        else if (classname != "" && food_stage)
 1899        {
 1900            return FoodStage.GetEnergy(null, food_stage, classname);
 1901        }
 1902        string class_path = 
string.
Format(
"cfgVehicles %1 Nutrition", classname);
 
 1904    }
 1905    
 1907    {
 1910        {
 1912        }
 1913        else if (classname != "" && food_stage)
 1914        {
 1915            return FoodStage.GetWater(null, food_stage, classname);
 1916        }
 1917        string class_path = 
string.
Format(
"cfgVehicles %1 Nutrition", classname);
 
 1919    }
 1920    
 1922    {
 1925        {
 1926            return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage()); 
 
 1927        }
 1928        else if (classname != "" && food_stage)
 1929        {
 1930            return FoodStage.GetNutritionalIndex(null, food_stage, classname);
 1931        }
 1932        string class_path = 
string.
Format(
"cfgVehicles %1 Nutrition", classname);
 
 1934        
 1935    }
 1936    
 1938    {
 1941        {
 1942            return FoodStage.GetToxicity(food_item.
GetFoodStage());
 
 1943        }
 1944        else if (classname != "" && food_stage)
 1945        {
 1946            return FoodStage.GetToxicity(null, food_stage, classname);
 1947        }
 1948        string class_path = 
string.
Format(
"cfgVehicles %1 Nutrition", classname);
 
 1950    }
 1951    
 1953    {
 1956        {
 1958        }
 1959        else if (classname != "" && food_stage)
 1960        {
 1961            return FoodStage.GetAgents(null, food_stage, classname);
 1962        }
 1963        string class_path = 
string.
Format(
"cfgVehicles %1 Nutrition", classname);
 
 1965    }
 1966    
 1968    {
 1971        {
 1972            return FoodStage.GetDigestibility(food_item.
GetFoodStage());
 
 1973        }
 1974        else if (classname != "" && food_stage)
 1975        {
 1976            return FoodStage.GetDigestibility(null, food_stage, classname);
 1977        }
 1978        string class_path = 
string.
Format(
"cfgVehicles %1 Nutrition", classname);
 
 1980    }
 1981    
 1983    {
 1986        {
 1987            return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
 
 1988        }
 1989        else if (className != "" && foodStage)
 1990        {
 1991            return FoodStage.GetAgentsPerDigest(null, foodStage, className);
 1992        }
 1993        string classPath = string.Format("cfgVehicles %1 Nutrition", className);
 1995    }
 1996    
 1998    {
 2008        
 2009        return profile;
 2010    }
 2011    
 2012    
 2013    
 2014    
 2016    {
 2018    }
 2019    
 2020    
 2022    {
 2024        {
 2026        }
 2027        
 2028        return false;
 2029    }
 2030 
 2032    {
 2034        {
 2036        }
 2037        
 2038        return false;
 2039    }
 2040    
 2042    {
 2044        {
 2046        }
 2047        
 2048        return false;
 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    
 2081    
 2083    {
 2085    }
 2086    
 2088    {
 2089        return GetFoodStage().GetNextFoodStageType( cooking_method );
 
 2090    }
 2091    
 2093    {
 2094        return GetFoodStage().GetFoodStageName( food_stage_type );
 
 2095    }
 2096    
 2098    {
 2099        return GetFoodStage().CanChangeToNewStage( cooking_method );
 
 2100    }
 2101    
 2102    
 2104    {
 2105        if ( !source.GetFoodStage())
 2106            return;
 2111    }
 2112    
 2115    {
 2118    }
 2119    
 2122    {
 2123        switch (stageNew)
 2124        {
 2129            break;
 2130            
 2133            break;
 2134        }
 2135    }
 2136    
 2137    
 2138    
 2139    
 2140    
 2142    {
 2144    }
 2145    
 2147    {
 2149        
 2150        
 2152    }
 2153    
 2155    {
 2157        {
 2160        }
 2161    }
 2162    
 2163    
 2165    {
 2167        if (player)
 2168        {
 2170            player.ServerReplaceItemInHandsWithNew(lambda);
 2171        }
 2172        else
 2173            Error(
"ReplaceEdibleWithNew - cannot use edible without player");
 
 2174    }
 2175    
 2177    {
 2179    }
 2180 
 2182    {
 2183        super.SetActions();
 2184 
 2187    }
 2188 
 2190    {
 2191        #ifndef SERVER
 2193        {
 2195 
 2198        }
 2199        #endif
 2200    }
 2201 
 2203    {
 2204        #ifndef SERVER
 2206        {
 2210        }
 2211        #endif
 2212    }
 2213    
 2215    {
 2216        return false;
 2217    }
 2218    
 2220    {
 2222    }
 2223    
 2224    override void ProcessDecay( 
float delta, 
bool hasRootAsPlayer )
 
 2225    {
 2227        
 2228        delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
 
 2230        if ( hasRootAsPlayer )
 2232        
 2233        
 2234
 2235
 2236
 2237
 2238        
 2240        {
 2241            
 2243            {
 2245                {
 2249                        break;
 2250                    
 2254                        break;
 2255                    
 2259                        break;
 2260                    
 2264                    default:
 2267                        return;
 2268                }
 2269                
 2270                
 2271            }
 2272            
 2274                        
 2276            {
 2278                {
 2279                    
 2281                    {
 2283                    } 
 2285                    {
 2288                        {
 2290                        }
 2291                        else
 2292                        {
 2294                            {
 2296                            }
 2297                            else
 2298                            {
 2300                            }
 2301                        }
 2302                    }
 2303                }
 2304            }
 2305 
 2306        }
 2308        {
 2309            
 2311            {
 2313                {
 2317                        break;
 2318                    
 2322                        break;
 2323                    
 2327                        break;
 2328                    
 2332                        break;
 2333 
 2336                    default:
 2339                        return;
 2340                }
 2341            }
 2342            
 2344            
 2346            {
 2348                {
 2349                    
 2351                    {
 2353                    }
 2354                }
 2355            }
 2356        }
 2358        {
 2359            
 2361            {
 2363                {
 2367                        break;
 2368 
 2371                    default:
 2374                        return;
 2375                }
 2376            }
 2377            
 2379            
 2381            {
 2383                {
 2384                    
 2386                    {
 2388                    }
 2389                }
 2390            }
 2391        }
 2392        else
 2393        {
 2394            
 2396 
 2398            {
 2401                
 2402            }
 2403            else
 2404            {
 2406                {
 2409                }
 2410            }
 2411        }
 2412    }
 2413    
 2415    {
 2416        if (
GetGame().IsDedicatedServer())
 
 2417            return;
 2418        
 2420        {
 2422            GetInventory().GetCurrentInventoryLocation(invLoc);
 2424            {
 2426                if (ptcMgr)
 2427                {
 2432                }
 2433            }
 2434        }   
 2436        {
 2438            {
 2441                return;
 2442            }
 2443            
 2445            GetInventory().GetCurrentInventoryLocation(inventoryLoc);
 2447            {
 2450            }
 2451        }
 2452    }
 2453    
 2454    override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
 
 2455    {
 2457        {
 2462        }
 2463 
 2464        super.GetDebugActions(outputList);
 2465    }
 2466    
 2468    {
 2469        super.OnAction(action_id, player, ctx);
 2470        
 2472        {
 2473            if ( action_id == 
EActions.FOOD_STAGE_PREV )
 
 2474            {
 2476                if (food_stage_prev <= 0)
 2477                {
 2479                }
 2481                return true;
 2482            }
 2483            else if ( action_id == 
EActions.FOOD_STAGE_NEXT )
 
 2484            {
 2487                {
 2489                }
 2491                return true;
 2492            }
 2493            
 2494        }
 2495        
 2496        #ifdef DIAG_DEVELOPER
 2497        if (action_id == 
EActions.FOOD_NUTRITIONS_DATA)
 
 2498        {
 2499            PrintNutritionsData();
 2500            return true;
 2501        }
 2502        #endif
 2503 
 2504        return false;
 2505    }
 2506    
 2508    {
 2509        string debug_output;
 2510 
 2511        debug_output = super.GetDebugText();
 2512        
 2515 
 2516        return debug_output;
 2517    }
 2518 
 2519    
 2520    
 2521    
 2522    
 2524    {
 2525        float ret = super.GetBaitEffectivity();
 2526        
 2528        {
 2529            ret *= 0.5;
 2530        }
 2531        
 2532        return ret;
 2533    }
 2534    
 2536    {
 2538    }
 2539    
 2541    {
 2543    }
 2544    
 2546    {
 2548    }
 2549    
 2550    #ifdef DIAG_DEVELOPER
 2551    private void PrintNutritionsData()
 2552    {
 2553        string nutritionsData   = "";
 2554        
 2557 
 2559        if (profile)
 2560        {
 2561            nutritionsData = 
string.
Format(
"Item: %1\n\n", 
this);
 
 2563            nutritionsData += 
string.
Format(
"Energy: %1\n", profile.
m_Energy);
 
 2567            nutritionsData += 
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
 
 2569 
 2572            
 2573            nutritionsData += 
string.
Format(
"Agents: %1\n", profile.
m_Agents);
 
 2575        }
 2576        
 2577        nutritionsData += "-----\n";
 2578        
 2580    }
 2581    #endif
 2582    
 2584    
 2587    {
 2589    }
 2590}
 2591 
 2593{
 2595};
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.