DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
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
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 action_data.m_Player.GetInventory().CreateInInventory("MouthRag");
50 //This is specific to rags, would need something better to scale if we want more gag types
51 MouthRag m_Gag = MouthRag.Cast(action_data.m_Player.GetItemOnSlot("Mask"));
52 if (m_Gag)
53 {
54 m_Gag.SetHealth01("", "", action_data.m_MainItem.GetHealth01("", ""));
55 action_data.m_Player.CheckForGag();
56 }
57
58
59 action_data.m_MainItem.TransferModifiers(action_data.m_Player);
60 action_data.m_MainItem.Delete();
61 //action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
62 }
63
65 {
66 if ( player.GetInventory().FindAttachment(InventorySlots.MASK) )
67 {
68 return true;
69 }
70 return false;
71 }
72};
protected float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
protected string m_Text
Definition ActionBase.c:49
protected int m_StanceMask
Definition ActionBase.c:53
class ActionTargets ActionTarget
ItemBase m_MainItem
Definition ActionBase.c:28
PlayerBase m_Player
Definition ActionBase.c:33
override void OnFinishProgressServer(ActionData action_data)
void ActionGagSelf()
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool HasTarget()
bool IsWearingMask(PlayerBase player)
provides access to slot configuration
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602