Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
portablegaslamp.c
Go to the documentation of this file.
1
class
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
13
protected
EffectSound
m_SoundBurningLoop
;
14
protected
EffectSound
m_SoundTurnOn
;
15
protected
EffectSound
m_SoundTurnOff
;
16
17
//--- POWER EVENTS
18
override
void
OnSwitchOn
()
19
{
20
super.OnSwitchOn();
21
22
//sound (client only)
23
SoundTurnOn
();
24
}
25
26
override
void
OnSwitchOff
()
27
{
28
super.OnSwitchOff();
29
30
//sound (client only)
31
SoundTurnOff
();
32
}
33
34
override
void
OnWorkStart
()
35
{
36
if
( !
g_Game
.IsServer() || !
g_Game
.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)
46
SoundBurningStart
();
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)
58
SoundBurningStop
();
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
84
override
void
SetActions
()
85
{
86
super.SetActions();
87
88
AddAction
(
ActionTurnOnWhileInHands
);
89
AddAction
(
ActionTurnOffWhileInHands
);
90
AddAction
(
ActionTurnOnWhileOnGround
);
91
AddAction
(
ActionTurnOffWhileOnGround
);
92
}
93
}
AddAction
void AddAction(typename actionName)
Definition
advancedcommunication.c:220
ActionTurnOffWhileInHands
Definition
actionturnoffwhileinhands.c:2
ActionTurnOffWhileOnGround
Definition
actionturnoffwhileonground.c:2
ActionTurnOnWhileInHands
Definition
actionturnonwhileinhands.c:2
ActionTurnOnWhileOnGround
Definition
actionturnonwhileonground.c:2
EffectSound
Wrapper class for managing sound through SEffectManager.
Definition
effectsound.c:5
ItemBase
Definition
inventoryitem.c:742
ItemBase::SoundTurnOn
void SoundTurnOn()
Definition
portablegaslamp.c:74
ItemBase::OnSwitchOn
override void OnSwitchOn()
Definition
portablegaslamp.c:18
ItemBase::OnSwitchOff
override void OnSwitchOff()
Definition
portablegaslamp.c:26
ItemBase::m_Light
BlowtorchLight m_Light
Definition
blowtorch.c:7
ItemBase::OnWorkStop
override void OnWorkStop()
Definition
portablegaslamp.c:49
ItemBase::m_SoundTurnOff
EffectSound m_SoundTurnOff
Definition
portablegaslamp.c:15
ItemBase::m_SoundBurningLoop
EffectSound m_SoundBurningLoop
Definition
blowtorch.c:9
ItemBase::GAS_LIGHT_MATERIAL_ON
const string GAS_LIGHT_MATERIAL_ON
Definition
portablegaslamp.c:5
ItemBase::m_SoundTurnOn
EffectSound m_SoundTurnOn
Definition
portablegaslamp.c:14
ItemBase::OnWorkStart
override void OnWorkStart()
Definition
portablegaslamp.c:34
ItemBase::SoundTurnOff
void SoundTurnOff()
Definition
portablegaslamp.c:79
ItemBase::SOUND_TURN_OFF
const string SOUND_TURN_OFF
Definition
portablegaslamp.c:11
ItemBase::SoundBurningStop
void SoundBurningStop()
Definition
blowtorch.c:56
ItemBase::GAS_LIGHT_MATERIAL_OFF
const string GAS_LIGHT_MATERIAL_OFF
Definition
portablegaslamp.c:6
ItemBase::SoundBurningStart
void SoundBurningStart()
Definition
blowtorch.c:51
ItemBase::SOUND_TURN_ON
const string SOUND_TURN_ON
Definition
portablegaslamp.c:10
ItemBase::SOUND_BURNING
const string SOUND_BURNING
Definition
blowtorch.c:5
ItemBase::SetActions
override void SetActions()
Definition
portablegaslamp.c:84
ScriptedLightBase
Definition
pointlightbase.c:2
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
Games
Dayz
scripts
4_world
entities
itembase
portablegaslamp.c
Generated by
1.17.0