3 protected float m_TargetUnits;
4 protected float m_SpentQuantity;
5 protected float m_SpentQuantity_total;
6 protected float m_ItemQuantity;
7 protected float m_AdjustedQuantityFilledPerSecond;
8 protected float m_QuantityFilledPerSecond;
9 protected ref Param1<float> m_SpentUnits;
10 protected float m_TimeElpased;
11 protected float m_DefaultTimeStep = 0.25;
12 protected int m_liquid_type;
16 m_QuantityFilledPerSecond = quantity_filled_per_second;
17 m_liquid_type = liquid_type;
26 m_SpentUnits =
new Param1<float>(0);
30 m_SpentUnits.param1 = 0;
33 float throughputCoef = action_data.m_MainItem.GetLiquidThroughputCoef();
35 if (action_data.m_Target && action_data.m_Target.GetObject() &&
Class.CastTo(entity,action_data.m_Target.GetObject()))
37 throughputCoef =
Math.Min(throughputCoef,entity.GetLiquidThroughputCoef());
39 m_QuantityFilledPerSecond *= throughputCoef;
41 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
42 m_TargetUnits = action_data.m_MainItem.GetQuantityMax() - action_data.m_MainItem.GetQuantity();
43 m_AdjustedQuantityFilledPerSecond = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus( m_QuantityFilledPerSecond,
m_Action.GetSpecialtyWeight(),
true );
48 if ( !action_data.m_Player )
53 if ( action_data.m_MainItem.GetQuantity() >= action_data.m_MainItem.GetQuantityMax() )
59 if ( m_SpentQuantity_total < m_TargetUnits )
61 m_SpentQuantity += m_AdjustedQuantityFilledPerSecond * action_data.m_Player.GetDeltaT();
62 m_TimeElpased += action_data.m_Player.GetDeltaT();
64 if ( m_TimeElpased >= m_DefaultTimeStep )
66 CalcAndSetQuantity( action_data );
74 CalcAndSetQuantity( action_data );
75 OnCompletePogress(action_data);
83 if ( !action_data.m_Player || !action_data.m_MainItem )
88 CalcAndSetQuantity( action_data );
92 override int Interrupt(
ActionData action_data )
96 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(
UASoftSkillsWeight.PRECISE_LOW );
99 return super.Interrupt( action_data );
102 override float GetProgress()
104 return m_SpentQuantity_total/m_TargetUnits;
108 void CalcAndSetQuantity(
ActionData action_data)
110 m_SpentQuantity_total += m_SpentQuantity;
115 m_SpentUnits.param1 = m_SpentQuantity;
116 SetACData(m_SpentUnits);
119 bool injectAgents =
true;
120 if (action_data.m_Target.GetObject() && (action_data.m_Target.GetObject().GetWaterSourceObjectType() ==
EWaterSourceObjectType.WELL || action_data.m_Target.GetObject().IsWell()))
121 injectAgents =
false;
123 Liquid.FillContainerEnviro(action_data.m_MainItem, m_liquid_type, m_SpentQuantity, injectAgents);