26 RegisterNetSyncVariableInt(
"m_FoodStage.m_SelectionIndex", 0, 6 );
27 RegisterNetSyncVariableInt(
"m_FoodStage.m_TextureIndex", 0, 6 );
28 RegisterNetSyncVariableInt(
"m_FoodStage.m_MaterialIndex", 0, 6 );
29 RegisterNetSyncVariableFloat(
"m_FoodStage.m_CookingTime", 0, 600, 0 );
32 RegisterNetSyncVariableBool(
"m_MakeCookingSounds");
46 super.EEDelete( parent );
54 super.EEItemLocationChanged(oldLoc, newLoc);
59 switch (oldLoc.GetParent().GetType())
64 case "SharpWoodenStick":
120 super.OnVariablesSynchronized();
180 super.OnStoreSave( ctx );
194 if ( !super.OnStoreLoad( ctx, version ) )
203 if ( version >= 115 )
222 super.AfterStoreLoad();
262 if (food_item && food_item.GetFoodStage())
264 return FoodStage.GetFullnessIndex(food_item.GetFoodStage());
266 else if (classname !=
"" && food_stage)
268 return FoodStage.GetFullnessIndex(null, food_stage, classname);
270 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
278 if (food_item && food_item.GetFoodStage())
280 return FoodStage.GetEnergy(food_item.GetFoodStage());
282 else if (classname !=
"" && food_stage)
284 return FoodStage.GetEnergy(null, food_stage, classname);
286 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
293 if (food_item && food_item.GetFoodStage())
295 return FoodStage.GetWater(food_item.GetFoodStage());
297 else if (classname !=
"" && food_stage)
299 return FoodStage.GetWater(null, food_stage, classname);
301 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
308 if (food_item && food_item.GetFoodStage())
310 return FoodStage.GetNutritionalIndex(food_item.GetFoodStage());
312 else if (classname !=
"" && food_stage)
314 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
316 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
324 if (food_item && food_item.GetFoodStage())
326 return FoodStage.GetToxicity(food_item.GetFoodStage());
328 else if (classname !=
"" && food_stage)
330 return FoodStage.GetToxicity(null, food_stage, classname);
332 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
339 if (food_item && food_item.GetFoodStage())
341 return FoodStage.GetAgents(food_item.GetFoodStage());
343 else if (classname !=
"" && food_stage)
345 return FoodStage.GetAgents(null, food_stage, classname);
347 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
354 if (food_item && food_item.GetFoodStage())
356 return FoodStage.GetDigestibility(food_item.GetFoodStage());
358 else if (classname !=
"" && food_stage)
360 return FoodStage.GetDigestibility(null, food_stage, classname);
362 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
368 return new NutritionalProfile(
GetFoodEnergy(item, classname, food_stage),
GetFoodWater(item, classname, food_stage),
GetFoodNutritionalIndex(item, classname, food_stage),
GetFoodTotalVolume(item, classname, food_stage),
GetFoodToxicity(item, classname, food_stage),
GetFoodAgents(item, classname,food_stage),
GetFoodDigestibility(item, classname,food_stage));
448 return GetFoodStage().GetNextFoodStageType( cooking_method );
453 return GetFoodStage().GetFoodStageName( food_stage_type );
458 return GetFoodStage().CanChangeToNewStage( cooking_method );
464 if ( !source.HasFoodStage())
496 player.ServerReplaceItemInHandsWithNew(lambda);
499 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
552 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
554 if ( hasRootAsPlayer )
742 super.GetDebugActions(outputList);
753 super.OnAction(action_id, player, ctx);
757 if ( action_id ==
EActions.FOOD_STAGE_PREV )
760 if (food_stage_prev <= 0)
767 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
AttachActionData ActionData ActionAttach()
Param4< int, int, string, int > TSelectableActionInfoWithColor
void AddAction(typename actionName)
ref FoodStage m_FoodStage
protected void SoundCookingStop()
static float GetFoodDigestibility(ItemBase item, string classname="", int food_stage=0)
static float GetFoodTotalVolume(ItemBase item, string classname="", int food_stage=0)
protected bool m_MakeCookingSounds
const string SOUND_BURNING_DONE
FoodStageType GetFoodStageType()
const string DIRECT_COOKING_SLOT_NAME
bool CanChangeToNewStage(CookingMethodType cooking_method)
override bool IsMushroom()
const string SOUND_BAKING_DONE
static float GetFoodEnergy(ItemBase item, string classname="", int food_stage=0)
protected FoodStageType m_LastDecayStage
static float GetFoodToxicity(ItemBase item, string classname="", int food_stage=0)
void MakeSoundsOnClient(bool soundstate)
protected float m_DecayTimer
static float GetFoodWater(ItemBase item, string classname="", int food_stage=0)
const string SOUND_BAKING_START
static float GetFoodNutritionalIndex(ItemBase item, string classname="", int food_stage=0)
static int GetFoodAgents(ItemBase item, string classname="", int food_stage=0)
protected EffectSound m_SoundEffectCooking
DEPRECATED.
protected void RemoveAudio()
class Edible_Base extends ItemBase ReplaceEdibleWithNewLambda(EntityAI old_item, string new_item_type, PlayerBase player)
protected void RefreshAudio()
void ChangeFoodStage(FoodStageType new_food_stage_type)
protected string m_SoundPlaying
protected void SoundCookingStart(string sound_name)
protected float m_DecayDelta
InventoryLocationType
types of Inventory Location
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...
bool OnStoreLoad(ParamsReadContext ctx, int version)
class JsonUndergroundAreaTriggerData GetPosition
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.
override void OnConsume(float amount, PlayerBase consumer)
Wrapper class for managing sound through SEffectManager.
override void Stop()
Stops sound.
provides access to slot configuration
static proto native owned string GetSlotName(int id)
converts slot_id to string
ref FoodStage m_FoodStage
protected void SoundCookingStop()
static float GetFoodDigestibility(ItemBase item, string classname="", int food_stage=0)
static float GetFoodTotalVolume(ItemBase item, string classname="", int food_stage=0)
void SetCookingTime(float time)
protected bool m_MakeCookingSounds
string GetFoodStageName(FoodStageType food_stage_type)
override void OnStoreSave(ParamsWriteContext ctx)
FoodStageType GetFoodStageType()
override bool CanBeCookedOnStick()
override bool CanBeCooked()
static NutritionalProfile GetNutritionalProfile(ItemBase item, string classname="", int food_stage=0)
bool Consume(float amount, PlayerBase consumer)
bool CanChangeToNewStage(CookingMethodType cooking_method)
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override bool IsMushroom()
static float GetFoodEnergy(ItemBase item, string classname="", int food_stage=0)
void TransferFoodStage(notnull Edible_Base source)
void ReplaceEdibleWithNew(string typeName)
static float GetFoodToxicity(ItemBase item, string classname="", int food_stage=0)
override bool CanProcessDecay()
override void EEDelete(EntityAI parent)
FoodStageType GetLastDecayStage()
override void AfterStoreLoad()
void OnConsume(float amount, PlayerBase consumer)
FoodStageType GetNextFoodStageType(CookingMethodType cooking_method)
void MakeSoundsOnClient(bool soundstate)
protected float m_DecayTimer
static float GetFoodWater(ItemBase item, string classname="", int food_stage=0)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
static float GetFoodNutritionalIndex(ItemBase item, string classname="", int food_stage=0)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
static int GetFoodAgents(ItemBase item, string classname="", int food_stage=0)
protected EffectSound m_SoundEffectCooking
DEPRECATED.
protected void RemoveAudio()
override void OnVariablesSynchronized()
override void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool CanHaveTemperature()
protected void RefreshAudio()
void ChangeFoodStage(FoodStageType new_food_stage_type)
protected string m_SoundPlaying
protected void SoundCookingStart(string sound_name)
protected SoundOnVehicle m_SoundCooking
override void SetActions()
Manager class for managing Effect (EffectParticle, EffectSound)
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.
Serialization general interface. Serializer API works with:
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
const float DECAY_FOOD_CAN_OPEN
const float DECAY_FOOD_BOILED_MEAT
const float DECAY_FOOD_RAW_CORPSE
const float DECAY_FOOD_RAW_FRVG
const int DECAY_TIMER_RANDOM_PERCENTAGE
const float DECAY_FOOD_BOILED_FRVG
const float DECAY_FOOD_RAW_MEAT
const float DECAY_FOOD_BAKED_FRVG
const float DECAY_FOOD_BAKED_MEAT
const float DECAY_RATE_ON_PLAYER
const int DECAY_FOOD_FRVG_DRIED_CHANCE
const float DECAY_FOOD_DRIED_MEAT
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
const int SAT_DEBUG_ACTION
bool Contains(string sample)
Returns true if sample is substring of string.