3 protected float m_ItemQuantity;
4 protected float m_SpentQuantity;
5 protected float m_ItemMaxQuantity;
6 protected float m_QuantityUsedPerSecond;
7 protected float m_AdjustedQuantityUsedPerSecond;
8 protected ref Param1<float> m_SpentUnits;
12 m_QuantityUsedPerSecond = quantity_used_per_second;
20 m_SpentUnits =
new Param1<float>(0);
24 m_SpentUnits.param1 = 0;
26 m_ItemMaxQuantity = action_data.m_MainItem.GetQuantityMax();
27 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
33 if ( !action_data.m_Player )
38 if ( m_ItemQuantity <= 0 )
44 if ( m_SpentQuantity < m_ItemQuantity )
46 m_AdjustedQuantityUsedPerSecond = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus( m_QuantityUsedPerSecond,
m_Action.GetSpecialtyWeight(),
true);
47 m_SpentQuantity += m_AdjustedQuantityUsedPerSecond * action_data.m_Player.GetDeltaT();
52 CalcAndSetQuantity( action_data );
53 OnCompletePogress(action_data);
61 if ( !action_data.m_Player )
66 CalcAndSetQuantity( action_data );
70 override float GetProgress()
73 return m_SpentQuantity/m_ItemQuantity;
79 void CalcAndSetQuantity(
ActionData action_data )
85 m_SpentUnits.param1 = m_SpentQuantity;
86 SetACData(m_SpentUnits);
89 if (action_data.m_MainItem)
91 action_data.m_MainItem.AddQuantity(- m_SpentQuantity,
false,
false);