DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionDestroyCombinationLock.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
6 }
7};
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
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};
protected float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
protected string m_Text
Definition ActionBase.c:49
protected bool m_FullBody
Definition ActionBase.c:52
protected int m_StanceMask
Definition ActionBase.c:53
class ActionTargets ActionTarget
protected ActionData m_ActionData
ItemBase m_MainItem
Definition ActionBase.c:28
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
ref ActionTarget m_Target
Definition ActionBase.c:32
override void OnFinishProgressServer(ActionData action_data)
override string GetAdminLogMessage(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override ScriptCallQueue GetCallQueue(int call_category)
Definition DayZGame.c:1153
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
const float SAW_LOCK
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
proto native CGame GetGame()
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10