Dayz  1.11.153731
Dayz Code Explorer by Zeroy
Edible_Base.c
Go to the documentation of this file.
1 class Edible_Base extends ItemBase
2 {
3  protected bool m_MakeCookingSounds;
4  protected SoundOnVehicle m_SoundCooking;
5  protected string m_SoundPlaying;
7  protected float m_DecayTimer;
8  protected float m_DecayDelta = 0.0;
10 
11  //Baking
12  const string SOUND_BAKING_START = "bake"; // raw stage
13  const string SOUND_BAKING_DONE = "bakeDone"; // baked stage
14  //Burning
15  const string SOUND_BURNING_DONE = "burned"; // burned stage
16 
17  void Edible_Base()
18  {
19  if ( HasFoodStage() )
20  {
21  m_FoodStage = new FoodStage( this );
22 
23  //synchronized variables
24  RegisterNetSyncVariableInt( "m_FoodStage.m_FoodStageType", FoodStageType.NONE, FoodStageType.COUNT );
25  RegisterNetSyncVariableInt( "m_FoodStage.m_SelectionIndex", 0, 6 );
26  RegisterNetSyncVariableInt( "m_FoodStage.m_TextureIndex", 0, 6 );
27  RegisterNetSyncVariableInt( "m_FoodStage.m_MaterialIndex", 0, 6 );
28  RegisterNetSyncVariableFloat( "m_FoodStage.m_CookingTime", 0, 600, 0 ); //min = 0; max = 0; precision = 0;
29 
30  m_SoundPlaying = "";
31  RegisterNetSyncVariableBool("m_MakeCookingSounds");
32  }
33  }
34 
35  override void EEInit()
36  {
37  super.EEInit();
38 
39  //update visual
40  UpdateVisuals();
41  }
42 
43  override void EEDelete( EntityAI parent )
44  {
45  super.EEDelete( parent );
46 
47  // remove audio
48  RemoveAudio();
49  }
50 
52  {
53  if ( GetFoodStage() )
54  {
55  GetFoodStage().UpdateVisuals();
56  }
57  }
58 
59  bool Consume(float amount, PlayerBase consumer)
60  {
61  AddQuantity(-amount, false, false);
62  OnConsume(amount, consumer);
63  return true;
64  }
65 
66  void OnConsume(float amount, PlayerBase consumer);
67 
68  //food staging
69  override bool CanBeCooked()
70  {
71  return false;
72  }
73 
74  override bool CanBeCookedOnStick()
75  {
76  return false;
77  }
78 
79  //================================================================
80  // SYNCHRONIZATION
81  //================================================================
82  void Synchronize()
83  {
84  if ( GetGame().IsServer() )
85  {
86  SetSynchDirty();
87 
88  if ( GetGame().IsMultiplayer() )
89  {
90  UpdateVisuals();
91  }
92  }
93  }
94 
95  override void OnVariablesSynchronized()
96  {
97  super.OnVariablesSynchronized();
98 
99  //update visuals
100  UpdateVisuals();
101 
102  //update audio
103  if ( m_MakeCookingSounds )
104  {
105  RefreshAudio();
106  }
107  else
108  {
109  RemoveAudio();
110  }
111  }
112 
113  //================================================================
114  // AUDIO EFFECTS (WHEN ON DCS)
115  //================================================================
116  void MakeSoundsOnClient( bool soundstate )
117  {
118  m_MakeCookingSounds = soundstate;
119 
120  //synchronize
121  Synchronize();
122  }
123  protected void RefreshAudio()
124  {
125  string sound_name;
126  int particle_id;
127 
128  switch ( GetFoodStageType() )
129  {
130  case FoodStageType.RAW:
131  sound_name = SOUND_BAKING_START;
132  break;
133  case FoodStageType.BAKED:
134  sound_name = SOUND_BAKING_DONE;
135  break;
136  case FoodStageType.BURNED:
137  sound_name = SOUND_BURNING_DONE;
138  break;
139  default:
140  sound_name = SOUND_BAKING_START;
141  break;
142  }
143  SoundCookingStart( sound_name );
144  }
145  protected void RemoveAudio()
146  {
147  m_MakeCookingSounds = false;
149  }
150 
151  //================================================================
152  // SERIALIZATION
153  //================================================================
154  override void OnStoreSave( ParamsWriteContext ctx )
155  {
156  super.OnStoreSave( ctx );
157 
158  if ( GetFoodStage() )
159  {
160  GetFoodStage().OnStoreSave( ctx );
161  }
162 
163  // food decay
164  ctx.Write( m_DecayTimer );
165  ctx.Write( m_LastDecayStage );
166  }
167 
168  override bool OnStoreLoad( ParamsReadContext ctx, int version )
169  {
170  if ( !super.OnStoreLoad( ctx, version ) )
171  return false;
172 
173  if ( GetFoodStage() )
174  {
175  if ( !GetFoodStage().OnStoreLoad( ctx, version ) )
176  return false;
177  }
178 
179  if ( version >= 115 )
180  {
181  if( !ctx.Read( m_DecayTimer ) )
182  {
183  m_DecayTimer = 0.0;
184  return false;
185  }
186  if( !ctx.Read( m_LastDecayStage ) )
187  {
189  return false;
190  }
191  }
192 
193  return true;
194  }
195 
196  override void AfterStoreLoad()
197  {
198  super.AfterStoreLoad();
199 
200  //synchronize
201  Synchronize();
202  }
203 
204  //get food stage
206  {
207  return m_FoodStage;
208  }
209 
210  //food types
211  override bool IsMeat()
212  {
213  return false;
214  }
215 
216  override bool IsFruit()
217  {
218  return false;
219  }
220 
221  override bool IsMushroom()
222  {
223  return false;
224  }
225 
226  //================================================================
227  // NUTRITIONAL VALUES
228  //================================================================
229  //food properties
230  static float GetFoodTotalVolume(ItemBase item, string classname = "", int food_stage = 0)
231  {
232  Edible_Base food_item = Edible_Base.Cast(item);
233  if(food_item && food_item.GetFoodStage())
234  {
235  return FoodStage.GetFullnessIndex(food_item.GetFoodStage());
236  }
237  else if(classname != "" && food_stage)
238  {
239  return FoodStage.GetFullnessIndex(null, food_stage, classname);
240  }
241  string class_path = "cfgVehicles " + classname + " Nutrition";
242  return GetGame().ConfigGetFloat( class_path + " fullnessIndex" );
243 
244  }
245 
246  static float GetFoodEnergy(ItemBase item, string classname = "", int food_stage = 0)
247  {
248  Edible_Base food_item = Edible_Base.Cast(item);
249  if(food_item && food_item.GetFoodStage())
250  {
251  return FoodStage.GetEnergy(food_item.GetFoodStage());
252  }
253  else if(classname != "" && food_stage)
254  {
255  return FoodStage.GetEnergy(null, food_stage, classname);
256  }
257  string class_path = "cfgVehicles " + classname + " Nutrition";
258  return GetGame().ConfigGetFloat( class_path + " energy" );
259  }
260 
261  static float GetFoodWater(ItemBase item, string classname = "", int food_stage = 0)
262  {
263  Edible_Base food_item = Edible_Base.Cast(item);
264  if(food_item && food_item.GetFoodStage())
265  {
266  return FoodStage.GetWater(food_item.GetFoodStage());
267  }
268  else if(classname != "" && food_stage)
269  {
270  return FoodStage.GetWater(null, food_stage, classname);
271  }
272  string class_path = "cfgVehicles " + classname + " Nutrition";
273  return GetGame().ConfigGetFloat( class_path + " water" );
274  }
275 
276  static float GetFoodNutritionalIndex(ItemBase item, string classname = "", int food_stage = 0)
277  {
278  Edible_Base food_item = Edible_Base.Cast(item);
279  if(food_item && food_item.GetFoodStage())
280  {
281  return FoodStage.GetNutritionalIndex(food_item.GetFoodStage());
282  }
283  else if(classname != "" && food_stage)
284  {
285  return FoodStage.GetNutritionalIndex(null, food_stage, classname);
286  }
287  string class_path = "cfgVehicles " + classname + " Nutrition";
288  return GetGame().ConfigGetFloat( class_path + " nutritionalIndex" );
289 
290  }
291 
292  static float GetFoodToxicity(ItemBase item, string classname = "", int food_stage = 0)
293  {
294  Edible_Base food_item = Edible_Base.Cast(item);
295  if(food_item && food_item.GetFoodStage())
296  {
297  return FoodStage.GetToxicity(food_item.GetFoodStage());
298  }
299  else if(classname != "" && food_stage)
300  {
301  return FoodStage.GetToxicity(null, food_stage, classname);
302  }
303  string class_path = "cfgVehicles " + classname + " Nutrition";
304  return GetGame().ConfigGetFloat( class_path + " toxicity" );
305  }
306 
307  static int GetFoodAgents(ItemBase item, string classname = "", int food_stage = 0)
308  {
309  Edible_Base food_item = Edible_Base.Cast(item);
310  if(food_item && food_item.GetFoodStage())
311  {
312  return FoodStage.GetAgents(food_item.GetFoodStage());
313  }
314  else if(classname != "" && food_stage)
315  {
316  return FoodStage.GetAgents(null, food_stage, classname);
317  }
318  string class_path = "cfgVehicles " + classname + " Nutrition";
319  return GetGame().ConfigGetInt( class_path + " agents" );
320  }
321 
322  static float GetFoodDigestibility(ItemBase item, string classname = "", int food_stage = 0)
323  {
324  Edible_Base food_item = Edible_Base.Cast(item);
325  if(food_item && food_item.GetFoodStage())
326  {
327  return FoodStage.GetDigestibility(food_item.GetFoodStage());
328  }
329  else if(classname != "" && food_stage)
330  {
331  return FoodStage.GetDigestibility(null, food_stage, classname);
332  }
333  string class_path = "cfgVehicles " + classname + " Nutrition";
334  return GetGame().ConfigGetInt( class_path + " digestibility" );
335  }
336 
337  static NutritionalProfile GetNutritionalProfile(ItemBase item, string classname = "", int food_stage = 0)
338  {
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));
340  }
341 
342  //================================================================
343  // FOOD STAGING
344  //================================================================
346  {
347  return GetFoodStage().GetFoodStageType();
348  }
349 
350  //food stage states
351  bool IsFoodRaw()
352  {
353  if ( GetFoodStage() )
354  {
355  return GetFoodStage().IsFoodRaw();
356  }
357 
358  return false;
359  }
360 
361  bool IsFoodBaked()
362  {
363  if ( GetFoodStage() )
364  {
365  return GetFoodStage().IsFoodBaked();
366  }
367 
368  return false;
369  }
370 
372  {
373  if ( GetFoodStage() )
374  {
375  return GetFoodStage().IsFoodBoiled();
376  }
377 
378  return false;
379  }
380 
381  bool IsFoodDried()
382  {
383  if ( GetFoodStage() )
384  {
385  return GetFoodStage().IsFoodDried();
386  }
387 
388  return false;
389  }
390 
392  {
393  if ( GetFoodStage() )
394  {
395  return GetFoodStage().IsFoodBurned();
396  }
397 
398  return false;
399  }
400 
402  {
403  if ( GetFoodStage() )
404  {
405  return GetFoodStage().IsFoodRotten();
406  }
407 
408  return false;
409  }
410 
411  //food stage change
412  void ChangeFoodStage( FoodStageType new_food_stage_type )
413  {
414  GetFoodStage().ChangeFoodStage( new_food_stage_type );
415  }
416 
418  {
419  return GetFoodStage().GetNextFoodStageType( cooking_method );
420  }
421 
422  string GetFoodStageName( FoodStageType food_stage_type )
423  {
424  return GetFoodStage().GetFoodStageName( food_stage_type );
425  }
426 
427  bool CanChangeToNewStage( CookingMethodType cooking_method )
428  {
429  return GetFoodStage().CanChangeToNewStage( cooking_method );
430  }
431 
432  //Use this to receive food stage from another Edible_Base
433  void TransferFoodStage( notnull Edible_Base source )
434  {
435  m_LastDecayStage = source.GetLastDecayStage();
436  ChangeFoodStage(source.GetFoodStage().GetFoodStageType());
437  m_DecayTimer = source.GetDecayTimer();
438  m_DecayDelta = source.GetDecayDelta();
439  }
440 
441  //================================================================
442  // COOKING
443  //================================================================
444  //cooking time
446  {
447  return GetFoodStage().GetCookingTime();
448  }
449 
450  void SetCookingTime( float time )
451  {
452  GetFoodStage().SetCookingTime( time );
453 
454  //synchronize when calling on server
455  Synchronize();
456  }
457 
458  //replace edible with new item (opening cans)
459  void ReplaceEdibleWithNew (string typeName)
460  {
462  if (player)
463  {
464  ReplaceEdibleWithNewLambda lambda = new ReplaceEdibleWithNewLambda(this, typeName, player);
465  player.ServerReplaceItemInHandsWithNew(lambda);
466  }
467  else
468  Error("ReplaceEdibleWithNew - cannot use edible without player");
469  }
470 
471  override void SetActions()
472  {
473  super.SetActions();
474 
479  }
480 
481  protected void SoundCookingStart( string sound_name )
482  {
483  if ( GetGame() && ( !GetGame().IsMultiplayer() || GetGame().IsClient() ) )
484  {
485  if ( m_SoundPlaying != sound_name )
486  {
487  //stop previous sound
489 
490  //create new
491  m_SoundCooking = PlaySoundLoop( sound_name, 50 );
492  m_SoundPlaying = sound_name;
493  }
494  }
495  }
496  protected void SoundCookingStop()
497  {
498  if ( m_SoundCooking )
499  {
501  m_SoundCooking = NULL;
502  m_SoundPlaying = "";
503  }
504  }
505 
506  override bool CanHaveTemperature()
507  {
508  return true;
509  }
510 
511  override bool CanDecay()
512  {
513  return false;
514  }
515 
516  override bool CanProcessDecay()
517  {
518  return ( GetFoodStageType() != FoodStageType.ROTTEN );
519  }
520 
521  override void ProcessDecay( float delta, bool hasRootAsPlayer )
522  {
523  m_DecayDelta += ( 1 + ( 1 - GetHealth01( "", "" ) ) );
524  if ( hasRootAsPlayer )
526 
527  /*Print( "-------------------------" );
528  Print( this );
529  Print( m_DecayTimer );
530  Print( m_DecayDelta );
531  Print( m_LastDecayStage );*/
532 
533  if ( IsFruit() )
534  {
535  // fruit and vegetables
537  {
538  switch ( GetFoodStageType() )
539  {
540  case FoodStageType.RAW:
543  break;
544 
545  case FoodStageType.BOILED:
548  break;
549 
550  case FoodStageType.BAKED:
553  break;
554 
555  case FoodStageType.DRIED:
556  case FoodStageType.BURNED:
557  case FoodStageType.ROTTEN:
558  default:
559  m_DecayTimer = -1;
561  return;
562  }
563 
564  //m_DecayTimer = m_DecayTimer / 1000.0;
565  }
566 
567  m_DecayTimer -= ( delta * m_DecayDelta );
568 
569  if ( m_DecayTimer <= 0 )
570  {
571  if ( m_LastDecayStage != FoodStageType.NONE )
572  {
573  // switch to decayed stage
574  if ( ( m_LastDecayStage == FoodStageType.BOILED ) || ( m_LastDecayStage == FoodStageType.BAKED ) )
575  {
576  ChangeFoodStage( FoodStageType.ROTTEN );
577  }
578  if ( m_LastDecayStage == FoodStageType.RAW )
579  {
580  int rng = Math.RandomIntInclusive( 0, 100 );
582  {
583  ChangeFoodStage( FoodStageType.ROTTEN );
584  }
585  else
586  {
587  if ( CanChangeToNewStage( FoodStageType.DRIED ) )
588  {
590  }
591  else
592  {
593  ChangeFoodStage( FoodStageType.ROTTEN );
594  }
595  }
596  }
597  }
598  }
599 
600  }
601  else if ( IsMeat() )
602  {
603  // meat
605  {
606  switch ( GetFoodStageType() )
607  {
608  case FoodStageType.RAW:
611  break;
612 
613  case FoodStageType.BOILED:
616  break;
617 
618  case FoodStageType.BAKED:
621  break;
622 
623  case FoodStageType.DRIED:
626  break;
627 
628  case FoodStageType.BURNED:
629  case FoodStageType.ROTTEN:
630  default:
631  m_DecayTimer = -1;
633  return;
634  }
635 
636  //m_DecayTimer = m_DecayTimer / 1000.0;
637  }
638 
639  m_DecayTimer -= ( delta * m_DecayDelta );
640 
641  if ( m_DecayTimer <= 0 )
642  {
643  if ( m_LastDecayStage != FoodStageType.NONE )
644  {
645  // switch to decayed stage
646  if ( ( m_LastDecayStage == FoodStageType.DRIED ) || ( m_LastDecayStage == FoodStageType.RAW ) || ( m_LastDecayStage == FoodStageType.BOILED ) || ( m_LastDecayStage == FoodStageType.BAKED ) )
647  {
648  ChangeFoodStage( FoodStageType.ROTTEN );
649  }
650  }
651  }
652  }
653  else
654  {
655  // opened cans
656  m_DecayTimer -= ( delta * m_DecayDelta );
657 
658  if ( ( m_DecayTimer <= 0 ) && ( m_LastDecayStage == FoodStageType.NONE ) )
659  {
662  //m_DecayTimer = m_DecayTimer / 1000.0;
663  }
664  else
665  {
666  if ( m_DecayTimer <= 0 )
667  {
668  InsertAgent(eAgents.FOOD_POISON, 1);
669  m_DecayTimer = -1;
670  }
671  }
672  }
673 
674  m_DecayDelta = 0.0;
675  }
676 
677  //================================================================
678  // GENERAL GETTERS
679  //================================================================
680 
682  {
683  return m_DecayTimer;
684  }
685 
687  {
688  return m_DecayDelta;
689  }
690 
692  {
693  return m_LastDecayStage;
694  }
695 }
696 
698 {
699  void ReplaceEdibleWithNewLambda (EntityAI old_item, string new_item_type, PlayerBase player) { }
700 };
ItemBase
Definition: InventoryItem.c:445
GetGame
proto native CGame GetGame()
ItemBase::GetDecayDelta
float GetDecayDelta()
Definition: Edible_Base.c:686
ItemBase::GetCookingTime
float GetCookingTime()
Definition: Edible_Base.c:445
ItemBase::GetFoodWater
static float GetFoodWater(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:261
GameConstants::DECAY_FOOD_BOILED_MEAT
const float DECAY_FOOD_BOILED_MEAT
Definition: constants.c:700
ItemBase::GetFoodStageName
string GetFoodStageName(FoodStageType food_stage_type)
Definition: Edible_Base.c:422
GameConstants::DECAY_FOOD_BOILED_FRVG
const float DECAY_FOOD_BOILED_FRVG
Definition: constants.c:701
GameConstants::DECAY_RATE_ON_PLAYER
const float DECAY_RATE_ON_PLAYER
Definition: constants.c:708
ItemBase::Consume
bool Consume(float amount, PlayerBase consumer)
Definition: Edible_Base.c:59
ItemBase::GetNextFoodStageType
FoodStageType GetNextFoodStageType(CookingMethodType cooking_method)
Definition: Edible_Base.c:417
m_DecayDelta
protected float m_DecayDelta
Definition: Edible_Base.c:7
GetFoodAgents
static int GetFoodAgents(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:306
Error
void Error(string err)
Messagebox with error message.
Definition: EnDebug.c:42
ChangeFoodStage
void ChangeFoodStage(FoodStageType new_food_stage_type)
Definition: Edible_Base.c:411
ItemBase::CanChangeToNewStage
bool CanChangeToNewStage(CookingMethodType cooking_method)
Definition: Edible_Base.c:427
ItemBase::CanProcessDecay
override bool CanProcessDecay()
Definition: Edible_Base.c:516
GetFoodNutritionalIndex
static float GetFoodNutritionalIndex(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:275
GetFoodStage
FoodStage GetFoodStage()
Definition: Edible_Base.c:204
ItemBase::CanDecay
override bool CanDecay()
Definition: Edible_Base.c:511
ItemBase::SoundCookingStop
protected void SoundCookingStop()
Definition: Edible_Base.c:496
CGame::ObjectDelete
proto native void ObjectDelete(Object obj)
RemoveAudio
protected void RemoveAudio()
Definition: Edible_Base.c:144
ItemBase::GetFoodNutritionalIndex
static float GetFoodNutritionalIndex(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:276
FoodStage
void FoodStage(Edible_Base food_item)
Definition: FoodStage.c:27
CGame::ConfigGetInt
proto native int ConfigGetInt(string path)
Get int value from config on path.
ItemBase::GetFoodToxicity
static float GetFoodToxicity(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:292
ItemBase::CanBeCooked
override bool CanBeCooked()
Definition: Edible_Base.c:69
ItemBase::GetDecayTimer
float GetDecayTimer()
Definition: Edible_Base.c:681
ItemBase::OnStoreSave
override void OnStoreSave(ParamsWriteContext ctx)
Definition: Edible_Base.c:154
AddAction
void AddAction(typename actionName)
Definition: AdvancedCommunication.c:86
ItemBase::IsMeat
override bool IsMeat()
Definition: Edible_Base.c:211
SOUND_BURNING_DONE
const string SOUND_BURNING_DONE
Definition: Edible_Base.c:14
Math::RandomFloat01
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
Definition: EnMath.c:94
m_LastDecayStage
protected FoodStageType m_LastDecayStage
Definition: Edible_Base.c:8
GetHierarchyRootPlayer
proto native Man GetHierarchyRootPlayer()
Returns root of current hierarchy cast to Man.
SOUND_BAKING_DONE
const string SOUND_BAKING_DONE
Definition: Edible_Base.c:12
RegisterNetSyncVariableFloat
proto native void RegisterNetSyncVariableFloat(string variableName, float minValue=0, float maxValue=0, int precision=1)
ItemBase::RefreshAudio
protected void RefreshAudio()
Definition: Edible_Base.c:123
HasFoodStage
bool HasFoodStage()
Definition: ItemBase.c:2174
ItemBase::CanBeCookedOnStick
override bool CanBeCookedOnStick()
Definition: Edible_Base.c:74
ItemBase::IsMushroom
override bool IsMushroom()
Definition: Edible_Base.c:221
ItemBase::ChangeFoodStage
void ChangeFoodStage(FoodStageType new_food_stage_type)
Definition: Edible_Base.c:412
SetSynchDirty
proto native void SetSynchDirty()
Sets object synchronization dirty flag, which signalize that object wants to be synchronized (take ef...
ItemBase::Synchronize
void Synchronize()
Definition: Edible_Base.c:82
ItemBase::GetNutritionalProfile
static NutritionalProfile GetNutritionalProfile(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:337
FoodStageType
FoodStageType
Definition: FoodStage.c:1
GameConstants::DECAY_FOOD_FRVG_DRIED_CHANCE
const int DECAY_FOOD_FRVG_DRIED_CHANCE
Definition: constants.c:706
m_SoundPlaying
protected string m_SoundPlaying
Definition: Edible_Base.c:4
GameConstants::DECAY_TIMER_RANDOM_PERCENTAGE
const int DECAY_TIMER_RANDOM_PERCENTAGE
Definition: constants.c:707
Serializer::Write
proto bool Write(void value_out)
Serializer
Serialization general interface.
Definition: Serializer.c:55
GetFoodDigestibility
static float GetFoodDigestibility(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:321
InsertAgent
void InsertAgent(int agent, float count=1)
Definition: ItemBase.c:3596
GetFoodEnergy
static float GetFoodEnergy(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:245
ItemBase::GetFoodDigestibility
static float GetFoodDigestibility(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:322
m_SoundCooking
protected SoundOnVehicle m_SoundCooking
Definition: Edible_Base.c:3
ItemBase::ReplaceEdibleWithNew
void ReplaceEdibleWithNew(string typeName)
Definition: Edible_Base.c:459
ItemBase::Edible_Base
void Edible_Base()
Definition: Edible_Base.c:17
UpdateVisuals
void UpdateVisuals()
Definition: Edible_Base.c:50
ItemBase::GetFoodStage
FoodStage GetFoodStage()
Definition: Edible_Base.c:205
GameConstants::DECAY_FOOD_RAW_FRVG
const float DECAY_FOOD_RAW_FRVG
Definition: constants.c:699
PlayerBase
Definition: PlayerBaseClient.c:1
ItemBase::GetFoodTotalVolume
static float GetFoodTotalVolume(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:230
ReplaceEdibleWithNewLambda
class Edible_Base extends ItemBase ReplaceEdibleWithNewLambda(EntityAI old_item, string new_item_type, PlayerBase player)
Definition: Edible_Base.c:699
ItemBase::SetCookingTime
void SetCookingTime(float time)
Definition: Edible_Base.c:450
OnStoreLoad
override bool OnStoreLoad(ParamsReadContext ctx, int version)
Definition: Edible_Base.c:167
ItemBase::AfterStoreLoad
override void AfterStoreLoad()
Definition: Edible_Base.c:196
Edible_Base::OnConsume
override void OnConsume(float amount, PlayerBase consumer)
Definition: CharcoalTablets.c:13
ItemBase::GetFoodStageType
FoodStageType GetFoodStageType()
Definition: Edible_Base.c:345
ItemBase::IsFoodRotten
bool IsFoodRotten()
Definition: Edible_Base.c:401
GetFoodToxicity
static float GetFoodToxicity(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:291
ItemBase::IsFoodBurned
bool IsFoodBurned()
Definition: Edible_Base.c:391
ItemBase::SetActions
override void SetActions()
Definition: Edible_Base.c:471
ItemBase::EEDelete
override void EEDelete(EntityAI parent)
Definition: Edible_Base.c:43
m_MakeCookingSounds
protected bool m_MakeCookingSounds
Definition: Edible_Base.c:2
Edible_Base::IsMeat
override bool IsMeat()
Definition: BearSteakMeat.c:13
ActionCreateIndoorFireplace
Definition: ActionCreateIndoorFireplace.c:1
ItemBase::ProcessDecay
override void ProcessDecay(float delta, bool hasRootAsPlayer)
Definition: Edible_Base.c:521
ItemBase::RemoveAudio
protected void RemoveAudio()
Definition: Edible_Base.c:145
Edible_Base::IsFruit
override bool IsFruit()
Definition: CaninaBerry.c:13
SoundCookingStart
protected void SoundCookingStart(string sound_name)
Definition: Edible_Base.c:480
ActionAttach
ActionAttachWheels ActionAttach
CookingMethodType
CookingMethodType
Definition: Cooking.c:1
RegisterNetSyncVariableInt
proto native void RegisterNetSyncVariableInt(string variableName, int minValue=0, int maxValue=0)
ActionCreateIndoorOven
Definition: ActionCreateIndoorOven.c:1
version
version
Definition: $PBOPREFIX$.txt:4
ItemBase::IsFoodRaw
bool IsFoodRaw()
Definition: Edible_Base.c:351
RegisterNetSyncVariableBool
proto native void RegisterNetSyncVariableBool(string variableName)
Math::RandomIntInclusive
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition: EnMath.c:56
ItemBase::SoundCookingStart
protected void SoundCookingStart(string sound_name)
Definition: Edible_Base.c:481
ItemBase::GetFoodEnergy
static float GetFoodEnergy(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:246
GameConstants::DECAY_FOOD_CAN_OPEN
const float DECAY_FOOD_CAN_OPEN
Definition: constants.c:705
ItemBase::UpdateVisuals
void UpdateVisuals()
Definition: Edible_Base.c:51
ItemBase::IsFruit
override bool IsFruit()
Definition: Edible_Base.c:216
ItemBase::TransferFoodStage
void TransferFoodStage(notnull Edible_Base source)
Definition: Edible_Base.c:433
ActionDetach
void ActionDetach()
Definition: ActionDetach.c:10
AddQuantity
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...
Definition: ItemBase.c:2947
ItemBase::IsFoodBoiled
bool IsFoodBoiled()
Definition: Edible_Base.c:371
NutritionalProfile
Definition: NutritionalProfile.c:1
ItemBase::MakeSoundsOnClient
void MakeSoundsOnClient(bool soundstate)
Definition: Edible_Base.c:116
ItemBase::CanHaveTemperature
override bool CanHaveTemperature()
Definition: Edible_Base.c:506
GameConstants::DECAY_FOOD_RAW_MEAT
const float DECAY_FOOD_RAW_MEAT
Definition: constants.c:698
eAgents
eAgents
Definition: EAgents.c:2
GameConstants
Definition: constants.c:474
CanChangeToNewStage
bool CanChangeToNewStage(CookingMethodType cooking_method)
Definition: Edible_Base.c:426
m_FoodStage
ref FoodStage m_FoodStage
Definition: Edible_Base.c:5
ItemBase::IsFoodBaked
bool IsFoodBaked()
Definition: Edible_Base.c:361
Serializer::Read
proto bool Read(void value_in)
ItemBase::GetLastDecayStage
FoodStageType GetLastDecayStage()
Definition: Edible_Base.c:691
SOUND_BAKING_START
const string SOUND_BAKING_START
Definition: Edible_Base.c:11
ItemBase::OnStoreLoad
override bool OnStoreLoad(ParamsReadContext ctx, int version)
Definition: Edible_Base.c:168
ItemBase::OnVariablesSynchronized
override void OnVariablesSynchronized()
Definition: Edible_Base.c:95
ItemBase::IsFoodDried
bool IsFoodDried()
Definition: Edible_Base.c:381
SoundCookingStop
protected void SoundCookingStop()
Definition: Edible_Base.c:495
CGame::ConfigGetFloat
proto native float ConfigGetFloat(string path)
Get float value from config on path.
GetFoodTotalVolume
static float GetFoodTotalVolume(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:229
Math
Definition: EnMath.c:6
GetFoodStageType
FoodStageType GetFoodStageType()
Definition: Edible_Base.c:344
ItemBase::EEInit
override void EEInit()
Definition: Edible_Base.c:35
TurnItemIntoItemLambda
Definition: MiscGameplayFunctions.c:91
EntityAI
Base native class of all vehicles in game.
Definition: Building.c:4
ItemBase::GetFoodAgents
static int GetFoodAgents(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:307
GameConstants::DECAY_FOOD_DRIED_MEAT
const float DECAY_FOOD_DRIED_MEAT
Definition: constants.c:704
RefreshAudio
protected void RefreshAudio()
Definition: Edible_Base.c:122
Synchronize
void Synchronize()
Definition: Edible_Base.c:81
GetFoodWater
static float GetFoodWater(ItemBase item, string classname="", int food_stage=0)
Definition: Edible_Base.c:260
Edible_Base
Definition: BearSteakMeat.c:1
GameConstants::DECAY_FOOD_BAKED_MEAT
const float DECAY_FOOD_BAKED_MEAT
Definition: constants.c:702
GameConstants::DECAY_FOOD_BAKED_FRVG
const float DECAY_FOOD_BAKED_FRVG
Definition: constants.c:703
m_DecayTimer
protected float m_DecayTimer
Definition: Edible_Base.c:6