DayZ 1.24
Loading...
Searching...
No Matches
ActionGagTarget Class Reference
Inheritance diagram for ActionGagTarget:
[legend]
Collaboration diagram for ActionGagTarget:
[legend]

Private Member Functions

void ActionGagTarget ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressServer (ActionData action_data)
 
bool IsWearingMask (PlayerBase player)
 
- Private Member Functions inherited from ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Detailed Description

Definition at line 1 of file ActionGagTarget.c.

Constructor & Destructor Documentation

◆ ActionGagTarget()

void ActionGagTarget::ActionGagTarget ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

override bool ActionGagTarget::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 20 of file ActionGagTarget.c.

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 }
bool IsWearingMask(PlayerBase player)
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo(), and IsWearingMask().

◆ CreateConditionComponents()

override void ActionGagTarget::CreateConditionComponents ( )
inlineprivate

Definition at line 13 of file ActionGagTarget.c.

14 {
15
18 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
Definition CCTMan.c:2
const float DEFAULT

References UAMaxDistances::DEFAULT, m_ConditionItem, and m_ConditionTarget.

◆ IsWearingMask()

bool ActionGagTarget::IsWearingMask ( PlayerBase player)
inlineprivate

Definition at line 61 of file ActionGagTarget.c.

62 {
63 if (player.GetInventory().FindAttachment(InventorySlots.MASK))
64 return true;
65 return false;
66 }
provides access to slot configuration

Referenced by ActionCondition().

◆ OnFinishProgressServer()

override void ActionGagTarget::OnFinishProgressServer ( ActionData action_data)
inlineprivate

Definition at line 43 of file ActionGagTarget.c.

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 }
bool CanReceiveAction(ActionTarget target)
Definition ActionBase.c:594

References CanReceiveAction(), and Class::CastTo().


The documentation for this class was generated from the following file: