42 static const int DECREASE_HEALTH_OF_TOOL_DEFAULT = 10;
46 static const int YIELD = 3;
59 override void CreateConditionComponents()
67 Object target_O = target.GetObject();
69 if ( item && target_O.IsInherited(PileOfWoodenPlanks))
71 string item_type = item.GetType();
76 if ( item.HasEnergyManager() && item.GetCompEM().CanWork() )
93 override ActionData CreateActionData()
99 override void OnFinishProgressServer( ActionData action_data )
103 PileOfWoodenPlanks item_POWP = PileOfWoodenPlanks.Cast( sawPlanksData.m_Target.GetObject() );
104 item_POWP.RemovePlanks(YIELD);
106 if (!sawPlanksData.m_LastPlanksPile)
110 else if ((sawPlanksData.m_LastPlanksPile.GetQuantity() + YIELD) >= sawPlanksData.m_LastPlanksPile.GetQuantityMax())
112 int remnant = sawPlanksData.m_LastPlanksPile.GetQuantity() + YIELD - sawPlanksData.m_LastPlanksPile.GetQuantityMax();
113 sawPlanksData.m_LastPlanksPile.SetQuantity(sawPlanksData.m_LastPlanksPile.GetQuantityMax());
120 sawPlanksData.m_LastPlanksPile.AddQuantity(YIELD);
123 sawPlanksData.m_MainItem.DecreaseHealth(
"",
"",
UADamageApplied.SAW_PLANKS);
129 planksNewResult.SetQuantity(quantity);
130 data.m_LastPlanksPile = planksNewResult;