diff --git a/graphs/data/fitDamageStats/calc/application.py b/graphs/data/fitDamageStats/calc/application.py index eb75750fc..6dc991802 100644 --- a/graphs/data/fitDamageStats/calc/application.py +++ b/graphs/data/fitDamageStats/calc/application.py @@ -99,7 +99,7 @@ def getApplicationPerKey(src, tgt, atkSpeed, atkAngle, distance, tgtSpeed, tgtAn distance=distance, tgtSigRadius=tgtSigRadius) elif mod.isBreacher: - applicationMap[mod] = 1 if inLockRange else 0 + applicationMap[mod] = getBreacherMult(mod=mod, distance=distance) if inLockRange else 0 for drone in src.item.activeDronesIter(): if not drone.isDealingDamage(): continue @@ -194,6 +194,21 @@ def getLauncherMult(mod, distance, tgtSpeed, tgtSigRadius): return distanceFactor * applicationFactor +def getBreacherMult(mod, distance): + missileMaxRangeData = mod.missileMaxRangeData + if missileMaxRangeData is None: + return 0 + # The ranges already consider ship radius + lowerRange, higherRange, higherChance = missileMaxRangeData + if distance is None or distance <= lowerRange: + distanceFactor = 1 + elif lowerRange < distance <= higherRange: + distanceFactor = higherChance + else: + distanceFactor = 0 + return distanceFactor + + def getSmartbombMult(mod, distance): modRange = mod.maxRange if modRange is None: diff --git a/graphs/data/fitDamageStats/getter.py b/graphs/data/fitDamageStats/getter.py index eb8688f0d..5c66593be 100644 --- a/graphs/data/fitDamageStats/getter.py +++ b/graphs/data/fitDamageStats/getter.py @@ -19,6 +19,7 @@ import eos.config +from eos.saveddata.targetProfile import TargetProfile from eos.utils.spoolSupport import SpoolOptions, SpoolType from eos.utils.stats import DmgTypes from graphs.data.base import PointGetter, SmoothPointGetter @@ -33,12 +34,10 @@ def applyDamage(dmgMap, applicationMap, tgtResists, tgtFullHp): total += dmg * applicationMap.get(key, 0) if not GraphSettings.getInstance().get('ignoreResists'): emRes, thermRes, kinRes, exploRes = tgtResists - total = DmgTypes( - em=total.em * (1 - emRes), - thermal=total.thermal * (1 - thermRes), - kinetic=total.kinetic * (1 - kinRes), - explosive=total.explosive * (1 - exploRes), - breacher=total.breacher) + else: + emRes = thermRes = kinRes = exploRes = 0 + total.profile = TargetProfile( + emAmount=emRes, thermalAmount=thermRes, kineticAmount=kinRes, explosiveAmount=exploRes, hp=tgtFullHp) return total