DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionDrinkWellContinuous.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
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
32 {
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}
void CreateConditionComponents()
Definition ActionBase.c:218
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool IsDrink()
Definition ActionBase.c:276
protected string m_Text
Definition ActionBase.c:49
protected bool m_FullBody
Definition ActionBase.c:52
protected int m_StanceMask
Definition ActionBase.c:53
ActionDrinkWellContinuousCB ActionContinuousBaseCB ActionDrinkWellContinuous()
class ActionTargets ActionTarget
eAgents
Definition EAgents.c:3
EConsumeType
Definition EConsumeType.c:2
EWaterSourceObjectType
override void OnEnd()
Definition JumpEvents.c:57
protected void OnStart(Param par=null)
protected ActionData m_ActionData
protected void OnFinishProgressServer(ActionData action_data)
protected void OnEndAnimationLoopServer(ActionData action_data)
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Param GetACData()
Definition CABase.c:48
provides access to slot configuration
const float DEFAULT
const float DRINK_WELL
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602