Skip to content

Commit 219173c

Browse files
committed
A few fixes for breachers on graphs
1 parent 6074cfe commit 219173c

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

graphs/data/fitDamageStats/calc/application.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def getApplicationPerKey(src, tgt, atkSpeed, atkAngle, distance, tgtSpeed, tgtAn
9999
distance=distance,
100100
tgtSigRadius=tgtSigRadius)
101101
elif mod.isBreacher:
102-
applicationMap[mod] = 1 if inLockRange else 0
102+
applicationMap[mod] = getBreacherMult(mod=mod, distance=distance) if inLockRange else 0
103103
for drone in src.item.activeDronesIter():
104104
if not drone.isDealingDamage():
105105
continue
@@ -194,6 +194,21 @@ def getLauncherMult(mod, distance, tgtSpeed, tgtSigRadius):
194194
return distanceFactor * applicationFactor
195195

196196

197+
def getBreacherMult(mod, distance):
198+
missileMaxRangeData = mod.missileMaxRangeData
199+
if missileMaxRangeData is None:
200+
return 0
201+
# The ranges already consider ship radius
202+
lowerRange, higherRange, higherChance = missileMaxRangeData
203+
if distance is None or distance <= lowerRange:
204+
distanceFactor = 1
205+
elif lowerRange < distance <= higherRange:
206+
distanceFactor = higherChance
207+
else:
208+
distanceFactor = 0
209+
return distanceFactor
210+
211+
197212
def getSmartbombMult(mod, distance):
198213
modRange = mod.maxRange
199214
if modRange is None:

graphs/data/fitDamageStats/getter.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020

2121
import eos.config
22+
from eos.saveddata.targetProfile import TargetProfile
2223
from eos.utils.spoolSupport import SpoolOptions, SpoolType
2324
from eos.utils.stats import DmgTypes
2425
from graphs.data.base import PointGetter, SmoothPointGetter
@@ -33,12 +34,10 @@ def applyDamage(dmgMap, applicationMap, tgtResists, tgtFullHp):
3334
total += dmg * applicationMap.get(key, 0)
3435
if not GraphSettings.getInstance().get('ignoreResists'):
3536
emRes, thermRes, kinRes, exploRes = tgtResists
36-
total = DmgTypes(
37-
em=total.em * (1 - emRes),
38-
thermal=total.thermal * (1 - thermRes),
39-
kinetic=total.kinetic * (1 - kinRes),
40-
explosive=total.explosive * (1 - exploRes),
41-
breacher=total.breacher)
37+
else:
38+
emRes = thermRes = kinRes = exploRes = 0
39+
total.profile = TargetProfile(
40+
emAmount=emRes, thermalAmount=thermRes, kineticAmount=kinRes, explosiveAmount=exploRes, hp=tgtFullHp)
4241
return total
4342

4443

0 commit comments

Comments
 (0)