Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
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 
20  override void CreateConditionComponents()
21  {
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 }
ItemBase
Definition: inventoryitem.c:730
ActionDisarmExplosiveWithRemoteDetonatorUnpairedCB
Definition: actiondisarmexplosivewithremotedetonatorunpaired.c:1
CAContinuousTime
Definition: cacontinuoustime.c:1
CreateConditionComponents
override void CreateConditionComponents()
Definition: actiondisarmexplosivewithremotedetonatorunpaired.c:20
KitchenTimer
Definition: kitchentimer.c:1
OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition: actiondisarmexplosivewithremotedetonatorunpaired.c:73
ReplaceDetonatorItemLambda
Definition: remotedetonator.c:258
ClaymoreMine
Definition: claymoremine.c:1
ActionDisarmExplosiveWithRemoteDetonatorUnpaired
ActionDisarmExplosiveWithRemoteDetonatorUnpairedCB ActionDisarmExplosiveCB ActionDisarmExplosiveWithRemoteDetonatorUnpaired()
Definition: actiondisarmexplosivewithremotedetonatorunpaired.c:11
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
ExplosivesBase
void ExplosivesBase()
Definition: explosivesbase.c:40
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actiondisarmexplosivewithremotedetonatorunpaired.c:26
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
RemoteDetonatorReceiver
RemoteDetonatorTrigger RemoteDetonator RemoteDetonatorReceiver()
Definition: remotedetonator.c:227
RemoteDetonatorTrigger
Definition: remotedetonator.c:46
CCTCursor
Definition: cctcursor.c:1
UATimeSpent
Definition: actionconstants.c:26
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
ReplaceItemWithNewLambdaBase
base class for transformation operations (creating one item from another)
Definition: replaceitemwithnewlambdabase.c:4
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