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

Private Member Functions

void ActionWorldLiquidActionSwitch ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void Start (ActionData action_data)
 
override bool IsLocal ()
 
override bool IsInstant ()
 
override bool RemoveForceTargetAfterUse ()
 

Private Attributes

bool m_switch_to
 

Detailed Description

Definition at line 2 of file ActionWorldLiquidActionSwitch.c.

Constructor & Destructor Documentation

◆ ActionWorldLiquidActionSwitch()

void ActionWorldLiquidActionSwitch::ActionWorldLiquidActionSwitch ( )
inlineprivate

Definition at line 5 of file ActionWorldLiquidActionSwitch.c.

6 {
7 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_PRONE;
8 }
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References m_StanceMask.

Member Function Documentation

◆ ActionCondition()

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

Definition at line 24 of file ActionWorldLiquidActionSwitch.c.

25 {
26 ItemBase target_item = ItemBase.Cast(target.GetObject());
27 if (Barrel_ColorBase.Cast(target_item) && !target_item.IsOpen())
28 return false;
29
30 if (target_item && item && Liquid.CanFillContainer(item, target_item.GetLiquidType(), true) && Liquid.CanFillContainer(target_item, item.GetLiquidType(), true) && !GetGame().IsInventoryOpen()) //TODO find better condition than IsKindOf
31 {
32 if (target_item.GetQuantity() > target_item.GetQuantityMin() && item.GetQuantity() < item.GetQuantityMax() && !player.GetLiquidTendencyDrain() && Liquid.CanFillContainer(item, target_item.GetLiquidType()))
33 {
34 if (Liquid.CanFillContainer(target_item, item.GetLiquidType()))
35 {
36 m_switch_to = 0;//"#liquid_drain";
37 return true;
38 }
39 else
40 {
41 player.SetLiquidTendencyDrain(true);
42 return false;
43 }
44 }
45 if (item.GetQuantity() > item.GetQuantityMin() && target_item.GetQuantity() < target_item.GetQuantityMax() && player.GetLiquidTendencyDrain() && Liquid.CanFillContainer(target_item, item.GetLiquidType()))
46 {
47 if (Liquid.CanFillContainer(item, target_item.GetLiquidType()))
48 {
49 m_switch_to = 1;//"#liquid_pour";
50 return true;
51 }
52 else
53 {
54 player.SetLiquidTendencyDrain(false);
55 return false;
56 }
57 }
58 }
59 return false;
60 }
Definition Liquid.c:2
static bool CanFillContainer(ItemBase container, int liquid_type, bool ignore_fullness_check=false)
Definition Liquid.c:136
proto native CGame GetGame()

References Liquid::CanFillContainer(), GetGame(), and m_switch_to.

◆ CreateConditionComponents()

override void ActionWorldLiquidActionSwitch::CreateConditionComponents ( )
inlineprivate

◆ IsInstant()

override bool ActionWorldLiquidActionSwitch::IsInstant ( )
inlineprivate

Definition at line 77 of file ActionWorldLiquidActionSwitch.c.

78 {
79 return true;
80 }

◆ IsLocal()

override bool ActionWorldLiquidActionSwitch::IsLocal ( )
inlineprivate

Definition at line 72 of file ActionWorldLiquidActionSwitch.c.

73 {
74 return true;
75 }

◆ RemoveForceTargetAfterUse()

override bool ActionWorldLiquidActionSwitch::RemoveForceTargetAfterUse ( )
inlineprivate

Definition at line 82 of file ActionWorldLiquidActionSwitch.c.

83 {
84 return false;
85 }

◆ Start()

override void ActionWorldLiquidActionSwitch::Start ( ActionData action_data)
inlineprivate

Definition at line 62 of file ActionWorldLiquidActionSwitch.c.

63 {
64 super.Start(action_data);
65 bool state;
66 state = action_data.m_Player.GetLiquidTendencyDrain();
67 action_data.m_Player.SetLiquidTendencyDrain(!state);
68
69 //Print(action_data.m_Player.GetLiquidTendencyDrain());
70 }

Member Data Documentation

◆ m_switch_to

bool ActionWorldLiquidActionSwitch::m_switch_to
private

Definition at line 4 of file ActionWorldLiquidActionSwitch.c.

Referenced by ActionCondition().


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