DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionDrainLiquid.c
Go to the documentation of this file.
2{
3 private const float TIME_TO_REPEAT = 0.25;
4
5 override void CreateActionComponent()
6 {
8 }
9};
10
12{
14 {
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_EMPTY_VESSEL;
17 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_EMPTY_VESSEL;
19 m_Text = "#drain_liquid";
20 }
21
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(target_item,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
50 override void OnStartAnimationLoop( ActionData action_data )
51 {
52 if ( !GetGame().IsMultiplayer() || GetGame().IsServer() )
53 {
54 Bottle_Base vessel_in_hands = Bottle_Base.Cast( action_data.m_Target.GetObject() );
55 Param1<bool> play = new Param1<bool>( true );
56
57 GetGame().RPCSingleParam( vessel_in_hands, SoundTypeBottle.EMPTYING, play, true );
58 }
59 }
60
61 override void OnEndAnimationLoop( ActionData action_data )
62 {
63 if ( !GetGame().IsMultiplayer() || GetGame().IsServer() )
64 {
65 Bottle_Base target_vessel = Bottle_Base.Cast( action_data.m_Target.GetObject());
66 Param1<bool> play = new Param1<bool>( false );
67 GetGame().RPCSingleParam( target_vessel, SoundTypeBottle.EMPTYING, play, true );
68 }
69 }
70};
protected float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
protected string m_Text
Definition ActionBase.c:49
class ActionTargets ActionTarget
SoundTypeBottle
Definition Bottle_Base.c:2
protected ActionData m_ActionData
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
ref ActionTarget m_Target
Definition ActionBase.c:32
private const float TIME_TO_REPEAT
override void CreateActionComponent()
override void OnFinishProgressServer(ActionData action_data)
override void OnStartAnimationLoop(ActionData action_data)
override void CreateConditionComponents()
override void OnEndAnimationLoop(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool HasProneException()
protected int m_CommandUIDProne
void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
Definition Game.c:882
Definition Liquid.c:2
static bool CanTransfer(ItemBase source_ent, ItemBase target_ent)
Definition Liquid.c:84
const float DEFAULT
const float DRAIN_LIQUID
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
proto native CGame GetGame()