Merge cap regen graph into already existing cap graph

This commit is contained in:
DarkPhoenix
2019-06-28 20:17:23 +03:00
parent d448116e91
commit 988688939b
5 changed files with 75 additions and 73 deletions

View File

@@ -1,14 +0,0 @@
import math
from .base import SmoothGraph
class FitCapRegenVsCapPercGraph(SmoothGraph):
def getYForX(self, fit, extraData, perc):
maxCap = fit.ship.getModifiedItemAttr('capacitorCapacity')
regenTime = fit.ship.getModifiedItemAttr('rechargeRate') / 1000
currentCap = maxCap * perc / 100
# https://wiki.eveuniversity.org/Capacitor#Capacitor_recharge_rate
regen = 10 * maxCap / regenTime * (math.sqrt(currentCap / maxCap) - currentCap / maxCap)
return regen