DayZ 1.24
Loading...
Searching...
No Matches
ActionDestroyCombinationLock.c
Go to the documentation of this file.
8
10{
11 static int CYCLES = 5;
13 {
15 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DISASSEMBLE;
16 m_FullBody = true;
17 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
19 m_Text = "#destroy_combination_lock";
20 }
21
27
28 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
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 }
39
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 }
63
65 {
66 return " destroyed combination lock with " + action_data.m_MainItem.GetDisplayName();
67 }
68};
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override string GetAdminLogMessage(ActionData action_data)
override void OnFinishProgressServer(ActionData action_data)
const float SAW_LOCK
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
proto native CGame GetGame()
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10