3 protected float m_PlantThirstyness;
4 protected float m_TimeToComplete;
5 protected float m_SpentQuantityTotal;
6 protected float m_StartQuantity;
11 m_QuantityUsedPerSecond = quantity_used_per_second;
18 if (
Class.CastTo(target_GB, action_data.m_Target.GetObject()) )
21 m_StartQuantity = action_data.m_MainItem.GetQuantity();
24 m_SpentUnits =
new Param1<float>(0);
28 m_SpentUnits.param1 = 0;
31 if ( action_data.m_MainItem )
32 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
37 target_GB.GetActionComponentNameList(action_data.m_Target.GetComponentIndex(), selections);
39 for (
int s = 0; s < selections.Count(); s++)
41 string selection = selections[s];
42 m_Slot = target_GB.GetSlotBySelection( selection );
47 m_PlantThirstyness = m_Slot.GetWaterUsage() - m_Slot.GetWater();
50 m_TimeToComplete = (
Math.Min(m_PlantThirstyness,m_ItemQuantity))/m_QuantityUsedPerSecond;
52 if (m_TimeToComplete <= 0.1)
54 m_TimeToComplete = 0.1;
62 Class.CastTo(target_GB, action_data.m_Target.GetObject() );
63 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
64 m_ItemMaxQuantity = action_data.m_MainItem.GetQuantityMax();
66 if ( !action_data.m_Player )
71 if ( m_ItemQuantity <= 0 )
77 if ( m_Slot && m_SpentQuantity < m_ItemQuantity )
79 m_SpentQuantity += m_QuantityUsedPerSecond * action_data.m_Player.GetDeltaT();
80 float water = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus( m_SpentQuantity,
m_Action.GetSpecialtyWeight(),
true );
81 m_Slot.GiveWater( water );
83 m_SpentQuantityTotal += m_SpentQuantity;
93 OnCompletePogress( action_data );
100 override float GetProgress()
102 if ( m_ItemQuantity <= 0 )
104 float progress = -(m_SpentQuantityTotal / m_StartQuantity);