DayZ 1.24
Loading...
Searching...
No Matches
ActionForceABite.c
Go to the documentation of this file.
8
9class ActionForceABite: ActionForceConsumeSingle
10{
12 {
13 m_CallbackClass = ActionForceABiteCB;
14 m_Text = "#feed_a_bite";
15 }
16
22
24 {
25 if (action_data.m_MainItem.GetQuantity() <= 0)
26 action_data.m_MainItem.SetQuantity(0);
27 }
28
29 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
30 {
31 if (!super.ActionCondition(player, target, item))
32 return false;
33
34 PlayerBase target_player = PlayerBase.Cast(target.GetObject());
35
36 if (target_player)
37 return target_player.CanEatAndDrink();
38 else
39 return false;
40 }
41
42};
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
override void CreateActionComponent()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void CreateConditionComponents()
override void OnEndServer(ActionData action_data)
Definition CCTMan.c:2
const float DEFAULT
const float EAT_NORMAL