DayZ 1.24
Loading...
Searching...
No Matches
Torch.c
Go to the documentation of this file.
2{
4 {
5 Init();
6 }
7
10 bool m_CanReceiveUpgrade; // Synchronized variable
11 bool m_IsBeingDestructed = false;
12
20
21 int m_RagsUpgradedCount;//how many rags were upgraded with fuel/lard
22 bool m_ConsumeRagFlipFlop;//are we burning rag or fuel/lard
24
25 string m_DecraftResult = "WoodenStick";
26 TorchLight m_Light;
27 bool m_WasLit;//was this item ever lit ? (used for correct material setting after reconnect for extinguished flammable items)
28
32
33 override void DeferredInit()
34 {
36 LockRags(true);
37 }
38
39 void Init()
40 {
42 {
43 string cfg_path = "CfgVehicles " + GetType();
44 m_BurnTimePerRagEx = GetGame().ConfigGetFloat(cfg_path + " burnTimePerRag");
45 m_BurnTimePerFullLardEx = GetGame().ConfigGetFloat(cfg_path + " burnTimePerFullLardDose");
46 m_BurnTimePerFullFuelDoseEx = GetGame().ConfigGetFloat(cfg_path + " burnTimePerFullFuelDose");
47 m_MaxConsumableLardQuantityEx = GetGame().ConfigGetFloat(cfg_path + " maxConsumableLardDose");
48 m_MaxConsumableFuelQuantityEx = GetGame().ConfigGetFloat(cfg_path + " maxConsumableFuelDose");
49 }
50 RegisterNetSyncVariableBool("m_CanReceiveUpgrade");
51 }
52
53 override void EEInit()
54 {
55 super.EEInit();
56
57 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
58 {
60 m_UTSSettings.m_Updateable = true;
61 m_UTSSettings.m_UpdateInterval = 1;
62 m_UTSSettings.m_TemperatureMin = 0;
63 m_UTSSettings.m_TemperatureMax = 300;
64 m_UTSSettings.m_RangeFull = 0.5;
65 m_UTSSettings.m_RangeMax = 1;
66 m_UTSSettings.m_TemperatureCap = 5;
67
70 }
71
72 }
73
75 {
76 if (GetHierarchyRoot())
77 return GetHierarchyRoot().GetPosition();
78
79 return super.GetPosition();
80 }
81
82 override void EEDelete(EntityAI parent)
83 {
84 super.EEDelete(parent);
85 if (m_LoopSoundEntity != NULL && GetGame() != NULL)
86 GetGame().ObjectDelete(m_LoopSoundEntity);
87
89 }
90
92 {
93 ItemBase att = ItemBase.Cast(GetInventory().FindAttachment(slotId));
94 if (att && att.IsFullQuantity())
95 return false;
96
97 return super.CanReceiveAttachment(attachment, slotId);
98 }
99
100 override bool CanPutInCargo(EntityAI parent)
101 {
102 if (!super.CanPutInCargo(parent)) return false;
103 return CanBeTakenAsCargo();
104 }
105
107 {
108 if (!super.CanReleaseAttachment(attachment))
109 return false;
110 return !GetCompEM().IsWorking();
111 }
112
113 override bool CanRemoveFromCargo(EntityAI parent)
114 {
115 return CanBeTakenAsCargo();
116 }
117
118 override bool CanPutAsAttachment(EntityAI parent)
119 {
120 return !GetCompEM().IsWorking();
121 }
122
124 {
125 // Don't let players burn their pockets!
126 return !GetCompEM().IsWorking();
127 }
128
129 override bool IsIgnited()
130 {
131 return GetCompEM().IsWorking();
132 }
133
135 {
136 return GetCompEM().IsWorking();
137 }
138
139 override bool HasFlammableMaterial()
140 {
141 return true;
142 }
143
144 // Checkes if Torch can be ignited
146 {
147 if (!GetCompEM().CheckWetness())
148 return false;
149
150 ItemBase rag = GetRag();
151
152 if (rag && GetCompEM().GetEnergy() < GetCompEM().GetEnergyUsage() * GetCompEM().GetUpdateInterval())
153 {
154 if (IsRagDryEnough(rag))
155 return false;
156 }
157
158 if (!GetCompEM().CanWork())
159 return false;
160
161 if (GetCompEM().GetEnergy() < 3)
162 return false;
163
164 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
165 if (player)
166 {
167 if (this != player.GetItemInHands())//we are in player's inventory, but not in his hands
168 return false;
169 }
170
171 return true;
172 }
173
175 {
176 float wetness = rag.GetWet();
177 bool is_dry_enough = wetness <= 1 - GetCompEM().GetWetnessExposure();
178 return is_dry_enough;
179 }
180
182 {
183 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
184 {
186 SetSynchDirty();
187 }
188 }
189
191 {
192 if (!GetCompEM().HasEnoughStoredEnergy())
193 ConsumeRag();
194
195 GetCompEM().SwitchOn();
196 }
197
198 override void OnSwitchOn()
199 {
200 if (!GetCompEM().HasEnoughStoredEnergy())
201 GetCompEM().SwitchOff();
202
203 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
204 m_UTSource.SetActive(true);
205 }
206
207 override void OnSwitchOff()
208 {
209 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
210 m_UTSource.SetActive(false);
211 }
212
213 void SetTorchDecraftResult(string type)
214 {
215 m_DecraftResult = type; //not persistent for the moment
216 }
217
219 {
220 ItemBase rag = GetRag();
221
222 if (rag)
223 {
224 if (rag.GetQuantity() <= 1)
225 {
226 LockRags(false); // Unlock attachment slot before deletion. Otherwise it will get stuck locked and unusable.
227 }
228
229 rag.AddQuantity(-1);
230 rag.SetHealth(0);
231 //GetCompEM().AddEnergy( m_BurnTimePerRagEx );
232 return true;
233 }
234
235 return false;
236 }
237
239 {
240 if (lard)
241 {
242 float lard_quant = lard.GetQuantity();
243
245
248
250
252 float add_energy_coef = 1;
253
254 float energy_limit = GetCompEM().GetEnergyMax() - GetCompEM().GetEnergy();
255
257 {
261 }
262
263 GetCompEM().AddEnergy(add_energy);
264 lard.AddQuantity(-available_lard_quant);
265
267
269 }
270 }
271
273 {
274 if (!GetRag())
275 return;
276 RuinRags();
277 LockRags(true);
278 float torchCurrentEnergy = GetCompEM().GetEnergy();
279 float sourceQuantity = 100000;//for upgrade from environment(gas pump)
280
281 if (source)
282 sourceQuantity = source.GetQuantity();
283
285 //float maxUpgradeCapacity = GetRagQuantity() * m_BurnTimePerRagEx;
287 //float freeUpgradeCapacity = maxUpgradeCapacity - currentlyUpgraded;
293 GetCompEM().AddEnergy(upgradeQuantity);
294 m_ConsumeRagFlipFlop = 0;//consume fuel first
295 if (source)
296 source.AddQuantity(-upgradeQuantity);
299 }
300
301
303 {
304 if (vessel)
305 {
306 float vessel_quant = vessel.GetQuantity();
307
309
312
314
316 float add_energy_coef = 1;
317
318 float energy_limit = GetCompEM().GetEnergyMax() - GetCompEM().GetEnergy();
319
321 {
325 }
326
327 GetCompEM().AddEnergy(add_energy);
328 vessel.AddQuantity(-available_vessel_quant);
329
331
333 }
334 }
335
337 {
339 float add_energy_coef = 1;
340
341 float energy_limit = GetCompEM().GetEnergyMax() - GetCompEM().GetEnergy();
342
344 {
347 }
348
349 GetCompEM().AddEnergy(add_energy);
352 }
353
354 void RuinRags()
355 {
356 ItemBase rag = GetRag();
357
358 if (rag)
359 {
360 rag.SetHealth(1); //does not actually ruin rags, combining would be impossible
361 }
362 }
363
364 // Inventory manipulation
365 override void OnInventoryExit(Man player)
366 {
367 super.OnInventoryExit(player);
368
369 StandUp();
370 }
371
372 // Stands up the torch, if possible. Returns true on success.
373 bool StandUp()
374 {
375 string surface_type;
377 GetGame().SurfaceGetType(position[0], position[2], surface_type);
378 bool is_surface_soft = GetGame().IsSurfaceDigable(surface_type);
379
380 if (is_surface_soft && !IsRuined())
381 {
382 vector ori_rotate = "0 0 0";
383 ori_rotate[0] = Math.RandomFloat(0, 360);
384 ori_rotate[1] = Math.RandomFloat(0, 10);
385 SetOrientation(ori_rotate);
386
387 return true; // I am standing up
388 }
389
390 return false; // I am NOT standing up
391 }
392
394 {
395 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
396 SetQuantityNormalized(GetCompEM().GetEnergy0To1());
397 }
398
400 {
401 return m_CanReceiveUpgrade;
402 }
403
405 {
406 GetCompEM().SetEnergy(m_BurnTimePerRagEx * quantity);
407 m_CanReceiveUpgrade = true;
408 SetSynchDirty();
409 }
410
411
412 override void EEItemAttached(EntityAI item, string slot_name)
413 {
414 super.EEItemAttached(item, slot_name);
417 }
418
419
420 override void EEItemDetached(EntityAI item, string slot_name)
421 {
422 super.EEItemDetached(item, slot_name);
423
425 {
426 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
427 {
428 EntityAI rags = EntityAI.Cast(GetGame().CreateObjectEx(item.GetType(), GetPosition(), ECE_PLACE_ON_SURFACE));
429 if (rags)
430 MiscGameplayFunctions.TransferItemProperties(item, rags);
431 }
432 return;
433 }
434
437 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(TryTransformIntoStick, 100);
438 }
439
441 {
442 if ((GetGame().IsServer() || !GetGame().IsMultiplayer()) && !IsIgnited() && !GetRag() && !IsSetForDeletion())
443 return true;
444 else
445 return false;
446 }
447
449 {
450 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
451 if (m_IsBeingDestructed || (player && player.IsPlayerDisconnected()))
452 return;
453
455 {
456 m_IsBeingDestructed = true;
457 if (player)
458 {
459 // Transform object into wooden stick
461
463 player.ServerReplaceItemInHandsWithNew(lambda);
464 }
465 else
466 {
467 // Create wooden stick and delete Torch
468 vector pos = GetPosition();
470
471 if (GetType() == "WoodenStick")
472 ori = ori + Vector(0, 90, 0);
473
474 ItemBase stick = ItemBase.Cast(GetGame().CreateObjectEx(m_DecraftResult, pos, ECE_PLACE_ON_SURFACE));
476 stick.SetPosition(pos);
477 stick.PlaceOnSurface();
478
479 if (stick.GetType() == "LongWoodenStick")
480 {
481 pos = stick.GetPosition() + Vector(0, -0.3, 0);
482 stick.SetPosition(pos);
483 }
484
485 stick.SetOrientation(ori);
486 GetGame().ObjectDelete(this);
487 }
488 }
489 }
490
491
492 override void OnWorkStart()
493 {
494 m_WasLit = true;
495 LockRags(true);
497 }
498
500 {
501 if (m_FireParticle)
503 }
504
506 {
507 return Rag.Cast(GetAttachmentByType(Rag));
508 }
509
510 void LockRags(bool do_lock)
511 {
512 ItemBase rag = GetRag();
513 if (rag)
514 {
515 if (do_lock)
516 rag.LockToParent();
517 else if (!m_RagsUpgradedCount)
518 rag.UnlockFromParent();
519 }
520 }
521
523 {
524 if (!m_Light)
525 {
526 m_Light = TorchLight.Cast(ScriptedLightBase.CreateLight(TorchLight, Vector(0, 0, 0), 1));
527 m_Light.AttachOnObject(this, m_ParticleLocalPos + Vector(0, 0.2, 0));
528 }
529
530 if (m_FireParticle)
531 {
533
534 if (direct_particle && direct_particle != m_Light.GetAttachmentParent())
535 m_Light.AttachOnObject(direct_particle, Vector(0, 0.2, 0));
536 }
537
538 float update_interval = GetCompEM().GetUpdateInterval();
539
541 {
544
547
550
551 m_Light.FadeBrightnessTo(m_Light.m_TorchBrightness * brightness_coef, update_interval);
552 m_Light.FadeRadiusTo(m_Light.m_TorchRadius * radius_coef, update_interval);
553 }
554 else
555 {
556 m_Light.FadeBrightnessTo(m_Light.m_TorchBrightness, update_interval);
557 m_Light.FadeRadiusTo(m_Light.m_TorchRadius, update_interval);
558 }
559 }
560
562 {
563 GetCompEM().SwitchOff();
564 }
565
566
567 override void OnWork(float consumed_energy)
568 {
570 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
571 {
572 if (GetCompEM().GetEnergy() < ((GetRagQuantity() + m_RagsUpgradedCount) - 1) * m_BurnTimePerRagEx)
573 {
574 if (m_RagsUpgradedCount == 0) //always burn rag
575 ConsumeRag();
576 else if (m_ConsumeRagFlipFlop)//burn rag
577 {
578 ConsumeRag();
580 }
581 else//burn lard/fuel
582 {
585 }
586 }
587 if (GetRag() && GetCompEM().GetEnergy() == 0 && GetRagQuantity() > 0)
588 GetRag().SetQuantity(0);
589 RuinRags();
590
592
594
595 AddWet(-m_WaterEvaporationByFireIntensityEx * GetCompEM().GetUpdateInterval());
596
597 Rag rag = GetRag();
598
599 if (rag)
600 rag.AddWet(-m_WaterEvaporationByFireIntensityEx * GetCompEM().GetUpdateInterval());
601 }
602
603 if (!m_LoopSoundEntity && GetGame() && (!GetGame().IsDedicatedServer()))
604 m_LoopSoundEntity = PlaySoundLoop(GetSoundName(), 50);
605
606 // Effect scaling by fuel
607 if (!GetGame().IsDedicatedServer())
608 {
609 UpdateLight();
611 }
612 }
613
614
616 {
617 return "torchLoop";
618 }
619
621 {
622 if (GetQuantity() < 40)
623 {
624 if (!m_FireParticle)
625 m_FireParticle = ParticleManager.GetInstance().PlayOnObject(ParticleList.TORCH_T1, this, m_ParticleLocalPos);
626
627 float scale = GetQuantity() / 40;
628
629 if (scale > 1)
630 scale = 1;
631
632 if (scale < 0.25)
633 scale = 0.25;
634
638 }
639 else
640 {
642 {
643 // Executes once when fire particle starts or changes
644
645 if (m_FireParticle)
647
648 m_FireParticle = ParticleManager.GetInstance().PlayOnObject(ParticleList.TORCH_T2, this, m_ParticleLocalPos);
649 }
650 }
651
652 }
653
654 override void OnWorkStop()
655 {
657 if (m_Light)
658 m_Light.FadeOut();
659
660 if (m_LoopSoundEntity && GetGame() && (!GetGame().IsDedicatedServer()))
661 {
662 GetGame().ObjectDelete(m_LoopSoundEntity);
664 }
665
666 if (m_FireParticle)
667 {
670 }
671
674
675 LockRags(false);
676
677 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
678 {
679 if (GetRag() && GetCompEM().GetEnergy() == 0 && GetRagQuantity() > 0)
680 GetRag().SetQuantity(0);
681 }
682
684 }
685
686 // COMBAT
687 // This needs refactor!
688 override int GetMeleeMode()
689 {
690 if (GetCompEM().IsWorking())
691 return 3; // ???
692 else
693 return 0; // ???
694 }
695
696 override int GetMeleeHeavyMode()
697 {
698 if (GetCompEM().IsWorking())
699 return 4; // ???
700 else
701 return 1; // ???
702 }
703
704 override int GetMeleeSprintMode()
705 {
706 if (GetCompEM().IsWorking())
707 return 5; // ???
708 else
709 return 2; // ???
710 }
711
712 override void SetActions()
713 {
714 super.SetActions();
715
717 }
718
720 {
721 super.OnAttachmentQuantityChangedEx(item, delta);
722 if (delta > 0)
723 {
724 GetCompEM().AddEnergy(m_BurnTimePerRagEx * delta);
727 }
728 }
729
730
732 {
733 return true;
734 }
735
736 override void OnDebugSpawn()
737 {
738 GetInventory().CreateAttachment("Rag");
741 }
742
744 {
745 if (GetRag())
746 return Math.Round(GetRag().GetQuantity());
747 return 0;
748 }
749
751 {
752 return "";
753 }
754
756 {
757 return "";
758 }
759
761 {
762 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
763 {
764 if (GetCompEM().IsWorking())
765 {
766 if (GetBurningMaterial())
767 SetObjectMaterial(0, GetBurningMaterial());
768 }
769 else if (m_WasLit)
770 {
771 if (GetBurntMaterial())
772 SetObjectMaterial(0, GetBurntMaterial());
773 }
774 }
775 }
776
777
779 {
780 super.OnStoreSave(ctx);
781 ctx.Write(m_WasLit);
782 }
783
784
785 override bool OnStoreLoad(ParamsReadContext ctx, int version)
786 {
787 if (!super.OnStoreLoad(ctx, version))
788 return false;
789 if (version >= 130)
790 {
791 if (!ctx.Read(m_WasLit))
792 return false;
793 }
795 return true;
796 }
797
799 {
800 result.SetQuantity(1);
801 }
802
803 //-------------
804 // DEBUG BELLOW
805 //-------------
806#ifdef DEVELOPER
808 {
809 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.ACTIVATE_ENTITY, "Ignite", FadeColors.LIGHT_GREY));
810 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SEPARATOR, "___________________________", FadeColors.LIGHT_GREY));
811
812 super.GetDebugActions(outputList);
813 }
814
815 override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
816 {
817 if (super.OnAction(action_id, player, ctx))
818 return true;
819 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
820 {
821 if (action_id == EActions.ACTIVATE_ENTITY)
823
824 }
825 return false;
826 }
827
828 override string GetDebugText()
829 {
830 string debug_output;
831
832 debug_output = super.GetDebugText();
833
834 if (GetGame().IsDedicatedServer())
835 {
836 debug_output += "m_RagsUpgradedCount:" + m_RagsUpgradedCount + "\n";
837 debug_output += "m_ConsumeRagFlipFlop:" + m_ConsumeRagFlipFlop + "\n";
839 debug_output += "Burning rag \n";
840 else if (IsIgnited())
841 debug_output += "Burning lard/fuel \n";
842 }
843 else
844 {
845
846 }
847 return debug_output;
848 }
849#endif
850}
851
852
853class Torch : FlammableBase
854{
855 //legacy vars which cannot be moved/removed
856 static float m_BurnTimePerRag;
863
864
865 override void Init()
866 {
867 super.Init();
868
869 //for legacy reasons
870 m_BurnTimePerRag = m_BurnTimePerRagEx;
871 m_BurnTimePerFullLard = m_BurnTimePerFullLardEx;
872 m_BurnTimePerFullFuelDose = m_BurnTimePerFullFuelDoseEx;
873 m_MaxConsumableLardQuantity = m_MaxConsumableLardQuantityEx;
874 m_MaxConsumableFuelQuantity = m_MaxConsumableFuelQuantityEx;
875 }
876
877 override void SetActions()
878 {
879 super.SetActions();
880
883 }
884
885 // !Called on CHILD when it's attached to parent.
886 override void OnWasAttached(EntityAI parent, int slot_id)
887 {
888 super.OnWasAttached(parent, slot_id);
889 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
890 LockRags(true);
891 }
892
893 // !Called on CHILD when it's detached from parent.
894 override void OnWasDetached(EntityAI parent, int slot_id)
895 {
896 super.OnWasDetached(parent, slot_id);
897 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
898 LockRags(false);
899 }
900
901
903 {
904 super.OnStoreSave(ctx);
905 ctx.Write(m_ConsumeRagFlipFlop);
906 ctx.Write(m_RagsUpgradedCount);
907 }
908
909
910 override bool OnStoreLoad(ParamsReadContext ctx, int version)
911 {
912 if (!super.OnStoreLoad(ctx, version))
913 return false;
914
915 if (version >= 129)
916 {
917 if (!ctx.Read(m_ConsumeRagFlipFlop))
918 return false;
919
920 if (!ctx.Read(m_RagsUpgradedCount))
921 return false;
922 }
923 UpdateCheckForReceivingUpgrade();
924 return true;
925 }
926};
927
929{
931 {
932 super.CopyOldPropertiesToNew(old_item, new_item);
933
937 if (stick && flammable)
938 flammable.ApplyResultModifications(stick);
939 }
940};
Param4< int, int, string, int > TSelectableActionInfoWithColor
Definition EntityAI.c:97
eBleedingSourceType GetType()
ActionLightItemOnFireCB ActionContinuousBaseCB ActionLightItemOnFire()
void AddAction(typename actionName)
void SetActions()
vector GetOrientation()
const int ECE_PLACE_ON_SURFACE
override Widget Init()
Definition DayZGame.c:120
EActions
Definition EActions.c:2
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
Definition ItemBase.c:6834
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
Definition ItemBase.c:7918
override float GetQuantity()
Definition ItemBase.c:7995
float GetEnergy()
Definition ItemBase.c:8140
override void AddWet(float value)
Definition ItemBase.c:8271
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
Definition ItemBase.c:6792
override void OnWasAttached(EntityAI parent, int slot_id)
Definition ItemBase.c:5983
void OnStoreSave(ParamsWriteContext ctx)
string GetDebugText()
bool OnStoreLoad(ParamsReadContext ctx, int version)
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
override void OnWasDetached(EntityAI parent, int slot_id)
static float m_BurnTimePerFullLard
Definition Torch.c:857
static int m_StartFadeOutOfLightAtQuantity
Definition Torch.c:862
static float m_MaxConsumableFuelQuantity
Definition Torch.c:860
static float m_BurnTimePerFullFuelDose
Definition Torch.c:858
static float m_WaterEvaporationByFireIntensity
Definition Torch.c:861
FlammableBase m_BurnTimePerRag
static float m_MaxConsumableLardQuantity
Definition Torch.c:859
class JsonUndergroundAreaTriggerData GetPosition
Super root of all classes in Enforce script.
Definition EnScript.c:11
void ConsumeFuelFromGasStation()
Definition Torch.c:336
override void OnDebugSpawn()
Definition Torch.c:736
int m_RagsUpgradedCount
Definition Torch.c:21
override bool CanPutInCargo(EntityAI parent)
Definition Torch.c:100
void UpdateLight()
Definition Torch.c:522
void RuinRags()
Definition Torch.c:354
void ApplyResultModifications(ItemBase result)
Definition Torch.c:798
bool IsRagDryEnough(ItemBase rag)
Definition Torch.c:174
override void OnInventoryExit(Man player)
Definition Torch.c:365
Rag GetRag()
Definition Torch.c:505
bool m_WasLit
Definition Torch.c:27
override int GetMeleeMode()
Definition Torch.c:688
void FlammableBase()
Definition Torch.c:3
bool CanBeTakenAsCargo()
Definition Torch.c:123
float m_MaxConsumableFuelQuantityEx
Definition Torch.c:17
void UpdateCheckForReceivingUpgrade()
Definition Torch.c:181
float m_BurnTimePerFullLardEx
Definition Torch.c:14
void ConsumeLard(Lard lard)
Definition Torch.c:238
vector m_ParticleLocalPos
Definition Torch.c:23
override bool IsIgnited()
Definition Torch.c:129
override bool CanReleaseAttachment(EntityAI attachment)
Definition Torch.c:106
bool CanTransformIntoStick()
Definition Torch.c:440
ref UniversalTemperatureSource m_UTSource
Definition Torch.c:29
bool m_IsBeingDestructed
Definition Torch.c:11
override bool OnStoreLoad(ParamsReadContext ctx, int version)
Definition Torch.c:785
SoundOnVehicle m_LoopSoundEntity
Definition Torch.c:8
override void OnIgnitedThis(EntityAI fire_source)
Definition Torch.c:190
override void EEInit()
Definition Torch.c:53
override void SetActions()
Definition Torch.c:712
void CraftingInit(float quantity)
Definition Torch.c:404
override void OnWork(float consumed_energy)
Definition Torch.c:567
override void OnStoreSave(ParamsWriteContext ctx)
Definition Torch.c:778
int GetRagQuantity()
Definition Torch.c:743
override void OnWorkStop()
Definition Torch.c:654
void TryTransformIntoStick()
Definition Torch.c:448
bool m_ConsumeRagFlipFlop
Definition Torch.c:22
override void DeferredInit()
Definition Torch.c:33
override void EEDelete(EntityAI parent)
Definition Torch.c:82
void Upgrade(ItemBase source)
Definition Torch.c:272
override void EEItemDetached(EntityAI item, string slot_name)
Definition Torch.c:420
void LockRags(bool do_lock)
Definition Torch.c:510
override bool CanRemoveFromCargo(EntityAI parent)
Definition Torch.c:113
override void OnSwitchOff()
Definition Torch.c:207
string GetBurningMaterial()
Definition Torch.c:750
float m_BurnTimePerFullFuelDoseEx
Definition Torch.c:15
bool StandUp()
Definition Torch.c:373
override bool CanBeIgnitedBy(EntityAI igniter=NULL)
Definition Torch.c:145
float m_WaterEvaporationByFireIntensityEx
Definition Torch.c:18
ref UniversalTemperatureSourceLambdaConstant m_UTSLConstant
Definition Torch.c:31
void SetTorchDecraftResult(string type)
Definition Torch.c:213
override void OnSwitchOn()
Definition Torch.c:198
TorchLight m_Light
Definition Torch.c:26
Particle m_FireParticle
Definition Torch.c:9
override void OnWorkStart()
Definition Torch.c:492
void UpdateMaterial()
Definition Torch.c:760
void CalculateQuantity()
Definition Torch.c:393
void StopAllParticles()
Definition Torch.c:499
override void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Definition Torch.c:719
ref UniversalTemperatureSourceSettings m_UTSSettings
Definition Torch.c:30
override bool DisassembleOnLastDetach()
Definition Torch.c:731
float m_MaxConsumableLardQuantityEx
Definition Torch.c:16
float m_BurnTimePerRagEx
Definition Torch.c:13
bool m_CanReceiveUpgrade
Definition Torch.c:10
override vector GetUniversalTemperatureSourcePosition()
Definition Torch.c:74
int m_StartFadeOutOfLightAtQuantityEx
Definition Torch.c:19
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Definition Torch.c:91
bool CanReceiveUpgrade()
Definition Torch.c:399
string m_DecraftResult
Definition Torch.c:25
override int GetMeleeSprintMode()
Definition Torch.c:704
override bool CanIgniteItem(EntityAI ignite_target=NULL)
Definition Torch.c:134
override int GetMeleeHeavyMode()
Definition Torch.c:696
void UpdateParticle()
Definition Torch.c:620
override bool CanPutAsAttachment(EntityAI parent)
Definition Torch.c:118
override void EEItemAttached(EntityAI item, string slot_name)
Definition Torch.c:412
void ConsumeFuelFromBottle(ItemBase vessel)
Definition Torch.c:302
bool ConsumeRag()
Definition Torch.c:218
override bool HasFlammableMaterial()
Definition Torch.c:139
void Init()
Definition Torch.c:39
override void OnItemInHandsPlayerSwimStart(PlayerBase player)
Definition Torch.c:561
string GetBurntMaterial()
Definition Torch.c:755
string GetSoundName()
Definition Torch.c:615
Definition EnMath.c:7
Legacy way of using particles in the game.
Definition Particle.c:7
void ScaleParticleParamFromOriginal(int parameter_id, float coef)
Scales the given parameter on all emitors relatively to their ORIGINAL value.
Definition Particle.c:646
int GetParticleID()
Gets particle id.
Definition Particle.c:292
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
Definition Particle.c:262
Object GetDirectParticleEffect()
Returns direct particle effect entity which is usually handled by this class 'Particle' if there is o...
Definition Particle.c:302
static const int TORCH_T2
static const int TORCH_T1
base class for transformation operations (creating one item from another)
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
override void CopyOldPropertiesToNew(notnull EntityAI old_item, EntityAI new_item)
Definition Torch.c:930
original Timer deletes m_params which is unwanted
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Min(float x, float y)
Returns smaller of two given values.
static proto float Round(float f)
Returns mathematical round of value.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
static proto float Ceil(float f)
Returns ceil of value.
EmitorParam
Definition EnVisual.c:114
const int SAT_DEBUG_ACTION
Definition constants.c:424
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8