DayZ 1.24
Loading...
Searching...
No Matches
ActionAttachExplosivesTrigger.c
Go to the documentation of this file.
20
26
28 {
29 return true;
30 }
31
32 override bool CanBeSetFromInventory()
33 {
34 return true;
35 }
36
37 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
38 {
39 if (target.GetParent())
40 return false;
41
42 if (ClaymoreMine.Cast(target.GetObject()))
43 return false;
44
45 ExplosivesBase explosive = ExplosivesBase.Cast(target.GetObject());
46 if (explosive)
47 {
48 ClockBase timedTrigger;
49 if (ClockBase.CastTo(timedTrigger, item))
50 return timedTrigger.IsAlarmOn() && explosive.IsTimerDetonable() && explosive.CanBeArmed();
51
52 return explosive.CanBeArmed();
53 }
54
55
56 return false;
57 }
58
60 {
62
63 ExplosivesBase explosive = ExplosivesBase.Cast(action_data.m_Target.GetObject());
64 if (explosive)
65 {
66 explosive.OnPlacementComplete(action_data.m_Player, explosive.GetPosition(), action_data.m_Player.GetOrientation());
67 explosive.UnlockTriggerSlots();
68 }
69
70 if (action_data.m_MainItem.IsInherited(RemoteDetonator))
71 {
73
74 return;
75 }
76 else
78 }
79
81 {
83
84 ExplosivesBase explosive = ExplosivesBase.Cast(action_data.m_Target.GetObject());
85 if (explosive)
86 explosive.UnlockTriggerSlots();
87
88 if (!action_data.m_MainItem.IsInherited(RemoteDetonator))
90 }
91
93 {
94 ExplosivesBase explosive;
95 if (action_data.m_Target.IsProxy())
96 explosive = ExplosivesBase.Cast(action_data.m_Target.GetParent());
97 else
98 explosive = ExplosivesBase.Cast(action_data.m_Target.GetObject());
99
100 if (explosive && action_data.m_MainItem)
101 {
102 explosive.UnlockTriggerSlots();
104 }
105 }
106
108 {
110 if (action_data.m_Target.IsProxy())
111 targetEAI = EntityAI.Cast(action_data.m_Target.GetParent());
112 else
113 targetEAI = EntityAI.Cast(action_data.m_Target.GetObject());
114
115 if (targetEAI && action_data.m_MainItem)
116 {
117 int slotId = InventorySlots.GetSlotIdFromString(action_data.m_MainItem.GetExplosiveTriggerSlotName());
118 action_data.m_Player.PredictiveTakeEntityToTargetAttachmentEx(targetEAI, action_data.m_MainItem, slotId);
119 }
120 }
121}
ActionAttachExplosivesTriggerCB ActionContinuousBaseCB ActionAttachExplosivesTrigger()
void CreateRemoteDetonatorReceiverAsAttachment(ActionData action_data)
void AttachItem(ActionData action_data)
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
bool CanBeSetFromInventory()
Definition ActionBase.c:279
void CreateConditionComponents()
Definition ActionBase.c:196
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
void ClearInventoryReservationEx(ActionData action_data)
Definition ActionBase.c:790
ActionData m_ActionData
void OnFinishProgressClient(ActionData action_data)
void OnFinishProgressServer(ActionData action_data)
ref CABase m_ActionComponent
Definition ActionBase.c:30
override bool ActionConditionContinue(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
static RemoteDetonatorTrigger SpawnInPlayerHands(notnull EntityAI pEntity, EntityAI deviceToPair=null)
const float DEFAULT
const float EXPLOSIVE_ARM
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597