DayZ 1.24
Loading...
Searching...
No Matches
ActionDialCombinationLockOnTarget.c File Reference

Go to the source code of this file.

Classes

class  ActionDialCombinationLockOnTargetCB
 

Functions

ActionDialCombinationLockOnTargetCB ActionContinuousBaseCB ActionDialCombinationLockOnTarget ()
 
override void CreateActionComponent ()
 
override void CreateConditionComponents ()
 
override bool HasProneException ()
 
override GetInputType ()
 
override void OnActionInfoUpdate (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressServer (ActionData action_data)
 

Variables

const float REPEAT_AFTER_SEC = 0.5
 

Function Documentation

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )

Definition at line 44 of file ActionDialCombinationLockOnTarget.c.

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 }

◆ ActionDialCombinationLockOnTarget()

ActionDialCombinationLockOnTargetCB ActionContinuousBaseCB ActionDialCombinationLockOnTarget ( )

Definition at line 1 of file ActionDialCombinationLockOnTarget.c.

14 {
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENITEM;
17 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_OPENITEM;
19 m_Text = "#dial_combination_lock";
20 }
string m_Text
Definition ActionBase.c:49
float m_SpecialtyWeight
Definition ActionBase.c:68
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

Referenced by ActionConstructor::RegisterActions(), and SetActions().

◆ CreateActionComponent()

override void ActionDialCombinationLockOnTarget::CreateActionComponent ( )
private

Definition at line 16 of file ActionDialCombinationLockOnTarget.c.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )

Definition at line 22 of file ActionDialCombinationLockOnTarget.c.

23 {
26 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
const float DEFAULT

References UAMaxDistances::DEFAULT, m_ConditionItem, and m_ConditionTarget.

◆ GetInputType()

override GetInputType ( )

◆ HasProneException()

override bool HasProneException ( )

Definition at line 28 of file ActionDialCombinationLockOnTarget.c.

29 {
30 return true;
31 }

◆ OnActionInfoUpdate()

override void OnActionInfoUpdate ( PlayerBase player,
ActionTarget target,
ItemBase item )

Definition at line 38 of file ActionDialCombinationLockOnTarget.c.

39 {
40 ConstructionActionData constructionActionData = player.GetConstructionActionData();
41 m_Text = "#dial_combination_lock " + constructionActionData.GetDialNumberText();
42 }

References m_Text.

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)

Definition at line 61 of file ActionDialCombinationLockOnTarget.c.

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 }

Variable Documentation

◆ REPEAT_AFTER_SEC

const float REPEAT_AFTER_SEC = 0.5
private

Definition at line 14 of file ActionDialCombinationLockOnTarget.c.