DayZ 1.24
Loading...
Searching...
No Matches
ActionConsume.c
Go to the documentation of this file.
8
10{
12 {
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_EAT;
15 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_EAT;
16
17 m_Text = "#eat";
18 }
19
20 override bool HasProneException()
21 {
22 return true;
23 }
24
25 override bool HasTarget()
26 {
27 return false;
28 }
29
35
37 {
38 ItemBase item = action_data.m_MainItem;
39
40 if (item && item.GetQuantity() <= 0.01)
41 item.SetQuantity(0);
42 else if (item && GetProgress(action_data) > 0)
43 {
44 // we don't want to inject an agent into an empty container
45 PlayerBase player = action_data.m_Player;
46 PluginTransmissionAgents plugin = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
47 plugin.TransmitAgents(player, item, AGT_UACTION_TO_ITEM);
48 }
49 }
50};
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
PluginBase GetPlugin(typename plugin_type)
ActionData m_ActionData
override void CreateActionComponent()
void ActionConsume()
override void OnEndServer(ActionData action_data)
override bool HasTarget()
override bool HasProneException()
override void CreateConditionComponents()
ref CABase m_ActionComponent
Definition ActionBase.c:30
override float GetProgress(ActionData action_data)
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
const int AGT_UACTION_TO_ITEM
Definition constants.c:474