Update adaptivearmorhardener.py

This commit is contained in:
Ebag333
2016-06-06 16:16:56 -07:00
parent 8f3370307a
commit 0a1be7d966

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")