DayZ 1.24
Loading...
Searching...
No Matches
ActionDialCombinationLockOnTarget.c
Go to the documentation of this file.
2{
3 private const float REPEAT_AFTER_SEC = 0.5;
4
9}
10
12{
14 {
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENITEM;
17 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_OPENITEM;
19 m_Text = "#dial_combination_lock";
20 }
21
27
28 override bool HasProneException()
29 {
30 return true;
31 }
32
33 override typename GetInputType()
34 {
36 }
37
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
62 {
63 //set dialed number
64 ConstructionActionData constructionActionData = action_data.m_Player.GetConstructionActionData();
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}
string m_Text
Definition ActionBase.c:49
void CreateConditionComponents()
Definition ActionBase.c:196
void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
Definition ActionBase.c:909
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
ActionDialCombinationLockOnTargetCB ActionContinuousBaseCB ActionDialCombinationLockOnTarget()
ActionData m_ActionData
void OnFinishProgressServer(ActionData action_data)
ref CABase m_ActionComponent
Definition ActionBase.c:30
override bool HasProneException()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597