DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionDisarmExplosiveWithRemoteDetonator.c
См. документацию.
19
21 {
22 m_ConditionItem = new CCINonRuined();
23 m_ConditionTarget = new CCTNonRuined();
24 }
25
26 override bool CanBeSetFromInventory()
27 {
28 return true;
29 }
30
31 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
32 {
33 if (!target)
34 return false;
35
36 ExplosivesBase explosive = ExplosivesBase.Cast(target.GetObject());
37 if (!explosive)
38 return false;
39
40 if (explosive.IsRuined() || !explosive.GetArmed() || !explosive.CanBeDisarmed())
41 return false;
42
43 if (explosive.GetAttachmentByType(KitchenTimer) || explosive.GetAttachmentByType(AlarmClock_ColorBase))
44 return false;
45
47 if (rdt && rdt.IsConnected())
48 {
49 if (explosive != rdt.GetControlledDevice())
50 return false;
51
52 ExplosivesBase controlledDevice = ExplosivesBase.Cast(rdt.GetControlledDevice());
53 if (controlledDevice && !controlledDevice.IsRuined() && controlledDevice.GetArmed())
54 return true;
55 }
56
57 return false;
58 }
59
60 override void OnFinishProgressServer(ActionData action_data)
61 {
62 ExplosivesBase explosive = ExplosivesBase.Cast(action_data.m_Target.GetObject());
63 ItemBase detonator = ItemBase.Cast(action_data.m_MainItem);
64
65 explosive.OnBeforeDisarm();
66
68 if (explosive.IsInherited(ClaymoreMine))
69 {
70 explosive.Disarm();
71 explosive.SetTakeable(true);
72 detonator.Delete();
73 return;
74 }
75
76 ReplaceDetonatorItemOnDisarmLambda lambda = new ReplaceDetonatorItemOnDisarmLambda(detonator, "RemoteDetonator");
77 MiscGameplayFunctions.TurnItemIntoItemEx(action_data.m_Player, lambda);
79 action_data.m_Player.GetItemAccessor().OnItemInHandsChanged();
80 }
81}
override void OnFinishProgressServer(ActionData action_data)
Определения ActionActivateTrap.c:116
override void CreateConditionComponents()
Определения ActionActivateTrap.c:30
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionActivateTrap.c:46
override bool CanBeSetFromInventory()
Определения ActionAttachExplosivesTrigger.c:32
int m_CommandUID
Определения ActionBase.c:31
int m_StanceMask
Определения ActionBase.c:33
ActionBase ActionData
Определения ActionBase.c:30
ActionDisarmExplosiveCB ActionContinuousBaseCB ActionDisarmExplosive()
Определения ActionDisarmExplosive.c:11
ActionDisarmExplosiveWithRemoteDetonatorCB ActionDisarmExplosiveCB ActionDisarmExplosiveWithRemoteDetonator()
class ActionTargets ActionTarget
void ExplosivesBase()
Определения ExplosivesBase.c:42
ActionData m_ActionData
Определения AnimatedActionBase.c:3
Определения AlarmClock.c:2
Определения CCINonRuined.c:2
Определения CCTNonRuined.c:2
Определения ClaymoreMine.c:2
Определения InventoryItem.c:731
Определения KitchenTimer.c:2
Определения PlayerBaseClient.c:2
EntityAI GetControlledDevice()
Определения RemoteDetonator.c:150
bool IsConnected()
Определения RemoteDetonator.c:145
const float DISARM_EXPLOSIVE_REMOTE_PAIRED
Определения ActionConstants.c:90
Определения ActionConstants.c:28
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602