diff --git a/eos/effects/remoteguidancedisruptfalloff.py b/eos/effects/remoteguidancedisruptfalloff.py index 20abfa9d6..48fadecaa 100644 --- a/eos/effects/remoteguidancedisruptfalloff.py +++ b/eos/effects/remoteguidancedisruptfalloff.py @@ -14,4 +14,4 @@ def handler(fit, src, context): ): fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"), tgtAttr, src.getModifiedItemAttr(srcAttr), - stackingPenalties=True) + stackingPenalties=True, remoteResists=True) diff --git a/eos/effects/remotesensordampfalloff.py b/eos/effects/remotesensordampfalloff.py index aa944bb19..3a5f7ab27 100644 --- a/eos/effects/remotesensordampfalloff.py +++ b/eos/effects/remotesensordampfalloff.py @@ -7,7 +7,11 @@ type= "projected", "active" def handler(fit, module, context): if "projected" not in context: return + + print "in sensor damp projection on ", fit, module.getModifiedItemAttr("maxTargetRangeBonus") + print fit.ship.getModifiedItemAttr('maxTargetRange') fit.ship.boostItemAttr("maxTargetRange", module.getModifiedItemAttr("maxTargetRangeBonus"), - stackingPenalties = True) + stackingPenalties = True, remoteResists=True) + print fit.ship.getModifiedItemAttr('maxTargetRange') fit.ship.boostItemAttr("scanResolution", module.getModifiedItemAttr("scanResolutionBonus"), - stackingPenalties = True) + stackingPenalties = True, remoteResists=True) diff --git a/eos/effects/remotetargetpaintfalloff.py b/eos/effects/remotetargetpaintfalloff.py index feb722b42..6c0026253 100644 --- a/eos/effects/remotetargetpaintfalloff.py +++ b/eos/effects/remotetargetpaintfalloff.py @@ -7,4 +7,4 @@ type = "projected", "active" def handler(fit, container, context): if "projected" in context: fit.ship.boostItemAttr("signatureRadius", container.getModifiedItemAttr("signatureRadiusBonus"), - stackingPenalties = True) + stackingPenalties = True, remoteResists=True) diff --git a/eos/effects/remotetrackingdisruptfalloff.py b/eos/effects/remotetrackingdisruptfalloff.py index 05e193603..d3066d78f 100644 --- a/eos/effects/remotetrackingdisruptfalloff.py +++ b/eos/effects/remotetrackingdisruptfalloff.py @@ -8,10 +8,10 @@ def handler(fit, module, context): if "projected" in context: fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"), "trackingSpeed", module.getModifiedItemAttr("trackingSpeedBonus"), - stackingPenalties = True) + stackingPenalties = True, remoteResists=True) fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"), "maxRange", module.getModifiedItemAttr("maxRangeBonus"), - stackingPenalties = True) + stackingPenalties = True, remoteResists=True) fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"), "falloff", module.getModifiedItemAttr("falloffBonus"), - stackingPenalties = True) + stackingPenalties = True, remoteResists=True) diff --git a/eos/effects/remotewebifierfalloff.py b/eos/effects/remotewebifierfalloff.py index 76d932c70..eb974b3d4 100644 --- a/eos/effects/remotewebifierfalloff.py +++ b/eos/effects/remotewebifierfalloff.py @@ -8,4 +8,4 @@ type = "active", "projected" def handler(fit, module, context): if "projected" not in context: return fit.ship.boostItemAttr("maxVelocity", module.getModifiedItemAttr("speedFactor"), - stackingPenalties = True) + stackingPenalties = True, remoteResists=True) diff --git a/eos/modifiedAttributeDict.py b/eos/modifiedAttributeDict.py index 828803491..f07e9d38a 100644 --- a/eos/modifiedAttributeDict.py +++ b/eos/modifiedAttributeDict.py @@ -313,14 +313,27 @@ class ModifiedAttributeDict(collections.MutableMapping): if not attributeName in self.__multipliers: self.__multipliers[attributeName] = 1 self.__multipliers[attributeName] *= multiplier + self.__placehold(attributeName) self.__afflict(attributeName, "%s*" % ("s" if stackingPenalties else ""), multiplier, multiplier != 1) - def boost(self, attributeName, boostFactor, skill=None, *args, **kwargs): + def boost(self, attributeName, boostFactor, skill=None, remoteResists=False, *args, **kwargs): """Boost value by some percentage""" if skill: boostFactor *= self.__handleSkill(skill) + if remoteResists: + # @todo: this is such a disgusting hack. Look into sending these checks to the module class before the + # effect is applied. + mod = self.fit.getModifier() + remoteResistID = mod.getModifiedItemAttr("remoteResistanceID") or None + + # We really don't have a way of getting a ships attribute by ID. Fail. + resist = next((x for x in self.fit.ship.item.attributes.values() if x.ID == remoteResistID), None) + + if remoteResistID and resist: + boostFactor *= resist.value + # We just transform percentage boost into multiplication factor self.multiply(attributeName, 1 + boostFactor / 100.0, *args, **kwargs) diff --git a/eos/saveddata/character.py b/eos/saveddata/character.py index 2d3fc260d..adbb1fbf9 100644 --- a/eos/saveddata/character.py +++ b/eos/saveddata/character.py @@ -315,7 +315,10 @@ class Skill(HandledItem): return self.__item def getModifiedItemAttr(self, key): - return self.item.attributes[key].value + if key in self.item.attributes: + return self.item.attributes[key].value + else: + return None def calculateModifiedAttributes(self, fit, runTime): if self.__suppressed: # or not self.learned - removed for GH issue 101