Dayz Explorer
1.29.162510
Loading...
Searching...
No Matches
actiontogglenvmode.c
Go to the documentation of this file.
1
2
class
ActionToggleNVMode: ActionSingleUseBase
3
{
4
void
ActionToggleNVMode()
5
{
6
//m_CallbackClass = ActionTurnOnTransmitterCB;
7
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_ITEM_ON;
8
m_CommandUIDProne
=
DayZPlayerConstants
.CMD_ACTIONFB_ITEM_ON;
9
m_Text
=
"#switch_mode"
;
10
}
11
12
override
void
CreateConditionComponents
()
13
{
14
m_ConditionItem
=
new
CCINonRuined
;
15
m_ConditionTarget
=
new
CCTNone
;
16
}
17
18
override
bool
HasTarget
()
19
{
20
return
false
;
21
}
22
23
override
bool
ActionCondition(
PlayerBase
player, ActionTarget target,
ItemBase
item )
24
{
25
ItemOptics
optics;
26
if
(
Class
.CastTo(optics,item) && optics.
IsNVOptic
() )
27
{
28
return
true
;
29
}
30
31
return
false
;
32
}
33
34
override
void
OnExecuteServer(
ActionData
action_data )
35
{
36
SwitchMode(action_data);
37
}
38
39
override
void
OnExecuteClient(
ActionData
action_data )
40
{
41
SwitchMode(action_data);
42
}
43
44
void
SwitchMode(
ActionData
action_data )
45
{
46
ItemOptics
optics =
ItemOptics
.Cast(action_data.m_MainItem);
47
switch
(optics.
GetCurrentOpticMode
())
48
{
49
case
GameConstants
.OPTICS_STATE_DAY:
50
optics.
SetCurrentOpticMode
(
GameConstants
.OPTICS_STATE_NIGHTVISION);
51
//TODO: animate
52
break
;
53
54
case
GameConstants
.OPTICS_STATE_NIGHTVISION:
55
optics.
SetCurrentOpticMode
(
GameConstants
.OPTICS_STATE_DAY);
56
//TODO: animate
57
break
;
58
}
59
}
60
}
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionBase::HasTarget
bool HasTarget()
Definition
actionbase.c:250
ActionBase::m_Text
string m_Text
Definition
actionbase.c:64
ActionBase::m_ConditionItem
ref CCIBase m_ConditionItem
Definition
actionbase.c:70
ActionBase::CreateConditionComponents
void CreateConditionComponents()
Definition
actionbase.c:236
ActionBase::m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
actionbase.c:71
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
animatedactionbase.c:143
AnimatedActionBase::m_CommandUIDProne
int m_CommandUIDProne
Definition
animatedactionbase.c:144
CCINonRuined
Definition
ccinonruined.c:2
CCTNone
Definition
cctnone.c:2
Class
Super root of all classes in Enforce script.
Definition
enscript.c:11
GameConstants
Definition
constants.c:664
ItemBase
Definition
inventoryitem.c:742
ItemOptics
Definition
itemoptics.c:2
ItemOptics::GetCurrentOpticMode
int GetCurrentOpticMode()
Definition
itemoptics.c:526
ItemOptics::IsNVOptic
bool IsNVOptic()
Definition
itemoptics.c:492
ItemOptics::SetCurrentOpticMode
void SetCurrentOpticMode(int mode)
Definition
itemoptics.c:520
PlayerBase
Definition
playerbaseclient.c:2
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:602
Daten
4_world
classes
useractionscomponent
actions
singleuse
actiontogglenvmode.c
Generated by
1.16.1