Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionuncoverheadtarget.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.COVER_HEAD);
6  }
7 };
8 
10 {
12  {
13  m_CallbackClass = ActionUncoverHeadTargetCB;
14  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
15  m_FullBody = true;
16  m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
17  m_Text = "#uncover_players_head";
18  }
19 
20  override void CreateConditionComponents()
21  {
23  m_ConditionTarget = new CCTMan(UAMaxDistances.DEFAULT,false);
24  }
25 
26  override typename GetInputType()
27  {
29  }
30 
31  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
32  {
33  PlayerBase targetPlayer;
34  if (Class.CastTo(targetPlayer, target.GetObject()))
35  {
36  if (IsWearingBurlap(targetPlayer))
37  {
38  return true;
39  }
40  }
41  return false;
42  }
43 
44  override void OnFinishProgressServer(ActionData action_data)
45  {
46  PlayerBase targetPlayer = PlayerBase.Cast(action_data.m_Target.GetObject());
47  if (CanReceiveAction(action_data.m_Target))
48  {
49  UncoverHead(PlayerBase.Cast(action_data.m_Target.GetObject()),action_data.m_Player);
50  }
51  }
52 
53  bool IsWearingBurlap(PlayerBase player)
54  {
55  EntityAI attachment;
56  Class.CastTo(attachment, player.GetInventory().FindAttachment(InventorySlots.HEADGEAR));
57  if (attachment && attachment.GetType() == "BurlapSackCover")
58  {
59  return true;
60  }
61  return false;
62  }
63 };
ItemBase
Definition: inventoryitem.c:730
ActionUncoverHeadTarget
Definition: actionuncoverheadtarget.c:9
CAContinuousTime
Definition: cacontinuoustime.c:1
InventorySlots
provides access to slot configuration
Definition: inventoryslots.c:5
ContinuousInteractActionInput
Definition: actioninput.c:521
UncoverHead
void UncoverHead(PlayerBase target, PlayerBase source)
Definition: actionuncoverheadself.c:2
CCTMan
Definition: cctman.c:1
CCINone
Definition: ccinone.c:1
UAMaxDistances
Definition: actionconstants.c:104
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
ActionUncoverHeadBase
Definition: actionuncoverheadself.c:10
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
ActionUncoverHeadTargetCB
Definition: actionuncoverheadtarget.c:1
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
EntityAI
Definition: building.c:5
CanReceiveAction
bool CanReceiveAction(ActionTarget target)
Definition: actionbase.c:638