Implemented projected fighters, and various fighter bugfixes / improvements

This commit is contained in:
blitzmann
2016-04-30 19:49:45 -04:00
parent 3a62a6c40d
commit d416124081
17 changed files with 75 additions and 19 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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)))