A few fixes for breachers on graphs

This commit is contained in:
DarkPhoenix
2024-11-13 05:13:37 +01:00
parent 6074cfe15a
commit 219173c43e
2 changed files with 21 additions and 7 deletions

View File

@@ -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:

View File

@@ -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