Skip to content

Commit

Permalink
Merge branch 'master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
blitzmann committed Mar 23, 2017
2 parents bca2672 + 4a6c0db commit 0a1008f
Show file tree
Hide file tree
Showing 13 changed files with 136 additions and 142 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ If you wish to help with development or simply need to run pyfa through a Python
* `dateutil`
* `matplotlib` (for some Linux distributions you may need to install separate wxPython bindings such as `python-matplotlib-wx`)
* `requests`
* `logbook` >= 1.0.0

## Bug Reporting
The preferred method of reporting bugs is through the project's [GitHub Issues interface](https://github.com/pyfa-org/Pyfa/issues). Alternatively, posting a report in the [pyfa thread](http://forums.eveonline.com/default.aspx?g=posts&t=247609) on the official EVE Online forums is acceptable. Guidelines for bug reporting can be found on [this wiki page](https://github.com/DarkFenX/Pyfa/wiki/Bug-Reporting).
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# Version data
version = "1.28.1"
tag = "git"
tag = "Stable"
expansionName = "YC119.3"
expansionVersion = "1.0"
evemonMinVersion = "4081"
Expand Down
160 changes: 83 additions & 77 deletions eos/saveddata/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ def build(self):
self.__capRecharge = None
self.__calculatedTargets = []
self.__remoteReps = {
"Armor": None,
"Shield": None,
"Hull": None,
"Armor" : None,
"Shield" : None,
"Hull" : None,
"Capacitor": None,
}
self.factorReload = False
Expand Down Expand Up @@ -370,9 +370,11 @@ def appliedImplants(self):

@validates("ID", "ownerID", "shipID")
def validator(self, key, val):
map = {"ID": lambda _val: isinstance(_val, int),
"ownerID": lambda _val: isinstance(_val, int) or _val is None,
"shipID": lambda _val: isinstance(_val, int) or _val is None}
map = {
"ID" : lambda _val: isinstance(_val, int),
"ownerID": lambda _val: isinstance(_val, int) or _val is None,
"shipID" : lambda _val: isinstance(_val, int) or _val is None
}

if not map[key](val):
raise ValueError(str(val) + " is not a valid value for " + key)
Expand Down Expand Up @@ -408,15 +410,15 @@ def clear(self, projected=False):
self.ship.clear()

c = chain(
self.modules,
self.drones,
self.fighters,
self.boosters,
self.implants,
self.projectedDrones,
self.projectedModules,
self.projectedFighters,
(self.character, self.extraAttributes),
self.modules,
self.drones,
self.fighters,
self.boosters,
self.implants,
self.projectedDrones,
self.projectedModules,
self.projectedFighters,
(self.character, self.extraAttributes),
)

for stuff in c:
Expand Down Expand Up @@ -476,11 +478,11 @@ def __runCommandBoosts(self, runTime="normal"):

if warfareBuffID == 11: # Shield Burst: Active Shielding: Repair Duration/Capacitor
self.modules.filteredItemBoost(
lambda mod: mod.item.requiresSkill("Shield Operation") or mod.item.requiresSkill(
"Shield Emission Systems"), "capacitorNeed", value)
lambda mod: mod.item.requiresSkill("Shield Operation") or mod.item.requiresSkill(
"Shield Emission Systems"), "capacitorNeed", value)
self.modules.filteredItemBoost(
lambda mod: mod.item.requiresSkill("Shield Operation") or mod.item.requiresSkill(
"Shield Emission Systems"), "duration", value)
lambda mod: mod.item.requiresSkill("Shield Operation") or mod.item.requiresSkill(
"Shield Emission Systems"), "duration", value)

if warfareBuffID == 12: # Shield Burst: Shield Extension: Shield HP
self.ship.boostItemAttr("shieldCapacity", value, stackingPenalties=True)
Expand All @@ -506,26 +508,26 @@ def __runCommandBoosts(self, runTime="normal"):
if warfareBuffID == 17: # Information Burst: Electronic Superiority: EWAR Range and Strength
groups = ("ECM", "Sensor Dampener", "Weapon Disruptor", "Target Painter")
self.modules.filteredItemBoost(lambda mod: mod.item.group.name in groups, "maxRange", value,
stackingPenalties=True)
stackingPenalties=True)
self.modules.filteredItemBoost(lambda mod: mod.item.group.name in groups,
"falloffEffectiveness", value, stackingPenalties=True)
"falloffEffectiveness", value, stackingPenalties=True)

for scanType in ("Magnetometric", "Radar", "Ladar", "Gravimetric"):
self.modules.filteredItemBoost(lambda mod: mod.item.group.name == "ECM",
"scan%sStrengthBonus" % scanType, value,
stackingPenalties=True)
"scan%sStrengthBonus" % scanType, value,
stackingPenalties=True)

for attr in ("missileVelocityBonus", "explosionDelayBonus", "aoeVelocityBonus", "falloffBonus",
"maxRangeBonus", "aoeCloudSizeBonus", "trackingSpeedBonus"):
self.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Weapon Disruptor",
attr, value)
attr, value)

for attr in ("maxTargetRangeBonus", "scanResolutionBonus"):
self.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Sensor Dampener",
attr, value)
attr, value)

self.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Target Painter",
"signatureRadiusBonus", value, stackingPenalties=True)
"signatureRadiusBonus", value, stackingPenalties=True)

if warfareBuffID == 18: # Information Burst: Electronic Hardening: Scan Strength
for scanType in ("Gravimetric", "Radar", "Ladar", "Magnetometric"):
Expand All @@ -544,40 +546,36 @@ def __runCommandBoosts(self, runTime="normal"):
if warfareBuffID == 21: # Skirmish Burst: Interdiction Maneuvers: Tackle Range
groups = ("Stasis Web", "Warp Scrambler")
self.modules.filteredItemBoost(lambda mod: mod.item.group.name in groups, "maxRange", value,
stackingPenalties=True)
stackingPenalties=True)

if warfareBuffID == 22: # Skirmish Burst: Rapid Deployment: AB/MWD Speed Increase
self.modules.filteredItemBoost(
lambda mod: mod.item.requiresSkill("Afterburner")
or mod.item.requiresSkill("High Speed Maneuvering"),
"speedFactor", value, stackingPenalties=True)
self.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Afterburner") or
mod.item.requiresSkill("High Speed Maneuvering"),
"speedFactor", value, stackingPenalties=True)

if warfareBuffID == 23: # Mining Burst: Mining Laser Field Enhancement: Mining/Survey Range
self.modules.filteredItemBoost(
lambda mod: mod.item.requiresSkill("Mining") or
mod.item.requiresSkill("Ice Harvesting") or
mod.item.requiresSkill("Gas Cloud Harvesting"),
"maxRange", value, stackingPenalties=True)
self.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining") or
mod.item.requiresSkill("Ice Harvesting") or
mod.item.requiresSkill("Gas Cloud Harvesting"),
"maxRange", value, stackingPenalties=True)

self.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("CPU Management"),
"surveyScanRange", value, stackingPenalties=True)
"surveyScanRange", value, stackingPenalties=True)

if warfareBuffID == 24: # Mining Burst: Mining Laser Optimization: Mining Capacitor/Duration
self.modules.filteredItemBoost(
lambda mod: mod.item.requiresSkill("Mining") or
mod.item.requiresSkill("Ice Harvesting") or
mod.item.requiresSkill("Gas Cloud Harvesting"),
"capacitorNeed", value, stackingPenalties=True)
self.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining") or
mod.item.requiresSkill("Ice Harvesting") or
mod.item.requiresSkill("Gas Cloud Harvesting"),
"capacitorNeed", value, stackingPenalties=True)

self.modules.filteredItemBoost(
lambda mod: mod.item.requiresSkill("Mining") or
mod.item.requiresSkill("Ice Harvesting") or
mod.item.requiresSkill("Gas Cloud Harvesting"),
"duration", value, stackingPenalties=True)
self.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining") or
mod.item.requiresSkill("Ice Harvesting") or
mod.item.requiresSkill("Gas Cloud Harvesting"),
"duration", value, stackingPenalties=True)

if warfareBuffID == 25: # Mining Burst: Mining Equipment Preservation: Crystal Volatility
self.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining"),
"crystalVolatilityChance", value, stackingPenalties=True)
"crystalVolatilityChance", value, stackingPenalties=True)

if warfareBuffID == 60: # Skirmish Burst: Evasive Maneuvers: Agility
self.ship.boostItemAttr("agility", value, stackingPenalties=True)
Expand Down Expand Up @@ -850,15 +848,17 @@ def getSlotsUsed(self, type, countDummies=False):

return amount

slots = {Slot.LOW: "lowSlots",
Slot.MED: "medSlots",
Slot.HIGH: "hiSlots",
Slot.RIG: "rigSlots",
Slot.SUBSYSTEM: "maxSubSystems",
Slot.SERVICE: "serviceSlots",
Slot.F_LIGHT: "fighterLightSlots",
Slot.F_SUPPORT: "fighterSupportSlots",
Slot.F_HEAVY: "fighterHeavySlots"}
slots = {
Slot.LOW : "lowSlots",
Slot.MED : "medSlots",
Slot.HIGH : "hiSlots",
Slot.RIG : "rigSlots",
Slot.SUBSYSTEM: "maxSubSystems",
Slot.SERVICE : "serviceSlots",
Slot.F_LIGHT : "fighterLightSlots",
Slot.F_SUPPORT: "fighterSupportSlots",
Slot.F_HEAVY : "fighterHeavySlots"
}

def getSlotsFree(self, type, countDummies=False):
if type in (Slot.MODE, Slot.SYSTEM):
Expand Down Expand Up @@ -1007,29 +1007,35 @@ def sustainableTank(self):
def calculateSustainableTank(self, effective=True):
if self.__sustainableTank is None:
if self.capStable:
sustainable = {"armorRepair": self.extraAttributes["armorRepair"],
"shieldRepair": self.extraAttributes["shieldRepair"],
"hullRepair": self.extraAttributes["hullRepair"]}
sustainable = {
"armorRepair" : self.extraAttributes["armorRepair"],
"shieldRepair": self.extraAttributes["shieldRepair"],
"hullRepair" : self.extraAttributes["hullRepair"]
}
else:
sustainable = {}

repairers = []
# Map a repairer type to the attribute it uses
groupAttrMap = {"Armor Repair Unit": "armorDamageAmount",
"Ancillary Armor Repairer": "armorDamageAmount",
"Hull Repair Unit": "structureDamageAmount",
"Shield Booster": "shieldBonus",
"Ancillary Shield Booster": "shieldBonus",
"Remote Armor Repairer": "armorDamageAmount",
"Remote Shield Booster": "shieldBonus"}
groupAttrMap = {
"Armor Repair Unit" : "armorDamageAmount",
"Ancillary Armor Repairer": "armorDamageAmount",
"Hull Repair Unit" : "structureDamageAmount",
"Shield Booster" : "shieldBonus",
"Ancillary Shield Booster": "shieldBonus",
"Remote Armor Repairer" : "armorDamageAmount",
"Remote Shield Booster" : "shieldBonus"
}
# Map repairer type to attribute
groupStoreMap = {"Armor Repair Unit": "armorRepair",
"Hull Repair Unit": "hullRepair",
"Shield Booster": "shieldRepair",
"Ancillary Shield Booster": "shieldRepair",
"Remote Armor Repairer": "armorRepair",
"Remote Shield Booster": "shieldRepair",
"Ancillary Armor Repairer": "armorRepair", }
groupStoreMap = {
"Armor Repair Unit" : "armorRepair",
"Hull Repair Unit" : "hullRepair",
"Shield Booster" : "shieldRepair",
"Ancillary Shield Booster": "shieldRepair",
"Remote Armor Repairer" : "armorRepair",
"Remote Shield Booster" : "shieldRepair",
"Ancillary Armor Repairer": "armorRepair",
}

capUsed = self.capUsed
for attr in ("shieldRepair", "armorRepair", "hullRepair"):
Expand Down Expand Up @@ -1057,7 +1063,7 @@ def calculateSustainableTank(self, effective=True):

# Sort repairers by efficiency. We want to use the most efficient repairers first
repairers.sort(key=lambda _mod: _mod.getModifiedItemAttr(
groupAttrMap[_mod.item.group.name]) / _mod.getModifiedItemAttr("capacitorNeed"), reverse=True)
groupAttrMap[_mod.item.group.name]) / _mod.getModifiedItemAttr("capacitorNeed"), reverse=True)

# Loop through every module until we're above peak recharge
# Most efficient first, as we sorted earlier.
Expand Down Expand Up @@ -1370,10 +1376,10 @@ def __deepcopy__(self, memo=None):

def __repr__(self):
return u"Fit(ID={}, ship={}, name={}) at {}".format(
self.ID, self.ship.item.name, self.name, hex(id(self))
self.ID, self.ship.item.name, self.name, hex(id(self))
).encode('utf8')

def __str__(self):
return u"{} ({})".format(
self.name, self.ship.item.name
self.name, self.ship.item.name
).encode('utf8')
2 changes: 1 addition & 1 deletion eos/saveddata/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def numCharges(self):
charges = 0
else:
charges = floor(containerCapacity / chargeVolume)
return charges
return int(charges)

@property
def numShots(self):
Expand Down
27 changes: 0 additions & 27 deletions gui/builtinContextMenus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,27 +0,0 @@
__all__ = [
"openFit",
# "moduleGlobalAmmoPicker",
"moduleAmmoPicker",
"itemStats",
"damagePattern",
"marketJump",
"droneSplit",
"itemRemove",
"droneRemoveStack",
"ammoPattern",
"project",
"factorReload",
"whProjector",
"cargo",
"shipJump",
"changeAffectingSkills",
"tacticalMode",
"targetResists",
"priceClear",
"amount",
"metaSwap",
"implantSets",
"fighterAbilities",
"cargoAmmo",
"droneStack"
]
8 changes: 7 additions & 1 deletion gui/builtinContextMenus/cargoAmmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
import service
import gui.globalEvents as GE
import wx
from service.settings import ContextMenuSettings
from service.fit import Fit


class CargoAmmo(ContextMenu):
def __init__(self):
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.settings = ContextMenuSettings.getInstance()

def display(self, srcContext, selection):
if not self.settings.get('cargoAmmo'):
return False

if srcContext not in ("marketItemGroup", "marketItemMisc") or self.mainFrame.getActiveFit() is None:
return False

Expand All @@ -23,7 +29,7 @@ def getText(self, itmContext, selection):
return "Add {0} to Cargo (x1000)".format(itmContext)

def activate(self, fullContext, selection, i):
sFit = service.Fit.getInstance()
sFit = Fit.getInstance()
fitID = self.mainFrame.getActiveFit()

typeID = int(selection[0].ID)
Expand Down
12 changes: 9 additions & 3 deletions gui/builtinContextMenus/droneStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
import service
import gui.globalEvents as GE
import wx
from service.settings import ContextMenuSettings
from service.fit import Fit


class CargoAmmo(ContextMenu):
class DroneStack(ContextMenu):
def __init__(self):
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.settings = ContextMenuSettings.getInstance()

def display(self, srcContext, selection):
if not self.settings.get('droneStack'):
return False

if srcContext not in ("marketItemGroup", "marketItemMisc") or self.mainFrame.getActiveFit() is None:
return False

Expand All @@ -25,7 +31,7 @@ def getText(self, itmContext, selection):
return "Add {0} to Drone Bay (x5)".format(itmContext)

def activate(self, fullContext, selection, i):
sFit = service.Fit.getInstance()
sFit = Fit.getInstance()
fitID = self.mainFrame.getActiveFit()

typeID = int(selection[0].ID)
Expand All @@ -34,4 +40,4 @@ def activate(self, fullContext, selection, i):
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))


CargoAmmo.register()
DroneStack.register()
1 change: 0 additions & 1 deletion gui/builtinStatsViews/outgoingViewMinimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# noinspection PyPackageRequirements
import wx
from gui.statsView import StatsView
from gui.bitmapLoader import BitmapLoader
from gui.utils.numberFormatter import formatAmount


Expand Down
Loading

0 comments on commit 0a1008f

Please sign in to comment.