DayZ 1.24
Loading...
Searching...
No Matches
ActionFillBottleBase Class Reference
Inheritance diagram for ActionFillBottleBase:
[legend]
Collaboration diagram for ActionFillBottleBase:
[legend]

Private Member Functions

void ActionFillBottleBase ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool ActionConditionContinue (ActionData action_data)
 
override bool SetupAction (PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
 
int GetLiquidType (PlayerBase player, ActionTarget target, ItemBase item)
 
void SetupStance (PlayerBase player)
 
- Private Member Functions inherited from ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Private Attributes

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

Detailed Description

Definition at line 18 of file ActionFillBottleBase.c.

Constructor & Destructor Documentation

◆ ActionFillBottleBase()

void ActionFillBottleBase::ActionFillBottleBase ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

override bool ActionFillBottleBase::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 39 of file ActionFillBottleBase.c.

40 {
41 if (item.IsFullQuantity())
42 return false;
43
44 Object targetObject = target.GetObject();
45 if (targetObject)
46 {
48 if (fuelstation)
49 {
50 if (!fuelstation.HasFuelToGive())
51 return false;
52 }
54 return false;
55
56 if (targetObject.GetWaterSourceObjectType() != EWaterSourceObjectType.NONE || targetObject.GetWaterSourceObjectType() == EWaterSourceObjectType.THROUGH || targetObject.IsFuelStation())
57 return GetLiquidType(player, target, item) != -1;
58 }
59
61 if (waterCheck.Can(player, target))
62 return GetLiquidType(player, target, item) != -1;
63
64 return false;
65 }
EWaterSourceObjectType
int GetLiquidType()
Definition ItemBase.c:8442
const string ALLOWED_WATER_SURFACES
const float DEFAULT
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.

References ALLOWED_WATER_SURFACES, UAMaxDistances::DEFAULT, vector::DistanceSq(), and GetLiquidType().

◆ ActionConditionContinue()

override bool ActionFillBottleBase::ActionConditionContinue ( ActionData action_data)
inlineprivate

Definition at line 67 of file ActionFillBottleBase.c.

68 {
69 return action_data.m_MainItem.GetQuantity() < action_data.m_MainItem.GetQuantityMax();
70 }

◆ CreateConditionComponents()

override void ActionFillBottleBase::CreateConditionComponents ( )
inlineprivate

Definition at line 33 of file ActionFillBottleBase.c.

34 {
37 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ GetLiquidType()

int ActionFillBottleBase::GetLiquidType ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 87 of file ActionFillBottleBase.c.

88 {
89 if (target.GetObject() && target.GetObject().IsFuelStation())
90 {
92 return LIQUID_GASOLINE;
93 }
94 else if ((!target.GetObject() || target.GetObject().IsWell() || target.GetObject().GetWaterSourceObjectType() == EWaterSourceObjectType.WELL || target.GetObject().GetWaterSourceObjectType() == EWaterSourceObjectType.THROUGH) && Liquid.CanFillContainer(item, LIQUID_WATER))
95 return LIQUID_WATER;
96
97 return -1;
98 }
Definition Liquid.c:2
static bool CanFillContainer(ItemBase container, int liquid_type, bool ignore_fullness_check=false)
Definition Liquid.c:136
const int LIQUID_GASOLINE
Definition constants.c:508
const int LIQUID_WATER
Definition constants.c:504

References Liquid::CanFillContainer(), LIQUID_GASOLINE, and LIQUID_WATER.

Referenced by ActionFillBottleBaseCB::CreateActionComponent().

◆ SetupAction()

override bool ActionFillBottleBase::SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = NULL )
inlineprivate

Definition at line 72 of file ActionFillBottleBase.c.

73 {
75
76 if (super.SetupAction(player, target, item, action_data, extra_data))
77 {
78 if (action_data.m_Target.GetObject())
79 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_FILLBOTTLEWELL;
80
81 return true;
82 }
83
84 return false;
85 }
void SetupStance(PlayerBase player)

References AnimatedActionBase::m_CommandUID, and SetupStance().

◆ SetupStance()

void ActionFillBottleBase::SetupStance ( PlayerBase player)
inlineprivate

Definition at line 100 of file ActionFillBottleBase.c.

101 {
102 //returns in format (totalWaterDepth, characterDepht, 0)
103 vector water_info = HumanCommandSwim.WaterLevelCheck(player, player.GetPosition());
104 if (water_info[1] > WATER_DEPTH)
105 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
106 else
107 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
108 }
class HumanCommandLadder HumanCommandSwim()
Definition human.c:669

References HumanCommandSwim(), m_StanceMask, and WATER_DEPTH.

Referenced by SetupAction().

Member Data Documentation

◆ ALLOWED_WATER_SURFACES

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

Definition at line 21 of file ActionFillBottleBase.c.

Referenced by ActionCondition().

◆ WATER_DEPTH

const float ActionFillBottleBase::WATER_DEPTH = 0.5
private

Definition at line 20 of file ActionFillBottleBase.c.

Referenced by SetupStance().


The documentation for this class was generated from the following file: