Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actiongagself.c
Go to the documentation of this file.
2{
3 void ActionGagSelf()
4 {
6 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_COVERHEAD_SELF;
7 //m_FullBody = true;
8 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
9 m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_LOW;
10 m_Text = "#gag_self";
11 }
12
13 override void CreateConditionComponents()
14 {
17 }
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
29 if ( !IsWearingMask(player) )
30 {
31 ItemBase headgear = ItemBase.Cast(player.FindAttachmentBySlotName( "Headgear" ));
32 if ( headgear )
33 {
34 bool headgear_restricted;
35 headgear_restricted = headgear.ConfigGetBool( "noMask" );
36 if (headgear_restricted)
37 {
38 return false;
39 }
40 }
41 return true;
42 }
43
44 return false;
45 }
46
47 override void OnFinishProgressServer( ActionData action_data )
48 {
49 ItemBase new_item;
50 if (Class.CastTo(new_item,action_data.m_Player.GetInventory().CreateAttachmentEx("MouthRag",InventorySlots.MASK)))
51 {
52 MiscGameplayFunctions.TransferItemProperties(action_data.m_MainItem,new_item,true,false,true);
53
54 action_data.m_MainItem.TransferModifiers(action_data.m_Player);
55 action_data.m_MainItem.Delete();
56 }
57 }
58
59 bool IsWearingMask( PlayerBase player)
60 {
61 if ( player.GetInventory().FindAttachment(InventorySlots.MASK) )
62 {
63 return true;
64 }
65 return false;
66 }
67};
float m_SpecialtyWeight
Definition actionbase.c:77
int m_StanceMask
Definition actionbase.c:62
string m_Text
Definition actionbase.c:58
ref CCIBase m_ConditionItem
Definition actionbase.c:64
ref CCTBase m_ConditionTarget
Definition actionbase.c:65
Super root of all classes in Enforce script.
Definition enscript.c:11
provides access to slot configuration
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602