32 RegisterNetSyncVariableFloat(
"m_FoodStage.m_CookingTime", 0, 600, 0);
37 RegisterNetSyncVariableBool(
"m_MakeCookingSounds");
50 super.EEDelete(parent);
60 super.EEItemLocationChanged(oldLoc, newLoc);
65 switch (oldLoc.GetParent().GetType())
70 case "SharpWoodenStick":
118 foodStageType = foodStage.GetFoodStageType();
152 return super.GetTemperatureFreezeTime();
156 return super.GetTemperatureFreezeTime();
172 return super.GetTemperatureThawTime();
176 return super.GetTemperatureThawTime();
194 super.OnVariablesSynchronized();
225 string soundName =
"";
285 nextStageProperties = FoodStage.GetAllCookingPropertiesForStage(nextFoodStage, null,
GetType());
286 float nextStageTime = nextStageProperties.Get(eCookingPropertyIndices.COOK_TIME);
288 if (progress01 > Cooking.BURNING_WARNING_THRESHOLD)
310 super.OnStoreSave(ctx);
324 if (!super.OnStoreLoad(ctx, version))
355 super.AfterStoreLoad();
396 return FoodStage.GetFullnessIndex(food_item.
GetFoodStage());
398 else if (classname !=
"" && food_stage)
400 return FoodStage.GetFullnessIndex(null, food_stage, classname);
402 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
414 else if (classname !=
"" && food_stage)
416 return FoodStage.GetEnergy(null, food_stage, classname);
418 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
429 else if (classname !=
"" && food_stage)
431 return FoodStage.GetWater(null, food_stage, classname);
433 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
442 return FoodStage.GetNutritionalIndex(food_item.
GetFoodStage());
444 else if (classname !=
"" && food_stage)
446 return FoodStage.GetNutritionalIndex(null, food_stage, classname);
448 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
460 else if (classname !=
"" && food_stage)
462 return FoodStage.GetToxicity(null, food_stage, classname);
464 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
475 else if (classname !=
"" && food_stage)
477 return FoodStage.GetAgents(null, food_stage, classname);
479 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
488 return FoodStage.GetDigestibility(food_item.
GetFoodStage());
490 else if (classname !=
"" && food_stage)
492 return FoodStage.GetDigestibility(null, food_stage, classname);
494 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
503 return FoodStage.GetAgentsPerDigest(foodItem.
GetFoodStage());
505 else if (className !=
"" && foodStage)
507 return FoodStage.GetAgentsPerDigest(null, foodStage, className);
509 string classPath =
string.Format(
"cfgVehicles %1 Nutrition", className);
605 return GetFoodStage().GetNextFoodStageType( cooking_method );
610 return GetFoodStage().GetFoodStageName( food_stage_type );
615 return GetFoodStage().CanChangeToNewStage( cooking_method );
621 if ( !source.GetFoodStage())
686 player.ServerReplaceItemInHandsWithNew(lambda);
689 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
744 delta *= DayZGame.Cast(
GetGame()).GetFoodDecayModifier();
746 if ( hasRootAsPlayer )
932 if (
GetGame().IsDedicatedServer())
938 GetInventory().GetCurrentInventoryLocation(invLoc);
961 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
972 super.GetDebugActions(outputList);
984 super.OnAction(action_id, player, ctx);
988 if ( action_id ==
EActions.FOOD_STAGE_PREV )
991 if (food_stage_prev <= 0)
998 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
1011 #ifdef DIAG_DEVELOPER
1012 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
1014 PrintNutritionsData();
1024 string debug_output;
1026 debug_output = super.GetDebugText();
1031 return debug_output;
1040 float ret = super.GetBaitEffectivity();
1065 #ifdef DIAG_DEVELOPER
1066 private void PrintNutritionsData()
1068 string nutritionsData =
"";
1076 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
1078 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
1082 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
1088 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
1092 nutritionsData +=
"-----\n";
1094 Debug.Log(nutritionsData);
Param4< int, int, string, int > TSelectableActionInfoWithColor
eBleedingSourceType GetType()
AttachActionData ActionData ActionAttach()
void AddAction(typename actionName)
DamageType
exposed from C++ (do not change)
EConsumptionPenaltyContext
Edible_Base ItemBase ReplaceEdibleWithNewLambda(EntityAI old_item, string new_item_type, PlayerBase player)
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.
int FilterAgents(int agentsIn)
Filter agents from the item (override on higher implementations)
override void OnStoreSave(ParamsWriteContext ctx)
static float GetAgentsPerDigest(ItemBase item, string className="", int foodStage=0)
void MakeSoundsOnClient(bool soundstate, CookingMethodType cookingMethod=CookingMethodType.NONE)
FoodStageType GetFoodStageType()
override float GetTemperatureThawTime()
void OnConsume(float amount, PlayerBase consumer)
override bool CanBeCookedOnStick()
override string GetDebugText()
EffectSound m_SoundEffectCooking
DEPRECATED.
const string SOUND_BOILING_START
FoodStageType GetNextFoodStageType(CookingMethodType cooking_method)
const string SOUND_BAKING_DONE
const string SOUND_DRYING_START
void HandleFoodStageChangeAgents(FoodStageType stageOld, FoodStageType stageNew)
removes select agents on foodstage transitions
override bool CanItemOverheat()
override bool IsMushroom()
override void OnVariablesSynchronized()
int GetConsumptionPenaltyContext()
override float GetTemperatureFreezeTime()
void SoundCookingStart(string sound_name)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
bool Consume(float amount, PlayerBase consumer)
override float GetBaitEffectivity()
const string SOUND_BAKING_START
void UpdateVisualsEx(bool forced=false)
static float GetFoodTotalVolume(ItemBase item, string classname="", int food_stage=0)
string GetFoodStageName(FoodStageType food_stage_type)
void OnFoodStageChange(FoodStageType stageOld, FoodStageType stageNew)
called on server
static float GetFoodEnergy(ItemBase item, string classname="", int food_stage=0)
const string SOUND_DRYING_DONE
ParticleSource m_HotVaporParticle
CookingMethodType m_CookedByMethod
void SetCookingTime(float time)
static float GetFoodDigestibility(ItemBase item, string classname="", int food_stage=0)
override void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool CanBeCooked()
FoodStageType GetLastDecayStage()
override void SetActions()
SoundOnVehicle m_SoundCooking
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
const string SOUND_BURNING_DONE
static float GetFoodToxicity(ItemBase item, string classname="", int food_stage=0)
static float GetFoodNutritionalIndex(ItemBase item, string classname="", int food_stage=0)
override void EEDelete(EntityAI parent)
static int GetFoodAgents(ItemBase item, string classname="", int food_stage=0)
override bool CanProcessDecay()
void ChangeFoodStage(FoodStageType new_food_stage_type)
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override FoodStage GetFoodStage()
void UpdateVaporParticle()
bool CanChangeToNewStage(CookingMethodType cooking_method)
ref FoodStage m_FoodStage
FoodStageType m_LastDecayStage
override void AfterStoreLoad()
void ReplaceEdibleWithNew(string typeName)
static NutritionalProfile GetNutritionalProfile(ItemBase item, string classname="", int food_stage=0)
const string DIRECT_COOKING_SLOT_NAME
static float GetFoodWater(ItemBase item, string classname="", int food_stage=0)
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
void TransferFoodStage(notnull Edible_Base source)
const string SOUND_BOILING_DONE
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.