diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 621db8b52..765e3301d 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -1,11 +1,13 @@ -# Submit a bug report bug report or feature request + ## Bug Report diff --git a/eos/effects/energynosferatufalloff.py b/eos/effects/energynosferatufalloff.py index 841efb7cf..0dc4fd81b 100644 --- a/eos/effects/energynosferatufalloff.py +++ b/eos/effects/energynosferatufalloff.py @@ -12,7 +12,7 @@ def handler(fit, src, context, **kwargs): amount = src.getModifiedItemAttr("powerTransferAmount") time = src.getModifiedItemAttr("duration") - if 'effect' in kwargs: + if 'effect' in kwargs and "projected" in context: amount *= ModifiedAttributeDict.getResistance(fit, kwargs['effect']) if "projected" in context: diff --git a/eos/effects/fighterabilityecm.py b/eos/effects/fighterabilityecm.py index be4e41929..e821c748a 100644 --- a/eos/effects/fighterabilityecm.py +++ b/eos/effects/fighterabilityecm.py @@ -11,13 +11,14 @@ displayName = "ECM" prefix = "fighterAbilityECM" type = "projected", "active" +grouped = True def handler(fit, module, context, **kwargs): if "projected" not in context: return # jam formula: 1 - (1- (jammer str/ship str))^(# of jam mods with same str)) - strModifier = 1 - module.getModifiedItemAttr("{}Strength{}".format(prefix, fit.scanType)) / fit.scanStrength + strModifier = 1 - (module.getModifiedItemAttr("{}Strength{}".format(prefix, fit.scanType)) * module.amountActive) / fit.scanStrength if 'effect' in kwargs: strModifier *= ModifiedAttributeDict.getResistance(fit, kwargs['effect']) diff --git a/eos/effects/fighterabilityenergyneutralizer.py b/eos/effects/fighterabilityenergyneutralizer.py index 1e2734202..8a43dff19 100644 --- a/eos/effects/fighterabilityenergyneutralizer.py +++ b/eos/effects/fighterabilityenergyneutralizer.py @@ -9,11 +9,12 @@ from eos.modifiedAttributeDict import ModifiedAttributeDict displayName = "Energy Neutralizer" prefix = "fighterAbilityEnergyNeutralizer" type = "active", "projected" +grouped = True def handler(fit, src, context, **kwargs): if "projected" in context: - amount = src.getModifiedItemAttr("{}Amount".format(prefix)) + amount = src.getModifiedItemAttr("{}Amount".format(prefix)) * src.amountActive time = src.getModifiedItemAttr("{}Duration".format(prefix)) if 'effect' in kwargs: diff --git a/eos/effects/fighterabilitymicrowarpdrive.py b/eos/effects/fighterabilitymicrowarpdrive.py index 01bea209a..6dfbae73a 100644 --- a/eos/effects/fighterabilitymicrowarpdrive.py +++ b/eos/effects/fighterabilitymicrowarpdrive.py @@ -14,7 +14,8 @@ runTime = "late" def handler(fit, module, context): - module.boostItemAttr("maxVelocity", module.getModifiedItemAttr("fighterAbilityMicroWarpDriveSpeedBonus")) + module.boostItemAttr("maxVelocity", module.getModifiedItemAttr("fighterAbilityMicroWarpDriveSpeedBonus"), + stackingPenalties=True) module.boostItemAttr("signatureRadius", module.getModifiedItemAttr("fighterAbilityMicroWarpDriveSignatureRadiusBonus"), stackingPenalties=True) diff --git a/eos/effects/fighterabilitystasiswebifier.py b/eos/effects/fighterabilitystasiswebifier.py index cf5143f98..0aa3b5faf 100644 --- a/eos/effects/fighterabilitystasiswebifier.py +++ b/eos/effects/fighterabilitystasiswebifier.py @@ -6,13 +6,12 @@ effects, and thus this effect file contains some custom information useful only # User-friendly name for the ability displayName = "Stasis Webifier" - prefix = "fighterAbilityStasisWebifier" - type = "active", "projected" +grouped = True def handler(fit, src, context): if "projected" not in context: return - fit.ship.boostItemAttr("maxVelocity", src.getModifiedItemAttr("{}SpeedPenalty".format(prefix))) + fit.ship.boostItemAttr("maxVelocity", src.getModifiedItemAttr("{}SpeedPenalty".format(prefix)) * src.amountActive) diff --git a/eos/effects/fighterabilitywarpdisruption.py b/eos/effects/fighterabilitywarpdisruption.py index 0d7013434..d362fb33f 100644 --- a/eos/effects/fighterabilitywarpdisruption.py +++ b/eos/effects/fighterabilitywarpdisruption.py @@ -8,9 +8,10 @@ effects, and thus this effect file contains some custom information useful only displayName = "Warp Disruption" prefix = "fighterAbilityWarpDisruption" type = "active", "projected" +grouped = True def handler(fit, src, context): if "projected" not in context: return - fit.ship.increaseItemAttr("warpScrambleStatus", src.getModifiedItemAttr("{}PointStrength".format(prefix))) + fit.ship.increaseItemAttr("warpScrambleStatus", src.getModifiedItemAttr("{}PointStrength".format(prefix)) * src.amountActive) diff --git a/eos/effects/shipbonusrole2logisticdronerepamountandhitpointbonus.py b/eos/effects/shipbonusrole2logisticdronerepamountandhitpointbonus.py index e05e180ae..100056f61 100644 --- a/eos/effects/shipbonusrole2logisticdronerepamountandhitpointbonus.py +++ b/eos/effects/shipbonusrole2logisticdronerepamountandhitpointbonus.py @@ -6,15 +6,15 @@ type = "passive" def handler(fit, src, context): - fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Repair Drone Operation"), + fit.drones.filteredItemBoost(lambda mod: mod.item.requiresSkill("Repair Drone Operation"), "structureDamageAmount", src.getModifiedItemAttr("shipBonusRole2")) - fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Repair Drone Operation"), + fit.drones.filteredItemBoost(lambda mod: mod.item.requiresSkill("Repair Drone Operation"), "shieldBonus", src.getModifiedItemAttr("shipBonusRole2")) - fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Repair Drone Operation"), + fit.drones.filteredItemBoost(lambda mod: mod.item.requiresSkill("Repair Drone Operation"), "armorDamageAmount", src.getModifiedItemAttr("shipBonusRole2")) - fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Repair Drone Operation"), + fit.drones.filteredItemBoost(lambda mod: mod.item.requiresSkill("Repair Drone Operation"), "armorHP", src.getModifiedItemAttr("shipBonusRole2")) - fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Repair Drone Operation"), + fit.drones.filteredItemBoost(lambda mod: mod.item.requiresSkill("Repair Drone Operation"), "shieldCapacity", src.getModifiedItemAttr("shipBonusRole2")) - fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Repair Drone Operation"), + fit.drones.filteredItemBoost(lambda mod: mod.item.requiresSkill("Repair Drone Operation"), "hp", src.getModifiedItemAttr("shipBonusRole2")) diff --git a/eos/saveddata/fighter.py b/eos/saveddata/fighter.py index 645d7fbe5..a88189739 100644 --- a/eos/saveddata/fighter.py +++ b/eos/saveddata/fighter.py @@ -271,17 +271,19 @@ class Fighter(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): projected = False for ability in self.abilities: - if ability.active: - effect = ability.effect - if effect.runTime == runTime and effect.activeByDefault and \ - ((projected and effect.isType("projected")) or not projected): - if ability.grouped: + if not ability.active: + continue + + effect = ability.effect + if effect.runTime == runTime and effect.activeByDefault and \ + ((projected and effect.isType("projected")) or not projected): + if ability.grouped: + effect.handler(fit, self, context) + else: + i = 0 + while i != self.amountActive: effect.handler(fit, self, context) - else: - i = 0 - while i != self.amountActive: - effect.handler(fit, self, context) - i += 1 + i += 1 def __deepcopy__(self, memo): copy = Fighter(self.item) diff --git a/gui/builtinShipBrowser/fitItem.py b/gui/builtinShipBrowser/fitItem.py index f76e3d6f9..fbc0a3020 100644 --- a/gui/builtinShipBrowser/fitItem.py +++ b/gui/builtinShipBrowser/fitItem.py @@ -362,12 +362,13 @@ class FitItem(SFItem.SFBrowserItem): self.deleted = True sFit = Fit.getInstance() - fit = sFit.getFit(self.fitID) # need to delete from import cache before actually deleting fit if self.shipBrowser.GetActiveStage() == 5: - if fit in self.shipBrowser.lastdata: # remove fit from import cache - self.shipBrowser.lastdata.remove(fit) + for x in self.shipBrowser.lastdata: # remove fit from import cache + if x[0] == self.fitID: + self.shipBrowser.lastdata.remove(x) + break sFit.deleteFit(self.fitID) @@ -376,7 +377,7 @@ class FitItem(SFItem.SFBrowserItem): # todo: would a simple RefreshList() work here instead of posting that a stage has been selected? if self.shipBrowser.GetActiveStage() == 5: - wx.PostEvent(self.shipBrowser, ImportSelected(fits=self.shipBrowser.lastdata)) + wx.PostEvent(self.shipBrowser, ImportSelected(fits=self.shipBrowser.lastdata, recent=self.shipBrowser.recentFits)) elif self.shipBrowser.GetActiveStage() == 4: wx.PostEvent(self.shipBrowser, SearchSelected(text=self.shipBrowser.navpanel.lastSearch, back=True)) else: diff --git a/service/port.py b/service/port.py index c61237b5c..db7dc0964 100644 --- a/service/port.py +++ b/service/port.py @@ -54,13 +54,14 @@ from collections import OrderedDict pyfalog = Logger(__name__) -EFT_SLOT_ORDER = [Slot.LOW, Slot.MED, Slot.HIGH, Slot.RIG, Slot.SUBSYSTEM] +EFT_SLOT_ORDER = [Slot.LOW, Slot.MED, Slot.HIGH, Slot.RIG, Slot.SUBSYSTEM, Slot.SERVICE] INV_FLAGS = { Slot.LOW: 11, Slot.MED: 19, Slot.HIGH: 27, Slot.RIG: 92, - Slot.SUBSYSTEM: 125 + Slot.SUBSYSTEM: 125, + Slot.SERVICE: 164 } INV_FLAG_CARGOBAY = 5