Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
telescopicbaton.c
Go to the documentation of this file.
2 {
3  protected int m_MeleeMode;
4  protected int m_MeleeHeavyMode;
5  protected int m_MeleeSprintMode;
6 
7  protected ref OpenableBehaviour m_Openable;
8 
9  void TelescopicBaton()
10  {
12  m_MeleeMode = 0;
13  m_MeleeHeavyMode = 1;
14  m_MeleeSprintMode = 2;
15 
16  m_Openable = new OpenableBehaviour(false);
17 
18  RegisterNetSyncVariableBool("m_Openable.m_IsOpened");
19 
20  UpdateVisualState();
21  }
22 
23  override void Open()
24  {
25  m_Openable.Open();
26  SetSynchDirty();
27 
29  m_MeleeMode = 3;
30  m_MeleeHeavyMode = 4;
31  m_MeleeSprintMode = 5;
32 
33  UpdateVisualState();
34  }
35 
36  override void Close()
37  {
38  m_Openable.Close();
39  SetSynchDirty();
40 
42  m_MeleeMode = 0;
43  m_MeleeHeavyMode = 1;
44  m_MeleeSprintMode = 2;
45 
46  UpdateVisualState();
47  }
48 
49  override bool IsOpen()
50  {
51  return m_Openable.IsOpened();
52  }
53 
54  protected void UpdateVisualState()
55  {
56  if ( IsOpen() )
57  {
58  SetAnimationPhase("Doors1", 0.0);
59  }
60  else
61  {
62  SetAnimationPhase("Doors1", 1.0);
63  }
64  }
65 
66  override int GetMeleeMode()
67  {
68  return m_MeleeMode;
69  }
70 
71  override int GetMeleeHeavyMode()
72  {
73  return m_MeleeHeavyMode;
74  }
75 
76  override int GetMeleeSprintMode()
77  {
78  return m_MeleeSprintMode;
79  }
80 
81  override void OnVariablesSynchronized()
82  {
83  super.OnVariablesSynchronized();
84 
85  UpdateVisualState();
86  }
87 
88  override void SetActions()
89  {
90  super.SetActions();
93  }
94 }
ItemBase
Definition: inventoryitem.c:730
ActionOpen
Definition: actionopen.c:1
AddAction
void AddAction(typename actionName)
Definition: advancedcommunication.c:86
OpenableBehaviour
Definition: openablebehaviour.c:1
TelescopicBaton
Definition: telescopicbaton.c:1
ActionClose
Definition: actionclose.c:1