Fix for #1377 - group up support fighters and modify the bonus based on amount active
This commit is contained in:
@@ -11,13 +11,14 @@ displayName = "ECM"
|
||||
prefix = "fighterAbilityECM"
|
||||
|
||||
type = "projected", "active"
|
||||
grouped = True
|
||||
|
||||
|
||||
def handler(fit, module, context, **kwargs):
|
||||
if "projected" not in context:
|
||||
return
|
||||
# jam formula: 1 - (1- (jammer str/ship str))^(# of jam mods with same str))
|
||||
strModifier = 1 - module.getModifiedItemAttr("{}Strength{}".format(prefix, fit.scanType)) / fit.scanStrength
|
||||
strModifier = 1 - (module.getModifiedItemAttr("{}Strength{}".format(prefix, fit.scanType)) * module.amountActive) / fit.scanStrength
|
||||
|
||||
if 'effect' in kwargs:
|
||||
strModifier *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])
|
||||
|
||||
@@ -9,11 +9,12 @@ from eos.modifiedAttributeDict import ModifiedAttributeDict
|
||||
displayName = "Energy Neutralizer"
|
||||
prefix = "fighterAbilityEnergyNeutralizer"
|
||||
type = "active", "projected"
|
||||
grouped = True
|
||||
|
||||
|
||||
def handler(fit, src, context, **kwargs):
|
||||
if "projected" in context:
|
||||
amount = src.getModifiedItemAttr("{}Amount".format(prefix))
|
||||
amount = src.getModifiedItemAttr("{}Amount".format(prefix)) * src.amountActive
|
||||
time = src.getModifiedItemAttr("{}Duration".format(prefix))
|
||||
|
||||
if 'effect' in kwargs:
|
||||
|
||||
@@ -6,13 +6,12 @@ effects, and thus this effect file contains some custom information useful only
|
||||
|
||||
# User-friendly name for the ability
|
||||
displayName = "Stasis Webifier"
|
||||
|
||||
prefix = "fighterAbilityStasisWebifier"
|
||||
|
||||
type = "active", "projected"
|
||||
grouped = True
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
if "projected" not in context:
|
||||
return
|
||||
fit.ship.boostItemAttr("maxVelocity", src.getModifiedItemAttr("{}SpeedPenalty".format(prefix)))
|
||||
fit.ship.boostItemAttr("maxVelocity", src.getModifiedItemAttr("{}SpeedPenalty".format(prefix)) * src.amountActive)
|
||||
|
||||
@@ -8,9 +8,10 @@ effects, and thus this effect file contains some custom information useful only
|
||||
displayName = "Warp Disruption"
|
||||
prefix = "fighterAbilityWarpDisruption"
|
||||
type = "active", "projected"
|
||||
grouped = True
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
if "projected" not in context:
|
||||
return
|
||||
fit.ship.increaseItemAttr("warpScrambleStatus", src.getModifiedItemAttr("{}PointStrength".format(prefix)))
|
||||
fit.ship.increaseItemAttr("warpScrambleStatus", src.getModifiedItemAttr("{}PointStrength".format(prefix)) * src.amountActive)
|
||||
|
||||
@@ -271,17 +271,19 @@ class Fighter(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
|
||||
projected = False
|
||||
|
||||
for ability in self.abilities:
|
||||
if ability.active:
|
||||
effect = ability.effect
|
||||
if effect.runTime == runTime and effect.activeByDefault and \
|
||||
((projected and effect.isType("projected")) or not projected):
|
||||
if ability.grouped:
|
||||
if not ability.active:
|
||||
continue
|
||||
|
||||
effect = ability.effect
|
||||
if effect.runTime == runTime and effect.activeByDefault and \
|
||||
((projected and effect.isType("projected")) or not projected):
|
||||
if ability.grouped:
|
||||
effect.handler(fit, self, context)
|
||||
else:
|
||||
i = 0
|
||||
while i != self.amountActive:
|
||||
effect.handler(fit, self, context)
|
||||
else:
|
||||
i = 0
|
||||
while i != self.amountActive:
|
||||
effect.handler(fit, self, context)
|
||||
i += 1
|
||||
i += 1
|
||||
|
||||
def __deepcopy__(self, memo):
|
||||
copy = Fighter(self.item)
|
||||
|
||||
@@ -358,7 +358,6 @@ class FitItem(SFItem.SFBrowserItem):
|
||||
self.deleted = True
|
||||
|
||||
sFit = Fit.getInstance()
|
||||
fit = sFit.getFit(self.fitID)
|
||||
|
||||
# need to delete from import cache before actually deleting fit
|
||||
if self.shipBrowser.GetActiveStage() == 5:
|
||||
|
||||
Reference in New Issue
Block a user