DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionForceFeed.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
6 }
7}
8
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
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 {
62 }
63};
64
66{
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
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}
void CreateConditionComponents()
Definition ActionBase.c:218
void OnEndServer(ActionData action_data)
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
protected bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition ActionBase.c:372
protected string m_Text
Definition ActionBase.c:49
protected bool m_FullBody
Definition ActionBase.c:52
protected int m_StanceMask
Definition ActionBase.c:53
ActionForceConsumeCB ActionContinuousBaseCB ActionForceConsume()
ActionForceFeedSmallCB ActionForceFeed
class ActionTargets ActionTarget
protected ActionData m_ActionData
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
ref ActionTarget m_Target
Definition ActionBase.c:32
override void CreateActionComponent()
override void CreateActionComponent()
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override string GetText()
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:602