DayZ 1.24
Loading...
Searching...
No Matches
ActionUngagSelf.c
Go to the documentation of this file.
2{
4 {
6 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_COVERHEAD_SELF;
7 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
8 m_Text = "#ungag";
9 }
10
12 {
15 }
16
17 override bool HasTarget()
18 {
19 return false;
20 }
21
22 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
23 {
24 if (IsWearingGag(player) && null == player.GetHumanInventory().GetEntityInHands())
25 return true;
26
27 return false;
28 }
29
31 {
33 Class.CastTo(attachment, action_data.m_Player.GetInventory().FindAttachment(InventorySlots.MASK));
34 if (attachment && attachment.GetType() == "MouthRag")
35 {
37 lamb.SetTransferParams(true, true, true, false, 1);
38 action_data.m_Player.ServerReplaceItemElsewhereWithNewInHands(lamb);
39 }
40 }
41
43 {
45 Class.CastTo(attachment, player.GetInventory().FindAttachment(InventorySlots.MASK));
46 if (attachment && attachment.GetType() == "MouthRag")
47 return true;
48 return false;
49 }
50};
51
53{
54 MouthRag gag;
56
58 {
59 gag = MouthRag.Cast(m_OldItem);
60 if (gag)
61 gag.SetIncomingLambaBool(true);
63 targetHnd.SetHands(player, null);
64 OverrideNewLocation(targetHnd);
65 m_OriginalOwner = m_OldItem.GetHierarchyRoot();
66 }
67
69 {
70 super.OnSuccess(new_item);
71
74 player.CheckForGag();
75 }
76
77 override void OnAbort()
78 {
79 if (gag)
80 gag.SetIncomingLambaBool(false);
81 }
82};
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
override bool HasTarget()
override void OnFinishProgressServer(ActionData action_data)
override void CreateConditionComponents()
bool IsWearingGag(PlayerBase player)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Super root of all classes in Enforce script.
Definition EnScript.c:11
InventoryLocation.
provides access to slot configuration
override void OnAbort()
EntityAI m_OriginalOwner
override void OnSuccess(EntityAI new_item)
void UngagSelfLambda(EntityAI old_item, string new_item_type, PlayerBase player)
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.