From 6cda47be9fcf0f9f0cdafb3e860937e26006d578 Mon Sep 17 00:00:00 2001 From: Indiction Date: Sun, 6 Nov 2016 23:19:18 +0100 Subject: [PATCH 1/2] Activate all fighter abilities by default and deactivate fighter groups if more than the maximum number of fighters are in bay --- service/fit.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/service/fit.py b/service/fit.py index 4a8bbef5c..ec7977898 100644 --- a/service/fit.py +++ b/service/fit.py @@ -658,6 +658,13 @@ class Fit(object): ''' if fighter is None: fighter = eos.types.Fighter(item) + used = fit.getSlotsUsed(fighter.slot) + total = fit.getNumSlots(fighter.slot) + for ability in fighter.abilities: + ability.active = True if ability.effect.isImplemented else False + if used >= total: + fighter.active = False + if fighter.fits(fit) is True: fit.fighters.append(fighter) else: From bbc4ef814635ae1fbab5071ef8b533c2fc678029 Mon Sep 17 00:00:00 2001 From: Indiction Date: Mon, 7 Nov 2016 23:28:27 +0100 Subject: [PATCH 2/2] Activate "standard attack" if available. If there is no "standard attack" all other abilities set active except propmods --- service/fit.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/service/fit.py b/service/fit.py index ec7977898..99c2e44ea 100644 --- a/service/fit.py +++ b/service/fit.py @@ -660,8 +660,20 @@ class Fit(object): fighter = eos.types.Fighter(item) used = fit.getSlotsUsed(fighter.slot) total = fit.getNumSlots(fighter.slot) + standardAttackActive = False; for ability in fighter.abilities: - ability.active = True if ability.effect.isImplemented else False + 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