Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionuncoverheadself.c
Go to the documentation of this file.
1
class
ActionUncoverHeadSelfCB
:
ActionContinuousBaseCB
2
{
3
override
void
CreateActionComponent
()
4
{
5
m_ActionData
.m_ActionComponent =
new
CAContinuousTime
(
UATimeSpent
.
COVER_HEAD
);
6
}
7
};
8
9
10
class
ActionUncoverHeadBase
:
ActionContinuousBase
11
{
12
void
UncoverHead
(
PlayerBase
target,
PlayerBase
source)
13
{
14
EntityAI
attachment;
15
if
(
Class
.
CastTo
(attachment, target.GetInventory().FindAttachment(
InventorySlots
.HEADGEAR)) && attachment.GetType() ==
"BurlapSackCover"
)
16
{
17
ItemBase
new_item = null;
18
if
(!source.GetEntityInHands())
19
{
20
new_item =
ItemBase
.Cast(
HumanInventory
.Cast(source.GetInventory()).
CreateInHands
(
"BurlapSack"
));
21
}
22
else
23
{
24
if
(!
Class
.
CastTo
(new_item,source.GetInventory().CreateInInventory(
"BurlapSack"
)))
//full inventory
25
{
26
vector
m4[4];
27
source.GetTransformWS(m4);
28
InventoryLocation
target_gnd =
new
InventoryLocation
;
29
target_gnd.
SetGround
(null, m4);
30
new_item =
ItemBase
.Cast(
GameInventory
.
LocationCreateEntity
(target_gnd,
"BurlapSack"
,
ECE_IN_INVENTORY
,
RF_DEFAULT
));
31
}
32
}
33
34
if
(new_item)
35
{
36
MiscGameplayFunctions.TransferItemProperties(attachment,new_item,
true
,
false
,
true
);
37
attachment.Delete();
38
}
39
}
40
}
41
42
}
43
44
class
ActionUncoverHeadSelf
:
ActionUncoverHeadBase
45
{
46
void
ActionUncoverHeadSelf
()
47
{
48
m_CallbackClass =
ActionUncoverHeadSelfCB
;
49
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_COVERHEAD_SELF;
50
m_StanceMask
=
DayZPlayerConstants
.STANCEMASK_ERECT |
DayZPlayerConstants
.STANCEMASK_CROUCH |
DayZPlayerConstants
.STANCEMASK_PRONE;
51
52
m_Text =
"#uncover_head"
;
53
}
54
55
override
void
CreateConditionComponents
()
56
{
57
m_ConditionItem =
new
CCINone
;
58
m_ConditionTarget =
new
CCTNone
;
59
}
60
61
override
bool
HasTarget
()
62
{
63
return
false
;
64
}
65
66
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item )
67
{
68
if
(
IsWearingBurlap
(player) )
69
return
true
;
70
71
return
false
;
72
}
73
74
override
void
OnFinishProgressServer
(
ActionData
action_data )
75
{
76
UncoverHead
(action_data.m_Player, action_data.m_Player);
77
}
78
79
80
bool
IsWearingBurlap
(
PlayerBase
player )
81
{
82
EntityAI
attachment;
83
Class
.
CastTo
(attachment, player.GetInventory().FindAttachment(
InventorySlots
.HEADGEAR));
84
if
( attachment && attachment.IsInherited(BurlapSackCover) )
85
{
86
return
true
;
87
}
88
return
false
;
89
}
90
};
m_CommandUID
int m_CommandUID
Definition
actionbase.c:31
m_StanceMask
int m_StanceMask
Definition
actionbase.c:33
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionTarget
class ActionTargets ActionTarget
IsWearingBurlap
bool IsWearingBurlap(PlayerBase player)
Definition
actionuncoverheadself.c:80
ActionUncoverHeadSelf
ActionUncoverHeadBase ActionContinuousBase ActionUncoverHeadSelf()
Definition
actionuncoverheadself.c:46
CreateConditionComponents
override void CreateConditionComponents()
Definition
actionuncoverheadself.c:55
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionuncoverheadself.c:66
HasTarget
override bool HasTarget()
Definition
actionuncoverheadself.c:61
ECE_IN_INVENTORY
const int ECE_IN_INVENTORY
Definition
centraleconomy.c:36
RF_DEFAULT
const int RF_DEFAULT
Definition
centraleconomy.c:65
ActionBaseCB::m_ActionData
ActionData m_ActionData
Definition
animatedactionbase.c:3
ActionContinuousBaseCB
Definition
actioncontinuousbase.c:2
ActionContinuousBase::OnFinishProgressServer
void OnFinishProgressServer(ActionData action_data)
Definition
actioncontinuousbase.c:283
ActionContinuousBase::ActionContinuousBase
void ActionContinuousBase()
Definition
actioncontinuousbase.c:124
ActionUncoverHeadBase
Definition
actionuncoverheadself.c:11
ActionUncoverHeadBase::UncoverHead
void UncoverHead(PlayerBase target, PlayerBase source)
Definition
actionuncoverheadself.c:12
ActionUncoverHeadSelfCB
Definition
actionuncoverheadself.c:2
ActionUncoverHeadSelfCB::CreateActionComponent
override void CreateActionComponent()
Definition
actionuncoverheadself.c:3
CAContinuousTime
Definition
cacontinuoustime.c:2
CCINone
Definition
ccinone.c:2
CCTNone
Definition
cctnone.c:2
Class
Super root of all classes in Enforce script.
Definition
enscript.c:11
EntityAI
Definition
inventoryitem.c:2
GameInventory
script counterpart to engine's class Inventory
Definition
inventory.c:81
GameInventory::LocationCreateEntity
static proto native EntityAI LocationCreateEntity(notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
HumanInventory
inventory for plain man/human
Definition
humaninventory.c:10
HumanInventory::CreateInHands
proto native EntityAI CreateInHands(string typeName)
InventoryLocation
InventoryLocation.
Definition
inventorylocation.c:30
InventoryLocation::SetGround
proto native void SetGround(EntityAI e, vector mat[4])
InventorySlots
provides access to slot configuration
Definition
inventoryslots.c:6
ItemBase
Definition
inventoryitem.c:742
PlayerBase
Definition
playerbaseclient.c:2
UATimeSpent
Definition
actionconstants.c:28
UATimeSpent::COVER_HEAD
const float COVER_HEAD
Definition
actionconstants.c:55
vector
Definition
enconvert.c:119
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:602
Class::CastTo
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
continuous
actionuncoverheadself.c
Generated by
1.17.0