DayZ 1.24
Loading...
Searching...
No Matches
ActionConsumeSingle.c
Go to the documentation of this file.
8
10{
12
14 {
15 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_LICKBATTERY;
16 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_LICKBATTERY;
17
18 m_Text = "#eat";
19 }
20
25
26 override bool HasProneException()
27 {
28 return true;
29 }
30
31 override bool HasTarget()
32 {
33 return false;
34 }
35
41
42 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
43 {
44 return super.ActionCondition(player, target, item) && player.CanEatAndDrink();
45 }
46
48 {
49 PlayerBase player = action_data.m_Player;
50
51 if (player && action_data.m_MainItem)
52 player.Consume(action_data.m_MainItem, GetConsumedQuantity(), EConsumeType.ITEM_SINGLE_TIME);
53 }
54
56 {
57 if (action_data.m_MainItem && (action_data.m_MainItem.GetQuantity() <= 0))
58 action_data.m_MainItem.SetQuantity(0);
59
60 if (action_data.m_Player.HasBloodyHandsEx() == eBloodyHandsTypes.SALMONELA && !action_data.m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES) && GetProgress(action_data) > 0)
61 action_data.m_Player.SetBloodyHandsPenalty();
62 }
63}
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
EConsumeType
Definition EConsumeType.c:2
eBloodyHandsTypes
ActionData m_ActionData
override void CreateActionComponent()
override void OnEndServer(ActionData action_data)
override bool HasTarget()
override bool HasProneException()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnExecuteServer(ActionData action_data)
override void CreateConditionComponents()
ref CABase m_ActionComponent
Definition ActionBase.c:30
override float GetProgress(ActionData action_data)
provides access to slot configuration
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597