Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actiondropitem.c
Go to the documentation of this file.
1
class
ActionDropItemCB
:
ActionSingleUseBaseCB
2
{
3
override
void
CreateActionComponent
()
4
{
5
super.CreateActionComponent();
6
EnableCancelCondition
(
true
);
7
}
8
9
override
void
EndActionComponent
()
10
{
11
SetCommand
(
DayZPlayerConstants
.CMD_ACTIONINT_END);
12
m_ActionData
.m_State =
UA_FINISHED
;
13
}
14
15
bool
CancelCondition
()
16
{
17
HumanMovementState
ms =
new
HumanMovementState
();
18
m_ActionData
.m_Player.GetMovementState(ms);
19
if
(ms.
m_CommandTypeId
==
DayZPlayerConstants
.COMMANDID_MOVE)
20
{
21
// Cancel action, if hands are raised
22
if
(ms.
IsRaised
())
23
return
true
;
24
}
25
26
return
false
;
27
}
28
}
29
30
class
ActionDropItem
:
ActionSingleUseBase
31
{
32
string
m_ItemName
=
""
;
33
34
void
ActionDropItem
()
35
{
36
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_DROPITEM_HANDS;
37
m_CommandUIDProne
=
DayZPlayerConstants
.CMD_ACTIONFB_DROPITEM_HANDS;
38
m_CallbackClass =
ActionDropItemCB
;
39
m_Text =
"#drop_item"
;
40
}
41
42
override
void
CreateConditionComponents
()
43
{
44
m_ConditionItem =
new
CCINone
();
45
m_ConditionTarget =
new
CCTNone
();
46
}
47
48
override
typename
GetInputType
()
49
{
50
return
DropActionInput
;
51
}
52
53
override
bool
HasProneException
()
54
{
55
return
true
;
56
}
57
58
override
bool
CanBeUsedThrowing
()
59
{
60
return
true
;
61
}
62
64
override
bool
CanBePerformedWhileChangingStance
()
65
{
66
return
false
;
67
}
68
69
override
bool
HasTarget
()
70
{
71
return
false
;
72
}
73
74
override
bool
UseAcknowledgment
()
75
{
76
return
false
;
77
}
78
79
override
bool
ActionConditionContinue
(
ActionData
action_data)
80
{
81
return
true
;
82
}
83
84
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item)
85
{
86
if
(!player || !item)
87
return
false
;
88
89
HumanInputController
hic = player.GetInputController();
90
HumanCommandMove
hcm = player.GetCommand_Move();
91
93
if
(hic && (hic.
IsStanceChange
() || hic.
IsThrowingModeChange
()))
94
return
false
;
95
97
if
(hcm && (hcm.
IsChangingStance
() || hcm.
IsStandingFromBack
()))
98
return
false
;
99
100
return
true
;
101
}
102
103
override
void
OnExecuteServer
(
ActionData
action_data)
104
{
105
if
(action_data.m_Player.IsPlacingServer())
106
action_data.m_Player.PlacingCancelServer();
107
108
ClearInventoryReservationEx(action_data);
109
110
if
(
g_Game
.IsServer() &&
g_Game
.IsMultiplayer())
111
{
112
action_data.m_Player.ServerDropEntity(action_data.m_Player.GetItemInHands());
// multiplayer server side
113
}
114
else
115
{
116
PhysicalDropItem
(action_data);
// single player or multiplayer client side
117
}
118
}
119
120
void
PhysicalDropItem
(
ActionData
action_data)
121
{
122
action_data.m_Player.PhysicalPredictiveDropItem(action_data.m_Player.GetItemInHands());
123
}
124
}
CreateConditionComponents
override void CreateConditionComponents()
Definition
actionactivatetrap.c:30
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionactivatetrap.c:46
ActionConditionContinue
override bool ActionConditionContinue(ActionData action_data)
Definition
actionattachexplosivestrigger.c:27
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
m_ItemName
DetachActionData m_ItemName
HasProneException
override bool HasProneException()
Definition
actiondialcombinationlock.c:28
OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition
actiondigoutstash.c:57
PhysicalDropItem
void PhysicalDropItem(ActionData action_data)
Definition
actiondropitem.c:120
ActionDropItem
void ActionDropItem()
Definition
actiondropitem.c:34
CanBeUsedThrowing
override bool CanBeUsedThrowing()
Definition
actiondropitem.c:58
UseAcknowledgment
override bool UseAcknowledgment()
Definition
actiondropitem.c:74
CanBePerformedWhileChangingStance
override bool CanBePerformedWhileChangingStance()
Prevent this action from beeing performed while changing stance.
Definition
actiondropitem.c:64
HasTarget
override bool HasTarget()
Definition
actioninput.c:473
GetInputType
override GetInputType()
Definition
actionsequentialbase.c:32
ActionTarget
class ActionTargets ActionTarget
ActionBaseCB::SetCommand
void SetCommand(int command_uid)
Definition
animatedactionbase.c:54
ActionBaseCB::m_ActionData
ActionData m_ActionData
Definition
animatedactionbase.c:3
ActionDropItemCB
Definition
actiondropitem.c:2
ActionDropItemCB::CancelCondition
bool CancelCondition()
Definition
actiondropitem.c:15
ActionDropItemCB::CreateActionComponent
override void CreateActionComponent()
Definition
actiondropitem.c:3
ActionDropItemCB::EndActionComponent
override void EndActionComponent()
Definition
actiondropitem.c:9
ActionSingleUseBaseCB
Definition
actionsingleusebase.c:2
ActionSingleUseBase
Definition
actionsingleusebase.c:30
CCINone
Definition
ccinone.c:2
CCTNone
Definition
cctnone.c:2
DropActionInput
Definition
actioninput.c:652
HumanCommandMove
Definition
human.c:434
HumanCommandMove::IsStandingFromBack
proto native bool IsStandingFromBack()
return true if prone on back is chaning to crounch/stand
HumanCommandMove::IsChangingStance
proto native bool IsChangingStance()
returns true if character is changing stance
HumanInputController
Definition
human.c:18
HumanInputController::IsStanceChange
proto native bool IsStanceChange()
stance change button was pressed
HumanInputController::IsThrowingModeChange
proto native bool IsThrowingModeChange()
returns true if change of throwing mode has been requested
HumanMovementState
Definition
human.c:1154
HumanMovementState::IsRaised
bool IsRaised()
Definition
human.c:1163
HumanMovementState::m_CommandTypeId
int m_CommandTypeId
Definition
human.c:1155
ItemBase
Definition
inventoryitem.c:742
PlayerBase
Definition
playerbaseclient.c:2
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:602
UA_FINISHED
const int UA_FINISHED
Definition
constants.c:469
EnableCancelCondition
proto native void EnableCancelCondition(bool pEnable)
enables calling cancel condition default is disabled when enabled - there must be a function "bool Ca...
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
singleuse
actiondropitem.c
Generated by
1.17.0