The following is the code that calculates cost:
float cost = (((ship.getHullSpec().getBaseValue())*0.5F)*betaCoreBonus);
iNode.upkeep += cost; //Add flat cost to monthly report
Well, it's been a long time since I've had to use trigonometry for anything so I could be getting this wrong... but it looks like it is indeed grabbing the repair cost based off the number of d-mods
present at the time and then dividing that as the cost. Which again would be fine if it was automatically fixing
all the d-mods in one pass... except that it often doesn't.
If you have multiple damaged ships, or even just one ship with more than 3 d-mods, then you're still paying the costs based on
all the d-mods on the ship even though it only fixing a partial amount. When the next month rolls around, you end up paying the costs for whatever d-mods are left over
a second time... or even a third or forth.
Meaning float=cost of $1,000,000 for 5 d-mods (@$200,000 each), only 1 gets fixed that month, cost is still $1,000,000. Month two it is down to $800,000, pay $800,000, fix maybe 2 more of them. Now down to 2 left... pay $800,000 in month three, and done. Total cost: $2,600,000 for a $1,000,000 repair job. I have officially paid more than it would have cost in the refit screen.
So.... I'd suggest something more along the lines of this:
float
total cost = (((ship.getHullSpec().getBaseValue())*0.5F)*betaCoreBonus)
float
cycle cost = (float total cost/number of d-mods present)*how many d-mods will be repaired this cycle
So if you have a ship with 5 d-mods and a total cost of $1,000,000 to fix it in drydock and it is only slated to fix 2 of them...
($1,000,000/5)*2=$400,000.
You now pay $400,000 to fix the two d-mods and the rest of the cost gets pushed back until it is actually fixed, because next cycle it will recompute it as $600,000 to fix for 3 d-mods. Drydock fixes 2 of them. $600,000/3=$200,000 (still) * 2 fixed = $400,000. One d-mod to go on month three and it costs $200,000. Ta-da, all $1,000,000 has been spent as it should be.