DayZ 1.24
Loading...
Searching...
No Matches
ActionEmptyBottleBase.c
Go to the documentation of this file.
2{
3 bool m_RPCStopAlreadySent;//since stopping contains a sound tail, we need to stop it only once, this bool ensures that
4 override void CreateActionComponent()
5 {
6 float EmptiedQuantity;
8 if (bottle)
9 EmptiedQuantity = bottle.GetLiquidEmptyRate() * bottle.GetLiquidThroughputCoef();
11 }
12};
13
15{
17 {
18 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_EMPTY_VESSEL;
20
22 m_FullBody = false;
23 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
24 m_Text = "#empty";
25 }
26
32
33 override bool HasTarget()
34 {
35 return false;
36 }
37
38 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
39 {
40 if (GetGame().IsServer() && GetGame().IsMultiplayer())
41 return true;
42
43 if (item.IsLiquidPresent())
44 return true;
45 return false;
46 }
47
49 {
50 if (action_data.m_MainItem.GetQuantity() > action_data.m_MainItem.GetQuantityMin())
51 return true;
52 return false;
53 }
54
56 {
57 SendRPC(action_data, true);
58 }
59
61 {
62 SendRPC(action_data, false);
63 }
64
66 {
67 SendRPC(action_data, false);
68 }
69
70 protected void SendRPC(ActionData actionData, bool enable)
71 {
72 if (!GetGame().IsMultiplayer() || GetGame().IsServer())
73 {
75 if (comp.m_RPCStopAlreadySent)
76 return;
77
80 GetGame().RPCSingleParam(target_vessel, SoundTypeBottle.EMPTYING, play, true);
81 if (!enable)
82 comp.m_RPCStopAlreadySent = true;
83 }
84 }
85};
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
SoundTypeBottle
Definition Bottle_Base.c:2
void SendRPC()
ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
ItemBase m_MainItem
Definition ActionBase.c:28
override void CreateActionComponent()
override void OnEndAnimationLoop(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void CreateConditionComponents()
override void OnEndServer(ActionData action_data)
override bool ActionConditionContinue(ActionData action_data)
void SendRPC(ActionData actionData, bool enable)
override void OnStartAnimationLoop(ActionData action_data)
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
proto native CGame GetGame()