3 protected float m_SlotFertilizerNeed;
4 protected float m_TimeToComplete;
5 protected float m_SpentQuantityTotal;
6 protected float m_StartQuantity;
8 protected string m_Selection;
12 m_QuantityUsedPerSecond = quantity_used_per_second;
19 if (
Class.CastTo(target_GB, action_data.m_Target.GetObject() ) )
22 m_StartQuantity = action_data.m_MainItem.GetQuantity();
26 m_SpentUnits =
new Param1<float>(0);
30 m_SpentUnits.param1 = 0;
33 if ( action_data.m_MainItem )
34 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
43 target_GB.GetActionComponentNameList(action_data.m_Target.GetComponentIndex(), selections);
45 for (
int s = 0; s < selections.Count(); s++)
48 m_Selection = selections[s];
49 m_Slot = target_GB.GetSlotBySelection( m_Selection );
55 string item_type = action_data.m_MainItem.GetType();
56 float consumed_quantity =
GetGame().ConfigGetFloat(
"cfgVehicles " + item_type +
" Horticulture ConsumedQuantity" );
58 float max = m_Slot.GetFertilizerQuantityMax();
60 m_SlotFertilizerNeed = max - consumed_quantity;
62 m_TimeToComplete = (
Math.Min(m_SlotFertilizerNeed,m_ItemQuantity))/m_QuantityUsedPerSecond;
69 if ( !action_data.m_Player )
74 if ( m_SpentQuantity >= m_ItemQuantity )
80 if ( m_SpentQuantity <= m_ItemQuantity )
82 m_SpentQuantity += m_QuantityUsedPerSecond * action_data.m_Player.GetDeltaT();
83 float val = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus( m_SpentQuantity,
m_Action.GetSpecialtyWeight(),
true );
85 Class.CastTo(garden_base, action_data.m_Target.GetObject() );
88 m_SpentQuantityTotal += m_SpentQuantity;
92 action_data.m_MainItem.AddQuantity( -m_SpentQuantity );
95 garden_base.Fertilize( action_data.m_Player, action_data.m_MainItem, val, m_Selection );
102 OnCompletePogress(action_data);
108 override float GetProgress()
114 return -(m_SpentQuantityTotal / m_StartQuantity);