DayZ 1.24
Loading...
Searching...
No Matches
ActionDrinkPondContinuous.c
Go to the documentation of this file.
8
9class ActionDrinkPondContinuous: ActionContinuousBase
10{
11 private const float WATER_DRANK_PER_SEC = 35;
12 protected const string ALLOWED_WATER_SURFACES = string.Format("%1|%2", UAWaterType.FRESH, UAWaterType.STILL);
13
15 {
16 m_CallbackClass = ActionDrinkPondContinuousCB;
17 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DRINKPOND;
18 m_FullBody = true;
19 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
20 m_Text = "#drink";
21 }
22
23 override bool IsDrink()
24 {
25 return true;
26 }
27
28 override typename GetInputType()
29 {
31 }
32
38
39 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
40 {
41 if (item && item.IsHeavyBehaviour())
42 return false;
43
44 return player.CanEatAndDrink();
45 }
46
48 {
49 super.OnStart(action_data);
50
51 action_data.m_Player.TryHideItemInHands(true);
52 }
53
55 {
56 action_data.m_Player.TryHideItemInHands(false);
57 }
58
60 {
61 Param1<float> nacdata = Param1<float>.Cast(action_data.m_ActionComponent.GetACData());
62 float amount = UAQuantityConsumed.DRINK;
63 action_data.m_Player.Consume(null, amount, EConsumeType.ENVIRO_POND);
64 }
65
67 {
68 if (action_data.m_Player.HasBloodyHands() && !action_data.m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES))
69 action_data.m_Player.SetBloodyHandsPenalty();
70 }
71
73 {
74 super.WriteToContext(ctx, action_data);
75
76 if (HasTarget())
77 {
78 ctx.Write(action_data.m_Target.GetCursorHitPos());
79 return;
80 }
81
82 ctx.Write(vector.Zero);
83 }
84
86 {
87 super.ReadFromContext(ctx, action_recive_data);
88
89 if (HasTarget())
90 {
92 if (!ctx.Read(cursorPosition))
93 return false;
94
95 action_recive_data.m_Target.SetCursorHitPos(cursorPosition);
96 }
97
98 return true;
99 }
100}
override void OnFinishProgressServer(ActionData action_data)
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
void CreateConditionComponents()
Definition ActionBase.c:196
bool HasTarget()
Definition ActionBase.c:210
GetInputType()
Definition ActionBase.c:181
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool IsDrink()
Definition ActionBase.c:254
bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition ActionBase.c:350
int m_StanceMask
Definition ActionBase.c:53
void ActionDrinkPondContinuous()
ActionDrinkPondContinuousCB WATER_DRANK_PER_SEC
override void OnEndAnimationLoopServer(ActionData action_data)
const string ALLOWED_WATER_SURFACES
EConsumeType
Definition EConsumeType.c:2
void ReadFromContext(ParamsReadContext ctx)
Definition Hand_Events.c:70
void WriteToContext(ParamsWriteContext ctx)
Definition Hand_Events.c:72
override void OnEnd()
Definition JumpEvents.c:53
void OnStart(Param par=null)
ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
provides access to slot configuration
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
const float DEFAULT
const float DRINK_POND
const string FRESH
fake
const string STILL
static const vector Zero
Definition EnConvert.c:110
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597