Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actiondisarmexplosivewithremotedetonator.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_PAIRED);
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 
20  override void CreateConditionComponents()
21  {
24  }
25 
26  override bool CanBeSetFromInventory()
27  {
28  return true;
29  }
30 
31  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
32  {
33  if (!target)
34  return false;
35 
36  ExplosivesBase explosive = ExplosivesBase.Cast(target.GetObject());
37  if (!explosive)
38  return false;
39 
40  if (explosive.IsRuined() || !explosive.GetArmed() || !explosive.CanBeDisarmed())
41  return false;
42 
43  if (explosive.GetAttachmentByType(KitchenTimer) || explosive.GetAttachmentByType(AlarmClock_ColorBase))
44  return false;
45 
47  if (rdt && rdt.IsConnected())
48  {
49  if (explosive != rdt.GetControlledDevice())
50  return false;
51 
52  ExplosivesBase controlledDevice = ExplosivesBase.Cast(rdt.GetControlledDevice());
53  if (controlledDevice && !controlledDevice.IsRuined() && controlledDevice.GetArmed())
54  return true;
55  }
56 
57  return false;
58  }
59 
60  override void OnFinishProgressServer(ActionData action_data)
61  {
62  ExplosivesBase explosive = ExplosivesBase.Cast(action_data.m_Target.GetObject());
63  ItemBase detonator = ItemBase.Cast(action_data.m_MainItem);
64 
65  explosive.OnBeforeDisarm();
66 
68  if (explosive.IsInherited(ClaymoreMine))
69  {
70  explosive.Disarm();
71  explosive.SetTakeable(true);
72  detonator.Delete();
73  return;
74  }
75 
76  ReplaceDetonatorItemOnDisarmLambda lambda = new ReplaceDetonatorItemOnDisarmLambda(detonator, "RemoteDetonator");
77  MiscGameplayFunctions.TurnItemIntoItemEx(action_data.m_Player, lambda);
79  action_data.m_Player.GetItemAccessor().OnItemInHandsChanged();
80  }
81 }
ItemBase
Definition: inventoryitem.c:730
CAContinuousTime
Definition: cacontinuoustime.c:1
ActionDisarmExplosive
ActionDisarmExplosiveCB ActionContinuousBaseCB ActionDisarmExplosive()
Definition: actiondisarmexplosive.c:11
CanBeSetFromInventory
override bool CanBeSetFromInventory()
Definition: actiondisarmexplosivewithremotedetonator.c:26
KitchenTimer
Definition: kitchentimer.c:1
ClaymoreMine
Definition: claymoremine.c:1
CreateConditionComponents
override void CreateConditionComponents()
Definition: actiondisarmexplosivewithremotedetonator.c:20
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
ExplosivesBase
void ExplosivesBase()
Definition: explosivesbase.c:40
PlayerBase
Definition: playerbaseclient.c:1
ActionDisarmExplosiveCB
Definition: actiondisarmexplosive.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
RemoteDetonatorTrigger
Definition: remotedetonator.c:46
UATimeSpent
Definition: actionconstants.c:26
ReplaceDetonatorItemOnDisarmLambda
Definition: remotedetonator.c:311
ActionDisarmExplosiveWithRemoteDetonatorCB
Definition: actiondisarmexplosivewithremotedetonator.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
AlarmClock_ColorBase
Definition: alarmclock.c:1
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
ActionDisarmExplosiveWithRemoteDetonator
ActionDisarmExplosiveWithRemoteDetonatorCB ActionDisarmExplosiveCB ActionDisarmExplosiveWithRemoteDetonator()
Definition: actiondisarmexplosivewithremotedetonator.c:11
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actiondisarmexplosivewithremotedetonator.c:31
OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition: actiondisarmexplosivewithremotedetonator.c:60