Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actioneatfruit.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousQuantityEdible(UAQuantityConsumed.EAT_NORMAL,UATimeSpent.DEFAULT);
6  }
7 };
8 
10 {
11  void ActionEatFruit()
12  {
13  m_CallbackClass = ActionEatFruitCB;
14  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_EAT;
15  m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_EAT;
16  }
17 
18  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
19  {
20  if (!super.ActionCondition(player, target, item))
21  return false;
22  Edible_Base food_item;
23 
24  if ( Class.CastTo(food_item, item) )
25  {
26  if ( food_item.IsFruit() )
27  return true;
28  }
29 
30  return false;
31  }
32 }
ItemBase
Definition: inventoryitem.c:730
ActionEatFruit
Definition: actioneatfruit.c:9
UAQuantityConsumed
Definition: actionconstants.c:3
ActionEatBig
Definition: actioneat.c:9
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CAContinuousQuantityEdible
Definition: cacontinuousquantityedible.c:1
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
ActionEatFruitCB
Definition: actioneatfruit.c:1
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
Edible_Base
Definition: bearsteakmeat.c:1