DayZ 1.24
Loading...
Searching...
No Matches
ActionDrinkWellContinuous.c File Reference

Go to the source code of this file.

Classes

class  ActionDrinkWellContinuousCB
 

Functions

ActionDrinkWellContinuousCB ActionContinuousBaseCB ActionDrinkWellContinuous ()
 
override void CreateActionComponent ()
 
override bool IsDrink ()
 
override GetInputType ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnStart (ActionData action_data)
 
override void OnEnd (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
override void OnEndAnimationLoopServer (ActionData action_data)
 

Function Documentation

◆ ActionCondition()

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

Definition at line 37 of file ActionDrinkWellContinuous.c.

38 {
39 if (item && item.IsHeavyBehaviour())
40 return false;
41
42 if (!player.CanEatAndDrink())
43 return false;
44
45 return target.GetObject() && (target.GetObject().GetWaterSourceObjectType() == EWaterSourceObjectType.WELL || target.GetObject().IsWell());
46 }
EWaterSourceObjectType

◆ ActionDrinkWellContinuous()

ActionDrinkWellContinuousCB ActionContinuousBaseCB ActionDrinkWellContinuous ( )

Definition at line 1 of file ActionDrinkWellContinuous.c.

12 {
13 m_CallbackClass = ActionDrinkWellContinuousCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DRINKWELL;
15 m_FullBody = true;
16 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
17
18 m_Text = "#drink";
19 }
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

Referenced by ActionConstructor::RegisterActions(), and BuildingSuper::SetActions().

◆ CreateActionComponent()

override void ActionDrinkWellContinuous::CreateActionComponent ( )

Definition at line 12 of file ActionDrinkWellContinuous.c.

12 {
13 m_CallbackClass = ActionDrinkWellContinuousCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DRINKWELL;
15 m_FullBody = true;

References m_FullBody, m_StanceMask, and m_Text.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )

Definition at line 31 of file ActionDrinkWellContinuous.c.

32 {
35 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
const float DEFAULT

References UAMaxDistances::DEFAULT, m_ConditionItem, and m_ConditionTarget.

◆ GetInputType()

override GetInputType ( )

◆ IsDrink()

override bool IsDrink ( )

Definition at line 21 of file ActionDrinkWellContinuous.c.

22 {
23 return true;
24 }

◆ OnEnd()

override void OnEnd ( ActionData action_data)

Definition at line 55 of file ActionDrinkWellContinuous.c.

56 {
57 action_data.m_Player.TryHideItemInHands(false);
58 }

◆ OnEndAnimationLoopServer()

override void OnEndAnimationLoopServer ( ActionData action_data)

Definition at line 73 of file ActionDrinkWellContinuous.c.

74 {
75 if (action_data.m_Player.HasBloodyHands())
76 action_data.m_Player.InsertAgent(eAgents.CHOLERA, 1);
77 }
eAgents
Definition EAgents.c:3

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)

Definition at line 60 of file ActionDrinkWellContinuous.c.

61 {
62 Param1<float> nacdata = Param1<float>.Cast(action_data.m_ActionComponent.GetACData());
63 if (nacdata)
64 {
65 float amount = UAQuantityConsumed.DRINK;
66 action_data.m_Player.Consume(null, amount, EConsumeType.ENVIRO_WELL);
67 }
68
69 if (action_data.m_Player.HasBloodyHands() && !action_data.m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES))
70 action_data.m_Player.SetBloodyHandsPenalty();
71 }
EConsumeType
Definition EConsumeType.c:2
provides access to slot configuration

References UAQuantityConsumed::DRINK.

◆ OnStart()

override void OnStart ( ActionData action_data)

Definition at line 48 of file ActionDrinkWellContinuous.c.

49 {
50 super.OnStart(action_data);
51
52 action_data.m_Player.TryHideItemInHands(true);
53 }