Add mining waste readout to the misc column, and fix more issues related to the attribute fetching change
This commit is contained in:
@@ -129,8 +129,8 @@ class Drone(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut, Mu
|
||||
cycleTime = self.getModifiedItemAttr("missileLaunchDuration", 0)
|
||||
else:
|
||||
for attr in ("speed", "duration", "durationHighisGood"):
|
||||
cycleTime = self.getModifiedItemAttr(attr, None)
|
||||
if cycleTime is not None:
|
||||
cycleTime = self.getModifiedItemAttr(attr)
|
||||
if cycleTime:
|
||||
break
|
||||
if cycleTime is None:
|
||||
return 0
|
||||
@@ -237,7 +237,7 @@ class Drone(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut, Mu
|
||||
|
||||
def getCycleParameters(self, reloadOverride=None):
|
||||
cycleTime = self.cycleTime
|
||||
if cycleTime == 0:
|
||||
if not cycleTime:
|
||||
return None
|
||||
return CycleInfo(self.cycleTime, 0, math.inf, False)
|
||||
|
||||
@@ -262,6 +262,7 @@ class Drone(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut, Mu
|
||||
else:
|
||||
cycleTime = cycleParams.averageTime
|
||||
yield_ = sum([getter(d) for d in self.MINING_ATTRIBUTES]) * self.amountActive
|
||||
print(self, yield_)
|
||||
yps = yield_ / (cycleTime / 1000.0)
|
||||
wasteChance = max(0, min(1, self.getModifiedItemAttr("miningWasteProbability")))
|
||||
wasteMult = self.getModifiedItemAttr("miningWastedVolumeMultiplier")
|
||||
|
||||
@@ -372,8 +372,8 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut, M
|
||||
def falloff(self):
|
||||
attrs = ("falloffEffectiveness", "falloff", "shipScanFalloff")
|
||||
for attr in attrs:
|
||||
falloff = self.getModifiedItemAttr(attr, None)
|
||||
if falloff is not None:
|
||||
falloff = self.getModifiedItemAttr(attr)
|
||||
if falloff:
|
||||
return falloff
|
||||
|
||||
@property
|
||||
|
||||
@@ -538,13 +538,23 @@ class Miscellanea(ViewColumn):
|
||||
tooltip = "Optimal signature radius"
|
||||
return text, tooltip
|
||||
elif itemGroup in ("Frequency Mining Laser", "Strip Miner", "Mining Laser", "Gas Cloud Harvester", "Mining Drone", "Gas Cloud Hoarders"):
|
||||
miningAmount = stuff.getModifiedItemAttr("specialtyMiningAmount") or stuff.getModifiedItemAttr("miningAmount")
|
||||
cycleTime = getattr(stuff, 'cycleTime', stuff.getModifiedItemAttr("duration"))
|
||||
if not miningAmount or not cycleTime:
|
||||
yps = stuff.miningYPS
|
||||
if not yps:
|
||||
return "", None
|
||||
minePerSec = (float(miningAmount) * 1000 / cycleTime)
|
||||
text = "{0} m3/s".format(formatAmount(minePerSec, 3, 0, 3))
|
||||
tooltip = "Mining Yield per second ({0} per hour)".format(formatAmount(minePerSec * 3600, 3, 0, 3))
|
||||
yph = yps * 3600
|
||||
wps = stuff.miningWPS
|
||||
wph = wps * 3600
|
||||
textParts = []
|
||||
textParts.append(formatAmount(yps, 3, 0, 3))
|
||||
tipLines = []
|
||||
tipLines.append("{} m\u00B3 mining yield per second ({} m\u00B3 per hour)".format(
|
||||
formatAmount(yps, 3, 0, 3), formatAmount(yph, 3, 0, 3)))
|
||||
if wps > 0:
|
||||
textParts.append(formatAmount(wps, 3, 0, 3))
|
||||
tipLines.append("{} m\u00B3 mining waste per second ({} m\u00B3 per hour)".format(
|
||||
formatAmount(wps, 3, 0, 3), formatAmount(wph, 3, 0, 3)))
|
||||
text = '{} m3/s'.format('+'.join(textParts))
|
||||
tooltip = '\n'.join(tipLines)
|
||||
return text, tooltip
|
||||
elif itemGroup == "Logistic Drone":
|
||||
rpsData = stuff.getRemoteReps(ignoreState=True)
|
||||
|
||||
Reference in New Issue
Block a user