DayZ 1.24
Loading...
Searching...
No Matches
ActionToggleNVG.c
Go to the documentation of this file.
1class ActionToggleNVG: ActionBase
2{
4 {
5 }
6
7 override bool IsInstant()
8 {
9 return true;
10 }
11
17
18 override typename GetInputType()
19 {
21 }
22
23 override bool HasTarget()
24 {
25 return true;
26 }
27
28 override bool UseMainItem()
29 {
30 return false;
31 }
32
33 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
34 {
35 NVGoggles goggles;
37 NVmount = Clothing.Cast(target.GetObject());
38 if (!NVmount)
39 return false;
40 goggles = NVGoggles.Cast(NVmount.FindAttachmentBySlotName("NVG"));
41 if (goggles)
42 return true;
43
44 return false;
45 }
46
48 {
49 super.Start(action_data);
50
51 NVGoggles goggles;
53
54 NVmount = Clothing.Cast(action_data.m_Target.GetObject());
55 goggles = NVGoggles.Cast(NVmount.FindAttachmentBySlotName("NVG"));
56
57 goggles.RotateGoggles(goggles.m_IsLowered);
58 }
59};
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
override bool UseMainItem()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void CreateConditionComponents()
override GetInputType()
override bool IsInstant()
override bool HasTarget()
override void Start(ActionData action_data)
const float DEFAULT