3 protected float m_InitItemQuantity;
4 protected float m_SpentQuantityTotal;
8 m_QuantityUsedPerSecond = quantity_used_per_second;
9 m_DefaultTimeToRepeat = time_to_repeat;
10 m_InitItemQuantity = -1;
11 m_SpentQuantityTotal = 0;
16 super.Setup( action_data );
18 if (m_InitItemQuantity < 0)
20 m_InitItemQuantity = action_data.m_MainItem.GetQuantity();
24 override void CalcAndSetQuantity(
ActionData action_data )
29 m_SpentUnits.param1 = m_SpentQuantity;
30 SetACData(m_SpentUnits);
32 m_SpentQuantityTotal += m_SpentQuantity;
42 ntarget.Consume(action_data.m_MainItem, m_SpentQuantity,
EConsumeType.ITEM_CONTINUOUS);
51 action_data.m_Player.Consume(action_data.m_MainItem, m_SpentQuantity,
EConsumeType.ITEM_CONTINUOUS);
56 override float GetProgress()
59 if (m_SpentQuantity > 0)
61 return Math.Clamp((1 - (m_InitItemQuantity - m_SpentQuantity - m_SpentQuantityTotal ) / m_InitItemQuantity), 0, 1);
65 return Math.Clamp((1 - (m_InitItemQuantity - m_SpentQuantityTotal ) / m_InitItemQuantity), 0, 1);