Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionforceconsume.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousQuantityEdible(UAQuantityConsumed.DEFAULT, UATimeSpent.DEFAULT);
6  }
7 }
8 
10 {
12  {
13  m_CallbackClass = ActionForceConsumeCB;
14  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_FORCEFEED;
15  m_StanceMask = DayZPlayerConstants.STANCEIDX_ERECT | DayZPlayerConstants.STANCEIDX_CROUCH;
16  m_FullBody = true;
17  m_Text = "#feed";
18  }
19 
20  override void CreateConditionComponents()
21  {
24  }
25 
26  override void OnEndServer(ActionData action_data)
27  {
28  if (action_data.m_MainItem && (action_data.m_MainItem.GetQuantity() <= 0.01))
29  {
30  action_data.m_MainItem.SetQuantity(0);
31  }
32 
33  }
34 
35  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
36  {
37  if (!super.ActionCondition(player, target, item))
38  return false;
39 
40  return item.GetQuantity() > item.GetQuantityMin();
41  }
42 }
ItemBase
Definition: inventoryitem.c:730
ActionForceConsume
ActionForceConsumeCB ActionContinuousBaseCB ActionForceConsume()
Definition: actionforceconsume.c:11
CCTMan
Definition: cctman.c:1
UAQuantityConsumed
Definition: actionconstants.c:3
ActionForceConsumeCB
Definition: actionforceconsume.c:1
UAMaxDistances
Definition: actionconstants.c:104
CreateConditionComponents
override void CreateConditionComponents()
Definition: actionforceconsume.c:20
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CAContinuousQuantityEdible
Definition: cacontinuousquantityedible.c:1
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionContinuousBase
Definition: actioncontinuousbase.c:132
CCINonRuined
Definition: ccinonruined.c:1
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionforceconsume.c:35
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
OnEndServer
override void OnEndServer(ActionData action_data)
Definition: actionforceconsume.c:26
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53