DayZ 1.24
Loading...
Searching...
No Matches
ActionGagSelf.c
Go to the documentation of this file.
2{
4 {
6 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_COVERHEAD_SELF;
7 //m_FullBody = true;
8 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
10 m_Text = "#gag_self";
11 }
12
18
19 override bool HasTarget()
20 {
21 return false;
22 }
23
24 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
25 {
26 if (item.GetQuantity() > 1)
27 return false;
28
30 {
31 ItemBase headgear = ItemBase.Cast(player.FindAttachmentBySlotName("Headgear"));
32 if (headgear)
33 {
35 headgear_restricted = headgear.ConfigGetBool("noMask");
37 return false;
38 }
39 return true;
40 }
41
42 return false;
43 }
44
46 {
48 if (Class.CastTo(new_item, action_data.m_Player.GetInventory().CreateAttachmentEx("MouthRag", InventorySlots.MASK)))
49 {
50 MiscGameplayFunctions.TransferItemProperties(action_data.m_MainItem, new_item, true, false, true);
51
52 action_data.m_MainItem.TransferModifiers(action_data.m_Player);
53 action_data.m_MainItem.Delete();
54 }
55 }
56
58 {
59 if (player.GetInventory().FindAttachment(InventorySlots.MASK))
60 return true;
61 return false;
62 }
63};
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
int m_StanceMask
Definition ActionBase.c:53
bool IsWearingMask(PlayerBase player)
void ActionGagSelf()
override void OnFinishProgressServer(ActionData action_data)
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool HasTarget()
Super root of all classes in Enforce script.
Definition EnScript.c:11
provides access to slot configuration
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.