DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionUncoverHeadTarget.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
6 }
7};
8
10{
12 {
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
21 {
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
45
46 override void OnFinishProgressServer( ActionData action_data )
47 {
48 PlayerBase targetPlayer = PlayerBase.Cast(action_data.m_Target.GetObject());
49 if (CanReceiveAction(action_data.m_Target))
50 {
51 UncoverHead(PlayerBase.Cast( action_data.m_Target.GetObject()),action_data.m_Player);
52 }
53 }
54
55
57 {
58 EntityAI attachment;
59 Class.CastTo(attachment, player.GetInventory().FindAttachment(InventorySlots.HEADGEAR));
60 if ( attachment && attachment.GetType() == "BurlapSackCover" )
61 {
62 return true;
63 }
64 return false;
65 }
66};
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool CanReceiveAction(ActionTarget target)
Definition ActionBase.c:637
protected string m_Text
Definition ActionBase.c:49
protected bool m_FullBody
Definition ActionBase.c:52
protected int m_StanceMask
Definition ActionBase.c:53
class ActionTargets ActionTarget
protected ActionData m_ActionData
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
ref ActionTarget m_Target
Definition ActionBase.c:32
void UncoverHead(PlayerBase target, PlayerBase source)
override void OnFinishProgressServer(ActionData action_data)
bool IsWearingBurlap(PlayerBase player)
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition CCTMan.c:2
Super root of all classes in Enforce script.
Definition EnScript.c:11
provides access to slot configuration
const float DEFAULT
const float COVER_HEAD
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.