DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionEmptyBottleBase.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
5 float EmptiedQuantity;// = QUANTITY_EMPTIED_PER_SEC;
7 if (bottle)
8 EmptiedQuantity = bottle.GetLiquidEmptyRate() * bottle.GetLiquidThroughputCoef();
10 }
11};
12
14{
16 {
17 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_EMPTY_VESSEL;
19
21 m_FullBody = false;
22 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
23 m_Text = "#empty";
24 }
25
27 {
30 }
31
32 override bool HasTarget()
33 {
34 return false;
35 }
36
37 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
38 {
39 /*vector pos_cursor = target.GetCursorHitPos();
40 vector pos_head;
41 MiscGameplayFunctions.GetHeadBonePos( player, pos_head );
42 float distance = vector.Distance(pos_cursor, pos_head);*/
43
44 if ( GetGame().IsServer() && GetGame().IsMultiplayer() )
45 return true;
46
47 if ( item.IsLiquidPresent() /*&& player.IsCurrentCameraAimedAtGround()*/ )
48 {
49 return true;
50 }
51 return false;
52 }
53
54 override bool ActionConditionContinue( ActionData action_data )
55 {
56 if (action_data.m_MainItem.GetQuantity() > action_data.m_MainItem.GetQuantityMin())
57 {
58 return true;
59 }
60 return false;
61 }
62
63 override void OnStartAnimationLoop( ActionData action_data )
64 {
65 if ( !GetGame().IsMultiplayer() || GetGame().IsServer() )
66 {
67 Bottle_Base vessel_in_hands = Bottle_Base.Cast( action_data.m_MainItem );
68 Param1<bool> play = new Param1<bool>( true );
69 GetGame().RPCSingleParam( vessel_in_hands, SoundTypeBottle.EMPTYING, play, true );
70 }
71 }
72
73 override void OnEndServer( ActionData action_data )
74 {
75 if ( !GetGame().IsMultiplayer() || GetGame().IsServer() )
76 {
77 Bottle_Base target_vessel = Bottle_Base.Cast( action_data.m_MainItem );
78 Param1<bool> play = new Param1<bool>( false );
79 GetGame().RPCSingleParam( target_vessel, SoundTypeBottle.EMPTYING, play, true );
80 }
81 }
82};
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
protected bool m_FullBody
Definition ActionBase.c:52
protected int m_StanceMask
Definition ActionBase.c:53
class ActionTargets ActionTarget
SoundTypeBottle
Definition Bottle_Base.c:2
protected ActionData m_ActionData
ItemBase m_MainItem
Definition ActionBase.c:28
ref CABase m_ActionComponent
Definition ActionBase.c:30
override void CreateActionComponent()
override bool ActionConditionContinue(ActionData action_data)
override void OnEndServer(ActionData action_data)
override void OnStartAnimationLoop(ActionData action_data)
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override float GetLiquidThroughputCoef()
void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
Definition Game.c:882
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
proto native CGame GetGame()