Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionpourliquid.c
Go to the documentation of this file.
2 {
3  private const float TIME_TO_REPEAT = 0.25;
4 
5  override void CreateActionComponent()
6  {
7  m_ActionData.m_ActionComponent = new CAContinuousQuantityLiquidTransfer(UAQuantityConsumed.DRAIN_LIQUID, TIME_TO_REPEAT, false);
8  }
9 };
10 
12 {
13  void ActionPourLiquid()
14  {
15  m_CallbackClass = ActionPourLiquidCB;
16  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_EMPTY_VESSEL;
17  m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_EMPTY_VESSEL;
19  m_Text = "#pour_liquid";
20  }
21 
22  override void CreateConditionComponents()
23  {
26  }
27 
28  override bool HasProneException()
29  {
30  return true;
31  }
32 
33  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
34  {
35  ItemBase target_item = ItemBase.Cast(target.GetObject());
36 
37  if ( target_item && item )
38  {
39  return Liquid.CanTransfer(item,target_item);;
40  }
41  return false;
42  }
43 
44  override void OnFinishProgressServer( ActionData action_data )
45  {
46  action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
47  }
48 
49  override void OnStartAnimationLoop( ActionData action_data )
50  {
51  if ( !GetGame().IsMultiplayer() || GetGame().IsServer() )
52  {
53  Bottle_Base vessel_in_hands = Bottle_Base.Cast( action_data.m_Target.GetObject() );
54  Param1<bool> play = new Param1<bool>( true );
55 
56  GetGame().RPCSingleParam( vessel_in_hands, SoundTypeBottle.POURING, play, true );
57  }
58  }
59 
60  override void OnEndAnimationLoop( ActionData action_data )
61  {
62  if ( !GetGame().IsMultiplayer() || GetGame().IsServer() )
63  {
64  Bottle_Base target_vessel = Bottle_Base.Cast( action_data.m_Target.GetObject());
65  Param1<bool> play = new Param1<bool>( false );
66 
67  GetGame().RPCSingleParam( target_vessel, SoundTypeBottle.POURING, play, true );
68  }
69  }
70 
71  override void OnEnd( ActionData action_data )
72  {
73  if ( !GetGame().IsMultiplayer() || GetGame().IsServer() )
74  {
75  Bottle_Base target_vessel = Bottle_Base.Cast( action_data.m_Target.GetObject());
76  Param1<bool> play = new Param1<bool>( false );
77 
78  GetGame().RPCSingleParam( target_vessel, SoundTypeBottle.POURING, play, true );
79  }
80  }
81 };
ItemBase
Definition: inventoryitem.c:730
GetGame
proto native CGame GetGame()
ActionPourLiquid
Definition: actionpourliquid.c:11
UASoftSkillsWeight
Definition: actionconstants.c:118
UAQuantityConsumed
Definition: actionconstants.c:3
CAContinuousQuantityLiquidTransfer
Definition: cacontinuousquantityliquidtransfer.c:1
Bottle_Base
Definition: canistergasoline.c:1
UAMaxDistances
Definition: actionconstants.c:104
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
TIME_TO_REPEAT
const private float TIME_TO_REPEAT
Definition: actionextinguishfireplacebyextinguisher.c:2
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTNonRuined
Definition: cctnonruined.c:1
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
ActionPourLiquidCB
Definition: actionpourliquid.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
SoundTypeBottle
SoundTypeBottle
Definition: bottle_base.c:1
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
Liquid
Definition: liquid.c:1
ActionContinuousBase
Definition: actioncontinuousbase.c:132
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68