DayZ 1.24
Loading...
Searching...
No Matches
ActionGagTarget.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;
10 m_Text = "#gag_person";
11 }
12
19
20 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
21 {
22 if (item.GetQuantity() > 1)
23 return false;
24
26 Class.CastTo(targetPlayer, target.GetObject());
28 {
29 ItemBase headgear = ItemBase.Cast(targetPlayer.FindAttachmentBySlotName("Headgear"));
30 if (headgear)
31 {
33 headgear_restricted = headgear.ConfigGetBool("noMask");
35 return false;
36 }
37 return true;
38 }
39
40 return false;
41 }
42
44 {
46 Class.CastTo(ntarget, action_data.m_Target.GetObject());
47
48 if (CanReceiveAction(action_data.m_Target))
49 {
51 if (Class.CastTo(m_Gag, ntarget.GetInventory().CreateAttachmentEx("MouthRag", InventorySlots.MASK)))
52 {
53 m_Gag.SetHealth01("", "", action_data.m_MainItem.GetHealth01("", ""));
54
55 action_data.m_MainItem.TransferModifiers(ntarget);
56 action_data.m_MainItem.Delete();
57 }
58 }
59 }
60
62 {
63 if (player.GetInventory().FindAttachment(InventorySlots.MASK))
64 return true;
65 return false;
66 }
67};
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool CanReceiveAction(ActionTarget target)
Definition ActionBase.c:594
int m_StanceMask
Definition ActionBase.c:53
override void CreateConditionComponents()
override void OnFinishProgressServer(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
bool IsWearingMask(PlayerBase player)
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.