From ed3b2eb1bf96f1de82201b91a76257a3e39237a2 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 19 Jun 2016 23:04:52 -0400 Subject: [PATCH] Fix energy warfare --- eos/effects/elitereconbonusenergyneutamount2.py | 2 +- eos/effects/energydestabilizationnew.py | 2 +- eos/effects/energyneutralizerentity.py | 2 +- eos/effects/energyneutralizerfalloff.py | 2 +- eos/effects/entityenergyneutralizerfalloff.py | 12 ++++++++++++ .../shipenergyneutralizertransferamountbonusab.py | 2 +- .../shipenergyneutralizertransferamountbonusac.py | 2 +- .../shipenergyneutralizertransferamountbonusaf.py | 2 +- .../shipenergyneutralizertransferamountbonusaf2.py | 2 +- .../shipneutdestabilizationamountbonusrookie.py | 2 +- ...embonusamarrelectronicenergydestabilizeramount.py | 2 +- eos/effects/systemenergyneutmultiplier.py | 2 +- eos/effects/systemneutbombs.py | 2 +- gui/builtinViewColumns/misc.py | 6 +++--- service/crudeTests.py | 0 15 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 eos/effects/entityenergyneutralizerfalloff.py create mode 100644 service/crudeTests.py diff --git a/eos/effects/elitereconbonusenergyneutamount2.py b/eos/effects/elitereconbonusenergyneutamount2.py index 6570460dd..ddbf0af85 100644 --- a/eos/effects/elitereconbonusenergyneutamount2.py +++ b/eos/effects/elitereconbonusenergyneutamount2.py @@ -6,4 +6,4 @@ type = "passive" def handler(fit, ship, context): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer", - "energyDestabilizationAmount", ship.getModifiedItemAttr("eliteBonusReconShip2"), skill="Recon Ships") + "energyNeutralizerAmount", ship.getModifiedItemAttr("eliteBonusReconShip2"), skill="Recon Ships") diff --git a/eos/effects/energydestabilizationnew.py b/eos/effects/energydestabilizationnew.py index c07517b0b..d2c3b8e03 100644 --- a/eos/effects/energydestabilizationnew.py +++ b/eos/effects/energydestabilizationnew.py @@ -5,6 +5,6 @@ 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 - amount = container.getModifiedItemAttr("energyDestabilizationAmount") + amount = container.getModifiedItemAttr("energyNeutralizerAmount") time = container.getModifiedItemAttr("duration") fit.addDrain(time, amount * multiplier, 0) diff --git a/eos/effects/energyneutralizerentity.py b/eos/effects/energyneutralizerentity.py index 49b895385..993df4a39 100644 --- a/eos/effects/energyneutralizerentity.py +++ b/eos/effects/energyneutralizerentity.py @@ -7,6 +7,6 @@ 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")): - amount = container.getModifiedItemAttr("energyDestabilizationAmount") + amount = container.getModifiedItemAttr("energyNeutralizerAmount") time = container.getModifiedItemAttr("duration") fit.addDrain(time, amount, 0) diff --git a/eos/effects/energyneutralizerfalloff.py b/eos/effects/energyneutralizerfalloff.py index 4896cec2d..b0702ad29 100644 --- a/eos/effects/energyneutralizerfalloff.py +++ b/eos/effects/energyneutralizerfalloff.py @@ -7,6 +7,6 @@ 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")): - amount = container.getModifiedItemAttr("energyDestabilizationAmount") + amount = container.getModifiedItemAttr("energyNeutralizerAmount") time = container.getModifiedItemAttr("duration") fit.addDrain(time, amount, 0) diff --git a/eos/effects/entityenergyneutralizerfalloff.py b/eos/effects/entityenergyneutralizerfalloff.py new file mode 100644 index 000000000..d1822bc9d --- /dev/null +++ b/eos/effects/entityenergyneutralizerfalloff.py @@ -0,0 +1,12 @@ +# energyNeutralizerFalloff +# +# Used by: +# Modules from group: Energy Neutralizer (51 of 51) +from eos.types import State +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")): + amount = container.getModifiedItemAttr("energyNeutralizerAmount") + time = container.getModifiedItemAttr("energyNeutralizerDuration") + fit.addDrain(time, amount, 0) diff --git a/eos/effects/shipenergyneutralizertransferamountbonusab.py b/eos/effects/shipenergyneutralizertransferamountbonusab.py index 3a005e1fc..a331c58d4 100644 --- a/eos/effects/shipenergyneutralizertransferamountbonusab.py +++ b/eos/effects/shipenergyneutralizertransferamountbonusab.py @@ -5,4 +5,4 @@ type = "passive" def handler(fit, ship, context): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer", - "energyDestabilizationAmount", ship.getModifiedItemAttr("shipBonusAB"), skill="Amarr Battleship") + "energyNeutralizerAmount", ship.getModifiedItemAttr("shipBonusAB"), skill="Amarr Battleship") diff --git a/eos/effects/shipenergyneutralizertransferamountbonusac.py b/eos/effects/shipenergyneutralizertransferamountbonusac.py index 1c4546fd3..58fb9bb96 100644 --- a/eos/effects/shipenergyneutralizertransferamountbonusac.py +++ b/eos/effects/shipenergyneutralizertransferamountbonusac.py @@ -6,4 +6,4 @@ type = "passive" def handler(fit, ship, context): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer", - "energyDestabilizationAmount", ship.getModifiedItemAttr("shipBonusAC"), skill="Amarr Cruiser") + "energyNeutralizerAmount", ship.getModifiedItemAttr("shipBonusAC"), skill="Amarr Cruiser") diff --git a/eos/effects/shipenergyneutralizertransferamountbonusaf.py b/eos/effects/shipenergyneutralizertransferamountbonusaf.py index 6e525dcb1..11116d5a2 100644 --- a/eos/effects/shipenergyneutralizertransferamountbonusaf.py +++ b/eos/effects/shipenergyneutralizertransferamountbonusaf.py @@ -6,4 +6,4 @@ type = "passive" def handler(fit, ship, context): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer", - "energyDestabilizationAmount", ship.getModifiedItemAttr("shipBonusAF"), skill="Amarr Frigate") + "energyNeutralizerAmount", ship.getModifiedItemAttr("shipBonusAF"), skill="Amarr Frigate") diff --git a/eos/effects/shipenergyneutralizertransferamountbonusaf2.py b/eos/effects/shipenergyneutralizertransferamountbonusaf2.py index 36a9f2b95..16c62b8a1 100644 --- a/eos/effects/shipenergyneutralizertransferamountbonusaf2.py +++ b/eos/effects/shipenergyneutralizertransferamountbonusaf2.py @@ -5,4 +5,4 @@ type = "passive" def handler(fit, ship, context): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer", - "energyDestabilizationAmount", ship.getModifiedItemAttr("shipBonus2AF"), skill="Amarr Frigate") + "energyNeutralizerAmount", ship.getModifiedItemAttr("shipBonus2AF"), skill="Amarr Frigate") diff --git a/eos/effects/shipneutdestabilizationamountbonusrookie.py b/eos/effects/shipneutdestabilizationamountbonusrookie.py index d333686cc..1d1aa57ad 100644 --- a/eos/effects/shipneutdestabilizationamountbonusrookie.py +++ b/eos/effects/shipneutdestabilizationamountbonusrookie.py @@ -5,4 +5,4 @@ type = "passive" def handler(fit, ship, context): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer", - "energyDestabilizationAmount", ship.getModifiedItemAttr("rookieNeutDrain")) + "energyNeutralizerAmount", ship.getModifiedItemAttr("rookieNeutDrain")) diff --git a/eos/effects/subsystembonusamarrelectronicenergydestabilizeramount.py b/eos/effects/subsystembonusamarrelectronicenergydestabilizeramount.py index 55e7d5614..ba29f0b27 100644 --- a/eos/effects/subsystembonusamarrelectronicenergydestabilizeramount.py +++ b/eos/effects/subsystembonusamarrelectronicenergydestabilizeramount.py @@ -5,4 +5,4 @@ type = "passive" def handler(fit, module, context): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer", - "energyDestabilizationAmount", module.getModifiedItemAttr("subsystemBonusAmarrElectronic"), skill="Amarr Electronic Systems") + "energyNeutralizerAmount", module.getModifiedItemAttr("subsystemBonusAmarrElectronic"), skill="Amarr Electronic Systems") diff --git a/eos/effects/systemenergyneutmultiplier.py b/eos/effects/systemenergyneutmultiplier.py index 8c6328c98..6c3e7b5af 100644 --- a/eos/effects/systemenergyneutmultiplier.py +++ b/eos/effects/systemenergyneutmultiplier.py @@ -6,5 +6,5 @@ runTime = "early" type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Energy Neutralizer", - "energyDestabilizationAmount", beacon.getModifiedItemAttr("energyWarfareStrengthMultiplier"), + "energyNeutralizerAmount", beacon.getModifiedItemAttr("energyWarfareStrengthMultiplier"), stackingPenalties=True, penaltyGroup="postMul") diff --git a/eos/effects/systemneutbombs.py b/eos/effects/systemneutbombs.py index a87d4e691..4bdadf12b 100644 --- a/eos/effects/systemneutbombs.py +++ b/eos/effects/systemneutbombs.py @@ -6,5 +6,5 @@ runTime = "early" type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Bomb Deployment"), - "energyDestabilizationAmount", beacon.getModifiedItemAttr("smartbombDamageMultiplier"), + "energyNeutralizerAmount", beacon.getModifiedItemAttr("smartbombDamageMultiplier"), stackingPenalties=True, penaltyGroup="postMul") diff --git a/gui/builtinViewColumns/misc.py b/gui/builtinViewColumns/misc.py index 9baee4726..0c7f9ef8f 100644 --- a/gui/builtinViewColumns/misc.py +++ b/gui/builtinViewColumns/misc.py @@ -86,7 +86,7 @@ class Miscellanea(ViewColumn): info.append("{0}{1}".format(n, slot[0].upper())) return "+ "+", ".join(info), "Slot Modifiers" elif itemGroup == "Energy Neutralizer": - neutAmount = stuff.getModifiedItemAttr("energyDestabilizationAmount") + neutAmount = stuff.getModifiedItemAttr("energyNeutralizerAmount") cycleTime = stuff.cycleTime if not neutAmount or not cycleTime: return "", None @@ -429,8 +429,8 @@ class Miscellanea(ViewColumn): tooltip = "{0} repaired per second".format(formatList(ttEntries)).capitalize() return text, tooltip elif itemGroup == "Energy Neutralizer Drone": - neutAmount = stuff.getModifiedItemAttr("energyDestabilizationAmount") - cycleTime = stuff.getModifiedItemAttr("duration") + neutAmount = stuff.getModifiedItemAttr("energyNeutralizerAmount") + cycleTime = stuff.getModifiedItemAttr("energyNeutralizerDuration") if not neutAmount or not cycleTime: return "", None capPerSec = float(-neutAmount) * 1000 / cycleTime diff --git a/service/crudeTests.py b/service/crudeTests.py new file mode 100644 index 000000000..e69de29bb