DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
PortableGasLamp.c
См. документацию.
1class PortableGasLamp extends ItemBase
2{
3 PortableGasLampLight m_Light;
4
5 private const string GAS_LIGHT_MATERIAL_ON = "dz\\gear\\cooking\\data\\GasLightOn.rvmat";
6 private const string GAS_LIGHT_MATERIAL_OFF = "dz\\data\\data\\default.rvmat";
7
8 //sound
9 const string SOUND_BURNING = "portablegaslamp_burn_SoundSet";
10 const string SOUND_TURN_ON = "portablegaslamp_turn_on_SoundSet";
11 const string SOUND_TURN_OFF = "portablegaslamp_turn_off_SoundSet";
12
16
17 //--- POWER EVENTS
18 override void OnSwitchOn()
19 {
20 super.OnSwitchOn();
21
22 //sound (client only)
24 }
25
26 override void OnSwitchOff()
27 {
28 super.OnSwitchOff();
29
30 //sound (client only)
32 }
33
34 override void OnWorkStart()
35 {
36 if ( !GetGame().IsServer() || !GetGame().IsMultiplayer() ) // client side
37 {
38 m_Light = PortableGasLampLight.Cast( ScriptedLightBase.CreateLight( PortableGasLampLight, "0 0 0") );
39 m_Light.AttachOnMemoryPoint(this, "light");
40 }
41
42 //refresh visual
43 SetObjectMaterial( 0, GAS_LIGHT_MATERIAL_ON );
44
45 //sound (client only)
47 }
48
49 override void OnWorkStop()
50 {
51 if (m_Light)
52 m_Light.FadeOut();
53
54 //refresh visual
55 SetObjectMaterial( 0, GAS_LIGHT_MATERIAL_OFF );
56
57 //sound (client only)
59 }
60
61 //================================================================
62 // SOUNDS
63 //================================================================
64 protected void SoundBurningStart()
65 {
66 PlaySoundSetLoop( m_SoundBurningLoop, SOUND_BURNING, 0.1, 0.3 );
67 }
68
69 protected void SoundBurningStop()
70 {
71 StopSoundSet( m_SoundBurningLoop );
72 }
73
74 protected void SoundTurnOn()
75 {
76 PlaySoundSet( m_SoundTurnOn, SOUND_TURN_ON, 0.1, 0.1 );
77 }
78
79 protected void SoundTurnOff()
80 {
81 PlaySoundSet( m_SoundTurnOff, SOUND_TURN_OFF, 0.1, 0.1 );
82 }
83
93}
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
Wrapper class for managing sound through SEffectManager.
Определения EffectSound.c:5
override void OnSwitchOn()
Определения PortableGasLamp.c:18
EffectSound m_SoundTurnOn
Определения PortableGasLamp.c:14
EffectSound m_SoundTurnOff
Определения PortableGasLamp.c:15
override void OnWorkStart()
Определения PortableGasLamp.c:34
void SoundTurnOn()
Определения PortableGasLamp.c:74
override void SetActions()
Определения PortableGasLamp.c:84
void SoundBurningStart()
Определения Blowtorch.c:51
BlowtorchLight m_Light
Определения Blowtorch.c:7
const string SOUND_BURNING
Определения Blowtorch.c:5
const string GAS_LIGHT_MATERIAL_ON
Определения PortableGasLamp.c:5
void SoundTurnOff()
Определения PortableGasLamp.c:79
EffectSound m_SoundBurningLoop
Определения Blowtorch.c:9
override void OnWorkStop()
Определения PortableGasLamp.c:49
const string SOUND_TURN_OFF
Определения PortableGasLamp.c:11
const string SOUND_TURN_ON
Определения PortableGasLamp.c:10
override void OnSwitchOff()
Определения PortableGasLamp.c:26
const string GAS_LIGHT_MATERIAL_OFF
Определения PortableGasLamp.c:6
void SoundBurningStop()
Определения Blowtorch.c:56
Определения InventoryItem.c:731
proto native CGame GetGame()