3 protected float m_PlantNeededSpraying;
4 protected float m_TimeToComplete;
5 protected float m_SpentQuantityTotal;
6 protected float m_StartQuantity;
7 protected PlantBase m_Plant;
11 m_QuantityUsedPerSecond = quantity_used_per_second;
18 if (
Class.CastTo(garden_base, target.GetObject()))
23 garden_base.GetActionComponentNameList(target.GetComponentIndex(), selections);
26 for (
int s = 0; s < selections.Count(); s++)
28 selection = selections[s];
29 slot = garden_base.GetSlotBySelection( selection );
34 if ( slot && slot.GetPlant() )
36 m_Plant = PlantBase.Cast(slot.GetPlant());
40 m_StartQuantity = action_data.m_MainItem.GetQuantity();
43 m_SpentUnits =
new Param1<float>(0);
47 m_SpentUnits.param1 = 0;
49 if ( action_data.m_MainItem )
51 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
55 m_PlantNeededSpraying = m_Plant.GetSprayUsage() - m_Plant.GetSprayQuantity();
58 m_TimeToComplete = (
Math.Min(m_PlantNeededSpraying,m_ItemQuantity))/m_QuantityUsedPerSecond;
91 Object targetObject = action_data.m_Target.GetObject();
93 if ( !action_data.m_Player )
98 if ( m_ItemQuantity <= 0 )
104 if ( m_SpentQuantity < m_ItemQuantity && m_SpentQuantity < m_PlantNeededSpraying )
106 m_SpentQuantity += m_QuantityUsedPerSecond * action_data.m_Player.GetDeltaT();
107 float transfered_spray = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus( m_SpentQuantity,
m_Action.GetSpecialtyWeight(),
true );
109 m_SpentQuantityTotal += m_SpentQuantity;
115 m_Plant.SprayPlant(transfered_spray);
126 OnCompletePogress(action_data);
132 override float GetProgress()
135 return -(m_SpentQuantityTotal / m_StartQuantity);