DayZ 1.24
Loading...
Searching...
No Matches
ActionDrinkWellContinuous.c
Go to the documentation of this file.
2{
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
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
49 {
50 super.OnStart(action_data);
51
52 action_data.m_Player.TryHideItemInHands(true);
53 }
54
56 {
57 action_data.m_Player.TryHideItemInHands(false);
58 }
59
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 }
72
74 {
75 if (action_data.m_Player.HasBloodyHands())
76 action_data.m_Player.InsertAgent(eAgents.CHOLERA, 1);
77 }
78}
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
void CreateConditionComponents()
Definition ActionBase.c:196
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool IsDrink()
Definition ActionBase.c:254
int m_StanceMask
Definition ActionBase.c:53
ActionDrinkWellContinuousCB ActionContinuousBaseCB ActionDrinkWellContinuous()
eAgents
Definition EAgents.c:3
EConsumeType
Definition EConsumeType.c:2
EWaterSourceObjectType
override void OnEnd()
Definition JumpEvents.c:53
void OnStart(Param par=null)
ActionData m_ActionData
void OnFinishProgressServer(ActionData action_data)
void OnEndAnimationLoopServer(ActionData action_data)
ref CABase m_ActionComponent
Definition ActionBase.c:30
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
provides access to slot configuration
const float DEFAULT
const float DRINK_WELL
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597