Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionungagself.c
Go to the documentation of this file.
1
class
ActionUngagSelf
:
ActionContinuousBase
2
{
3
void
ActionUngagSelf
()
4
{
5
m_CallbackClass
=
ActionUncoverHeadSelfCB
;
6
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_COVERHEAD_SELF;
7
m_StanceMask
=
DayZPlayerConstants
.STANCEMASK_ERECT |
DayZPlayerConstants
.STANCEMASK_CROUCH;
8
m_Text
=
"#ungag"
;
9
}
10
11
override
void
CreateConditionComponents
()
12
{
13
m_ConditionItem
=
new
CCINone
;
14
m_ConditionTarget
=
new
CCTNone
;
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.GetEntityInHands())
25
return
true
;
26
27
return
false
;
28
}
29
30
override
void
OnFinishProgressServer
(
ActionData
action_data )
31
{
32
EntityAI
attachment;
33
Class
.
CastTo
(attachment, action_data.m_Player.GetInventory().FindAttachment(
InventorySlots
.MASK));
34
if
( attachment && attachment.GetType() ==
"MouthRag"
)
35
{
36
UngagSelfLambda
lamb =
new
UngagSelfLambda
(attachment,
"Rag"
, action_data.m_Player);
37
lamb.SetTransferParams(
true
,
true
,
true
,
false
, 1);
38
action_data.m_Player.ServerReplaceItemElsewhereWithNewInHands(lamb);
39
}
40
}
41
42
bool
IsWearingGag
(
PlayerBase
player )
43
{
44
EntityAI
attachment;
45
Class
.
CastTo
(attachment, player.GetInventory().FindAttachment(
InventorySlots
.MASK));
46
if
( attachment && attachment.GetType() ==
"MouthRag"
)
47
{
48
return
true
;
49
}
50
return
false
;
51
}
52
};
53
54
class
UngagSelfLambda
:
TurnItemIntoItemLambda
55
{
56
MouthRag
gag
;
57
EntityAI
m_OriginalOwner
;
58
59
void
UngagSelfLambda
(
EntityAI
old_item,
string
new_item_type,
PlayerBase
player)
60
{
61
gag
= MouthRag.Cast(m_OldItem);
62
if
(
gag
)
63
gag
.SetIncomingLambaBool(
true
);
64
InventoryLocation
targetHnd =
new
InventoryLocation
;
65
targetHnd.
SetHands
(player, null);
66
OverrideNewLocation(targetHnd);
67
m_OriginalOwner
= m_OldItem.GetHierarchyRoot();
68
}
69
70
override
void
OnSuccess
(
EntityAI
new_item)
71
{
72
super.OnSuccess(new_item);
73
74
PlayerBase
player;
75
if
(
Class
.
CastTo
(player,
m_OriginalOwner
))
76
{
77
player.CheckForGag();
78
}
79
}
80
81
override
void
OnAbort
()
82
{
83
if
(
gag
)
84
gag
.SetIncomingLambaBool(
false
);
85
}
86
};
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionTarget
class ActionTargets ActionTarget
ActionBase::m_Text
string m_Text
Definition
actionbase.c:64
ActionBase::m_ConditionItem
ref CCIBase m_ConditionItem
Definition
actionbase.c:70
ActionBase::m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
actionbase.c:71
ActionBase::m_StanceMask
int m_StanceMask
Definition
actionbase.c:68
ActionContinuousBase::ActionContinuousBase
void ActionContinuousBase()
Definition
actioncontinuousbase.c:124
ActionUncoverHeadSelfCB
Definition
actionuncoverheadself.c:2
ActionUngagSelf::OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition
actionungagself.c:30
ActionUngagSelf::CreateConditionComponents
override void CreateConditionComponents()
Definition
actionungagself.c:11
ActionUngagSelf::ActionUngagSelf
void ActionUngagSelf()
Definition
actionungagself.c:3
ActionUngagSelf::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionungagself.c:22
ActionUngagSelf::HasTarget
override bool HasTarget()
Definition
actionungagself.c:17
ActionUngagSelf::IsWearingGag
bool IsWearingGag(PlayerBase player)
Definition
actionungagself.c:42
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
animatedactionbase.c:143
AnimatedActionBase::m_CallbackClass
m_CallbackClass
Definition
animatedactionbase.c:145
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
InventoryLocation
InventoryLocation.
Definition
inventorylocation.c:30
InventoryLocation::SetHands
proto native void SetHands(notnull EntityAI parent, EntityAI e)
InventorySlots
provides access to slot configuration
Definition
inventoryslots.c:6
ItemBase
Definition
inventoryitem.c:742
PlayerBase
Definition
playerbaseclient.c:2
TurnItemIntoItemLambda
Definition
miscgameplayfunctions.c:92
UngagSelfLambda
Definition
actionungagself.c:55
UngagSelfLambda::OnSuccess
override void OnSuccess(EntityAI new_item)
Definition
actionungagself.c:70
UngagSelfLambda::gag
MouthRag gag
Definition
actionungagself.c:56
UngagSelfLambda::OnAbort
override void OnAbort()
Definition
actionungagself.c:81
UngagSelfLambda::m_OriginalOwner
EntityAI m_OriginalOwner
Definition
actionungagself.c:57
UngagSelfLambda::UngagSelfLambda
void UngagSelfLambda(EntityAI old_item, string new_item_type, PlayerBase player)
Definition
actionungagself.c:59
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
actionungagself.c
Generated by
1.17.0