Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionforcefeed.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 {
12  {
13  m_CallbackClass = ActionForceFeedCB;
14  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_FORCEFEED;
15  m_FullBody = true;
16  m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
17  m_Text = "#feed";
18  }
19 
20  override void CreateConditionComponents()
21  {
24  }
25 
26 
27  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
28  {
29  if (!super.ActionCondition(player, target, item))
30  return false;
31 
32  PlayerBase targetPlayer = PlayerBase.Cast(target.GetObject());
33 
34  return targetPlayer && targetPlayer.CanEatAndDrink();
35  }
36 
37 
38  override void OnEndServer(ActionData action_data)
39  {
40  super.OnEndServer(action_data);
41 
42  if (action_data.m_Player.HasBloodyHands() && !action_data.m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES))
43  {
44  Object targetPlayer = action_data.m_Target.GetObject();
45  PlayerBase target = PlayerBase.Cast(targetPlayer);
46  if (target)
47  {
48  target.SetBloodyHandsPenalty();
49  }
50  }
51  }
52 };
53 
54 
55 //-----------------SMALL BITES VARIANT-------------------
56 
58 {
59  override void CreateActionComponent()
60  {
61  m_ActionData.m_ActionComponent = new CAContinuousQuantityEdible(UAQuantityConsumed.EAT_NORMAL,UATimeSpent.DEFAULT);
62  }
63 };
64 
66 {
67  void ActionForceFeed()
68  {
69  m_CallbackClass = ActionForceFeedSmallCB;
70  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_FORCEFEED;
71  m_FullBody = true;
72  m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
73  }
74 
75  override void CreateConditionComponents()
76  {
79  }
80 
81  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
82  {
83  if (!super.ActionCondition(player, target, item))
84  return false;
85 
86  PlayerBase targetPlayer = PlayerBase.Cast(target.GetObject());
87 
88  return targetPlayer && targetPlayer.CanEatAndDrink();
89  }
90 
91 
92  override string GetText()
93  {
94  return "#feed";
95  }
96 }
ItemBase
Definition: inventoryitem.c:730
CreateConditionComponents
override void CreateConditionComponents()
Definition: actionforcefeed.c:20
ActionForceFeedCB
Definition: actionforcefeed.c:1
InventorySlots
provides access to slot configuration
Definition: inventoryslots.c:5
CCTMan
Definition: cctman.c:1
UAQuantityConsumed
Definition: actionconstants.c:3
UAMaxDistances
Definition: actionconstants.c:104
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionforcefeed.c:27
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
Object
Definition: objecttyped.c:1
ActionForceFeedSmallCB
Definition: actionforcefeed.c:57
ActionForceConsume
ActionForceDrinkCB ActionForceConsume
CAContinuousQuantityEdible
Definition: cacontinuousquantityedible.c:1
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
OnEndServer
override void OnEndServer(ActionData action_data)
Definition: actionforcefeed.c:38
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionForceFeed
ActionForceFeedSmallCB ActionForceFeed
Definition: actionforcefeed.c:11
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
ActionForceFeedSmall
Definition: actionforcefeed.c:65