Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
fireplacebase.c
Go to the documentation of this file.
2 {
3  NO_FIRE = 1,
4  START_FIRE = 2,
5  SMALL_FIRE = 3,
7  END_FIRE = 5,
11 
12  COUNT = 9 //for net sync purposes
13 }
14 
15 enum FirePlaceFailure
16 {
17  WIND = 0,
18  WET = 1,
19 }
20 
21 class FireplaceBase extends ItemBase
22 {
23  //State params
24  protected bool m_IsBurning = false;
25  protected bool m_HasAshes = false;
26  protected bool m_IsOven = false;
27  protected bool m_HasStoneCircle = false;
28  protected bool m_RoofAbove = false;
29  protected bool m_NoIgnite = false;
30  protected int m_OvenAttachmentsLockState = -1;
32  protected FireplaceFireState m_LastFireState = FireplaceFireState.NO_FIRE; //for synchronization purposes
33  protected vector m_HalfExtents;
34 
35  //Fireplace params
36  protected float m_TemperatureLossMP = 1.0;
37  protected float m_FuelBurnRateMP = 1.0;
38 
39  //cooking
40  protected ref Cooking m_CookingProcess;
41 
42  //
43  const float PARAM_SMALL_FIRE_TEMPERATURE = 150;
44  const float PARAM_NORMAL_FIRE_TEMPERATURE = 1000;
45  const float PARAM_MIN_FIRE_TEMPERATURE = 30;
46  const float PARAM_TEMPERATURE_INCREASE = 3;
47  const float PARAM_TEMPERATURE_DECREASE = 3;
48  const float PARAM_MAX_WET_TO_IGNITE = 0.2;
49  const float PARAM_MIN_TEMP_TO_REIGNITE = 30;
50  const float PARAM_IGNITE_RAIN_THRESHOLD = 0.1;
51  const float PARAM_BURN_WET_THRESHOLD = 0.40;
52  const float PARAM_WET_INCREASE_COEF = 0.02;
53  const float PARAM_WET_HEATING_DECREASE_COEF = 0.01;
54  const float PARAM_WET_COOLING_DECREASE_COEF = 0.002;
55  const float PARAM_FIRE_CONSUM_RATE_AMOUNT = 0.5;
56  const float PARAM_BURN_DAMAGE_COEF = 5.0;
58  const float PARAM_ITEM_HEAT_MIN_TEMP = 40;
60  const float PARAM_FULL_HEAT_RADIUS = 2.0;
61  const float PARAM_HEAT_RADIUS = 4.0;
62  const float PARAM_HEAT_THROUGH_AIR_COEF = 0.1;
64  const int MIN_STONES_TO_BUILD_CIRCLE = 8;
66  const int MIN_STONES_TO_BUILD_OVEN = 16;
68  const float MIN_CEILING_HEIGHT = 5;
69  //
70  const float TEMPERATURE_LOSS_MP_DEFAULT = 1.0;
71  const float TEMPERATURE_LOSS_MP_STONES = 0.90; //10% boost
72  const float TEMPERATURE_LOSS_MP_OVEN = 0.75; //25% boost
73 
74  const float FUEL_BURN_RATE_DEFAULT = 1.0;
75  const float FUEL_BURN_RATE_STONES = 0.92;
76  const float FUEL_BURN_RATE_OVEN = 0.85;
77 
79  const float PARAM_COOKING_TEMP_THRESHOLD = 100;
80  const float PARAM_COOKING_EQUIP_MAX_TEMP = 250;
82  const int TIMER_HEATING_UPDATE_INTERVAL = 3;
85  const int DIRECT_COOKING_SLOT_COUNT = 3;
87  const float DIRECT_COOKING_SPEED = 1.5; // per second
88  const int SMOKING_SLOT_COUNT = 4;
89  const float SMOKING_SPEED = 1; // per second
90 
91  // stage lifetimes
92  const int LIFETIME_FIREPLACE_STONE_CIRCLE = 172800;
93  const int LIFETIME_FIREPLACE_STONE_OVEN = 604800;
94 
95  const float IGNITE_WIND_THRESHOLD = 0.8; //fireplace can not be ignited above this multiple of max wind
96 
97  //Timers
98  protected ref Timer m_HeatingTimer;
99  protected ref Timer m_CoolingTimer;
100 
101  // Light entity
102  protected FireplaceLight m_Light;
103  protected float m_LightDistance = 2000;
104 
105  //Attachments
110 
111  //Particles - default for FireplaceBase
112  protected int PARTICLE_FIRE_START = ParticleList.CAMP_FIRE_START;
113  protected int PARTICLE_OVEN_FIRE_START = ParticleList.CAMP_STOVE_FIRE_START;
114  protected int PARTICLE_SMALL_FIRE = ParticleList.CAMP_SMALL_FIRE;
115  protected int PARTICLE_NORMAL_FIRE = ParticleList.CAMP_NORMAL_FIRE;
116  protected int PARTICLE_OVEN_FIRE = ParticleList.CAMP_STOVE_FIRE;
117  protected int PARTICLE_SMALL_SMOKE = ParticleList.CAMP_SMALL_SMOKE;
118  protected int PARTICLE_NORMAL_SMOKE = ParticleList.CAMP_NORMAL_SMOKE;
119  protected int PARTICLE_FIRE_END = ParticleList.CAMP_FIRE_END;
120  protected int PARTICLE_OVEN_FIRE_END = ParticleList.CAMP_STOVE_FIRE_END;
121  protected int PARTICLE_STEAM_END = ParticleList.CAMP_STEAM_2END;
122  protected int PARTICLE_STEAM_EXTINGUISHING = ParticleList.CAMP_STEAM_EXTINGUISH_START;
123  protected int PARTICLE_NO_IGNITE_WIND = ParticleList.CAMP_NO_IGNITE_WIND;
124  //
133 
134  //Sounds
135  const string SOUND_FIRE_HEAVY = "HeavyFire_SoundSet";
136  const string SOUND_FIRE_LIGHT = "LightFire_SoundSet";
137  const string SOUND_FIRE_NO_FIRE = "NoFuelFire_SoundSet";
138  const string SOUND_FIRE_EXTINGUISHING = "ExtinguishByWater_SoundSet";
139  const string SOUND_FIRE_EXTINGUISHED = "ExtinguishByWaterEnd_SoundSet";
140 
141  //
144  //
145 
146  //Fuel
147  //Kindling / Fuel item types
148  protected static ref map<typename, ref FireConsumableType> m_FireConsumableTypes;
150 
151  //Player action / status messages
152  const string MESSAGE_IGNITE_IGNIT_ITEM_DAMAGED = "You cannot start fire. Fireplace is ruined.";
153  const string MESSAGE_IGNITE_NO_KINDLING = "There needs to be some kindling to start a fire.";
154  const string MESSAGE_IGNITE_TOO_WET = "The fireplace is too wet to be ignited.";
155  const string MESSAGE_IGNITE_RAIN = "The fire went out because of the rain.";
156  const string MESSAGE_IGNITE_WIND = "The fire went out because of the wind.";
157  const string MESSAGE_IGNITE_IN_WATER = "I cannot ignite the fireplace in the water.";
158  const string MESSAGE_IGNITE_UNDER_LOW_ROOF = "I cannot ignite the fireplace here, the is not enough room.";
159  const string MESSAGE_REIGNITE_NO_KINDLING = "There needs to be some kindling to start a fire.";
160  const string MESSAGE_REIGNITE_RAIN = "Cannot reignite fireplace in rain.";
161  const string MESSAGE_REIGNITE_TOO_WET = "The fireplace is too wet to be reignited.";
162  const string MESSAGE_BURY_ASHES_FAILED_NOT_EMPTY = "Cannot bury ashes. There are sill items in it.";
163  const string MESSAGE_BURY_ASHES_FAILED_SURFACE = "Cannot bury ashes on hard surface.";
164  const string MESSAGE_BURY_ASHES_FAILED_BURNING = "Cannot bury ashes, the fireplace is still burning.";
165  const string MESSAGE_BURY_ASHES_FAILED_TOO_HOT = "Cannot bury ashes, the fireplace is too hot.";
166  const string MESSAGE_CANNOT_BUILD_OVEN = "Cannot build oven.";
167  const string MESSAGE_CANNOT_DISMANTLE_OVEN = "Cannot dismantle oven.";
168 
169  //Visual animations
170  const string ANIMATION_ASHES = "Ashes";
171  const string ANIMATION_KINDLING = "Kindling";
172  const string ANIMATION_STICKS = "Sticks";
173  const string ANIMATION_WOOD = "Wood";
174  const string ANIMATION_BURNT_WOOD = "BurntWood";
175  const string ANIMATION_STONE = "Stone";
176  const string ANIMATION_STONES = "StonesCircle";
177  const string ANIMATION_TRIPOD = "Tripod";
178  const string ANIMATION_OVEN = "Oven";
179  const string ANIMATION_INVENTORY = "Inventory";
180  const string ANIMATION_COOKWARE_HANDLE = "handleRotate";
181  const string ANIMATION_CAULDRON_HANDLE = "handle1Rotate";
182 
183 
184  //Visual textures and materials
185  const string MATERIAL_FIREPLACE_GLOW = "dz\\gear\\cooking\\data\\stoneground.rvmat";
186  const string MATERIAL_FIREPLACE_NOGLOW = "dz\\gear\\cooking\\data\\stonegroundnoemit.rvmat";
187 
188  //Attachment types
189  //Fuel
191  typename ATTACHMENT_FIREWOOD = Firewood;
192  //Kindling
193  typename ATTACHMENT_RAGS = Rag;
194  typename ATTACHMENT_BANDAGE = BandageDressing;
195  typename ATTACHMENT_BOOK = ItemBook;
196  typename ATTACHMENT_BARK_OAK = Bark_Oak;
197  typename ATTACHMENT_BARK_BIRCH = Bark_Birch;
198  typename ATTACHMENT_PAPER = Paper;
199  typename ATTACHMENT_GIFTWRAP = GiftWrapPaper;
202  //Other
203  typename ATTACHMENT_TRIPOD = Tripod;
204  typename ATTACHMENT_COOKINGSTAND = CookingStand;
205  typename ATTACHMENT_STONES = Stone;
206  typename ATTACHMENT_COOKING_POT = Pot;
207  typename ATTACHMENT_FRYING_PAN = FryingPan;
208  typename ATTACHMENT_CAULDRON = Cauldron;
209  //
210  const string OBJECT_CLUTTER_CUTTER = "ClutterCutterFireplace";
212 
213  //area damage
215 
216  //quantity
217  protected float m_TotalEnergy;
218 
219  // Noise
221  private bool m_CanNoise = true; // Flip every fireplace update to limit amount of noise generation
222 
223  // UniversalTemperatureSource
227 
228  //================================================================
229  // INIT / STORE LOAD-SAVE
230  //================================================================
231  //Constructor
232  protected void FireplaceBase()
233  {
234  //STATIC: define kindling types
235  if (!m_FireConsumableTypes)
236  {
237  m_FireConsumableTypes = new ref map<typename, ref FireConsumableType>();
238  m_FireConsumableTypes.Insert(ATTACHMENT_RAGS, new FireConsumableType(ATTACHMENT_RAGS, 14, true, "Rags"));
239  m_FireConsumableTypes.Insert(ATTACHMENT_BANDAGE, new FireConsumableType(ATTACHMENT_BANDAGE, 14, true, "MedicalBandage"));
240  m_FireConsumableTypes.Insert(ATTACHMENT_BOOK, new FireConsumableType(ATTACHMENT_BOOK, 36, true, "Book"));
241  m_FireConsumableTypes.Insert(ATTACHMENT_BARK_OAK, new FireConsumableType(ATTACHMENT_BARK_OAK, 20, true, "OakBark"));
242  m_FireConsumableTypes.Insert(ATTACHMENT_BARK_BIRCH, new FireConsumableType(ATTACHMENT_BARK_BIRCH, 14, true, "BirchBark"));
243  m_FireConsumableTypes.Insert(ATTACHMENT_PAPER, new FireConsumableType(ATTACHMENT_PAPER, 10, true, "Paper"));
244  m_FireConsumableTypes.Insert(ATTACHMENT_GIFTWRAP, new FireConsumableType(ATTACHMENT_GIFTWRAP, 10, true, "GiftWrapPaper"));
245  m_FireConsumableTypes.Insert(ATTACHMENT_PUNCHEDCARD, new FireConsumableType(ATTACHMENT_PUNCHEDCARD, 10, true, "PunchedCard"));
246  m_FireConsumableTypes.Insert(ATTACHMENT_EYEMASK_COLORBASE, new FireConsumableType(ATTACHMENT_EYEMASK_COLORBASE, 10, true, "EyeMask_ColorBase"));
247 
248  //define fuel types
249  m_FireConsumableTypes.Insert(ATTACHMENT_STICKS, new FireConsumableType( ATTACHMENT_STICKS, 40, false, "WoodenStick"));
250  m_FireConsumableTypes.Insert(ATTACHMENT_FIREWOOD, new FireConsumableType( ATTACHMENT_FIREWOOD, 100, false, "Firewood"));
251  }
252 
253  //calculate total energy
255 
256  //define fuel / kindling items (fire consumables)
258 
259  //default burning parameters
262 
263  //synchronized variables
264  RegisterNetSyncVariableBool( "m_IsBurning" );
265  RegisterNetSyncVariableBool( "m_HasAshes" );
266  RegisterNetSyncVariableBool( "m_IsOven" );
267  RegisterNetSyncVariableBool( "m_HasStoneCircle" );
268  RegisterNetSyncVariableBool( "m_RoofAbove" );
269  RegisterNetSyncVariableInt( "m_FireState", FireplaceFireState.NO_FIRE, FireplaceFireState.COUNT );
270  RegisterNetSyncVariableBool( "m_IsSoundSynchRemote" );
271  RegisterNetSyncVariableBool( "m_IsPlaceSound" );
272  RegisterNetSyncVariableBool( "m_NoIgnite" );
273 
274  m_HalfExtents = vector.Zero;
275  }
276 
277  protected void ~FireplaceBase()
278  {
280 
281  if (GetLightEntity())
282  {
283  GetLightEntity().FadeOut();
284  }
285  }
286 
287  override void EEInit()
288  {
289  super.EEInit();
290 
291  //refresh visual on init
293 
294  if (GetGame().IsServer() || !GetGame().IsMultiplayer())
295  {
297  m_UTSSettings.m_AffectStat = true;
298  m_UTSSettings.m_ManualUpdate = true;
299  m_UTSSettings.m_TemperatureMin = 0;
300  m_UTSSettings.m_TemperatureMax = PARAM_NORMAL_FIRE_TEMPERATURE;
303  m_UTSSettings.m_RangeMax = PARAM_HEAT_RADIUS;
304 
306  m_UTSLFireplace.SetSmallFireplaceTemperatureMax(PARAM_SMALL_FIRE_TEMPERATURE);
307  m_UTSLFireplace.SetNormalFireplaceTemperatureMax(PARAM_NORMAL_FIRE_TEMPERATURE);
308 
310  }
311  }
312 
313  override void EEItemAttached(EntityAI item, string slot_name)
314  {
315  super.EEItemAttached(item, slot_name);
316 
317  //cookware
318  switch (item.Type())
319  {
320  case ATTACHMENT_CAULDRON:
323  SetCookingEquipment(ItemBase.Cast(item));
324  break;
325  }
326  }
327 
328  override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
329  {
330  super.OnItemLocationChanged(old_owner, new_owner);
331 
332  //refresh physics after location change (with delay)
333  GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).Call(RefreshFireplacePhysics);
334  }
335 
336  override void OnAttachmentRuined(EntityAI attachment)
337  {
338  switch (attachment.Type())
339  {
340  case ATTACHMENT_TRIPOD:
342  int slot = InventorySlots.GetSlotIdFromString("CookingEquipment");
343  EntityAI ent = GetInventory().FindAttachment(slot);
344  if (ent)
345  {
346  switch (ent.Type())
347  {
349  case ATTACHMENT_CAULDRON:
351  vector direction = ent.GetDirection();
352  float dot = vector.Dot(direction, vector.Forward);
353 
354  float angle = Math.Acos(dot);
355  if (direction[0] < 0)
356  {
357  angle = -angle;
358  }
359 
360  float cos = Math.Cos(angle);
361  float sin = Math.Sin(angle);
362  GetInventory().DropEntityInBounds(InventoryMode.SERVER, this, ent, "2 0 2", angle, cos, sin);
363  break;
364  }
365  }
366 
367  attachment.Delete();
368  break;
369  }
370  }
371 
372  override void EEDelete(EntityAI parent)
373  {
374  super.EEDelete(parent);
375 
377 
378  // cleanup particles (for cases of leaving burning fplace and going back outside of network bubble)
379  #ifndef SERVER
381  #endif
382  }
383 
384  //on store save/load
385  override void OnStoreSave( ParamsWriteContext ctx )
386  {
387  super.OnStoreSave(ctx);
388 
389  //Save ashes state
390  ctx.Write( m_HasAshes );
391 
392  //Save temperature loss MP
393  ctx.Write( m_TemperatureLossMP );
394 
395  //Save fuel burn rate MP
396  ctx.Write( m_FuelBurnRateMP );
397 
398  //Save burning state
399  ctx.Write( m_IsBurning );
400  }
401 
402  override bool OnStoreLoad( ParamsReadContext ctx, int version )
403  {
404  if ( !super.OnStoreLoad(ctx, version) )
405  return false;
406 
407  //--- Fireplace data ---
408  //Load ashes state
409  if ( !ctx.Read( m_HasAshes ) )
410  {
411  m_HasAshes = false; //set default
412  return false;
413  }
414 
415  //Load temperature loss MP
416  if ( !ctx.Read( m_TemperatureLossMP ) )
417  {
418  m_TemperatureLossMP = 1.0; //set default
419  return false;
420  }
421 
422  //Load fuel burn rate MP
423  if ( !ctx.Read( m_FuelBurnRateMP ) )
424  {
425  m_FuelBurnRateMP = 1.0; //set default
426  return false;
427  }
428 
429  //Load burning state, if true start fire
430  if ( !ctx.Read( m_IsBurning ) )
431  {
432  m_IsBurning = false; //set default
433  return false;
434  }
435  //---
436 
437  return true;
438  }
439 
440  override void AfterStoreLoad()
441  {
442  super.AfterStoreLoad();
443 
444  Synchronize();
445 
446  //start fire
447  if (IsBurning() )
448  {
449  if (GetGame() && GetGame().IsServer())
450  {
451  StartFire(true); //will be auto-synchronized when starting fire
452  }
453  }
454  }
455 
456  //================================================================
457  // SYNCHRONIZATION
458  //================================================================
459  void Synchronize()
460  {
461  if ( GetGame() && GetGame().IsServer() )
462  {
463  SetSynchDirty();
464 
465  if ( GetGame().IsMultiplayer() && GetGame().IsServer() )
466  {
467  //Refresh visuals (on server)
468  GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).Call( RefreshFireplaceVisuals );
469  }
470  }
471  }
472 
473  override void OnVariablesSynchronized()
474  {
475  super.OnVariablesSynchronized();
476 
479 
480  if (IsPlaceSound())
481  {
482  PlayPlaceSound();
483  }
484 
485  if (IsBaseFireplace() && !IsOven())
486  {
487  if (m_IsBurning && !m_AreaDamage)
488  {
489  CreateAreaDamage();
490  }
491  else if (!m_IsBurning && m_AreaDamage)
492  {
494  }
495  }
496  }
497 
498  //================================================================
499  // BASE
500  //================================================================
501 
502  //States
503  //check fireplace types
504  override bool IsFireplace()
505  {
506  return true;
507  }
508 
509  bool IsBaseFireplace()
510  {
511  return false;
512  }
513 
514  bool IsBarrelWithHoles()
515  {
516  return false;
517  }
518 
519  bool IsFireplaceIndoor()
520  {
521  return false;
522  }
523 
524  bool IsIndoorOven()
525  {
526  return false;
527  }
528 
529  override bool CanHaveWetness()
530  {
531  return true;
532  }
533 
534  override bool CanHaveTemperature()
535  {
536  return true;
537  }
538 
539  //cooking equipment
541  {
542  return m_CookingEquipment;
543  }
544 
545  void SetCookingEquipment(ItemBase equipment)
546  {
547  m_CookingEquipment = equipment;
548  }
549 
551  {
552  if (m_CookingProcess)
553  {
554  m_CookingProcess.TerminateCookingSounds(pItem);
555  }
556 
557  SetCookingEquipment(null);
558  }
559 
562  {
563  SetCookingEquipment(null);
564  }
565 
567  {
568  for (int i = 0; i < DIRECT_COOKING_SLOT_COUNT; i++)
569  {
570  if ( m_DirectCookingSlots[i] )
571  {
572  return true;
573  }
574  }
575  return false;
576  }
577 
579  {
580  for (int i = 0; i < SMOKING_SLOT_COUNT; i++)
581  {
582  if ( m_SmokingSlots[i] )
583  {
584  return true;
585  }
586  }
587  return false;
588  }
589 
592  {
593  DeleteSafe();
594  }
595 
596  override bool IsPrepareToDelete()
597  {
598  return IsEmpty() && !IsBurning() && !HasAshes();
599  }
600 
601  override void EECargoOut(EntityAI item)
602  {
603  super.EECargoOut(item);
604 
605  CheckForDestroy();
606  }
607 
608  //================================================================
609  // VISUAL
610  //================================================================
611  //Fireplace visual
613  {
614  if (IsHologram())
615  {
616  return;
617  }
618 
619  // Light
620  #ifndef SERVER
621  if (IsBurning() )
622  {
623  //turn light on
624  if (!GetLightEntity())
625  {
626  SetLightEntity(FireplaceLight.Cast(ScriptedLightBase.CreateLight(FireplaceLight, GetPosition(), 20)));
627  GetLightEntity().AttachOnMemoryPoint(this, "light");
628  }
629 
630  if (GetLightEntity() && GetLightEntity().GetBrightness() > 0)
631  {
632  // change brightness based on the distance of player to the fireplace
633  Object player = GetGame().GetPlayer();
634  float lightDist = m_LightDistance;
635 
636  if (IsOven())
637  {
638  lightDist = 50;
639  }
640 
641  if (player)
642  {
643  if (vector.DistanceSq(player.GetPosition(), this.GetPosition()) > lightDist * lightDist)
644  {
645  GetLightEntity().FadeBrightnessTo(0, 5);
646  }
647  else
648  {
649  GetLightEntity().FadeBrightnessTo(FireplaceLight.m_FireplaceBrightness, 5);
650  }
651  }
652 
653  // The following solves an issue with the light point clipping through narrow geometry
654  if (IsItemTypeAttached(ATTACHMENT_STONES) || IsBarrelWithHoles() || IsFireplaceIndoor())
655  {
656  GetLightEntity().SetInteriorMode();
657  }
658  else
659  {
660  GetLightEntity().SetExteriorMode();
661  }
662  }
663  }
664  else
665  {
666  //turn light off
667  if (GetLightEntity())
668  {
669  GetLightEntity().FadeOut();
670  }
671  }
672  #endif
673 
674  //set default burn parameters based on fireplace type
675  if (IsBarrelWithHoles() || IsFireplaceIndoor() || IsIndoorOven() || IsOven())
676  {
679  }
680  else if (HasStoneCircle())
681  {
684  }
685  else
686  {
689  }
690 
691  // Oven attachments
692  if (IsOven())
693  {
694  //lock attachment slots
696  {
697  LockOvenAttachments(true);
698  }
699  }
700  else
701  {
702  //unlock attachment slots
704  {
705  LockOvenAttachments(false);
706  }
707  }
708 
709  //VISUAL STATES
710  //Fuel state
711  if ( GetGame().IsServer() ) // SetAnimationPhase should ideally be called on server only..
712  {
713  // Sticks state
715  SetAnimationPhase( ANIMATION_STICKS, 0 );
716  else
717  SetAnimationPhase( ANIMATION_STICKS, 1 );
718 
719  // Firewood state
721  {
722  if ( IsBurning() && HasAshes() )
723  {
724  SetAnimationPhase( ANIMATION_BURNT_WOOD, 0 ); // Because this might not be set under certain circumstances
725  SetAnimationPhase( ANIMATION_WOOD, 1 );
726  }
727 
728  if ( IsWet() || !IsBurning() )
729  {
730  SetAnimationPhase( ANIMATION_BURNT_WOOD, 1 );
731  SetAnimationPhase( ANIMATION_WOOD, 0 );
732  }
733  }
734  else
735  {
736  SetAnimationPhase( ANIMATION_WOOD, 1 );
737  SetAnimationPhase( ANIMATION_BURNT_WOOD, 1 );
738  }
739 
740  // Kindling state
741  if ( GetKindlingCount() != 0 )
742  SetAnimationPhase( ANIMATION_KINDLING, 0 );
743  else
744  SetAnimationPhase( ANIMATION_KINDLING, 1 );
745 
746  // Ashes state
747  if ( HasAshes() )
748  SetAnimationPhase( ANIMATION_ASHES, 0 );
749  else
750  SetAnimationPhase( ANIMATION_ASHES, 1 );
751 
752  // Stone variations
753  if (HasStones())
754  {
755  if (HasStoneCircle())
756  {
757  SetAnimationPhase(ANIMATION_STONES, 0);
758  SetAnimationPhase(ANIMATION_STONE, 1);
759  }
760  else if (IsOven())
761  {
762  SetAnimationPhase(ANIMATION_OVEN, 0);
763  SetAnimationPhase(ANIMATION_STONE, 1);
764  }
765  else
766  {
768  SetAnimationPhase(ANIMATION_STONES, 1);
769  SetAnimationPhase(ANIMATION_OVEN, 1);
770  SetAnimationPhase(ANIMATION_STONE, 0);
771  }
772  }
773  else
774  {
775  SetAnimationPhase(ANIMATION_STONE, 1);
776  }
777  }
778 
779  //refresh physics (with delay)
780  GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).Call(RefreshFireplacePhysics);
781  }
782 
783  protected void SetBurntFirewood()
784  {
785  if ( GetGame().IsServer() && IsInAnimPhase( ANIMATION_WOOD ) )
786  {
787  SetAnimationPhase( ANIMATION_WOOD, 1 );
788  SetAnimationPhase( ANIMATION_BURNT_WOOD, 0 );
789  }
790  }
791 
792  //Refresh fireplace object physics
793  void RefreshFireplacePhysics();
794 
795  protected void RefreshFireParticlesAndSounds( bool force_refresh )
796  {
797  FireplaceFireState fire_state = GetFireState();
798 
799  if ( m_LastFireState != fire_state || force_refresh )
800  {
801  switch ( fire_state )
802  {
803  case FireplaceFireState.START_FIRE:
804  {
805  //particles
807 
808  //sounds
809  SoundFireStop();
811  break;
812  }
813  case FireplaceFireState.SMALL_FIRE:
814  {
815  //particles
817 
819 
820  if ( CanShowSmoke() )
821  ParticleSmallSmokeStart();
822  else
824 
827 
829 
830  //sounds
831  SoundFireStop();
833  break;
834  }
835  case FireplaceFireState.NORMAL_FIRE:
836  {
837  //particles
839 
842 
844 
845  if ( CanShowSmoke() )
846  ParticleNormalSmokeStart();
847  else
849 
851 
852  //sounds
853  SoundFireStop();
855  break;
856  }
857  case FireplaceFireState.END_FIRE:
858  {
859  //particles
861 
864 
867 
869 
870  //sounds
871  SoundFireStop();
873  break;
874  }
875  case FireplaceFireState.EXTINGUISHING_FIRE: //TODO add steam particles when extinguishing
876  {
877  //particles
879 
882 
885 
887 
889 
890  //sounds
891  SoundFireStop();
893  break;
894  }
895  case FireplaceFireState.EXTINGUISHED_FIRE: //TODO add steam particles when fireplace is extinguished
896  {
897  //particles
899 
902 
905 
907 
909 
910  if ( CanShowSmoke() )
912  else
914 
915  //sounds
916  SoundFireStop();
919  break;
920  }
921  case FireplaceFireState.REIGNITED_FIRE:
922  {
923  //particles
925 
928 
931 
933 
935 
936  //sounds
937  SoundFireStop();
938  break;
939  }
940  case FireplaceFireState.NO_FIRE:
941  {
942  //particles
944 
947 
950 
952 
955 
956  //sounds
957  SoundFireStop();
958  break;
959  }
960  }
961 
962  m_LastFireState = fire_state;
963  }
964  }
965 
966  protected void StopAllParticlesAndSounds()
967  {
968  // go through all fireplace particles
969  if ( m_ParticleFireStart )
971  if ( m_ParticleSmallFire )
973  if ( m_ParticleNormalFire )
975  if ( m_ParticleSmallSmoke )
977  if ( m_ParticleNormalSmoke )
979  if ( m_ParticleFireEnd )
981  if ( m_ParticleSteamEnd )
985 
986  // go through all fireplace sounds
987  if ( m_SoundFireLoop )
988  StopSoundSet( m_SoundFireLoop );
989  if ( m_SoundFire )
990  StopSoundSet( m_SoundFire );
991  }
992 
993  bool CanShowSmoke()
994  {
995  return true;
996  }
997 
998  //Fireplace fire intensity
1000  {
1001  float temperature = GetTemperature();
1002 
1003  //if it's burning
1004  if (IsBurning())
1005  {
1006  //Start fire
1007  if (temperature <= PARAM_MIN_FIRE_TEMPERATURE)
1008  {
1009  if ( GetFireState() != FireplaceFireState.START_FIRE )
1010  {
1011  SetFireState( FireplaceFireState.START_FIRE );
1012  }
1013  }
1014  //Small fire
1015  else if (temperature <= PARAM_SMALL_FIRE_TEMPERATURE)
1016  {
1017  if ( GetFireState() != FireplaceFireState.SMALL_FIRE )
1018  {
1019  SetFireState( FireplaceFireState.SMALL_FIRE );
1020  }
1021  }
1022  //Normal fire
1023  else if (temperature > PARAM_SMALL_FIRE_TEMPERATURE)
1024  {
1025  if ( GetFireState() != FireplaceFireState.NORMAL_FIRE )
1026  {
1027  SetFireState( FireplaceFireState.NORMAL_FIRE );
1028  }
1029  }
1030  }
1031  }
1032 
1033  //================================================================
1034  // PARTICLES & SOUNDS
1035  //================================================================
1036  //returns true if particle started, false if not
1037  protected bool PlayParticle( out Particle particle, int particle_type, vector pos, bool worldpos = false )
1038  {
1039  if ( !particle && GetGame() && ( !GetGame().IsDedicatedServer() ) )
1040  {
1041  if ( !worldpos )
1042  {
1043  particle = ParticleManager.GetInstance().PlayOnObject( particle_type, this, pos );
1044  }
1045  else
1046  {
1047  particle = ParticleManager.GetInstance().PlayInWorld( particle_type, pos );
1048  }
1049 
1050  return true;
1051  }
1052 
1053  return false;
1054  }
1055 
1056  //returns true if particle stopped, false if not
1057  protected bool StopParticle( out Particle particle )
1058  {
1059  if ( particle && GetGame() && ( !GetGame().IsDedicatedServer() ) )
1060  {
1061  particle.Stop();
1062  particle = NULL;
1063 
1064  return true;
1065  }
1066 
1067  return false;
1068  }
1069 
1070  //start fire
1071  protected void ParticleFireStartStart()
1072  {
1073  if ( IsOven() )
1074  {
1076  }
1077  else
1078  {
1080  }
1081  }
1082 
1083  protected void ParticleFireStartStop()
1084  {
1086  }
1087 
1088  //small fire
1089  protected void ParticleSmallFireStart()
1090  {
1091  if ( IsOven() )
1092  {
1094  }
1095  else
1096  {
1098  }
1099  }
1100 
1101  protected void ParticleSmallFireStop()
1102  {
1104  }
1105 
1106  //normal fire
1107  protected void ParticleNormalFireStart()
1108  {
1109  if ( IsOven() )
1110  {
1112  }
1113  else
1114  {
1116  }
1117  }
1118 
1119  protected void ParticleNormalFireStop()
1120  {
1122  }
1123 
1124  //small smoke
1125  protected void ParticleSmallSmokeStart()
1126  {
1127  PlayParticle( m_ParticleSmallSmoke, PARTICLE_SMALL_SMOKE, GetSmokeEffectPosition() );
1128 
1129  //calculate air resistance
1130  float actual_height;
1131  if ( GetCeilingHeight( actual_height ) )
1132  {
1133  float air_resistance = GetAirResistanceForSmokeParticles( actual_height );
1134 
1135  //alter smoke height
1136  m_ParticleSmallSmoke.SetParameter( -1, EmitorParam.AIR_RESISTANCE, air_resistance );
1137  }
1138 
1139  if ( IsRoofAbove() )
1140  {
1141  m_ParticleSmallSmoke.SetParameter( -1, EmitorParam.WIND, false );
1142  }
1143  }
1144 
1145  protected void ParticleSmallSmokeStop()
1146  {
1148  }
1149 
1150  //normal smoke
1151  protected void ParticleNormalSmokeStart()
1152  {
1153  PlayParticle( m_ParticleNormalSmoke, PARTICLE_NORMAL_SMOKE, GetSmokeEffectPosition() );
1154 
1155  //calculate air resistance
1156  float actual_height;
1157  if ( GetCeilingHeight( actual_height ) )
1158  {
1159  float air_resistance = GetAirResistanceForSmokeParticles( actual_height );
1160 
1161  //alter smoke height
1162  m_ParticleNormalSmoke.SetParameter( -1, EmitorParam.AIR_RESISTANCE, air_resistance );
1163  }
1164 
1165  if ( IsRoofAbove() )
1166  {
1167  m_ParticleNormalSmoke.SetParameter( -1, EmitorParam.WIND, false );
1168  }
1169  }
1170 
1171  protected void ParticleNormalSmokeStop()
1172  {
1174  }
1175 
1176  //fire end
1177  protected void ParticleFireEndStart()
1178  {
1179  if ( IsOven() )
1180  {
1182  }
1183  else
1184  {
1186  }
1187  }
1188 
1189  protected void ParticleFireEndStop()
1190  {
1192  }
1193 
1195  {
1196  if ( IsOven() )
1197  {
1199  }
1200  else
1201  {
1203  }
1204  }
1205 
1206  //steam extinguishing
1208  {
1210  }
1211 
1213  {
1215  }
1216 
1217  //steam end
1218  protected void ParticleSteamEndStart()
1219  {
1221  }
1222 
1223  protected void ParticleSteamEndStop()
1224  {
1226  }
1227 
1228  protected void ParticleWetNoIgniteStart()
1229  {
1231  }
1232 
1233  protected void ParticleWetNoIgniteStop()
1234  {
1236  }
1237 
1238  bool GetCeilingHeight( out float actual_height )
1239  {
1240  vector from = this.GetPosition();
1241  vector to = this.GetPosition();
1242  from[1] = from[1] + 1.0;
1243  to[1] = to[1] + MIN_CEILING_HEIGHT;
1244  vector contactPos;
1245  vector contactDir;
1246  int contactComponent;
1247 
1248  bool hit = DayZPhysics.RaycastRV( from, to, contactPos, contactDir, contactComponent, NULL, NULL, this );
1249  actual_height = vector.Distance( from, contactPos ) + 1.0;
1250 
1251  return hit;
1252  }
1253 
1254  float GetAirResistanceForSmokeParticles( float actual_height )
1255  {
1256  float air_res;
1257  actual_height = Math.Clamp( actual_height, 0, 36 );
1258 
1259  air_res = ( 6 - actual_height ) * 0.33;
1260  air_res = Math.Clamp( air_res, 0, 2 );
1261 
1262  return air_res;
1263  }
1264 
1265  //Particle Positions
1266  //Get local fire and smoke effect position
1268  {
1269  return Vector( 0, 0.05, 0 );
1270  }
1271 
1272  protected vector GetSmokeEffectPosition()
1273  {
1274  return Vector( 0, 0.05, 0 );
1275  }
1276 
1277  //================================================================
1278  // SOUNDS
1279  //================================================================
1280  //Burning
1281  //Start
1282  protected void SoundFireLightStart()
1283  {
1284  PlaySoundSetLoop( m_SoundFireLoop, SOUND_FIRE_LIGHT, 1.0, 1.0 );
1285  }
1286 
1287  protected void SoundFireHeavyStart()
1288  {
1289  PlaySoundSetLoop( m_SoundFireLoop, SOUND_FIRE_HEAVY, 1.0, 2.0 );
1290  }
1291 
1292  protected void SoundFireNoFireStart()
1293  {
1294  PlaySoundSetLoop( m_SoundFireLoop, SOUND_FIRE_NO_FIRE, 2.0, 2.0 );
1295  }
1296 
1298  {
1299  PlaySoundSet( m_SoundFire, SOUND_FIRE_EXTINGUISHED, 0.1, 0.1 );
1300  }
1301 
1302  protected void SoundFireWetNoIgniteStart()
1303  {
1304  PlaySoundSet( m_SoundFire, SOUND_FIRE_EXTINGUISHED, 0.1, 0.1 );
1305  }
1306 
1308  {
1309  PlaySoundSetLoop( m_SoundFireLoop, SOUND_FIRE_EXTINGUISHING, 1.0, 0.5 );
1310  }
1311 
1313  {
1314  PlaySoundSet( m_SoundFire, "ExtinguishByWind_SoundSet", 0, 0 );
1315  }
1316 
1317  //Stop
1318  protected void SoundFireStop()
1319  {
1320  StopSoundSet( m_SoundFireLoop );
1321  }
1322 
1323  //================================================================
1324  // FUEL / KINDLING
1325  //================================================================
1326  //Add to fire consumables
1327  protected void AddToFireConsumables(ItemBase item)
1328  {
1329  m_FireConsumables.Insert(item, new FireConsumable(item, GetFireConsumableTypeEnergy(item)));
1331  }
1332 
1334  {
1335  FireConsumableType fireConsumableType = m_FireConsumableTypes.Get(item.Type());
1336  if (!fireConsumableType)
1337  {
1339  int count = m_FireConsumableTypes.Count();
1340  for (int i = 0; i < count; ++i)
1341  {
1342  if (item.IsInherited(m_FireConsumableTypes.GetKey(i)))
1343  fireConsumableType = m_FireConsumableTypes.GetElement(i);
1344  }
1345  }
1346 
1347  if (fireConsumableType)
1348  return fireConsumableType.GetEnergy();
1349 
1350  return 0;
1351  }
1352 
1353  //Remove from fire consumables
1354  protected void RemoveFromFireConsumables(FireConsumable fire_consumable)
1355  {
1356  if (fire_consumable)
1357  {
1358  m_FireConsumables.Remove(fire_consumable.GetItem());
1359  delete fire_consumable;
1360  }
1361 
1363  }
1364 
1366  {
1367  return m_FireConsumables.Get(item);
1368  }
1369 
1370  //Set fuel / kindling to consume
1371  //Sets the item with the lowest energy value as item that will be consumed next
1372  //Returns reference to set fire consumable
1374  {
1375  if (m_FireConsumables.Count() == 0)
1376  {
1377  m_ItemToConsume = null;
1378  }
1379  else
1380  {
1381  for (int i = 0; i < m_FireConsumables.Count(); ++i)
1382  {
1383  ItemBase key = m_FireConsumables.GetKey(i);
1384  FireConsumable fireConsumable = m_FireConsumables.Get(key);
1385 
1386  if (i == 0)
1387  {
1388  m_ItemToConsume = fireConsumable;
1389  }
1390  else
1391  {
1392  if (fireConsumable.GetEnergy() < m_ItemToConsume.GetEnergy())
1393  {
1394  m_ItemToConsume = fireConsumable;
1395  }
1396  }
1397  }
1398  }
1399 
1400  //refresh visual
1402 
1403  return m_ItemToConsume;
1404  }
1405 
1407  {
1408  return m_ItemToConsume;
1409  }
1410 
1411  //Spend item that is used as consumable for fire (fuel, kindling)
1412  //if 'amount == 0', the whole quantity will be consumed (quantity -= 1 )
1413  //debug
1414  //int m_debug_fire_consume_time = 0;
1415  protected void SpendFireConsumable(float amount)
1416  {
1417  //spend item
1418  FireConsumable fireConsumable = GetItemToConsume();
1419 
1420  if (!fireConsumable)
1421  {
1422  //Set new item to consume
1423  fireConsumable = SetItemToConsume();
1424  }
1425 
1426  if (fireConsumable)
1427  {
1428  ItemBase item = fireConsumable.GetItem();
1429  fireConsumable.SetRemainingEnergy(fireConsumable.GetRemainingEnergy() - amount);
1430 
1431  if (fireConsumable.GetRemainingEnergy() <= 0 || amount == 0)
1432  {
1433  //set ashes
1434  if (!HasAshes())
1435  {
1436  SetAshesState(true);
1437  }
1438 
1439  if (item.IsAnyInherited({ItemBook, Paper, GiftWrapPaper, EyeMask_ColorBase}))
1440  {
1441  RemoveFromFireConsumables(fireConsumable);
1442  item.Delete();
1443  }
1444  else
1445  {
1446  //if there is nothing left, delete and remove old consumable, set new fire consumable
1447  if (item.GetQuantity() <= 1)
1448  {
1449  //remove item from fuel items
1450  RemoveFromFireConsumables(fireConsumable);
1451  }
1452  else
1453  {
1454  fireConsumable.SetRemainingEnergy(fireConsumable.GetEnergy());
1455  }
1456 
1457  item.AddQuantity(-1);
1458  SetItemToConsume();
1459  }
1460  }
1461  }
1462 
1464  }
1465 
1467  protected int GetKindlingCount()
1468  {
1469  int attachmentsCount = GetInventory().AttachmentCount();
1470  int kindlingCount = 0;
1471 
1472  for (int i = 0; i < attachmentsCount; ++i)
1473  {
1474  ItemBase item = ItemBase.Cast(GetInventory().GetAttachmentFromIndex(i));
1475 
1476  if (IsKindling(item))
1477  kindlingCount++;
1478  }
1479 
1480  return kindlingCount;
1481  }
1482 
1484  protected int GetFuelCount()
1485  {
1486  int attachmentsCount = GetInventory().AttachmentCount();
1487  int fuelCount = 0;
1488 
1489  for (int i = 0; i < attachmentsCount; ++i)
1490  {
1491  ItemBase item = ItemBase.Cast(GetInventory().GetAttachmentFromIndex(i));
1492  if (IsFuel(item))
1493  fuelCount++;
1494  }
1495 
1496  return fuelCount;
1497  }
1498 
1500  protected bool IsKindling(ItemBase item)
1501  {
1502  FireConsumableType fireConsumableType = m_FireConsumableTypes.Get(item.Type());
1503  if (!fireConsumableType)
1504  {
1506  int count = m_FireConsumableTypes.Count();
1507  for (int i = 0; i < count; ++i)
1508  {
1509  if (item.IsInherited(m_FireConsumableTypes.GetKey(i)))
1510  fireConsumableType = m_FireConsumableTypes.GetElement(i);
1511  }
1512  }
1513 
1514  return fireConsumableType && fireConsumableType.IsKindling();
1515  }
1516 
1518  protected bool IsFuel(ItemBase item)
1519  {
1520  FireConsumableType fireConsumableType = m_FireConsumableTypes.Get(item.Type());
1521  if (!fireConsumableType)
1522  {
1524  int count = m_FireConsumableTypes.Count();
1525  for (int i = 0; i < count; ++i)
1526  {
1527  if (item.IsInherited(m_FireConsumableTypes.GetKey(i)))
1528  fireConsumableType = m_FireConsumableTypes.GetElement(i);
1529  }
1530  }
1531 
1532  return fireConsumableType && !fireConsumableType.IsKindling();
1533  }
1534 
1535  //Has attachments of given type
1536  bool IsItemTypeAttached(typename item_type)
1537  {
1538  return GetAttachmentByType(item_type) != null;
1539  }
1540 
1541  //Has attachments of required quantity
1542  bool IsItemAttachedQuantity(typename item_type, float quantity)
1543  {
1544  ItemBase item = ItemBase.Cast(GetAttachmentByType(item_type));
1545 
1546  return item.GetQuantity() >= quantity;
1547  }
1548 
1549  //Has last attached item
1551  {
1552  return GetInventory().AttachmentCount() == 1;
1553  }
1554 
1555  //Has last fuel/kindling attached
1557  {
1558  return (GetFuelCount() + GetKindlingCount()) == 1;
1559  }
1560 
1561 
1562  //================================================================
1563  // FIRE STATE
1564  //================================================================
1565  //Is fireplace burning?
1566  bool IsBurning()
1567  {
1568  return m_IsBurning;
1569  }
1570 
1571  //Set burning state
1572  protected void SetBurningState(bool is_burning)
1573  {
1574  m_IsBurning = is_burning;
1575  }
1576 
1577  //Are ashes present in fireplace?
1578  bool HasAshes()
1579  {
1580  return m_HasAshes;
1581  }
1582 
1583  //Set ashes state
1584  protected void SetAshesState(bool has_ashes)
1585  {
1586  m_HasAshes = has_ashes;
1587 
1588  if (m_HasAshes)
1589  {
1590  SetBurntFirewood();
1591  }
1592  }
1593 
1594  //Is in oven state
1595  bool IsOven()
1596  {
1597  return m_IsOven;
1598  }
1600  {
1601  return m_HasStoneCircle;
1602  }
1603 
1604  bool HasStones()
1605  {
1606  EntityAI attached_item = GetAttachmentByType(ATTACHMENT_STONES);
1607 
1608  return attached_item && attached_item.GetQuantity() > 0;
1609  }
1610 
1612  {
1613  if (HasStones())
1614  {
1615  return GetAttachmentByType(ATTACHMENT_STONES).GetQuantity();
1616  }
1617 
1618  return 0;
1619  }
1620 
1621  void SetOvenState( bool is_oven )
1622  {
1623  if ( m_IsOven != is_oven )
1624  {
1625  m_IsOven = is_oven;
1626  m_RoofAbove = is_oven;
1627 
1628  GetInventory().SetSlotLock( InventorySlots.GetSlotIdFromString("Stones") , is_oven);
1629 
1630  Synchronize();
1631  }
1632  }
1633  void SetStoneCircleState( bool has_stonecircle )
1634  {
1635  if ( m_HasStoneCircle != has_stonecircle )
1636  {
1637  m_HasStoneCircle = has_stonecircle;
1638 
1639  GetInventory().SetSlotLock( InventorySlots.GetSlotIdFromString("Stones") , has_stonecircle);
1640 
1641  Synchronize();
1642  }
1643  }
1644 
1645  //Temperature loss MP
1646  protected float GetTemperatureLossMP()
1647  {
1648  return m_TemperatureLossMP;
1649  }
1650 
1651  protected void SetTemperatureLossMP( float value )
1652  {
1653  m_TemperatureLossMP = value;
1654  }
1655 
1656  //Fuel burn rate MP
1657  protected float GetFuelBurnRateMP()
1658  {
1659  return m_FuelBurnRateMP;
1660  }
1661 
1662  protected void SetFuelBurnRateMP( float value )
1663  {
1664  m_FuelBurnRateMP = value;
1665  }
1666 
1667  //Get fire state
1668  protected int GetFireState()
1669  {
1670  return m_FireState;
1671  }
1672 
1673  //Sets fire state
1674  protected void SetFireState( FireplaceFireState state )
1675  {
1676  if ( m_FireState != state )
1677  {
1678  m_FireState = state;
1679 
1680  Synchronize();
1681  }
1682  }
1683 
1685  {
1686  SetFireState( FireplaceFireState.EXTINGUISHING_FIRE );
1687  }
1688 
1689  //================================================================
1690  // FIRE PROCESS
1691  //================================================================
1692 
1693  //Start the fire process
1694  // 1. start heating
1695  // 2. heating
1696  // 3. stop heating
1697  void StartFire(bool force_start = false)
1698  {
1699  //stop cooling process if active
1700  if (m_CoolingTimer)
1701  {
1702  m_CoolingTimer.Stop();
1703  m_CoolingTimer = null;
1704  }
1705 
1706  //set under roof flag (was fire ignited under roof?)
1707  if (MiscGameplayFunctions.IsUnderRoof(this))
1708  m_RoofAbove = true;
1709 
1710  //start fire
1711  if (!IsBurning() || force_start)
1712  {
1713  SetItemToConsume();
1714  SetBurningState(true);
1715  m_UTSource.SetActive(true);
1716  StartHeating();
1717 
1718  //Update navmesh
1719  if (!IsFireplaceIndoor())
1720  {
1721  SetAffectPathgraph(false, true);
1722  GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, this);
1723  }
1724  }
1725 
1726  Synchronize();
1727  }
1728 
1729  //Start heating
1730  protected void StartHeating()
1731  {
1732  //visual
1733  SetObjectMaterial(0, MATERIAL_FIREPLACE_GLOW);
1734 
1735  if (IsWindy() && !IsRoofAbove() && !IsOven() && !IsBarrelWithHoles())
1736  {
1737  StopFire();
1738  return;
1739  }
1740 
1742  {
1743  StopFire(FireplaceFireState.EXTINGUISHED_FIRE);
1744  return;
1745  }
1746 
1747  //create area damage
1748  if (IsBaseFireplace() && !IsOven())
1749  CreateAreaDamage();
1750 
1752  m_HeatingTimer.Run(TIMER_HEATING_UPDATE_INTERVAL, this, "Heating", null, true);
1753 
1754  //Setup the noise parameters on fire start
1755  m_NoisePar = new NoiseParams();
1756  if (IsRoofAbove() || IsOven() || IsFireplaceIndoor()) //If we have a roof, we are probably inside
1757  m_NoisePar.LoadFromPath("CfgVehicles FireplaceBase NoiseFireplaceSpecial");
1758  else
1759  m_NoisePar.LoadFromPath("CfgVehicles FireplaceBase NoiseFireplaceBase");
1760  }
1761 
1762  //Do heating
1763  protected void Heating()
1764  {
1765  float temperature = GetTemperature();
1766  float temperature_modifier = 0;
1767 
1768  //check burning conditions
1770  {
1771  StopFire(FireplaceFireState.EXTINGUISHED_FIRE);
1772  return;
1773  }
1774  else
1775  {
1776  if (m_FireConsumables.Count() == 0)
1777  {
1778  StopFire();
1779  return;
1780  }
1781  }
1782 
1783  //spend actual fire consumable
1785  SpendFireConsumable(amount);
1786 
1787  //set wetness if raining and alter temperature modifier (which will lower temperature increase because of rain)
1788  float rain = GetGame().GetWeather().GetRain().GetActual();
1789  if (rain >= PARAM_BURN_WET_THRESHOLD && !IsRoofAbove())
1790  {
1791  //set wet to fireplace
1793 
1794  //set temperature modifier
1795  temperature_modifier = PARAM_TEMPERATURE_INCREASE * rain;
1796  }
1797  //subtract wetness when heating and not raining above
1798  else
1799  {
1801  }
1802 
1803  // temperature via UniversalTemperatureSource
1804  m_UTSLFireplace.SetFuelCount(GetFuelCount());
1805  temperature = GetTemperature() + (PARAM_TEMPERATURE_INCREASE * TIMER_HEATING_UPDATE_INTERVAL) - temperature_modifier;
1806  m_UTSLFireplace.SetCurrentTemperature(temperature);
1808 
1809  //check fire state
1810  if ( GetFireState() != FireplaceFireState.EXTINGUISHING_FIRE )
1811  {
1812  RefreshFireState();
1813  }
1814 
1815  //damage cargo items
1817 
1818  //manage cooking equipment (this applies only for case of cooking pot on a tripod)
1820  {
1821  float cook_equip_temp = m_CookingEquipment.GetTemperature();
1822 
1823  if ( cook_equip_temp >= PARAM_COOKING_TEMP_THRESHOLD )
1824  {
1825  //start cooking
1827  }
1828 
1829  //DEBUG
1830  /*
1831  PlayerBase player = ( PlayerBase ) GetGame().GetPlayer();
1832  string s_message = "cooking equipment temp = " + ftoa(cook_equip_temp) + " | PARAM_COOKING_TEMP_THRESHOLD = " + ftoa(PARAM_COOKING_TEMP_THRESHOLD);
1833  if (player != NULL) {player.MessageAction (s_message);}
1834  Print ( s_message );
1835  */
1836  //set temperature to cooking equipment
1837  cook_equip_temp = cook_equip_temp + PARAM_COOKING_EQUIP_TEMP_INCREASE;
1838  if ( temperature <= PARAM_SMALL_FIRE_TEMPERATURE )
1839  {
1840  cook_equip_temp = Math.Clamp ( cook_equip_temp, PARAM_ITEM_HEAT_MIN_TEMP, PARAM_SMALL_FIRE_TEMPERATURE );
1841  }
1842  else
1843  {
1844  cook_equip_temp = Math.Clamp ( cook_equip_temp, PARAM_ITEM_HEAT_MIN_TEMP, PARAM_COOKING_EQUIP_MAX_TEMP );
1845  }
1846 
1847  m_CookingEquipment.SetTemperature( cook_equip_temp );
1848  }
1849 
1850  float cook_item_temp;
1851  int i;
1852  // manage cooking on direct cooking slots
1853  if ( DirectCookingSlotsInUse() )
1854  {
1855  for ( i = 0; i < DIRECT_COOKING_SLOT_COUNT; i++ )
1856  {
1857  if ( m_DirectCookingSlots[i] )
1858  {
1859  cook_item_temp = m_DirectCookingSlots[i].GetTemperature();
1860  if ( cook_item_temp >= PARAM_COOKING_TEMP_THRESHOLD )
1861  {
1862  CookOnDirectSlot( m_DirectCookingSlots[i], cook_item_temp, temperature );
1863  }
1864  }
1865  }
1866  }
1867 
1868  // manage smoking slots
1869  if ( SmokingSlotsInUse() )
1870  {
1871  for ( i = 0; i < SMOKING_SLOT_COUNT; i++ )
1872  {
1873  if ( m_SmokingSlots[i] )
1874  {
1875  SmokeOnSmokingSlot( m_SmokingSlots[i], cook_item_temp, temperature );
1876  }
1877  }
1878  }
1879 
1880  //Make noise for AI, only at night
1881  if ( GetGame().GetWorld().IsNight() && m_CanNoise )
1882  {
1883  NoiseSystem noise = GetGame().GetNoiseSystem();
1884  if ( noise && m_NoisePar )
1885  {
1886  noise.AddNoisePos( this, GetPosition(), m_NoisePar);
1887  }
1888  m_CanNoise = false;
1889  }
1890  else
1891  m_CanNoise = true;
1892 
1893  Synchronize();
1894  }
1895 
1896  //Stop the fire process
1897  // 1. start cooling
1898  // 2. cooling
1899  // 3. stop cooling
1900  void StopFire( FireplaceFireState fire_state = FireplaceFireState.END_FIRE )
1901  {
1902  StopHeating();
1904  SetBurningState(false);
1905  StartCooling();
1906  SetFireState(fire_state);
1907 
1908  //Update navmesh
1909  if (!IsFireplaceIndoor())
1910  {
1911  SetAffectPathgraph(false, false);
1912  GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, this);
1913  }
1914 
1915  Synchronize();
1916  }
1917 
1918  protected void StopHeating()
1919  {
1920  if (!m_HeatingTimer)
1921  return;
1922 
1923  m_HeatingTimer.Stop();
1924  m_HeatingTimer = null;
1925  }
1926 
1927  protected void StartCooling()
1928  {
1929  if (m_HeatingTimer)
1930  {
1931  m_HeatingTimer.Stop();
1932  m_HeatingTimer = null;
1933  }
1934 
1935  //Start cooling
1937  m_CoolingTimer.Run(TIMER_COOLING_UPDATE_INTERVAL, this, "Cooling", null, true);
1938  }
1939 
1940  protected void Cooling()
1941  {
1942  float wetness = GetWet();
1943  float temperature = GetTemperature();
1944  float temperature_modifier = 0;
1945 
1946  if (!IsBurning() && temperature >= 10)
1947  {
1948  //check wetness
1949  //set wetness if raining and alter temperature modifier (which will lower temperature increase because of rain)
1950  float rain = GetGame().GetWeather().GetRain().GetActual();
1951  if (IsRainingAbove() && !IsRoofAbove())
1952  {
1953  //set wet to fireplace
1955 
1956  //set temperature modifier
1957  temperature_modifier = temperature_modifier + ( PARAM_TEMPERATURE_DECREASE * rain );
1958  }
1959  else //subtract wetness
1960  {
1962  }
1963 
1964  //calculate already obtained wetness (e.g. extinguished by water)
1965  temperature_modifier = temperature_modifier + ( PARAM_TEMPERATURE_DECREASE * wetness );
1966 
1967  // temperature via UniversalTemperatureSource
1968  m_UTSLFireplace.SetFuelCount(GetFuelCount());
1969  temperature = GetTemperature() - (PARAM_TEMPERATURE_DECREASE * TIMER_COOLING_UPDATE_INTERVAL) - temperature_modifier;
1970  m_UTSLFireplace.SetCurrentTemperature(temperature);
1972 
1973  //damage cargo items
1975 
1976  //cook with equipment if temperature of equipment is still high
1977  if ( m_CookingEquipment )
1978  {
1979  float cook_equip_temp = m_CookingEquipment.GetTemperature();
1980 
1981  if ( cook_equip_temp >= PARAM_COOKING_TEMP_THRESHOLD )
1982  {
1983  //cook
1985  }
1986  }
1987 
1988  float cook_item_temp;
1989  int i;
1990 
1991  // manage cooking on direct cooking slots
1992  if ( DirectCookingSlotsInUse() )
1993  {
1994  for ( i = 0; i < DIRECT_COOKING_SLOT_COUNT; i++ )
1995  {
1996  if ( m_DirectCookingSlots[i] )
1997  {
1998  cook_item_temp = m_DirectCookingSlots[i].GetTemperature();
1999  if ( cook_item_temp >= PARAM_COOKING_TEMP_THRESHOLD )
2000  {
2001  CookOnDirectSlot( m_DirectCookingSlots[i], cook_item_temp, temperature );
2002  }
2003  }
2004  }
2005  }
2006 
2007  // manage smoking slots
2008  if ( SmokingSlotsInUse() )
2009  {
2010  for ( i = 0; i < SMOKING_SLOT_COUNT; i++ )
2011  {
2012  if ( m_SmokingSlots[i] )
2013  {
2014  SmokeOnSmokingSlot( m_SmokingSlots[i], cook_item_temp, temperature );
2015  }
2016  }
2017  }
2018 
2019  //Debug
2020  //PlayerBase player = ( PlayerBase ) GetGame().GetPlayer();
2021  //if (player != NULL) {player.MessageAction ( temperature.ToString() );}
2022  }
2023  else
2024  {
2025  //stop cooling
2026  if (Math.AbsFloat(temperature) < 10)
2027  {
2028  StopCooling();
2029  m_UTSource.SetActive(false);
2030  }
2031  }
2032  }
2033 
2034  protected void StopCooling()
2035  {
2036  //stop all fire visuals
2038  SetObjectMaterial(0, MATERIAL_FIREPLACE_NOGLOW);
2039 
2040  //Stop cooling
2041  m_CoolingTimer.Stop();
2042  m_CoolingTimer = NULL;
2043 
2044  //destroy area damage
2046 
2047  //remove cookware audio visuals
2048  if (GetCookingEquipment())
2049  {
2050  Bottle_Base cooking_pot = Bottle_Base.Cast(GetCookingEquipment());
2051  if ( cooking_pot )
2052  cooking_pot.RemoveAudioVisualsOnClient();
2053  }
2054 
2056  {
2057  for ( int i = 0; i < DIRECT_COOKING_SLOT_COUNT; i++ )
2058  {
2059  if ( m_DirectCookingSlots[i] )
2060  {
2061  Bottle_Base cookingpot = Bottle_Base.Cast( m_DirectCookingSlots[i] );
2062  if ( cookingpot )
2063  cookingpot.RemoveAudioVisualsOnClient();
2064 
2065  FryingPan fryingpan = FryingPan.Cast( m_DirectCookingSlots[i] );
2066  if ( fryingpan )
2067  fryingpan.RemoveAudioVisualsOnClient();
2068 
2069  Edible_Base itsfood = Edible_Base.Cast( m_DirectCookingSlots[i] );
2070  if ( itsfood )
2071  itsfood.MakeSoundsOnClient( false );
2072  }
2073  }
2074  }
2075  }
2076 
2077  //================================================================
2078  // COOKING
2079  //================================================================
2080  protected void CookWithEquipment()
2081  {
2082  if (m_CookingProcess == null)
2083  {
2084  m_CookingProcess = new Cooking();
2085  }
2086 
2087  m_CookingProcess.CookWithEquipment(m_CookingEquipment);
2088  }
2089 
2091  {
2092  if (m_CookingProcess == null)
2093  {
2094  m_CookingProcess = new Cooking();
2095  }
2096 
2097  return m_CookingProcess;
2098  }
2099 
2100  protected void CookOnDirectSlot(ItemBase slot_item, float temp_equip, float temp_ext)
2101  {
2102  if (m_CookingProcess == null)
2103  {
2104  m_CookingProcess = new Cooking();
2105  }
2106 
2107  m_CookingProcess.CookWithEquipment(slot_item);
2108 
2109  switch (slot_item.Type())
2110  {
2111  case ATTACHMENT_CAULDRON:
2113  case ATTACHMENT_FRYING_PAN:
2114  float cookEquipTemp = temp_equip + PARAM_COOKING_EQUIP_TEMP_INCREASE;
2115  if ( temp_ext <= PARAM_SMALL_FIRE_TEMPERATURE )
2116  {
2117  cookEquipTemp = Math.Clamp(cookEquipTemp, PARAM_ITEM_HEAT_MIN_TEMP, PARAM_SMALL_FIRE_TEMPERATURE);
2118  }
2119  else
2120  {
2121  cookEquipTemp = Math.Clamp(cookEquipTemp, PARAM_ITEM_HEAT_MIN_TEMP, PARAM_COOKING_EQUIP_MAX_TEMP);
2122  }
2123  slot_item.SetTemperature(cookEquipTemp);
2124  break;
2125  }
2126  }
2127 
2128  protected void SmokeOnSmokingSlot( ItemBase slot_item, float temp_equip, float temp_ext )
2129  {
2130  if ( m_CookingProcess == NULL )
2131  {
2132  m_CookingProcess = new Cooking();
2133  }
2134 
2135  // smoking slots accept only individual meat/fruit/veg items
2136  Edible_Base ingr = Edible_Base.Cast( slot_item );
2137  if ( ingr )
2138  {
2139  m_CookingProcess.SmokeItem( ingr, FireplaceBase.TIMER_HEATING_UPDATE_INTERVAL * FireplaceBase.SMOKING_SPEED );
2140  }
2141  }
2142 
2143  //================================================================
2144  // FIRE VICINITY
2145  //================================================================
2146  //apply damage to all items, raise temperature to only specific items
2147  protected void BurnItemsInFireplace()
2148  {
2150  CargoBase cargo = GetInventory().GetCargo();
2151  for (int i = 0; i < cargo.GetItemCount(); i++)
2152  {
2153  ItemBase item = ItemBase.Cast(cargo.GetItem(i));
2154 
2155  //set damage
2156  AddDamageToItemByFireEx(item, false, false);
2157 
2158  if (item.GetHealth("", "Health") <= 0 && !item.IsKindOf("Grenade_Base"))
2159  {
2160  item.Delete();
2161  }
2162 
2163  //add temperature
2165 
2166  //remove wetness
2168  }
2169 
2171  for (int j = 0; j < GetInventory().AttachmentCount(); ++j)
2172  {
2173  ItemBase attachment = ItemBase.Cast(GetInventory().GetAttachmentFromIndex(j));
2174 
2175  //set damage
2176  AddDamageToItemByFireEx(attachment, false, true);
2177 
2178  //add temperature
2179  AddTemperatureToItemByFire(attachment);
2180 
2181  //remove wetness
2183  }
2184  }
2185 
2186  //add temperature to item by fire
2188  {
2189  if (item.GetTemperatureMax() >= PARAM_ITEM_HEAT_MIN_TEMP)
2190  {
2191  float temperature = item.GetTemperature() + PARAM_ITEM_HEAT_TEMP_INCREASE_COEF;
2192  temperature = Math.Clamp(temperature, PARAM_ITEM_HEAT_MIN_TEMP, PARAM_MAX_ITEM_HEAT_TEMP_INCREASE);
2193  item.SetTemperature(temperature);
2194  }
2195  }
2196 
2198  protected void AddTemperatureToFireplace(float amount) {};
2199 
2200  //add damage to item by fire
2201  protected void AddDamageToItemByFireEx(ItemBase item, bool can_be_ruined, bool pAttachment)
2202  {
2203  if (!item)
2204  {
2205  return;
2206  }
2207 
2209  {
2210  return;
2211  }
2212 
2214  if (!pAttachment)
2215  {
2217  GameInventory itemInventory = item.GetInventory();
2218  if (itemInventory)
2219  {
2220  for (int i = 0; i < itemInventory.AttachmentCount(); ++i)
2221  {
2222  itemInventory.GetAttachmentFromIndex(i).AddHealth("", "", -PARAM_BURN_DAMAGE_COEF);
2223  }
2224  }
2225 
2226  item.AddHealth("", "", -PARAM_BURN_DAMAGE_COEF);
2227  }
2228  else
2229  {
2230  float timerCoef = 1.0;
2231  if (m_HeatingTimer && m_HeatingTimer.IsRunning())
2232  {
2233  timerCoef = TIMER_HEATING_UPDATE_INTERVAL;
2234  }
2235  else if (m_CoolingTimer && m_CoolingTimer.IsRunning())
2236  {
2237  timerCoef = TIMER_COOLING_UPDATE_INTERVAL;
2238  }
2239 
2240  switch (item.Type())
2241  {
2242  case ATTACHMENT_TRIPOD:
2245  case ATTACHMENT_CAULDRON:
2246  case ATTACHMENT_FRYING_PAN:
2247  item.DecreaseHealth(GameConstants.FIRE_ATTACHMENT_DAMAGE_PER_SECOND * timerCoef, false);
2248  break;
2249  }
2250 
2252  if (IsFuel(item) || IsKindling(item))
2253  {
2254  if (item.GetHealthLevel() < GameConstants.STATE_BADLY_DAMAGED)
2255  {
2256  item.DecreaseHealth(PARAM_BURN_DAMAGE_COEF, false);
2257  }
2258  }
2259 
2261  if (item.CanBeCooked() && item.GetHealthLevel() >= GameConstants.STATE_BADLY_DAMAGED)
2262  {
2263  Edible_Base edible_item = Edible_Base.Cast( item );
2264  edible_item.ChangeFoodStage(FoodStageType.BURNED);
2265  }
2266  }
2267  }
2268 
2269  // DEPRECATED
2270  protected void AddDamageToItemByFire(ItemBase item, bool can_be_ruined)
2271  {
2272  item.DecreaseHealth( PARAM_BURN_DAMAGE_COEF, false );
2273 
2274  if ( item.CanBeCooked() & item.GetHealthLevel() >= GameConstants.STATE_BADLY_DAMAGED )
2275  {
2276  Edible_Base edible_item = Edible_Base.Cast( item );
2277  edible_item.ChangeFoodStage( FoodStageType.BURNED );
2278  }
2279  }
2280 
2281  //add wetness on item
2282  protected void AddWetnessToItem(ItemBase item, float amount)
2283  {
2284  float wetness = item.GetWet();
2285  wetness = wetness + amount;
2286  wetness = Math.Clamp(wetness, 0, 1); //wetness <0-1>
2287  item.SetWet(wetness);
2288  }
2289 
2290  //add wetness on fireplace
2291  void AddWetnessToFireplace(float amount)
2292  {
2293  //add wetness
2294  float wetness = GetWet();
2295  wetness = wetness + amount;
2296  wetness = Math.Clamp(wetness, 0, 1); //wetness <0-1>
2297  SetWet(wetness);
2298 
2299  //decrease temperature
2300  if (amount > 0)
2301  {
2302  float temperature = GetTemperature();
2303  temperature = temperature * ( 1 - ( wetness * 0.5 ) );
2304  temperature = Math.Clamp( temperature, PARAM_MIN_FIRE_TEMPERATURE, PARAM_NORMAL_FIRE_TEMPERATURE );
2305  // temperature via UniversalTemperatureSource
2306  m_UTSLFireplace.SetFuelCount(GetFuelCount());
2307  m_UTSLFireplace.SetCurrentTemperature(temperature);
2308  }
2309  }
2310 
2312  protected void TransferHeatToNearPlayers() {}
2313 
2314  //Create and Destroy damage radius around the fireplace when starting/stopping burning process
2315  void CreateAreaDamage()
2316  {
2317  //destroy area damage if some already exists
2319 
2320  //create new area damage
2321  m_AreaDamage = new AreaDamageLoopedDeferred( this );
2322  m_AreaDamage.SetDamageComponentType(AreaDamageComponentTypes.HITZONE);
2323  m_AreaDamage.SetExtents("-0.30 0 -0.30", "0.30 0.75 0.30");
2324  m_AreaDamage.SetLoopInterval( 0.5 );
2325  m_AreaDamage.SetDeferDuration( 0.5 );
2326  m_AreaDamage.SetHitZones( { "Head","Torso","LeftHand","LeftLeg","LeftFoot","RightHand","RightLeg","RightFoot" } );
2327  m_AreaDamage.SetAmmoName( "FireDamage" );
2328  m_AreaDamage.Spawn();
2329  }
2330 
2332  {
2333  if ( m_AreaDamage )
2334  {
2335  m_AreaDamage.Destroy();
2336  }
2337  }
2338 
2341  {
2342  ErrorEx("Deprecated method", ErrorExSeverity.INFO);
2343 
2344  return false;
2345  }
2346 
2347  //================================================================
2348  // ACTIONS
2349  //================================================================
2350  // --- Actions / Action conditions
2351  //Check if there is some kindling attached
2353  {
2354  return GetKindlingCount() > 0;
2355  }
2356 
2357  //Check if the weather is too windy
2358  static bool IsWindy()
2359  {
2360  //check wind
2361  float wind_speed = GetGame().GetWeather().GetWindSpeed();
2362  float wind_speed_threshold = GetGame().GetWeather().GetWindMaximumSpeed() * FireplaceBase.IGNITE_WIND_THRESHOLD;
2363 
2364  return ( wind_speed >= wind_speed_threshold );
2365  }
2366 
2368  {
2369  return m_NoIgnite;
2370  }
2371 
2372  void SetIgniteFailure( bool failure )
2373  {
2374  m_NoIgnite = failure;
2375  }
2376 
2377  //Check if the fireplace is too wet to be ignited
2378  static bool IsEntityWet( notnull EntityAI entity_ai )
2379  {
2380  return ( entity_ai.GetWet() >= FireplaceBase.PARAM_MAX_WET_TO_IGNITE );
2381  }
2382 
2383  bool IsWet()
2384  {
2385  return FireplaceBase.IsEntityWet( this );
2386  }
2387 
2388  //Check if there is any roof above fireplace
2390  {
2391  return m_RoofAbove;
2392  }
2393 
2394  //check if fireplace is opened
2395  override bool IsOpen()
2396  {
2397  return true;
2398  }
2399 
2400  //Check if there is enough space for smoke
2402  {
2403  return !MiscGameplayFunctions.IsUnderRoof( this, FireplaceBase.MIN_CEILING_HEIGHT );
2404  }
2405 
2406  //Check if it's raining and there is only sky above fireplace
2407  static bool IsRainingAboveEntity( notnull EntityAI entity_ai )
2408  {
2409  return ( GetGame() && ( GetGame().GetWeather().GetRain().GetActual() >= FireplaceBase.PARAM_IGNITE_RAIN_THRESHOLD ) );
2410  }
2411 
2413  {
2414  return FireplaceBase.IsRainingAboveEntity( this );
2415  }
2416 
2417  //Check there is water surface bellow fireplace
2418  static bool IsEntityOnWaterSurface(notnull EntityAI entity_ai)
2419  {
2420  vector fireplacePosition = entity_ai.GetPosition();
2421  string surfaceType;
2422  g_Game.SurfaceGetType3D(fireplacePosition[0], fireplacePosition[1] + g_Game.SurfaceGetSeaLevel(), fireplacePosition[2], surfaceType);
2423  if (!surfaceType)
2424  {
2425  float waterLevelDiff = fireplacePosition[1] - g_Game.SurfaceGetSeaLevel();
2426  return waterLevelDiff < 0.5;
2427  }
2428  else if (surfaceType.Contains("water"))
2429  {
2430  return true;
2431  }
2432 
2433  return false;
2434  }
2436  {
2437  return FireplaceBase.IsEntityOnWaterSurface(this);
2438  }
2439 
2440  //check if the surface is interior
2441  static bool IsEntityOnInteriorSurface(notnull EntityAI entity_ai)
2442  {
2443  string surfaceType;
2444  vector fireplacePosition = entity_ai.GetPosition();
2445  GetGame().SurfaceGetType3D(fireplacePosition[0], fireplacePosition[1] + 1.0, fireplacePosition[2], surfaceType);
2446  return (GetGame().ConfigGetInt("CfgSurfaces " + surfaceType + " interior") == 1);
2447  }
2449  {
2450  return FireplaceBase.IsEntityOnInteriorSurface( this );
2451  }
2452 
2453  //Checks if has not additional items in it
2454  override bool IsEmpty()
2455  {
2456  return ( GetInventory().GetCargo().GetItemCount() == 0 && GetInventory().AttachmentCount() == 0 );
2457  }
2458 
2459  //Checks if it has no items in cargo
2461  {
2462  return ( GetInventory().GetCargo().GetItemCount() == 0 );
2463  }
2464 
2466  {
2467  return GetInventory().FindAttachment(InventorySlots.GetSlotIdFromString("CookingTripod")) != null;
2468  }
2469 
2470  //Check if object is in animation phase
2471  bool IsInAnimPhase( string anim_phase )
2472  {
2473  return GetAnimationPhase(anim_phase) == 0;
2474  }
2475 
2476  bool IsSpaceFor(vector size)
2477  {
2478  array<Object> objs = {};
2479  if (GetGame().IsBoxCollidingGeometry(GetWorldPosition() + Vector(0, size[1] * 0.5 + 0.1, 0), GetDirection().VectorToAngles(), size, ObjIntersect.View, ObjIntersect.Geom, {this}, objs))
2480  {
2481  foreach (Object obj : objs)
2482  {
2483  if (dBodyGetInteractionLayer(obj) == PhxInteractionLayers.ITEM_LARGE)
2484  return false;
2485  }
2486  }
2487  return true;
2488  }
2489 
2490 
2491  override bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
2492  {
2493  if (!otherDestination || otherDestination.GetParent() == this)
2494  {
2495  return false;
2496  }
2497  return true;
2498  }
2499 
2500  //Action condition for building oven
2502  {
2503  return !IsOven() && !IsBurning() && (GetAttachedStonesCount() >= MIN_STONES_TO_BUILD_OVEN) && !FindAttachmentBySlotName("CookingTripod") && !HasStoneCircle() && IsSpaceForOven();
2504  }
2505 
2507  {
2508  const float size = 0.6;
2509  return IsSpaceFor(Vector(size, size, size));
2510  }
2511 
2512  //Action condition for stone circle
2514  {
2516  }
2517 
2519  {
2520  return IsSpaceFor(Vector(0.9, 0.1, 0.9));
2521  }
2522 
2523  //Action condition for dismantling oven
2525  {
2527  }
2528  //Action condition for dismantling stone circle
2530  {
2531  return ( HasStoneCircle() && !IsOven() && !IsBurning() );
2532  }
2533 
2534  bool CanCookOnStick()
2535  {
2537  }
2538 
2539  //Can extinguish fire
2540  bool CanExtinguishFire()
2541  {
2542  return IsBurning();
2543  }
2544 
2545  FireplaceLight GetLightEntity()
2546  {
2547  return m_Light;
2548  }
2549 
2550  void SetLightEntity( FireplaceLight light )
2551  {
2552  m_Light = light;
2553  }
2554 
2555  //================================================================
2556  // ADVANCED PLACEMENT
2557  //================================================================
2558 
2559  override void OnPlacementComplete( Man player, vector position = "0 0 0", vector orientation = "0 0 0" )
2560  {
2561  super.OnPlacementComplete( player, position, orientation );
2562 
2563  if ( GetGame().IsServer() )
2564  {
2565  //remove grass
2566  Object cc_object = GetGame().CreateObjectEx( OBJECT_CLUTTER_CUTTER , position, ECE_PLACE_ON_SURFACE );
2567  cc_object.SetOrientation( orientation );
2568  GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( GetGame().ObjectDelete, 1000, false, cc_object );
2569 
2570  SetIsPlaceSound( true );
2571  }
2572  }
2573 
2574  override string GetPlaceSoundset()
2575  {
2576  return "placeFireplace_SoundSet";
2577  }
2578 
2579  //================================================================
2580  // QUANITTY
2581  //================================================================
2582  // calculates and sets total energy based on possible (fuel/kinidling) item attachments
2583  protected void CalcAndSetTotalEnergy()
2584  {
2585  if ( GetGame() && GetGame().IsServer() )
2586  {
2587  m_TotalEnergy = 0;
2588 
2589  foreach (FireConsumableType fireConsumableType : m_FireConsumableTypes)
2590  {
2591  string quantityConfigPath = string.Format("CfgVehicles %1 varQuantityMax", fireConsumableType.GetItemType().ToString());
2592  string stackMaxConfigPath = string.Format("CfgSlots Slot_%1 stackMax", fireConsumableType.GetAttSlot());
2593  if (GetGame().ConfigIsExisting(quantityConfigPath))
2594  {
2595  float quantityMax = GetGame().ConfigGetFloat(quantityConfigPath);
2596  }
2597 
2598  if (GetGame().ConfigIsExisting(stackMaxConfigPath))
2599  {
2600  float stackMax = GetGame().ConfigGetFloat(stackMaxConfigPath);
2601  }
2602 
2603  //debug
2604  //Print( fireConsumableType.GetItemType().ToString() + " quantityMax = " + quantityMax.ToString() + " [" + (quantity_max*fire_consumable_type.GetEnergy()).ToString() + "] | stack_max = " + stack_max.ToString() + " [" + (stack_max*fire_consumable_type.GetEnergy()).ToString() + "]" );
2605 
2606  if (stackMax > 0)
2607  {
2608  m_TotalEnergy += stackMax * fireConsumableType.GetEnergy();
2609  }
2610  else
2611  {
2612  m_TotalEnergy += quantityMax * fireConsumableType.GetEnergy();
2613  }
2614  }
2615 
2616  //debug
2617  //Print( "Total energy = " + m_TotalEnergy.ToString() );
2618  }
2619  }
2620 
2621  // calculates and sets current quantity based on actual (fuel/kinidling) item attachments
2622  protected void CalcAndSetQuantity()
2623  {
2624  if (GetGame() && GetGame().IsServer())
2625  {
2626  float remainingEnergy;
2627 
2628  foreach (FireConsumable fireConsumable : m_FireConsumables)
2629  {
2630  float quantity = fireConsumable.GetItem().GetQuantity();
2631  if (quantity > 0)
2632  {
2633  remainingEnergy += ((quantity - 1) * fireConsumable.GetEnergy()) + fireConsumable.GetRemainingEnergy();
2634  //Print( fireConsumable.GetItem().GetType() + " remaining energy = " + ( ( ( quantity - 1 ) * fire_consumable.GetEnergy() ) + fire_consumable.GetRemainingEnergy() ).ToString() );
2635  }
2636  else
2637  {
2638  remainingEnergy += fireConsumable.GetRemainingEnergy();
2639  //Print( fireConsumable.GetItem().GetType() + " remaining energy = " + ( fireConsumable.GetRemainingEnergy().ToString() ) );
2640  }
2641  }
2642 
2643  SetQuantity(remainingEnergy / m_TotalEnergy * GetQuantityMax());
2644  }
2645  }
2646 
2648  {
2649  super.OnAttachmentQuantityChanged(item);
2650 
2652  }
2653 
2654  override bool CanReleaseAttachment(EntityAI attachment)
2655  {
2656  if (!super.CanReleaseAttachment(attachment))
2657  return false;
2658 
2659  ItemBase item = ItemBase.Cast(attachment);
2660  if (IsKindling(item) || IsFuel(item))
2661  {
2662  return !IsBurning();
2663  }
2664 
2665  return true;
2666  }
2667 
2668  void LockOvenAttachments(bool lock)
2669  {
2670  //Print("LockOvenAttachments");
2671  //string path_cooking_equipment = "" + CFG_VEHICLESPATH + " " + GetType() + " GUIInventoryAttachmentsProps CookingEquipment attachmentSlots";
2672  string path_cooking_equipment = string.Format("%1 %2 GUIInventoryAttachmentsProps CookingEquipment attachmentSlots", CFG_VEHICLESPATH, GetType());
2673  //string path_direct_cooking = "" + CFG_VEHICLESPATH + " " + GetType() + " GUIInventoryAttachmentsProps DirectCooking attachmentSlots";
2674  string path_direct_cooking = string.Format("%1 %2 GUIInventoryAttachmentsProps DirectCooking attachmentSlots", CFG_VEHICLESPATH, GetType());
2675  if ( GetGame().ConfigIsExisting(path_cooking_equipment) && GetGame().ConfigIsExisting(path_direct_cooking) )
2676  {
2677  array<string> arr_cooking_equipment = new array<string>;
2678  array<string> arr_direct_cooking = new array<string>;
2679  GetGame().ConfigGetTextArray(path_cooking_equipment,arr_cooking_equipment);
2680  GetGame().ConfigGetTextArray(path_direct_cooking,arr_direct_cooking);
2681  for ( int i = 0; i < arr_cooking_equipment.Count(); i++ )
2682  {
2683  if ( lock != GetInventory().GetSlotLock(InventorySlots.GetSlotIdFromString(arr_cooking_equipment[i])) )
2684  {
2685  GetInventory().SetSlotLock(InventorySlots.GetSlotIdFromString(arr_cooking_equipment[i]),lock);
2686  //Print("attachment lock: " + arr_cooking_equipment[i] + " " + lock);
2687  }
2688  }
2689 
2690  for ( i = 0; i < arr_direct_cooking.Count(); i++ )
2691  {
2692  if ( lock == GetInventory().GetSlotLock(InventorySlots.GetSlotIdFromString(arr_direct_cooking[i])) )
2693  {
2694  GetInventory().SetSlotLock(InventorySlots.GetSlotIdFromString(arr_direct_cooking[i]),!lock);
2695  //Print("attachment lock: " + arr_direct_cooking[i] + " " + !lock);
2696  }
2697  }
2698  }
2700  }
2701  override bool DisassembleOnLastDetach()
2702  {
2703  return true;
2704  }
2705 
2706  override void OnRPC( PlayerIdentity sender, int rpc_type, ParamsReadContext ctx )
2707  {
2708  super.OnRPC( sender, rpc_type, ctx );
2709 
2710  ref Param1<bool> p = new Param1<bool>(false);
2711 
2712  if (ctx.Read(p))
2713  {
2714  bool failure = p.param1;
2715  }
2716 
2717  switch ( rpc_type )
2718  {
2719  case FirePlaceFailure.WIND:
2720 
2721  if ( failure )
2722  {
2724  SoundFireStop();
2726  }
2727 
2728  break;
2729 
2730  case FirePlaceFailure.WET:
2731 
2732  if ( failure )
2733  {
2735  SoundFireStop();
2737  }
2738 
2739  break;
2740  }
2741  }
2742 
2743 
2744  //================================================================
2745  // DEBUG
2746  //================================================================
2747 
2748  //Debug menu Spawn Ground Special
2749  override void OnDebugSpawn()
2750  {
2751  ItemBase firewood = ItemBase.Cast(GetInventory().CreateInInventory("Firewood"));
2752  firewood.SetQuantity(firewood.GetQuantityMax());
2753 
2754  ItemBase sticks = ItemBase.Cast(GetInventory().CreateInInventory("WoodenStick"));
2755  sticks.SetQuantity(sticks.GetQuantityMax());
2756 
2757  ItemBase stone = ItemBase.Cast(GetInventory().CreateInInventory("Stone"));
2758  stone.SetQuantity(stone.GetQuantityMax());
2759 
2760  GetInventory().CreateInInventory("Rag");
2761 
2762  SpawnEntityOnGroundPos("PetrolLighter", GetPosition());
2763  }
2764 
2765  override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
2766  {
2767  outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.ACTIVATE_ENTITY, "Ignite", FadeColors.LIGHT_GREY));
2768  outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.DEACTIVATE_ENTITY, "Extinguish", FadeColors.LIGHT_GREY));
2769  outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SEPARATOR, "___________________________", FadeColors.LIGHT_GREY));
2770 
2771  super.GetDebugActions(outputList);
2772  }
2773 
2774  override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
2775  {
2776  if (super.OnAction(action_id, player, ctx))
2777  return true;
2778  if (GetGame().IsServer() || !GetGame().IsMultiplayer())
2779  {
2780  if (action_id == EActions.ACTIVATE_ENTITY)
2781  {
2782  OnIgnitedThis(null);
2783  }
2784  else if (action_id == EActions.DEACTIVATE_ENTITY)
2785  {
2786  StopFire();
2787  }
2788  }
2789  return false;
2790  }
2791 
2792 
2793 }
WoodenStick
Definition: woodenstick.c:1
ItemBase
Definition: inventoryitem.c:730
RefreshFireParticlesAndSounds
protected void RefreshFireParticlesAndSounds(bool force_refresh)
Definition: fireplacebase.c:795
PARAM_TEMPERATURE_INCREASE
const float PARAM_TEMPERATURE_INCREASE
minimum fireplace temperature under which the fireplace is inactive (degree Celsius)
Definition: fireplacebase.c:46
UniversalTemperatureSourceLambdaFireplace
Definition: universaltemperaturesourcelambdafireplace.c:1
MESSAGE_BURY_ASHES_FAILED_TOO_HOT
const string MESSAGE_BURY_ASHES_FAILED_TOO_HOT
Definition: fireplacebase.c:165
IsOnWaterSurface
bool IsOnWaterSurface()
Definition: fireplacebase.c:2435
GetGame
proto native CGame GetGame()
GetCookingProcess
Cooking GetCookingProcess()
Definition: fireplacebase.c:2090
ParticleSteamEndStart
protected void ParticleSteamEndStart()
Definition: fireplacebase.c:1218
SoundFireExtinguishingStart
protected void SoundFireExtinguishingStart()
Definition: fireplacebase.c:1307
CALL_CATEGORY_SYSTEM
const int CALL_CATEGORY_SYSTEM
Definition: tools.c:8
m_UTSource
protected ref UniversalTemperatureSource m_UTSource
Definition: fireplacebase.c:224
GetWet
override float GetWet()
Definition: itembase.c:3602
SetTemperatureLossMP
protected void SetTemperatureLossMP(float value)
Definition: fireplacebase.c:1651
SetQuantity
bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Set item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
Definition: itembase.c:3159
PARAM_SMALL_FIRE_TEMPERATURE
const float PARAM_SMALL_FIRE_TEMPERATURE
Definition: fireplacebase.c:43
SOUND_FIRE_NO_FIRE
const string SOUND_FIRE_NO_FIRE
Definition: fireplacebase.c:137
MESSAGE_CANNOT_DISMANTLE_OVEN
const string MESSAGE_CANNOT_DISMANTLE_OVEN
Definition: fireplacebase.c:167
ATTACHMENT_CAULDRON
ATTACHMENT_CAULDRON
Definition: fireplacebase.c:208
ParticleSmallSmokeStop
protected void ParticleSmallSmokeStop()
Definition: fireplacebase.c:1145
SoundFireNoFireStart
protected void SoundFireNoFireStart()
Definition: fireplacebase.c:1292
PlayParticle
protected bool PlayParticle(out Particle particle, int particle_type, vector pos, bool worldpos=false)
Definition: fireplacebase.c:1037
ParticleWetNoIgniteStart
protected void ParticleWetNoIgniteStart()
Definition: fireplacebase.c:1228
dBodyGetInteractionLayer
proto native int dBodyGetInteractionLayer(notnull IEntity ent)
m_SoundFire
protected EffectSound m_SoundFire
Definition: fireplacebase.c:143
PARTICLE_OVEN_FIRE_END
protected int PARTICLE_OVEN_FIRE_END
Definition: fireplacebase.c:120
SoundFireExtinguishedStart
protected void SoundFireExtinguishedStart()
Definition: fireplacebase.c:1297
MESSAGE_CANNOT_BUILD_OVEN
const string MESSAGE_CANNOT_BUILD_OVEN
Definition: fireplacebase.c:166
PARAM_IGNITE_RAIN_THRESHOLD
const float PARAM_IGNITE_RAIN_THRESHOLD
minimum fireplace temperature under which the fireplace can be reignited using air only (degree Celsi...
Definition: fireplacebase.c:50
CookOnDirectSlot
protected void CookOnDirectSlot(ItemBase slot_item, float temp_equip, float temp_ext)
Definition: fireplacebase.c:2100
m_ParticleFireEnd
protected Particle m_ParticleFireEnd
Definition: fireplacebase.c:130
m_CookingProcess
protected ref Cooking m_CookingProcess
determines how fast will the fuel item burn before spending (lower is better)
Definition: fireplacebase.c:40
m_TemperatureLossMP
protected float m_TemperatureLossMP
Definition: fireplacebase.c:36
AddDamageToItemByFire
protected void AddDamageToItemByFire(ItemBase item, bool can_be_ruined)
Definition: fireplacebase.c:2270
MESSAGE_IGNITE_WIND
const string MESSAGE_IGNITE_WIND
Definition: fireplacebase.c:156
CALL_CATEGORY_GAMEPLAY
const int CALL_CATEGORY_GAMEPLAY
Definition: tools.c:10
SOUND_FIRE_EXTINGUISHED
const string SOUND_FIRE_EXTINGUISHED
Definition: fireplacebase.c:139
IsCargoEmpty
bool IsCargoEmpty()
Definition: fireplacebase.c:2460
GetIgniteFailure
bool GetIgniteFailure()
Definition: fireplacebase.c:2367
Particle
Legacy way of using particles in the game.
Definition: particle.c:6
PARAM_WET_COOLING_DECREASE_COEF
const float PARAM_WET_COOLING_DECREASE_COEF
value for calculating wetness loss during heating process
Definition: fireplacebase.c:54
ATTACHMENT_PUNCHEDCARD
ATTACHMENT_PUNCHEDCARD
Definition: fireplacebase.c:200
HasStones
bool HasStones()
Definition: fireplacebase.c:1604
MIN_CEILING_HEIGHT
const float MIN_CEILING_HEIGHT
maximum temperature for dismantling oven
Definition: fireplacebase.c:68
MESSAGE_IGNITE_IN_WATER
const string MESSAGE_IGNITE_IN_WATER
Definition: fireplacebase.c:157
m_UTSLFireplace
protected ref UniversalTemperatureSourceLambdaFireplace m_UTSLFireplace
Definition: fireplacebase.c:226
IsFireplace
override bool IsFireplace()
Definition: fireplacebase.c:504
Synchronize
void Synchronize()
Definition: fireplacebase.c:459
InventorySlots
provides access to slot configuration
Definition: inventoryslots.c:5
CanHaveTemperature
override bool CanHaveTemperature()
Definition: fireplacebase.c:534
ParticleWetNoIgniteStop
protected void ParticleWetNoIgniteStop()
Definition: fireplacebase.c:1233
m_OvenAttachmentsLockState
protected int m_OvenAttachmentsLockState
Definition: fireplacebase.c:30
ATTACHMENT_BARK_OAK
ATTACHMENT_BARK_OAK
Definition: fireplacebase.c:196
IsRoofAbove
bool IsRoofAbove()
Definition: fireplacebase.c:2389
ParticleFireStartStop
protected void ParticleFireStartStop()
Definition: fireplacebase.c:1083
DIRECT_COOKING_SPEED
const float DIRECT_COOKING_SPEED
Definition: fireplacebase.c:87
HasStoneCircle
bool HasStoneCircle()
Definition: fireplacebase.c:1599
GetAttachedStonesCount
int GetAttachedStonesCount()
Definition: fireplacebase.c:1611
ClearCookingEquipment
void ClearCookingEquipment(ItemBase pItem)
Definition: fireplacebase.c:550
SOUND_FIRE_EXTINGUISHING
const string SOUND_FIRE_EXTINGUISHING
Definition: fireplacebase.c:138
AddToFireConsumables
protected void AddToFireConsumables(ItemBase item)
Definition: fireplacebase.c:1327
ParticleSteamEndStop
protected void ParticleSteamEndStop()
Definition: fireplacebase.c:1223
OnAttachmentRuined
override void OnAttachmentRuined(EntityAI attachment)
Definition: fireplacebase.c:336
ANIMATION_INVENTORY
const string ANIMATION_INVENTORY
Definition: fireplacebase.c:179
RefreshFireState
void RefreshFireState()
Definition: fireplacebase.c:999
MAX_TEMPERATURE_TO_DISMANTLE_OVEN
const int MAX_TEMPERATURE_TO_DISMANTLE_OVEN
minimum amount of stones for oven
Definition: fireplacebase.c:67
m_ParticleSmallFire
protected Particle m_ParticleSmallFire
Definition: fireplacebase.c:126
HasCookingStand
bool HasCookingStand()
Definition: fireplacebase.c:2465
m_FireState
protected FireplaceFireState m_FireState
Definition: fireplacebase.c:31
m_DirectCookingSlots
protected ItemBase m_DirectCookingSlots[DIRECT_COOKING_SLOT_COUNT]
Definition: fireplacebase.c:107
StartHeating
protected void StartHeating()
Definition: fireplacebase.c:1730
SetLightEntity
void SetLightEntity(FireplaceLight light)
Definition: fireplacebase.c:2550
SetAshesState
protected void SetAshesState(bool has_ashes)
Definition: fireplacebase.c:1584
BurnItemsInFireplace
protected void BurnItemsInFireplace()
Definition: fireplacebase.c:2147
PARTICLE_NORMAL_SMOKE
protected int PARTICLE_NORMAL_SMOKE
Definition: fireplacebase.c:118
IsSpaceForCircle
bool IsSpaceForCircle()
Definition: fireplacebase.c:2518
PARTICLE_SMALL_SMOKE
protected int PARTICLE_SMALL_SMOKE
Definition: fireplacebase.c:117
ATTACHMENT_RAGS
ATTACHMENT_RAGS
Definition: fireplacebase.c:193
DirectCookingSlotsInUse
bool DirectCookingSlotsInUse()
Definition: fireplacebase.c:566
TransferHeatToNearPlayers
protected void TransferHeatToNearPlayers()
DEPRECATED.
Definition: fireplacebase.c:2312
GetDebugActions
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
Definition: fireplacebase.c:2765
StartCooling
protected void StartCooling()
Definition: fireplacebase.c:1927
PARTICLE_OVEN_FIRE_START
protected int PARTICLE_OVEN_FIRE_START
Definition: fireplacebase.c:113
PARAM_FIRE_CONSUM_RATE_AMOUNT
const float PARAM_FIRE_CONSUM_RATE_AMOUNT
value for calculating wetness loss during cooling process
Definition: fireplacebase.c:55
ANIMATION_TRIPOD
const string ANIMATION_TRIPOD
Definition: fireplacebase.c:177
SMOKING_SLOT_COUNT
const int SMOKING_SLOT_COUNT
Definition: fireplacebase.c:88
IsRainingAbove
bool IsRainingAbove()
Definition: fireplacebase.c:2412
ATTACHMENT_TRIPOD
ATTACHMENT_TRIPOD
Definition: fireplacebase.c:203
AddWetnessToFireplace
void AddWetnessToFireplace(float amount)
Definition: fireplacebase.c:2291
SetFireState
protected void SetFireState(FireplaceFireState state)
Definition: fireplacebase.c:1674
m_NoIgnite
protected bool m_NoIgnite
Definition: fireplacebase.c:29
StopParticle
protected bool StopParticle(out Particle particle)
Definition: fireplacebase.c:1057
InventoryLocation
InventoryLocation.
Definition: inventorylocation.c:27
PARAM_MIN_TEMP_TO_REIGNITE
const float PARAM_MIN_TEMP_TO_REIGNITE
maximum wetness value when the fireplace can be ignited
Definition: fireplacebase.c:49
IsEmpty
override bool IsEmpty()
Definition: fireplacebase.c:2454
SmokingSlotsInUse
bool SmokingSlotsInUse()
Definition: fireplacebase.c:578
m_TotalEnergy
protected float m_TotalEnergy
Definition: fireplacebase.c:217
ParticleSteamExtinguishingStart
protected void ParticleSteamExtinguishingStart()
Definition: fireplacebase.c:1207
ANIMATION_BURNT_WOOD
const string ANIMATION_BURNT_WOOD
Definition: fireplacebase.c:174
OnAction
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
Definition: fireplacebase.c:2774
SoundFireHeavyStart
protected void SoundFireHeavyStart()
Definition: fireplacebase.c:1287
ECE_PLACE_ON_SURFACE
const int ECE_PLACE_ON_SURFACE
Definition: centraleconomy.c:37
SMALL_FIRE
@ SMALL_FIRE
Definition: fireplacebase.c:5
SpendFireConsumable
protected void SpendFireConsumable(float amount)
Definition: fireplacebase.c:1415
GetQuantityMax
override int GetQuantityMax()
Definition: itembase.c:3262
FireConsumableType
Definition: fireconsumabletype.c:1
GetFuelBurnRateMP
protected float GetFuelBurnRateMP()
Definition: fireplacebase.c:1657
m_ParticleFireStart
protected Particle m_ParticleFireStart
Definition: fireplacebase.c:125
UniversalTemperatureSource
original Timer deletes m_params which is unwanted
Definition: universaltemperaturesource.c:25
ParticleFireEndStop
protected void ParticleFireEndStop()
Definition: fireplacebase.c:1189
SoundFireStop
protected void SoundFireStop()
Definition: fireplacebase.c:1318
m_ParticleNormalFire
protected Particle m_ParticleNormalFire
Definition: fireplacebase.c:127
ANIMATION_CAULDRON_HANDLE
const string ANIMATION_CAULDRON_HANDLE
Definition: fireplacebase.c:181
IsPlaceSound
bool IsPlaceSound()
Definition: itembase.c:4288
AddTemperatureToItemByFire
protected void AddTemperatureToItemByFire(ItemBase item)
Definition: fireplacebase.c:2187
m_ParticleSmallSmoke
protected Particle m_ParticleSmallSmoke
Definition: fireplacebase.c:128
m_IsOven
protected bool m_IsOven
Definition: fireplacebase.c:26
StopCooling
protected void StopCooling()
Definition: fireplacebase.c:2034
IsOven
bool IsOven()
Definition: fireplacebase.c:1595
m_RoofAbove
protected bool m_RoofAbove
Definition: fireplacebase.c:28
Bottle_Base
Definition: canistergasoline.c:1
ANIMATION_OVEN
const string ANIMATION_OVEN
Definition: fireplacebase.c:178
FireplaceBase
Definition: barrelholes_colorbase.c:1
m_HalfExtents
protected vector m_HalfExtents
Definition: fireplacebase.c:33
EmitorParam
EmitorParam
Definition: envisual.c:113
ATTACHMENT_BANDAGE
ATTACHMENT_BANDAGE
Definition: fireplacebase.c:194
IsFuel
protected bool IsFuel(ItemBase item)
Returns if item attached to fireplace is fuel.
Definition: fireplacebase.c:1518
SmokeOnSmokingSlot
protected void SmokeOnSmokingSlot(ItemBase slot_item, float temp_equip, float temp_ext)
Definition: fireplacebase.c:2128
MESSAGE_BURY_ASHES_FAILED_BURNING
const string MESSAGE_BURY_ASHES_FAILED_BURNING
Definition: fireplacebase.c:164
COUNT
@ COUNT
Definition: fireplacebase.c:12
OBJECT_CLUTTER_CUTTER
const string OBJECT_CLUTTER_CUTTER
Definition: fireplacebase.c:210
m_UTSSettings
protected ref UniversalTemperatureSourceSettings m_UTSSettings
Definition: fireplacebase.c:225
AddTemperatureToFireplace
protected void AddTemperatureToFireplace(float amount)
DEPRECATED.
Definition: fireplacebase.c:2198
MESSAGE_IGNITE_RAIN
const string MESSAGE_IGNITE_RAIN
Definition: fireplacebase.c:155
ErrorEx
enum ShapeType ErrorEx
m_ParticleNormalSmoke
protected Particle m_ParticleNormalSmoke
Definition: fireplacebase.c:129
~FireplaceBase
protected void ~FireplaceBase()
Definition: fireplacebase.c:277
ANIMATION_STICKS
const string ANIMATION_STICKS
Definition: fireplacebase.c:172
ATTACHMENT_GIFTWRAP
ATTACHMENT_GIFTWRAP
Definition: fireplacebase.c:199
ATTACHMENT_COOKINGSTAND
ATTACHMENT_COOKINGSTAND
Definition: fireplacebase.c:204
SOUND_FIRE_HEAVY
const string SOUND_FIRE_HEAVY
Definition: fireplacebase.c:135
LIFETIME_FIREPLACE_STONE_OVEN
const int LIFETIME_FIREPLACE_STONE_OVEN
Definition: fireplacebase.c:93
ParticleNormalFireStart
protected void ParticleNormalFireStart()
Definition: fireplacebase.c:1107
PARAM_WET_HEATING_DECREASE_COEF
const float PARAM_WET_HEATING_DECREASE_COEF
value for calculating of wetness that fireplace gain when raining
Definition: fireplacebase.c:53
Serializer
Serialization general interface. Serializer API works with:
Definition: serializer.c:55
GetTemperature
override float GetTemperature()
Definition: itembase.c:3525
SetOvenState
void SetOvenState(bool is_oven)
Definition: fireplacebase.c:1621
DIRECT_COOKING_SLOT_COUNT
const int DIRECT_COOKING_SLOT_COUNT
direct cooking slots
Definition: fireplacebase.c:86
NORMAL_FIRE
@ NORMAL_FIRE
Definition: fireplacebase.c:6
PARAM_MAX_ITEM_HEAT_TEMP_INCREASE
const float PARAM_MAX_ITEM_HEAT_TEMP_INCREASE
minimum temperature for items that can be heated in fireplace cargo or as attachments (degree Celsius...
Definition: fireplacebase.c:59
OnPlacementComplete
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Definition: fireplacebase.c:2559
PlayerIdentity
The class that will be instanced (moddable)
Definition: gameplay.c:377
StopFire
void StopFire(FireplaceFireState fire_state=FireplaceFireState.END_FIRE)
Definition: fireplacebase.c:1900
TEMPERATURE_LOSS_MP_OVEN
const float TEMPERATURE_LOSS_MP_OVEN
Definition: fireplacebase.c:72
m_ParticleSteamExtinguishing
protected Particle m_ParticleSteamExtinguishing
Definition: fireplacebase.c:132
ATTACHMENT_STONES
ATTACHMENT_STONES
Definition: fireplacebase.c:205
PARAM_BURN_WET_THRESHOLD
const float PARAM_BURN_WET_THRESHOLD
maximum rain value when the fireplace can be ignited
Definition: fireplacebase.c:51
IsWet
bool IsWet()
Definition: fireplacebase.c:2383
ATTACHMENT_FIREWOOD
ATTACHMENT_FIREWOOD
Definition: fireplacebase.c:191
PARAM_TEMPERATURE_DECREASE
const float PARAM_TEMPERATURE_DECREASE
how much will temperature increase when fireplace is burning (degree Celsius per second)
Definition: fireplacebase.c:47
PARAM_MAX_TRANSFERED_TEMPERATURE
const float PARAM_MAX_TRANSFERED_TEMPERATURE
DEPRECATED value for calculation of heat transfered from fireplace through air to player (environment...
Definition: fireplacebase.c:63
SetIgniteFailure
void SetIgniteFailure(bool failure)
Definition: fireplacebase.c:2372
GetPosition
class JsonUndergroundAreaTriggerData GetPosition
Definition: undergroundarealoader.c:9
PARTICLE_OVEN_FIRE
protected int PARTICLE_OVEN_FIRE
Definition: fireplacebase.c:116
EffectSound
Wrapper class for managing sound through SEffectManager.
Definition: effectsound.c:4
ATTACHMENT_EYEMASK_COLORBASE
ATTACHMENT_EYEMASK_COLORBASE
Definition: fireplacebase.c:201
ANIMATION_STONE
const string ANIMATION_STONE
Definition: fireplacebase.c:175
EEInit
override void EEInit()
Definition: fireplacebase.c:287
WIND
enum FireplaceFireState WIND
SoundFireWetNoIgniteStart
protected void SoundFireWetNoIgniteStart()
Definition: fireplacebase.c:1302
ParticleList
Definition: particlelist.c:11
Cooling
protected void Cooling()
Definition: fireplacebase.c:1940
IsCeilingHighEnoughForSmoke
bool IsCeilingHighEnoughForSmoke()
Definition: fireplacebase.c:2401
PlayerBase
Definition: playerbaseclient.c:1
map
map
Definition: controlsxboxnew.c:3
vector
Definition: enconvert.c:105
PunchedCard
Definition: punchedcard.c:1
NoiseParams
class ObjectSpawnerHandler NoiseParams
UniversalTemperatureSourceSettings
Definition: universaltemperaturesource.c:1
MESSAGE_REIGNITE_TOO_WET
const string MESSAGE_REIGNITE_TOO_WET
Definition: fireplacebase.c:161
GetTemperatureLossMP
protected float GetTemperatureLossMP()
Definition: fireplacebase.c:1646
InventoryMode
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition: inventory.c:21
ATTACHMENT_STICKS
ATTACHMENT_STICKS
Definition: fireplacebase.c:190
IsInAnimPhase
bool IsInAnimPhase(string anim_phase)
Definition: fireplacebase.c:2471
PARAM_MAX_WET_TO_IGNITE
const float PARAM_MAX_WET_TO_IGNITE
how much will temperature decrease when fireplace is cooling (degree Celsius per second)
Definition: fireplacebase.c:48
PARTICLE_NO_IGNITE_WIND
protected int PARTICLE_NO_IGNITE_WIND
Definition: fireplacebase.c:123
CFG_VEHICLESPATH
const string CFG_VEHICLESPATH
Definition: constants.c:209
CookWithEquipment
protected void CookWithEquipment()
Definition: fireplacebase.c:2080
SetStoneCircleState
void SetStoneCircleState(bool has_stonecircle)
Definition: fireplacebase.c:1633
StopAllParticlesAndSounds
protected void StopAllParticlesAndSounds()
Definition: fireplacebase.c:966
SetExtinguishingState
void SetExtinguishingState()
Definition: fireplacebase.c:1684
OnRPC
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Definition: fireplacebase.c:2706
HasLastFuelKindlingAttached
bool HasLastFuelKindlingAttached()
Definition: fireplacebase.c:1556
ATTACHMENT_BOOK
ATTACHMENT_BOOK
Definition: fireplacebase.c:195
IsSpaceForOven
bool IsSpaceForOven()
Definition: fireplacebase.c:2506
m_ClutterCutter
protected Object m_ClutterCutter
Definition: fireplacebase.c:211
SMOKING_SPEED
const float SMOKING_SPEED
Definition: fireplacebase.c:89
GetLightEntity
FireplaceLight GetLightEntity()
Definition: fireplacebase.c:2545
ParticleFireWindyNoIgniteStart
protected void ParticleFireWindyNoIgniteStart()
Definition: fireplacebase.c:1194
NO_FIRE
@ NO_FIRE
Definition: fireplacebase.c:3
CargoBase
represents base for cargo storage for entities
Definition: cargo.c:6
m_ParticleSteamEnd
protected Particle m_ParticleSteamEnd
Definition: fireplacebase.c:131
m_IsBurning
enum FireplaceFireState m_IsBurning
ANIMATION_WOOD
const string ANIMATION_WOOD
Definition: fireplacebase.c:173
m_HeatingTimer
protected ref Timer m_HeatingTimer
Definition: fireplacebase.c:98
PlayPlaceSound
void PlayPlaceSound()
Definition: itembase.c:4348
g_Game
DayZGame g_Game
Definition: dayzgame.c:3727
ErrorExSeverity
ErrorExSeverity
Definition: endebug.c:61
StopHeating
protected void StopHeating()
Definition: fireplacebase.c:1918
Object
Definition: objecttyped.c:1
ParticleSmallFireStart
protected void ParticleSmallFireStart()
Definition: fireplacebase.c:1089
PARTICLE_STEAM_END
protected int PARTICLE_STEAM_END
Definition: fireplacebase.c:121
IsSpaceFor
bool IsSpaceFor(vector size)
Definition: fireplacebase.c:2476
m_SoundFireLoop
protected EffectSound m_SoundFireLoop
Definition: fireplacebase.c:142
ATTACHMENT_PAPER
ATTACHMENT_PAPER
Definition: fireplacebase.c:198
MESSAGE_REIGNITE_RAIN
const string MESSAGE_REIGNITE_RAIN
Definition: fireplacebase.c:160
ScriptedLightBase
Definition: pointlightbase.c:1
m_HasAshes
protected bool m_HasAshes
Definition: fireplacebase.c:25
m_SmokingSlots
protected ItemBase m_SmokingSlots[SMOKING_SLOT_COUNT]
Definition: fireplacebase.c:108
m_LightDistance
protected float m_LightDistance
Definition: fireplacebase.c:103
PARAM_FULL_HEAT_RADIUS
const float PARAM_FULL_HEAT_RADIUS
maximum value of temperature of items in fireplace when heating (degree Celsius)
Definition: fireplacebase.c:60
m_HasStoneCircle
protected bool m_HasStoneCircle
Definition: fireplacebase.c:27
PARAM_ITEM_HEAT_TEMP_INCREASE_COEF
const float PARAM_ITEM_HEAT_TEMP_INCREASE_COEF
value for calculating damage on items located in fireplace cargo
Definition: fireplacebase.c:57
ATTACHMENT_FRYING_PAN
ATTACHMENT_FRYING_PAN
Definition: fireplacebase.c:207
MATERIAL_FIREPLACE_NOGLOW
const string MATERIAL_FIREPLACE_NOGLOW
Definition: fireplacebase.c:186
EEDelete
override void EEDelete(EntityAI parent)
Definition: fireplacebase.c:372
IsItemAttachedQuantity
bool IsItemAttachedQuantity(typename item_type, float quantity)
Definition: fireplacebase.c:1542
AreaDamageLoopedDeferred
Deferred version of AreaDamageLooped.
Definition: areadamageloopeddeferred.c:2
MESSAGE_IGNITE_UNDER_LOW_ROOF
const string MESSAGE_IGNITE_UNDER_LOW_ROOF
Definition: fireplacebase.c:158
TEMPERATURE_LOSS_MP_DEFAULT
const float TEMPERATURE_LOSS_MP_DEFAULT
min height of ceiling for fire to be ignited
Definition: fireplacebase.c:70
SetIsPlaceSound
void SetIsPlaceSound(bool is_place_sound)
Definition: itembase.c:4283
END_FIRE
@ END_FIRE
Definition: fireplacebase.c:7
PARTICLE_STEAM_EXTINGUISHING
protected int PARTICLE_STEAM_EXTINGUISHING
Definition: fireplacebase.c:122
PARAM_COOKING_EQUIP_TEMP_INCREASE
const float PARAM_COOKING_EQUIP_TEMP_INCREASE
maximum temperature of attached cooking equipment (degree Celsius)
Definition: fireplacebase.c:81
EECargoOut
override void EECargoOut(EntityAI item)
Definition: fireplacebase.c:601
OnItemLocationChanged
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
Definition: fireplacebase.c:328
SetFuelBurnRateMP
protected void SetFuelBurnRateMP(float value)
Definition: fireplacebase.c:1662
PARAM_HEAT_THROUGH_AIR_COEF
const float PARAM_HEAT_THROUGH_AIR_COEF
radius in which objects are heated by fire
Definition: fireplacebase.c:62
FoodStageType
FoodStageType
Definition: foodstage.c:1
IsOnInteriorSurface
bool IsOnInteriorSurface()
Definition: fireplacebase.c:2448
GetFireConsumableByItem
protected FireConsumable GetFireConsumableByItem(ItemBase item)
Definition: fireplacebase.c:1365
FUEL_BURN_RATE_STONES
const float FUEL_BURN_RATE_STONES
Definition: fireplacebase.c:75
m_FireConsumables
protected ref map< ItemBase, ref FireConsumable > m_FireConsumables
Definition: fireplacebase.c:149
MESSAGE_BURY_ASHES_FAILED_SURFACE
const string MESSAGE_BURY_ASHES_FAILED_SURFACE
Definition: fireplacebase.c:163
PARTICLE_FIRE_START
protected int PARTICLE_FIRE_START
Definition: fireplacebase.c:112
CanSwapEntities
override bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
Definition: fireplacebase.c:2491
SetBurningState
protected void SetBurningState(bool is_burning)
Definition: fireplacebase.c:1572
EActions
EActions
Definition: eactions.c:1
IsKindling
protected bool IsKindling(ItemBase item)
Returns if item attached to fireplace is kindling.
Definition: fireplacebase.c:1500
GetCookingEquipment
ItemBase GetCookingEquipment()
Definition: fireplacebase.c:540
GetFireState
protected int GetFireState()
Definition: fireplacebase.c:1668
CanDismantleOven
bool CanDismantleOven()
Definition: fireplacebase.c:2524
LockOvenAttachments
void LockOvenAttachments(bool lock)
Definition: fireplacebase.c:2668
IGNITE_WIND_THRESHOLD
const float IGNITE_WIND_THRESHOLD
Definition: fireplacebase.c:95
CalcAndSetQuantity
protected void CalcAndSetQuantity()
Definition: fireplacebase.c:2622
array< Object >
TIMER_COOLING_UPDATE_INTERVAL
const int TIMER_COOLING_UPDATE_INTERVAL
update interval duration of heating process (seconds)
Definition: fireplacebase.c:84
DestroyAreaDamage
void DestroyAreaDamage()
Definition: fireplacebase.c:2331
MESSAGE_REIGNITE_NO_KINDLING
const string MESSAGE_REIGNITE_NO_KINDLING
Definition: fireplacebase.c:159
ANIMATION_ASHES
const string ANIMATION_ASHES
Definition: fireplacebase.c:170
NoiseSystem
Definition: noise.c:1
FireplaceFireState
FireplaceFireState
Definition: fireplacebase.c:1
SOUND_FIRE_LIGHT
const string SOUND_FIRE_LIGHT
Definition: fireplacebase.c:136
ParticleSteamExtinguishingStop
protected void ParticleSteamExtinguishingStop()
Definition: fireplacebase.c:1212
MESSAGE_BURY_ASHES_FAILED_NOT_EMPTY
const string MESSAGE_BURY_ASHES_FAILED_NOT_EMPTY
Definition: fireplacebase.c:162
PARAM_ITEM_HEAT_MIN_TEMP
const float PARAM_ITEM_HEAT_MIN_TEMP
value for calculating temperature increase on each heat update interval (degree Celsius)
Definition: fireplacebase.c:58
ParticleSmallFireStop
protected void ParticleSmallFireStop()
Definition: fireplacebase.c:1101
ANIMATION_KINDLING
const string ANIMATION_KINDLING
Definition: fireplacebase.c:171
quantityMax
float quantityMax
Definition: cfgplayerspawndatajson.c:209
TIMER_HEATING_UPDATE_INTERVAL
const int TIMER_HEATING_UPDATE_INTERVAL
Definition: fireplacebase.c:83
m_AreaDamage
protected ref AreaDamageManager m_AreaDamage
Definition: fireplacebase.c:214
MIN_STONES_TO_BUILD_CIRCLE
const int MIN_STONES_TO_BUILD_CIRCLE
Definition: fireplacebase.c:65
EXTINGUISHED_FIRE
@ EXTINGUISHED_FIRE
Definition: fireplacebase.c:9
MATERIAL_FIREPLACE_GLOW
const string MATERIAL_FIREPLACE_GLOW
Definition: fireplacebase.c:185
ANIMATION_STONES
const string ANIMATION_STONES
Definition: fireplacebase.c:176
PARAM_NORMAL_FIRE_TEMPERATURE
const float PARAM_NORMAL_FIRE_TEMPERATURE
maximum fireplace temperature of a small fire (degree Celsius)
Definition: fireplacebase.c:44
GetItemToConsume
protected FireConsumable GetItemToConsume()
Definition: fireplacebase.c:1406
FireConsumable
Definition: fireconsumable.c:1
SetItemToConsume
protected FireConsumable SetItemToConsume()
Definition: fireplacebase.c:1373
FUEL_BURN_RATE_DEFAULT
const float FUEL_BURN_RATE_DEFAULT
Definition: fireplacebase.c:74
IsHologram
override bool IsHologram()
Definition: itembase.c:962
CanDismantleStoneCircle
bool CanDismantleStoneCircle()
Definition: fireplacebase.c:2529
GetFireConsumableTypeEnergy
protected float GetFireConsumableTypeEnergy(ItemBase item)
Definition: fireplacebase.c:1333
ANIMATION_COOKWARE_HANDLE
const string ANIMATION_COOKWARE_HANDLE
Definition: fireplacebase.c:180
AddDamageToItemByFireEx
protected void AddDamageToItemByFireEx(ItemBase item, bool can_be_ruined, bool pAttachment)
Definition: fireplacebase.c:2201
EyeMask_ColorBase
Definition: eyemask_colorbase.c:1
PARTICLE_SMALL_FIRE
protected int PARTICLE_SMALL_FIRE
Definition: fireplacebase.c:114
GameConstants
Definition: constants.c:612
CalcAndSetTotalEnergy
protected void CalcAndSetTotalEnergy()
Definition: fireplacebase.c:2583
GetFuelCount
protected int GetFuelCount()
Returns count of all fuel type items (define in 'm_FuelTypes') attached to fireplace.
Definition: fireplacebase.c:1484
SetBurntFirewood
protected void SetBurntFirewood()
Definition: fireplacebase.c:783
AreaDamageComponentTypes
Definition: areadamagemanager.c:1
FireplaceBase
protected void FireplaceBase()
Definition: fireplacebase.c:232
SoundFireWindyNoIgniteStart
protected void SoundFireWindyNoIgniteStart()
Definition: fireplacebase.c:1312
DayZPhysics
Definition: dayzphysics.c:123
FUEL_BURN_RATE_OVEN
const float FUEL_BURN_RATE_OVEN
Definition: fireplacebase.c:76
AreaDamageManager
void AreaDamageManager(EntityAI parent)
Definition: areadamagemanager.c:22
MESSAGE_IGNITE_TOO_WET
const string MESSAGE_IGNITE_TOO_WET
Definition: fireplacebase.c:154
IsItemTypeAttached
bool IsItemTypeAttached(typename item_type)
Definition: fireplacebase.c:1536
StartFire
void StartFire(bool force_start=false)
Definition: fireplacebase.c:1697
IsFacingFireplace
bool IsFacingFireplace(PlayerBase player)
DEPRECATED.
Definition: fireplacebase.c:2340
Timer
Definition: dayzplayerimplement.c:62
MESSAGE_IGNITE_IGNIT_ITEM_DAMAGED
const string MESSAGE_IGNITE_IGNIT_ITEM_DAMAGED
Definition: fireplacebase.c:152
m_ItemToConsume
protected ref FireConsumable m_ItemToConsume
Definition: fireplacebase.c:109
CanBuildStoneCircle
bool CanBuildStoneCircle()
Definition: fireplacebase.c:2513
AddWetnessToItem
protected void AddWetnessToItem(ItemBase item, float amount)
Definition: fireplacebase.c:2282
OnAttachmentQuantityChanged
override void OnAttachmentQuantityChanged(ItemBase item)
Definition: fireplacebase.c:2647
REIGNITED_FIRE
@ REIGNITED_FIRE
Definition: fireplacebase.c:10
TEMPERATURE_LOSS_MP_STONES
const float TEMPERATURE_LOSS_MP_STONES
Definition: fireplacebase.c:71
ParticleNormalSmokeStop
protected void ParticleNormalSmokeStop()
Definition: fireplacebase.c:1171
PARTICLE_NORMAL_FIRE
protected int PARTICLE_NORMAL_FIRE
Definition: fireplacebase.c:115
m_FuelBurnRateMP
protected float m_FuelBurnRateMP
determines how fast will the fireplace loose its temperature when cooling (lower is better)
Definition: fireplacebase.c:37
SAT_DEBUG_ACTION
const int SAT_DEBUG_ACTION
Definition: constants.c:424
EXTINGUISHING_FIRE
@ EXTINGUISHING_FIRE
Definition: fireplacebase.c:8
LIFETIME_FIREPLACE_STONE_CIRCLE
const int LIFETIME_FIREPLACE_STONE_CIRCLE
Definition: fireplacebase.c:92
ParticleNormalFireStop
protected void ParticleNormalFireStop()
Definition: fireplacebase.c:1119
ATTACHMENT_BARK_BIRCH
ATTACHMENT_BARK_BIRCH
Definition: fireplacebase.c:197
HasLastAttachment
bool HasLastAttachment()
Definition: fireplacebase.c:1550
PARAM_COOKING_TEMP_THRESHOLD
const float PARAM_COOKING_TEMP_THRESHOLD
cooking
Definition: fireplacebase.c:79
ATTACHMENT_COOKING_POT
ATTACHMENT_COOKING_POT
Definition: fireplacebase.c:206
DestroyFireplace
void DestroyFireplace()
[DEPRECATED]
Definition: fireplacebase.c:591
MIN_STONES_TO_BUILD_OVEN
const int MIN_STONES_TO_BUILD_OVEN
minimum amount of stones for circle
Definition: fireplacebase.c:66
m_NoisePar
ref NoiseParams m_NoisePar
Definition: fireplacebase.c:220
m_CookingEquipment
protected ItemBase m_CookingEquipment
Definition: fireplacebase.c:106
CanBuildOven
bool CanBuildOven()
Definition: fireplacebase.c:2501
GetCeilingHeight
bool GetCeilingHeight(out float actual_height)
Definition: fireplacebase.c:1238
CanHaveWetness
override bool CanHaveWetness()
Definition: fireplacebase.c:529
GetAirResistanceForSmokeParticles
float GetAirResistanceForSmokeParticles(float actual_height)
Definition: fireplacebase.c:1254
Math
Definition: enmath.c:6
PARTICLE_FIRE_END
protected int PARTICLE_FIRE_END
Definition: fireplacebase.c:119
ParticleManager
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Definition: particlemanager.c:84
m_Light
protected FireplaceLight m_Light
Definition: fireplacebase.c:102
PARAM_MIN_FIRE_TEMPERATURE
const float PARAM_MIN_FIRE_TEMPERATURE
maximum fireplace temperature of a normal fire (degree Celsius)
Definition: fireplacebase.c:45
GetKindlingCount
protected int GetKindlingCount()
Returns count of all kindling type items (define in 'm_KindlingTypes') attached to fireplace.
Definition: fireplacebase.c:1467
TSelectableActionInfoWithColor
Param4< int, int, string, int > TSelectableActionInfoWithColor
Definition: entityai.c:97
PARAM_BURN_DAMAGE_COEF
const float PARAM_BURN_DAMAGE_COEF
base value of fire consumption rate (how many base energy will be spent on each update)
Definition: fireplacebase.c:56
m_CanNoise
private bool m_CanNoise
Definition: fireplacebase.c:221
HasAshes
bool HasAshes()
Definition: fireplacebase.c:1578
ParticleFireEndStart
protected void ParticleFireEndStart()
Definition: fireplacebase.c:1177
Vector
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
m_LastFireState
protected FireplaceFireState m_LastFireState
Definition: fireplacebase.c:32
m_CoolingTimer
protected ref Timer m_CoolingTimer
Definition: fireplacebase.c:99
EntityAI
Definition: building.c:5
HasAnyKindling
bool HasAnyKindling()
Definition: fireplacebase.c:2352
SoundFireLightStart
protected void SoundFireLightStart()
Definition: fireplacebase.c:1282
RemoveFromFireConsumables
protected void RemoveFromFireConsumables(FireConsumable fire_consumable)
Definition: fireplacebase.c:1354
SetWet
override void SetWet(float value, bool allow_client=false)
Definition: itembase.c:3573
PARAM_WET_INCREASE_COEF
const float PARAM_WET_INCREASE_COEF
maximum wetness value when the fireplace is able to burn
Definition: fireplacebase.c:52
START_FIRE
@ START_FIRE
Definition: fireplacebase.c:4
ParticleFireStartStart
protected void ParticleFireStartStart()
Definition: fireplacebase.c:1071
GetType
override int GetType()
Definition: huddebugwincharagents.c:49
PhxInteractionLayers
PhxInteractionLayers
Definition: dayzphysics.c:1
MESSAGE_IGNITE_NO_KINDLING
const string MESSAGE_IGNITE_NO_KINDLING
Definition: fireplacebase.c:153
PARAM_COOKING_EQUIP_MAX_TEMP
const float PARAM_COOKING_EQUIP_MAX_TEMP
temperature threshold for starting coooking process (degree Celsius)
Definition: fireplacebase.c:80
WET
enum FireplaceFireState WET
Heating
protected void Heating()
Definition: fireplacebase.c:1763
Edible_Base
Definition: bearsteakmeat.c:1
GameInventory
script counterpart to engine's class Inventory
Definition: inventory.c:78
DisassembleOnLastDetach
override bool DisassembleOnLastDetach()
Definition: fireplacebase.c:2701
PARAM_HEAT_RADIUS
const float PARAM_HEAT_RADIUS
radius in which objects are fully heated by fire
Definition: fireplacebase.c:61
GetFireEffectPosition
protected vector GetFireEffectPosition()
Definition: fireplacebase.c:1267
IsBurning
bool IsBurning()
Definition: fireplacebase.c:1566
RefreshFireplaceVisuals
void RefreshFireplaceVisuals()
Definition: fireplacebase.c:612