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

Go to the source code of this file.

Classes

class  ActionDrinkPondContinuousCB
 

Functions

void ActionDrinkPondContinuous ()
 
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)
 
override void WriteToContext (ParamsWriteContext ctx, ActionData action_data)
 
override bool ReadFromContext (ParamsReadContext ctx, out ActionReciveData action_recive_data)
 

Variables

ActionDrinkPondContinuousCB WATER_DRANK_PER_SEC = 35
 
const string ALLOWED_WATER_SURFACES = string.Format("%1|%2", UAWaterType.FRESH, UAWaterType.STILL)
 

Function Documentation

◆ ActionCondition()

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

Definition at line 39 of file ActionDrinkPondContinuous.c.

40 {
41 if (item && item.IsHeavyBehaviour())
42 return false;
43
44 return player.CanEatAndDrink();
45 }

◆ ActionDrinkPondContinuous()

void ActionDrinkPondContinuous ( )
protected

Definition at line 14 of file ActionDrinkPondContinuous.c.

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 }
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

References m_FullBody, m_StanceMask, and m_Text.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
protected

◆ GetInputType()

override GetInputType ( )
protected

◆ IsDrink()

override bool IsDrink ( )
protected

Definition at line 23 of file ActionDrinkPondContinuous.c.

24 {
25 return true;
26 }

◆ OnEnd()

override void OnEnd ( ActionData action_data)
protected

Definition at line 54 of file ActionDrinkPondContinuous.c.

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

◆ OnEndAnimationLoopServer()

override void OnEndAnimationLoopServer ( ActionData action_data)
protected

Definition at line 66 of file ActionDrinkPondContinuous.c.

67 {
68 if (action_data.m_Player.HasBloodyHands() && !action_data.m_Player.GetInventory().FindAttachment(InventorySlots.GLOVES))
69 action_data.m_Player.SetBloodyHandsPenalty();
70 }
provides access to slot configuration

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
protected

Definition at line 59 of file ActionDrinkPondContinuous.c.

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 }
EConsumeType
Definition EConsumeType.c:2

References UAQuantityConsumed::DRINK.

◆ OnStart()

override void OnStart ( ActionData action_data)
protected

Definition at line 47 of file ActionDrinkPondContinuous.c.

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

◆ ReadFromContext()

override bool ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
protected

Definition at line 85 of file ActionDrinkPondContinuous.c.

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 }
bool HasTarget()
Definition ActionBase.c:210

References HasTarget().

◆ WriteToContext()

override void WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
protected

Definition at line 72 of file ActionDrinkPondContinuous.c.

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 }
static const vector Zero
Definition EnConvert.c:110

References HasTarget(), and vector::Zero.

Variable Documentation

◆ ALLOWED_WATER_SURFACES

const string ALLOWED_WATER_SURFACES = string.Format("%1|%2", UAWaterType.FRESH, UAWaterType.STILL)
protected

Definition at line 12 of file ActionDrinkPondContinuous.c.

Referenced by CreateConditionComponents().

◆ WATER_DRANK_PER_SEC

ActionDrinkPondContinuousCB WATER_DRANK_PER_SEC = 35