Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actiondisarmexplosivewithremotedetonatorunpaired.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
5 m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.DISARM_EXPLOSIVE_REMOTE_UNPAIRED);
6 }
7}
8
10{
12 {
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
15 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
16 m_FullBody = true;
17 m_Text = "#disarm";
18 }
19
21 {
22 m_ConditionItem = new CCINonRuined();
23 m_ConditionTarget = new CCTCursor();
24 }
25
26 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
27 {
28 if (!target)
29 {
30 return false;
31 }
32
34 ExplosivesBase explosive = ExplosivesBase.Cast(target.GetObject());
35 if (!explosive)
36 {
37 return false;
38 }
39
40 if (explosive.IsRuined() || !explosive.GetArmed() || !explosive.CanBeDisarmed())
41 {
42 return false;
43 }
44
45 if (explosive.GetAttachmentByType(KitchenTimer) || explosive.GetAttachmentByType(AlarmClock_ColorBase))
46 {
47 return false;
48 }
49
50 RemoteDetonatorReceiver attachedReceiver = RemoteDetonatorReceiver.Cast(explosive.GetAttachmentByType(RemoteDetonatorReceiver));
51 if (!explosive.IsInherited(ClaymoreMine) && attachedReceiver && attachedReceiver.IsRuined())
52 {
53 return false;
54 }
55
58 if (rdt && target.GetObject() != rdt.GetControlledDevice())
59 {
60 return true;
61 }
62
64 RemoteDetonator rd = RemoteDetonator.Cast(item);
65 if (rd && rd.IsKit())
66 {
67 return true;
68 }
69
70 return false;
71 }
72
73 override void OnFinishProgressServer(ActionData action_data)
74 {
75 ExplosivesBase target = ExplosivesBase.Cast(action_data.m_Target.GetObject());
76 ItemBase detonator = ItemBase.Cast(action_data.m_MainItem);
77
78 target.Disarm();
79 target.SetTakeable(true);
80
82 if (target.IsInherited(ClaymoreMine))
83 {
84 detonator.Delete();
85 return;
86 }
87
88 ReplaceItemWithNewLambdaBase lambda = new ReplaceDetonatorItemLambda(detonator, "RemoteDetonator");
89 MiscGameplayFunctions.TurnItemIntoItemEx(action_data.m_Player, lambda);
91 action_data.m_Player.GetItemAccessor().OnItemInHandsChanged();
92 }
93}
override void OnFinishProgressServer(ActionData action_data)
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
int m_CommandUID
Definition actionbase.c:31
int m_StanceMask
Definition actionbase.c:33
ActionDisarmExplosiveWithRemoteDetonatorCB ActionDisarmExplosiveCB ActionDisarmExplosiveWithRemoteDetonator()
ActionDisarmExplosiveWithRemoteDetonatorUnpairedCB ActionDisarmExplosiveCB ActionDisarmExplosiveWithRemoteDetonatorUnpaired()
ActionData m_ActionData
base class for transformation operations (creating one item from another)
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
RemoteDetonatorTrigger RemoteDetonator RemoteDetonatorReceiver()