diff --git a/eos/graph/fitDps.py b/eos/graph/fitDps.py index 957f6778b..ab02bd809 100644 --- a/eos/graph/fitDps.py +++ b/eos/graph/fitDps.py @@ -40,11 +40,14 @@ class FitDpsGraph(Graph): 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: + if "remoteTargetPaintFalloff" in mod.item.effects: + ew['signatureRadius'].append(1+(mod.getModifiedItemAttr("signatureRadiusBonus") / 100) * self.calculateModuleMultiplier(mod, data)) + if "remoteWebifierFalloff" in mod.item.effects: if distance <= mod.getModifiedItemAttr("maxRange"): ew['velocity'].append(1+(mod.getModifiedItemAttr("speedFactor") / 100)) + elif mod.getModifiedItemAttr("falloffEffectiveness") > 0: + #I am affected by falloff + ew['velocity'].append(1+(mod.getModifiedItemAttr("speedFactor") / 100) * self.calculateModuleMultiplier(mod, data)) ew['signatureRadius'].sort(key=abssort) ew['velocity'].sort(key=abssort) @@ -71,7 +74,7 @@ class FitDpsGraph(Graph): if distance <= fit.extraAttributes["droneControlRange"]: for drone in fit.drones: - multiplier = 1 if drone.getModifiedItemAttr("maxVelocity") > 0 else self.calculateTurretMultiplier(drone, data) + multiplier = 1 if drone.getModifiedItemAttr("maxVelocity") > 1 else self.calculateTurretMultiplier(drone, data) dps, _ = drone.damageStats(fit.targetResists) total += dps * multiplier return total @@ -122,3 +125,13 @@ class FitDpsGraph(Graph): rangeEq = ((max(0, distance - turretOptimal)) / turretFalloff) ** 2 return 0.5 ** (trackingEq + rangeEq) + + def calculateModuleMultiplier(self, mod, data): + #Simplified formula, we make some assumptions about the module + #This is basically the calculateTurretChanceToHit without tracking values + distance = data["distance"] * 1000 + turretOptimal = mod.maxRange + turretFalloff = mod.falloff + rangeEq = ((max(0, distance - turretOptimal)) / turretFalloff) ** 2 + + return 0.5 ** (rangeEq) diff --git a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py index e028ef478..1701e670b 100644 --- a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py +++ b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py @@ -14,9 +14,10 @@ class PFHTMLExportPref ( PreferenceView): desc = "HTML Export (File > Export HTML) allows you to export your entire fitting "+\ "database into an HTML file at the specified location. This file can be "+\ "used in the in-game browser to easily open and import your fits, or used "+\ - "in a regular web browser to open them at NULL-SEC.com." + "in a regular web browser to open them at NULL-SEC.com or Osmium." desc2 = "Enabling automatic exporting will update the HTML file after any change "+\ "to a fit is made. Under certain circumstance, this may cause performance issues." + desc3 = "Preferred website to view fits while not using in-game browser can be selected below." def populatePanel( self, panel ): self.mainFrame = gui.mainFrame.MainFrame.getInstance() @@ -57,6 +58,24 @@ class PFHTMLExportPref ( PreferenceView): self.exportEnabled.Bind(wx.EVT_CHECKBOX, self.OnExportEnabledChange) mainSizer.Add( self.exportEnabled, 0, wx.ALL|wx.EXPAND, 5 ) + self.stDesc3 = wx.StaticText( panel, wx.ID_ANY, self.desc3, wx.DefaultPosition, wx.DefaultSize, 0 ) + self.stDesc3.Wrap(dlgWidth - 50) + mainSizer.Add( self.stDesc3, 0, wx.ALL, 5 ) + + websiteSizer = wx.BoxSizer( wx.HORIZONTAL ) + + self.stWebsite = wx.StaticText( panel, wx.ID_ANY, u"Website:", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.stWebsite.Wrap( -1 ) + websiteSizer.Add( self.stWebsite, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) + + self.chWebsiteChoices = [ "o.smium.org", "null-sec.com" ] + self.chWebsiteType = wx.Choice( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, self.chWebsiteChoices, 0 ) + self.chWebsiteType.SetStringSelection( self.HTMLExportSettings.getWebsite() ) + websiteSizer.Add( self.chWebsiteType, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) + self.chWebsiteType.Bind(wx.EVT_CHOICE, self.OnCHWebsiteTypeSelect) + + mainSizer.Add( websiteSizer, 0, wx.EXPAND, 5 ) + panel.SetSizer( mainSizer ) panel.Layout() @@ -75,6 +94,10 @@ class PFHTMLExportPref ( PreferenceView): def OnExportEnabledChange(self, event): self.HTMLExportSettings.setEnabled(self.exportEnabled.GetValue()) + def OnCHWebsiteTypeSelect(self, event): + choice = self.chWebsiteType.GetStringSelection() + self.HTMLExportSettings.setWebsite(choice) + def getImage(self): return BitmapLoader.getBitmap("prefs_html", "gui") diff --git a/gui/utils/exportHtml.py b/gui/utils/exportHtml.py index d7e25c04a..8de0f35eb 100644 --- a/gui/utils/exportHtml.py +++ b/gui/utils/exportHtml.py @@ -45,6 +45,12 @@ class exportHtmlThread(threading.Thread): timestamp = time.localtime(time.time()) localDate = "%d/%02d/%02d %02d:%02d" % (timestamp[0], timestamp[1], timestamp[2], timestamp[3], timestamp[4]) + + website = settings.getWebsite() + if website == "o.smium.org": + dnaUrl = "https://o.smium.org/loadout/dna/" + elif website == "null-sec.com": + dnaUrl = "https://null-sec.com/hangar/?dna=" HTML = """ @@ -126,7 +132,7 @@ class exportHtmlThread(threading.Thread): if (typeof CCPEVE !== 'undefined') { // inside IGB $(this).attr('href', 'javascript:CCPEVE.showFitting("'+dna+'");'); } else { // outside IGB - $(this).attr('href', 'https://null-sec.com/hangar/?dna='+dna); } + $(this).attr('href', '%s'+dna); } }); }); @@ -139,7 +145,7 @@ class exportHtmlThread(threading.Thread):
Last updated: %s ()
-""" % (time.time(), localDate) +""" % (time.time(), dnaUrl, localDate) HTML += '