Skip to content
Permalink
Browse files

Make Titan DD's active, and add DPS numbers for them.

  • Loading branch information...
Ebag333 committed Jun 24, 2017
1 parent 7cce5d0 commit 724862827506e0d7962273484c52bbf0ae8e6365
@@ -0,0 +1,6 @@
effectType = "active"


def handler(fit, src, context):
# Used to make modules active
pass
@@ -62,7 +62,7 @@ def rel_listener(target, value, initiator):
if not target or (isinstance(value, Module) and value.isEmpty):
return

pyfalog.debug('{0} changed the relationship with {1}', repr(value), repr(target))
pyfalog.debug(u'Changed the relationship with {0}', target.ship.name)
target.modified = datetime.datetime.now()


@@ -480,7 +480,7 @@ def addCommandBonus(self, warfareBuffID, value, _module, effect, runTime="normal
self.commandBonuses[warfareBuffID] = (runTime, value, _module, effect)

def __runCommandBoosts(self, runTime="normal"):
pyfalog.debug("Applying gang boosts for {0}", repr(self))
pyfalog.debug(u"Applying gang boosts for {0}", self.name)
for warfareBuffID in self.commandBonuses.keys():
# Unpack all data required to run effect properly
effect_runTime, value, thing, effect = self.commandBonuses[warfareBuffID]
@@ -315,8 +315,15 @@ def damageStats(self, targetResists):
volley *= self.getModifiedItemAttr("damageMultiplier") or 1
if volley:
cycleTime = self.cycleTime
# Some weapons repeat multiple times in one cycle (think doomsdays)
# Get the number of times it fires off
weaponDoT = max(
self.getModifiedItemAttr("doomsdayDamageDuration", 1) / self.getModifiedItemAttr("doomsdayDamageCycleTime", 1),
1
)

self.__volley = volley
self.__dps = volley / (cycleTime / 1000.0)
self.__dps = (volley * weaponDoT) / (cycleTime / 1000.0)

return self.__dps, self.__volley

@@ -146,7 +146,7 @@ def RefreshList(self, doRefresh=False, doFocus=False):
self.SetFocus()

for i in xrange(len(self._wList)):
iwidth, iheight = self._wList[i].GetSize()
__, iheight = self._wList[i].GetSize()
self._wList[i].SetSize((cwidth, iheight))
if doRefresh is True:
self._wList[i].Refresh()
@@ -33,7 +33,7 @@
"DarkPhoenix \tKadesh Priestess (retired)",
"Darriele \t\tDarriele (retired)",
)
credits = (
devcredits = (
"Entity (Entity) \tCapacitor calculations / EVEAPI python lib / Reverence",
"Aurora \t\tMaths",
"Corollax (Aamrr) \tVarious EOS / pyfa improvements",
@@ -28,7 +28,7 @@ def populateFits(cls, evt):
if evt is not None:
ids = getattr(evt, 'typeID')
if not isinstance(ids, set):
ids = set([ids])
ids = {ids}
else:
ids = None

@@ -67,7 +67,7 @@ def getSubMenu(self, context, selection, rootMenu, i, pitem):

if len(self.__class__.commandFits) < 15:
for fit in sorted(self.__class__.commandFits, key=lambda x: x.name):
pyfalog.debug(repr(fit))
pyfalog.debug(fit.name)
menuItem = self.addFit(rootMenu if msw else sub, fit, True)
sub.AppendItem(menuItem)
else:
@@ -149,10 +149,10 @@ def refreshPanel(self, fit):
else:
self.stEff.Hide()

stats = (("labelFullDpsWeapon", lambda: fit.weaponDPS, 3, 0, 0, "%s DPS", None),
("labelFullDpsDrone", lambda: fit.droneDPS, 3, 0, 0, "%s DPS", None),
("labelFullVolleyTotal", lambda: fit.totalVolley, 3, 0, 0, "%s", "Volley: %.1f"),
("labelFullDpsTotal", lambda: fit.totalDPS, 3, 0, 0, "%s", None))
stats = (("labelFullDpsWeapon", lambda: fit.weaponDPS, 3, 0, 3, "%s DPS", None),
("labelFullDpsDrone", lambda: fit.droneDPS, 3, 0, 3, "%s DPS", None),
("labelFullVolleyTotal", lambda: fit.totalVolley, 3, 0, 3, "%s", "Volley: %.1f"),
("labelFullDpsTotal", lambda: fit.totalDPS, 3, 0, 3, "%s", None))
# See GH issue #
# if fit is not None and fit.totalYield > 0:
# self.miningyield.Show()
@@ -35,6 +35,9 @@


class BaseName(ViewColumn):
def delayedText(self, display, colItem):
pass

name = "Base Name"

def __init__(self, fittingView, params):
@@ -44,7 +47,8 @@ def __init__(self, fittingView, params):
self.columnText = "Name"
self.shipImage = fittingView.imageList.GetImageIndex("ship_small", "gui")
self.mask = wx.LIST_MASK_TEXT
self.projectedView = isinstance(fittingView, gui.projectedView.ProjectedView)
# We can't do an isInstance here because we'll get a circular import
self.projectedView = type(fittingView).__name__ == "ProjectedView"

def getColumnText(self, stuff):
if isinstance(stuff, Drone):
@@ -63,8 +67,7 @@ def getColumnText(self, stuff):
if info:
return "%dx %s (%s)" % (stuff.getProjectionInfo(fitID).amount, stuff.name, stuff.ship.item.name)

pyfalog.warning("Projected View trying to display things that aren't there. stuff: {}, info: {}", repr(stuff),
info)
pyfalog.warning(u"Projected View trying to display things that aren't there.")
return "<unknown>"
else:
return "%s (%s)" % (stuff.name, stuff.ship.item.name)
@@ -31,6 +31,9 @@


class Miscellanea(ViewColumn):
def delayedText(self, display, colItem):
pass

name = "Miscellanea"

def __init__(self, fittingView, params=None):
@@ -72,6 +75,31 @@ def __getData(self, stuff):

if itemGroup == "Ship Modifiers":
return "", None
elif itemGroup in ("Super Weapon", "Structure Doomsday Weapon"):
doomsday_duration = stuff.getModifiedItemAttr("doomsdayDamageDuration", 1)
doomsday_dottime = stuff.getModifiedItemAttr("doomsdayDamageCycleTime", 1)
func = stuff.getModifiedItemAttr

volley = sum(
map(
lambda attr: (func("%sDamage" % attr) or 0),
("em", "thermal", "kinetic", "explosive")
)
)
volley *= stuff.getModifiedItemAttr("damageMultiplier") or 1

if volley <= 0:
text = ""
tooltip = ""
elif max(doomsday_duration / doomsday_dottime, 1) > 1:
text = "{0} dmg over {1} s".format(formatAmount(volley * (doomsday_duration / doomsday_dottime), 3, 0, 3), doomsday_duration / 1000)
tooltip = "Raw damage done over time"
else:
text = "{0} dmg".format(formatAmount(volley * (doomsday_duration / doomsday_dottime), 3, 0, 3))
tooltip = "Raw damage done"
return text, tooltip

pass
elif itemGroup in ("Energy Weapon", "Hybrid Weapon", "Projectile Weapon", "Combat Drone", "Fighter Drone"):
trackingSpeed = stuff.getModifiedItemAttr("trackingSpeed")
if not trackingSpeed:
@@ -524,7 +552,7 @@ def __getData(self, stuff):

duration = cycles * cycleTime / 1000
for number_of_cycles in {5, 10, 25}:
tooltip = "{0}\n{1} charges lasts {2} seconds ({3} cycles)".format(
tooltip = "{0}\n{1} charges lasts {2} ` ({3} cycles)".format(
tooltip,
formatAmount(number_of_cycles * cycles, 3, 0, 3),
formatAmount((duration + reload_time) * number_of_cycles, 3, 0, 3),
@@ -795,7 +795,7 @@ def __fetchCallback(self, e=None):
if e is None:
self.stStatus.SetLabel("Successfully fetched {}\'s skills from EVE API.".format(charName))
else:
exc_type, exc_obj, __ = e
__, exc_obj, __ = e
pyfalog.error("Unable to retrieve {0}\'s skills. Error message:\n{1}".format(charName, exc_obj))
self.stStatus.SetLabel("Unable to retrieve {}\'s skills. Error message:\n{}".format(charName, exc_obj))

@@ -230,7 +230,7 @@ def populate(self, stuff):
if listItemCount > stuffItemCount:
if listItemCount - stuffItemCount > 20 > stuffItemCount:
self.DeleteAllItems()
for i in range(stuffItemCount):
for __ in range(stuffItemCount):
self.InsertStringItem(sys.maxint, "")
else:
for i in range(listItemCount - stuffItemCount):
@@ -28,6 +28,7 @@
from gui.utils.helpers_wxPython import DragDropHelper
from service.fit import Fit
from service.market import Market
from gui.utils.helpers_static import DRONE_ORDER


class DroneViewDrop(wx.PyDropTarget):
@@ -155,17 +156,12 @@ def _merge(self, src, dst):
if sFit.mergeDrones(fitID, self.drones[src], self.drones[dst]):
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))

DRONE_ORDER = ('Light Scout Drones', 'Medium Scout Drones',
'Heavy Attack Drones', 'Sentry Drones', 'Fighters',
'Fighter Bombers', 'Combat Utility Drones',
'Electronic Warfare Drones', 'Logistic Drones', 'Mining Drones', 'Salvage Drones')

def droneKey(self, drone):
sMkt = Market.getInstance()

groupName = sMkt.getMarketGroupByItem(drone.item).name

return (self.DRONE_ORDER.index(groupName),
return (DRONE_ORDER.index(groupName),
drone.item.name)

def fitChanged(self, event):
@@ -22,7 +22,6 @@
import threading
import time
import webbrowser
from codecs import open
from time import gmtime, strftime

import sqlalchemy
@@ -53,7 +52,6 @@
from gui.characterSelection import CharacterSelection
from gui.chromeTabs import PFNotebook
from gui.copySelectDialog import CopySelectDialog
from gui.graphFrame import GraphFrame
from gui.mainMenuBar import MainMenuBar
from gui.marketBrowser import ItemSelected, MarketBrowser
from gui.multiSwitch import MultiSwitch
@@ -67,6 +65,7 @@
from gui.updateDialog import UpdateDialog
from gui.utils.clipboard import fromClipboard, toClipboard
from gui.utils.helpers_wxPython import Frame
from gui.utils.ExportHtml import ExportHtml
from service.character import Character
from service.fit import Fit
from service.port import IPortUser, Port
@@ -366,7 +365,7 @@ def ShowAboutBox(self, evt):
info.Description = wordwrap(gui.aboutData.description + "\n\nDevelopers:\n\t" +
"\n\t".join(gui.aboutData.developers) +
"\n\nAdditional credits:\n\t" +
"\n\t".join(gui.aboutData.credits) +
"\n\t".join(gui.aboutData.devcredits) +
"\n\nLicenses:\n\t" +
"\n\t".join(gui.aboutData.licenses) +
"\n\nEVE Data: \t" + gamedata_version +
@@ -881,7 +880,6 @@ def backupToXml(self, event):
self.progressDialog.ShowModal()

def exportHtml(self, event):
from gui.utils.exportHtml import ExportHtml
sFit = Fit.getInstance()
settings = HTMLExportSettings.getInstance()

@@ -1034,7 +1032,7 @@ def closeWaitDialog(self):

def openGraphFrame(self, event):
if not self.graphFrame:
self.graphFrame = GraphFrame(self)
self.graphFrame = graphFrame.GraphFrame(self)

if graphFrame.graphFrame_enabled:
self.graphFrame.Show()
@@ -19,6 +19,7 @@

# noinspection PyPackageRequirements
import wx
from wx.lib import newevent
from service.market import Market
from service.attribute import Attribute
from gui.display import Display
@@ -32,7 +33,7 @@

pyfalog = Logger(__name__)

ItemSelected, ITEM_SELECTED = wx.lib.newevent.NewEvent()
ItemSelected, ITEM_SELECTED = newevent.NewEvent()

RECENTLY_USED_MODULES = -2
MAX_RECENTLY_USED_MODULES = 50
@@ -207,7 +208,7 @@ def expandLookup(self, event):
self.SortChildren(root)

def jump(self, item):
pyfalog.debug("Open market group and meta tab for item: {0}", repr(item))
pyfalog.debug("Open market group and meta tab for item: {0}", item.name)
self.marketBrowser.searchMode = False
sMkt = self.sMkt
mg = sMkt.getMarketGroupByItem(item)
@@ -44,8 +44,8 @@ def AddPage(self, tabWnd=None, tabTitle="Empty Tab", tabImage=None, showClose=Tr

PFNotebook.AddPage(self, tabWnd, tabTitle, tabImage, True)

def DeletePage(self, n, *args, **kwargs):
PFNotebook.DeletePage(self, n, *args, **kwargs)
def DeletePage(self, n, internal=False):
PFNotebook.DeletePage(self, n, internal=internal)
if self.GetPageCount() == 0:
self.AddPage()

@@ -20,9 +20,9 @@
# noinspection PyPackageRequirements
import wx
from logbook import Logger
import gui.display as d
import gui.globalEvents as GE
import gui.droneView
from gui.utils.helpers_static import DRONE_ORDER
from gui.display import Display
from gui.builtinViewColumns.state import State
from gui.contextMenu import ContextMenu
from gui.utils.helpers_wxPython import DragDropHelper
@@ -62,15 +62,15 @@ def OnData(self, x, y, t):
return t


class ProjectedView(d.Display):
class ProjectedView(Display):
DEFAULT_COLS = ["State",
"Ammo Icon",
"Base Icon",
"Base Name",
"Ammo"]

def __init__(self, parent):
d.Display.__init__(self, parent, style=wx.LC_SINGLE_SEL | wx.BORDER_NONE)
Display.__init__(self, parent, style=wx.LC_SINGLE_SEL | wx.BORDER_NONE)

self.lastFitId = None

@@ -80,8 +80,6 @@ def __init__(self, parent):
self.Bind(wx.EVT_LEFT_DCLICK, self.remove)
self.Bind(wx.EVT_KEY_UP, self.kbEvent)

self.droneView = gui.droneView.DroneView

if "__WXGTK__" in wx.PlatformInfo:
self.Bind(wx.EVT_RIGHT_UP, self.scheduleMenu)
else:
@@ -167,7 +165,7 @@ def droneSort(self, drone):
if item.marketGroup is None:
item = item.metaGroup.parent

return (self.droneView.DRONE_ORDER.index(item.marketGroup.name),
return (DRONE_ORDER.index(item.marketGroup.name),
drone.item.name)

@staticmethod
@@ -177,7 +175,8 @@ def fitSort(fit):
def fitChanged(self, event):
sFit = Fit.getInstance()
fit = sFit.getFit(event.fitID)
pyfalog.debug("ProjectedView::fitChanged: {}", repr(fit))
if fit:
pyfalog.debug("ProjectedView::fitChanged: {0}", fit.name)

self.Parent.Parent.DisablePage(self, not fit or fit.isStructure)

@@ -171,7 +171,7 @@ def MouseClick(self, event):
button.SetState(state | (not BTN_PRESSED))
return button

bwidth, bheight = button.GetSize()
bwidth, __ = button.GetSize()
bx += bwidth + self.padding

return None
@@ -1086,7 +1086,7 @@ def DrawItem(self, mdc):

mdc.SetFont(Fonts.getFont("font_plus_one"))

categoryName, fittings = self.fittingInfo
categoryName, __ = self.fittingInfo

mdc.DrawText(categoryName, self.catx, self.caty)

@@ -1233,7 +1233,7 @@ def MouseLeftUp(self, event):
self.newBtn.SetBitmap(self.newBmp)
self.Refresh()
else:
shipName, __, fittings = self.shipFittingInfo
__, __, fittings = self.shipFittingInfo
if fittings > 0:
wx.PostEvent(self.shipBrowser, Stage3Selected(shipID=self.shipID, back=True))
else:
@@ -1299,7 +1299,7 @@ def UpdateElementsPos(self, mdc):

self.shipNamey = (rect.height - self.shipBmp.GetHeight()) / 2

shipName, shipTrait, fittings = self.shipFittingInfo
shipName, __, fittings = self.shipFittingInfo

mdc.SetFont(Fonts.getFont("font_plus_one"))
__, htext = mdc.GetTextExtent(shipName)

0 comments on commit 7248628

Please sign in to comment.
You can’t perform that action at this time.