DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionTriggerRemotely.c
См. документацию.
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 {
46 if (vector.DistanceSq(player.GetPosition(), controlledDevice.GetPosition()) <= Math.SqrFloat(UAMaxDistances.EXPLOSIVE_REMOTE_ACTIVATION))
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
60 override void OnExecuteServer(ActionData action_data)
61 {
62 super.OnExecuteServer(action_data);
63
64 RemoteDetonatorTrigger rdt = RemoteDetonatorTrigger.Cast(action_data.m_MainItem);
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}
ActionBase ActionData
Определения ActionBase.c:30
class ActionTargets ActionTarget
void ExplosivesBase()
Определения ExplosivesBase.c:42
ERemoteDetonatorLEDState
Определения RemoteDetonator.c:2
string m_Text
Определения ActionBase.c:58
ref CCIBase m_ConditionItem
Определения ActionBase.c:64
ref CCTBase m_ConditionTarget
Определения ActionBase.c:65
void ActionSingleUseBase()
Определения ActionSingleUseBase.c:31
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionTriggerRemotely.c:31
override bool HasTarget()
Определения ActionTriggerRemotely.c:21
override bool HasProneException()
Определения ActionTriggerRemotely.c:26
override bool HasProgress()
Определения ActionTriggerRemotely.c:16
override void CreateConditionComponents()
Определения ActionTriggerRemotely.c:10
override void OnExecuteServer(ActionData action_data)
Определения ActionTriggerRemotely.c:60
void ActionTriggerRemotely()
Определения ActionTriggerRemotely.c:3
int m_CommandUID
Определения AnimatedActionBase.c:143
int m_CommandUIDProne
Определения AnimatedActionBase.c:144
Определения CCINonRuined.c:2
Определения CCTNone.c:2
Определения InventoryItem.c:731
Определения EnMath.c:7
Определения PlayerBaseClient.c:2
EntityAI GetControlledDevice()
Определения RemoteDetonator.c:150
bool IsConnected()
Определения RemoteDetonator.c:145
const float EXPLOSIVE_REMOTE_ACTIVATION
Определения ActionConstants.c:118
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
Определения EnConvert.c:106
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
static proto float SqrFloat(float f)
Returns squared value.