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);
403 return g_Game.ConfigGetFloat( class_path +
" fullnessIndex" );
414 else if (classname !=
"" && food_stage)
416 return FoodStage.GetEnergy(null, food_stage, classname);
418 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
419 return g_Game.ConfigGetFloat( class_path +
" energy" );
429 else if (classname !=
"" && food_stage)
431 return FoodStage.GetWater(null, food_stage, classname);
433 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
434 return g_Game.ConfigGetFloat( class_path +
" water" );
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);
449 return g_Game.ConfigGetFloat( class_path +
" nutritionalIndex" );
460 else if (classname !=
"" && food_stage)
462 return FoodStage.GetToxicity(null, food_stage, classname);
464 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
465 return g_Game.ConfigGetFloat( class_path +
" toxicity" );
475 else if (classname !=
"" && food_stage)
477 return FoodStage.GetAgents(null, food_stage, classname);
479 string class_path =
string.Format(
"cfgVehicles %1 Nutrition", classname);
480 return g_Game.ConfigGetInt( class_path +
" agents" );
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);
495 return g_Game.ConfigGetInt( class_path +
" digestibility" );
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);
510 return g_Game.ConfigGetInt(classPath +
" agentsPerDigest");
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(
g_Game).GetFoodDecayModifier();
746 if ( hasRootAsPlayer )
932 if (
g_Game.IsDedicatedServer())
938 GetInventory().GetCurrentInventoryLocation(invLoc);
961 GetInventory().GetCurrentInventoryLocation(inventoryLoc);
980 super.GetDebugActions(outputList);
985 super.OnAction(action_id, player, ctx);
989 if ( action_id ==
EActions.FOOD_STAGE_PREV )
992 if (food_stage_prev <= 0)
999 else if ( action_id ==
EActions.FOOD_STAGE_NEXT )
1012 #ifdef DIAG_DEVELOPER
1013 if (action_id ==
EActions.FOOD_NUTRITIONS_DATA)
1015 PrintNutritionsData();
1025 string debug_output;
1027 debug_output = super.GetDebugText();
1032 return debug_output;
1041 float ret = super.GetBaitEffectivity();
1066 #ifdef DIAG_DEVELOPER
1067 private void PrintNutritionsData()
1069 string nutritionsData =
"";
1077 nutritionsData =
string.
Format(
"Item: %1\n\n",
this);
1079 nutritionsData +=
string.
Format(
"Energy: %1\n", profile.
m_Energy);
1083 nutritionsData +=
string.
Format(
"Toxicity (obsolete): %1\n", profile.
m_Toxicity);
1089 nutritionsData +=
string.
Format(
"Agents: %1\n", profile.
m_Agents);
1093 nutritionsData +=
"-----\n";
1095 Debug.Log(nutritionsData);
Param4< int, int, string, int > TSelectableActionInfoWithColor
eBleedingSourceType GetType()
AttachActionData ActionData ActionAttach()
void AddAction(typename actionName)
ref FoodStage m_FoodStage
override bool CanItemOverheat()
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)
void OnFoodStageChange(FoodStageType stageOld, FoodStageType stageNew)
called on server
override float GetTemperatureFreezeTime()
string GetFoodStageName(FoodStageType food_stage_type)
const string SOUND_BURNING_DONE
override void OnStoreSave(ParamsWriteContext ctx)
FoodStageType GetFoodStageType()
override bool CanBeCookedOnStick()
override bool CanBeCooked()
override string GetDebugText()
static NutritionalProfile GetNutritionalProfile(ItemBase item, string classname="", int food_stage=0)
const string DIRECT_COOKING_SLOT_NAME
bool Consume(float amount, PlayerBase consumer)
bool CanChangeToNewStage(CookingMethodType cooking_method)
SoundOnVehicle m_SoundCooking
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override bool IsMushroom()
const string SOUND_BAKING_DONE
static float GetFoodEnergy(ItemBase item, string classname="", int food_stage=0)
void TransferFoodStage(notnull Edible_Base source)
FoodStageType m_LastDecayStage
void ReplaceEdibleWithNew(string typeName)
static float GetFoodToxicity(ItemBase item, string classname="", int food_stage=0)
override bool CanProcessDecay()
override float GetTemperatureThawTime()
override void EEDelete(EntityAI parent)
FoodStageType GetLastDecayStage()
override void AfterStoreLoad()
void OnConsume(float amount, PlayerBase consumer)
FoodStageType GetNextFoodStageType(CookingMethodType cooking_method)
int GetConsumptionPenaltyContext()
void UpdateVaporParticle()
const string SOUND_DRYING_START
static float GetFoodWater(ItemBase item, string classname="", int food_stage=0)
override FoodStage GetFoodStage()
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
const string SOUND_BAKING_START
static float GetFoodNutritionalIndex(ItemBase item, string classname="", int food_stage=0)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
const string SOUND_DRYING_DONE
static int GetFoodAgents(ItemBase item, string classname="", int food_stage=0)
void UpdateVisualsEx(bool forced=false)
static float GetAgentsPerDigest(ItemBase item, string className="", int foodStage=0)
void SoundCookingStart(string sound_name)
EffectSound m_SoundEffectCooking
DEPRECATED.
ParticleSource m_HotVaporParticle
override void OnVariablesSynchronized()
override void ProcessDecay(float delta, bool hasRootAsPlayer)
const string SOUND_BOILING_DONE
const string SOUND_BOILING_START
void MakeSoundsOnClient(bool soundstate, CookingMethodType cookingMethod=CookingMethodType.NONE)
CookingMethodType m_CookedByMethod
void ChangeFoodStage(FoodStageType new_food_stage_type)
void HandleFoodStageChangeAgents(FoodStageType stageOld, FoodStageType stageNew)
removes select agents on foodstage transitions
override float GetBaitEffectivity()
override void SetActions()
int FilterAgents(int agentsIn)
Filter agents from the item (override on higher implementations).
Wrapper class for managing sound through SEffectManager.
proto native int GetType()
returns type of InventoryLocation
provides access to slot configuration
static proto native owned string GetSlotName(int id)
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
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.
proto bool Write(void value_out)
proto bool Read(void value_in)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DamageType
exposed from C++ (do not change)
EConsumptionPenaltyContext
Edible_Base ItemBase ReplaceEdibleWithNewLambda(EntityAI old_item, string new_item_type, PlayerBase player)
override bool CanHaveTemperature()
Serializer ParamsReadContext
Serializer ParamsWriteContext
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 const float TEMPERATURE_FREEZE_TIME_COEF_BURNED
static const float TEMPERATURE_THAW_TIME_COEF_DRIED
static const float TEMPERATURE_THAW_TIME_COEF_BURNED
static const float TEMPERATURE_FREEZE_TIME_COEF_DRIED
const int STATE_HOT_LVL_TWO
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
vector GetPosition()
Get the world position of the Effect.
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.
bool Contains(string sample)
Returns true if sample is substring of string.
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.