Trying to flesh out how command boosts are gonna work.

This commit is contained in:
Ryan Holmes
2016-11-16 09:54:02 -05:00
parent 34243b7b71
commit 29b5a7433d
2 changed files with 42 additions and 3 deletions

View File

@@ -1,16 +1,43 @@
# We should probably have something a little less hacky in place, but time is money!
'''
Some documentation:
When the fit is calculated, we gather up all the gang effects and stick them onto the fit. We don't run the actual
effect yet, only give the fit details so that it can run the effect at a later time. We need to do this so that we can
only run the strongest effect. When we are done, one of the last things that we do with the fit is to loop through those
bonuses and actually run the effect. To do this, we have a special argument passed into the effect handler that tells it
which warfareBuffID to run (shouldn't need this right now, but better safe than sorry)
'''
type = "passive"
def handler(fit, module, context):
def handler(fit, module, context, warfareBuffID = None):
print "In chargeBonusWarfareEffect, context: ", context
def runEffect(id, value):
print "RUN EFFECT: ",
if id == 21: # Skirmish Burst: Interdiction Maneuvers: Tackle Range
print "Tackle Range"
return
groups = ("Stasis Web", "Warp Scrambler")
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name in groups,
"maxRange", value,
"maxRange", value,
stackingPenalties=True)
if id == 10:
print "Shield Resists"
print "Inside the CHARGE"
for x in xrange(1, 4):
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
runEffect(module.getModifiedChargeAttr("warfareBuff{}ID".format(x)), module.getModifiedChargeAttr("warfareBuff{}Value".format(x)))
value = module.getModifiedChargeAttr("warfareBuff{}Value".format(x))
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))
if 'commandRun' not in context:
print "Add buffID", warfareBuffID, " to ", fit
fit.addCommandBonus(id, value, module)
elif warfareBuffID is not None and warfareBuffID == id:
print "Running buffID ", warfareBuffID, " on ", fit
runEffect(warfareBuffID, value)