3 bool m_TendencyRecived;
13 private const float TIME_TO_REPEAT = 0.25;
15 override void CreateActionComponent()
17 if (TransferLiquidActionData.Cast(m_ActionData))
34 override void CreateConditionComponents()
40 override bool HasProneException()
45 override string GetText()
48 if ( player.GetLiquidTendencyDrain() )
49 return "#drain_liquid";
51 return "#pour_liquid";
58 if ( target_item && item )
60 bool can_drain =
Liquid.CanTransfer(target_item,item);
61 bool can_pour =
Liquid.CanTransfer(item,target_item);
63 if (can_drain && can_pour)
67 else if (!can_pour && can_drain)
69 if ( (!
GetGame().IsDedicatedServer()) && !player.GetLiquidTendencyDrain() )
71 player.SetLiquidTendencyDrain(
true);
79 else if (!can_drain && can_pour)
81 if ( (!
GetGame().IsDedicatedServer()) && player.GetLiquidTendencyDrain() )
83 player.SetLiquidTendencyDrain(
false);
95 override void OnStartClient(
ActionData action_data )
97 TransferLiquidActionData.Cast(action_data).m_Tendency = action_data.m_Player.GetLiquidTendencyDrain();
100 override void OnStartServer(
ActionData action_data )
102 if (!
GetGame().IsMultiplayer())
103 TransferLiquidActionData.Cast(action_data).m_Tendency = action_data.m_Player.GetLiquidTendencyDrain();
106 override void OnFinishProgressServer(
ActionData action_data )
113 TransferLiquidActionData action_data =
new TransferLiquidActionData;
119 super.WriteToContext(ctx, action_data);
121 ctx.Write(action_data.m_Player.GetLiquidTendencyDrain());
124 override bool ReadFromContext(
ParamsReadContext ctx, out ActionReciveData action_recive_data )
126 if(!action_recive_data)
132 super.ReadFromContext(ctx, action_recive_data);
135 if ( !ctx.Read(tendency_drain) )
137 recive_data_transfer.m_TendencyRecived = tendency_drain;
141 override void HandleReciveData(ActionReciveData action_recive_data,
ActionData action_data)
143 super.HandleReciveData(action_recive_data, action_data);
146 TransferLiquidActionData.Cast(action_data).m_Tendency = recive_data_transfer.m_TendencyRecived;
149 override void OnStartAnimationLoop(
ActionData action_data )
154 Param1<bool> play =
new Param1<bool>(
true );
155 if (TransferLiquidActionData.Cast(action_data))
157 if (TransferLiquidActionData.Cast(action_data).m_Tendency ==
true)
159 else if (!TransferLiquidActionData.Cast(action_data).m_Tendency ==
false)
165 override void OnEndAnimationLoop(
ActionData action_data )
170 Param1<bool> play =
new Param1<bool>(
false );
171 if (TransferLiquidActionData.Cast(action_data).m_Tendency)