Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
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 
10 {
11  static int CYCLES = 5;
13  {
14  m_CallbackClass = ActionDestroyCombinationLockCB;
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 
22  override void CreateConditionComponents()
23  {
26  }
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  {
36  return true;
37  }
38 
39  return false;
40  }
41 
42  override void OnFinishProgressServer( ActionData action_data )
43  {
44  Fence fence = Fence.Cast( action_data.m_Target.GetObject() );
45  if ( fence )
46  {
47  CombinationLock combination_lock = fence.GetCombinationLock();
48  if ( combination_lock )
49  {
50  combination_lock.AddHealth("","",-(combination_lock.GetMaxHealth("","")/CYCLES));
51 
52  if ( combination_lock.IsDamageDestroyed() )
53  {
54  combination_lock.UnlockServer( action_data.m_Player, fence );
55  GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( combination_lock.DestroyLock, 200, false );
56  }
57  }
58  }
59 
60  action_data.m_MainItem.DecreaseHealth( UADamageApplied.SAW_LOCK, false );
61 
62  //soft skills
63  action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
64  }
65 
66  override string GetAdminLogMessage(ActionData action_data)
67  {
68  return " destroyed combination lock with " + action_data.m_MainItem.GetDisplayName();
69  }
70 };
ItemBase
Definition: inventoryitem.c:730
GetGame
proto native CGame GetGame()
ActionDestroyCombinationLock
Definition: actiondestroycombinationlock.c:9
CALL_CATEGORY_GAMEPLAY
const int CALL_CATEGORY_GAMEPLAY
Definition: tools.c:10
CAContinuousRepeat
Definition: cacontinuousrepeat.c:1
UADamageApplied
Definition: actionconstants.c:130
CombinationLock
Definition: combinationlock4.c:1
UASoftSkillsWeight
Definition: actionconstants.c:118
UAMaxDistances
Definition: actionconstants.c:104
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionDestroyCombinationLockCB
Definition: actiondestroycombinationlock.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTNonRuined
Definition: cctnonruined.c:1
Object
Definition: objecttyped.c:1
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionContinuousBase
Definition: actioncontinuousbase.c:132
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53