3 protected float m_PlantThirstyness;
4 protected float m_TimeToComplete;
8 m_QuantityUsedPerSecond = quantity_used_per_second;
14 if (
Class.CastTo(target_PB, action_data.m_Target.GetObject()))
19 m_SpentUnits =
new Param1<float>(0);
23 m_SpentUnits.param1 = 0;
25 if ( action_data.m_MainItem )
27 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
31 m_PlantThirstyness = target_PB.GetWaterMax() - target_PB.GetWater();
34 m_TimeToComplete = (
Math.Min(m_PlantThirstyness,m_ItemQuantity))/m_QuantityUsedPerSecond;
40 if ( !action_data.m_Player )
45 if ( m_ItemQuantity <= 0 )
51 if ( m_SpentQuantity < m_ItemQuantity && m_SpentQuantity < m_PlantThirstyness )
53 m_AdjustedQuantityUsedPerSecond = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus( m_QuantityUsedPerSecond,
m_Action.GetSpecialtyWeight(),
true);
54 m_SpentQuantity += m_QuantityUsedPerSecond * action_data.m_Player.GetDeltaT();
59 Class.CastTo(plant, action_data.m_Target.GetObject() );
60 Slot slot = plant.GetSlot();
61 slot.GiveWater( m_SpentQuantity );
68 OnCompletePogress(action_data);
74 override float GetProgress()
77 return (m_SpentQuantity*m_QuantityUsedPerSecond)/m_TimeToComplete;