Fix titan command effects
This commit is contained in:
@@ -15,11 +15,7 @@ which warfareBuffID to run (shouldn't need this right now, but better safe than
|
|||||||
|
|
||||||
type = "active", "gang"
|
type = "active", "gang"
|
||||||
def handler(fit, module, context, **kwargs):
|
def handler(fit, module, context, **kwargs):
|
||||||
print "In chargeBonusWarfareEffect, context: ", context
|
|
||||||
|
|
||||||
def runEffect(id, value):
|
def runEffect(id, value):
|
||||||
print "RUN EFFECT: ", fit,
|
|
||||||
|
|
||||||
if id == 10: # Shield Burst: Shield Harmonizing: Shield Resistance
|
if id == 10: # Shield Burst: Shield Harmonizing: Shield Resistance
|
||||||
for damageType in ("Em", "Explosive", "Thermal", "Kinetic"):
|
for damageType in ("Em", "Explosive", "Thermal", "Kinetic"):
|
||||||
fit.ship.boostItemAttr("shield%sDamageResonance" % damageType, value)
|
fit.ship.boostItemAttr("shield%sDamageResonance" % damageType, value)
|
||||||
@@ -101,12 +97,10 @@ def handler(fit, module, context, **kwargs):
|
|||||||
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
|
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
|
||||||
value = module.getModifiedChargeAttr("warfareBuff{}Multiplier".format(x))
|
value = module.getModifiedChargeAttr("warfareBuff{}Multiplier".format(x))
|
||||||
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))
|
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))
|
||||||
print "Buff ID: ",id," value: ",value
|
|
||||||
if id:
|
if id:
|
||||||
if 'commandRun' not in context:
|
if 'commandRun' not in context:
|
||||||
print "Add buffID", id, " to ", fit
|
|
||||||
fit.addCommandBonus(id, value, module, kwargs['effect'])
|
fit.addCommandBonus(id, value, module, kwargs['effect'])
|
||||||
elif kwargs['warfareBuffID'] is not None and kwargs['warfareBuffID'] == id:
|
elif kwargs['warfareBuffID'] is not None and kwargs['warfareBuffID'] == id:
|
||||||
print "Running buffID ", kwargs['warfareBuffID'], " on ", fit
|
|
||||||
runEffect(kwargs['warfareBuffID'], value)
|
runEffect(kwargs['warfareBuffID'], value)
|
||||||
|
|
||||||
|
|||||||
@@ -11,43 +11,44 @@ def handler(fit, module, context, **kwargs):
|
|||||||
|
|
||||||
if id == 40: # Avatar Effect Generator : Kinetic resistance bonus
|
if id == 40: # Avatar Effect Generator : Kinetic resistance bonus
|
||||||
for attr in ("armorKineticDamageResonance", "shieldKineticDamageResonance", "hullKineticDamageResonance"):
|
for attr in ("armorKineticDamageResonance", "shieldKineticDamageResonance", "hullKineticDamageResonance"):
|
||||||
fit.ship.boostItemAttr(attr, value, stackingPenalties=True)
|
fit.ship.boostItemAttr(attr, value)
|
||||||
|
|
||||||
if id == 41: # Erebus Effect Generator : Armor HP bonus
|
if id == 49: # Avatar Effect Generator : EM resistance penalty
|
||||||
|
for attr in ("armorEmDamageResonance", "shieldEmDamageResonance", "hullEmDamageResonance"):
|
||||||
|
fit.ship.boostItemAttr(attr, value)
|
||||||
|
|
||||||
|
if id == 42: # Erebus Effect Generator : Armor HP bonus
|
||||||
fit.ship.boostItemAttr("armorHP", value, stackingPenalties=True)
|
fit.ship.boostItemAttr("armorHP", value, stackingPenalties=True)
|
||||||
|
|
||||||
if id == 42: # Leviathan Effect Generator : Shield HP bonus
|
|
||||||
fit.ship.boostItemAttr("shieldCapacity", value, stackingPenalties=True)
|
|
||||||
|
|
||||||
if id == 43: # Erebus Effect Generator : Explosive resistance bonus
|
if id == 43: # Erebus Effect Generator : Explosive resistance bonus
|
||||||
for attr in ("armorExplosiveDamageResonance", "shieldExplosiveDamageResonance", "hullExplosiveDamageResonance"):
|
for attr in ("armorExplosiveDamageResonance", "shieldExplosiveDamageResonance", "hullExplosiveDamageResonance"):
|
||||||
fit.ship.boostItemAttr(attr, value, stackingPenalties=True)
|
fit.ship.boostItemAttr(attr, value)
|
||||||
|
|
||||||
if id == 44: # Erebus Effect Generator : Thermal resistance penalty
|
if id == 44: # Erebus Effect Generator : Thermal resistance penalty
|
||||||
for attr in ("armorThermalDamageResonance", "shieldThermalDamageResonance", "hullThermalDamageResonance"):
|
for attr in ("armorThermalDamageResonance", "shieldThermalDamageResonance", "hullThermalDamageResonance"):
|
||||||
fit.ship.boostItemAttr(attr, value, stackingPenalties=True)
|
fit.ship.boostItemAttr(attr, value)
|
||||||
|
|
||||||
if id == 45: # Ragnarok Effect Generator : Signature Radius bonus
|
if id == 45: # Ragnarok Effect Generator : Signature Radius bonus
|
||||||
fit.ship.boostItemAttr("signatureRadius", value, stackingPenalties=True)
|
fit.ship.boostItemAttr("signatureRadius", value, stackingPenalties=True)
|
||||||
|
|
||||||
if id == 46: # Ragnarok Effect Generator : Thermal resistance bonus
|
if id == 46: # Ragnarok Effect Generator : Thermal resistance bonus
|
||||||
for attr in ("armorThermalDamageResonance", "shieldThermalDamageResonance", "hullThermalDamageResonance"):
|
for attr in ("armorThermalDamageResonance", "shieldThermalDamageResonance", "hullThermalDamageResonance"):
|
||||||
fit.ship.boostItemAttr(attr, value, stackingPenalties=True)
|
fit.ship.boostItemAttr(attr, value)
|
||||||
|
|
||||||
if id == 47: # Ragnarok Effect Generator : Explosive resistance penaly
|
if id == 47: # Ragnarok Effect Generator : Explosive resistance penaly
|
||||||
for attr in ("armorExplosiveDamageResonance", "shieldExplosiveDamageResonance", "hullExplosiveDamageResonance"):
|
for attr in ("armorExplosiveDamageResonance", "shieldExplosiveDamageResonance", "hullExplosiveDamageResonance"):
|
||||||
fit.ship.boostItemAttr(attr, value, stackingPenalties=True)
|
fit.ship.boostItemAttr(attr, value)
|
||||||
|
|
||||||
if id == 48: # Leviathan Effect Generator : Shield HP bonus
|
if id == 48: # Leviathan Effect Generator : Shield HP bonus
|
||||||
fit.ship.boostItemAttr("shieldCapacity", value, stackingPenalties=True)
|
fit.ship.boostItemAttr("shieldCapacity", value, stackingPenalties=True)
|
||||||
|
|
||||||
if id == 49: # Leviathan Effect Generator : EM resistance bonus
|
if id == 49: # Leviathan Effect Generator : EM resistance bonus
|
||||||
for attr in ("armorEmDamageResonance", "shieldEmDamageResonance", "hullEmDamageResonance"):
|
for attr in ("armorEmDamageResonance", "shieldEmDamageResonance", "hullEmDamageResonance"):
|
||||||
fit.ship.boostItemAttr(attr, value, stackingPenalties=True)
|
fit.ship.boostItemAttr(attr, value)
|
||||||
|
|
||||||
if id == 50: # Leviathan Effect Generator : Kinetic resistance penalty
|
if id == 50: # Leviathan Effect Generator : Kinetic resistance penalty
|
||||||
for attr in ("armorKineticDamageResonance", "shieldKineticDamageResonance", "hullKineticDamageResonance"):
|
for attr in ("armorKineticDamageResonance", "shieldKineticDamageResonance", "hullKineticDamageResonance"):
|
||||||
fit.ship.boostItemAttr(attr, value, stackingPenalties=True)
|
fit.ship.boostItemAttr(attr, value)
|
||||||
|
|
||||||
if id == 51: # Avatar Effect Generator : Velocity penalty
|
if id == 51: # Avatar Effect Generator : Velocity penalty
|
||||||
fit.ship.boostItemAttr("maxVelocity", value, stackingPenalties=True)
|
fit.ship.boostItemAttr("maxVelocity", value, stackingPenalties=True)
|
||||||
@@ -63,9 +64,9 @@ def handler(fit, module, context, **kwargs):
|
|||||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name in groups, "maxRange", value, stackingPenalties=True)
|
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name in groups, "maxRange", value, stackingPenalties=True)
|
||||||
|
|
||||||
for x in xrange(1, 4):
|
for x in xrange(1, 4):
|
||||||
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
|
if module.getModifiedItemAttr("warfareBuff{}ID".format(x)):
|
||||||
value = module.getModifiedChargeAttr("warfareBuff{}Multiplier".format(x))
|
value = module.getModifiedItemAttr("warfareBuff{}Value".format(x))
|
||||||
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))
|
id = module.getModifiedItemAttr("warfareBuff{}ID".format(x))
|
||||||
|
|
||||||
if id:
|
if id:
|
||||||
if 'commandRun' not in context:
|
if 'commandRun' not in context:
|
||||||
|
|||||||
@@ -449,8 +449,6 @@ class Fit(object):
|
|||||||
# oh fuck this is so janky
|
# oh fuck this is so janky
|
||||||
# @todo should we pass in min/max to this function, or is abs okay?
|
# @todo should we pass in min/max to this function, or is abs okay?
|
||||||
# (abs is old method, ccp now provides the aggregate function in their data)
|
# (abs is old method, ccp now provides the aggregate function in their data)
|
||||||
print "Add command bonus: ", warfareBuffID, " - value: ", value
|
|
||||||
|
|
||||||
if warfareBuffID not in self.commandBonuses or abs(self.commandBonuses[warfareBuffID][1]) < abs(value):
|
if warfareBuffID not in self.commandBonuses or abs(self.commandBonuses[warfareBuffID][1]) < abs(value):
|
||||||
self.commandBonuses[warfareBuffID] = (runTime, value, module, effect)
|
self.commandBonuses[warfareBuffID] = (runTime, value, module, effect)
|
||||||
|
|
||||||
@@ -514,12 +512,10 @@ class Fit(object):
|
|||||||
eos.db.saveddata_session.delete(self)
|
eos.db.saveddata_session.delete(self)
|
||||||
|
|
||||||
if self.commandFits and not withBoosters:
|
if self.commandFits and not withBoosters:
|
||||||
print "Calculatate command fits and apply to fit"
|
|
||||||
for fit in self.commandFits:
|
for fit in self.commandFits:
|
||||||
if self == fit:
|
if self == fit:
|
||||||
print "nope"
|
|
||||||
continue
|
continue
|
||||||
print "calculating ", fit
|
|
||||||
fit.calculateModifiedAttributes(self, True)
|
fit.calculateModifiedAttributes(self, True)
|
||||||
#
|
#
|
||||||
# for thing in chain(fit.modules, fit.implants, fit.character.skills, (fit.ship,)):
|
# for thing in chain(fit.modules, fit.implants, fit.character.skills, (fit.ship,)):
|
||||||
|
|||||||
@@ -655,10 +655,14 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
|
|||||||
effect.activeByDefault and \
|
effect.activeByDefault and \
|
||||||
(effect.isType("offline") or
|
(effect.isType("offline") or
|
||||||
(effect.isType("passive") and self.state >= State.ONLINE) or
|
(effect.isType("passive") and self.state >= State.ONLINE) or
|
||||||
|
|
||||||
(effect.isType("active") and self.state >= State.ACTIVE))\
|
(effect.isType("active") and self.state >= State.ACTIVE))\
|
||||||
and ((projected and effect.isType("projected")) or not projected)\
|
and ((projected and effect.isType("projected")) or not projected)\
|
||||||
and ((gang and effect.isType("gang")) or not gang):
|
and ((gang and effect.isType("gang")) or not gang):
|
||||||
effect.handler(fit, self, context)
|
try:
|
||||||
|
effect.handler(fit, self, context, effect=effect)
|
||||||
|
except:
|
||||||
|
effect.handler(fit, self, context)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cycleTime(self):
|
def cycleTime(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user