Only apply command boosts when command module is active, and add t2 command burst effect

This commit is contained in:
blitzman
2016-11-20 12:45:08 -05:00
parent 11716f7f94
commit 62a696cc4b
8 changed files with 29 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ bonuses and actually run the effect. To do this, we have a special argument pass
which warfareBuffID to run (shouldn't need this right now, but better safe than sorry)
'''
type = "passive", "gang"
type = "active", "gang"
def handler(fit, module, context, **kwargs):
print "In chargeBonusWarfareEffect, context: ", context

View File

@@ -0,0 +1,3 @@
type = "active"
def handler(fit, module, context):
pass

View File

@@ -0,0 +1,3 @@
type = "active"
def handler(fit, module, context):
pass

View File

@@ -0,0 +1,3 @@
type = "active"
def handler(fit, module, context):
pass

View File

@@ -0,0 +1,3 @@
type = "active"
def handler(fit, module, context):
pass

View File

@@ -1,5 +1,5 @@
type = "passive", "gang"
type = "active", "gang"
def handler(fit, module, context, **kwargs):
def runEffect(id, value):
if id == 39: # Avatar Effect Generator : Capacitor Recharge bonus

View File

@@ -0,0 +1,6 @@
type = "passive"
runTime = "late"
def handler(fit, module, context):
for x in xrange(1, 4):
module.boostChargeAttr("warfareBuff{}Value".format(x), module.getModifiedItemAttr("commandBurstStrengthBonus"))

View File

@@ -597,16 +597,20 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
# fix for #82 and it's regression #106
if not projected or (self.projected and not forceProjected) or gang:
for effect in self.charge.effects.itervalues():
if effect.runTime == runTime and (not gang or (gang and effect.isType("gang"))):
# todo: ensure that these are run when the module is active only
thing = ("moduleCharge",)
if effect.runTime == runTime and \
(effect.isType("offline") or
(effect.isType("passive") and self.state >= State.ONLINE) or
(effect.isType("active") and self.state >= State.ACTIVE)) and \
(not gang or (gang and effect.isType("gang"))):
chargeContext = ("moduleCharge",)
# For gang effects, we pass in the effect itself as an argument. However, to avoid going through
# all the effect files and defining this argument, do a simple try/catch here and be done with it.
# @todo: possibly fix this
try:
effect.handler(fit, self, thing, effect=effect)
effect.handler(fit, self, chargeContext, effect=effect)
except:
effect.handler(fit, self, thing)
effect.handler(fit, self, chargeContext)
if self.item:
if self.state >= State.OVERHEATED: