Merge pull request #634 from Ebag333/master

RAH follows damage profile
This commit is contained in:
Ryan Holmes
2016-06-12 02:13:03 -04:00
committed by GitHub
2 changed files with 27 additions and 0 deletions

View File

@@ -6,5 +6,13 @@ 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")

View File

@@ -483,6 +483,25 @@ class Miscellanea(ViewColumn):
duration = cycles * cycleTime / 1000
text = "{0} / {1}s".format(formatAmount(ehp, 3, 0, 9), formatAmount(duration, 3, 0, 3))
return text, tooltip
elif itemGroup == "Armor Resistance Shift Hardener":
itemArmorResistanceShiftHardenerEM = (1-stuff.getModifiedItemAttr("armorEmDamageResonance"))*100
itemArmorResistanceShiftHardenerTherm = (1-stuff.getModifiedItemAttr("armorThermalDamageResonance")) * 100
itemArmorResistanceShiftHardenerKin = (1-stuff.getModifiedItemAttr("armorKineticDamageResonance")) * 100
itemArmorResistanceShiftHardenerExp = (1-stuff.getModifiedItemAttr("armorExplosiveDamageResonance")) * 100
text = "{0}% | {1}% | {2}% | {3}%".format(
formatAmount(itemArmorResistanceShiftHardenerEM, 3, 0, 3),
formatAmount(itemArmorResistanceShiftHardenerTherm, 3, 0, 3),
formatAmount(itemArmorResistanceShiftHardenerKin, 3, 0, 3),
formatAmount(itemArmorResistanceShiftHardenerExp, 3, 0, 3),
)
tooltip = "Resistances Shifted to Damage Profile:\n{0}% EM | {1}% Therm | {2}% Kin | {3}% Exp".format(
formatAmount(itemArmorResistanceShiftHardenerEM, 3, 0, 3),
formatAmount(itemArmorResistanceShiftHardenerTherm, 3, 0, 3),
formatAmount(itemArmorResistanceShiftHardenerKin, 3, 0, 3),
formatAmount(itemArmorResistanceShiftHardenerExp, 3, 0, 3),
)
return text, tooltip
elif stuff.charge is not None:
chargeGroup = stuff.charge.group.name