DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Blowtorch.c
См. документацию.
1class Blowtorch extends ItemBase
2{
3 const string TEXTURE_FLAME = "dz\\gear\\cooking\\data\\flame_butane_ca.paa";
4 const string ANIM_PHASE_FLAME = "FlameHide";
5 const string SOUND_BURNING = "Blowtorch_Loop_SoundSet";
6
8
10
11 override void OnWorkStart()
12 {
13 super.OnWorkStart();
14
15 #ifndef SERVER
16 m_Light = BlowtorchLight.Cast(ScriptedLightBase.CreateLight(BlowtorchLight, "0 0 0"));
17 m_Light.AttachOnMemoryPoint(this, "light");
18 #endif
19
22 }
23
24 override void OnWorkStop()
25 {
26 #ifndef SERVER
27 if (m_Light)
28 {
29 m_Light.FadeOut();
30 }
31 #endif
32
33 RefreshFlameVisual(false);
35 }
36
37 protected void RefreshFlameVisual(bool working = false)
38 {
39 if (working)
40 {
41 SetObjectTexture(0, TEXTURE_FLAME);
42 SetAnimationPhase(ANIM_PHASE_FLAME, 0.0);
43 }
44 else
45 {
46 SetObjectTexture(0, "");
47 SetAnimationPhase(ANIM_PHASE_FLAME, 1.0);
48 }
49 }
50
51 protected void SoundBurningStart()
52 {
53 PlaySoundSetLoop(m_SoundBurningLoop, SOUND_BURNING, 0.1, 0.0);
54 }
55
56 protected void SoundBurningStop()
57 {
58 StopSoundSet(m_SoundBurningLoop);
59 }
60
61 override bool CanPutInCargo(EntityAI parent)
62 {
63 if (!super.CanPutInCargo(parent))
64 {
65 return false;
66 }
67
68 return !GetCompEM().IsSwitchedOn();
69 }
70
71 override bool CanRemoveFromCargo(EntityAI parent)
72 {
73 return true;
74 }
75
76 override bool IsIgnited()
77 {
78 return GetCompEM().IsWorking();
79 }
80
81 override void OnIgnitedTarget(EntityAI target_item)
82 {
83 if (GetGame().IsServer())
84 {
85 if (GetGasCanister())
86 {
87 ComponentEnergyManager canisterEM = GetGasCanister().GetCompEM();
88 if (canisterEM)
89 canisterEM.AddEnergy(-1 * (GetCompEM().GetEnergyUsage() * UATimeSpent.FIREPLACE_IGNITE));
90 }
91 }
92 }
93
94 override bool CanIgniteItem(EntityAI ignite_target = NULL)
95 {
96 return ignite_target.CanBeIgnitedBy(this);
97 }
98
110
112 {
113 if (GetInventory().AttachmentCount() != 0)
114 {
115 return GetInventory().GetAttachmentFromIndex(0);
116 }
117
118 return null;
119 }
120
121 bool HasEnoughEnergyForRepair(float pTime)
122 {
123 if (GetGasCanister())
124 {
125 ComponentEnergyManager canisterEM = GetGasCanister().GetCompEM();
126 if (canisterEM)
127 {
128 return canisterEM.GetEnergy() > GetCompEM().GetEnergyUsage() * pTime;
129 }
130 }
131
132 return false;
133 }
134
135 override void OnDebugSpawn()
136 {
137 GetInventory().CreateInInventory("LargeGasCanister");
138 }
139}
ActionLightItemOnFireWithBlowtorchCB ActionLightItemOnFireCB ActionLightItemOnFireWithBlowtorch()
ActionRepairBoatEngineCB ActionRepairVehiclePartCB ActionRepairBoatEngine()
Определения ActionRepairBoatEngine.c:11
ActionRepairCarChassisWithBlowtorchCB ActionRepairCarChassisCB ActionRepairCarChassisWithBlowtorch()
ActionRepairCarEngineWithBlowtorchCB ActionRepairCarEngineCB ActionRepairCarEngineWithBlowtorch()
ActionRepairCarPartWithBlowtorchCB ActionRepairCarPartCB ActionRepairCarPartWithBlowtorch()
ActionRepairItemWithBlowtorchCB ActionContinuousBaseCB ActionRepairItemWithBlowtorch()
Определения ActionRepairItemWithBlowtorch.c:11
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
Определения BlowtorchLight.c:2
float AddEnergy(float added_energy)
Energy manager: Adds energy to this device and clamps it within its min/max storage limits....
Определения ComponentEnergyManager.c:1220
float GetEnergy()
Energy manager: Returns the amount of stored energy this device has.
Определения ComponentEnergyManager.c:1214
Wrapper class for managing sound through SEffectManager.
Определения EffectSound.c:5
Определения Building.c:6
override void OnWorkStart()
Определения Blowtorch.c:11
EntityAI GetGasCanister()
Определения Blowtorch.c:111
override void SetActions()
Определения Blowtorch.c:99
void RefreshFlameVisual(bool working=false)
Определения Blowtorch.c:37
void SoundBurningStart()
Определения Blowtorch.c:51
BlowtorchLight m_Light
Определения Blowtorch.c:7
const string SOUND_BURNING
Определения Blowtorch.c:5
EffectSound m_SoundBurningLoop
Определения Blowtorch.c:9
override bool IsIgnited()
Определения Blowtorch.c:76
override void OnWorkStop()
Определения Blowtorch.c:24
override void OnIgnitedTarget(EntityAI target_item)
Определения Blowtorch.c:81
const string ANIM_PHASE_FLAME
Определения Blowtorch.c:4
override bool CanRemoveFromCargo(EntityAI parent)
Определения Blowtorch.c:71
bool HasEnoughEnergyForRepair(float pTime)
Определения Blowtorch.c:121
override bool CanPutInCargo(EntityAI parent)
Определения Blowtorch.c:61
override void OnDebugSpawn()
Определения Blowtorch.c:135
void SoundBurningStop()
Определения Blowtorch.c:56
const string TEXTURE_FLAME
Определения Blowtorch.c:3
override bool CanIgniteItem(EntityAI ignite_target=NULL)
Определения Blowtorch.c:94
Определения InventoryItem.c:731
const float FIREPLACE_IGNITE
Определения ActionConstants.c:96
Определения ActionConstants.c:28
proto native CGame GetGame()