DayZ 1.24
Loading...
Searching...
No Matches
ActionForceFeed.c
Go to the documentation of this file.
2{
7}
8
9class ActionForceFeed: ActionForceConsume
10{
11 void ActionForceFeed()
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
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
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();
46 if (target)
47 target.SetBloodyHandsPenalty();
48 }
49 }
50};
51
52
53//-----------------SMALL BITES VARIANT-------------------
54
62
63class ActionForceFeedSmall: ActionForceConsume
64{
66 {
67 m_CallbackClass = ActionForceFeedSmallCB;
68 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_FORCEFEED;
69 m_FullBody = true;
70 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
71 }
72
78
79 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
80 {
81 if (!super.ActionCondition(player, target, item))
82 return false;
83
84 PlayerBase targetPlayer = PlayerBase.Cast(target.GetObject());
85
86 return targetPlayer && targetPlayer.CanEatAndDrink();
87 }
88
89
90 override string GetText()
91 {
92 return "#feed";
93 }
94}
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
void CreateConditionComponents()
Definition ActionBase.c:196
void OnEndServer(ActionData action_data)
Definition ActionBase.c:962
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition ActionBase.c:350
int m_StanceMask
Definition ActionBase.c:53
ActionForceFeedSmallCB ActionForceFeed
ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
override void CreateActionComponent()
override void CreateActionComponent()
override string GetText()
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition CCTMan.c:2
provides access to slot configuration
const float DEFAULT
const float EAT_NORMAL
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597