diff --git a/README.md b/README.md index 340eec53f..a5f89ee6d 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,17 @@ The latest version along with release notes can always be found on the project's ## Installation Windows and OS X users are supplied self-contained builds of pyfa on the [latest releases](https://github.com/pyfa-org/Pyfa/releases/latest) page. An `.exe` installer is also available for Windows builds. Linux users can run pyfa using their distribution's Python interpreter. There is no official self-contained package for Linux, however, there are a number of third-party packages available through distribution-specific repositories. +#### OS X +There are two different distributives for OS X: `-mac` and `-mac-deprecated`. + +* `-mac`: based on wxPython 3.0.2.0 and has updated libraries. This is the recommended build. +* `-mac-deprecated`: utilizes older binaries running on wxPython 2.8; because of this, some features are not available (currently CREST support and Attribute Overrides). Additionally, as development happens primarily on wxPython 3.0, a few GUI bugs may pop up as `-mac-deprecated` is not actively tested. However, due to some general issues with wxPython 3.0, especially on some newer OS X versions, `-mac-deprecated` is still offered for those that need it. + +There is also a [Homebrew](http://brew.sh) option for installing pyfa on OS X. Please note this is maintained by a third-party and is not tested by pyfa developers. Simply fire up in terminal: +``` +$ brew cask install pyfa +``` + ### Linux Distro-specific Packages The following is a list of pyfa packages available for certain distributions. Please note that these packages are maintained by third-parties and are not evaluated by the pyfa developers. diff --git a/config.py b/config.py index 3d0db405d..2445a34eb 100644 --- a/config.py +++ b/config.py @@ -18,10 +18,10 @@ debug = False saveInRoot = False # Version data -version = "1.21.2" -tag = "Stable" +version = "1.21.4" +tag = "git" expansionName = "Citadel" -expansionVersion = "1.3" +expansionVersion = "1.11" evemonMinVersion = "4081" pyfaPath = None diff --git a/eos/db/gamedata/queries.py b/eos/db/gamedata/queries.py index 93c43fc38..32c0f766f 100644 --- a/eos/db/gamedata/queries.py +++ b/eos/db/gamedata/queries.py @@ -194,7 +194,7 @@ def searchItems(nameLike, where=None, join=None, eager=None): items = gamedata_session.query(Item).options(*processEager(eager)).join(*join) for token in nameLike.split(' '): token_safe = u"%{0}%".format(sqlizeString(token)) - items = items.filter(processWhere(Item.name.like(token_safe, escape="\\"), where)) + items = items.filter(and_(Item.name.like(token_safe, escape="\\"), where)) items = items.limit(100).all() return items diff --git a/eos/db/saveddata/fighter.py b/eos/db/saveddata/fighter.py index 1daa37ae7..2f4089756 100644 --- a/eos/db/saveddata/fighter.py +++ b/eos/db/saveddata/fighter.py @@ -20,7 +20,7 @@ from sqlalchemy import Table, Column, Integer, ForeignKey, Boolean from sqlalchemy.orm import mapper from eos.db import saveddata_meta -from eos.types import Fighter +from eos.types import Fighter, Fit from sqlalchemy.orm import * from sqlalchemy.sql import and_ from eos.effectHandlerHelpers import * @@ -42,6 +42,7 @@ fighter_abilities_table = Table("fightersAbilities", saveddata_meta, mapper(Fighter, fighters_table, properties = { + "owner": relation(Fit), "_Fighter__abilities": relation( FighterAbility, backref="fighter", diff --git a/eos/db/util.py b/eos/db/util.py index d3efbc0f2..47a950c80 100644 --- a/eos/db/util.py +++ b/eos/db/util.py @@ -18,7 +18,7 @@ #=============================================================================== from sqlalchemy.orm import eagerload -from sqlalchemy.sql import and_ +from sqlalchemy.sql import and_, or_ replace = {"attributes": "_Item__attributes", "modules": "_Fit__modules", diff --git a/eos/effects/capitallauncherskillcruisecitadelemdamage1.py b/eos/effects/capitallauncherskillcruisecitadelemdamage1.py index a6fbc2b97..de758b0f0 100644 --- a/eos/effects/capitallauncherskillcruisecitadelemdamage1.py +++ b/eos/effects/capitallauncherskillcruisecitadelemdamage1.py @@ -1,4 +1,4 @@ -# capitalLauncherSkillCruiseCitadelEmDamage1 +# capitalLauncherSkillCruiseCitadelEmDamage1 # # Used by: # Skill: XL Cruise Missiles diff --git a/eos/effects/decreasetargetspeed.py b/eos/effects/decreasetargetspeed.py index d19823d8d..7a6fbf9b0 100644 --- a/eos/effects/decreasetargetspeed.py +++ b/eos/effects/decreasetargetspeed.py @@ -1,7 +1,4 @@ -# decreaseTargetSpeed -# -# Used by: -# Drones from group: Stasis Webifying Drone (3 of 3) +# Not used by any item type = "active", "projected" def handler(fit, module, context): if "projected" not in context: diff --git a/eos/effects/dronedamagebonusrequringdrones.py b/eos/effects/dronedamagebonusrequringdrones.py index 80bcff017..0baf75d99 100644 --- a/eos/effects/dronedamagebonusrequringdrones.py +++ b/eos/effects/dronedamagebonusrequringdrones.py @@ -1,7 +1,4 @@ -# droneDamageBonusRequringDrones -# -# Used by: -# Skill: Drone Interfacing +# Not used by any item type = "passive" def handler(fit, skill, context): fit.drones.filteredItemBoost(lambda drone: drone.item.requiresSkill("Drones"), diff --git a/eos/effects/elitebonuscommanddestroyermwdsigradius3.py b/eos/effects/elitebonuscommanddestroyermwdsigradius3.py index 34abe1494..330679036 100644 --- a/eos/effects/elitebonuscommanddestroyermwdsigradius3.py +++ b/eos/effects/elitebonuscommanddestroyermwdsigradius3.py @@ -1,7 +1,4 @@ -# eliteBonusCommandDestroyerMWDSigRadius3 -# -# Used by: -# Ships from group: Command Destroyers (4 of 4) +# Not used by any item type = "passive" def handler(fit, src, context): fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("High Speed Maneuvering"), "signatureRadiusBonus", src.getModifiedItemAttr("eliteBonusCommandDestroyer3"), skill="Command Destroyers") diff --git a/eos/effects/elitebonuslogisticremotearmorrepaircapneed1.py b/eos/effects/elitebonuslogisticremotearmorrepaircapneed1.py index 7f4e10117..f92fc8c87 100644 --- a/eos/effects/elitebonuslogisticremotearmorrepaircapneed1.py +++ b/eos/effects/elitebonuslogisticremotearmorrepaircapneed1.py @@ -3,6 +3,5 @@ # Used by: # Ship: Oneiros type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Armor Repairer", - "capacitorNeed", ship.getModifiedItemAttr("eliteBonusLogistics1"), skill="Logistics Cruisers") +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "capacitorNeed", src.getModifiedItemAttr("eliteBonusLogistics1"), skill="Logistics Cruisers") diff --git a/eos/effects/elitebonuslogisticremotearmorrepaircapneed2.py b/eos/effects/elitebonuslogisticremotearmorrepaircapneed2.py index 7e39fddbb..283490e87 100644 --- a/eos/effects/elitebonuslogisticremotearmorrepaircapneed2.py +++ b/eos/effects/elitebonuslogisticremotearmorrepaircapneed2.py @@ -3,6 +3,5 @@ # Used by: # Ship: Guardian type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Armor Repairer", - "capacitorNeed", ship.getModifiedItemAttr("eliteBonusLogistics2"), skill="Logistics Cruisers") +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "capacitorNeed", src.getModifiedItemAttr("eliteBonusLogistics2"), skill="Logistics Cruisers") diff --git a/eos/effects/elitebonuslogisticshieldtransfercapneed1.py b/eos/effects/elitebonuslogisticshieldtransfercapneed1.py index d0024995a..d8bdb5441 100644 --- a/eos/effects/elitebonuslogisticshieldtransfercapneed1.py +++ b/eos/effects/elitebonuslogisticshieldtransfercapneed1.py @@ -4,6 +4,5 @@ # Ship: Basilisk # Ship: Etana type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Shield Booster", - "capacitorNeed", ship.getModifiedItemAttr("eliteBonusLogistics1"), skill="Logistics Cruisers") +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Emission Systems"), "capacitorNeed", src.getModifiedItemAttr("eliteBonusLogistics1"), skill="Logistics Cruisers") diff --git a/eos/effects/elitebonuslogisticshieldtransfercapneed2.py b/eos/effects/elitebonuslogisticshieldtransfercapneed2.py index 7e731892d..4acb6ef52 100644 --- a/eos/effects/elitebonuslogisticshieldtransfercapneed2.py +++ b/eos/effects/elitebonuslogisticshieldtransfercapneed2.py @@ -3,6 +3,5 @@ # Used by: # Ship: Scimitar type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Shield Booster", - "capacitorNeed", ship.getModifiedItemAttr("eliteBonusLogistics2"), skill="Logistics Cruisers") +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Emission Systems"), "capacitorNeed", src.getModifiedItemAttr("eliteBonusLogistics2"), skill="Logistics Cruisers") diff --git a/eos/effects/energydestabilizationnew.py b/eos/effects/energydestabilizationnew.py index fefadab40..c07517b0b 100644 --- a/eos/effects/energydestabilizationnew.py +++ b/eos/effects/energydestabilizationnew.py @@ -1,7 +1,4 @@ -# energyDestabilizationNew -# -# Used by: -# Drones from group: Energy Neutralizer Drone (3 of 3) +# Not used by any item from eos.types import State type = "active", "projected" def handler(fit, container, context): diff --git a/eos/effects/energyneutralizerentity.py b/eos/effects/energyneutralizerentity.py new file mode 100644 index 000000000..49b895385 --- /dev/null +++ b/eos/effects/energyneutralizerentity.py @@ -0,0 +1,12 @@ +# energyNeutralizerEntity +# +# Used by: +# Drones from group: Energy Neutralizer Drone (3 of 3) +from eos.types import State +type = "active", "projected" +def handler(fit, container, context): + if "projected" in context and ((hasattr(container, "state") \ + and container.state >= State.ACTIVE) or hasattr(container, "amountActive")): + amount = container.getModifiedItemAttr("energyDestabilizationAmount") + time = container.getModifiedItemAttr("duration") + fit.addDrain(time, amount, 0) diff --git a/eos/effects/energyneutralizerfalloff.py b/eos/effects/energyneutralizerfalloff.py index 402f20333..4896cec2d 100644 --- a/eos/effects/energyneutralizerfalloff.py +++ b/eos/effects/energyneutralizerfalloff.py @@ -1,14 +1,12 @@ # energyNeutralizerFalloff # # Used by: -# Drones from group: Energy Neutralizer Drone (3 of 3) # Modules from group: Energy Neutralizer (51 of 51) from eos.types import State type = "active", "projected" def handler(fit, container, context): if "projected" in context and ((hasattr(container, "state") \ and container.state >= State.ACTIVE) or hasattr(container, "amountActive")): - multiplier = container.amountActive if hasattr(container, "amountActive") else 1 amount = container.getModifiedItemAttr("energyDestabilizationAmount") time = container.getModifiedItemAttr("duration") - fit.addDrain(time, amount * multiplier, 0) + fit.addDrain(time, amount, 0) diff --git a/eos/effects/energytransfer.py b/eos/effects/energytransfer.py index 3c82a340c..8390cf52c 100644 --- a/eos/effects/energytransfer.py +++ b/eos/effects/energytransfer.py @@ -1,7 +1,4 @@ -# energyTransfer -# -# Used by: -# Modules from group: Remote Capacitor Transmitter (38 of 38) +# Not used by any item type = "projected", "active" def handler(fit, module, context): if "projected" in context: diff --git a/eos/effects/ewtargetpaint.py b/eos/effects/ewtargetpaint.py index 1f13ea821..4be80da74 100644 --- a/eos/effects/ewtargetpaint.py +++ b/eos/effects/ewtargetpaint.py @@ -1,7 +1,4 @@ -# ewTargetPaint -# -# Used by: -# Drones named like: TP (3 of 3) +# Not used by any item type = "projected", "active" def handler(fit, container, context): if "projected" in context: diff --git a/eos/effects/fighterabilityattackm.py b/eos/effects/fighterabilityattackm.py index dd41d77dc..d2d14119c 100644 --- a/eos/effects/fighterabilityattackm.py +++ b/eos/effects/fighterabilityattackm.py @@ -1,3 +1,4 @@ +# Not used by any item """ Since fighter abilities do not have any sort of item entity in the EVE database, we must derive the abilities from the effects, and thus this effect file contains some custom information useful only to fighters. diff --git a/eos/effects/fighterabilityecm.py b/eos/effects/fighterabilityecm.py index e211e7424..c18825aad 100644 --- a/eos/effects/fighterabilityecm.py +++ b/eos/effects/fighterabilityecm.py @@ -1,3 +1,4 @@ +# Not used by any item """ Since fighter abilities do not have any sort of item entity in the EVE database, we must derive the abilities from the effects, and thus this effect file contains some custom information useful only to fighters. diff --git a/eos/effects/fighterabilityenergyneutralizer.py b/eos/effects/fighterabilityenergyneutralizer.py index ca0460e15..0315e4301 100644 --- a/eos/effects/fighterabilityenergyneutralizer.py +++ b/eos/effects/fighterabilityenergyneutralizer.py @@ -1,3 +1,4 @@ +# Not used by any item """ Since fighter abilities do not have any sort of item entity in the EVE database, we must derive the abilities from the effects, and thus this effect file contains some custom information useful only to fighters. diff --git a/eos/effects/fighterabilitylaunchbomb.py b/eos/effects/fighterabilitylaunchbomb.py index 55e5eca15..5a9513e1d 100644 --- a/eos/effects/fighterabilitylaunchbomb.py +++ b/eos/effects/fighterabilitylaunchbomb.py @@ -1,3 +1,4 @@ +# Not used by any item """ Since fighter abilities do not have any sort of item entity in the EVE database, we must derive the abilities from the effects, and thus this effect file contains some custom information useful only to fighters. diff --git a/eos/effects/fighterabilitymicrowarpdrive.py b/eos/effects/fighterabilitymicrowarpdrive.py index 7d5bc13e6..9e2303ec4 100644 --- a/eos/effects/fighterabilitymicrowarpdrive.py +++ b/eos/effects/fighterabilitymicrowarpdrive.py @@ -1,3 +1,4 @@ +# Not used by any item """ Since fighter abilities do not have any sort of item entity in the EVE database, we must derive the abilities from the effects, and thus this effect file contains some custom information useful only to fighters. diff --git a/eos/effects/fighterabilitymissiles.py b/eos/effects/fighterabilitymissiles.py index 16e7ee8b2..7615f5616 100644 --- a/eos/effects/fighterabilitymissiles.py +++ b/eos/effects/fighterabilitymissiles.py @@ -1,3 +1,4 @@ +# Not used by any item """ Since fighter abilities do not have any sort of item entity in the EVE database, we must derive the abilities from the effects, and thus this effect file contains some custom information useful only to fighters. diff --git a/eos/effects/fighterabilitystasiswebifier.py b/eos/effects/fighterabilitystasiswebifier.py index 2a3aa0393..f067859bc 100644 --- a/eos/effects/fighterabilitystasiswebifier.py +++ b/eos/effects/fighterabilitystasiswebifier.py @@ -1,3 +1,4 @@ +# Not used by any item """ Since fighter abilities do not have any sort of item entity in the EVE database, we must derive the abilities from the effects, and thus this effect file contains some custom information useful only to fighters. diff --git a/eos/effects/fighterabilitywarpdisruption.py b/eos/effects/fighterabilitywarpdisruption.py index 8e74b35d7..b0e0c281d 100644 --- a/eos/effects/fighterabilitywarpdisruption.py +++ b/eos/effects/fighterabilitywarpdisruption.py @@ -1,3 +1,4 @@ +# Not used by any item """ Since fighter abilities do not have any sort of item entity in the EVE database, we must derive the abilities from the effects, and thus this effect file contains some custom information useful only to fighters. diff --git a/eos/effects/fueledarmorrepair.py b/eos/effects/fueledarmorrepair.py index 0077e287d..91f1ffc65 100644 --- a/eos/effects/fueledarmorrepair.py +++ b/eos/effects/fueledarmorrepair.py @@ -6,8 +6,10 @@ runTime = "late" type = "active" def handler(fit, module, context): if module.charge and module.charge.name == "Nanite Repair Paste": - module.multiplyItemAttr("armorDamageAmount", 3) + multiplier = 3 + else: + multiplier = 1 - amount = module.getModifiedItemAttr("armorDamageAmount") + amount = module.getModifiedItemAttr("armorDamageAmount") * multiplier speed = module.getModifiedItemAttr("duration") / 1000.0 fit.extraAttributes.increase("armorRepair", amount / speed) diff --git a/eos/effects/maraudermodeeffect26.py b/eos/effects/maraudermodeeffect26.py index 61d228dd2..74b730de6 100644 --- a/eos/effects/maraudermodeeffect26.py +++ b/eos/effects/maraudermodeeffect26.py @@ -1,7 +1,4 @@ -# marauderModeEffect26 -# -# Used by: -# Module: Bastion Module I +# Not used by any item type = "active" runTime = "early" def handler(fit, module, context): diff --git a/eos/effects/modulebonusancillaryremotearmorrepairer.py b/eos/effects/modulebonusancillaryremotearmorrepairer.py new file mode 100644 index 000000000..ba176a64f --- /dev/null +++ b/eos/effects/modulebonusancillaryremotearmorrepairer.py @@ -0,0 +1,17 @@ +# moduleBonusAncillaryRemoteArmorRepairer +# +# Used by: +# Modules from group: Ancillary Remote Armor Repairer (4 of 4) +runTime = "late" +type = "projected", "active" +def handler(fit, module, context): + if "projected" not in context: return + + if module.charge and module.charge.name == "Nanite Repair Paste": + multiplier = 3 + else: + multiplier = 1 + + amount = module.getModifiedItemAttr("armorDamageAmount") * multiplier + speed = module.getModifiedItemAttr("duration") / 1000.0 + fit.extraAttributes.increase("armorRepair", amount / speed) \ No newline at end of file diff --git a/eos/effects/modulebonusancillaryremoteshieldbooster.py b/eos/effects/modulebonusancillaryremoteshieldbooster.py new file mode 100644 index 000000000..2aab65f2a --- /dev/null +++ b/eos/effects/modulebonusancillaryremoteshieldbooster.py @@ -0,0 +1,11 @@ +# moduleBonusAncillaryRemoteShieldBooster +# +# Used by: +# Modules from group: Ancillary Remote Shield Booster (4 of 4) +runTime = "late" +type = "projected", "active" +def handler(fit, module, context): + if "projected" not in context: return + amount = module.getModifiedItemAttr("shieldBonus") + speed = module.getModifiedItemAttr("duration") / 1000.0 + fit.extraAttributes.increase("shieldRepair", amount / speed) \ No newline at end of file diff --git a/eos/effects/modulebonusarmoredwarfarelinkdamagecontrol.py b/eos/effects/modulebonusarmoredwarfarelinkdamagecontrol.py index 34423fd81..d537f13ce 100644 --- a/eos/effects/modulebonusarmoredwarfarelinkdamagecontrol.py +++ b/eos/effects/modulebonusarmoredwarfarelinkdamagecontrol.py @@ -4,7 +4,7 @@ # Variations of module: Armored Warfare Link - Damage Control I (2 of 2) type = "gang", "active" gangBoost = "armorRepairCapacitorNeed" -runTime = "late" +#runTime = "late" def handler(fit, module, context): if "gang" not in context: return diff --git a/eos/effects/modulebonusarmoredwarfarelinkpassivedefense.py b/eos/effects/modulebonusarmoredwarfarelinkpassivedefense.py index 7b88f75f3..f83745ebf 100644 --- a/eos/effects/modulebonusarmoredwarfarelinkpassivedefense.py +++ b/eos/effects/modulebonusarmoredwarfarelinkpassivedefense.py @@ -4,7 +4,7 @@ # Variations of module: Armored Warfare Link - Passive Defense I (2 of 2) type = "gang", "active" gangBoost = "armorResistance" -runTime = "late" +#runTime = "late" def handler(fit, module, context): if "gang" not in context: return diff --git a/eos/effects/modulebonusarmoredwarfarelinkrapidrepair.py b/eos/effects/modulebonusarmoredwarfarelinkrapidrepair.py index 0817d2204..9575779e4 100644 --- a/eos/effects/modulebonusarmoredwarfarelinkrapidrepair.py +++ b/eos/effects/modulebonusarmoredwarfarelinkrapidrepair.py @@ -4,7 +4,7 @@ # Variations of module: Armored Warfare Link - Rapid Repair I (2 of 2) type = "gang", "active" gangBoost = "armorRepairDuration" -runTime = "late" +#runTime = "late" def handler(fit, module, context): if "gang" not in context: return diff --git a/eos/effects/modulebonusinformationwarfarelinkreconoperation.py b/eos/effects/modulebonusinformationwarfarelinkreconoperation.py index 98c23a7f2..123ab066e 100644 --- a/eos/effects/modulebonusinformationwarfarelinkreconoperation.py +++ b/eos/effects/modulebonusinformationwarfarelinkreconoperation.py @@ -4,7 +4,7 @@ # Variations of module: Information Warfare Link - Recon Operation I (2 of 2) type = "gang", "active" gangBoost = "electronicMaxRange" -runTime = "late" +#runTime = "late" def handler(fit, module, context): if "gang" not in context: return diff --git a/eos/effects/modulebonusinformationwarfarelinksensorintegrity.py b/eos/effects/modulebonusinformationwarfarelinksensorintegrity.py index e85db5c3d..49af64bfe 100644 --- a/eos/effects/modulebonusinformationwarfarelinksensorintegrity.py +++ b/eos/effects/modulebonusinformationwarfarelinksensorintegrity.py @@ -5,7 +5,7 @@ type = "gang", "active" gangBoost = "maxTargetRange" gangBonus = "commandBonus" -runTime = "late" +#runTime = "late" def handler(fit, module, context): if "gang" not in context: return diff --git a/eos/effects/modulebonusnetworkedsensorarray.py b/eos/effects/modulebonusnetworkedsensorarray.py index 236b6e6b7..880e041bb 100644 --- a/eos/effects/modulebonusnetworkedsensorarray.py +++ b/eos/effects/modulebonusnetworkedsensorarray.py @@ -18,11 +18,10 @@ def handler(fit, src, context): 'Burst Jammer', 'Weapon Disruptor', 'ECM', + 'Stasis Grappler', 'Sensor Dampener', 'Target Painter'] fit.modules.filteredItemBoost(lambda mod: mod.item.group.name in groups or mod.item.requiresSkill("Propulsion Jamming"), - "capacitorNeed", src.getModifiedItemAttr("ewCapacitorNeedBonus")) - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Propulsion Jamming"), - "capacitorNeed", src.getModifiedItemAttr("ewCapacitorNeedBonus")) + "capacitorNeed", src.getModifiedItemAttr("ewCapacitorNeedBonus")) \ No newline at end of file diff --git a/eos/effects/modulebonussiegewarfarelinkactiveshielding.py b/eos/effects/modulebonussiegewarfarelinkactiveshielding.py index 0719d3c71..a24ddcedc 100644 --- a/eos/effects/modulebonussiegewarfarelinkactiveshielding.py +++ b/eos/effects/modulebonussiegewarfarelinkactiveshielding.py @@ -4,7 +4,7 @@ # Variations of module: Siege Warfare Link - Active Shielding I (2 of 2) type = "gang", "active" gangBoost = "shieldRepairDuration" -runTime = "late" +#runTime = "late" def handler(fit, module, context): if "gang" not in context: return diff --git a/eos/effects/modulebonussiegewarfarelinkshieldefficiency.py b/eos/effects/modulebonussiegewarfarelinkshieldefficiency.py index 7611e9c04..52f0d64d0 100644 --- a/eos/effects/modulebonussiegewarfarelinkshieldefficiency.py +++ b/eos/effects/modulebonussiegewarfarelinkshieldefficiency.py @@ -4,7 +4,7 @@ # Variations of module: Siege Warfare Link - Shield Efficiency I (2 of 2) type = "gang", "active" gangBoost = "shieldRepairCapacitorNeed" -runTime = "late" +#runTime = "late" def handler(fit, module, context): if "gang" not in context: return diff --git a/eos/effects/modulebonussiegewarfarelinkshieldharmonizing.py b/eos/effects/modulebonussiegewarfarelinkshieldharmonizing.py index ddb68ef0e..663a7ecc0 100644 --- a/eos/effects/modulebonussiegewarfarelinkshieldharmonizing.py +++ b/eos/effects/modulebonussiegewarfarelinkshieldharmonizing.py @@ -3,7 +3,7 @@ # Used by: # Variations of module: Siege Warfare Link - Shield Harmonizing I (2 of 2) type = "gang", "active" -runTime = "late" +#runTime = "late" gangBoost = "shieldResistance" def handler(fit, module, context): diff --git a/eos/effects/modulebonusskirmishwarfarelinkevasivemaneuvers.py b/eos/effects/modulebonusskirmishwarfarelinkevasivemaneuvers.py index 8e93481a8..615ec0e10 100644 --- a/eos/effects/modulebonusskirmishwarfarelinkevasivemaneuvers.py +++ b/eos/effects/modulebonusskirmishwarfarelinkevasivemaneuvers.py @@ -4,7 +4,7 @@ # Variations of module: Skirmish Warfare Link - Evasive Maneuvers I (2 of 2) type = "gang", "active" gangBoost = "signatureRadius" -runTime = "late" +#runTime = "late" def handler(fit, module, context): if "gang" not in context: return diff --git a/eos/effects/modulebonusskirmishwarfarelinkinterdictionmaneuvers.py b/eos/effects/modulebonusskirmishwarfarelinkinterdictionmaneuvers.py index 60c868d56..ac6897113 100644 --- a/eos/effects/modulebonusskirmishwarfarelinkinterdictionmaneuvers.py +++ b/eos/effects/modulebonusskirmishwarfarelinkinterdictionmaneuvers.py @@ -4,7 +4,7 @@ # Variations of module: Skirmish Warfare Link - Interdiction Maneuvers I (2 of 2) type = "gang", "active" gangBoost = "interdictionMaxRange" -runTime = "late" +#runTime = "late" def handler(fit, module, context): if "gang" not in context: return diff --git a/eos/effects/modulebonusskirmishwarfarelinkrapiddeployment.py b/eos/effects/modulebonusskirmishwarfarelinkrapiddeployment.py index aae691cd6..f26737711 100644 --- a/eos/effects/modulebonusskirmishwarfarelinkrapiddeployment.py +++ b/eos/effects/modulebonusskirmishwarfarelinkrapiddeployment.py @@ -4,7 +4,7 @@ # Variations of module: Skirmish Warfare Link - Rapid Deployment I (2 of 2) type = "gang", "active" gangBoost = "speedFactor" -runTime = "late" +#runTime = "late" def handler(fit, module, context): if "gang" not in context: return diff --git a/eos/effects/modulebonustriagemodule.py b/eos/effects/modulebonustriagemodule.py index 704348e25..791acecc3 100644 --- a/eos/effects/modulebonustriagemodule.py +++ b/eos/effects/modulebonustriagemodule.py @@ -42,14 +42,13 @@ def handler(fit, src, context): 'Burst Jammer', 'Weapon Disruptor', 'ECM', + 'Stasis Grappler', 'Sensor Dampener', 'Target Painter'] fit.modules.filteredItemBoost(lambda mod: mod.item.group.name in groups or mod.item.requiresSkill("Propulsion Jamming"), "capacitorNeed", src.getModifiedItemAttr("ewCapacitorNeedBonus")) - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Propulsion Jamming"), - "capacitorNeed", src.getModifiedItemAttr("ewCapacitorNeedBonus")) # todo: test for April 2016 release # Block EWAR & projected effects diff --git a/eos/effects/overloadselfdamagebonus.py b/eos/effects/overloadselfdamagebonus.py index 305e9d3d5..0ff334285 100644 --- a/eos/effects/overloadselfdamagebonus.py +++ b/eos/effects/overloadselfdamagebonus.py @@ -1,9 +1,9 @@ # overloadSelfDamageBonus # # Used by: -# Modules from group: Energy Weapon (102 of 209) -# Modules from group: Hybrid Weapon (106 of 221) -# Modules from group: Projectile Weapon (100 of 165) +# Modules from group: Energy Weapon (101 of 209) +# Modules from group: Hybrid Weapon (105 of 221) +# Modules from group: Projectile Weapon (99 of 165) type = "overheat" def handler(fit, module, context): module.boostItemAttr("damageMultiplier", module.getModifiedItemAttr("overloadDamageModifier")) \ No newline at end of file diff --git a/eos/effects/remotearmorpowerneedbonuseffect.py b/eos/effects/remotearmorpowerneedbonuseffect.py index 48137cc6c..9940ffe88 100644 --- a/eos/effects/remotearmorpowerneedbonuseffect.py +++ b/eos/effects/remotearmorpowerneedbonuseffect.py @@ -4,6 +4,5 @@ # Ship: Guardian # Ship: Oneiros type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Armor Repairer", - "power", ship.getModifiedItemAttr("remoteArmorPowerNeedBonus")) +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "power", src.getModifiedItemAttr("remoteArmorPowerNeedBonus")) diff --git a/eos/effects/remotearmorrepairentity.py b/eos/effects/remotearmorrepairentity.py new file mode 100644 index 000000000..4b4b049fc --- /dev/null +++ b/eos/effects/remotearmorrepairentity.py @@ -0,0 +1,10 @@ +# remoteArmorRepairEntity +# +# Used by: +# Drones named like: Armor Maintenance Bot (6 of 6) +type = "projected", "active" +def handler(fit, container, context): + if "projected" in context: + bonus = container.getModifiedItemAttr("armorDamageAmount") + duration = container.getModifiedItemAttr("duration") / 1000.0 + fit.extraAttributes.increase("armorRepair", bonus / duration) diff --git a/eos/effects/remotearmorrepairfalloff.py b/eos/effects/remotearmorrepairfalloff.py index 01ebfd10f..6a1849234 100644 --- a/eos/effects/remotearmorrepairfalloff.py +++ b/eos/effects/remotearmorrepairfalloff.py @@ -2,7 +2,6 @@ # # Used by: # Modules from group: Remote Armor Repairer (39 of 39) -# Drones named like: Armor Maintenance Bot (6 of 6) type = "projected", "active" def handler(fit, container, context): if "projected" in context: diff --git a/eos/effects/remoteecmburst.py b/eos/effects/remoteecmburst.py index cd54b4cbc..45ca33f3f 100644 --- a/eos/effects/remoteecmburst.py +++ b/eos/effects/remoteecmburst.py @@ -1,7 +1,4 @@ -# remoteEcmBurst -# -# Used by: -# Module: ECM Jammer Burst Projector +# Not used by any item type = 'active' def handler(fit, module, context): pass diff --git a/eos/effects/remoteguidancedisruptfalloff.py b/eos/effects/remoteguidancedisruptfalloff.py index 20abfa9d6..48fadecaa 100644 --- a/eos/effects/remoteguidancedisruptfalloff.py +++ b/eos/effects/remoteguidancedisruptfalloff.py @@ -14,4 +14,4 @@ def handler(fit, src, context): ): fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"), tgtAttr, src.getModifiedItemAttr(srcAttr), - stackingPenalties=True) + stackingPenalties=True, remoteResists=True) diff --git a/eos/effects/remotehullrepair.py b/eos/effects/remotehullrepair.py index 1bf1fd50a..84ee64290 100644 --- a/eos/effects/remotehullrepair.py +++ b/eos/effects/remotehullrepair.py @@ -1,7 +1,4 @@ -# remoteHullRepair -# -# Used by: -# Drones named like: Hull Maintenance Bot (6 of 6) +# Not used by any item type = "projected", "active" runTime = "late" def handler(fit, module, context): diff --git a/eos/effects/remotehullrepairentity.py b/eos/effects/remotehullrepairentity.py new file mode 100644 index 000000000..4f41aec22 --- /dev/null +++ b/eos/effects/remotehullrepairentity.py @@ -0,0 +1,11 @@ +# remoteHullRepairEntity +# +# Used by: +# Drones named like: Hull Maintenance Bot (6 of 6) +type = "projected", "active" +runTime = "late" +def handler(fit, module, context): + if "projected" not in context: return + bonus = module.getModifiedItemAttr("structureDamageAmount") + duration = module.getModifiedItemAttr("duration") / 1000.0 + fit.extraAttributes.increase("hullRepair", bonus / duration) diff --git a/eos/effects/remotehullrepairfalloff.py b/eos/effects/remotehullrepairfalloff.py index 41ccddae1..94dc050c7 100644 --- a/eos/effects/remotehullrepairfalloff.py +++ b/eos/effects/remotehullrepairfalloff.py @@ -2,7 +2,6 @@ # # Used by: # Modules from group: Remote Hull Repairer (8 of 8) -# Drones named like: Hull Maintenance Bot (6 of 6) type = "projected", "active" runTime = "late" def handler(fit, module, context): diff --git a/eos/effects/remotesensordampentity.py b/eos/effects/remotesensordampentity.py new file mode 100644 index 000000000..2176a5a51 --- /dev/null +++ b/eos/effects/remotesensordampentity.py @@ -0,0 +1,14 @@ +# remoteSensorDampEntity +# +# Used by: +# Drones named like: SD (3 of 3) +type= "projected", "active" +def handler(fit, module, context): + if "projected" not in context: + return + + fit.ship.boostItemAttr("maxTargetRange", module.getModifiedItemAttr("maxTargetRangeBonus"), + stackingPenalties = True, remoteResists=True) + + fit.ship.boostItemAttr("scanResolution", module.getModifiedItemAttr("scanResolutionBonus"), + stackingPenalties = True, remoteResists=True) diff --git a/eos/effects/remotesensordampfalloff.py b/eos/effects/remotesensordampfalloff.py index aa944bb19..0339ee196 100644 --- a/eos/effects/remotesensordampfalloff.py +++ b/eos/effects/remotesensordampfalloff.py @@ -2,12 +2,13 @@ # # Used by: # Modules from group: Sensor Dampener (6 of 6) -# Drones named like: SD (3 of 3) type= "projected", "active" def handler(fit, module, context): if "projected" not in context: return + fit.ship.boostItemAttr("maxTargetRange", module.getModifiedItemAttr("maxTargetRangeBonus"), - stackingPenalties = True) + stackingPenalties = True, remoteResists=True) + fit.ship.boostItemAttr("scanResolution", module.getModifiedItemAttr("scanResolutionBonus"), - stackingPenalties = True) + stackingPenalties = True, remoteResists=True) diff --git a/eos/effects/remoteshieldtransferentity.py b/eos/effects/remoteshieldtransferentity.py new file mode 100644 index 000000000..7a1fb0e20 --- /dev/null +++ b/eos/effects/remoteshieldtransferentity.py @@ -0,0 +1,10 @@ +# remoteShieldTransferEntity +# +# Used by: +# Drones named like: Shield Maintenance Bot (6 of 6) +type = "projected", "active" +def handler(fit, container, context): + if "projected" in context: + bonus = container.getModifiedItemAttr("shieldBonus") + duration = container.getModifiedItemAttr("duration") / 1000.0 + fit.extraAttributes.increase("shieldRepair", bonus / duration) diff --git a/eos/effects/remoteshieldtransferfalloff.py b/eos/effects/remoteshieldtransferfalloff.py index 883341859..1506da541 100644 --- a/eos/effects/remoteshieldtransferfalloff.py +++ b/eos/effects/remoteshieldtransferfalloff.py @@ -2,7 +2,6 @@ # # Used by: # Modules from group: Remote Shield Booster (38 of 38) -# Drones named like: Shield Maintenance Bot (6 of 6) type = "projected", "active" def handler(fit, container, context): if "projected" in context: diff --git a/eos/effects/remotetargetpaintentity.py b/eos/effects/remotetargetpaintentity.py new file mode 100644 index 000000000..4c001bd41 --- /dev/null +++ b/eos/effects/remotetargetpaintentity.py @@ -0,0 +1,9 @@ +# remoteTargetPaintEntity +# +# Used by: +# Drones named like: TP (3 of 3) +type = "projected", "active" +def handler(fit, container, context): + if "projected" in context: + fit.ship.boostItemAttr("signatureRadius", container.getModifiedItemAttr("signatureRadiusBonus"), + stackingPenalties = True, remoteResists=True) diff --git a/eos/effects/remotetargetpaintfalloff.py b/eos/effects/remotetargetpaintfalloff.py index feb722b42..2d1fcb539 100644 --- a/eos/effects/remotetargetpaintfalloff.py +++ b/eos/effects/remotetargetpaintfalloff.py @@ -2,9 +2,8 @@ # # Used by: # Modules from group: Target Painter (8 of 8) -# Drones named like: TP (3 of 3) type = "projected", "active" def handler(fit, container, context): if "projected" in context: fit.ship.boostItemAttr("signatureRadius", container.getModifiedItemAttr("signatureRadiusBonus"), - stackingPenalties = True) + stackingPenalties = True, remoteResists=True) diff --git a/eos/effects/remotetrackingdisruptfalloff.py b/eos/effects/remotetrackingdisruptfalloff.py index 05e193603..9ea0a7f4e 100644 --- a/eos/effects/remotetrackingdisruptfalloff.py +++ b/eos/effects/remotetrackingdisruptfalloff.py @@ -1,17 +1,16 @@ # remoteTrackingDisruptFalloff # # Used by: -# Drones named like: TD (3 of 3) # Variations of module: Tracking Disruptor I (6 of 6) type= "projected", "active" def handler(fit, module, context): if "projected" in context: fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"), "trackingSpeed", module.getModifiedItemAttr("trackingSpeedBonus"), - stackingPenalties = True) + stackingPenalties = True, remoteResists=True) fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"), "maxRange", module.getModifiedItemAttr("maxRangeBonus"), - stackingPenalties = True) + stackingPenalties = True, remoteResists=True) fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"), "falloff", module.getModifiedItemAttr("falloffBonus"), - stackingPenalties = True) + stackingPenalties = True, remoteResists=True) diff --git a/eos/effects/remoteweapondisruptentity.py b/eos/effects/remoteweapondisruptentity.py new file mode 100644 index 000000000..3b997e147 --- /dev/null +++ b/eos/effects/remoteweapondisruptentity.py @@ -0,0 +1,16 @@ +# remoteWeaponDisruptEntity +# +# Used by: +# Drones named like: TD (3 of 3) +type= "projected", "active" +def handler(fit, module, context): + if "projected" in context: + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"), + "trackingSpeed", module.getModifiedItemAttr("trackingSpeedBonus"), + stackingPenalties = True, remoteResists=True) + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"), + "maxRange", module.getModifiedItemAttr("maxRangeBonus"), + stackingPenalties = True, remoteResists=True) + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"), + "falloff", module.getModifiedItemAttr("falloffBonus"), + stackingPenalties = True, remoteResists=True) diff --git a/eos/effects/remotewebifierentity.py b/eos/effects/remotewebifierentity.py new file mode 100644 index 000000000..36186be00 --- /dev/null +++ b/eos/effects/remotewebifierentity.py @@ -0,0 +1,9 @@ +# remoteWebifierEntity +# +# Used by: +# Drones from group: Stasis Webifying Drone (3 of 3) +type = "active", "projected" +def handler(fit, module, context): + if "projected" not in context: return + fit.ship.boostItemAttr("maxVelocity", module.getModifiedItemAttr("speedFactor"), + stackingPenalties = True, remoteResists=True) diff --git a/eos/effects/remotewebifierfalloff.py b/eos/effects/remotewebifierfalloff.py index 76d932c70..1f37c29c5 100644 --- a/eos/effects/remotewebifierfalloff.py +++ b/eos/effects/remotewebifierfalloff.py @@ -1,11 +1,10 @@ # remoteWebifierFalloff # # Used by: -# Drones from group: Stasis Webifying Drone (3 of 3) # Modules from group: Stasis Grappler (7 of 7) # Modules from group: Stasis Web (18 of 18) type = "active", "projected" def handler(fit, module, context): if "projected" not in context: return fit.ship.boostItemAttr("maxVelocity", module.getModifiedItemAttr("speedFactor"), - stackingPenalties = True) + stackingPenalties = True, remoteResists=True) diff --git a/eos/effects/shieldtransportcpuneedbonuseffect.py b/eos/effects/shieldtransportcpuneedbonuseffect.py index 8d40190cf..0e5cf26bf 100644 --- a/eos/effects/shieldtransportcpuneedbonuseffect.py +++ b/eos/effects/shieldtransportcpuneedbonuseffect.py @@ -3,6 +3,5 @@ # Used by: # Ships from group: Logistics (3 of 5) type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Shield Booster", - "cpu", ship.getModifiedItemAttr("shieldTransportCpuNeedBonus")) +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Emission Systems"), "cpu", src.getModifiedItemAttr("shieldTransportCpuNeedBonus")) diff --git a/eos/effects/shipbonusenergyvampirerangead2.py b/eos/effects/shipbonusenergyvampirerangead2.py index 90f055473..5739edcbc 100644 --- a/eos/effects/shipbonusenergyvampirerangead2.py +++ b/eos/effects/shipbonusenergyvampirerangead2.py @@ -1,7 +1,4 @@ -# shipBonusEnergyVampireRangeAD2 -# -# Used by: -# Ship: Dragoon +# Not used by any item type = "passive" def handler(fit, ship, context): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu", diff --git a/eos/effects/shipbonusforceauxiliarya1remoterepairandcapamount.py b/eos/effects/shipbonusforceauxiliarya1remoterepairandcapamount.py index 2a9e8bfba..ef38862e5 100644 --- a/eos/effects/shipbonusforceauxiliarya1remoterepairandcapamount.py +++ b/eos/effects/shipbonusforceauxiliarya1remoterepairandcapamount.py @@ -4,5 +4,9 @@ # Ship: Apostle type = "passive" def handler(fit, src, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Capacitor Emission Systems"), "powerTransferAmount", src.getModifiedItemAttr("shipBonusForceAuxiliaryA1"), skill="Amarr Carrier") - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Remote Armor Repair Systems"), "armorDamageAmount", src.getModifiedItemAttr("shipBonusForceAuxiliaryA1"), skill="Amarr Carrier") + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capacitor Emission Systems") or + mod.item.requiresSkill("Capital Capacitor Emission Systems"), + "powerTransferAmount", src.getModifiedItemAttr("shipBonusForceAuxiliaryA1"), skill="Amarr Carrier") + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems") or + mod.item.requiresSkill("Capital Remote Armor Repair Systems"), + "armorDamageAmount", src.getModifiedItemAttr("shipBonusForceAuxiliaryA1"), skill="Amarr Carrier") diff --git a/eos/effects/shipbonusforceauxiliaryc1remoteboostandcapamount.py b/eos/effects/shipbonusforceauxiliaryc1remoteboostandcapamount.py index 1b0b75d4d..0aaf8c8a9 100644 --- a/eos/effects/shipbonusforceauxiliaryc1remoteboostandcapamount.py +++ b/eos/effects/shipbonusforceauxiliaryc1remoteboostandcapamount.py @@ -4,5 +4,9 @@ # Ship: Minokawa type = "passive" def handler(fit, src, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Capacitor Emission Systems"), "powerTransferAmount", src.getModifiedItemAttr("shipBonusForceAuxiliaryC1"), skill="Caldari Carrier") - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Shield Emission Systems"), "shieldBonus", src.getModifiedItemAttr("shipBonusForceAuxiliaryC1"), skill="Caldari Carrier") + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capacitor Emission Systems") or + mod.item.requiresSkill("Capital Capacitor Emission Systems"), + "powerTransferAmount", src.getModifiedItemAttr("shipBonusForceAuxiliaryC1"), skill="Caldari Carrier") + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Emission Systems") or + mod.item.requiresSkill("Capital Shield Emission Systems"), + "shieldBonus", src.getModifiedItemAttr("shipBonusForceAuxiliaryC1"), skill="Caldari Carrier") diff --git a/eos/effects/shipbonusforceauxiliaryg1remotecycletime.py b/eos/effects/shipbonusforceauxiliaryg1remotecycletime.py index f73fe5bd8..eb889bf5d 100644 --- a/eos/effects/shipbonusforceauxiliaryg1remotecycletime.py +++ b/eos/effects/shipbonusforceauxiliaryg1remotecycletime.py @@ -4,7 +4,9 @@ # Ship: Ninazu type = "passive" def handler(fit, src, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Remote Armor Repair Systems"), "duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryG1"), skill="Gallente Carrier") - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Shield Emission Systems"), "duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryG1"), skill="Gallente Carrier") - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Emission Systems"), "duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryG1"), skill="Gallente Carrier") - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryG1"), skill="Gallente Carrier") + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Emission Systems") or + mod.item.requiresSkill("Capital Shield Emission Systems"), + "duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryG1"), skill="Gallente Carrier") + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems") or + mod.item.requiresSkill("Capital Remote Armor Repair Systems"), + "duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryG1"), skill="Gallente Carrier") diff --git a/eos/effects/shipbonusforceauxiliarym1remotecycletime.py b/eos/effects/shipbonusforceauxiliarym1remotecycletime.py index f553f578e..90f14c952 100644 --- a/eos/effects/shipbonusforceauxiliarym1remotecycletime.py +++ b/eos/effects/shipbonusforceauxiliarym1remotecycletime.py @@ -4,7 +4,10 @@ # Ship: Lif type = "passive" def handler(fit, src, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Emission Systems"), "duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryM1"), skill="Minmatar Carrier") - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Shield Emission Systems"), "duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryM1"), skill="Minmatar Carrier") - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryM1"), skill="Minmatar Carrier") - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Remote Armor Repair Systems"), "duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryM1"), skill="Minmatar Carrier") + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Emission Systems") or + mod.item.requiresSkill("Capital Shield Emission Systems"), + "duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryM1"), skill="Minmatar Carrier") + + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems") or + mod.item.requiresSkill("Capital Remote Armor Repair Systems"), + "duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryM1"), skill="Minmatar Carrier") diff --git a/eos/effects/shipbonusremotearmorrepairamount2af.py b/eos/effects/shipbonusremotearmorrepairamount2af.py index dbabc1045..c672f9496 100644 --- a/eos/effects/shipbonusremotearmorrepairamount2af.py +++ b/eos/effects/shipbonusremotearmorrepairamount2af.py @@ -4,6 +4,5 @@ # Ship: Deacon # Ship: Inquisitor type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Armor Repairer", - "armorDamageAmount", ship.getModifiedItemAttr("shipBonus2AF"), skill="Amarr Frigate") +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "armorDamageAmount", src.getModifiedItemAttr("shipBonus2AF"), skill="Amarr Frigate") diff --git a/eos/effects/shipbonusremotearmorrepairamountac2.py b/eos/effects/shipbonusremotearmorrepairamountac2.py index 5d90469a3..2b56129bf 100644 --- a/eos/effects/shipbonusremotearmorrepairamountac2.py +++ b/eos/effects/shipbonusremotearmorrepairamountac2.py @@ -3,6 +3,5 @@ # Used by: # Ship: Augoror type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Armor Repairer", - "armorDamageAmount", ship.getModifiedItemAttr("shipBonusAC2"), skill="Amarr Cruiser") +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "armorDamageAmount", src.getModifiedItemAttr("shipBonusAC2"), skill="Amarr Cruiser") diff --git a/eos/effects/shipbonusremotearmorrepairamountgc2.py b/eos/effects/shipbonusremotearmorrepairamountgc2.py index fbd04f0b2..7612f0191 100644 --- a/eos/effects/shipbonusremotearmorrepairamountgc2.py +++ b/eos/effects/shipbonusremotearmorrepairamountgc2.py @@ -3,6 +3,5 @@ # Used by: # Ship: Exequror type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Armor Repairer", - "armorDamageAmount", ship.getModifiedItemAttr("shipBonusGC2"), skill="Gallente Cruiser") +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "armorDamageAmount", src.getModifiedItemAttr("shipBonusGC2"), skill="Gallente Cruiser") diff --git a/eos/effects/shipbonusremotearmorrepairamountgf2.py b/eos/effects/shipbonusremotearmorrepairamountgf2.py index 56bb2a1bb..40475557a 100644 --- a/eos/effects/shipbonusremotearmorrepairamountgf2.py +++ b/eos/effects/shipbonusremotearmorrepairamountgf2.py @@ -3,6 +3,5 @@ # Used by: # Variations of ship: Navitas (2 of 2) type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Armor Repairer", - "armorDamageAmount", ship.getModifiedItemAttr("shipBonusGF2"), skill="Gallente Frigate") +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "armorDamageAmount", src.getModifiedItemAttr("shipBonusGF2"), skill="Gallente Frigate") diff --git a/eos/effects/shipbonusremotearmorrepaircapneedac1.py b/eos/effects/shipbonusremotearmorrepaircapneedac1.py index d93489454..d9257a835 100644 --- a/eos/effects/shipbonusremotearmorrepaircapneedac1.py +++ b/eos/effects/shipbonusremotearmorrepaircapneedac1.py @@ -3,6 +3,5 @@ # Used by: # Ship: Augoror type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Armor Repairer", - "capacitorNeed", ship.getModifiedItemAttr("shipBonusAC"), skill="Amarr Cruiser") +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "capacitorNeed", src.getModifiedItemAttr("shipBonusAC"), skill="Amarr Cruiser") diff --git a/eos/effects/shipbonusremotearmorrepaircapneedaf.py b/eos/effects/shipbonusremotearmorrepaircapneedaf.py index b79927306..56daea7ba 100644 --- a/eos/effects/shipbonusremotearmorrepaircapneedaf.py +++ b/eos/effects/shipbonusremotearmorrepaircapneedaf.py @@ -4,6 +4,5 @@ # Ship: Deacon # Ship: Inquisitor type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Armor Repairer", - "capacitorNeed", ship.getModifiedItemAttr("shipBonusAF"), skill="Amarr Frigate") +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "capacitorNeed", src.getModifiedItemAttr("shipBonusAF"), skill="Amarr Frigate") diff --git a/eos/effects/shipbonusremotearmorrepaircapneedgc1.py b/eos/effects/shipbonusremotearmorrepaircapneedgc1.py index 022e51477..79788def7 100644 --- a/eos/effects/shipbonusremotearmorrepaircapneedgc1.py +++ b/eos/effects/shipbonusremotearmorrepaircapneedgc1.py @@ -3,6 +3,5 @@ # Used by: # Ship: Exequror type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Armor Repairer", - "capacitorNeed", ship.getModifiedItemAttr("shipBonusGC"), skill="Gallente Cruiser") +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "capacitorNeed", src.getModifiedItemAttr("shipBonusGC"), skill="Gallente Cruiser") diff --git a/eos/effects/shipbonusremotearmorrepaircapneedgf.py b/eos/effects/shipbonusremotearmorrepaircapneedgf.py index f081267cf..6f2c5fd7a 100644 --- a/eos/effects/shipbonusremotearmorrepaircapneedgf.py +++ b/eos/effects/shipbonusremotearmorrepaircapneedgf.py @@ -3,6 +3,5 @@ # Used by: # Variations of ship: Navitas (2 of 2) type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Armor Repairer", - "capacitorNeed", ship.getModifiedItemAttr("shipBonusGF"), skill="Gallente Frigate") +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "capacitorNeed", src.getModifiedItemAttr("shipBonusGF"), skill="Gallente Frigate") diff --git a/eos/effects/shipbonusshieldtransfercapneed1.py b/eos/effects/shipbonusshieldtransfercapneed1.py index 922d3804f..1414679f2 100644 --- a/eos/effects/shipbonusshieldtransfercapneed1.py +++ b/eos/effects/shipbonusshieldtransfercapneed1.py @@ -3,6 +3,5 @@ # Used by: # Ship: Osprey type = "passive" -def handler(fit, ship, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Shield Booster", - "capacitorNeed", ship.getModifiedItemAttr("shipBonusCC"), skill="Caldari Cruiser") +def handler(fit, src, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Emission Systems"), "capacitorNeed", src.getModifiedItemAttr("shipBonusCC"), skill="Caldari Cruiser") diff --git a/eos/effects/shipxlprojectiledamagerole.py b/eos/effects/shipxlprojectiledamagerole.py index fbbb39202..e79fcfda7 100644 --- a/eos/effects/shipxlprojectiledamagerole.py +++ b/eos/effects/shipxlprojectiledamagerole.py @@ -1,7 +1,4 @@ -# shipXLProjectileDamageRole -# -# Used by: -# Ship: Naglfar +# Not used by any item type = "passive" def handler(fit, ship, context): fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Projectile Turret"), diff --git a/eos/effects/skillbonusdronenavigation.py b/eos/effects/skillbonusdronenavigation.py index 618ae51fa..bcd65fb81 100644 --- a/eos/effects/skillbonusdronenavigation.py +++ b/eos/effects/skillbonusdronenavigation.py @@ -5,5 +5,5 @@ type = "passive" def handler(fit, src, context): lvl = src.level - fit.drones.filteredItemBoost(lambda mod: mod.item.requiresSkill("Drones"), "maxVelocity", src.getModifiedItemAttr("droneMaxVelocityBonus") * lvl) - fit.fighters.filteredItemBoost(lambda mod: mod.item.requiresSkill("Fighters"), "maxVelocity", src.getModifiedItemAttr("droneMaxVelocityBonus") * lvl) + fit.drones.filteredItemBoost(lambda mod: mod.item.requiresSkill("Drones"), "maxVelocity", src.getModifiedItemAttr("maxVelocityBonus") * lvl) + fit.fighters.filteredItemBoost(lambda mod: mod.item.requiresSkill("Fighters"), "maxVelocity", src.getModifiedItemAttr("maxVelocityBonus") * lvl) diff --git a/eos/effects/skillreactivearmorhardenercapneedbonus.py b/eos/effects/skillreactivearmorhardenercapneedbonus.py index 888995e40..e377cd9a9 100644 --- a/eos/effects/skillreactivearmorhardenercapneedbonus.py +++ b/eos/effects/skillreactivearmorhardenercapneedbonus.py @@ -1,3 +1,7 @@ +# skillReactiveArmorHardenerCapNeedBonus +# +# Used by: +# Skill: Resistance Phasing type = "passive" def handler(fit, src, context): lvl = src.level diff --git a/eos/effects/skillreactivearmorhardenerdurationbonus.py b/eos/effects/skillreactivearmorhardenerdurationbonus.py index 20ff0d48e..45e4c0b91 100644 --- a/eos/effects/skillreactivearmorhardenerdurationbonus.py +++ b/eos/effects/skillreactivearmorhardenerdurationbonus.py @@ -1,3 +1,7 @@ +# skillReactiveArmorHardenerDurationBonus +# +# Used by: +# Skill: Resistance Phasing type = "passive" def handler(fit, src, context): lvl = src.level diff --git a/eos/effects/skillremotehullrepairsystemscapneedbonus.py b/eos/effects/skillremotehullrepairsystemscapneedbonus.py index c9a31e3df..181ab2239 100644 --- a/eos/effects/skillremotehullrepairsystemscapneedbonus.py +++ b/eos/effects/skillremotehullrepairsystemscapneedbonus.py @@ -1,4 +1,4 @@ -# skillRemoteHullRepairSystemsCapNeedBonus +# skillRemoteHullRepairSystemsCapNeedBonus # # Used by: # Skill: Remote Hull Repair Systems diff --git a/eos/effects/subsystembonusamarrdefensive2remotearmorrepairamount.py b/eos/effects/subsystembonusamarrdefensive2remotearmorrepairamount.py index f14c08301..fa0c9a3e8 100644 --- a/eos/effects/subsystembonusamarrdefensive2remotearmorrepairamount.py +++ b/eos/effects/subsystembonusamarrdefensive2remotearmorrepairamount.py @@ -4,5 +4,5 @@ # Subsystem: Legion Defensive - Adaptive Augmenter type = "passive" def handler(fit, module, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Armor Repairer", + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "armorDamageAmount", module.getModifiedItemAttr("subsystemBonusAmarrDefensive2"), skill="Amarr Defensive Systems") diff --git a/eos/effects/subsystembonuscaldaridefensive2remoteshieldtransporteramount.py b/eos/effects/subsystembonuscaldaridefensive2remoteshieldtransporteramount.py index e55064df9..d267413eb 100644 --- a/eos/effects/subsystembonuscaldaridefensive2remoteshieldtransporteramount.py +++ b/eos/effects/subsystembonuscaldaridefensive2remoteshieldtransporteramount.py @@ -4,5 +4,5 @@ # Subsystem: Tengu Defensive - Adaptive Shielding type = "passive" def handler(fit, module, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Shield Booster", + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Emission Systems"), "shieldBonus", module.getModifiedItemAttr("subsystemBonusCaldariDefensive2"), skill="Caldari Defensive Systems") diff --git a/eos/effects/subsystembonusgallentedefensive2remotearmorrepairamount.py b/eos/effects/subsystembonusgallentedefensive2remotearmorrepairamount.py index 9a8a14678..25c865057 100644 --- a/eos/effects/subsystembonusgallentedefensive2remotearmorrepairamount.py +++ b/eos/effects/subsystembonusgallentedefensive2remotearmorrepairamount.py @@ -4,5 +4,5 @@ # Subsystem: Proteus Defensive - Adaptive Augmenter type = "passive" def handler(fit, module, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Armor Repairer", + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "armorDamageAmount", module.getModifiedItemAttr("subsystemBonusGallenteDefensive2"), skill="Gallente Defensive Systems") diff --git a/eos/effects/subsystembonusminmatardefensive2remoteshieldtransporteramount.py b/eos/effects/subsystembonusminmatardefensive2remoteshieldtransporteramount.py index 1e5d2c069..349d30c51 100644 --- a/eos/effects/subsystembonusminmatardefensive2remoteshieldtransporteramount.py +++ b/eos/effects/subsystembonusminmatardefensive2remoteshieldtransporteramount.py @@ -4,5 +4,5 @@ # Subsystem: Loki Defensive - Adaptive Shielding type = "passive" def handler(fit, module, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Remote Shield Booster", + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Emission Systems"), "shieldBonus", module.getModifiedItemAttr("subsystemBonusMinmatarDefensive2"), skill="Minmatar Defensive Systems") diff --git a/eos/effects/titanturretdamagescaling.py b/eos/effects/titanturretdamagescaling.py index ce19cd6c2..7f549ae75 100644 --- a/eos/effects/titanturretdamagescaling.py +++ b/eos/effects/titanturretdamagescaling.py @@ -1,7 +1,4 @@ -# titanTurretDamageScaling -# -# Used by: -# Ships from group: Titan (4 of 4) +# Not used by any item type = "passive" def handler(fit, ship, context): fit.modules.filteredItemIncrease(lambda mod: mod.item.requiresSkill("Gunnery"), diff --git a/eos/effects/triagemodeeffect3.py b/eos/effects/triagemodeeffect3.py index 763f8ca73..17b9a8758 100644 --- a/eos/effects/triagemodeeffect3.py +++ b/eos/effects/triagemodeeffect3.py @@ -73,6 +73,7 @@ def handler(fit, module, context): 'Burst Projectors', 'Weapon Disruptor', 'ECM', + 'Stasis Grappler', 'Remote Sensor Damper', 'Target Painter'] diff --git a/eos/effects/triagemodeeffect7.py b/eos/effects/triagemodeeffect7.py index 07f3d45c6..17cb9532f 100644 --- a/eos/effects/triagemodeeffect7.py +++ b/eos/effects/triagemodeeffect7.py @@ -83,6 +83,7 @@ def handler(fit, module, context): 'Burst Projectors', 'Weapon Disruptor', 'ECM', + 'Stasis Grappler', 'Remote Sensor Damper', 'Target Painter'] diff --git a/eos/effects/turretweaponrangefallofftrackingspeedmultiplytargethostile.py b/eos/effects/turretweaponrangefallofftrackingspeedmultiplytargethostile.py index 05ed6876a..63d9743b9 100644 --- a/eos/effects/turretweaponrangefallofftrackingspeedmultiplytargethostile.py +++ b/eos/effects/turretweaponrangefallofftrackingspeedmultiplytargethostile.py @@ -1,7 +1,4 @@ -# turretWeaponRangeFalloffTrackingSpeedMultiplyTargetHostile -# -# Used by: -# Drones named like: TD (3 of 3) +# Not used by any item type = "projected", "active" def handler(fit, container, context): if "projected" in context: diff --git a/eos/effects/warpscramble.py b/eos/effects/warpscramble.py index 9c819a3bc..96d0b3d40 100644 --- a/eos/effects/warpscramble.py +++ b/eos/effects/warpscramble.py @@ -1,9 +1,7 @@ # warpScramble # # Used by: -# Variations of module: Heavy Warp Disruptor I (7 of 7) -# Variations of module: Warp Disruptor I (19 of 19) -# Module: Civilian Warp Disruptor +# Modules named like: Warp Disruptor (27 of 27) type = "projected", "active" def handler(fit, module, context): fit.ship.increaseItemAttr("warpScrambleStatus", module.getModifiedItemAttr("warpScrambleStrength")) \ No newline at end of file diff --git a/eos/effects/warpscrambleblockmwdwithnpceffect.py b/eos/effects/warpscrambleblockmwdwithnpceffect.py index 55cb867d6..5369efc45 100644 --- a/eos/effects/warpscrambleblockmwdwithnpceffect.py +++ b/eos/effects/warpscrambleblockmwdwithnpceffect.py @@ -1,8 +1,7 @@ # warpScrambleBlockMWDWithNPCEffect # # Used by: -# Variations of module: Heavy Warp Scrambler I (7 of 7) -# Variations of module: Warp Scrambler I (19 of 19) +# Modules named like: Warp Scrambler (26 of 26) runTime = "early" type = "projected", "active" diff --git a/eos/graph/fitDps.py b/eos/graph/fitDps.py index e427ba30c..dc402706d 100644 --- a/eos/graph/fitDps.py +++ b/eos/graph/fitDps.py @@ -78,9 +78,13 @@ class FitDpsGraph(Graph): dps, _ = drone.damageStats(fit.targetResists) total += dps * multiplier + # this is janky as fuck for fighter in fit.fighters: - dps, _ = fighter.damageStats(fit.targetResists) - total += dps + for ability in fighter.abilities: + if ability.dealsDamage and ability.active: + multiplier = self.calculateFighterMissileMultiplier(ability, data) + dps, _ = ability.damageStats(fit.targetResists) + total += dps * multiplier return total @@ -116,6 +120,35 @@ class FitDpsGraph(Graph): multiplier = min(1, (float(targetSigRad) / dmgScaling) ** 2) return multiplier + def calculateFighterMissileMultiplier(self, ability, data): + prefix = ability.attrPrefix + + targetSigRad = data["signatureRadius"] + targetVelocity = data["velocity"] + explosionRadius = ability.fighter.getModifiedItemAttr("{}ExplosionRadius".format(prefix)) + explosionVelocity = ability.fighter.getModifiedItemAttr("{}ExplosionVelocity".format(prefix)) + damageReductionFactor = ability.fighter.getModifiedItemAttr("{}ReductionFactor".format(prefix)) + + # the following conditionals are because CCP can't keep a decent naming convention, as if fighter implementation + # wasn't already fucked. + if damageReductionFactor is None: + damageReductionFactor = ability.fighter.getModifiedItemAttr("{}DamageReductionFactor".format(prefix)) + + damageReductionSensitivity = ability.fighter.getModifiedItemAttr("{}ReductionSensitivity".format(prefix)) + if damageReductionSensitivity is None: + damageReductionSensitivity = ability.fighter.getModifiedItemAttr("{}DamageReductionSensitivity".format(prefix)) + + targetSigRad = explosionRadius if targetSigRad is None else targetSigRad + sigRadiusFactor = targetSigRad / explosionRadius + + if targetVelocity: + velocityFactor = (explosionVelocity / explosionRadius * targetSigRad / targetVelocity) ** ( + log(damageReductionFactor) / log(damageReductionSensitivity)) + else: + velocityFactor = 1 + + return min(sigRadiusFactor, velocityFactor, 1) + def calculateTurretChanceToHit(self, mod, data): distance = data["distance"] * 1000 tracking = mod.getModifiedItemAttr("trackingSpeed") diff --git a/eos/modifiedAttributeDict.py b/eos/modifiedAttributeDict.py index ed331ae6a..0f366af6f 100644 --- a/eos/modifiedAttributeDict.py +++ b/eos/modifiedAttributeDict.py @@ -153,13 +153,24 @@ class ModifiedAttributeDict(collections.MutableMapping): if attrInfo is None: cappingId = cappingAttrKeyCache[key] = None else: + # see GH issue #620 cappingId = cappingAttrKeyCache[key] = attrInfo.maxAttributeID if cappingId is None: cappingKey = None else: cappingAttrInfo = getAttributeInfo(cappingId) cappingKey = None if cappingAttrInfo is None else cappingAttrInfo.name - cappingValue = self.__calculateValue(cappingKey) if cappingKey is not None else None + + if cappingKey: + if cappingKey in self.original: + # some items come with their own caps (ie: carriers). If they do, use this + cappingValue = self.original.get(cappingKey).value + else: + # If not, get info about the default value + cappingValue = self.__calculateValue(cappingKey) + else: + cappingValue = None + # If value is forced, we don't have to calculate anything, # just return forced value instead force = self.__forced[key] if key in self.__forced else None @@ -312,14 +323,27 @@ class ModifiedAttributeDict(collections.MutableMapping): if not attributeName in self.__multipliers: self.__multipliers[attributeName] = 1 self.__multipliers[attributeName] *= multiplier + self.__placehold(attributeName) self.__afflict(attributeName, "%s*" % ("s" if stackingPenalties else ""), multiplier, multiplier != 1) - def boost(self, attributeName, boostFactor, skill=None, *args, **kwargs): + def boost(self, attributeName, boostFactor, skill=None, remoteResists=False, *args, **kwargs): """Boost value by some percentage""" if skill: boostFactor *= self.__handleSkill(skill) + if remoteResists: + # @todo: this is such a disgusting hack. Look into sending these checks to the module class before the + # effect is applied. + mod = self.fit.getModifier() + remoteResistID = mod.getModifiedItemAttr("remoteResistanceID") or None + + # We really don't have a way of getting a ships attribute by ID. Fail. + resist = next((x for x in self.fit.ship.item.attributes.values() if x.ID == remoteResistID), None) + + if remoteResistID and resist: + boostFactor *= resist.value + # We just transform percentage boost into multiplication factor self.multiply(attributeName, 1 + boostFactor / 100.0, *args, **kwargs) diff --git a/eos/saveddata/character.py b/eos/saveddata/character.py index 2d3fc260d..adbb1fbf9 100644 --- a/eos/saveddata/character.py +++ b/eos/saveddata/character.py @@ -315,7 +315,10 @@ class Skill(HandledItem): return self.__item def getModifiedItemAttr(self, key): - return self.item.attributes[key].value + if key in self.item.attributes: + return self.item.attributes[key].value + else: + return None def calculateModifiedAttributes(self, fit, runTime): if self.__suppressed: # or not self.learned - removed for GH issue 101 diff --git a/eos/saveddata/fighter.py b/eos/saveddata/fighter.py index 353273106..ebbffb814 100644 --- a/eos/saveddata/fighter.py +++ b/eos/saveddata/fighter.py @@ -159,25 +159,11 @@ class Fighter(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): if self.__dps is None: self.__volley = 0 self.__dps = 0 - if self.active: + if self.active and self.amountActive > 0: for ability in self.abilities: - if ability.dealsDamage and ability.active and self.amountActive > 0: - - cycleTime = self.getModifiedItemAttr("{}Duration".format(ability.attrPrefix)) - if ability.attrPrefix == "fighterAbilityLaunchBomb": - # bomb calcs - volley = sum(map(lambda attr: (self.getModifiedChargeAttr("%sDamage" % attr) or 0) * (1 - getattr(targetResists, "%sAmount" % attr, 0)), self.DAMAGE_TYPES)) - print volley - else: - volley = sum(map(lambda d2, d: - (self.getModifiedItemAttr("{}Damage{}".format(ability.attrPrefix, d2)) or 0) * - (1-getattr(targetResists, "{}Amount".format(d), 0)), - self.DAMAGE_TYPES2, self.DAMAGE_TYPES)) - - volley *= self.amountActive - volley *= self.getModifiedItemAttr("{}DamageMultiplier".format(ability.attrPrefix)) or 1 - self.__volley += volley - self.__dps += volley / (cycleTime / 1000.0) + dps, volley = ability.damageStats(targetResists) + self.__dps += dps + self.__volley += volley return self.__dps, self.__volley @@ -222,6 +208,7 @@ class Fighter(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): self.__miningyield = None self.itemModifiedAttributes.clear() self.chargeModifiedAttributes.clear() + [x.clear() for x in self.abilities] def canBeApplied(self, projectedOnto): """Check if fighter can engage specific fitting""" diff --git a/eos/saveddata/fighterAbility.py b/eos/saveddata/fighterAbility.py index 3956a2e4d..e7756bde1 100644 --- a/eos/saveddata/fighterAbility.py +++ b/eos/saveddata/fighterAbility.py @@ -23,6 +23,8 @@ import logging logger = logging.getLogger(__name__) class FighterAbility(object): + DAMAGE_TYPES = ("em", "kinetic", "explosive", "thermal") + DAMAGE_TYPES2 = ("EM", "Kin", "Exp", "Therm") def __init__(self, effect): """Initialize from the program""" @@ -67,4 +69,33 @@ class FighterAbility(object): @property def grouped(self): # is the ability applied per fighter (webs, returns False), or as a group (MWD, returned True) - return self.__effect.getattr('grouped') \ No newline at end of file + return self.__effect.getattr('grouped') + + def damageStats(self, targetResists=None): + if self.__dps is None: + self.__volley = 0 + self.__dps = 0 + if self.dealsDamage and self.active: + cycleTime = self.fighter.getModifiedItemAttr("{}Duration".format(self.attrPrefix)) + + if self.attrPrefix == "fighterAbilityLaunchBomb": + # bomb calcs + volley = sum(map(lambda attr: (self.fighter.getModifiedChargeAttr("%sDamage" % attr) or 0) * ( + 1 - getattr(targetResists, "%sAmount" % attr, 0)), self.DAMAGE_TYPES)) + else: + volley = sum(map(lambda d2, d: + (self.fighter.getModifiedItemAttr( + "{}Damage{}".format(self.attrPrefix, d2)) or 0) * + (1 - getattr(targetResists, "{}Amount".format(d), 0)), + self.DAMAGE_TYPES2, self.DAMAGE_TYPES)) + + volley *= self.fighter.amountActive + volley *= self.fighter.getModifiedItemAttr("{}DamageMultiplier".format(self.attrPrefix)) or 1 + self.__volley += volley + self.__dps += volley / (cycleTime / 1000.0) + + return self.__dps, self.__volley + + def clear(self): + self.__dps = None + self.__volley = None diff --git a/eos/saveddata/ship.py b/eos/saveddata/ship.py index 0d9def9ee..3a78fd122 100644 --- a/eos/saveddata/ship.py +++ b/eos/saveddata/ship.py @@ -48,7 +48,7 @@ class Ship(ItemAttrShortcut, HandledItem): self.__item = item self.__modeItems = self.__getModeItems() - self.__itemModifiedAttributes = ModifiedAttributeDict() + self.__itemModifiedAttributes = ModifiedAttributeDict(parent=self) self.__itemModifiedAttributes.original = dict(self.item.attributes) self.__itemModifiedAttributes.original.update(self.EXTRA_ATTRIBUTES) self.__itemModifiedAttributes.overrides = self.item.overrides diff --git a/eve.db b/eve.db index 5756cf5c6..25a40b791 100644 Binary files a/eve.db and b/eve.db differ diff --git a/gui/builtinContextMenus/changeAffectingSkills.py b/gui/builtinContextMenus/changeAffectingSkills.py index fecd77234..5111a8d27 100644 --- a/gui/builtinContextMenus/changeAffectingSkills.py +++ b/gui/builtinContextMenus/changeAffectingSkills.py @@ -60,7 +60,7 @@ class ChangeAffectingSkills(ContextMenu): else: label = "Level %s" % i - id = wx.NewId() + id = ContextMenu.nextID() self.skillIds[id] = (skill, i) menuItem = wx.MenuItem(rootMenu, id, label, kind=wx.ITEM_RADIO) rootMenu.Bind(wx.EVT_MENU, self.handleSkillChange, menuItem) @@ -72,7 +72,7 @@ class ChangeAffectingSkills(ContextMenu): sub = wx.Menu() for skill in self.skills: - skillItem = wx.MenuItem(sub, wx.NewId(), skill.item.name) + skillItem = wx.MenuItem(sub, ContextMenu.nextID(), skill.item.name) grandSub = wx.Menu() skillItem.SetSubMenu(grandSub) if skill.learned: diff --git a/gui/builtinContextMenus/damagePattern.py b/gui/builtinContextMenus/damagePattern.py index 3238b9b43..8d9b6be32 100644 --- a/gui/builtinContextMenus/damagePattern.py +++ b/gui/builtinContextMenus/damagePattern.py @@ -48,7 +48,7 @@ class DamagePattern(ContextMenu): return self.m def addPattern(self, rootMenu, pattern): - id = wx.NewId() + id = ContextMenu.nextID() name = getattr(pattern, "_name", pattern.name) if pattern is not None else "No Profile" self.patternIds[id] = pattern diff --git a/gui/builtinContextMenus/fighterAbilities.py b/gui/builtinContextMenus/fighterAbilities.py index 910703659..9a86c23b1 100644 --- a/gui/builtinContextMenus/fighterAbilities.py +++ b/gui/builtinContextMenus/fighterAbilities.py @@ -20,7 +20,7 @@ class FighterAbility(ContextMenu): def addAbility(self, menu, ability): label = ability.name - id = wx.NewId() + id = ContextMenu.nextID() self.abilityIds[id] = ability menuItem = wx.MenuItem(menu, id, label, kind=wx.ITEM_CHECK) menu.Bind(wx.EVT_MENU, self.handleMode, menuItem) diff --git a/gui/builtinContextMenus/implantSets.py b/gui/builtinContextMenus/implantSets.py index 6ae43039b..8dcf6dd1f 100644 --- a/gui/builtinContextMenus/implantSets.py +++ b/gui/builtinContextMenus/implantSets.py @@ -42,7 +42,7 @@ class ImplantSets(ContextMenu): self.idmap = {} for set in implantSets: - id = wx.NewId() + id = ContextMenu.nextID() mitem = wx.MenuItem(rootMenu, id, set.name) bindmenu.Bind(wx.EVT_MENU, self.handleSelection, mitem) self.idmap[id] = set diff --git a/gui/builtinContextMenus/metaSwap.py b/gui/builtinContextMenus/metaSwap.py index 35ae4b36f..5377b40dd 100644 --- a/gui/builtinContextMenus/metaSwap.py +++ b/gui/builtinContextMenus/metaSwap.py @@ -67,11 +67,11 @@ class MetaSwap(ContextMenu): if thisgroup != group: group = thisgroup - id = wx.NewId() + id = ContextMenu.nextID() m.Append(id, u'─ %s ─' % group) m.Enable(id, False) - id = wx.NewId() + id = ContextMenu.nextID() mitem = wx.MenuItem(rootMenu, id, item.name) bindmenu.Bind(wx.EVT_MENU, self.handleModule, mitem) self.moduleLookup[id] = item diff --git a/gui/builtinContextMenus/moduleAmmoPicker.py b/gui/builtinContextMenus/moduleAmmoPicker.py index 24250b7de..3e7ee02cd 100644 --- a/gui/builtinContextMenus/moduleAmmoPicker.py +++ b/gui/builtinContextMenus/moduleAmmoPicker.py @@ -98,7 +98,7 @@ class ModuleAmmoPicker(ContextMenu): return map(self.numericConverter, parts) def addCharge(self, menu, charge): - id = wx.NewId() + id = ContextMenu.nextID() name = charge.name if charge is not None else "Empty" self.chargeIds[id] = charge item = wx.MenuItem(menu, id, name) @@ -112,7 +112,7 @@ class ModuleAmmoPicker(ContextMenu): return item def addSeperator(self, m, text): - id = wx.NewId() + id = ContextMenu.nextID() m.Append(id, u'─ %s ─' % text) m.Enable(id, False) diff --git a/gui/builtinContextMenus/tacticalMode.py b/gui/builtinContextMenus/tacticalMode.py index 3469017a8..3b5cc5043 100644 --- a/gui/builtinContextMenus/tacticalMode.py +++ b/gui/builtinContextMenus/tacticalMode.py @@ -26,7 +26,7 @@ class TacticalMode(ContextMenu): def addMode(self, menu, mode): label = mode.item.name.rsplit()[-2] - id = wx.NewId() + id = ContextMenu.nextID() self.modeIds[id] = mode menuItem = wx.MenuItem(menu, id, label, kind=wx.ITEM_RADIO) menu.Bind(wx.EVT_MENU, self.handleMode, menuItem) diff --git a/gui/builtinContextMenus/targetResists.py b/gui/builtinContextMenus/targetResists.py index 4aeb10ffd..c0f9bf00c 100644 --- a/gui/builtinContextMenus/targetResists.py +++ b/gui/builtinContextMenus/targetResists.py @@ -39,7 +39,7 @@ class TargetResists(ContextMenu): wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID)) def addPattern(self, rootMenu, pattern): - id = wx.NewId() + id = ContextMenu.nextID() name = getattr(pattern, "_name", pattern.name) if pattern is not None else "No Profile" self.patternIds[id] = pattern @@ -89,7 +89,7 @@ class TargetResists(ContextMenu): # Items that have a parent for menuName, patterns in self.subMenus.items(): # Create parent item for root menu that is simply name of parent - item = wx.MenuItem(rootMenu, wx.NewId(), menuName) + item = wx.MenuItem(rootMenu, ContextMenu.nextID(), menuName) # Create menu for child items grandSub = wx.Menu() diff --git a/gui/builtinContextMenus/whProjector.py b/gui/builtinContextMenus/whProjector.py index ac1bb66cb..ba0677e20 100644 --- a/gui/builtinContextMenus/whProjector.py +++ b/gui/builtinContextMenus/whProjector.py @@ -29,7 +29,7 @@ class WhProjector(ContextMenu): sub.AppendItem(subItem) for swData in sorted(effdata[swType], key=lambda tpl: tpl[2]): - wxid = wx.NewId() + wxid = ContextMenu.nextID() swObj, swName, swClass = swData self.idmap[wxid] = (swObj, swName) grandSubItem = wx.MenuItem(grandSub, wxid, swClass) diff --git a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py index 1701e670b..804577b3e 100644 --- a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py +++ b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py @@ -18,6 +18,8 @@ class PFHTMLExportPref ( PreferenceView): 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." + desc4 = "Export Fittings in a minmal HTML Version, just containing the Fittingslinks " +\ + "without any visual styling or javscript features" def populatePanel( self, panel ): self.mainFrame = gui.mainFrame.MainFrame.getInstance() @@ -57,6 +59,17 @@ class PFHTMLExportPref ( PreferenceView): self.exportEnabled.SetValue(self.HTMLExportSettings.getEnabled()) self.exportEnabled.Bind(wx.EVT_CHECKBOX, self.OnExportEnabledChange) mainSizer.Add( self.exportEnabled, 0, wx.ALL|wx.EXPAND, 5 ) + + + + self.stDesc4 = wx.StaticText( panel, wx.ID_ANY, self.desc4, wx.DefaultPosition, wx.DefaultSize, 0 ) + self.stDesc4.Wrap(dlgWidth - 50) + mainSizer.Add( self.stDesc4, 0, wx.ALL, 5 ) + + self.exportMinimal = wx.CheckBox( panel, wx.ID_ANY, u"Enable minimal export Format", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.exportMinimal.SetValue(self.HTMLExportSettings.getMinimalEnabled()) + self.exportMinimal.Bind(wx.EVT_CHECKBOX, self.OnMinimalEnabledChange) + mainSizer.Add( self.exportMinimal, 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) @@ -93,6 +106,9 @@ class PFHTMLExportPref ( PreferenceView): def OnExportEnabledChange(self, event): self.HTMLExportSettings.setEnabled(self.exportEnabled.GetValue()) + + def OnMinimalEnabledChange(self, event): + self.HTMLExportSettings.setMinimalEnabled(self.exportMinimal.GetValue()) def OnCHWebsiteTypeSelect(self, event): choice = self.chWebsiteType.GetStringSelection() diff --git a/gui/builtinViewColumns/misc.py b/gui/builtinViewColumns/misc.py index 05c7f9020..c50f23e47 100644 --- a/gui/builtinViewColumns/misc.py +++ b/gui/builtinViewColumns/misc.py @@ -477,6 +477,8 @@ class Miscellanea(ViewColumn): tooltip = "E{0}".format(tooltip) else: hpRatio = 1 + if itemGroup == "Ancillary Armor Repairer": + hpRatio *= 3 ehp = hp * hpRatio duration = cycles * cycleTime / 1000 text = "{0} / {1}s".format(formatAmount(ehp, 3, 0, 9), formatAmount(duration, 3, 0, 3)) diff --git a/gui/chromeTabs.py b/gui/chromeTabs.py index 27f077d58..06ed1d5a1 100644 --- a/gui/chromeTabs.py +++ b/gui/chromeTabs.py @@ -719,6 +719,7 @@ class PFTabsContainer(wx.Panel): self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnErase) self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp) + self.Bind(wx.EVT_MIDDLE_UP, self.OnMiddleUp) self.Bind(wx.EVT_MOTION, self.OnMotion) self.Bind(wx.EVT_SIZE, self.OnSize) self.Bind(wx.EVT_SYS_COLOUR_CHANGED, self.OnSysColourChanged) @@ -796,6 +797,28 @@ class PFTabsContainer(wx.Panel): if self.CheckTabClose(tab, mposx, mposy): return + def OnMiddleUp(self, event): + mposx, mposy = event.GetPosition() + + tab = self.FindTabAtPos(mposx, mposy) + + if tab is None or not tab.closeButton: # if not able to close, return False + return False + + index = self.tabs.index(tab) + ev = PageClosing(index) + wx.PostEvent(self.Parent, ev) + if ev.isVetoed(): + return False + + index = self.GetTabIndex(tab) + self.DeleteTab(index) + wx.PostEvent(self.Parent, PageClosed(index=index)) + sel = self.GetSelected() + + if sel is not None: + wx.PostEvent(self.Parent, PageChanged(-1, sel)) + def GetSelectedTab(self): for tab in self.tabs: if tab.GetSelected(): diff --git a/gui/contextMenu.py b/gui/contextMenu.py index 4ed09f9c1..61823ff3a 100644 --- a/gui/contextMenu.py +++ b/gui/contextMenu.py @@ -18,9 +18,14 @@ #=============================================================================== import wx +import logging + +logger = logging.getLogger(__name__) class ContextMenu(object): menus = [] + _ids = [] #[wx.NewId() for x in xrange(200)] # init with decent amount + _idxid = -1 @classmethod def register(cls): @@ -44,6 +49,8 @@ class ContextMenu(object): (('marketItemGroup', 'Implant'),) (('fittingShip', 'Ship'),) """ + cls._idxid = -1 + debug_start = len(cls._ids) rootMenu = wx.Menu() rootMenu.info = {} @@ -68,7 +75,7 @@ class ContextMenu(object): bitmap = m.getBitmap(srcContext, selection) multiple = not isinstance(bitmap, wx.Bitmap) for it, text in enumerate(texts): - id = wx.NewId() + id = cls.nextID() rootItem = wx.MenuItem(rootMenu, id, text) rootMenu.info[id] = (m, fullContext, it) @@ -109,6 +116,10 @@ class ContextMenu(object): if amount > 0 and i != len(fullContexts) - 1: rootMenu.AppendSeparator() + debug_end = len(cls._ids) + if (debug_end - debug_start): + logger.debug("%d new IDs created for this menu" % (debug_end - debug_start)) + return rootMenu if empty is False else None @classmethod @@ -134,6 +145,22 @@ class ContextMenu(object): def getSubMenu(self, context, selection, rootMenu, i, pitem): return None + @classmethod + def nextID(cls): + """ + Fetches an ID from the pool of IDs allocated to Context Menu. + If we don't have enough ID's to fulfill request, create new + ID and add it to the pool. + + See GH Issue #589 + """ + cls._idxid += 1 + + if cls._idxid >= len(cls._ids): # We don't ahve an ID for this index, create one + cls._ids.append(wx.NewId()) + + return cls._ids[cls._idxid] + def getText(self, context, selection): """ getText should be implemented in child classes, and should return either diff --git a/gui/utils/exportHtml.py b/gui/utils/exportHtml.py index 8de0f35eb..e3338774e 100644 --- a/gui/utils/exportHtml.py +++ b/gui/utils/exportHtml.py @@ -46,12 +46,36 @@ 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]) + minimal = settings.getMinimalEnabled(); 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=" + + if minimal: + HTML = self.generateMinimalHTML(sMkt,sFit, dnaUrl) + else: + HTML = self.generateFullHTML(sMkt,sFit, dnaUrl) + try: + FILE = open(settings.getPath(), "w") + FILE.write(HTML.encode('utf-8')) + FILE.close() + except IOError: + print "Failed to write to " + settings.getPath() + pass + + if self.callback: + wx.CallAfter(self.callback, -1) + + + + def generateFullHTML(self,sMkt,sFit,dnaUrl): + """ Generate the complete HTML with styling and javascript """ + timestamp = time.localtime(time.time()) + localDate = "%d/%02d/%02d %02d:%02d" % (timestamp[0], timestamp[1], timestamp[2], timestamp[3], timestamp[4]) + HTML = """ @@ -130,7 +154,7 @@ class exportHtmlThread(threading.Thread): $('a[data-dna]').each(function( index ) { var dna = $(this).data('dna'); if (typeof CCPEVE !== 'undefined') { // inside IGB - $(this).attr('href', 'javascript:CCPEVE.showFitting("'+dna+'");'); } + $(this).attr('href', 'javascript:CCPEVE.showFitting("'+dna+'");');} else { // outside IGB $(this).attr('href', '%s'+dna); } }); @@ -217,16 +241,46 @@ class exportHtmlThread(threading.Thread): -""" +""" - try: - FILE = open(settings.getPath(), "w") - FILE.write(HTML.encode('utf-8')) - FILE.close() - except IOError: - print "Failed to write to " + settings.getPath() - pass - if self.callback: - wx.CallAfter(self.callback, -1) + return HTML + + + + + def generateMinimalHTML(self,sMkt,sFit,dnaUrl): + """ Generate a minimal HTML version of the fittings, without any javascript or styling""" + categoryList = list(sMkt.getShipRoot()) + categoryList.sort(key=lambda ship: ship.name) + count = 0 + HTML = '' + for group in categoryList: + # init market group string to give ships something to attach to + + + ships = list(sMkt.getShipList(group.ID)) + ships.sort(key=lambda ship: ship.name) + + ships.sort(key=lambda ship: ship.name) + + for ship in ships: + fits = sFit.getFitsWithShip(ship.ID) + for fit in fits: + if self.stopRunning: + return + try: + dnaFit = sFit.exportDna(fit[0]) + HTML += 'IGB' +\ + ' / OOGB '+ship.name +': '+ fit[1]+ '
\n' + except: + continue + finally: + if self.callback: + wx.CallAfter(self.callback, count) + count += 1 + return HTML; + + + diff --git a/scripts/jsonToSql.py b/scripts/jsonToSql.py index 2a35814bc..ce4bdf5fa 100755 --- a/scripts/jsonToSql.py +++ b/scripts/jsonToSql.py @@ -208,6 +208,8 @@ def main(db, json_path): row["iconFile"] = row["iconFile"].lower().replace("modules/", "").replace(".png", "") for k, v in row.iteritems(): + if (isinstance(v, basestring)): + v = v.strip() setattr(instance, fieldMap.get(k, k), v) eos.db.gamedata_session.add(instance) diff --git a/service/fit.py b/service/fit.py index 3ae8c51fa..71f8c873d 100644 --- a/service/fit.py +++ b/service/fit.py @@ -519,10 +519,11 @@ class Fit(object): fit = eos.db.getFit(fitID) module = fit.modules[moduleIdx] + cargo = fit.cargo[cargoIdx] # Gather modules and convert Cargo item to Module, silently return if not a module try: - cargoP = eos.types.Module(fit.cargo[cargoIdx].item) + cargoP = eos.types.Module(cargo.item) cargoP.owner = fit if cargoP.isValidState(State.ACTIVE): cargoP.state = State.ACTIVE @@ -542,12 +543,19 @@ class Fit(object): fit.modules.insert(moduleIdx, cargoP) if not copyMod: # remove existing cargo if not cloning - fit.cargo.remove(fit.cargo[cargoIdx]) + if cargo.amount == 1: + fit.cargo.remove(cargo) + else: + cargo.amount -= 1 if not module.isEmpty: # if module is placeholder, we don't want to convert/add it - moduleP = eos.types.Cargo(module.item) - moduleP.amount = 1 - fit.cargo.insert(cargoIdx, moduleP) + for x in fit.cargo.find(module.item): + x.amount += 1 + break + else: + moduleP = eos.types.Cargo(module.item) + moduleP.amount = 1 + fit.cargo.insert(cargoIdx, moduleP) eos.db.commit() self.recalc(fit) diff --git a/service/market.py b/service/market.py index 7f982b081..65725a70e 100644 --- a/service/market.py +++ b/service/market.py @@ -26,6 +26,7 @@ import Queue import config import eos.db import eos.types +from sqlalchemy.sql import and_, or_ from service.settings import SettingsProvider, NetworkSettings import service import service.conversions as conversions @@ -125,7 +126,7 @@ class SearchWorkerThread(threading.Thread): sMkt = Market.getInstance() if filterOn is True: # Rely on category data provided by eos as we don't hardcode them much in service - filter = eos.types.Category.name.in_(sMkt.SEARCH_CATEGORIES) + filter = or_(eos.types.Category.name.in_(sMkt.SEARCH_CATEGORIES), eos.types.Group.name.in_(sMkt.SEARCH_GROUPS)) elif filterOn: # filter by selected categories filter = eos.types.Category.name.in_(filterOn) else: @@ -314,7 +315,8 @@ class Market(): "Standard Cerebral Accelerator": 977, # Implants & Boosters > Booster "Talocan Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners "Terran Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners - "Tetrimon Data Analyzer I": 714 } # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners + "Tetrimon Data Analyzer I": 714 # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners + } self.ITEMS_FORCEDMARKETGROUP_R = self.__makeRevDict(self.ITEMS_FORCEDMARKETGROUP) @@ -330,6 +332,7 @@ class Market(): ("complex", frozenset((6,))), ("officer", frozenset((5,)))]) self.SEARCH_CATEGORIES = ("Drone", "Module", "Subsystem", "Charge", "Implant", "Deployable", "Fighter") + self.SEARCH_GROUPS = ("Ice Product",) self.ROOT_MARKET_GROUPS = (9, # Modules 1111, # Rigs 157, # Drones diff --git a/service/settings.py b/service/settings.py index 60627e6b8..cd1b33b44 100644 --- a/service/settings.py +++ b/service/settings.py @@ -221,7 +221,7 @@ class HTMLExportSettings(): return cls._instance def __init__(self): - serviceHTMLExportDefaultSettings = {"enabled": False, "path": config.pyfaPath + os.sep + 'pyfaFits.html', "website": "null-sec.com" } + serviceHTMLExportDefaultSettings = {"enabled": False, "path": config.pyfaPath + os.sep + 'pyfaFits.html', "website": "null-sec.com", "minimal": False } self.serviceHTMLExportSettings = SettingsProvider.getInstance().getSettings("pyfaServiceHTMLExportSettings", serviceHTMLExportDefaultSettings) def getEnabled(self): @@ -229,6 +229,14 @@ class HTMLExportSettings(): def setEnabled(self, enabled): self.serviceHTMLExportSettings["enabled"] = enabled + + + def getMinimalEnabled(self): + return self.serviceHTMLExportSettings["minimal"] + + def setMinimalEnabled(self, minimal): + self.serviceHTMLExportSettings["minimal"] = minimal + def getPath(self): return self.serviceHTMLExportSettings["path"]