Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actiondrinkwellcontinuous.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousRepeat(UATimeSpent.DRINK_WELL);
6  }
7 }
8 
10 {
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  }
20 
21  override bool IsDrink()
22  {
23  return true;
24  }
25 
26  override typename GetInputType()
27  {
29  }
30 
31  override void CreateConditionComponents()
32  {
33  m_ConditionItem = new CCINone();
35  }
36 
37  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
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  }
47 
48  override void OnStart(ActionData action_data)
49  {
50  super.OnStart(action_data);
51 
52  action_data.m_Player.TryHideItemInHands(true);
53  }
54 
55  override void OnEnd(ActionData action_data)
56  {
57  action_data.m_Player.TryHideItemInHands(false);
58  }
59 
60  override void OnFinishProgressServer(ActionData action_data)
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  {
71  action_data.m_Player.SetBloodyHandsPenalty();
72  }
73  }
74 
75  override void OnEndAnimationLoopServer(ActionData action_data)
76  {
77  if (action_data.m_Player.HasBloodyHands())
78  {
79  action_data.m_Player.InsertAgent(eAgents.CHOLERA, 1);
80  }
81  }
82 }
ItemBase
Definition: inventoryitem.c:730
CAContinuousRepeat
Definition: cacontinuousrepeat.c:1
InventorySlots
provides access to slot configuration
Definition: inventoryslots.c:5
OnStart
override void OnStart(ActionData action_data)
Definition: actiondrinkwellcontinuous.c:48
ContinuousInteractActionInput
Definition: actioninput.c:521
EWaterSourceObjectType
EWaterSourceObjectType
Definition: ewatersourceobjecttype.c:1
CCINone
Definition: ccinone.c:1
UAQuantityConsumed
Definition: actionconstants.c:3
OnEnd
override void OnEnd(ActionData action_data)
Definition: actiondrinkwellcontinuous.c:55
UAMaxDistances
Definition: actionconstants.c:104
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actiondrinkwellcontinuous.c:37
OnEndAnimationLoopServer
override void OnEndAnimationLoopServer(ActionData action_data)
Definition: actiondrinkwellcontinuous.c:75
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
EConsumeType
EConsumeType
Definition: econsumetype.c:1
PlayerBase
Definition: playerbaseclient.c:1
eAgents
eAgents
Definition: eagents.c:2
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTCursor
Definition: cctcursor.c:1
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
ActionDrinkWellContinuousCB
Definition: actiondrinkwellcontinuous.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
ActionDrinkWellContinuous
ActionDrinkWellContinuousCB ActionContinuousBaseCB ActionDrinkWellContinuous()
Definition: actiondrinkwellcontinuous.c:11
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition: actiondrinkwellcontinuous.c:60
ActionContinuousBase
Definition: actioncontinuousbase.c:132
IsDrink
override bool IsDrink()
Definition: actiondrinkwellcontinuous.c:21
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
GetInputType
override GetInputType()
Definition: actiondrinkwellcontinuous.c:26
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
CreateConditionComponents
override void CreateConditionComponents()
Definition: actiondrinkwellcontinuous.c:31