DayZ 1.24
Loading...
Searching...
No Matches
ActionConsumeSingle Class Reference
Inheritance diagram for ActionConsumeSingle:
[legend]
Collaboration diagram for ActionConsumeSingle:
[legend]

Private Member Functions

void ActionConsumeSingle ()
 
int GetConsumedQuantity ()
 
override bool HasProneException ()
 
override bool HasTarget ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 
override void OnEndServer (ActionData action_data)
 

Private Attributes

const int DEFAULT_CONSUMED_QUANTITY = 1
 

Detailed Description

Definition at line 9 of file ActionConsumeSingle.c.

Constructor & Destructor Documentation

◆ ActionConsumeSingle()

void ActionConsumeSingle::ActionConsumeSingle ( )
inlineprivate

Definition at line 13 of file ActionConsumeSingle.c.

14 {
15 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_LICKBATTERY;
16 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_LICKBATTERY;
17
18 m_Text = "#eat";
19 }
string m_Text
Definition ActionBase.c:49
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CommandUID, AnimatedActionBase::m_CommandUIDProne, and m_Text.

Member Function Documentation

◆ ActionCondition()

override bool ActionConsumeSingle::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 42 of file ActionConsumeSingle.c.

43 {
44 return super.ActionCondition(player, target, item) && player.CanEatAndDrink();
45 }

◆ CreateConditionComponents()

override void ActionConsumeSingle::CreateConditionComponents ( )
inlineprivate

Definition at line 36 of file ActionConsumeSingle.c.

37 {
40 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ GetConsumedQuantity()

int ActionConsumeSingle::GetConsumedQuantity ( )
inlineprivate

Definition at line 21 of file ActionConsumeSingle.c.

22 {
24 }

References DEFAULT_CONSUMED_QUANTITY.

Referenced by OnExecuteServer().

◆ HasProneException()

override bool ActionConsumeSingle::HasProneException ( )
inlineprivate

Definition at line 26 of file ActionConsumeSingle.c.

27 {
28 return true;
29 }

◆ HasTarget()

override bool ActionConsumeSingle::HasTarget ( )
inlineprivate

Definition at line 31 of file ActionConsumeSingle.c.

32 {
33 return false;
34 }

◆ OnEndServer()

override void ActionConsumeSingle::OnEndServer ( ActionData action_data)
inlineprivate

Definition at line 55 of file ActionConsumeSingle.c.

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 }
eBloodyHandsTypes
override float GetProgress(ActionData action_data)
provides access to slot configuration

References AnimatedActionBase::GetProgress().

◆ OnExecuteServer()

override void ActionConsumeSingle::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 47 of file ActionConsumeSingle.c.

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 }
EConsumeType
Definition EConsumeType.c:2

References GetConsumedQuantity().

Member Data Documentation

◆ DEFAULT_CONSUMED_QUANTITY

const int ActionConsumeSingle::DEFAULT_CONSUMED_QUANTITY = 1
private

Definition at line 11 of file ActionConsumeSingle.c.

Referenced by GetConsumedQuantity().


The documentation for this class was generated from the following file: