|
Dayz
1.11.153731
Dayz Code Explorer by Zeroy
|
Go to the documentation of this file.
45 super.EEDelete( parent );
88 if (
GetGame().IsMultiplayer() )
97 super.OnVariablesSynchronized();
156 super.OnStoreSave( ctx );
170 if ( !super.OnStoreLoad( ctx,
version ) )
198 super.AfterStoreLoad();
233 if(food_item && food_item.GetFoodStage())
235 return FoodStage.GetFullnessIndex(food_item.GetFoodStage());
237 else if(classname !=
"" && food_stage)
239 return FoodStage.GetFullnessIndex(
null, food_stage, classname);
241 string class_path =
"cfgVehicles " + classname +
" Nutrition";
249 if(food_item && food_item.GetFoodStage())
251 return FoodStage.GetEnergy(food_item.GetFoodStage());
253 else if(classname !=
"" && food_stage)
255 return FoodStage.GetEnergy(
null, food_stage, classname);
257 string class_path =
"cfgVehicles " + classname +
" Nutrition";
264 if(food_item && food_item.GetFoodStage())
266 return FoodStage.GetWater(food_item.GetFoodStage());
268 else if(classname !=
"" && food_stage)
270 return FoodStage.GetWater(
null, food_stage, classname);
272 string class_path =
"cfgVehicles " + classname +
" Nutrition";
279 if(food_item && food_item.GetFoodStage())
281 return FoodStage.GetNutritionalIndex(food_item.GetFoodStage());
283 else if(classname !=
"" && food_stage)
285 return FoodStage.GetNutritionalIndex(
null, food_stage, classname);
287 string class_path =
"cfgVehicles " + classname +
" Nutrition";
295 if(food_item && food_item.GetFoodStage())
297 return FoodStage.GetToxicity(food_item.GetFoodStage());
299 else if(classname !=
"" && food_stage)
301 return FoodStage.GetToxicity(
null, food_stage, classname);
303 string class_path =
"cfgVehicles " + classname +
" Nutrition";
310 if(food_item && food_item.GetFoodStage())
312 return FoodStage.GetAgents(food_item.GetFoodStage());
314 else if(classname !=
"" && food_stage)
316 return FoodStage.GetAgents(
null, food_stage, classname);
318 string class_path =
"cfgVehicles " + classname +
" Nutrition";
325 if(food_item && food_item.GetFoodStage())
327 return FoodStage.GetDigestibility(food_item.GetFoodStage());
329 else if(classname !=
"" && food_stage)
331 return FoodStage.GetDigestibility(
null, food_stage, classname);
333 string class_path =
"cfgVehicles " + classname +
" Nutrition";
339 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));
419 return GetFoodStage().GetNextFoodStageType( cooking_method );
424 return GetFoodStage().GetFoodStageName( food_stage_type );
429 return GetFoodStage().CanChangeToNewStage( cooking_method );
465 player.ServerReplaceItemInHandsWithNew(lambda);
468 Error(
"ReplaceEdibleWithNew - cannot use edible without player");
524 if ( hasRootAsPlayer )
proto native CGame GetGame()
static float GetFoodWater(ItemBase item, string classname="", int food_stage=0)
const float DECAY_FOOD_BOILED_MEAT
string GetFoodStageName(FoodStageType food_stage_type)
const float DECAY_FOOD_BOILED_FRVG
const float DECAY_RATE_ON_PLAYER
bool Consume(float amount, PlayerBase consumer)
FoodStageType GetNextFoodStageType(CookingMethodType cooking_method)
protected float m_DecayDelta
static int GetFoodAgents(ItemBase item, string classname="", int food_stage=0)
void Error(string err)
Messagebox with error message.
void ChangeFoodStage(FoodStageType new_food_stage_type)
bool CanChangeToNewStage(CookingMethodType cooking_method)
override bool CanProcessDecay()
static float GetFoodNutritionalIndex(ItemBase item, string classname="", int food_stage=0)
protected void SoundCookingStop()
proto native void ObjectDelete(Object obj)
protected void RemoveAudio()
static float GetFoodNutritionalIndex(ItemBase item, string classname="", int food_stage=0)
void FoodStage(Edible_Base food_item)
proto native int ConfigGetInt(string path)
Get int value from config on path.
static float GetFoodToxicity(ItemBase item, string classname="", int food_stage=0)
override bool CanBeCooked()
override void OnStoreSave(ParamsWriteContext ctx)
void AddAction(typename actionName)
const string SOUND_BURNING_DONE
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
protected FoodStageType m_LastDecayStage
proto native Man GetHierarchyRootPlayer()
Returns root of current hierarchy cast to Man.
const string SOUND_BAKING_DONE
proto native void RegisterNetSyncVariableFloat(string variableName, float minValue=0, float maxValue=0, int precision=1)
protected void RefreshAudio()
override bool CanBeCookedOnStick()
override bool IsMushroom()
void ChangeFoodStage(FoodStageType new_food_stage_type)
proto native void SetSynchDirty()
Sets object synchronization dirty flag, which signalize that object wants to be synchronized (take ef...
static NutritionalProfile GetNutritionalProfile(ItemBase item, string classname="", int food_stage=0)
const int DECAY_FOOD_FRVG_DRIED_CHANCE
protected string m_SoundPlaying
const int DECAY_TIMER_RANDOM_PERCENTAGE
proto bool Write(void value_out)
Serialization general interface.
static float GetFoodDigestibility(ItemBase item, string classname="", int food_stage=0)
void InsertAgent(int agent, float count=1)
static float GetFoodEnergy(ItemBase item, string classname="", int food_stage=0)
static float GetFoodDigestibility(ItemBase item, string classname="", int food_stage=0)
protected SoundOnVehicle m_SoundCooking
void ReplaceEdibleWithNew(string typeName)
const float DECAY_FOOD_RAW_FRVG
static float GetFoodTotalVolume(ItemBase item, string classname="", int food_stage=0)
class Edible_Base extends ItemBase ReplaceEdibleWithNewLambda(EntityAI old_item, string new_item_type, PlayerBase player)
void SetCookingTime(float time)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void AfterStoreLoad()
override void OnConsume(float amount, PlayerBase consumer)
FoodStageType GetFoodStageType()
static float GetFoodToxicity(ItemBase item, string classname="", int food_stage=0)
override void SetActions()
override void EEDelete(EntityAI parent)
protected bool m_MakeCookingSounds
override void ProcessDecay(float delta, bool hasRootAsPlayer)
protected void RemoveAudio()
protected void SoundCookingStart(string sound_name)
ActionAttachWheels ActionAttach
proto native void RegisterNetSyncVariableInt(string variableName, int minValue=0, int maxValue=0)
proto native void RegisterNetSyncVariableBool(string variableName)
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
protected void SoundCookingStart(string sound_name)
static float GetFoodEnergy(ItemBase item, string classname="", int food_stage=0)
const float DECAY_FOOD_CAN_OPEN
void TransferFoodStage(notnull Edible_Base source)
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 MakeSoundsOnClient(bool soundstate)
override bool CanHaveTemperature()
const float DECAY_FOOD_RAW_MEAT
bool CanChangeToNewStage(CookingMethodType cooking_method)
ref FoodStage m_FoodStage
proto bool Read(void value_in)
FoodStageType GetLastDecayStage()
const string SOUND_BAKING_START
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnVariablesSynchronized()
protected void SoundCookingStop()
proto native float ConfigGetFloat(string path)
Get float value from config on path.
static float GetFoodTotalVolume(ItemBase item, string classname="", int food_stage=0)
FoodStageType GetFoodStageType()
Base native class of all vehicles in game.
static int GetFoodAgents(ItemBase item, string classname="", int food_stage=0)
const float DECAY_FOOD_DRIED_MEAT
protected void RefreshAudio()
static float GetFoodWater(ItemBase item, string classname="", int food_stage=0)
const float DECAY_FOOD_BAKED_MEAT
const float DECAY_FOOD_BAKED_FRVG
protected float m_DecayTimer