Merge pull request #684 from Ebag333/Neuts

Applied size reduction effect to neut/nos
This commit is contained in:
Ryan Holmes
2016-07-24 01:25:15 -04:00
committed by GitHub
9 changed files with 62 additions and 47 deletions

View File

@@ -1,10 +1,9 @@
# Not used by any item
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")):
multiplier = container.amountActive if hasattr(container, "amountActive") else 1
amount = container.getModifiedItemAttr("energyNeutralizerAmount")
time = container.getModifiedItemAttr("duration")
fit.addDrain(time, amount * multiplier, 0)
def handler(fit, src, context):
if "projected" in context and ((hasattr(src, "state") and src.state >= State.ACTIVE) or hasattr(src, "amountActive")):
multiplier = src.amountActive if hasattr(src, "amountActive") else 1
amount = src.getModifiedItemAttr("energyNeutralizerAmount")
time = src.getModifiedItemAttr("duration")
fit.addDrain(src, time, amount * multiplier, 0)

View File

@@ -4,9 +4,11 @@
# Drones from group: Energy Neutralizer Drone (3 of 3)
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("duration")
fit.addDrain(time, amount, 0)
def handler(fit, src, context):
if "projected" in context and ((hasattr(src, "state") and src.state >= State.ACTIVE) or hasattr(src, "amountActive")):
amount = src.getModifiedItemAttr("energyNeutralizerAmount")
time = src.getModifiedItemAttr("duration")
fit.addDrain(src, time, amount, 0)

View File

@@ -4,9 +4,11 @@
# 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("duration")
fit.addDrain(time, amount, 0)
def handler(fit, src, context):
if "projected" in context and ((hasattr(src, "state") and src.state >= State.ACTIVE) or hasattr(src, "amountActive")):
amount = src.getModifiedItemAttr("energyNeutralizerAmount")
time = src.getModifiedItemAttr("duration")
fit.addDrain(src, time, amount, 0)

View File

@@ -4,10 +4,13 @@
# Modules from group: Energy Nosferatu (51 of 51)
type = "active", "projected"
runTime = "late"
def handler(fit, module, context):
amount = module.getModifiedItemAttr("powerTransferAmount")
time = module.getModifiedItemAttr("duration")
def handler(fit, src, context):
amount = src.getModifiedItemAttr("powerTransferAmount")
time = src.getModifiedItemAttr("duration")
if "projected" in context:
fit.addDrain(time, amount, 0)
fit.addDrain(src, time, amount, 0)
elif "module" in context:
module.itemModifiedAttributes.force("capacitorNeed", -amount)
src.itemModifiedAttributes.force("capacitorNeed", -amount)

View File

@@ -1,7 +1,7 @@
# Not used by any item
type = "projected", "active"
def handler(fit, module, context):
def handler(fit, src, context):
if "projected" in context:
amount = module.getModifiedItemAttr("powerTransferAmount")
duration = module.getModifiedItemAttr("duration")
fit.addDrain(duration, -amount, 0)
amount = src.getModifiedItemAttr("powerTransferAmount")
duration = src.getModifiedItemAttr("duration")
fit.addDrain(src, duration, -amount, 0)

View File

@@ -4,9 +4,11 @@
# Drones from group: Energy Neutralizer Drone (3 of 3)
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)
def handler(fit, src, context):
if "projected" in context and ((hasattr(src, "state") and src.state >= State.ACTIVE) or hasattr(src, "amountActive")):
amount = src.getModifiedItemAttr("energyNeutralizerAmount")
time = src.getModifiedItemAttr("energyNeutralizerDuration")
fit.addDrain(src, time, amount, 0)

View File

@@ -3,17 +3,15 @@
Since fighter abilities do not have any sort of item entity in the EVE database, we must derive the abilities from the
effects, and thus this effect file contains some custom information useful only to fighters.
"""
from eos.types import State
# User-friendly name for the ability
displayName = "Energy Neutralizer"
prefix = "fighterAbilityEnergyNeutralizer"
type = "active", "projected"
def handler(fit, container, context):
def handler(fit, src, context):
if "projected" in context:
amount = container.getModifiedItemAttr("{}Amount".format(prefix))
time = container.getModifiedItemAttr("{}Duration".format(prefix))
fit.addDrain(time, amount, 0)
amount = src.getModifiedItemAttr("{}Amount".format(prefix))
time = src.getModifiedItemAttr("{}Duration".format(prefix))
fit.addDrain(src, time, amount, 0)

View File

@@ -3,8 +3,8 @@
# Used by:
# Modules from group: Remote Capacitor Transmitter (41 of 41)
type = "projected", "active"
def handler(fit, module, context):
def handler(fit, src, context):
if "projected" in context:
amount = module.getModifiedItemAttr("powerTransferAmount")
duration = module.getModifiedItemAttr("duration")
fit.addDrain(duration, -amount, 0)
amount = src.getModifiedItemAttr("powerTransferAmount")
duration = src.getModifiedItemAttr("duration")
fit.addDrain(src, duration, -amount, 0)

View File

@@ -873,8 +873,17 @@ class Fit(object):
rechargeRate = self.ship.getModifiedItemAttr("shieldRechargeRate") / 1000.0
return 10 / rechargeRate * sqrt(percent) * (1 - sqrt(percent)) * capacity
def addDrain(self, cycleTime, capNeed, clipSize=0):
def addDrain(self, src, cycleTime, capNeed, clipSize=0):
""" Used for both cap drains and cap fills (fills have negative capNeed) """
rigSize = self.ship.getModifiedItemAttr("rigSize")
energyNeutralizerSignatureResolution = src.getModifiedItemAttr("energyNeutralizerSignatureResolution")
signatureRadius = self.ship.getModifiedItemAttr("signatureRadius")
#Signature reduction, uses the bomb formula as per CCP Larrikin
if energyNeutralizerSignatureResolution:
capNeed = capNeed*min(1, signatureRadius/energyNeutralizerSignatureResolution)
resistance = self.ship.getModifiedItemAttr("energyWarfareResistance") or 1 if capNeed > 0 else 1
self.__extraDrains.append((cycleTime, capNeed * resistance, clipSize))