Posted by: DIT_grue
« on: August 17, 2016, 12:16:29 AM »It's not consistent because there's a random factor involved. Trying to dig up the details for this sort of thing can be hit or miss, but this one was easy because I did it earlier in the week for another thread.
The psuedo code is as follows:
Repair Chance = Round Down ((Increment Length in Seconds / Item Cost) x Highest Damage Control Rating*)
If Repair Chance > 1000 Then
Repair Done = True
Else
If Random Number(1000) <= Repair Chance Then
Repair Done = True
End
End
* This is usually the damage control rating of the ship. However, if the ship is in a hangar and the mothership has a higher damage control rating, then the damage control rating of the mothership is used. This could be used by fighters on a carrier or it could be a huge repair ship that takes full size ships into its internal hangar. In this case, the maintenance supplies of the mothership are used.