Implemented projected fighters, and various fighter bugfixes / improvements
This commit is contained in:
@@ -13,6 +13,6 @@ type = "projected", "active"
|
||||
def handler(fit, module, context):
|
||||
if "projected" not in context: return
|
||||
# jam formula: 1 - (1- (jammer str/ship str))^(# of jam mods with same str))
|
||||
strModifier = 1 - module.getModifiedItemAttr("{}Srength{}".format(prefix, fit.scanType))/fit.scanStrength
|
||||
strModifier = 1 - module.getModifiedItemAttr("{}Strength{}".format(prefix, fit.scanType))/fit.scanStrength
|
||||
|
||||
fit.ecmProjectedStr *= strModifier
|
||||
|
||||
@@ -12,8 +12,7 @@ prefix = "fighterAbilityEnergyNeutralizer"
|
||||
type = "active", "projected"
|
||||
|
||||
def handler(fit, container, context):
|
||||
if "projected" in context and ((hasattr(container, "state") and container.state >= State.ACTIVE) or hasattr(container, "amountActive")):
|
||||
multiplier = container.amountActive if hasattr(container, "amountActive") else 1
|
||||
if "projected" in context:
|
||||
amount = container.getModifiedItemAttr("{}Amount".format(prefix))
|
||||
time = container.getModifiedItemAttr("{}Duration".format(prefix))
|
||||
fit.addDrain(time, amount * multiplier, 0)
|
||||
fit.addDrain(time, amount, 0)
|
||||
@@ -13,5 +13,4 @@ type = "active", "projected"
|
||||
|
||||
def handler(fit, src, context):
|
||||
if "projected" not in context: return
|
||||
multiplier = src.amountActive if hasattr(src, "amountActive") else 1
|
||||
fit.ship.boostItemAttr("maxVelocity", src.getModifiedItemAttr("{}SpeedPenalty") * multiplier)
|
||||
fit.ship.boostItemAttr("maxVelocity", src.getModifiedItemAttr("{}SpeedPenalty".format(prefix)))
|
||||
|
||||
Reference in New Issue
Block a user