3 protected float m_TargetUnits;
4 protected float m_SpentQuantity;
5 protected float m_SpentQuantity_total;
6 protected float m_AdjustedQuantityEmptiedPerSecond;
7 protected float m_QuantityEmptiedPerSecond;
8 protected bool m_WringingClothes;
9 protected ref Param1<float> m_SpentUnits;
10 protected float m_TimeElpased;
11 protected float m_DefaultTimeStep = 0.25;
15 m_QuantityEmptiedPerSecond = quantity_emptied_per_second;
22 m_SpentUnits =
new Param1<float>(0);
26 m_SpentUnits.param1 = 0;
29 if ( action_data.m_MainItem.IsClothing() )
31 m_WringingClothes =
true;
33 m_SpentQuantity = action_data.m_MainItem.GetWetMax() - action_data.m_MainItem.GetWet();
34 m_TargetUnits = action_data.m_MainItem.GetWetMax();
38 m_WringingClothes =
false;
40 m_SpentQuantity = action_data.m_MainItem.GetQuantityMin();
41 m_TargetUnits = action_data.m_MainItem.GetQuantity();
44 m_AdjustedQuantityEmptiedPerSecond = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus( m_QuantityEmptiedPerSecond,
m_Action.GetSpecialtyWeight(),
true );
49 if ( !action_data.m_Player )
54 if ( m_WringingClothes && action_data.m_MainItem.GetWet() >= action_data.m_MainItem.GetWetMax() )
60 if ( m_SpentQuantity_total <= m_TargetUnits )
62 m_SpentQuantity += m_AdjustedQuantityEmptiedPerSecond * action_data.m_Player.GetDeltaT();
63 m_TimeElpased += action_data.m_Player.GetDeltaT();
65 if ( m_TimeElpased >= m_DefaultTimeStep )
67 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 float GetProgress()
94 return m_SpentQuantity_total / m_TargetUnits;
99 void CalcAndSetQuantity(
ActionData action_data )
101 m_SpentQuantity_total += m_SpentQuantity;
106 m_SpentUnits.param1 = m_SpentQuantity;
107 SetACData(m_SpentUnits);
110 action_data.m_MainItem.AddQuantity(-m_SpentQuantity);