DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
FireplaceBase.c
Go to the documentation of this file.
2{
3 NO_FIRE = 1,
11
12 COUNT = 9 //for net sync purposes
14
15enum FirePlaceFailure
16{
17 WIND = 0,
18 WET = 1,
19}
20
21class 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
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;
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;
54 const float PARAM_WET_COOLING_DECREASE_COEF = 0.002;
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;
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;
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
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
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
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;
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
236 {
239 m_FireConsumableTypes.Insert(ATTACHMENT_BANDAGE, new FireConsumableType(ATTACHMENT_BANDAGE, 14, true, "MedicalBandage"));
247
248 //define fuel types
249 m_FireConsumableTypes.Insert(ATTACHMENT_STICKS, new FireConsumableType( ATTACHMENT_STICKS, 40, false, "WoodenStick"));
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
275 }
276
277 protected void ~FireplaceBase()
278 {
279 if (GetLightEntity())
280 {
281 GetLightEntity().FadeOut();
282 }
283 }
284
285 override void EEInit()
286 {
287 super.EEInit();
288
289 //refresh visual on init
291
292 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
293 {
302
306
308 }
309 }
310
311 override void EEItemAttached(EntityAI item, string slot_name)
312 {
313 super.EEItemAttached(item, slot_name);
314
315 //cookware
316 switch (item.Type())
317 {
321 SetCookingEquipment(ItemBase.Cast(item));
322 break;
323 }
324 }
325
326 override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
327 {
328 super.OnItemLocationChanged(old_owner, new_owner);
329
330 //refresh physics after location change (with delay)
332 }
333
334 override void OnAttachmentRuined(EntityAI attachment)
335 {
336 switch (attachment.Type())
337 {
340 int slot = InventorySlots.GetSlotIdFromString("CookingEquipment");
341 EntityAI ent = GetInventory().FindAttachment(slot);
342 if (ent)
343 {
344 switch (ent.Type())
345 {
349 vector direction = ent.GetDirection();
350 float dot = vector.Dot(direction, vector.Forward);
351
352 float angle = Math.Acos(dot);
353 if (direction[0] < 0)
354 {
355 angle = -angle;
356 }
357
358 float cos = Math.Cos(angle);
359 float sin = Math.Sin(angle);
360 GetInventory().DropEntityInBounds(InventoryMode.SERVER, this, ent, "2 0 2", angle, cos, sin);
361 break;
362 }
363 }
364
365 attachment.Delete();
366 break;
367 }
368 }
369
370 override void EEDelete(EntityAI parent)
371 {
372 super.EEDelete(parent);
373
375
376 // cleanup particles (for cases of leaving burning fplace and going back outside of network bubble)
377 #ifndef SERVER
379 #endif
380 }
381
382 //on store save/load
383 override void OnStoreSave( ParamsWriteContext ctx )
384 {
385 super.OnStoreSave(ctx);
386
387 //Save ashes state
388 ctx.Write( m_HasAshes );
389
390 //Save temperature loss MP
392
393 //Save fuel burn rate MP
394 ctx.Write( m_FuelBurnRateMP );
395
396 //Save burning state
397 ctx.Write( m_IsBurning );
398 }
399
400 override bool OnStoreLoad( ParamsReadContext ctx, int version )
401 {
402 if ( !super.OnStoreLoad(ctx, version) )
403 return false;
404
405 //--- Fireplace data ---
406 //Load ashes state
407 if ( !ctx.Read( m_HasAshes ) )
408 {
409 m_HasAshes = false; //set default
410 return false;
411 }
412
413 //Load temperature loss MP
414 if ( !ctx.Read( m_TemperatureLossMP ) )
415 {
416 m_TemperatureLossMP = 1.0; //set default
417 return false;
418 }
419
420 //Load fuel burn rate MP
421 if ( !ctx.Read( m_FuelBurnRateMP ) )
422 {
423 m_FuelBurnRateMP = 1.0; //set default
424 return false;
425 }
426
427 //Load burning state, if true start fire
428 if ( !ctx.Read( m_IsBurning ) )
429 {
430 m_IsBurning = false; //set default
431 return false;
432 }
433 //---
434
435 return true;
436 }
437
438 override void AfterStoreLoad()
439 {
440 super.AfterStoreLoad();
441
442 Synchronize();
443
444 //start fire
445 if (IsBurning() )
446 {
447 if (GetGame() && GetGame().IsServer())
448 {
449 StartFire(true); //will be auto-synchronized when starting fire
450 }
451 }
452 }
453
454 //================================================================
455 // SYNCHRONIZATION
456 //================================================================
458 {
459 if ( GetGame() && GetGame().IsServer() )
460 {
461 SetSynchDirty();
462
463 if ( GetGame().IsMultiplayer() && GetGame().IsServer() )
464 {
465 //Refresh visuals (on server)
467 }
468 }
469 }
470
472 {
473 super.OnVariablesSynchronized();
474
477
478 if (IsPlaceSound())
479 {
481 }
482
483 if (IsBaseFireplace() && !IsOven())
484 {
486 {
488 }
489 else if (!m_IsBurning && m_AreaDamage)
490 {
492 }
493 }
494 }
495
496 //================================================================
497 // BASE
498 //================================================================
499
500 //States
501 //check fireplace types
502 override bool IsFireplace()
503 {
504 return true;
505 }
506
508 {
509 return false;
510 }
511
513 {
514 return false;
515 }
516
518 {
519 return false;
520 }
521
523 {
524 return false;
525 }
526
527 override bool CanHaveWetness()
528 {
529 return true;
530 }
531
532 override bool CanHaveTemperature()
533 {
534 return true;
535 }
536
537 //cooking equipment
539 {
540 return m_CookingEquipment;
541 }
542
544 {
545 m_CookingEquipment = equipment;
546 }
547
549 {
551 {
552 m_CookingProcess.TerminateCookingSounds(pItem);
553 }
554
556 }
557
560 {
562 }
563
565 {
566 for (int i = 0; i < DIRECT_COOKING_SLOT_COUNT; i++)
567 {
568 if ( m_DirectCookingSlots[i] )
569 {
570 return true;
571 }
572 }
573 return false;
574 }
575
577 {
578 for (int i = 0; i < SMOKING_SLOT_COUNT; i++)
579 {
580 if ( m_SmokingSlots[i] )
581 {
582 return true;
583 }
584 }
585 return false;
586 }
587
588 //Destroy
590 {
591 //delete object
592 DeleteSafe();
593 }
594
595 override bool IsPrepareToDelete()
596 {
597 return IsEmpty() && !IsBurning() && !HasAshes();
598 }
599
600 override void EECargoOut(EntityAI item)
601 {
602 super.EECargoOut(item);
603 CheckForDestroy();
604 }
605
606 //================================================================
607 // VISUAL
608 //================================================================
609 //Fireplace visual
611 {
612 if (IsHologram())
613 {
614 return;
615 }
616
617 // Light
618 #ifndef SERVER
619 if (IsBurning() )
620 {
621 //turn light on
622 if (!GetLightEntity())
623 {
624 SetLightEntity(FireplaceLight.Cast(ScriptedLightBase.CreateLight(FireplaceLight, GetPosition(), 20)));
625 GetLightEntity().AttachOnMemoryPoint(this, "light");
626 }
627
628 if (GetLightEntity() && GetLightEntity().GetBrightness() > 0)
629 {
630 // change brightness based on the distance of player to the fireplace
631 Object player = GetGame().GetPlayer();
632 float lightDist = m_LightDistance;
633
634 if (IsOven())
635 {
636 lightDist = 50;
637 }
638
639 if (player)
640 {
641 if (vector.DistanceSq(player.GetPosition(), this.GetPosition()) > lightDist * lightDist)
642 {
643 GetLightEntity().FadeBrightnessTo(0, 5);
644 }
645 else
646 {
647 GetLightEntity().FadeBrightnessTo(FireplaceLight.m_FireplaceBrightness, 5);
648 }
649 }
650
651 // The following solves an issue with the light point clipping through narrow geometry
653 {
654 GetLightEntity().SetInteriorMode();
655 }
656 else
657 {
658 GetLightEntity().SetExteriorMode();
659 }
660 }
661 }
662 else
663 {
664 //turn light off
665 if (GetLightEntity())
666 {
667 GetLightEntity().FadeOut();
668 }
669 }
670 #endif
671
672 //set default burn parameters based on fireplace type
674 {
677 }
678 else if (HasStoneCircle())
679 {
682 }
683 else
684 {
687 }
688
689 // Oven attachments
690 if (IsOven())
691 {
692 //lock attachment slots
694 {
696 }
697 }
698 else
699 {
700 //unlock attachment slots
702 {
703 LockOvenAttachments(false);
704 }
705 }
706
707 //VISUAL STATES
708 //Fuel state
709 if ( GetGame().IsServer() ) // SetAnimationPhase should ideally be called on server only..
710 {
711 // Sticks state
713 SetAnimationPhase( ANIMATION_STICKS, 0 );
714 else
715 SetAnimationPhase( ANIMATION_STICKS, 1 );
716
717 // Firewood state
719 {
720 if ( IsBurning() && HasAshes() )
721 {
722 SetAnimationPhase( ANIMATION_BURNT_WOOD, 0 ); // Because this might not be set under certain circumstances
723 SetAnimationPhase( ANIMATION_WOOD, 1 );
724 }
725
726 if ( IsWet() || !IsBurning() )
727 {
728 SetAnimationPhase( ANIMATION_BURNT_WOOD, 1 );
729 SetAnimationPhase( ANIMATION_WOOD, 0 );
730 }
731 }
732 else
733 {
734 SetAnimationPhase( ANIMATION_WOOD, 1 );
735 SetAnimationPhase( ANIMATION_BURNT_WOOD, 1 );
736 }
737
738 // Kindling state
739 if ( GetKindlingCount() != 0 )
740 SetAnimationPhase( ANIMATION_KINDLING, 0 );
741 else
742 SetAnimationPhase( ANIMATION_KINDLING, 1 );
743
744 // Ashes state
745 if ( HasAshes() )
746 SetAnimationPhase( ANIMATION_ASHES, 0 );
747 else
748 SetAnimationPhase( ANIMATION_ASHES, 1 );
749
750 // Stone variations
751 if (HasStones())
752 {
753 if (HasStoneCircle())
754 {
755 SetAnimationPhase(ANIMATION_STONES, 0);
756 SetAnimationPhase(ANIMATION_STONE, 1);
757 }
758 else if (IsOven())
759 {
760 SetAnimationPhase(ANIMATION_OVEN, 0);
761 SetAnimationPhase(ANIMATION_STONE, 1);
762 }
763 else
764 {
766 SetAnimationPhase(ANIMATION_STONES, 1);
767 SetAnimationPhase(ANIMATION_OVEN, 1);
768 SetAnimationPhase(ANIMATION_STONE, 0);
769 }
770 }
771 else
772 {
773 SetAnimationPhase(ANIMATION_STONE, 1);
774 }
775 }
776
777 //refresh physics (with delay)
779 }
780
781 protected void SetBurntFirewood()
782 {
783 if ( GetGame().IsServer() && IsInAnimPhase( ANIMATION_WOOD ) )
784 {
785 SetAnimationPhase( ANIMATION_WOOD, 1 );
786 SetAnimationPhase( ANIMATION_BURNT_WOOD, 0 );
787 }
788 }
789
790 //Refresh fireplace object physics
792
793 protected void RefreshFireParticlesAndSounds( bool force_refresh )
794 {
795 FireplaceFireState fire_state = GetFireState();
796
797 if ( m_LastFireState != fire_state || force_refresh )
798 {
799 switch ( fire_state )
800 {
801 case FireplaceFireState.START_FIRE:
802 {
803 //particles
805
806 //sounds
809 break;
810 }
811 case FireplaceFireState.SMALL_FIRE:
812 {
813 //particles
815
817
818 if ( CanShowSmoke() )
820 else
822
825
827
828 //sounds
831 break;
832 }
833 case FireplaceFireState.NORMAL_FIRE:
834 {
835 //particles
837
840
842
843 if ( CanShowSmoke() )
845 else
847
849
850 //sounds
853 break;
854 }
855 case FireplaceFireState.END_FIRE:
856 {
857 //particles
859
862
865
867
868 //sounds
871 break;
872 }
873 case FireplaceFireState.EXTINGUISHING_FIRE: //TODO add steam particles when extinguishing
874 {
875 //particles
877
880
883
885
887
888 //sounds
891 break;
892 }
893 case FireplaceFireState.EXTINGUISHED_FIRE: //TODO add steam particles when fireplace is extinguished
894 {
895 //particles
897
900
903
905
907
908 if ( CanShowSmoke() )
910 else
912
913 //sounds
917 break;
918 }
919 case FireplaceFireState.REIGNITED_FIRE:
920 {
921 //particles
923
926
929
931
933
934 //sounds
936 break;
937 }
938 case FireplaceFireState.NO_FIRE:
939 {
940 //particles
942
945
948
950
953
954 //sounds
956 break;
957 }
958 }
959
960 m_LastFireState = fire_state;
961 }
962 }
963
965 {
966 // go through all fireplace particles
977 if ( m_ParticleFireEnd )
979 if ( m_ParticleSteamEnd )
983
984 // go through all fireplace sounds
985 if ( m_SoundFireLoop )
986 StopSoundSet( m_SoundFireLoop );
987 if ( m_SoundFire )
988 StopSoundSet( m_SoundFire );
989 }
990
992 {
993 return true;
994 }
995
996 //Fireplace fire intensity
998 {
999 float temperature = GetTemperature();
1000
1001 //if it's burning
1002 if (IsBurning())
1003 {
1004 //Start fire
1005 if (temperature <= PARAM_MIN_FIRE_TEMPERATURE)
1006 {
1007 if ( GetFireState() != FireplaceFireState.START_FIRE )
1008 {
1009 SetFireState( FireplaceFireState.START_FIRE );
1010 }
1011 }
1012 //Small fire
1013 else if (temperature <= PARAM_SMALL_FIRE_TEMPERATURE)
1014 {
1015 if ( GetFireState() != FireplaceFireState.SMALL_FIRE )
1016 {
1017 SetFireState( FireplaceFireState.SMALL_FIRE );
1018 }
1019 }
1020 //Normal fire
1021 else if (temperature > PARAM_SMALL_FIRE_TEMPERATURE)
1022 {
1023 if ( GetFireState() != FireplaceFireState.NORMAL_FIRE )
1024 {
1025 SetFireState( FireplaceFireState.NORMAL_FIRE );
1026 }
1027 }
1028 }
1029 }
1030
1031 //================================================================
1032 // PARTICLES & SOUNDS
1033 //================================================================
1034 //returns true if particle started, false if not
1035 protected bool PlayParticle( out Particle particle, int particle_type, vector pos, bool worldpos = false )
1036 {
1037 if ( !particle && GetGame() && ( !GetGame().IsDedicatedServer() ) )
1038 {
1039 if ( !worldpos )
1040 {
1041 particle = ParticleManager.GetInstance().PlayOnObject( particle_type, this, pos );
1042 }
1043 else
1044 {
1045 particle = ParticleManager.GetInstance().PlayInWorld( particle_type, pos );
1046 }
1047
1048 return true;
1049 }
1050
1051 return false;
1052 }
1053
1054 //returns true if particle stopped, false if not
1055 protected bool StopParticle( out Particle particle )
1056 {
1057 if ( particle && GetGame() && ( !GetGame().IsDedicatedServer() ) )
1058 {
1059 particle.Stop();
1060 particle = NULL;
1061
1062 return true;
1063 }
1064
1065 return false;
1066 }
1067
1068 //start fire
1069 protected void ParticleFireStartStart()
1070 {
1071 if ( IsOven() )
1072 {
1074 }
1075 else
1076 {
1078 }
1079 }
1080
1081 protected void ParticleFireStartStop()
1082 {
1084 }
1085
1086 //small fire
1087 protected void ParticleSmallFireStart()
1088 {
1089 if ( IsOven() )
1090 {
1092 }
1093 else
1094 {
1096 }
1097 }
1098
1099 protected void ParticleSmallFireStop()
1100 {
1102 }
1103
1104 //normal fire
1106 {
1107 if ( IsOven() )
1108 {
1110 }
1111 else
1112 {
1114 }
1115 }
1116
1117 protected void ParticleNormalFireStop()
1118 {
1120 }
1121
1122 //small smoke
1124 {
1126
1127 //calculate air resistance
1128 float actual_height;
1129 if ( GetCeilingHeight( actual_height ) )
1130 {
1131 float air_resistance = GetAirResistanceForSmokeParticles( actual_height );
1132
1133 //alter smoke height
1134 m_ParticleSmallSmoke.SetParameter( -1, EmitorParam.AIR_RESISTANCE, air_resistance );
1135 }
1136
1137 if ( IsRoofAbove() )
1138 {
1140 }
1141 }
1142
1143 protected void ParticleSmallSmokeStop()
1144 {
1146 }
1147
1148 //normal smoke
1150 {
1152
1153 //calculate air resistance
1154 float actual_height;
1155 if ( GetCeilingHeight( actual_height ) )
1156 {
1157 float air_resistance = GetAirResistanceForSmokeParticles( actual_height );
1158
1159 //alter smoke height
1160 m_ParticleNormalSmoke.SetParameter( -1, EmitorParam.AIR_RESISTANCE, air_resistance );
1161 }
1162
1163 if ( IsRoofAbove() )
1164 {
1166 }
1167 }
1168
1170 {
1172 }
1173
1174 //fire end
1175 protected void ParticleFireEndStart()
1176 {
1177 if ( IsOven() )
1178 {
1180 }
1181 else
1182 {
1184 }
1185 }
1186
1187 protected void ParticleFireEndStop()
1188 {
1190 }
1191
1193 {
1194 if ( IsOven() )
1195 {
1197 }
1198 else
1199 {
1201 }
1202 }
1203
1204 //steam extinguishing
1206 {
1208 }
1209
1211 {
1213 }
1214
1215 //steam end
1216 protected void ParticleSteamEndStart()
1217 {
1219 }
1220
1221 protected void ParticleSteamEndStop()
1222 {
1224 }
1225
1227 {
1229 }
1230
1232 {
1234 }
1235
1236 bool GetCeilingHeight( out float actual_height )
1237 {
1238 vector from = this.GetPosition();
1239 vector to = this.GetPosition();
1240 from[1] = from[1] + 1.0;
1241 to[1] = to[1] + MIN_CEILING_HEIGHT;
1242 vector contactPos;
1243 vector contactDir;
1244 int contactComponent;
1245
1246 bool hit = DayZPhysics.RaycastRV( from, to, contactPos, contactDir, contactComponent, NULL, NULL, this );
1247 actual_height = vector.Distance( from, contactPos ) + 1.0;
1248
1249 return hit;
1250 }
1251
1252 float GetAirResistanceForSmokeParticles( float actual_height )
1253 {
1254 float air_res;
1255 actual_height = Math.Clamp( actual_height, 0, 36 );
1256
1257 air_res = ( 6 - actual_height ) * 0.33;
1258 air_res = Math.Clamp( air_res, 0, 2 );
1259
1260 return air_res;
1261 }
1262
1263 //Particle Positions
1264 //Get local fire and smoke effect position
1266 {
1267 return Vector( 0, 0.05, 0 );
1268 }
1269
1271 {
1272 return Vector( 0, 0.05, 0 );
1273 }
1274
1275 //================================================================
1276 // SOUNDS
1277 //================================================================
1278 //Burning
1279 //Start
1280 protected void SoundFireLightStart()
1281 {
1282 PlaySoundSetLoop( m_SoundFireLoop, SOUND_FIRE_LIGHT, 1.0, 1.0 );
1283 }
1284
1285 protected void SoundFireHeavyStart()
1286 {
1287 PlaySoundSetLoop( m_SoundFireLoop, SOUND_FIRE_HEAVY, 1.0, 2.0 );
1288 }
1289
1290 protected void SoundFireNoFireStart()
1291 {
1292 PlaySoundSetLoop( m_SoundFireLoop, SOUND_FIRE_NO_FIRE, 2.0, 2.0 );
1293 }
1294
1296 {
1297 PlaySoundSet( m_SoundFire, SOUND_FIRE_EXTINGUISHED, 0.1, 0.1 );
1298 }
1299
1301 {
1302 PlaySoundSet( m_SoundFire, SOUND_FIRE_EXTINGUISHED, 0.1, 0.1 );
1303 }
1304
1306 {
1307 PlaySoundSetLoop( m_SoundFireLoop, SOUND_FIRE_EXTINGUISHING, 1.0, 0.5 );
1308 }
1309
1311 {
1312 PlaySoundSet( m_SoundFire, "ExtinguishByWind_SoundSet", 0, 0 );
1313 }
1314
1315 //Stop
1316 protected void SoundFireStop()
1317 {
1318 StopSoundSet( m_SoundFireLoop );
1319 }
1320
1321 //================================================================
1322 // FUEL / KINDLING
1323 //================================================================
1324 //Add to fire consumables
1325 protected void AddToFireConsumables(ItemBase item)
1326 {
1327 m_FireConsumables.Insert(item, new FireConsumable(item, GetFireConsumableTypeEnergy(item)));
1329 }
1330
1332 {
1333 FireConsumableType fireConsumableType = m_FireConsumableTypes.Get(item.Type());
1334 if (!fireConsumableType)
1335 {
1337 int count = m_FireConsumableTypes.Count();
1338 for (int i = 0; i < count; ++i)
1339 {
1340 if (item.IsInherited(m_FireConsumableTypes.GetKey(i)))
1341 fireConsumableType = m_FireConsumableTypes.GetElement(i);
1342 }
1343 }
1344
1345 if (fireConsumableType)
1346 return fireConsumableType.GetEnergy();
1347
1348 return 0;
1349 }
1350
1351 //Remove from fire consumables
1352 protected void RemoveFromFireConsumables(FireConsumable fire_consumable)
1353 {
1354 if (fire_consumable)
1355 {
1356 m_FireConsumables.Remove(fire_consumable.GetItem());
1357 delete fire_consumable;
1358 }
1359
1361 }
1362
1364 {
1365 return m_FireConsumables.Get(item);
1366 }
1367
1368 //Set fuel / kindling to consume
1369 //Sets the item with the lowest energy value as item that will be consumed next
1370 //Returns reference to set fire consumable
1372 {
1373 if (m_FireConsumables.Count() == 0)
1374 {
1375 m_ItemToConsume = null;
1376 }
1377 else
1378 {
1379 for (int i = 0; i < m_FireConsumables.Count(); ++i)
1380 {
1381 ItemBase key = m_FireConsumables.GetKey(i);
1382 FireConsumable fireConsumable = m_FireConsumables.Get(key);
1383
1384 if (i == 0)
1385 {
1386 m_ItemToConsume = fireConsumable;
1387 }
1388 else
1389 {
1390 if (fireConsumable.GetEnergy() < m_ItemToConsume.GetEnergy())
1391 {
1392 m_ItemToConsume = fireConsumable;
1393 }
1394 }
1395 }
1396 }
1397
1398 //refresh visual
1400
1401 return m_ItemToConsume;
1402 }
1403
1405 {
1406 return m_ItemToConsume;
1407 }
1408
1409 //Spend item that is used as consumable for fire (fuel, kindling)
1410 //if 'amount == 0', the whole quantity will be consumed (quantity -= 1 )
1411 //debug
1412 //int m_debug_fire_consume_time = 0;
1413 protected void SpendFireConsumable(float amount)
1414 {
1415 //spend item
1416 FireConsumable fireConsumable = GetItemToConsume();
1417
1418 if (!fireConsumable)
1419 {
1420 //Set new item to consume
1421 fireConsumable = SetItemToConsume();
1422 }
1423
1424 if (fireConsumable)
1425 {
1426 ItemBase item = fireConsumable.GetItem();
1427 fireConsumable.SetRemainingEnergy(fireConsumable.GetRemainingEnergy() - amount);
1428
1429 if (fireConsumable.GetRemainingEnergy() <= 0 || amount == 0)
1430 {
1431 //set ashes
1432 if (!HasAshes())
1433 {
1434 SetAshesState(true);
1435 }
1436
1437 if (item.IsAnyInherited({ItemBook, Paper, GiftWrapPaper, EyeMask_ColorBase}))
1438 {
1439 RemoveFromFireConsumables(fireConsumable);
1440 item.Delete();
1441 }
1442 else
1443 {
1444 //if there is nothing left, delete and remove old consumable, set new fire consumable
1445 if (item.GetQuantity() <= 1)
1446 {
1447 //remove item from fuel items
1448 RemoveFromFireConsumables(fireConsumable);
1449 }
1450 else
1451 {
1452 fireConsumable.SetRemainingEnergy(fireConsumable.GetEnergy());
1453 }
1454
1455 item.AddQuantity(-1);
1457 }
1458 }
1459 }
1460
1462 }
1463
1465 protected int GetKindlingCount()
1466 {
1467 int attachmentsCount = GetInventory().AttachmentCount();
1468 int kindlingCount = 0;
1469
1470 for (int i = 0; i < attachmentsCount; ++i)
1471 {
1472 ItemBase item = ItemBase.Cast(GetInventory().GetAttachmentFromIndex(i));
1473
1474 if (IsKindling(item))
1475 kindlingCount++;
1476 }
1477
1478 return kindlingCount;
1479 }
1480
1482 protected int GetFuelCount()
1483 {
1484 int attachmentsCount = GetInventory().AttachmentCount();
1485 int fuelCount = 0;
1486
1487 for (int i = 0; i < attachmentsCount; ++i)
1488 {
1489 ItemBase item = ItemBase.Cast(GetInventory().GetAttachmentFromIndex(i));
1490 if (IsFuel(item))
1491 fuelCount++;
1492 }
1493
1494 return fuelCount;
1495 }
1496
1498 protected bool IsKindling(ItemBase item)
1499 {
1500 FireConsumableType fireConsumableType = m_FireConsumableTypes.Get(item.Type());
1501 if (!fireConsumableType)
1502 {
1504 int count = m_FireConsumableTypes.Count();
1505 for (int i = 0; i < count; ++i)
1506 {
1507 if (item.IsInherited(m_FireConsumableTypes.GetKey(i)))
1508 fireConsumableType = m_FireConsumableTypes.GetElement(i);
1509 }
1510 }
1511
1512 return fireConsumableType && fireConsumableType.IsKindling();
1513 }
1514
1516 protected bool IsFuel(ItemBase item)
1517 {
1518 FireConsumableType fireConsumableType = m_FireConsumableTypes.Get(item.Type());
1519 if (!fireConsumableType)
1520 {
1522 int count = m_FireConsumableTypes.Count();
1523 for (int i = 0; i < count; ++i)
1524 {
1525 if (item.IsInherited(m_FireConsumableTypes.GetKey(i)))
1526 fireConsumableType = m_FireConsumableTypes.GetElement(i);
1527 }
1528 }
1529
1530 return fireConsumableType && !fireConsumableType.IsKindling();
1531 }
1532
1533 //Has attachments of given type
1534 bool IsItemTypeAttached(typename item_type)
1535 {
1536 return GetAttachmentByType(item_type) != null;
1537 }
1538
1539 //Has attachments of required quantity
1540 bool IsItemAttachedQuantity(typename item_type, float quantity)
1541 {
1542 ItemBase item = ItemBase.Cast(GetAttachmentByType(item_type));
1543
1544 return item.GetQuantity() >= quantity;
1545 }
1546
1547 //Has last attached item
1549 {
1550 return GetInventory().AttachmentCount() == 1;
1551 }
1552
1553 //Has last fuel/kindling attached
1555 {
1556 return (GetFuelCount() + GetKindlingCount()) == 1;
1557 }
1558
1559
1560 //================================================================
1561 // FIRE STATE
1562 //================================================================
1563 //Is fireplace burning?
1565 {
1566 return m_IsBurning;
1567 }
1568
1569 //Set burning state
1570 protected void SetBurningState(bool is_burning)
1571 {
1572 m_IsBurning = is_burning;
1573 }
1574
1575 //Are ashes present in fireplace?
1577 {
1578 return m_HasAshes;
1579 }
1580
1581 //Set ashes state
1582 protected void SetAshesState(bool has_ashes)
1583 {
1584 m_HasAshes = has_ashes;
1585
1586 if (m_HasAshes)
1587 {
1589 }
1590 }
1591
1592 //Is in oven state
1593 bool IsOven()
1594 {
1595 return m_IsOven;
1596 }
1598 {
1599 return m_HasStoneCircle;
1600 }
1601
1603 {
1604 EntityAI attached_item = GetAttachmentByType(ATTACHMENT_STONES);
1605
1606 return attached_item && attached_item.GetQuantity() > 0;
1607 }
1608
1610 {
1611 if (HasStones())
1612 {
1613 return GetAttachmentByType(ATTACHMENT_STONES).GetQuantity();
1614 }
1615
1616 return 0;
1617 }
1618
1619 void SetOvenState( bool is_oven )
1620 {
1621 if ( m_IsOven != is_oven )
1622 {
1623 m_IsOven = is_oven;
1624 m_RoofAbove = is_oven;
1625
1626 GetInventory().SetSlotLock( InventorySlots.GetSlotIdFromString("Stones") , is_oven);
1627
1628 Synchronize();
1629 }
1630 }
1631 void SetStoneCircleState( bool has_stonecircle )
1632 {
1633 if ( m_HasStoneCircle != has_stonecircle )
1634 {
1635 m_HasStoneCircle = has_stonecircle;
1636
1637 GetInventory().SetSlotLock( InventorySlots.GetSlotIdFromString("Stones") , has_stonecircle);
1638
1639 Synchronize();
1640 }
1641 }
1642
1643 //Temperature loss MP
1644 protected float GetTemperatureLossMP()
1645 {
1646 return m_TemperatureLossMP;
1647 }
1648
1649 protected void SetTemperatureLossMP( float value )
1650 {
1651 m_TemperatureLossMP = value;
1652 }
1653
1654 //Fuel burn rate MP
1655 protected float GetFuelBurnRateMP()
1656 {
1657 return m_FuelBurnRateMP;
1658 }
1659
1660 protected void SetFuelBurnRateMP( float value )
1661 {
1662 m_FuelBurnRateMP = value;
1663 }
1664
1665 //Get fire state
1666 protected int GetFireState()
1667 {
1668 return m_FireState;
1669 }
1670
1671 //Sets fire state
1672 protected void SetFireState( FireplaceFireState state )
1673 {
1674 if ( m_FireState != state )
1675 {
1676 m_FireState = state;
1677
1678 Synchronize();
1679 }
1680 }
1681
1683 {
1684 SetFireState( FireplaceFireState.EXTINGUISHING_FIRE );
1685 }
1686
1687 //================================================================
1688 // FIRE PROCESS
1689 //================================================================
1690
1691 //Start the fire process
1692 // 1. start heating
1693 // 2. heating
1694 // 3. stop heating
1695 void StartFire(bool force_start = false)
1696 {
1697 //stop cooling process if active
1698 if (m_CoolingTimer)
1699 {
1701 m_CoolingTimer = null;
1702 }
1703
1704 //set under roof flag (was fire ignited under roof?)
1705 if (MiscGameplayFunctions.IsUnderRoof(this))
1706 m_RoofAbove = true;
1707
1708 //start fire
1709 if (!IsBurning() || force_start)
1710 {
1712 SetBurningState(true);
1713 m_UTSource.SetActive(true);
1714 StartHeating();
1715
1716 //Update navmesh
1717 if (!IsFireplaceIndoor())
1718 {
1719 SetAffectPathgraph(false, true);
1720 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, this);
1721 }
1722 }
1723
1724 Synchronize();
1725 }
1726
1727 //Start heating
1728 protected void StartHeating()
1729 {
1730 //visual
1731 SetObjectMaterial(0, MATERIAL_FIREPLACE_GLOW);
1732
1733 if (IsWindy() && !IsRoofAbove() && !IsOven() && !IsBarrelWithHoles())
1734 {
1735 StopFire();
1736 return;
1737 }
1738
1740 {
1741 StopFire(FireplaceFireState.EXTINGUISHED_FIRE);
1742 return;
1743 }
1744
1745 //create area damage
1746 if (IsBaseFireplace() && !IsOven())
1748
1750 m_HeatingTimer.Run(TIMER_HEATING_UPDATE_INTERVAL, this, "Heating", null, true);
1751
1752 //Setup the noise parameters on fire start
1753 m_NoisePar = new NoiseParams();
1754 if (IsRoofAbove() || IsOven() || IsFireplaceIndoor()) //If we have a roof, we are probably inside
1755 m_NoisePar.LoadFromPath("CfgVehicles FireplaceBase NoiseFireplaceSpecial");
1756 else
1757 m_NoisePar.LoadFromPath("CfgVehicles FireplaceBase NoiseFireplaceBase");
1758 }
1759
1760 //Do heating
1761 protected void Heating()
1762 {
1763 float temperature = GetTemperature();
1764 float temperature_modifier = 0;
1765
1766 //check burning conditions
1768 {
1769 StopFire(FireplaceFireState.EXTINGUISHED_FIRE);
1770 return;
1771 }
1772 else
1773 {
1774 if (m_FireConsumables.Count() == 0)
1775 {
1776 StopFire();
1777 return;
1778 }
1779 }
1780
1781 //spend actual fire consumable
1783 SpendFireConsumable(amount);
1784
1785 //set wetness if raining and alter temperature modifier (which will lower temperature increase because of rain)
1786 float rain = GetGame().GetWeather().GetRain().GetActual();
1787 if (rain >= PARAM_BURN_WET_THRESHOLD && (IsRainingAbove() && !MiscGameplayFunctions.IsUnderRoof(this)))
1788 {
1789 //set wet to fireplace
1791
1792 //set temperature modifier
1793 temperature_modifier = PARAM_TEMPERATURE_INCREASE * rain;
1794 }
1795 //subtract wetness when heating and not raining above
1796 else
1797 {
1799 }
1800
1801 // temperature via UniversalTemperatureSource
1803 temperature = GetTemperature() + (PARAM_TEMPERATURE_INCREASE * TIMER_HEATING_UPDATE_INTERVAL) - temperature_modifier;
1806
1807 //check fire state
1808 if ( GetFireState() != FireplaceFireState.EXTINGUISHING_FIRE )
1809 {
1811 }
1812
1813 //damage cargo items
1815
1816 //manage cooking equipment (this applies only for case of cooking pot on a tripod)
1818 {
1819 float cook_equip_temp = m_CookingEquipment.GetTemperature();
1820
1821 if ( cook_equip_temp >= PARAM_COOKING_TEMP_THRESHOLD )
1822 {
1823 //start cooking
1825 }
1826
1827 //DEBUG
1828 /*
1829 PlayerBase player = ( PlayerBase ) GetGame().GetPlayer();
1830 string s_message = "cooking equipment temp = " + ftoa(cook_equip_temp) + " | PARAM_COOKING_TEMP_THRESHOLD = " + ftoa(PARAM_COOKING_TEMP_THRESHOLD);
1831 if (player != NULL) {player.MessageAction (s_message);}
1832 Print ( s_message );
1833 */
1834 //set temperature to cooking equipment
1835 cook_equip_temp = cook_equip_temp + PARAM_COOKING_EQUIP_TEMP_INCREASE;
1836 if ( temperature <= PARAM_SMALL_FIRE_TEMPERATURE )
1837 {
1838 cook_equip_temp = Math.Clamp ( cook_equip_temp, PARAM_ITEM_HEAT_MIN_TEMP, PARAM_SMALL_FIRE_TEMPERATURE );
1839 }
1840 else
1841 {
1842 cook_equip_temp = Math.Clamp ( cook_equip_temp, PARAM_ITEM_HEAT_MIN_TEMP, PARAM_COOKING_EQUIP_MAX_TEMP );
1843 }
1844
1845 m_CookingEquipment.SetTemperature( cook_equip_temp );
1846 }
1847
1848 float cook_item_temp;
1849 int i;
1850 // manage cooking on direct cooking slots
1852 {
1853 for ( i = 0; i < DIRECT_COOKING_SLOT_COUNT; i++ )
1854 {
1855 if ( m_DirectCookingSlots[i] )
1856 {
1857 cook_item_temp = m_DirectCookingSlots[i].GetTemperature();
1858 if ( cook_item_temp >= PARAM_COOKING_TEMP_THRESHOLD )
1859 {
1860 CookOnDirectSlot( m_DirectCookingSlots[i], cook_item_temp, temperature );
1861 }
1862 }
1863 }
1864 }
1865
1866 // manage smoking slots
1867 if ( SmokingSlotsInUse() )
1868 {
1869 for ( i = 0; i < SMOKING_SLOT_COUNT; i++ )
1870 {
1871 if ( m_SmokingSlots[i] )
1872 {
1873 SmokeOnSmokingSlot( m_SmokingSlots[i], cook_item_temp, temperature );
1874 }
1875 }
1876 }
1877
1878 //Make noise for AI, only at night
1879 if ( GetGame().GetWorld().IsNight() && m_CanNoise )
1880 {
1882 if ( noise && m_NoisePar )
1883 {
1884 noise.AddNoisePos( this, GetPosition(), m_NoisePar);
1885 }
1886 m_CanNoise = false;
1887 }
1888 else
1889 m_CanNoise = true;
1890
1891 Synchronize();
1892 }
1893
1894 //Stop the fire process
1895 // 1. start cooling
1896 // 2. cooling
1897 // 3. stop cooling
1898 void StopFire( FireplaceFireState fire_state = FireplaceFireState.END_FIRE )
1899 {
1900 StopHeating();
1902 SetBurningState(false);
1903 StartCooling();
1904 SetFireState(fire_state);
1905
1906 //Update navmesh
1907 if (!IsFireplaceIndoor())
1908 {
1909 SetAffectPathgraph(false, false);
1910 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, this);
1911 }
1912
1913 Synchronize();
1914 }
1915
1916 protected void StopHeating()
1917 {
1918 if (!m_HeatingTimer)
1919 return;
1920
1922 m_HeatingTimer = null;
1923 }
1924
1925 protected void StartCooling()
1926 {
1927 if (m_HeatingTimer)
1928 {
1930 m_HeatingTimer = null;
1931 }
1932
1933 //Start cooling
1935 m_CoolingTimer.Run(TIMER_COOLING_UPDATE_INTERVAL, this, "Cooling", null, true);
1936 }
1937
1938 protected void Cooling()
1939 {
1940 float wetness = GetWet();
1941 float temperature = GetTemperature();
1942 float temperature_modifier = 0;
1943
1944 if (!IsBurning() && temperature >= 10)
1945 {
1946 //check wetness
1947 //set wetness if raining and alter temperature modifier (which will lower temperature increase because of rain)
1948 float rain = GetGame().GetWeather().GetRain().GetActual();
1949 if (IsRainingAbove() && !IsRoofAbove())
1950 {
1951 //set wet to fireplace
1953
1954 //set temperature modifier
1955 temperature_modifier = temperature_modifier + ( PARAM_TEMPERATURE_DECREASE * rain );
1956 }
1957 else //subtract wetness
1958 {
1960 }
1961
1962 //calculate already obtained wetness (e.g. extinguished by water)
1963 temperature_modifier = temperature_modifier + ( PARAM_TEMPERATURE_DECREASE * wetness );
1964
1965 // temperature via UniversalTemperatureSource
1967 temperature = GetTemperature() - (PARAM_TEMPERATURE_DECREASE * TIMER_COOLING_UPDATE_INTERVAL) - temperature_modifier;
1970
1971 //damage cargo items
1973
1974 //cook with equipment if temperature of equipment is still high
1975 if ( m_CookingEquipment )
1976 {
1977 float cook_equip_temp = m_CookingEquipment.GetTemperature();
1978
1979 if ( cook_equip_temp >= PARAM_COOKING_TEMP_THRESHOLD )
1980 {
1981 //cook
1983 }
1984 }
1985
1986 float cook_item_temp;
1987 int i;
1988
1989 // manage cooking on direct cooking slots
1991 {
1992 for ( i = 0; i < DIRECT_COOKING_SLOT_COUNT; i++ )
1993 {
1994 if ( m_DirectCookingSlots[i] )
1995 {
1996 cook_item_temp = m_DirectCookingSlots[i].GetTemperature();
1997 if ( cook_item_temp >= PARAM_COOKING_TEMP_THRESHOLD )
1998 {
1999 CookOnDirectSlot( m_DirectCookingSlots[i], cook_item_temp, temperature );
2000 }
2001 }
2002 }
2003 }
2004
2005 // manage smoking slots
2006 if ( SmokingSlotsInUse() )
2007 {
2008 for ( i = 0; i < SMOKING_SLOT_COUNT; i++ )
2009 {
2010 if ( m_SmokingSlots[i] )
2011 {
2012 SmokeOnSmokingSlot( m_SmokingSlots[i], cook_item_temp, temperature );
2013 }
2014 }
2015 }
2016
2017 //Debug
2018 //PlayerBase player = ( PlayerBase ) GetGame().GetPlayer();
2019 //if (player != NULL) {player.MessageAction ( temperature.ToString() );}
2020 }
2021 else
2022 {
2023 //stop cooling
2024 if (Math.AbsFloat(temperature) < 10)
2025 {
2026 StopCooling();
2027 m_UTSource.SetActive(false);
2028 }
2029 }
2030 }
2031
2032 protected void StopCooling()
2033 {
2034 //stop all fire visuals
2036 SetObjectMaterial(0, MATERIAL_FIREPLACE_NOGLOW);
2037
2038 //Stop cooling
2040 m_CoolingTimer = NULL;
2041
2042 //destroy area damage
2044
2045 //remove cookware audio visuals
2046 if (GetCookingEquipment())
2047 {
2048 Bottle_Base cooking_pot = Bottle_Base.Cast(GetCookingEquipment());
2049 if ( cooking_pot )
2050 cooking_pot.RemoveAudioVisualsOnClient();
2051 }
2052
2054 {
2055 for ( int i = 0; i < DIRECT_COOKING_SLOT_COUNT; i++ )
2056 {
2057 if ( m_DirectCookingSlots[i] )
2058 {
2059 Bottle_Base cookingpot = Bottle_Base.Cast( m_DirectCookingSlots[i] );
2060 if ( cookingpot )
2061 cookingpot.RemoveAudioVisualsOnClient();
2062
2063 FryingPan fryingpan = FryingPan.Cast( m_DirectCookingSlots[i] );
2064 if ( fryingpan )
2065 fryingpan.RemoveAudioVisualsOnClient();
2066
2067 Edible_Base itsfood = Edible_Base.Cast( m_DirectCookingSlots[i] );
2068 if ( itsfood )
2069 itsfood.MakeSoundsOnClient( false );
2070 }
2071 }
2072 }
2073 }
2074
2075 //================================================================
2076 // COOKING
2077 //================================================================
2078 protected void CookWithEquipment()
2079 {
2080 if (m_CookingProcess == null)
2081 {
2082 m_CookingProcess = new Cooking();
2083 }
2084
2085 m_CookingProcess.CookWithEquipment(m_CookingEquipment);
2086 }
2087
2089 {
2090 if (m_CookingProcess == null)
2091 {
2092 m_CookingProcess = new Cooking();
2093 }
2094
2095 return m_CookingProcess;
2096 }
2097
2098 protected void CookOnDirectSlot(ItemBase slot_item, float temp_equip, float temp_ext)
2099 {
2100 if (m_CookingProcess == null)
2101 {
2102 m_CookingProcess = new Cooking();
2103 }
2104
2105 m_CookingProcess.CookWithEquipment(slot_item);
2106
2107 switch (slot_item.Type())
2108 {
2112 float cookEquipTemp = temp_equip + PARAM_COOKING_EQUIP_TEMP_INCREASE;
2113 if ( temp_ext <= PARAM_SMALL_FIRE_TEMPERATURE )
2114 {
2115 cookEquipTemp = Math.Clamp(cookEquipTemp, PARAM_ITEM_HEAT_MIN_TEMP, PARAM_SMALL_FIRE_TEMPERATURE);
2116 }
2117 else
2118 {
2119 cookEquipTemp = Math.Clamp(cookEquipTemp, PARAM_ITEM_HEAT_MIN_TEMP, PARAM_COOKING_EQUIP_MAX_TEMP);
2120 }
2121 slot_item.SetTemperature(cookEquipTemp);
2122 break;
2123 }
2124 }
2125
2126 protected void SmokeOnSmokingSlot( ItemBase slot_item, float temp_equip, float temp_ext )
2127 {
2128 if ( m_CookingProcess == NULL )
2129 {
2130 m_CookingProcess = new Cooking();
2131 }
2132
2133 // smoking slots accept only individual meat/fruit/veg items
2134 Edible_Base ingr = Edible_Base.Cast( slot_item );
2135 if ( ingr )
2136 {
2137 m_CookingProcess.SmokeItem( ingr, FireplaceBase.TIMER_HEATING_UPDATE_INTERVAL * FireplaceBase.SMOKING_SPEED );
2138 }
2139 }
2140
2141 //================================================================
2142 // FIRE VICINITY
2143 //================================================================
2144 //apply damage to all items, raise temperature to only specific items
2145 protected void BurnItemsInFireplace()
2146 {
2148 CargoBase cargo = GetInventory().GetCargo();
2149 for (int i = 0; i < cargo.GetItemCount(); i++)
2150 {
2151 ItemBase item = ItemBase.Cast(cargo.GetItem(i));
2152
2153 //set damage
2154 AddDamageToItemByFireEx(item, false, false);
2155
2156 if (item.GetHealth("", "Health") <= 0 && !item.IsKindOf("Grenade_Base"))
2157 {
2158 item.Delete();
2159 }
2160
2161 //add temperature
2163
2164 //remove wetness
2166 }
2167
2169 for (int j = 0; j < GetInventory().AttachmentCount(); ++j)
2170 {
2171 ItemBase attachment = ItemBase.Cast(GetInventory().GetAttachmentFromIndex(j));
2172
2173 //set damage
2174 AddDamageToItemByFireEx(attachment, false, true);
2175
2176 //add temperature
2177 AddTemperatureToItemByFire(attachment);
2178
2179 //remove wetness
2181 }
2182 }
2183
2184 //add temperature to item by fire
2186 {
2187 if (item.GetTemperatureMax() >= PARAM_ITEM_HEAT_MIN_TEMP)
2188 {
2189 float temperature = item.GetTemperature() + PARAM_ITEM_HEAT_TEMP_INCREASE_COEF;
2191 item.SetTemperature(temperature);
2192 }
2193 }
2194
2196 protected void AddTemperatureToFireplace(float amount) {};
2197
2198 //add damage to item by fire
2199 protected void AddDamageToItemByFireEx(ItemBase item, bool can_be_ruined, bool pAttachment)
2200 {
2201 if (!item)
2202 {
2203 return;
2204 }
2205
2207 {
2208 return;
2209 }
2210
2212 if (!pAttachment)
2213 {
2215 GameInventory itemInventory = item.GetInventory();
2216 if (itemInventory)
2217 {
2218 for (int i = 0; i < itemInventory.AttachmentCount(); ++i)
2219 {
2220 itemInventory.GetAttachmentFromIndex(i).AddHealth("", "", -PARAM_BURN_DAMAGE_COEF);
2221 }
2222 }
2223
2224 item.AddHealth("", "", -PARAM_BURN_DAMAGE_COEF);
2225 }
2226 else
2227 {
2228 float timerCoef = 1.0;
2229 if (m_HeatingTimer && m_HeatingTimer.IsRunning())
2230 {
2232 }
2233 else if (m_CoolingTimer && m_CoolingTimer.IsRunning())
2234 {
2235 timerCoef = TIMER_COOLING_UPDATE_INTERVAL;
2236 }
2237
2238 switch (item.Type())
2239 {
2240 case ATTACHMENT_TRIPOD:
2245 item.DecreaseHealth(GameConstants.FIRE_ATTACHMENT_DAMAGE_PER_SECOND * timerCoef, false);
2246 break;
2247 }
2248
2250 if (IsFuel(item) || IsKindling(item))
2251 {
2252 if (item.GetHealthLevel() < GameConstants.STATE_BADLY_DAMAGED)
2253 {
2254 item.DecreaseHealth(PARAM_BURN_DAMAGE_COEF, false);
2255 }
2256 }
2257
2259 if (item.CanBeCooked() && item.GetHealthLevel() >= GameConstants.STATE_BADLY_DAMAGED)
2260 {
2261 Edible_Base edible_item = Edible_Base.Cast( item );
2262 edible_item.ChangeFoodStage(FoodStageType.BURNED);
2263 }
2264 }
2265 }
2266
2267 // DEPRECATED
2268 protected void AddDamageToItemByFire(ItemBase item, bool can_be_ruined)
2269 {
2270 item.DecreaseHealth( PARAM_BURN_DAMAGE_COEF, false );
2271
2272 if ( item.CanBeCooked() & item.GetHealthLevel() >= GameConstants.STATE_BADLY_DAMAGED )
2273 {
2274 Edible_Base edible_item = Edible_Base.Cast( item );
2275 edible_item.ChangeFoodStage( FoodStageType.BURNED );
2276 }
2277 }
2278
2279 //add wetness on item
2280 protected void AddWetnessToItem(ItemBase item, float amount)
2281 {
2282 float wetness = item.GetWet();
2283 wetness = wetness + amount;
2284 wetness = Math.Clamp(wetness, 0, 1); //wetness <0-1>
2285 item.SetWet(wetness);
2286 }
2287
2288 //add wetness on fireplace
2289 void AddWetnessToFireplace(float amount)
2290 {
2291 //add wetness
2292 float wetness = GetWet();
2293 wetness = wetness + amount;
2294 wetness = Math.Clamp(wetness, 0, 1); //wetness <0-1>
2295 SetWet(wetness);
2296
2297 //decrease temperature
2298 if (amount > 0)
2299 {
2300 float temperature = GetTemperature();
2301 temperature = temperature * ( 1 - ( wetness * 0.5 ) );
2303 // temperature via UniversalTemperatureSource
2306 }
2307 }
2308
2310 protected void TransferHeatToNearPlayers() {}
2311
2312 //Create and Destroy damage radius around the fireplace when starting/stopping burning process
2314 {
2315 //destroy area damage if some already exists
2317
2318 //create new area damage
2320 m_AreaDamage.SetDamageComponentType(AreaDamageComponentTypes.HITZONE);
2321 m_AreaDamage.SetExtents("-0.30 0 -0.30", "0.30 0.75 0.30");
2322 m_AreaDamage.SetLoopInterval( 0.5 );
2323 m_AreaDamage.SetDeferDuration( 0.5 );
2324 m_AreaDamage.SetHitZones( { "Head","Torso","LeftHand","LeftLeg","LeftFoot","RightHand","RightLeg","RightFoot" } );
2325 m_AreaDamage.SetAmmoName( "FireDamage" );
2326 m_AreaDamage.Spawn();
2327 }
2328
2330 {
2331 if ( m_AreaDamage )
2332 {
2333 m_AreaDamage.Destroy();
2334 }
2335 }
2336
2339 {
2340 ErrorEx("Deprecated method", ErrorExSeverity.INFO);
2341
2342 return false;
2343 }
2344
2345 //================================================================
2346 // ACTIONS
2347 //================================================================
2348 // --- Actions / Action conditions
2349 //Check if there is some kindling attached
2351 {
2352 return GetKindlingCount() > 0;
2353 }
2354
2355 //Check if the weather is too windy
2356 static bool IsWindy()
2357 {
2358 //check wind
2359 float wind_speed = GetGame().GetWeather().GetWindSpeed();
2360 float wind_speed_threshold = GetGame().GetWeather().GetWindMaximumSpeed() * FireplaceBase.IGNITE_WIND_THRESHOLD;
2361
2362 return ( wind_speed >= wind_speed_threshold );
2363 }
2364
2366 {
2367 return m_NoIgnite;
2368 }
2369
2370 void SetIgniteFailure( bool failure )
2371 {
2372 m_NoIgnite = failure;
2373 }
2374
2375 //Check if the fireplace is too wet to be ignited
2376 static bool IsEntityWet( notnull EntityAI entity_ai )
2377 {
2378 return ( entity_ai.GetWet() >= FireplaceBase.PARAM_MAX_WET_TO_IGNITE );
2379 }
2380
2381 bool IsWet()
2382 {
2383 return FireplaceBase.IsEntityWet( this );
2384 }
2385
2386 //Check if there is any roof above fireplace
2388 {
2389 return m_RoofAbove;
2390 }
2391
2392 //check if fireplace is opened
2393 override bool IsOpen()
2394 {
2395 return true;
2396 }
2397
2398 //Check if there is enough space for smoke
2400 {
2401 return !MiscGameplayFunctions.IsUnderRoof( this, FireplaceBase.MIN_CEILING_HEIGHT );
2402 }
2403
2404 //Check if it's raining and there is only sky above fireplace
2405 static bool IsRainingAboveEntity( notnull EntityAI entity_ai )
2406 {
2407 return ( GetGame() && ( GetGame().GetWeather().GetRain().GetActual() >= FireplaceBase.PARAM_IGNITE_RAIN_THRESHOLD ) );
2408 }
2409
2411 {
2412 return FireplaceBase.IsRainingAboveEntity( this );
2413 }
2414
2415 //Check there is water surface bellow fireplace
2416 static bool IsEntityOnWaterSurface( notnull EntityAI entity_ai )
2417 {
2418 vector fireplace_pos = entity_ai.GetPosition();
2419 if ( GetGame().SurfaceIsSea( fireplace_pos[0], fireplace_pos[2] ) )
2420 {
2421 return true;
2422 }
2423 else if ( GetGame().SurfaceIsPond( fireplace_pos[0], fireplace_pos[2] ) )
2424 {
2425 return true;
2426 }
2427 else
2428 {
2429 string surface_type;
2430 GetGame().SurfaceGetType3D( fireplace_pos[0], fireplace_pos[1] + 1.0, fireplace_pos[2], surface_type );
2431 return surface_type.Contains("water");
2432 }
2433
2434 return false;
2435 }
2437 {
2438 return FireplaceBase.IsEntityOnWaterSurface( this );
2439 }
2440
2441 //check if the surface is interior
2442 static bool IsEntityOnInteriorSurface( notnull EntityAI entity_ai )
2443 {
2444 string surface_type;
2445 vector fireplace_pos = entity_ai.GetPosition();
2446 GetGame().SurfaceGetType3D( fireplace_pos[0], fireplace_pos[1] + 1.0, fireplace_pos[2], surface_type );
2447 return ( ( GetGame().ConfigGetInt( "CfgSurfaces " + surface_type + " interior" ) ) == 1 );
2448 }
2450 {
2451 return FireplaceBase.IsEntityOnInteriorSurface( this );
2452 }
2453
2454 //Checks if has not additional items in it
2455 override bool IsEmpty()
2456 {
2457 return ( GetInventory().GetCargo().GetItemCount() == 0 && GetInventory().AttachmentCount() == 0 );
2458 }
2459
2460 //Checks if it has no items in cargo
2462 {
2463 return ( GetInventory().GetCargo().GetItemCount() == 0 );
2464 }
2465
2467 {
2468 return GetInventory().FindAttachment(InventorySlots.GetSlotIdFromString("CookingTripod")) != null;
2469 }
2470
2471 //Check if object is in animation phase
2472 bool IsInAnimPhase( string anim_phase )
2473 {
2474 return GetAnimationPhase(anim_phase) == 0;
2475 }
2476
2478 {
2479 array<Object> objs = {};
2480 if (GetGame().IsBoxCollidingGeometry(GetWorldPosition() + Vector(0, size[1] * 0.5 + 0.1, 0), GetDirection().VectorToAngles(), size, ObjIntersect.View, ObjIntersect.Geom, {this}, objs))
2481 {
2482 foreach (Object obj : objs)
2483 {
2484 if (dBodyGetInteractionLayer(obj) == PhxInteractionLayers.ITEM_LARGE)
2485 return false;
2486 }
2487 }
2488 return true;
2489 }
2490
2491
2492 override bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
2493 {
2494 if (!otherDestination || otherDestination.GetParent() == this)
2495 {
2496 return false;
2497 }
2498 return true;
2499 }
2500
2501 //Action condition for building oven
2503 {
2504 return !IsOven() && !IsBurning() && (GetAttachedStonesCount() >= MIN_STONES_TO_BUILD_OVEN) && !FindAttachmentBySlotName("CookingTripod") && !HasStoneCircle() && IsSpaceForOven();
2505 }
2506
2508 {
2509 const float size = 0.6;
2510 return IsSpaceFor(Vector(size, size, size));
2511 }
2512
2513 //Action condition for stone circle
2515 {
2517 }
2518
2520 {
2521 return IsSpaceFor(Vector(0.9, 0.1, 0.9));
2522 }
2523
2524 //Action condition for dismantling oven
2526 {
2528 }
2529 //Action condition for dismantling stone circle
2531 {
2532 return ( HasStoneCircle() && !IsOven() && !IsBurning() );
2533 }
2534
2536 {
2538 }
2539
2540 //Can extinguish fire
2542 {
2543 return IsBurning();
2544 }
2545
2546 FireplaceLight GetLightEntity()
2547 {
2548 return m_Light;
2549 }
2550
2551 void SetLightEntity( FireplaceLight light )
2552 {
2553 m_Light = light;
2554 }
2555
2556 //================================================================
2557 // ADVANCED PLACEMENT
2558 //================================================================
2559
2560 override void OnPlacementComplete( Man player, vector position = "0 0 0", vector orientation = "0 0 0" )
2561 {
2562 super.OnPlacementComplete( player, position, orientation );
2563
2564 if ( GetGame().IsServer() )
2565 {
2566 //remove grass
2568 cc_object.SetOrientation( orientation );
2569 GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( GetGame().ObjectDelete, 1000, false, cc_object );
2570
2571 SetIsPlaceSound( true );
2572 }
2573 }
2574
2575 override string GetPlaceSoundset()
2576 {
2577 return "placeFireplace_SoundSet";
2578 }
2579
2580 //================================================================
2581 // QUANITTY
2582 //================================================================
2583 // calculates and sets total energy based on possible (fuel/kinidling) item attachments
2584 protected void CalcAndSetTotalEnergy()
2585 {
2586 if ( GetGame() && GetGame().IsServer() )
2587 {
2588 m_TotalEnergy = 0;
2589
2590 foreach (FireConsumableType fireConsumableType : m_FireConsumableTypes)
2591 {
2592 string quantityConfigPath = string.Format("CfgVehicles %1 varQuantityMax", fireConsumableType.GetItemType().ToString());
2593 string stackMaxConfigPath = string.Format("CfgSlots Slot_%1 stackMax", fireConsumableType.GetAttSlot());
2594 if (GetGame().ConfigIsExisting(quantityConfigPath))
2595 {
2596 float quantityMax = GetGame().ConfigGetFloat(quantityConfigPath);
2597 }
2598
2599 if (GetGame().ConfigIsExisting(stackMaxConfigPath))
2600 {
2601 float stackMax = GetGame().ConfigGetFloat(stackMaxConfigPath);
2602 }
2603
2604 //debug
2605 //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() + "]" );
2606
2607 if (stackMax > 0)
2608 {
2609 m_TotalEnergy += stackMax * fireConsumableType.GetEnergy();
2610 }
2611 else
2612 {
2613 m_TotalEnergy += quantityMax * fireConsumableType.GetEnergy();
2614 }
2615 }
2616
2617 //debug
2618 //Print( "Total energy = " + m_TotalEnergy.ToString() );
2619 }
2620 }
2621
2622 // calculates and sets current quantity based on actual (fuel/kinidling) item attachments
2623 protected void CalcAndSetQuantity()
2624 {
2625 if (GetGame() && GetGame().IsServer())
2626 {
2627 float remainingEnergy;
2628
2629 foreach (FireConsumable fireConsumable : m_FireConsumables)
2630 {
2631 float quantity = fireConsumable.GetItem().GetQuantity();
2632 if (quantity > 0)
2633 {
2634 remainingEnergy += ((quantity - 1) * fireConsumable.GetEnergy()) + fireConsumable.GetRemainingEnergy();
2635 //Print( fireConsumable.GetItem().GetType() + " remaining energy = " + ( ( ( quantity - 1 ) * fire_consumable.GetEnergy() ) + fire_consumable.GetRemainingEnergy() ).ToString() );
2636 }
2637 else
2638 {
2639 remainingEnergy += fireConsumable.GetRemainingEnergy();
2640 //Print( fireConsumable.GetItem().GetType() + " remaining energy = " + ( fireConsumable.GetRemainingEnergy().ToString() ) );
2641 }
2642 }
2643
2644 SetQuantity(remainingEnergy / m_TotalEnergy * GetQuantityMax());
2645 }
2646 }
2647
2649 {
2650 super.OnAttachmentQuantityChanged(item);
2651
2653 }
2654
2655 override bool CanReleaseAttachment(EntityAI attachment)
2656 {
2657 if (!super.CanReleaseAttachment(attachment))
2658 return false;
2659
2660 ItemBase item = ItemBase.Cast(attachment);
2661 if (IsKindling(item) || IsFuel(item))
2662 {
2663 return !IsBurning();
2664 }
2665
2666 return true;
2667 }
2668
2669 void LockOvenAttachments(bool lock)
2670 {
2671 //Print("LockOvenAttachments");
2672 //string path_cooking_equipment = "" + CFG_VEHICLESPATH + " " + GetType() + " GUIInventoryAttachmentsProps CookingEquipment attachmentSlots";
2673 string path_cooking_equipment = string.Format("%1 %2 GUIInventoryAttachmentsProps CookingEquipment attachmentSlots", CFG_VEHICLESPATH, GetType());
2674 //string path_direct_cooking = "" + CFG_VEHICLESPATH + " " + GetType() + " GUIInventoryAttachmentsProps DirectCooking attachmentSlots";
2675 string path_direct_cooking = string.Format("%1 %2 GUIInventoryAttachmentsProps DirectCooking attachmentSlots", CFG_VEHICLESPATH, GetType());
2676 if ( GetGame().ConfigIsExisting(path_cooking_equipment) && GetGame().ConfigIsExisting(path_direct_cooking) )
2677 {
2678 array<string> arr_cooking_equipment = new array<string>;
2679 array<string> arr_direct_cooking = new array<string>;
2680 GetGame().ConfigGetTextArray(path_cooking_equipment,arr_cooking_equipment);
2681 GetGame().ConfigGetTextArray(path_direct_cooking,arr_direct_cooking);
2682 for ( int i = 0; i < arr_cooking_equipment.Count(); i++ )
2683 {
2684 if ( lock != GetInventory().GetSlotLock(InventorySlots.GetSlotIdFromString(arr_cooking_equipment[i])) )
2685 {
2686 GetInventory().SetSlotLock(InventorySlots.GetSlotIdFromString(arr_cooking_equipment[i]),lock);
2687 //Print("attachment lock: " + arr_cooking_equipment[i] + " " + lock);
2688 }
2689 }
2690
2691 for ( i = 0; i < arr_direct_cooking.Count(); i++ )
2692 {
2693 if ( lock == GetInventory().GetSlotLock(InventorySlots.GetSlotIdFromString(arr_direct_cooking[i])) )
2694 {
2695 GetInventory().SetSlotLock(InventorySlots.GetSlotIdFromString(arr_direct_cooking[i]),!lock);
2696 //Print("attachment lock: " + arr_direct_cooking[i] + " " + !lock);
2697 }
2698 }
2699 }
2701 }
2703 {
2704 return true;
2705 }
2706
2707 override void OnRPC( PlayerIdentity sender, int rpc_type, ParamsReadContext ctx )
2708 {
2709 super.OnRPC( sender, rpc_type, ctx );
2710
2711 ref Param1<bool> p = new Param1<bool>(false);
2712
2713 if (ctx.Read(p))
2714 {
2715 bool failure = p.param1;
2716 }
2717
2718 switch ( rpc_type )
2719 {
2720 case FirePlaceFailure.WIND:
2721
2722 if ( failure )
2723 {
2725 SoundFireStop();
2727 }
2728
2729 break;
2730
2731 case FirePlaceFailure.WET:
2732
2733 if ( failure )
2734 {
2736 SoundFireStop();
2738 }
2739
2740 break;
2741 }
2742 }
2743
2744
2745 //================================================================
2746 // DEBUG
2747 //================================================================
2748
2749 //Debug menu Spawn Ground Special
2750 override void OnDebugSpawn()
2751 {
2752 ItemBase firewood = ItemBase.Cast(GetInventory().CreateInInventory("Firewood"));
2753 firewood.SetQuantity(firewood.GetQuantityMax());
2754
2755 ItemBase sticks = ItemBase.Cast(GetInventory().CreateInInventory("WoodenStick"));
2756 sticks.SetQuantity(sticks.GetQuantityMax());
2757
2758 ItemBase stone = ItemBase.Cast(GetInventory().CreateInInventory("Stone"));
2759 stone.SetQuantity(stone.GetQuantityMax());
2760
2761 GetInventory().CreateInInventory("Rag");
2762
2763 SpawnEntityOnGroundPos("PetrolLighter", GetPosition());
2764 }
2765
2766 override void GetDebugButtonNames(out string button1, out string button2, out string button3, out string button4)
2767 {
2768 button1 = "Ignite";
2769 button2 = "Extinguish";
2770 }
2771
2772 override void OnDebugButtonPressServer(int button_index)
2773 {
2774 switch (button_index)
2775 {
2776 case 1:
2777 OnIgnitedThis(null);
2778 break;
2779 case 2:
2780 StopFire();
2781 break;
2782 }
2783 }
2784}
InventoryMode
Definition Inventory.c:20
eBleedingSourceType GetType()
ref NoiseParams m_NoisePar
void AreaDamageManager(EntityAI parent)
override void EEInit()
const int ECE_PLACE_ON_SURFACE
void Synchronize()
Container_Base m_HalfExtents
static const float PARAM_BURN_DAMAGE_COEF
Definition Cooking.c:24
PhxInteractionLayers
Definition DayZPhysics.c:2
protected ExplosiveLight m_Light
light
override void EEDelete(EntityAI parent)
protected ref UniversalTemperatureSourceSettings m_UTSSettings
float GetAirResistanceForSmokeParticles(float actual_height)
const int MAX_TEMPERATURE_TO_DISMANTLE_OVEN
minimum amount of stones for oven
protected void ParticleFireStartStart()
protected ref Timer m_HeatingTimer
void RefreshFireplaceVisuals()
ATTACHMENT_FIREWOOD
protected void ParticleSteamEndStop()
protected void ParticleSteamExtinguishingStop()
protected bool m_NoIgnite
const string MESSAGE_BURY_ASHES_FAILED_BURNING
ItemBase GetCookingEquipment()
const string SOUND_FIRE_EXTINGUISHING
static bool IsEntityOnInteriorSurface(notnull EntityAI entity_ai)
protected void StopHeating()
bool CanBuildStoneCircle()
bool HasAnyKindling()
const float TEMPERATURE_LOSS_MP_OVEN
bool SmokingSlotsInUse()
const float PARAM_HEAT_THROUGH_AIR_COEF
radius in which objects are heated by fire
bool DirectCookingSlotsInUse()
protected void ParticleSmallFireStart()
protected void BurnItemsInFireplace()
protected void CookOnDirectSlot(ItemBase slot_item, float temp_equip, float temp_ext)
protected void SoundFireLightStart()
protected void SoundFireHeavyStart()
ATTACHMENT_BARK_OAK
const string ANIMATION_OVEN
const int DIRECT_COOKING_SLOT_COUNT
direct cooking slots
const int TIMER_HEATING_UPDATE_INTERVAL
protected ref map< ItemBase, ref FireConsumable > m_FireConsumables
void LockOvenAttachments(bool lock)
protected void ParticleNormalSmokeStop()
ATTACHMENT_FRYING_PAN
const string MESSAGE_IGNITE_NO_KINDLING
const int TIMER_COOLING_UPDATE_INTERVAL
update interval duration of heating process (seconds)
protected int PARTICLE_OVEN_FIRE_START
ATTACHMENT_CAULDRON
const string MESSAGE_IGNITE_IN_WATER
ATTACHMENT_STICKS
protected ref Timer m_CoolingTimer
protected void SoundFireWindyNoIgniteStart()
const float PARAM_TEMPERATURE_DECREASE
how much will temperature increase when fireplace is burning (degree Celsius per second)
protected ref FireConsumable m_ItemToConsume
const float PARAM_TEMPERATURE_INCREASE
minimum fireplace temperature under which the fireplace is inactive (degree Celsius)
const float PARAM_FIRE_CONSUM_RATE_AMOUNT
value for calculating wetness loss during cooling process
const string MESSAGE_REIGNITE_RAIN
const int LIFETIME_FIREPLACE_STONE_CIRCLE
protected void ParticleSmallSmokeStop()
const string SOUND_FIRE_HEAVY
protected float GetTemperatureLossMP()
protected float GetFireConsumableTypeEnergy(ItemBase item)
protected void SetFuelBurnRateMP(float value)
protected void ParticleSmallFireStop()
const string MESSAGE_BURY_ASHES_FAILED_NOT_EMPTY
protected EffectSound m_SoundFireLoop
protected int PARTICLE_SMALL_FIRE
protected void SoundFireWetNoIgniteStart()
bool IsSpaceForOven()
static bool IsEntityOnWaterSurface(notnull EntityAI entity_ai)
const float TEMPERATURE_LOSS_MP_DEFAULT
min height of ceiling for fire to be ignited
protected FireplaceFireState m_LastFireState
const string SOUND_FIRE_LIGHT
protected ItemBase m_SmokingSlots[SMOKING_SLOT_COUNT]
enum FireplaceFireState m_IsBurning
bool IsCeilingHighEnoughForSmoke()
override bool IsFireplace()
const string MESSAGE_IGNITE_IGNIT_ITEM_DAMAGED
const string MESSAGE_IGNITE_RAIN
protected void SetFireState(FireplaceFireState state)
protected Object m_ClutterCutter
const float PARAM_ITEM_HEAT_MIN_TEMP
value for calculating temperature increase on each heat update interval (degree Celsius)
protected void RemoveFromFireConsumables(FireConsumable fire_consumable)
protected void TransferHeatToNearPlayers()
DEPRECATED.
protected void Heating()
protected int PARTICLE_OVEN_FIRE_END
protected bool IsFuel(ItemBase item)
Returns if item attached to fireplace is fuel.
const float PARAM_MIN_TEMP_TO_REIGNITE
maximum wetness value when the fireplace can be ignited
override void OnDebugButtonPressServer(int button_index)
protected ref AreaDamageManager m_AreaDamage
ATTACHMENT_PUNCHEDCARD
void DestroyFireplace()
ATTACHMENT_EYEMASK_COLORBASE
bool HasCookingStand()
protected bool m_HasStoneCircle
bool CanBuildOven()
protected float m_TotalEnergy
ATTACHMENT_BANDAGE
bool IsOnWaterSurface()
const string MESSAGE_CANNOT_DISMANTLE_OVEN
protected bool m_HasAshes
void StopFire(FireplaceFireState fire_state=FireplaceFireState.END_FIRE)
const string OBJECT_CLUTTER_CUTTER
const string ANIMATION_CAULDRON_HANDLE
protected void AddTemperatureToItemByFire(ItemBase item)
bool HasAshes()
protected void ParticleFireWindyNoIgniteStart()
ATTACHMENT_BOOK
protected ItemBase m_CookingEquipment
bool IsRainingAbove()
protected int PARTICLE_FIRE_END
protected FireConsumable GetItemToConsume()
const float DIRECT_COOKING_SPEED
const int LIFETIME_FIREPLACE_STONE_OVEN
ATTACHMENT_GIFTWRAP
ATTACHMENT_RAGS
const float PARAM_MAX_TRANSFERED_TEMPERATURE
DEPRECATED value for calculation of heat transfered from fireplace through air to player (environment...
override void OnAttachmentRuined(EntityAI attachment)
protected bool m_IsOven
const string ANIMATION_TRIPOD
protected int PARTICLE_NO_IGNITE_WIND
protected EffectSound m_SoundFire
const int MIN_STONES_TO_BUILD_OVEN
minimum amount of stones for circle
const float PARAM_HEAT_RADIUS
radius in which objects are fully heated by fire
protected int PARTICLE_SMALL_SMOKE
protected float m_TemperatureLossMP
protected Particle m_ParticleSteamExtinguishing
FireplaceLight GetLightEntity()
protected void SoundFireExtinguishingStart()
protected FireConsumable GetFireConsumableByItem(ItemBase item)
const string MESSAGE_IGNITE_WIND
const float TEMPERATURE_LOSS_MP_STONES
const string MATERIAL_FIREPLACE_GLOW
protected int PARTICLE_FIRE_START
protected void StartCooling()
protected ref UniversalTemperatureSourceLambdaFireplace m_UTSLFireplace
static bool IsWindy()
protected vector GetFireEffectPosition()
static bool IsEntityWet(notnull EntityAI entity_ai)
const string SOUND_FIRE_EXTINGUISHED
bool HasStones()
const string ANIMATION_ASHES
const float PARAM_NORMAL_FIRE_TEMPERATURE
maximum fireplace temperature of a small fire (degree Celsius)
protected Particle m_ParticleFireStart
protected float m_FuelBurnRateMP
determines how fast will the fireplace loose its temperature when cooling (lower is better)
protected int PARTICLE_NORMAL_FIRE
bool CanDismantleStoneCircle()
const string MESSAGE_IGNITE_UNDER_LOW_ROOF
const float PARAM_MIN_FIRE_TEMPERATURE
maximum fireplace temperature of a normal fire (degree Celsius)
protected void AddDamageToItemByFire(ItemBase item, bool can_be_ruined)
bool IsInAnimPhase(string anim_phase)
const float MIN_CEILING_HEIGHT
maximum temperature for dismantling oven
const float PARAM_MAX_ITEM_HEAT_TEMP_INCREASE
minimum temperature for items that can be heated in fireplace cargo or as attachments (degree Celsius...
const string MATERIAL_FIREPLACE_NOGLOW
bool IsSpaceForCircle()
bool IsCargoEmpty()
const string ANIMATION_INVENTORY
protected void ParticleWetNoIgniteStart()
protected void ParticleFireEndStart()
protected int GetFuelCount()
Returns count of all fuel type items (define in 'm_FuelTypes') attached to fireplace.
protected void SoundFireNoFireStart()
protected void AddTemperatureToFireplace(float amount)
DEPRECATED.
const string ANIMATION_STONES
bool GetIgniteFailure()
bool IsOnInteriorSurface()
void RefreshFireState()
protected void ~FireplaceBase()
protected bool m_RoofAbove
const float PARAM_SMALL_FIRE_TEMPERATURE
protected int GetFireState()
protected void Cooling()
protected void ParticleFireEndStop()
Cooking GetCookingProcess()
protected void AddToFireConsumables(ItemBase item)
const float PARAM_WET_COOLING_DECREASE_COEF
value for calculating wetness loss during heating process
protected ref UniversalTemperatureSource m_UTSource
protected void CookWithEquipment()
ATTACHMENT_STONES
const string MESSAGE_REIGNITE_TOO_WET
const int SMOKING_SLOT_COUNT
void DestroyAreaDamage()
ATTACHMENT_COOKING_POT
protected int PARTICLE_STEAM_END
const float FUEL_BURN_RATE_OVEN
const string MESSAGE_BURY_ASHES_FAILED_TOO_HOT
protected void CalcAndSetQuantity()
bool IsBurning()
protected FireConsumable SetItemToConsume()
bool IsWet()
protected void ParticleNormalFireStop()
bool IsRoofAbove()
const string MESSAGE_CANNOT_BUILD_OVEN
void StartFire(bool force_start=false)
protected void CalcAndSetTotalEnergy()
const string ANIMATION_WOOD
ATTACHMENT_PAPER
bool CanCookOnStick()
void SetIgniteFailure(bool failure)
protected void SetBurningState(bool is_burning)
const float FUEL_BURN_RATE_DEFAULT
const float PARAM_BURN_WET_THRESHOLD
maximum rain value when the fireplace can be ignited
ATTACHMENT_BARK_BIRCH
ATTACHMENT_TRIPOD
protected Particle m_ParticleSmallFire
override bool DisassembleOnLastDetach()
const float FUEL_BURN_RATE_STONES
bool HasStoneCircle()
ATTACHMENT_COOKINGSTAND
void SetStoneCircleState(bool has_stonecircle)
protected void StopAllParticlesAndSounds()
protected float m_LightDistance
static bool IsRainingAboveEntity(notnull EntityAI entity_ai)
void SetExtinguishingState()
protected Particle m_ParticleFireEnd
protected void SpendFireConsumable(float amount)
const string ANIMATION_KINDLING
protected void AddDamageToItemByFireEx(ItemBase item, bool can_be_ruined, bool pAttachment)
protected void ParticleSteamExtinguishingStart()
const string MESSAGE_IGNITE_TOO_WET
protected void ParticleWetNoIgniteStop()
const float PARAM_IGNITE_RAIN_THRESHOLD
minimum fireplace temperature under which the fireplace can be reignited using air only (degree Celsi...
protected bool IsKindling(ItemBase item)
Returns if item attached to fireplace is kindling.
bool IsFacingFireplace(PlayerBase player)
DEPRECATED.
protected void ParticleFireStartStop()
bool GetCeilingHeight(out float actual_height)
const float PARAM_COOKING_EQUIP_MAX_TEMP
temperature threshold for starting coooking process (degree Celsius)
const float PARAM_ITEM_HEAT_TEMP_INCREASE_COEF
value for calculating damage on items located in fireplace cargo
FireplaceFireState
@ NO_FIRE
@ SMALL_FIRE
@ EXTINGUISHED_FIRE
@ COUNT
@ EXTINGUISHING_FIRE
@ REIGNITED_FIRE
@ END_FIRE
@ NORMAL_FIRE
@ START_FIRE
int GetAttachedStonesCount()
bool IsOven()
const float PARAM_WET_INCREASE_COEF
maximum wetness value when the fireplace is able to burn
const string ANIMATION_COOKWARE_HANDLE
private bool m_CanNoise
protected Particle m_ParticleSmallSmoke
const float PARAM_MAX_WET_TO_IGNITE
how much will temperature decrease when fireplace is cooling (degree Celsius per second)
static protected ref map< typename, ref FireConsumableType > m_FireConsumableTypes
protected void SoundFireStop()
protected void ParticleSteamEndStart()
override void EECargoOut(EntityAI item)
protected int PARTICLE_NORMAL_SMOKE
protected void AddWetnessToItem(ItemBase item, float amount)
protected Particle m_ParticleNormalSmoke
const float IGNITE_WIND_THRESHOLD
bool IsSpaceFor(vector size)
enum FireplaceFireState WIND
void ClearCookingEquipment()
DEPRECATED.
void CreateAreaDamage()
const string ANIMATION_STICKS
const float PARAM_FULL_HEAT_RADIUS
maximum value of temperature of items in fireplace when heating (degree Celsius)
const string ANIMATION_STONE
protected void StartHeating()
bool IsItemAttachedQuantity(typename item_type, float quantity)
const float PARAM_COOKING_EQUIP_TEMP_INCREASE
maximum temperature of attached cooking equipment (degree Celsius)
protected Particle m_ParticleNormalFire
protected void SetAshesState(bool has_ashes)
bool IsItemTypeAttached(typename item_type)
bool HasLastFuelKindlingAttached()
override void GetDebugButtonNames(out string button1, out string button2, out string button3, out string button4)
protected float GetFuelBurnRateMP()
override bool IsEmpty()
protected void SoundFireExtinguishedStart()
protected void RefreshFireParticlesAndSounds(bool force_refresh)
protected void ParticleNormalFireStart()
void SetOvenState(bool is_oven)
protected void StopCooling()
protected FireplaceFireState m_FireState
enum FireplaceFireState WET
protected Particle m_ParticleSteamEnd
const string MESSAGE_BURY_ASHES_FAILED_SURFACE
protected void SetTemperatureLossMP(float value)
const float PARAM_WET_HEATING_DECREASE_COEF
value for calculating of wetness that fireplace gain when raining
const int MIN_STONES_TO_BUILD_CIRCLE
protected int PARTICLE_STEAM_EXTINGUISHING
bool HasLastAttachment()
const string ANIMATION_BURNT_WOOD
const string MESSAGE_REIGNITE_NO_KINDLING
void SetLightEntity(FireplaceLight light)
bool CanDismantleOven()
protected void SmokeOnSmokingSlot(ItemBase slot_item, float temp_equip, float temp_ext)
const float PARAM_COOKING_TEMP_THRESHOLD
cooking
const string SOUND_FIRE_NO_FIRE
protected int m_OvenAttachmentsLockState
const float SMOKING_SPEED
protected int PARTICLE_OVEN_FIRE
protected void SetBurntFirewood()
override bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
protected int GetKindlingCount()
Returns count of all kindling type items (define in 'm_KindlingTypes') attached to fireplace.
void AddWetnessToFireplace(float amount)
protected ItemBase m_DirectCookingSlots[DIRECT_COOKING_SLOT_COUNT]
protected ref Cooking m_CookingProcess
determines how fast will the fuel item burn before spending (lower is better)
FoodStageType
Definition FoodStage.c:2
override bool IsHologram()
Definition ItemBase.c:5556
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
Definition ItemBase.c:6436
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
Definition ItemBase.c:5779
protected bool CanHaveTemperature()
Definition ItemBase.c:9149
protected bool CanHaveWetness()
Definition ItemBase.c:9143
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Definition ItemBase.c:8431
override float GetTemperature()
Definition ItemBase.c:8156
override void SetWet(float value, bool allow_client=false)
Definition ItemBase.c:8204
void SetIsPlaceSound(bool is_place_sound)
Definition ItemBase.c:8900
void PlayPlaceSound()
Definition ItemBase.c:8938
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:7805
bool IsPlaceSound()
Definition ItemBase.c:8905
override float GetWet()
Definition ItemBase.c:8233
override int GetQuantityMax()
Definition ItemBase.c:7907
class NoiseSystem NoiseParams()
Definition Noise.c:15
void PlayParticle(int particle_id=-1)
Method to tell the particle to start playing.
bool StopParticle(int flags=0)
Method to tell the particle to stop playing.
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
void OnRPC(float stamina, float stamina_cap, bool cooldown)
deprecated use, StaminaHandler uses SyncJunctures now
class JsonUndergroundAreaTriggerData GetPosition
Deferred version of AreaDamageLooped.
proto void SurfaceGetType3D(float x, float y, float z, out string type)
proto native Object CreateObjectEx(string type, vector pos, int iFlags, int iRotation=RF_DEFAULT)
Creates object of certain type.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto native DayZPlayer GetPlayer()
override ScriptCallQueue GetCallQueue(int call_category)
Definition DayZGame.c:1153
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native bool ConfigIsExisting(string path)
proto native Weather GetWeather()
Returns weather controller object.
proto native NoiseSystem GetNoiseSystem()
represents base for cargo storage for entities
Definition Cargo.c:7
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
ItemBase GetItem()
void SetRemainingEnergy(float energy)
float GetRemainingEnergy()
override bool IsOpen()
override void OnDebugSpawn()
override bool IsBarrelWithHoles()
override protected vector GetSmokeEffectPosition()
override bool IsBaseFireplace()
Definition Fireplace.c:19
override void RefreshFireplacePhysics()
Definition Fireplace.c:513
override void SetCookingEquipment(ItemBase equipment)
Definition Fireplace.c:354
override void OnStoreSave(ParamsWriteContext ctx)
override bool CanExtinguishFire()
override void ParticleNormalSmokeStart()
override bool CanReleaseAttachment(EntityAI attachment)
Definition Fireplace.c:150
override void OnIgnitedThis(EntityAI fire_source)
override string GetPlaceSoundset()
override void AfterStoreLoad()
Definition Fireplace.c:556
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void EEItemAttached(EntityAI item, string slot_name)
override bool IsPrepareToDelete()
override bool CanShowSmoke()
override void OnVariablesSynchronized()
override bool IsIndoorOven()
Definition OvenIndoor.c:155
override void ParticleSmallSmokeStart()
override bool IsFireplaceIndoor()
script counterpart to engine's class Inventory
Definition Inventory.c:77
proto native EntityAI GetAttachmentFromIndex(int index)
proto native int AttachmentCount()
Returns count of attachments attached to this item.
InventoryLocation.
proto native EntityAI GetParent()
returns parent of current inventory location
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
override bool CanBeCooked()
Definition Edible_Base.c:95
Definition EnMath.c:7
proto void AddNoisePos(EntityAI source_entity, vector pos, NoiseParams noise_params, float external_strenght_multiplier=1.0)
Legacy way of using particles in the game.
Definition Particle.c:7
void SetParameter(int emitter, int parameter, float value)
Set the value of a parameter of an emitor in the particle.
Definition Particle.c:625
static const int CAMP_STOVE_FIRE
static const int CAMP_STOVE_FIRE_END
static const int CAMP_STEAM_EXTINGUISH_START
static const int CAMP_FIRE_START
static const int CAMP_FIRE_END
static const int CAMP_STOVE_FIRE_START
static const int CAMP_NORMAL_FIRE
static const int CAMP_NORMAL_SMOKE
static const int CAMP_SMALL_FIRE
static const int CAMP_NO_IGNITE_WIND
static const int CAMP_STEAM_2END
static const int CAMP_SMALL_SMOKE
The class that will be instanced (moddable)
Definition gameplay.c:378
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto void Call(func fn, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
proto bool Write(void value_out)
proto bool Read(void value_in)
override void Stop()
original Timer deletes m_params which is unwanted
float m_TemperatureMax
min temperature you can get from the TemperatureSource
bool m_AffectStat
update is called manually (ex. own tick of parent entity)
float m_RangeFull
temperature cap that will limit the return value from GetTemperature method
bool m_ManualUpdate
if the Update is running periodically
float m_TemperatureMin
how often the Update is ticking
float m_RangeMax
range where the full temperature is given to receiver
float m_TemperatureCap
max temperature you can get from the TemperatureSource
proto native float GetWindMaximumSpeed()
Returns maximal wind speed in metre per second.
proto native float GetWindSpeed()
Returns actual wind speed in metre per second.
proto native Rain GetRain()
Returns a rain phenomenon object.
proto native float GetActual()
Returns actual value of phenomenon in range <0, 1>.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
static const vector Forward
Definition EnConvert.c:109
static const vector Zero
Definition EnConvert.c:110
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Definition EnConvert.c:271
proto native CGame GetGame()
ErrorExSeverity
Definition EnDebug.c:62
enum ShapeType ErrorEx
const float FIRE_ATTACHMENT_DAMAGE_PER_SECOND
various damage per second constants
Definition constants.c:712
const int STATE_BADLY_DAMAGED
Definition constants.c:743
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Acos(float c)
Returns angle in radians from cosinus.
static proto float Cos(float angle)
Returns cosinus of angle in radians.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float AbsFloat(float f)
Returns absolute value.
static proto float Sin(float angle)
Returns sinus of angle in radians.
const string CFG_VEHICLESPATH
Definition constants.c:195
EmitorParam
Definition EnVisual.c:114
proto native int dBodyGetInteractionLayer(notnull IEntity ent)
bool Contains(string sample)
Returns true if sample is substring of string.
Definition EnString.c:286
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8