Merge pull request #799 from IndictionEve/ActiveFighterAbilities

Activate fighter standard attack and limit active fighters
This commit is contained in:
Ryan Holmes
2016-11-21 23:18:40 -05:00
committed by GitHub

View File

@@ -693,6 +693,25 @@ class Fit(object):
'''
if fighter is None:
fighter = eos.types.Fighter(item)
used = fit.getSlotsUsed(fighter.slot)
total = fit.getNumSlots(fighter.slot)
standardAttackActive = False;
for ability in fighter.abilities:
if (ability.effect.isImplemented and ability.effect.handlerName == u'fighterabilityattackm'):
# Activate "standard attack" if available
ability.active = True
standardAttackActive = True
else:
# Activate all other abilities (Neut, Web, etc) except propmods if no standard attack is active
if (ability.effect.isImplemented
and standardAttackActive == False
and ability.effect.handlerName != u'fighterabilitymicrowarpdrive'
and ability.effect.handlerName != u'fighterabilityevasivemaneuvers'):
ability.active = True
if used >= total:
fighter.active = False
if fighter.fits(fit) is True:
fit.fighters.append(fighter)
else: