DayZ 1.24
Loading...
Searching...
No Matches
ActionUngagTarget.c
Go to the documentation of this file.
2{
4 {
6 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_COVERHEAD_TARGET;
7 //m_FullBody = true;
8 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
9 m_Text = "#ungag_person";
10 }
11
13 {
14
17 }
18
19 override typename GetInputType()
20 {
22 }
23
24 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
25 {
27 if (Class.CastTo(targetPlayer, target.GetObject()))
28 {
29 if (IsWearingGag(targetPlayer) && null == player.GetHumanInventory().GetEntityInHands())
30 return true;
31 }
32 return false;
33 }
34
36 {
37 PlayerBase ntarget = PlayerBase.Cast(action_data.m_Target.GetObject());
38 if (CanReceiveAction(action_data.m_Target))
39 {
41 Class.CastTo(attachment, ntarget.GetInventory().FindAttachment(InventorySlots.MASK));
42
43 if (attachment && attachment.GetType() == "MouthRag")
44 {
46 lamb.SetTransferParams(true, true, true, false, 1);
47 action_data.m_Player.ServerReplaceItemElsewhereWithNewInHands(lamb);
48 }
49 }
50 }
51
53 {
55 Class.CastTo(attachment, player.GetInventory().FindAttachment(InventorySlots.MASK));
56 if (attachment && attachment.GetType() == "MouthRag")
57 return true;
58 return false;
59 }
60};
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool CanReceiveAction(ActionTarget target)
Definition ActionBase.c:594
int m_StanceMask
Definition ActionBase.c:53
bool IsWearingGag(PlayerBase player)
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnFinishProgressServer(ActionData action_data)
Definition CCTMan.c:2
Super root of all classes in Enforce script.
Definition EnScript.c:11
provides access to slot configuration
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.