56 {
58 Construction construction = base_building.GetConstruction();
59 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
60 ConstructionPart construction_part = construction_action_data.
GetTargetPart();
61
62 if ( construction.CanDestroyPart( construction_part.
GetPartName() ) )
63 {
64
66 string zone_name;
67 DamageSystem.GetDamageZoneFromComponentName(base_building,part_name,zone_name);
68
69 if (zone_name != "")
70 {
71 base_building.AddHealth(zone_name,
"Health",-(base_building.GetMaxHealth(zone_name,
"")/
CYCLES));
72 if ( base_building.GetHealth(zone_name,"Health") < 1 )
74 }
75 else
76 {
78 }
79
80
81 action_data.m_MainItem.DecreaseHealth( UADamageApplied.DESTROY, false );
82 }
83 }
const int AT_DESTROY_PART
void Construction(BaseBuildingBase parent)
ConstructionPart GetTargetPart()