Skip to content

Commit ecc3f9f

Browse files
committed
Add base support for breacher pods to graphs
1 parent c660e40 commit ecc3f9f

File tree

6 files changed

+65
-9
lines changed

6 files changed

+65
-9
lines changed

eos/saveddata/module.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -527,11 +527,7 @@ def getVolley(self, spoolOptions=None, targetProfile=None, ignoreState=False):
527527

528528
def getDps(self, spoolOptions=None, targetProfile=None, ignoreState=False, getSpreadDPS=False):
529529
dmgDuringCycle = DmgTypes.default()
530-
# Special hack for breachers, since those are DoT and work independently of gun cycle
531-
if self.isBreacher:
532-
cycleParams = CycleInfo(activeTime=1000, inactiveTime=0, quantity=math.inf, isInactivityReload=False)
533-
else:
534-
cycleParams = self.getCycleParameters()
530+
cycleParams = self.getCycleParametersForDps()
535531
if cycleParams is None:
536532
return dmgDuringCycle
537533
volleyParams = self.getVolleyParameters(spoolOptions=spoolOptions, targetProfile=targetProfile, ignoreState=ignoreState)
@@ -965,6 +961,13 @@ def calculateModifiedAttributes(self, fit, runTime, forceProjected=False, gang=F
965961
and ((gang and effect.isType("gang")) or not gang):
966962
effect.handler(fit, self, context, projectionRange, effect=effect)
967963

964+
def getCycleParametersForDps(self, reloadOverride=None):
965+
# Special hack for breachers, since those are DoT and work independently of gun cycle
966+
if self.isBreacher:
967+
return CycleInfo(activeTime=1000, inactiveTime=0, quantity=math.inf, isInactivityReload=False)
968+
else:
969+
return self.getCycleParameters(reloadOverride=reloadOverride)
970+
968971
def getCycleParameters(self, reloadOverride=None):
969972
"""Copied from new eos as well"""
970973
# Determine if we'll take into account reload time or not

eos/utils/stats.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,30 @@ def names(short=None, postProcessor=None, includePure=False):
205205
return value
206206

207207

208+
class DmgInflicted(DmgTypes):
209+
210+
@classmethod
211+
def from_dmg_types(cls, dmg_types):
212+
return cls(em=dmg_types.em, thermal=dmg_types.thermal, kinetic=dmg_types.kinetic, explosive=dmg_types.explosive, breacher=dmg_types.breacher)
213+
214+
def __add__(self, other):
215+
return type(self)(
216+
em=self.em + other.em,
217+
thermal=self.thermal + other.thermal,
218+
kinetic=self.kinetic + other.kinetic,
219+
explosive=self.explosive + other.explosive,
220+
breacher=self.breacher + other.breacher)
221+
222+
def __iadd__(self, other):
223+
self.em += other.em
224+
self.thermal += other.thermal
225+
self.kinetic += other.kinetic
226+
self.explosive += other.explosive
227+
self.breacher += other.breacher
228+
self._calcTotal()
229+
return self
230+
231+
208232
class RRTypes:
209233
"""Container for tank data stats."""
210234

graphs/data/fitDamageStats/cache/time.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from eos.utils.float import floatUnerr
2424
from eos.utils.spoolSupport import SpoolOptions, SpoolType
25-
from eos.utils.stats import DmgTypes
25+
from eos.utils.stats import DmgTypes, DmgInflicted
2626
from graphs.data.base import FitDataCache
2727

2828

@@ -170,23 +170,26 @@ def addDpsVolley(ddKey, addedTimeStart, addedTimeFinish, addedVolleys):
170170
def addDmg(ddKey, addedTime, addedDmg):
171171
if addedDmg.total == 0:
172172
return
173-
intCacheDmg.setdefault(ddKey, {})[addedTime] = addedDmg
173+
intCacheDmg.setdefault(ddKey, {})[addedTime] = DmgInflicted.from_dmg_types(addedDmg)
174174

175175
# Modules
176176
for mod in src.item.activeModulesIter():
177177
if not mod.isDealingDamage():
178178
continue
179-
cycleParams = mod.getCycleParameters(reloadOverride=True)
179+
cycleParams = mod.getCycleParametersForDps(reloadOverride=True)
180180
if cycleParams is None:
181181
continue
182182
currentTime = 0
183183
nonstopCycles = 0
184184
for cycleTimeMs, inactiveTimeMs, isInactivityReload in cycleParams.iterCycles():
185185
cycleVolleys = []
186186
volleyParams = mod.getVolleyParameters(spoolOptions=SpoolOptions(SpoolType.CYCLES, nonstopCycles, True))
187+
187188
for volleyTimeMs, volley in volleyParams.items():
188189
cycleVolleys.append(volley)
189190
addDmg(mod, currentTime + volleyTimeMs / 1000, volley)
191+
if mod.isBreacher:
192+
break
190193
addDpsVolley(mod, currentTime, currentTime + cycleTimeMs / 1000, cycleVolleys)
191194
if inactiveTimeMs > 0:
192195
nonstopCycles = 0

graphs/data/fitDamageStats/calc/application.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ def getApplicationPerKey(src, tgt, atkSpeed, atkAngle, distance, tgtSpeed, tgtAn
9898
tgt=tgt,
9999
distance=distance,
100100
tgtSigRadius=tgtSigRadius)
101+
elif mod.isBreacher:
102+
applicationMap[mod] = 1 if inLockRange else 0
101103
for drone in src.item.activeDronesIter():
102104
if not drone.isDealingDamage():
103105
continue

graphs/data/fitDamageStats/graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def tgtExtraCols(self):
8989
cols = []
9090
if not GraphSettings.getInstance().get('ignoreResists'):
9191
cols.append('Target Resists')
92-
cols.extend(('Speed', 'SigRadius', 'Radius'))
92+
cols.extend(('Speed', 'SigRadius', 'Radius', 'FullHP'))
9393
return cols
9494

9595
# Calculation stuff

gui/builtinViewColumns/attributeDisplayGraph.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,30 @@ def _getFitTooltip(self):
197197
SignatureRadiusColumn.register()
198198

199199

200+
class FullHpColumn(GraphColumn):
201+
202+
name = 'FullHP'
203+
stickPrefixToValue = True
204+
205+
def __init__(self, fittingView, params):
206+
super().__init__(fittingView, 68)
207+
208+
def _getValue(self, stuff):
209+
if isinstance(stuff, Fit):
210+
full_hp = stuff.hp.get('shield', 0) + stuff.hp.get('armor', 0) + stuff.hp.get('hull', 0)
211+
elif isinstance(stuff, TargetProfile):
212+
full_hp = stuff.hp
213+
else:
214+
full_hp = 0
215+
return full_hp, 'hp'
216+
217+
def _getFitTooltip(self):
218+
return 'Total raw HP'
219+
220+
221+
FullHpColumn.register()
222+
223+
200224
class ShieldAmountColumn(GraphColumn):
201225

202226
name = 'ShieldAmount'

0 commit comments

Comments
 (0)