Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actiondetach.c
Go to the documentation of this file.
1
class
DetachActionData
:
ActionData
2
{
3
int
m_AttSlot
;
4
}
5
6
class
ActionDetach
:
ActionInteractBase
7
{
8
string
m_ItemName
=
""
;
9
10
void
ActionDetach
()
11
{
12
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_PICKUP_HANDS;
13
m_CommandUIDProne
=
DayZPlayerConstants
.CMD_ACTIONFB_PICKUP_HANDS;
14
m_Text =
"#take_to_hands"
;
15
}
16
17
override
void
CreateConditionComponents
()
18
{
19
m_ConditionItem =
new
CCINone
;
20
m_ConditionTarget =
new
CCTCursorNoRuinCheck
();
21
}
22
23
override
bool
HasProneException
()
24
{
25
return
true
;
26
}
27
28
override
typename
GetInputType
()
29
{
30
return
ContinuousInteractActionInput
;
31
}
32
33
override
bool
HasProgress
()
34
{
35
return
false
;
36
}
37
38
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item )
39
{
40
ItemBase
tgt_item =
ItemBase
.Cast( target.GetObject() );
41
EntityAI
tgt_parent =
EntityAI
.Cast( target.GetParent() );
42
EntityAI
tgt_entity =
EntityAI
.Cast( target.GetObject() );
43
44
if
( !tgt_item || !tgt_entity || !tgt_parent )
45
return
false
;
46
47
if
( !tgt_parent || !tgt_item.IsItemBase() || !tgt_item.
IsTakeable
() || tgt_item.IsBeingPlaced() )
48
return
false
;
49
50
if
( player.GetCommand_Vehicle() )
51
return
false
;
52
53
if
( player.GetInventory().CanAddEntityIntoHands(tgt_entity) )
//&& !player.GetInventory().CanAddEntityIntoInventory(tgt_entity) )
54
{
55
if
( tgt_entity.GetHierarchyRootPlayer() != player )
56
{
57
if
( tgt_entity.CanDetachAttachment( tgt_parent ) && tgt_parent.CanReleaseAttachment( tgt_entity ) )
58
return
true
;
59
}
60
}
61
62
return
false
;
63
}
64
65
override
void
OnExecute
(
ActionData
action_data )
66
{
67
if
(
g_Game
.IsDedicatedServer())
68
{
69
ClearActionJuncture
(action_data);
70
return
;
71
}
72
73
ActionManagerClient
am =
ActionManagerClient
.Cast(action_data.m_Player.GetActionManager());
74
am.
UnlockInventory
(action_data);
75
76
EntityAI
ntarget =
EntityAI
.Cast(action_data.m_Target.GetObject());
77
action_data.m_Player.PredictiveTakeEntityToHands(ntarget);
78
}
79
80
override
void
CreateAndSetupActionCallback
(
ActionData
action_data )
81
{
82
EntityAI
target =
EntityAI
.Cast(action_data.m_Target.GetObject());
83
ActionBaseCB
callback;
84
if
(!target)
85
return
;
86
87
if
(target.IsHeavyBehaviour())
88
{
89
Class
.
CastTo
(callback, action_data.m_Player.StartCommand_Action(
DayZPlayerConstants
.CMD_ACTIONFB_PICKUP_HEAVY,GetCallbackClassTypename(),
DayZPlayerConstants
.STANCEMASK_ERECT));
90
}
91
else
92
{
93
if
( action_data.m_Player.IsPlayerInStance(
DayZPlayerConstants
.STANCEMASK_CROUCH |
DayZPlayerConstants
.STANCEMASK_ERECT) )
94
{
95
Class
.
CastTo
(callback, action_data.m_Player.AddCommandModifier_Action(
DayZPlayerConstants
.CMD_ACTIONMOD_PICKUP_HANDS,GetCallbackClassTypename()));
96
}
97
else
98
{
99
Class
.
CastTo
(callback, action_data.m_Player.StartCommand_Action(
DayZPlayerConstants
.CMD_ACTIONFB_PICKUP_HANDS,GetCallbackClassTypename(),
DayZPlayerConstants
.STANCEMASK_PRONE));
100
}
101
}
102
callback.
SetActionData
(action_data);
103
callback.
InitActionComponent
();
104
action_data.m_Callback = callback;
105
}
106
};
m_CommandUIDProne
int m_CommandUIDProne
Definition
actionbase.c:32
m_CommandUID
int m_CommandUID
Definition
actionbase.c:31
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionDetach
void ActionDetach()
Definition
actiondetach.c:10
m_ItemName
DetachActionData m_ItemName
ActionTarget
class ActionTargets ActionTarget
ActionBaseCB
Definition
animatedactionbase.c:2
ActionBaseCB::InitActionComponent
void InitActionComponent()
Definition
animatedactionbase.c:66
ActionBaseCB::SetActionData
void SetActionData(ActionData action_data)
Definition
animatedactionbase.c:109
ActionBase::ClearActionJuncture
void ClearActionJuncture(ActionData action_data)
Definition
actionbase.c:1104
ActionBase::HasProgress
bool HasProgress()
For UI: hiding of progress bar.
Definition
actionbase.c:256
ActionInteractBase
Definition
actioninteractbase.c:39
ActionInteractBase::CreateConditionComponents
override void CreateConditionComponents()
Definition
actioninteractbase.c:49
ActionInteractBase::GetInputType
override GetInputType()
Definition
actioninteractbase.c:61
ActionManagerClient
Definition
actionmanagerclient.c:5
ActionManagerClient::UnlockInventory
void UnlockInventory(ActionData action_data)
Definition
actionmanagerclient.c:588
AnimatedActionBase::CreateAndSetupActionCallback
void CreateAndSetupActionCallback(ActionData action_data)
Definition
animatedactionbase.c:324
AnimatedActionBase::OnExecute
void OnExecute(ActionData action_data)
Definition
animatedactionbase.c:171
AnimatedActionBase::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
animatedactionbase.c:240
AnimatedActionBase::HasProneException
override bool HasProneException()
Definition
animatedactionbase.c:318
CCINone
Definition
ccinone.c:2
CCTCursorNoRuinCheck
Definition
cctcursornoruincheck.c:2
Class
Super root of all classes in Enforce script.
Definition
enscript.c:11
ContinuousInteractActionInput
Definition
actioninput.c:523
DetachActionData
Definition
actiondetach.c:2
DetachActionData::m_AttSlot
int m_AttSlot
Definition
actiondetach.c:3
EntityAI
Definition
inventoryitem.c:2
ItemBase
Definition
inventoryitem.c:742
ItemBase::IsTakeable
override bool IsTakeable()
Definition
basebuildingbase.c:1008
PlayerBase
Definition
playerbaseclient.c:2
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
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
interact
actiondetach.c
Generated by
1.17.0