Dayz Explorer 1.29.162510
Loading...
Searching...
No Matches
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
11class ActionPourLiquid: ActionContinuousBase
12{
13 void ActionPourLiquid()
14 {
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_EMPTY_VESSEL;
17 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_EMPTY_VESSEL;
18 m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
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 OnStartAnimationLoop( ActionData action_data )
45 {
46 if ( !g_Game.IsMultiplayer() || g_Game.IsServer() )
47 {
48 Bottle_Base vessel_in_hands = Bottle_Base.Cast( action_data.m_Target.GetObject() );
49 Param1<bool> play = new Param1<bool>( true );
50
51 g_Game.RPCSingleParam( vessel_in_hands, SoundTypeBottle.POURING, play, true );
52 }
53 }
54
55 override void OnEndAnimationLoop( ActionData action_data )
56 {
57 if ( !g_Game.IsMultiplayer() || g_Game.IsServer() )
58 {
59 Bottle_Base target_vessel = Bottle_Base.Cast( action_data.m_Target.GetObject());
60 Param1<bool> play = new Param1<bool>( false );
61
62 g_Game.RPCSingleParam( target_vessel, SoundTypeBottle.POURING, play, true );
63 }
64 }
65
66 override void OnEnd( ActionData action_data )
67 {
68 if ( !g_Game.IsMultiplayer() || g_Game.IsServer() )
69 {
70 Bottle_Base target_vessel = Bottle_Base.Cast( action_data.m_Target.GetObject());
71 Param1<bool> play = new Param1<bool>( false );
72
73 g_Game.RPCSingleParam( target_vessel, SoundTypeBottle.POURING, play, true );
74 }
75 }
76};
ActionBase ActionData
Definition actionbase.c:30
SoundTypeBottle
Definition bottle_base.c:2
void CreateActionComponent()
ActionData m_ActionData
float m_SpecialtyWeight
Definition actionbase.c:83
string m_Text
Definition actionbase.c:64
ref CCIBase m_ConditionItem
Definition actionbase.c:70
void CreateConditionComponents()
Definition actionbase.c:236
ref CCTBase m_ConditionTarget
Definition actionbase.c:71
override bool HasProneException()
DayZGame g_Game
Definition dayzgame.c:3942
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
void OnEnd()
Definition sound.c:226