DayZ 1.24
Loading...
Searching...
No Matches
ActionTriggerRemotely.c
Go to the documentation of this file.
2{
4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PRESS_TRIGGER;
6 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_PRESS_TRIGGER;
7 m_Text = "#STR_Detonate";
8 }
9
11 {
14 }
15
16 override bool HasProgress()
17 {
18 return true;
19 }
20
21 override bool HasTarget()
22 {
23 return false;
24 }
25
26 override bool HasProneException()
27 {
28 return true;
29 }
30
31 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
32 {
34 if (rdt && rdt.IsConnected())
35 {
36 ExplosivesBase controlledDevice = ExplosivesBase.Cast(rdt.GetControlledDevice());
37 if (controlledDevice && controlledDevice.GetPairDevice() != item)
38 {
39 rdt.UpdateLED(ERemoteDetonatorLEDState.OFF);
40
41 return false;
42 }
43
44 if (controlledDevice && !controlledDevice.IsRuined() && controlledDevice.GetArmed())
45 {
47 {
48 rdt.UpdateLED(ERemoteDetonatorLEDState.LIT);
49
50 return true;
51 }
52 }
53 }
54
55 rdt.UpdateLED(ERemoteDetonatorLEDState.OFF);
56
57 return false;
58 }
59
61 {
62 super.OnExecuteServer(action_data);
63
65 if (rdt && rdt.IsConnected())
66 {
67 ItemBase controlledDevice = ItemBase.Cast(rdt.GetControlledDevice());
68 if (controlledDevice && !controlledDevice.IsRuined())
69 {
70 controlledDevice.OnActivatedByItem(action_data.m_MainItem);
71 action_data.m_MainItem.SetAnimationPhase("trigger", 1);
72 action_data.m_MainItem.SetAnimationPhase("lever", 1);
73 }
74 }
75 }
76}
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
ERemoteDetonatorLEDState
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool HasProneException()
override void CreateConditionComponents()
override void OnExecuteServer(ActionData action_data)
Definition EnMath.c:7
const float EXPLOSIVE_REMOTE_ACTIVATION
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
static proto float SqrFloat(float f)
Returns squared value.