DayZ 1.24
Loading...
Searching...
No Matches
ActionTransferLiquid Class Reference
Inheritance diagram for ActionTransferLiquid:
[legend]
Collaboration diagram for ActionTransferLiquid:
[legend]

Private Member Functions

void ActionTransferLiquid ()
 
override void CreateConditionComponents ()
 
override bool HasProneException ()
 
override string GetText ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnStartClient (ActionData action_data)
 
override void OnStartServer (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
override ActionData CreateActionData ()
 
override void WriteToContext (ParamsWriteContext ctx, ActionData action_data)
 
override bool ReadFromContext (ParamsReadContext ctx, out ActionReciveData action_recive_data)
 
override void HandleReciveData (ActionReciveData action_recive_data, ActionData action_data)
 
override void OnStartAnimationLoop (ActionData action_data)
 
override void OnEndAnimationLoop (ActionData action_data)
 
- Private Member Functions inherited from ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Detailed Description

Definition at line 24 of file ActionTransferLiquid.c.

Constructor & Destructor Documentation

◆ ActionTransferLiquid()

Member Function Documentation

◆ ActionCondition()

override bool ActionTransferLiquid::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 54 of file ActionTransferLiquid.c.

55 {
56 ItemBase target_item = ItemBase.Cast(target.GetObject());
57
58 if (target_item && item)
59 {
62
63 if (can_drain && can_pour)
64 return true;
65 else if (!can_pour && can_drain)
66 {
67 if ((!GetGame().IsDedicatedServer()) && !player.GetLiquidTendencyDrain())
68 {
69 player.SetLiquidTendencyDrain(true);
70 return false;
71 }
72 else
73 return true;
74 }
75 else if (!can_drain && can_pour)
76 {
77 if ((!GetGame().IsDedicatedServer()) && player.GetLiquidTendencyDrain())
78 {
79 player.SetLiquidTendencyDrain(false);
80 return false;
81 }
82 else
83 return true;
84 }
85 }
86 return false;
87 }
Definition Liquid.c:2
static bool CanTransfer(ItemBase source_ent, ItemBase target_ent)
Definition Liquid.c:79
proto native CGame GetGame()

References Liquid::CanTransfer(), and GetGame().

◆ CreateActionData()

override ActionData ActionTransferLiquid::CreateActionData ( )
inlineprivate

Definition at line 105 of file ActionTransferLiquid.c.

◆ CreateConditionComponents()

override void ActionTransferLiquid::CreateConditionComponents ( )
inlineprivate

Definition at line 34 of file ActionTransferLiquid.c.

35 {
38 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
const float DEFAULT

References UAMaxDistances::DEFAULT, m_ConditionItem, and m_ConditionTarget.

◆ GetText()

override string ActionTransferLiquid::GetText ( )
inlineprivate

Definition at line 45 of file ActionTransferLiquid.c.

46 {
48 if (player.GetLiquidTendencyDrain())
49 return "#drain_liquid";
50 else
51 return "#pour_liquid";
52 }
PlayerBase GetPlayer()

References GetGame(), and GetPlayer().

◆ HandleReciveData()

override void ActionTransferLiquid::HandleReciveData ( ActionReciveData action_recive_data,
ActionData action_data )
inlineprivate

◆ HasProneException()

override bool ActionTransferLiquid::HasProneException ( )
inlineprivate

Definition at line 40 of file ActionTransferLiquid.c.

41 {
42 return true;
43 }

◆ OnEndAnimationLoop()

override void ActionTransferLiquid::OnEndAnimationLoop ( ActionData action_data)
inlineprivate

Definition at line 157 of file ActionTransferLiquid.c.

158 {
159 if (!GetGame().IsMultiplayer() || GetGame().IsServer())
160 {
161 Bottle_Base target_vessel = Bottle_Base.Cast(action_data.m_Target.GetObject());
162 Param1<bool> play = new Param1<bool>(false);
163 if (TransferLiquidActionData.Cast(action_data).m_Tendency)
164 GetGame().RPCSingleParam(target_vessel, SoundTypeBottle.EMPTYING, play, true);
165 else
166 GetGame().RPCSingleParam(target_vessel, SoundTypeBottle.POURING, play, true);
167 }
168 }
SoundTypeBottle
Definition Bottle_Base.c:2

References GetGame().

◆ OnFinishProgressServer()

override void ActionTransferLiquid::OnFinishProgressServer ( ActionData action_data)
inlineprivate

Definition at line 100 of file ActionTransferLiquid.c.

101 {
102 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
103 }

References m_SpecialtyWeight.

◆ OnStartAnimationLoop()

override void ActionTransferLiquid::OnStartAnimationLoop ( ActionData action_data)
inlineprivate

Definition at line 141 of file ActionTransferLiquid.c.

142 {
143 if (!GetGame().IsMultiplayer() || GetGame().IsServer())
144 {
145 Bottle_Base vessel_in_hands = Bottle_Base.Cast(action_data.m_Target.GetObject());
146 Param1<bool> play = new Param1<bool>(true);
148 {
149 if (TransferLiquidActionData.Cast(action_data).m_Tendency == true)
150 GetGame().RPCSingleParam(vessel_in_hands, SoundTypeBottle.EMPTYING, play, true);
151 else if (!TransferLiquidActionData.Cast(action_data).m_Tendency == false)
152 GetGame().RPCSingleParam(vessel_in_hands, SoundTypeBottle.POURING, play, true);
153 }
154 }
155 }

References GetGame().

◆ OnStartClient()

override void ActionTransferLiquid::OnStartClient ( ActionData action_data)
inlineprivate

Definition at line 89 of file ActionTransferLiquid.c.

90 {
91 TransferLiquidActionData.Cast(action_data).m_Tendency = action_data.m_Player.GetLiquidTendencyDrain();
92 }

◆ OnStartServer()

override void ActionTransferLiquid::OnStartServer ( ActionData action_data)
inlineprivate

Definition at line 94 of file ActionTransferLiquid.c.

95 {
96 if (!GetGame().IsMultiplayer())
97 TransferLiquidActionData.Cast(action_data).m_Tendency = action_data.m_Player.GetLiquidTendencyDrain();
98 }

References GetGame().

◆ ReadFromContext()

override bool ActionTransferLiquid::ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
inlineprivate

Definition at line 118 of file ActionTransferLiquid.c.

119 {
123
124 super.ReadFromContext(ctx, action_recive_data);
125
126 bool tendency_drain;
127 if (!ctx.Read(tendency_drain))
128 return false;
129 recive_data_transfer.m_TendencyRecived = tendency_drain;
130 return true;
131 }

◆ WriteToContext()

override void ActionTransferLiquid::WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
inlineprivate

Definition at line 111 of file ActionTransferLiquid.c.

112 {
113 super.WriteToContext(ctx, action_data);
114
115 ctx.Write(action_data.m_Player.GetLiquidTendencyDrain());
116 }

The documentation for this class was generated from the following file: