From 8a4fe1627e59cce17e236ae2c73b89ae97ea27be Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Mon, 14 Nov 2016 01:37:23 -0800 Subject: [PATCH 1/6] Requirements for Pyfa Caught most of the main ones, I think. (Yes I'm sneaking EVE-Gnosis in here, just so I don't have a conflict when I submit the cap/shield sim fix) --- requirements.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..e009d507a --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +matplotlib +PyYAML +python-dateutil +urllib3 +requests +sqlalchemy +EVE-Gnosis From d3fdf9854d76a1d6b39c6ec3674cfbb6ff47dae3 Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Fri, 18 Nov 2016 01:01:08 -0800 Subject: [PATCH 2/6] Add versions Updated Gnosis to point to at least the current version. Pinned Requests as there's a bug in the most recent version. (Only applies to Python 3, but....) --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index e009d507a..548ada1d7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,6 @@ matplotlib PyYAML python-dateutil urllib3 -requests +requests==2.11.1 sqlalchemy -EVE-Gnosis +EVE-Gnosis>=2016.11.17post2 From b9e5a47924ef756f87d653aba1f38eeb75ee5488 Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Tue, 6 Dec 2016 13:46:09 -0800 Subject: [PATCH 3/6] Remove gnosis --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 548ada1d7..f8e777507 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,3 @@ python-dateutil urllib3 requests==2.11.1 sqlalchemy -EVE-Gnosis>=2016.11.17post2 From 5b62419520a80de633d3fb6aa5d85bf02cf43a52 Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Thu, 8 Dec 2016 10:05:22 -0800 Subject: [PATCH 4/6] Add requirements for getting this to work on Travis-Ci --- requirements_test.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 requirements_test.txt diff --git a/requirements_test.txt b/requirements_test.txt new file mode 100644 index 000000000..1bbef8b92 --- /dev/null +++ b/requirements_test.txt @@ -0,0 +1,7 @@ +pytest==3.0.3 +pytest-mock==1.2 +pytest-cov==2.3.1 +pytest-capturelog==0.7 +coverage==4.2 +coveralls==1.1 +codecov From 7875c2acaa8770bfd9b5480b4bdd52759731f5a9 Mon Sep 17 00:00:00 2001 From: blitzman Date: Mon, 12 Dec 2016 00:24:50 -0500 Subject: [PATCH 5/6] Fix titan command effects --- eos/effects/chargebonuswarfarecharge.py | 8 +------ eos/effects/moduletitaneffectgenerator.py | 29 ++++++++++++----------- eos/saveddata/fit.py | 6 +---- eos/saveddata/module.py | 6 ++++- 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/eos/effects/chargebonuswarfarecharge.py b/eos/effects/chargebonuswarfarecharge.py index 005101d45..83865a009 100644 --- a/eos/effects/chargebonuswarfarecharge.py +++ b/eos/effects/chargebonuswarfarecharge.py @@ -15,11 +15,7 @@ which warfareBuffID to run (shouldn't need this right now, but better safe than type = "active", "gang" def handler(fit, module, context, **kwargs): - print "In chargeBonusWarfareEffect, context: ", context - def runEffect(id, value): - print "RUN EFFECT: ", fit, - if id == 10: # Shield Burst: Shield Harmonizing: Shield Resistance for damageType in ("Em", "Explosive", "Thermal", "Kinetic"): fit.ship.boostItemAttr("shield%sDamageResonance" % damageType, value) @@ -101,12 +97,10 @@ def handler(fit, module, context, **kwargs): if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)): value = module.getModifiedChargeAttr("warfareBuff{}Multiplier".format(x)) id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x)) - print "Buff ID: ",id," value: ",value + if id: if 'commandRun' not in context: - print "Add buffID", id, " to ", fit fit.addCommandBonus(id, value, module, kwargs['effect']) elif kwargs['warfareBuffID'] is not None and kwargs['warfareBuffID'] == id: - print "Running buffID ", kwargs['warfareBuffID'], " on ", fit runEffect(kwargs['warfareBuffID'], value) diff --git a/eos/effects/moduletitaneffectgenerator.py b/eos/effects/moduletitaneffectgenerator.py index 2a5de4473..43f8c3fbe 100644 --- a/eos/effects/moduletitaneffectgenerator.py +++ b/eos/effects/moduletitaneffectgenerator.py @@ -11,43 +11,44 @@ def handler(fit, module, context, **kwargs): if id == 40: # Avatar Effect Generator : Kinetic resistance bonus for attr in ("armorKineticDamageResonance", "shieldKineticDamageResonance", "hullKineticDamageResonance"): - fit.ship.boostItemAttr(attr, value, stackingPenalties=True) + fit.ship.boostItemAttr(attr, value) - if id == 41: # Erebus Effect Generator : Armor HP bonus + if id == 49: # Avatar Effect Generator : EM resistance penalty + for attr in ("armorEmDamageResonance", "shieldEmDamageResonance", "hullEmDamageResonance"): + fit.ship.boostItemAttr(attr, value) + + if id == 42: # Erebus Effect Generator : Armor HP bonus fit.ship.boostItemAttr("armorHP", value, stackingPenalties=True) - if id == 42: # Leviathan Effect Generator : Shield HP bonus - fit.ship.boostItemAttr("shieldCapacity", value, stackingPenalties=True) - if id == 43: # Erebus Effect Generator : Explosive resistance bonus for attr in ("armorExplosiveDamageResonance", "shieldExplosiveDamageResonance", "hullExplosiveDamageResonance"): - fit.ship.boostItemAttr(attr, value, stackingPenalties=True) + fit.ship.boostItemAttr(attr, value) if id == 44: # Erebus Effect Generator : Thermal resistance penalty for attr in ("armorThermalDamageResonance", "shieldThermalDamageResonance", "hullThermalDamageResonance"): - fit.ship.boostItemAttr(attr, value, stackingPenalties=True) + fit.ship.boostItemAttr(attr, value) if id == 45: # Ragnarok Effect Generator : Signature Radius bonus fit.ship.boostItemAttr("signatureRadius", value, stackingPenalties=True) if id == 46: # Ragnarok Effect Generator : Thermal resistance bonus for attr in ("armorThermalDamageResonance", "shieldThermalDamageResonance", "hullThermalDamageResonance"): - fit.ship.boostItemAttr(attr, value, stackingPenalties=True) + fit.ship.boostItemAttr(attr, value) if id == 47: # Ragnarok Effect Generator : Explosive resistance penaly for attr in ("armorExplosiveDamageResonance", "shieldExplosiveDamageResonance", "hullExplosiveDamageResonance"): - fit.ship.boostItemAttr(attr, value, stackingPenalties=True) + fit.ship.boostItemAttr(attr, value) if id == 48: # Leviathan Effect Generator : Shield HP bonus fit.ship.boostItemAttr("shieldCapacity", value, stackingPenalties=True) if id == 49: # Leviathan Effect Generator : EM resistance bonus for attr in ("armorEmDamageResonance", "shieldEmDamageResonance", "hullEmDamageResonance"): - fit.ship.boostItemAttr(attr, value, stackingPenalties=True) + fit.ship.boostItemAttr(attr, value) if id == 50: # Leviathan Effect Generator : Kinetic resistance penalty for attr in ("armorKineticDamageResonance", "shieldKineticDamageResonance", "hullKineticDamageResonance"): - fit.ship.boostItemAttr(attr, value, stackingPenalties=True) + fit.ship.boostItemAttr(attr, value) if id == 51: # Avatar Effect Generator : Velocity penalty fit.ship.boostItemAttr("maxVelocity", value, stackingPenalties=True) @@ -63,9 +64,9 @@ def handler(fit, module, context, **kwargs): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name in groups, "maxRange", value, stackingPenalties=True) for x in xrange(1, 4): - if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)): - value = module.getModifiedChargeAttr("warfareBuff{}Multiplier".format(x)) - id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x)) + if module.getModifiedItemAttr("warfareBuff{}ID".format(x)): + value = module.getModifiedItemAttr("warfareBuff{}Value".format(x)) + id = module.getModifiedItemAttr("warfareBuff{}ID".format(x)) if id: if 'commandRun' not in context: diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index 1fe345be0..27cbece91 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -449,8 +449,6 @@ class Fit(object): # oh fuck this is so janky # @todo should we pass in min/max to this function, or is abs okay? # (abs is old method, ccp now provides the aggregate function in their data) - print "Add command bonus: ", warfareBuffID, " - value: ", value - if warfareBuffID not in self.commandBonuses or abs(self.commandBonuses[warfareBuffID][1]) < abs(value): self.commandBonuses[warfareBuffID] = (runTime, value, module, effect) @@ -514,12 +512,10 @@ class Fit(object): eos.db.saveddata_session.delete(self) if self.commandFits and not withBoosters: - print "Calculatate command fits and apply to fit" for fit in self.commandFits: if self == fit: - print "nope" continue - print "calculating ", fit + fit.calculateModifiedAttributes(self, True) # # for thing in chain(fit.modules, fit.implants, fit.character.skills, (fit.ship,)): diff --git a/eos/saveddata/module.py b/eos/saveddata/module.py index 1a1c56de3..567be64d6 100644 --- a/eos/saveddata/module.py +++ b/eos/saveddata/module.py @@ -655,10 +655,14 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): effect.activeByDefault and \ (effect.isType("offline") or (effect.isType("passive") and self.state >= State.ONLINE) or + (effect.isType("active") and self.state >= State.ACTIVE))\ and ((projected and effect.isType("projected")) or not projected)\ and ((gang and effect.isType("gang")) or not gang): - effect.handler(fit, self, context) + try: + effect.handler(fit, self, context, effect=effect) + except: + effect.handler(fit, self, context) @property def cycleTime(self): From 0a28fb60df9156d8ed454e0527dd548157a19618 Mon Sep 17 00:00:00 2001 From: blitzman Date: Mon, 12 Dec 2016 00:27:36 -0500 Subject: [PATCH 6/6] oops --- eos/effects/moduletitaneffectgenerator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eos/effects/moduletitaneffectgenerator.py b/eos/effects/moduletitaneffectgenerator.py index 43f8c3fbe..e5c2b3d2e 100644 --- a/eos/effects/moduletitaneffectgenerator.py +++ b/eos/effects/moduletitaneffectgenerator.py @@ -13,7 +13,7 @@ def handler(fit, module, context, **kwargs): for attr in ("armorKineticDamageResonance", "shieldKineticDamageResonance", "hullKineticDamageResonance"): fit.ship.boostItemAttr(attr, value) - if id == 49: # Avatar Effect Generator : EM resistance penalty + if id == 41: # Avatar Effect Generator : EM resistance penalty for attr in ("armorEmDamageResonance", "shieldEmDamageResonance", "hullEmDamageResonance"): fit.ship.boostItemAttr(attr, value)