Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionforceabite.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CASingleUseQuantityEdible(UAQuantityConsumed.EAT_NORMAL);
6  }
7 };
8 
10 {
11  void ActionForceABite()
12  {
13  m_CallbackClass = ActionForceABiteCB;
14  m_Text = "#feed_a_bite";
15  }
16 
17  override void CreateConditionComponents()
18  {
21  }
22 
23  override void OnEndServer( ActionData action_data )
24  {
25  if ( action_data.m_MainItem.GetQuantity() <= 0 )
26  {
27  action_data.m_MainItem.SetQuantity(0);
28  }
29  }
30 
31  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
32  {
33  if (!super.ActionCondition( player, target, item))
34  return false;
35 
36  PlayerBase target_player = PlayerBase.Cast(target.GetObject());
37 
38  if (target_player)
39  return target_player.CanEatAndDrink();
40  else
41  return false;
42  }
43 
44 };
ItemBase
Definition: inventoryitem.c:730
CASingleUseQuantityEdible
Definition: casingleusequantityedible.c:1
CCTMan
Definition: cctman.c:1
UAQuantityConsumed
Definition: actionconstants.c:3
ActionForceConsumeSingle
void ActionForceConsumeSingle()
Definition: actionforceconsumesingle.c:13
ActionForceABiteCB
Definition: actionforceabite.c:1
ActionSingleUseBaseCB
Definition: actionsingleusebase.c:1
UAMaxDistances
Definition: actionconstants.c:104
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
ActionForceABite
Definition: actionforceabite.c:9
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56