Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actiondestroycombinationlock.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
5 m_ActionData.m_ActionComponent = new CAContinuousRepeat(6.0);
6 }
7};
8
11{
12 static int CYCLES = 5;
14 {
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DISASSEMBLE;
17 m_FullBody = true;
18 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
19 m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_MEDIUM;
20 m_Text = "#destroy_combination_lock";
21 }
22
23 override void CreateConditionComponents()
24 {
27 }
28
29 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
30 {
31 Object target_object = target.GetObject();
32 string selection = target_object.GetActionComponentName( target.GetComponentIndex() );
33 Fence fence = Fence.Cast( target_object );
34
35 if ( fence && fence.IsLocked() && selection == "wall_interact" )
36 {
37 return true;
38 }
39
40 return false;
41 }
42
43 override void OnFinishProgressServer( ActionData action_data )
44 {
45 Fence fence = Fence.Cast( action_data.m_Target.GetObject() );
46 if ( fence )
47 {
48 CombinationLock combination_lock = fence.GetCombinationLock();
49 if ( combination_lock )
50 {
51 combination_lock.AddHealth("","",-(combination_lock.GetMaxHealth("","")/CYCLES));
52
53 if ( combination_lock.IsDamageDestroyed() )
54 {
55 combination_lock.UnlockServer( action_data.m_Player, fence );
56 GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( combination_lock.DestroyLock, 200, false );
57 }
58 }
59 }
60
61 action_data.m_MainItem.DecreaseHealth( UADamageApplied.SAW_LOCK, false );
62 }
63
64 override string GetAdminLogMessage(ActionData action_data)
65 {
66 return " destroyed combination lock with " + action_data.m_MainItem.GetDisplayName();
67 }
68};
ActionData m_ActionData
float m_SpecialtyWeight
Definition actionbase.c:77
int m_StanceMask
Definition actionbase.c:62
string m_Text
Definition actionbase.c:58
ref CCIBase m_ConditionItem
Definition actionbase.c:64
bool m_FullBody
Definition actionbase.c:61
ref CCTBase m_ConditionTarget
Definition actionbase.c:65
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
proto native CGame GetGame()
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10