DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionEatFruit.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
6 }
7};
8
10{
12 {
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}
class ActionTargets ActionTarget
protected ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
override void CreateActionComponent()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
protected int m_CommandUIDProne
Super root of all classes in Enforce script.
Definition EnScript.c:11
override bool IsFruit()
Definition CaninaBerry.c:13
const float EAT_NORMAL
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.