Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actiondialcombinationlockontarget.c
Go to the documentation of this file.
2 {
3  private const float REPEAT_AFTER_SEC = 0.5;
4 
5  override void CreateActionComponent()
6  {
7  m_ActionData.m_ActionComponent = new CAContinuousRepeat(REPEAT_AFTER_SEC);
8  }
9 }
10 
12 {
14  {
15  m_CallbackClass = ActionDialCombinationLockOnTargetCB;
16  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENITEM;
17  m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_OPENITEM;
19  m_Text = "#dial_combination_lock";
20  }
21 
22  override void CreateConditionComponents()
23  {
24  m_ConditionItem = new CCINone();
26  }
27 
28  override bool HasProneException()
29  {
30  return true;
31  }
32 
33  override typename GetInputType()
34  {
36  }
37 
38  override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
39  {
40  ConstructionActionData constructionActionData = player.GetConstructionActionData();
41  m_Text = "#dial_combination_lock " + constructionActionData.GetDialNumberText();
42  }
43 
44  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
45  {
46  if (!target.GetObject())
47  return false;
48 
49  CombinationLock lock = CombinationLock.Cast(target.GetObject());
50  if (lock && lock.GetHierarchyParent() && Fence.Cast(lock.GetHierarchyParent()))
51  {
52  ConstructionActionData constructionActionData = player.GetConstructionActionData();
53  constructionActionData.SetCombinationLock(lock);
54 
55  return true;
56  }
57 
58  return false;
59  }
60 
61  override void OnFinishProgressServer(ActionData action_data)
62  {
63  //set dialed number
64  ConstructionActionData constructionActionData = action_data.m_Player.GetConstructionActionData();
65  CombinationLock combination_lock = constructionActionData.GetCombinationLock();
66  if (combination_lock)
67  {
68  combination_lock.DialNextNumber();
69 
70  //check for unlock state
71  if (!combination_lock.IsLockedOnGate())
72  {
73  EntityAI target_entity = EntityAI.Cast(action_data.m_Target.GetObject());
74  combination_lock.UnlockServer(action_data.m_Player, target_entity.GetHierarchyParent());
75  }
76  }
77  }
78 }
ItemBase
Definition: inventoryitem.c:730
ActionDialCombinationLockOnTarget
ActionDialCombinationLockOnTargetCB ActionContinuousBaseCB ActionDialCombinationLockOnTarget()
Definition: actiondialcombinationlockontarget.c:13
ConstructionActionData
Definition: constructionactiondata.c:1
CAContinuousRepeat
Definition: cacontinuousrepeat.c:1
CombinationLock
Definition: combinationlock4.c:1
ContinuousInteractActionInput
Definition: actioninput.c:521
CreateConditionComponents
override void CreateConditionComponents()
Definition: actiondialcombinationlockontarget.c:22
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actiondialcombinationlockontarget.c:44
UASoftSkillsWeight
Definition: actionconstants.c:118
OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition: actiondialcombinationlockontarget.c:61
CCINone
Definition: ccinone.c:1
GetInputType
override GetInputType()
Definition: actiondialcombinationlockontarget.c:33
UAMaxDistances
Definition: actionconstants.c:104
REPEAT_AFTER_SEC
const private float REPEAT_AFTER_SEC
Definition: actiondialcombinationlock.c:2
ActionDialCombinationLockOnTargetCB
Definition: actiondialcombinationlockontarget.c:1
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTNonRuined
Definition: cctnonruined.c:1
HasProneException
override bool HasProneException()
Definition: actiondialcombinationlockontarget.c:28
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
OnActionInfoUpdate
override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actiondialcombinationlockontarget.c:38
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionContinuousBase
Definition: actioncontinuousbase.c:132
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
EntityAI
Definition: building.c:5