DayZ 1.30
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 #ifndef NO_GUI
17 m_Light = BlowtorchLight.Cast(ScriptedLightBase.CreateLight(BlowtorchLight, "0 0 0"));
18 m_Light.AttachOnMemoryPoint(this, "light");
19 #endif
20 #endif
21
24 }
25
26 override void OnWorkStop()
27 {
28 #ifndef SERVER
29 #ifndef NO_GUI
30 if (m_Light)
31 {
32 m_Light.FadeOut();
33 }
34 #endif
35 #endif
36
37 RefreshFlameVisual(false);
39 }
40
41 protected void RefreshFlameVisual(bool working = false)
42 {
43 if (working)
44 {
45 SetObjectTexture(0, TEXTURE_FLAME);
46 SetAnimationPhase(ANIM_PHASE_FLAME, 0.0);
47 }
48 else
49 {
50 SetObjectTexture(0, "");
51 SetAnimationPhase(ANIM_PHASE_FLAME, 1.0);
52 }
53 }
54
55 protected void SoundBurningStart()
56 {
57 PlaySoundSetLoop(m_SoundBurningLoop, SOUND_BURNING, 0.1, 0.0);
58 }
59
60 protected void SoundBurningStop()
61 {
62 StopSoundSet(m_SoundBurningLoop);
63 }
64
65 override bool CanPutInCargo(EntityAI parent)
66 {
67 if (!super.CanPutInCargo(parent))
68 {
69 return false;
70 }
71
72 return !GetCompEM().IsSwitchedOn();
73 }
74
75 override bool CanRemoveFromCargo(EntityAI parent)
76 {
77 return true;
78 }
79
80 override bool IsIgnited()
81 {
82 return GetCompEM().IsWorking();
83 }
84
85 override void OnIgnitedTarget(EntityAI target_item)
86 {
87 if (g_Game.IsServer())
88 {
89 if (GetGasCanister())
90 {
91 ComponentEnergyManager canisterEM = GetGasCanister().GetCompEM();
92 if (canisterEM)
93 canisterEM.AddEnergy(-1 * (GetCompEM().GetEnergyUsage() * UATimeSpent.FIREPLACE_IGNITE));
94 }
95 }
96 }
97
98 override bool CanIgniteItem(EntityAI ignite_target = NULL)
99 {
100 return ignite_target.CanBeIgnitedBy(this);
101 }
102
117
119 {
120 if (GetInventory().AttachmentCount() != 0)
121 {
122 return GetInventory().GetAttachmentFromIndex(0);
123 }
124
125 return null;
126 }
127
128 bool HasEnoughEnergyForRepair(float pTime)
129 {
130 if (GetGasCanister())
131 {
132 ComponentEnergyManager canisterEM = GetGasCanister().GetCompEM();
133 if (canisterEM)
134 {
135 return canisterEM.GetEnergy() > GetCompEM().GetEnergyUsage() * pTime;
136 }
137 }
138
139 return false;
140 }
141
142 override void OnDebugSpawn()
143 {
144 GetInventory().CreateInInventory("LargeGasCanister");
145 }
146}
ActionLightItemOnFireWithBlowtorchCB ActionLightItemOnFireCB ActionLightItemOnFireWithBlowtorch()
ActionRepairBoatEngineCB ActionRepairVehiclePartCB ActionRepairBoatEngine()
Определения ActionRepairBoatEngine.c:11
ActionRepairCarChassisWithBlowtorchCB ActionRepairCarChassisCB ActionRepairCarChassisWithBlowtorch()
ActionRepairCarEngineWithBlowtorchCB ActionRepairCarEngineCB ActionRepairCarEngineWithBlowtorch()
ActionRepairCarPartWithBlowtorchCB ActionRepairCarPartCB ActionRepairCarPartWithBlowtorch()
ActionRepairItemWithBlowtorchCB ActionContinuousBaseCB ActionRepairItemWithBlowtorch()
Определения ActionRepairItemWithBlowtorch.c:11
ActionRepairMotorbikeChassisWithBlowtorchCB ActionRepairCarChassisCB ActionRepairMotorbikeChassisWithBlowtorch()
ActionRepairMotorbikeEngineWithBlowtorchCB ActionRepairCarEngineCB ActionRepairMotorbikeEngineWithBlowtorch()
ActionRepairMotorbikePartWithBlowTorchCB ActionRepairMotorbikePartCB ActionRepairMotorbikePartWithBlowTorch()
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
DayZGame g_Game
Определения DayZGame.c:4074
Определения 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:1252
float GetEnergy()
Energy manager: Returns the amount of stored energy this device has.
Определения ComponentEnergyManager.c:1246
Wrapper class for managing sound through SEffectManager.
Определения EffectSound.c:5
override void OnWorkStart()
Определения Blowtorch.c:11
EntityAI GetGasCanister()
Определения Blowtorch.c:118
override void SetActions()
Определения Blowtorch.c:103
void RefreshFlameVisual(bool working=false)
Определения Blowtorch.c:41
void SoundBurningStart()
Определения Blowtorch.c:55
BlowtorchLight m_Light
Определения Blowtorch.c:7
const string SOUND_BURNING
Определения Blowtorch.c:5
EffectSound m_SoundBurningLoop
Определения Blowtorch.c:9
override bool IsIgnited()
Определения Blowtorch.c:80
override void OnWorkStop()
Определения Blowtorch.c:26
override void OnIgnitedTarget(EntityAI target_item)
Определения Blowtorch.c:85
const string ANIM_PHASE_FLAME
Определения Blowtorch.c:4
override bool CanRemoveFromCargo(EntityAI parent)
Определения Blowtorch.c:75
bool HasEnoughEnergyForRepair(float pTime)
Определения Blowtorch.c:128
override bool CanPutInCargo(EntityAI parent)
Определения Blowtorch.c:65
override void OnDebugSpawn()
Определения Blowtorch.c:142
void SoundBurningStop()
Определения Blowtorch.c:60
const string TEXTURE_FLAME
Определения Blowtorch.c:3
override bool CanIgniteItem(EntityAI ignite_target=NULL)
Определения Blowtorch.c:98
const float FIREPLACE_IGNITE
Определения ActionConstants.c:97
Определения ActionConstants.c:28