3 static const float TIME_SAW_HANDSAW = 1.5;
4 static const float TIME_SAW_HACKSAW = 3.0;
5 static const float TIME_AXES = 1.2;
7 override void CreateActionComponent()
12 float GetDefaultTime()
14 string item_type = m_ActionData.m_MainItem.GetType();
19 return TIME_SAW_HACKSAW;
23 return TIME_SAW_HANDSAW;
30 Print(
"ActionSawPlanksCB | Item detection error, assigning negative time");
37 static const int DECREASE_HEALTH_OF_TOOL_DEFAULT = 10;
41 static const int YIELD = 3;
56 override void CreateConditionComponents()
64 Object target_O = target.GetObject();
66 if ( item && target_O.IsInherited(PileOfWoodenPlanks))
68 string item_type = item.GetType();
73 if ( item.HasEnergyManager() && item.GetCompEM().CanWork() )
90 override void OnFinishProgressServer(
ActionData action_data )
92 PileOfWoodenPlanks item_POWP = PileOfWoodenPlanks.Cast( action_data.m_Target.GetObject() );
93 item_POWP.RemovePlanks(YIELD);
95 vector pos = action_data.m_Player.GetPosition();
99 m_Planks.GetInventory().GetCurrentInventoryLocation(currentLoc);
101 if (!m_Planks || !currentLoc.CompareLocationOnly(m_PlanksLocation))
104 m_Planks.SetQuantity(YIELD);
106 m_Planks.GetInventory().GetCurrentInventoryLocation(currentLoc);
107 m_PlanksLocation.Copy(currentLoc);
109 else if ((m_Planks.GetQuantity() + YIELD) >= m_Planks.GetQuantityMax())
111 int remnant = m_Planks.GetQuantity() + YIELD - m_Planks.GetQuantityMax();
112 m_Planks.SetQuantity(m_Planks.GetQuantityMax());
116 m_Planks.SetQuantity(remnant);
118 m_Planks.GetInventory().GetCurrentInventoryLocation(currentLoc);
119 m_PlanksLocation.Copy(currentLoc);
124 m_Planks.AddQuantity(YIELD);
127 ItemBase item = action_data.m_MainItem;
129 string item_type = item.GetType();