From c1405fa67527c824ec39635eaac5ce569faccdf2 Mon Sep 17 00:00:00 2001 From: MaruMaruOO Date: Thu, 26 Jul 2018 17:39:32 -0400 Subject: [PATCH] More getter swapping for efsPort --- service/efsPort.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/service/efsPort.py b/service/efsPort.py index 72c8b1310..8d7610ec0 100755 --- a/service/efsPort.py +++ b/service/efsPort.py @@ -458,13 +458,13 @@ class EfsPort(): def sumDamage(attr): totalDamage = 0 for damageType in ["emDamage", "thermalDamage", "kineticDamage", "explosiveDamage"]: - if attr[damageType] is not None: - totalDamage += attr[damageType] + if attr(damageType) is not None: + totalDamage += attr(damageType) return totalDamage def getCurrentMultipliers(tf): fitMultipliers = {} - getDroneMulti = lambda d: sumDamage(d.itemModifiedAttributes) * d.getModifiedItemAttr("damageMultiplier") + getDroneMulti = lambda d: sumDamage(d.getModifiedItemAttr) * d.getModifiedItemAttr("damageMultiplier") fitMultipliers["drones"] = list(map(getDroneMulti, tf.drones)) getFitTurrets = lambda f: filter(lambda mod: mod.hardpoint == Hardpoint.TURRET, f.modules) @@ -472,7 +472,7 @@ class EfsPort(): fitMultipliers["turrets"] = list(map(getTurretMulti, getFitTurrets(tf))) getFitLaunchers = lambda f: filter(lambda mod: mod.hardpoint == Hardpoint.MISSILE, f.modules) - getLauncherMulti = lambda mod: sumDamage(mod.chargeModifiedAttributes) / mod.cycleTime + getLauncherMulti = lambda mod: sumDamage(mod.getModifiedChargeAttr) / mod.cycleTime fitMultipliers["launchers"] = list(map(getLauncherMulti, getFitLaunchers(tf))) return fitMultipliers @@ -484,7 +484,7 @@ class EfsPort(): for mod in weaponTypeSet: mod.owner = fit turrets = list(filter(lambda mod: mod.getModifiedItemAttr("damageMultiplier"), turrets)) - launchers = list(filter(lambda mod: sumDamage(mod.chargeModifiedAttributes), launchers)) + launchers = list(filter(lambda mod: sumDamage(mod.getModifiedChargeAttr), launchers)) # Since the effect modules are fairly opaque a mock test fit is used to test the impact of traits. # standin class used to prevent . notation causing issues when used as an arg