Skip to content

Commit

Permalink
Fix #137 - TP and Webs affect DPS in graph
Browse files Browse the repository at this point in the history
  • Loading branch information
blitzmann committed Jul 21, 2014
1 parent 979539c commit c76e4c8
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion eos/graph/fitDps.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from eos.graph import Graph, Data
from eos.types import Hardpoint, State
from math import log, sin, radians
from math import log, sin, radians, exp

class FitDpsGraph(Graph):
defaults = {"angle": 0,
Expand All @@ -32,9 +32,29 @@ def __init__(self, fit, data=None):
self.fit = fit

def calcDps(self, data):
ew = {'signatureRadius':[],'velocity':[]}
fit = self.fit
total = 0
distance = data["distance"] * 1000
abssort = lambda val: -abs(val - 1)

for mod in fit.modules:
if not mod.isEmpty and mod.state >= State.ACTIVE:
if "ewTargetPaint" in mod.item.effects:
ew['signatureRadius'].append(1+(mod.getModifiedItemAttr("signatureRadiusBonus") / 100))
if "decreaseTargetSpeed" in mod.item.effects:
ew['velocity'].append(1+(mod.getModifiedItemAttr("speedFactor") / 100))

ew['signatureRadius'].sort(key=abssort)
ew['velocity'].sort(key=abssort)

for attr, values in ew.iteritems():
val = data[attr]
for i in xrange(len(values)):
bonus = values[i]
val *= 1 + (bonus - 1) * exp(- i ** 2 / 7.1289)
data[attr] = val

for mod in fit.modules:
if mod.hardpoint == Hardpoint.TURRET:
if mod.state >= State.ACTIVE:
Expand Down

0 comments on commit c76e4c8

Please sign in to comment.