3 protected float m_TargetUnits;
4 protected float m_SpentQuantity;
5 protected float m_Time;
6 protected float m_TimeToEjectOneBullet;
7 protected ref Param1<float> m_SpentUnits;
11 m_TimeToEjectOneBullet = eject_time;
19 m_SpentUnits =
new Param1<float>(0);
23 m_SpentUnits.param1 = 0;
27 Class.CastTo(itm, action_data.m_MainItem);
28 m_TargetUnits = itm.GetAmmoCount();
34 if ( !action_data.m_Player )
39 if ( m_TargetUnits == 0 )
45 if ( m_SpentQuantity < m_TargetUnits )
47 m_Time += action_data.m_Player.GetDeltaT();
48 if (
m_Time > m_TimeToEjectOneBullet )
57 CalcAndSetQuantity( action_data );
58 OnCompletePogress(action_data);
66 if ( !action_data.m_Player || !action_data.m_MainItem )
71 CalcAndSetQuantity( action_data );
75 override float GetProgress()
78 return m_SpentQuantity/m_TargetUnits;
83 void CalcAndSetQuantity(
ActionData action_data )
87 if ( action_data.m_MainItem )
90 Class.CastTo(itm, action_data.m_MainItem);
93 m_SpentUnits.param1 = m_SpentQuantity;
94 SetACData(m_SpentUnits);
96 itm.ServerAddAmmoCount(-m_SpentQuantity);