diff --git a/eos/utils/stats.py b/eos/utils/stats.py index 8df2515b5..456c079ce 100644 --- a/eos/utils/stats.py +++ b/eos/utils/stats.py @@ -106,9 +106,13 @@ class DmgTypes: yield self.thermal yield self.kinetic yield self.explosive - yield self.breacher + yield self.pure yield self.total + @property + def pure(self): + return self.breacher + def __eq__(self, other): if not isinstance(other, DmgTypes): return NotImplemented @@ -189,8 +193,11 @@ class DmgTypes: return makeReprStr(self, spec=['em', 'thermal', 'kinetic', 'explosive', 'breacher', 'total']) @staticmethod - def names(short=None, postProcessor=None): - value = [_t('em'), _t('th'), _t('kin'), _t('exp'), _t('breacher')] if short else [_t('em'), _t('thermal'), _t('kinetic'), _t('explosive'), _t('breacher')] + def names(short=None, postProcessor=None, includePure=False): + + value = [_t('em'), _t('th'), _t('kin'), _t('exp')] if short else [_t('em'), _t('thermal'), _t('kinetic'), _t('explosive')] + if includePure: + value += [_t('pure')] if postProcessor: value = [postProcessor(x) for x in value] diff --git a/gui/builtinStatsViews/firepowerViewFull.py b/gui/builtinStatsViews/firepowerViewFull.py index f290d5cd5..cd164b542 100644 --- a/gui/builtinStatsViews/firepowerViewFull.py +++ b/gui/builtinStatsViews/firepowerViewFull.py @@ -173,10 +173,9 @@ class FirepowerViewFull(StatsView): if hasSpool: lines.append("") lines.append(_t("Current") + ": {}".format(formatAmount(normal.total, prec, lowest, highest))) - for dmgType in normal.names(): + for dmgType in normal.names(includePure=True): val = getattr(normal, dmgType, None) if val: - dmgType = {'breacher': 'pure'}.get(dmgType, dmgType) lines.append("{}{}: {}%".format( " " if hasSpool else "", _t(dmgType).capitalize(), diff --git a/service/ammo.py b/service/ammo.py index a731c1a1e..f38be0d96 100644 --- a/service/ammo.py +++ b/service/ammo.py @@ -69,7 +69,7 @@ class Ammo: falloff = (mod.item.getAttribute('falloff') or 0) * \ (charge.getAttribute('fallofMultiplier') or 1) for type_ in DmgTypes.names(): - d = charge.getAttribute('%sDamage' % type_) + d = charge.getAttribute('%sDamage' % type_, default=0) if d > 0: damage += d # Take optimal and falloff as range factor