Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actioneat.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousQuantityEdible(UAQuantityConsumed.EAT_BIG, UATimeSpent.DEFAULT);
6  }
7 };
8 
10 {
11  void ActionEatBig()
12  {
13  m_CallbackClass = ActionEatBigCB;
14  //m_Sound = "EatingSoft_0";
15  m_Text = "#eat";
16  }
17 
18  override void CreateConditionComponents()
19  {
22  }
23 
24  override int IsEat()
25  {
26  return true;
27  }
28 
29  override bool HasTarget()
30  {
31  return false;
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 player.CanEatAndDrink();
41  }
42 
43  override void OnEndServer( ActionData action_data )
44  {
45  super.OnEndServer(action_data);
46 
47  if ( action_data.m_Player.HasBloodyHandsEx() == eBloodyHandsTypes.SALMONELA && !action_data.m_Player.GetInventory().FindAttachment( InventorySlots.GLOVES ) && GetProgress(action_data) > 0 )
48  {
49  action_data.m_Player.SetBloodyHandsPenalty();
50  }
51  }
52 };
53 
54 
55 //-------------- Action Eat
57 {
58  override void CreateActionComponent()
59  {
60  m_ActionData.m_ActionComponent = new CAContinuousQuantityEdible(UAQuantityConsumed.EAT_NORMAL, UATimeSpent.DEFAULT);
61  }
62 };
63 
65 {
66  void ActionEat()
67  {
68  m_CallbackClass = ActionEatCB;
69  }
70 
71 
72 };
73 
74 //-------------- Action Eat Small
76 {
77  override void CreateActionComponent()
78  {
79  m_ActionData.m_ActionComponent = new CAContinuousQuantityEdible(UAQuantityConsumed.EAT_SMALL, UATimeSpent.DEFAULT);
80  }
81 };
82 
84 {
85  void ActionEatSmall()
86  {
87  m_CallbackClass = ActionEatSmallCB;
88  }
89 };
ItemBase
Definition: inventoryitem.c:730
ActionEatCB
Definition: actioneat.c:56
GetProgress
float GetProgress(ActionData action_data)
Definition: actionbase.c:1061
ActionEat
Definition: actioneat.c:64
InventorySlots
provides access to slot configuration
Definition: inventoryslots.c:5
eBloodyHandsTypes
eBloodyHandsTypes
Definition: pluginlifespan.c:8
UAQuantityConsumed
Definition: actionconstants.c:3
ActionEatBig
Definition: actioneat.c:9
ActionEatBigCB
Definition: actioneat.c:1
ActionConsume
Definition: actionconsume.c:9
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
CCTSelf
Definition: cctself.c:1
CAContinuousQuantityEdible
Definition: cacontinuousquantityedible.c:1
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
ActionEatSmallCB
Definition: actioneat.c:75
ActionEatSmall
Definition: actioneat.c:83
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