Minor fixes
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user