Support speedLimit introduced with Entosis Link
This commit is contained in:
4
eos/effects/passivespeedlimit.py
Normal file
4
eos/effects/passivespeedlimit.py
Normal file
@@ -0,0 +1,4 @@
|
||||
runtime = "late"
|
||||
type = "passive"
|
||||
def handler(fit, src, context):
|
||||
fit.extraAttributes['speedLimit'] = src.getModifiedItemAttr("speedLimit")
|
||||
@@ -303,6 +303,14 @@ class Fit(object):
|
||||
def jamChance(self):
|
||||
return (1-self.ecmProjectedStr)*100
|
||||
|
||||
@property
|
||||
def maxSpeed(self):
|
||||
speedLimit = self.ship.getModifiedItemAttr("speedLimit")
|
||||
if speedLimit and self.ship.getModifiedItemAttr("maxVelocity") > speedLimit:
|
||||
return speedLimit
|
||||
|
||||
return self.ship.getModifiedItemAttr("maxVelocity")
|
||||
|
||||
@property
|
||||
def alignTime(self):
|
||||
agility = self.ship.getModifiedItemAttr("agility")
|
||||
|
||||
@@ -35,6 +35,10 @@ class Ship(ItemAttrShortcut, HandledItem):
|
||||
"droneControlRange": 20000,
|
||||
"cloaked": False,
|
||||
"siege": False
|
||||
# We also have speedLimit for Entosis Link, but there seems to be an
|
||||
# issue with naming it exactly "speedLimit" due to unknown reasons.
|
||||
# Regardless, we don't have to put it here anyways - it will come up
|
||||
# as None unless the Entosis effect sets it.
|
||||
}
|
||||
|
||||
def __init__(self, item):
|
||||
|
||||
@@ -149,7 +149,7 @@ class TargetingMiscViewFull(StatsView):
|
||||
("labelScanRes", {"main": lambda: fit.ship.getModifiedItemAttr("scanResolution")}, 3, 0, 0, "mm"),
|
||||
("labelSensorStr", {"main": lambda: fit.scanStrength}, 3, 0, 0, ""),
|
||||
("labelCtrlRange", {"main": lambda: fit.extraAttributes["droneControlRange"] / 1000}, 3, 0, 0, "km"),
|
||||
("labelFullSpeed", {"main": lambda: fit.ship.getModifiedItemAttr("maxVelocity")}, 3, 0, 0, "m/s"),
|
||||
("labelFullSpeed", {"main": lambda: fit.maxSpeed}, 3, 0, 0, "m/s"),
|
||||
("labelFullAlignTime", {"main": lambda: fit.alignTime}, 3, 0, 0, "s"),
|
||||
("labelFullSigRadius", {"main": lambda: fit.ship.getModifiedItemAttr("signatureRadius")}, 3, 0, 9, ""),
|
||||
("labelFullWarpSpeed", {"main": lambda: fit.warpSpeed}, 3, 0, 0, "AU/s"),
|
||||
|
||||
Reference in New Issue
Block a user