Merge branch 'default-database-profiles' of git://github.com/Ebag333/Pyfa

This commit is contained in:
blitzmann
2016-06-13 20:01:35 -04:00
8 changed files with 218 additions and 17 deletions

View File

@@ -6,13 +6,5 @@ type = "active"
def handler(fit, module, context):
for type in ("kinetic", "thermal", "explosive", "em"):
attr = "armor%sDamageResonance" % type.capitalize()
#Adjust RAH to match the current damage pattern
damagePattern = fit.damagePattern
attrDamagePattern = "%sAmount" % type
damagePatternModifier = getattr(damagePattern,attrDamagePattern)/float(sum((damagePattern.emAmount,damagePattern.thermalAmount,damagePattern.kineticAmount,damagePattern.explosiveAmount)))
modifiedResistModifier = (1-(((1-module.getModifiedItemAttr(attr))*4)*(damagePatternModifier)))
module.forceItemAttr(attr, modifiedResistModifier)
fit.ship.multiplyItemAttr(attr, module.getModifiedItemAttr(attr),
stackingPenalties=True, penaltyGroup="preMul")