Tox fixes
This commit is contained in:
@@ -23,16 +23,20 @@ from sqlalchemy.orm import relation, mapper, synonym
|
||||
from eos.db import gamedata_meta
|
||||
from eos.types import AlphaClone, AlphaCloneSkill
|
||||
|
||||
alphaclones_table = Table("alphaClones", gamedata_meta,
|
||||
Column("alphaCloneID", Integer, primary_key=True),
|
||||
Column("alphaCloneName", String),
|
||||
)
|
||||
alphaclones_table = Table(
|
||||
"alphaClones",
|
||||
gamedata_meta,
|
||||
Column("alphaCloneID", Integer, primary_key=True),
|
||||
Column("alphaCloneName", String),
|
||||
)
|
||||
|
||||
alphacloneskskills_table = Table("alphaCloneSkills", gamedata_meta,
|
||||
Column("alphaCloneID", Integer, ForeignKey("alphaClones.alphaCloneID"), primary_key=True),
|
||||
Column("typeID", Integer, primary_key=True),
|
||||
Column("level", Integer),
|
||||
)
|
||||
alphacloneskskills_table = Table(
|
||||
"alphaCloneSkills",
|
||||
gamedata_meta,
|
||||
Column("alphaCloneID", Integer, ForeignKey("alphaClones.alphaCloneID"), primary_key=True),
|
||||
Column("typeID", Integer, primary_key=True),
|
||||
Column("level", Integer),
|
||||
)
|
||||
|
||||
mapper(AlphaClone, alphaclones_table,
|
||||
properties={
|
||||
|
||||
@@ -33,7 +33,7 @@ class DatabaseCleanup:
|
||||
results = saveddata_engine.execute(query)
|
||||
return results
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
logger.error("Failed to connect to database or error executing query:\n%s",query)
|
||||
logger.error("Failed to connect to database or error executing query:\n%s", query)
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -22,11 +22,8 @@ from sqlalchemy.sql import and_
|
||||
from eos.db import saveddata_session, sd_lock
|
||||
from eos.db.saveddata.fit import projectedFits_table
|
||||
from eos.db.util import processEager, processWhere
|
||||
from eos.db import saveddata_session, sd_lock
|
||||
|
||||
from eos.types import *
|
||||
from eos.db.saveddata.fit import projectedFits_table
|
||||
from sqlalchemy.sql import and_
|
||||
import eos.config
|
||||
|
||||
configVal = getattr(eos.config, "saveddataCache", None)
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
# Items from market group: Ammunition & Charges > Command Burst Charges (15 of 15)
|
||||
type = "active"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
for x in xrange(1, 4):
|
||||
value = module.getModifiedChargeAttr("warfareBuff{}Multiplier".format(x))
|
||||
module.multiplyItemAttr("warfareBuff{}Value".format(x), value)
|
||||
module.multiplyItemAttr("warfareBuff{}Value".format(x), value)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# Not used by any item
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Information Command Specialist"),
|
||||
"commandBonusHidden", module.getModifiedItemAttr("eliteBonusCommandShips3"), skill="Command Ships")
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
# Used by:
|
||||
# Ship: Rabisu
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "falloffEffectiveness", src.getModifiedItemAttr("eliteBonusLogistics1"), skill="Logistics Cruisers")
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "maxRange", src.getModifiedItemAttr("eliteBonusLogistics1"), skill="Logistics Cruisers")
|
||||
|
||||
@@ -5,8 +5,7 @@ type = "active", "projected"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
if "projected" in context and (
|
||||
(hasattr(src, "state") and src.state >= State.ACTIVE) or hasattr(src, "amountActive")):
|
||||
if "projected" in context and ((hasattr(src, "state") and src.state >= State.ACTIVE) or hasattr(src, "amountActive")):
|
||||
multiplier = src.amountActive if hasattr(src, "amountActive") else 1
|
||||
amount = src.getModifiedItemAttr("energyNeutralizerAmount")
|
||||
time = src.getModifiedItemAttr("duration")
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
# Modules named like: Drone Mining Augmentor (8 of 8)
|
||||
# Skill: Ice Harvesting Drone Operation
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
lvl = src.level if "skill" in context else 1
|
||||
fit.drones.filteredItemBoost(lambda mod: mod.item.requiresSkill("Ice Harvesting Drone Operation"), "duration", src.getModifiedItemAttr("rofBonus") * lvl)
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
# Used by:
|
||||
# Skill: Mining Director
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
lvl = src.level
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff4Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl)
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff3Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl)
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff2Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl)
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff1Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl)
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff1Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl)
|
||||
|
||||
@@ -13,6 +13,8 @@ which warfareBuffID to run (shouldn't need this right now, but better safe than
|
||||
'''
|
||||
|
||||
type = "active", "gang"
|
||||
|
||||
|
||||
def handler(fit, module, context, **kwargs):
|
||||
for x in xrange(1, 5):
|
||||
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
|
||||
@@ -21,5 +23,3 @@ def handler(fit, module, context, **kwargs):
|
||||
|
||||
if id:
|
||||
fit.addCommandBonus(id, value, module, kwargs['effect'])
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
# Variations of module: Information Command Burst I (2 of 2)
|
||||
|
||||
type = "active", "gang"
|
||||
|
||||
|
||||
def handler(fit, module, context, **kwargs):
|
||||
for x in xrange(1, 5):
|
||||
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
|
||||
@@ -11,4 +13,4 @@ def handler(fit, module, context, **kwargs):
|
||||
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))
|
||||
|
||||
if id:
|
||||
fit.addCommandBonus(id, value, module, kwargs['effect'])
|
||||
fit.addCommandBonus(id, value, module, kwargs['effect'])
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
# Variations of module: Mining Foreman Burst I (2 of 2)
|
||||
|
||||
type = "active", "gang"
|
||||
|
||||
|
||||
def handler(fit, module, context, **kwargs):
|
||||
for x in xrange(1, 5):
|
||||
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
|
||||
@@ -11,4 +13,4 @@ def handler(fit, module, context, **kwargs):
|
||||
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))
|
||||
|
||||
if id:
|
||||
fit.addCommandBonus(id, value, module, kwargs['effect'])
|
||||
fit.addCommandBonus(id, value, module, kwargs['effect'])
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
# Variations of module: Shield Command Burst I (2 of 2)
|
||||
|
||||
type = "active", "gang"
|
||||
|
||||
|
||||
def handler(fit, module, context, **kwargs):
|
||||
for x in xrange(1, 5):
|
||||
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
|
||||
@@ -11,4 +13,4 @@ def handler(fit, module, context, **kwargs):
|
||||
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))
|
||||
|
||||
if id:
|
||||
fit.addCommandBonus(id, value, module, kwargs['effect'])
|
||||
fit.addCommandBonus(id, value, module, kwargs['effect'])
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
# Variations of module: Skirmish Command Burst I (2 of 2)
|
||||
|
||||
type = "active", "gang"
|
||||
|
||||
|
||||
def handler(fit, module, context, **kwargs):
|
||||
for x in xrange(1, 5):
|
||||
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
|
||||
@@ -11,4 +13,4 @@ def handler(fit, module, context, **kwargs):
|
||||
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))
|
||||
|
||||
if id:
|
||||
fit.addCommandBonus(id, value, module, kwargs['effect'])
|
||||
fit.addCommandBonus(id, value, module, kwargs['effect'])
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
# Used by:
|
||||
# Modules from group: Titan Phenomena Generator (4 of 4)
|
||||
type = "active", "gang"
|
||||
|
||||
|
||||
def handler(fit, module, context, **kwargs):
|
||||
for x in xrange(1, 5):
|
||||
if module.getModifiedItemAttr("warfareBuff{}ID".format(x)):
|
||||
@@ -11,7 +13,3 @@ def handler(fit, module, context, **kwargs):
|
||||
|
||||
if id:
|
||||
fit.addCommandBonus(id, value, module, kwargs['effect'])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ runTime = "late"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
if "projected" not in context: return
|
||||
if "projected" not in context:
|
||||
return
|
||||
bonus = module.getModifiedItemAttr("structureDamageAmount")
|
||||
duration = module.getModifiedItemAttr("duration") / 1000.0
|
||||
fit.extraAttributes.increase("hullRepair", bonus / duration)
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
# Used by:
|
||||
# Ship: Rabisu
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "falloffEffectiveness", src.getModifiedItemAttr("roleBonusRepairRange"))
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "maxRange", src.getModifiedItemAttr("roleBonusRepairRange"))
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
# Used by:
|
||||
# Ship: Apostle
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command") or mod.item.requiresSkill("Information Command"), "warfareBuff4Value", src.getModifiedItemAttr("shipBonusForceAuxiliaryA4"), skill="Amarr Carrier")
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command") or mod.item.requiresSkill("Information Command"), "warfareBuff3Value", src.getModifiedItemAttr("shipBonusForceAuxiliaryA4"), skill="Amarr Carrier")
|
||||
|
||||
@@ -11,5 +11,5 @@ def handler(fit, module, context):
|
||||
fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Rockets") or mod.charge.requiresSkill("Light Missiles"),
|
||||
"{}Damage".format(type),
|
||||
1 / module.getModifiedItemAttr("modeDamageBonusPostDiv"),
|
||||
stackingPenalties = True,
|
||||
stackingPenalties=True,
|
||||
penaltyGroup="postDiv")
|
||||
|
||||
@@ -4,4 +4,3 @@ type = "passive"
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.extraAttributes.increase("maxTargetsLockedFromSkills", src.getModifiedItemAttr("structureRigMaxTargetBonus"))
|
||||
|
||||
|
||||
@@ -148,10 +148,6 @@ class Fighter(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
|
||||
def item(self):
|
||||
return self.__item
|
||||
|
||||
@property
|
||||
def charge(self):
|
||||
return self.__charge
|
||||
|
||||
@property
|
||||
def hasAmmo(self):
|
||||
return self.charge is not None
|
||||
|
||||
@@ -487,11 +487,9 @@ class Fit(object):
|
||||
self.ship.boostItemAttr("armor%sDamageResonance" % damageType, value)
|
||||
|
||||
if warfareBuffID == 14: # Armor Burst: Rapid Repair: Repair Duration/Capacitor
|
||||
self.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill(
|
||||
"Remote Armor Repair Systems") or mod.item.requiresSkill("Repair Systems"),
|
||||
self.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems") or mod.item.requiresSkill("Repair Systems"),
|
||||
"capacitorNeed", value)
|
||||
self.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill(
|
||||
"Remote Armor Repair Systems") or mod.item.requiresSkill("Repair Systems"), "duration",
|
||||
self.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems") or mod.item.requiresSkill("Repair Systems"), "duration",
|
||||
value)
|
||||
|
||||
if warfareBuffID == 15: # Armor Burst: Armor Reinforcement: Armor HP
|
||||
@@ -512,9 +510,8 @@ class Fit(object):
|
||||
"scan%sStrengthBonus" % scanType, value,
|
||||
stackingPenalties=True)
|
||||
|
||||
for attr in (
|
||||
"missileVelocityBonus", "explosionDelayBonus", "aoeVelocityBonus", "falloffBonus",
|
||||
"maxRangeBonus", "aoeCloudSizeBonus", "trackingSpeedBonus"):
|
||||
for attr in ("missileVelocityBonus", "explosionDelayBonus", "aoeVelocityBonus", "falloffBonus",
|
||||
"maxRangeBonus", "aoeCloudSizeBonus", "trackingSpeedBonus"):
|
||||
self.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Weapon Disruptor",
|
||||
attr, value)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user