DayZ 1.24
Loading...
Searching...
No Matches
ActionAttachExplosivesTrigger.c File Reference

Go to the source code of this file.

Classes

class  ActionAttachExplosivesTriggerCB
 

Functions

ActionAttachExplosivesTriggerCB ActionContinuousBaseCB ActionAttachExplosivesTrigger ()
 
override void CreateActionComponent ()
 
override void CreateConditionComponents ()
 
override bool ActionConditionContinue (ActionData action_data)
 
override bool CanBeSetFromInventory ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressServer (ActionData action_data)
 
override void OnFinishProgressClient (ActionData action_data)
 
void CreateRemoteDetonatorReceiverAsAttachment (ActionData action_data)
 
void AttachItem (ActionData action_data)
 

Function Documentation

◆ ActionAttachExplosivesTrigger()

ActionAttachExplosivesTriggerCB ActionContinuousBaseCB ActionAttachExplosivesTrigger ( )

Definition at line 1 of file ActionAttachExplosivesTrigger.c.

12 {
13 m_CallbackClass = ActionAttachExplosivesTriggerCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
15 m_FullBody = true;
17
18 m_Text = "#STR_ArmExplosive";
19 }
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
float m_SpecialtyWeight
Definition ActionBase.c:68
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

Referenced by OnVariablesSynchronized(), ActionConstructor::RegisterActions(), RemoteDetonatorReceiver(), RemoteDetonatorTrigger::SetActions(), and SetActions().

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )

Definition at line 37 of file ActionAttachExplosivesTrigger.c.

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 }

◆ ActionConditionContinue()

override bool ActionConditionContinue ( ActionData action_data)

Definition at line 27 of file ActionAttachExplosivesTrigger.c.

28 {
29 return true;
30 }

◆ AttachItem()

void AttachItem ( ActionData action_data)
protected

Definition at line 107 of file ActionAttachExplosivesTrigger.c.

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 }
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id

References InventorySlots::GetSlotIdFromString().

Referenced by OnExecuteClient(), OnExecuteServer(), OnFinishProgressClient(), and OnFinishProgressServer().

◆ CanBeSetFromInventory()

override bool CanBeSetFromInventory ( )

Definition at line 32 of file ActionAttachExplosivesTrigger.c.

33 {
34 return true;
35 }

◆ CreateActionComponent()

override void ActionAttachExplosivesTrigger::CreateActionComponent ( )

Definition at line 12 of file ActionAttachExplosivesTrigger.c.

12 {
13 m_CallbackClass = ActionAttachExplosivesTriggerCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
15 m_FullBody = true;

References m_FullBody, m_SpecialtyWeight, m_Text, and UASoftSkillsWeight::PRECISE_LOW.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )

◆ CreateRemoteDetonatorReceiverAsAttachment()

void CreateRemoteDetonatorReceiverAsAttachment ( ActionData action_data)
protected

Definition at line 92 of file ActionAttachExplosivesTrigger.c.

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 }
static RemoteDetonatorTrigger SpawnInPlayerHands(notnull EntityAI pEntity, EntityAI deviceToPair=null)

References RemoteDetonatorTrigger::SpawnInPlayerHands().

Referenced by OnFinishProgressServer().

◆ OnFinishProgressClient()

override void OnFinishProgressClient ( ActionData action_data)

Definition at line 80 of file ActionAttachExplosivesTrigger.c.

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 }
void AttachItem(ActionData action_data)
void ClearInventoryReservationEx(ActionData action_data)
Definition ActionBase.c:790

References AttachItem(), and ClearInventoryReservationEx().

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)

Definition at line 59 of file ActionAttachExplosivesTrigger.c.

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 }
void CreateRemoteDetonatorReceiverAsAttachment(ActionData action_data)

References AttachItem(), ClearInventoryReservationEx(), and CreateRemoteDetonatorReceiverAsAttachment().