3 protected float m_ItemQuantity;
4 protected float m_SpentQuantity;
5 protected float m_ItemMaxQuantity;
6 protected float m_TimeElpased;
7 protected float m_QuantityUsedPerSecond;
8 protected float m_AdjustedQuantityUsedPerSecond;
9 protected float m_DefaultTimeToRepeat;
10 protected ref Param1<float> m_SpentUnits;
14 m_QuantityUsedPerSecond = quantity_used_per_second;
15 m_DefaultTimeToRepeat = time_to_repeat;
25 m_SpentUnits =
new Param1<float>( 0 );
29 m_SpentUnits.param1 = 0;
32 m_ItemMaxQuantity = action_data.m_MainItem.GetQuantityMax();
33 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
39 if ( !action_data.m_Player )
44 if ( m_ItemQuantity <= 0 )
50 if ( m_SpentQuantity < m_ItemQuantity )
52 m_AdjustedQuantityUsedPerSecond = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus( m_QuantityUsedPerSecond,
m_Action.GetSpecialtyWeight(),
true);
53 m_SpentQuantity += m_AdjustedQuantityUsedPerSecond * action_data.m_Player.GetDeltaT();
54 m_TimeElpased += action_data.m_Player.GetDeltaT();
56 if ( m_TimeElpased >= m_DefaultTimeToRepeat )
58 CalcAndSetQuantity( action_data );
66 CalcAndSetQuantity( action_data );
67 OnCompletePogress(action_data);
75 if ( !action_data.m_Player )
79 if (GetProgress() > 0)
81 CalcAndSetQuantity( action_data );
86 override float GetProgress()
89 return ( m_ItemQuantity - m_SpentQuantity ) / m_ItemMaxQuantity;
95 void CalcAndSetQuantity(
ActionData action_data )
101 m_SpentUnits.param1 = m_SpentQuantity;
102 SetACData(m_SpentUnits);
105 action_data.m_MainItem.AddQuantity( -m_SpentQuantity,
false,
false );