Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actiondropitem.c
Go to the documentation of this file.
2 {
3  override void EndActionComponent()
4  {
5  SetCommand(DayZPlayerConstants.CMD_ACTIONINT_END);
6  m_ActionData.m_State = UA_FINISHED;
7  }
8 }
9 
11 {
12  string m_ItemName = "";
13 
15  {
16  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_DROPITEM_HANDS;
17  m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_DROPITEM_HANDS;
18  m_CallbackClass = ActionDropItemCB;
19  m_Text = "#drop_item";
20  }
21 
22  override void CreateConditionComponents()
23  {
24  m_ConditionItem = new CCINone();
25  m_ConditionTarget = new CCTNone();
26  }
27 
28  override typename GetInputType()
29  {
30  return DropActionInput;
31  }
32 
33  override bool HasProneException()
34  {
35  return true;
36  }
37 
38  override bool CanBeUsedThrowing()
39  {
40  return true;
41  }
42 
43  override bool HasTarget()
44  {
45  return false;
46  }
47 
48  override bool UseAcknowledgment()
49  {
50  return false;
51  }
52 
53  override bool ActionConditionContinue(ActionData action_data)
54  {
55  return true;
56  }
57 
58  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
59  {
60  HumanCommandMove hcm = player.GetCommand_Move();
61  if (hcm && hcm.IsChangingStance())
62  return false;
63 
64  if (player.GetCommand_Vehicle())
65  return false;
66 
67  return player && item;
68  }
69 
70  override void OnExecuteServer(ActionData action_data)
71  {
72  if (action_data.m_Player.IsPlacingServer())
73  action_data.m_Player.PlacingCancelServer();
74 
75  if (!GetGame().IsMultiplayer())
76  PhysicalDropItem(action_data);
77  }
78 
79  override void OnExecuteClient(ActionData action_data)
80  {
81  super.OnExecuteClient(action_data);
82 
83  PhysicalDropItem(action_data);
84  }
85 
86  void PhysicalDropItem( ActionData action_data )
87  {
88  action_data.m_Player.PhysicalPredictiveDropItem(action_data.m_Player.GetItemInHands());
89  }
90 }
ItemBase
Definition: inventoryitem.c:730
GetGame
proto native CGame GetGame()
ActionDropItemCB
Definition: actiondropitem.c:1
CreateConditionComponents
override void CreateConditionComponents()
Definition: actiondropitem.c:22
PhysicalDropItem
void PhysicalDropItem(ActionData action_data)
Definition: actiondropitem.c:86
CCINone
Definition: ccinone.c:1
CCTNone
Definition: cctnone.c:1
OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition: actiondropitem.c:70
ActionSingleUseBaseCB
Definition: actionsingleusebase.c:1
HasProneException
override bool HasProneException()
Definition: actiondropitem.c:33
OnExecuteClient
override void OnExecuteClient(ActionData action_data)
Definition: actiondropitem.c:79
HasTarget
override bool HasTarget()
Definition: actiondropitem.c:43
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actiondropitem.c:58
GetInputType
override GetInputType()
Definition: actiondropitem.c:28
PlayerBase
Definition: playerbaseclient.c:1
UA_FINISHED
const int UA_FINISHED
Definition: constants.c:436
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
HumanCommandMove
Definition: human.c:433
m_Text
protected string m_Text
Definition: actionbase.c:49
ActionSingleUseBase
Definition: actionsingleusebase.c:41
ActionConditionContinue
override bool ActionConditionContinue(ActionData action_data)
Definition: actiondropitem.c:53
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
DropActionInput
Definition: actioninput.c:650
ActionDropItem
void ActionDropItem()
Definition: actiondropitem.c:14
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
CanBeUsedThrowing
override bool CanBeUsedThrowing()
Definition: actiondropitem.c:38
m_ItemName
ActionDropItemCB m_ItemName
UseAcknowledgment
override bool UseAcknowledgment()
Definition: actiondropitem.c:48