Cost and Duration
The cost and duration of each repair is calculable. To repair a unit from 1 health to maximum health costs 25% of the total unit cost. For example, fully repairing a unit which is 200 minerals and 200 gas will cost 50 minerals and 50 gas. The time needed to repair a unit is dependent on its build time. A unit which takes 60 seconds to create will also take 60 seconds to repair with a single SCV. These values are proportional. If a unit is half damaged and it takes 60 seconds, 200 minerals, and 200 gas to create, it will cost 30 seconds, 25 minerals, and 25 gas to repair.
Buildings are the same, however due to Terran buildings catching fire and receiving damage below 33% life, that extra damage must also be repaired thus giving the effect of an extra cost. Buildings which are under construction cannot be repaired until construction is finished.
The Command Center behaves differently from all other buildings because it can be changed into a Planetary Fortress or Orbital Command. After the building is upgraded, the cost and build time of the upgrade is added to the cost and build time of the Command Center to determine its repair duration and cost. So, if a Command Center takes 100 seconds to build and costs 400 minerals and a Planetary Fortress costs 150 minerals, 150 gas, and 60 seconds, then the total cost of the building is 550 minerals (400 + 150), 150 gas (0 + 150), and 160 seconds (100 + 60). Because of this, the Planetary Fortress will cost 138 minerals (550 / 4), 38 gas (150 / 4), and 160 seconds to fully repair.
Adding an additional SCV does not change the final cost of the repair, but repair time is inversely proportional to the number of SCV's repairing.
A MULE repairs at exactly the same rate and cost of an SCV. A MULE can also be repaired, with its value approximated at 60 minerals and a build time of 17 seconds.
SCVs set to auto-repair (Medivac/Bunker will automatically repair any other mechanical units inside of the Medivac/Bunker. However, SCVs inside a Medivac/Bunker cannot repair the Medivac/Bunker itself while they are cargo. They must leave the Medivac/Bunker in order to repair it.+ ) that are placed in a
When an SCV repairs a unit it gains the same AI targeting priority as the unit which it is repairing. This means a unit which attack-moves toward a unit which is being repaired the AI will target whichever unit is closer, the SCV or the unit being repaired. This statement also assumes that the unit was already being repaired by an SCV. If a unit is at full health and takes damage then an SCV starts repairing, the unit will not change targets until it is re-ordered to attack, such as a new attack-move order.
For players struggling to attack the repairing SCVs, such as with a Thor which is very large, a useful strategy is to simply move command your units past the unit being repaired such that the SCVs end up between the target and your units.
The Repair ability can also be used on units from other races that have the Mechanical trait. Although this rules out all of Zerg's buildings and units, it does include the majority of Protoss units. However, Repair cannot be used on Protoss structures.
Note that SCVs cannot repair shields. This ability works on hit points only.