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

Go to the source code of this file.

Classes

class  ActionDisarmExplosiveWithRemoteDetonatorCB
 

Functions

ActionDisarmExplosiveWithRemoteDetonatorCB ActionDisarmExplosiveCB ActionDisarmExplosiveWithRemoteDetonator ()
 
override void CreateActionComponent ()
 
override void CreateConditionComponents ()
 
override bool CanBeSetFromInventory ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressServer (ActionData action_data)
 

Function Documentation

◆ ActionCondition()

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

Definition at line 31 of file ActionDisarmExplosiveWithRemoteDetonator.c.

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 }

◆ ActionDisarmExplosiveWithRemoteDetonator()

ActionDisarmExplosiveWithRemoteDetonatorCB ActionDisarmExplosiveCB ActionDisarmExplosiveWithRemoteDetonator ( )

Definition at line 1 of file ActionDisarmExplosiveWithRemoteDetonator.c.

12 {
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
15 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
16 m_FullBody = true;
17 m_Text = "#disarm";
18 }
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

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

◆ CanBeSetFromInventory()

override bool CanBeSetFromInventory ( )

Definition at line 26 of file ActionDisarmExplosiveWithRemoteDetonator.c.

27 {
28 return true;
29 }

◆ CreateActionComponent()

override void ActionDisarmExplosiveWithRemoteDetonator::CreateActionComponent ( )

Definition at line 12 of file ActionDisarmExplosiveWithRemoteDetonator.c.

12 {
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
15 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;

References m_FullBody, m_StanceMask, and m_Text.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )

Definition at line 20 of file ActionDisarmExplosiveWithRemoteDetonator.c.

21 {
24 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)

claymore has integrated detonator

refresh IK, item changed

Definition at line 60 of file ActionDisarmExplosiveWithRemoteDetonator.c.

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
77 MiscGameplayFunctions.TurnItemIntoItemEx(action_data.m_Player, lambda);
79 action_data.m_Player.GetItemAccessor().OnItemInHandsChanged();
80 }