DayZ 1.24
Loading...
Searching...
No Matches
ActionDestroyCombinationLock Class Reference
Inheritance diagram for ActionDestroyCombinationLock:
[legend]
Collaboration diagram for ActionDestroyCombinationLock:
[legend]

Private Member Functions

void ActionDestroyCombinationLock ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressServer (ActionData action_data)
 
override string GetAdminLogMessage (ActionData action_data)
 
- Private Member Functions inherited from ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Static Private Attributes

static int CYCLES = 5
 

Detailed Description

Definition at line 9 of file ActionDestroyCombinationLock.c.

Constructor & Destructor Documentation

◆ ActionDestroyCombinationLock()

void ActionDestroyCombinationLock::ActionDestroyCombinationLock ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

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

Definition at line 28 of file ActionDestroyCombinationLock.c.

29 {
30 Object target_object = target.GetObject();
31 string selection = target_object.GetActionComponentName(target.GetComponentIndex());
32 Fence fence = Fence.Cast(target_object);
33
34 if (fence && fence.IsLocked() && selection == "wall_interact")
35 return true;
36
37 return false;
38 }

◆ CreateConditionComponents()

override void ActionDestroyCombinationLock::CreateConditionComponents ( )
inlineprivate

◆ GetAdminLogMessage()

override string ActionDestroyCombinationLock::GetAdminLogMessage ( ActionData action_data)
inlineprivate

Definition at line 64 of file ActionDestroyCombinationLock.c.

65 {
66 return " destroyed combination lock with " + action_data.m_MainItem.GetDisplayName();
67 }

◆ OnFinishProgressServer()

override void ActionDestroyCombinationLock::OnFinishProgressServer ( ActionData action_data)
inlineprivate

Definition at line 40 of file ActionDestroyCombinationLock.c.

41 {
42 Fence fence = Fence.Cast(action_data.m_Target.GetObject());
43 if (fence)
44 {
45 CombinationLock combination_lock = fence.GetCombinationLock();
47 {
48 combination_lock.AddHealth("", "", -(combination_lock.GetMaxHealth("", "") / CYCLES));
49
50 if (combination_lock.IsDamageDestroyed())
51 {
52 combination_lock.UnlockServer(action_data.m_Player, fence);
53 GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(combination_lock.DestroyLock, 200, false);
54 }
55 }
56 }
57
58 action_data.m_MainItem.DecreaseHealth(UADamageApplied.SAW_LOCK, false);
59
60 //soft skills
61 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
62 }
const float SAW_LOCK
proto native CGame GetGame()
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10

References CALL_CATEGORY_GAMEPLAY, CYCLES, GetGame(), m_SpecialtyWeight, and UADamageApplied::SAW_LOCK.

Member Data Documentation

◆ CYCLES

int ActionDestroyCombinationLock::CYCLES = 5
staticprivate

Definition at line 11 of file ActionDestroyCombinationLock.c.

Referenced by OnFinishProgressServer().


The documentation for this class was generated from the following file: