Add drones and fighters to fit optimization
This commit is contained in:
@@ -296,6 +296,13 @@ class Drone(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
|
||||
copy.amountActive = self.amountActive
|
||||
return copy
|
||||
|
||||
def rebase(self, item):
|
||||
amount = self.amount
|
||||
amountActive = self.amountActive
|
||||
Drone.__init__(self, item)
|
||||
self.amount = amount
|
||||
self.amountActive = amountActive
|
||||
|
||||
def fits(self, fit):
|
||||
fitDroneGroupLimits = set()
|
||||
for i in range(1, 3):
|
||||
|
||||
@@ -355,6 +355,17 @@ class Fighter(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
|
||||
copyAbility.active = ability.active
|
||||
return copy
|
||||
|
||||
def rebase(self, item):
|
||||
amount = self.amount
|
||||
active = self.active
|
||||
abilityEffectStates = {a.effectID: a.active for a in self.abilities}
|
||||
Fighter.__init__(self, item)
|
||||
self.amount = amount
|
||||
self.active = active
|
||||
for ability in self.abilities:
|
||||
if ability.effectID in abilityEffectStates:
|
||||
ability.active = abilityEffectStates[ability.effectID]
|
||||
|
||||
def fits(self, fit):
|
||||
# If ships doesn't support this type of fighter, don't add it
|
||||
if fit.getNumSlots(self.slot) == 0:
|
||||
|
||||
@@ -234,7 +234,7 @@ class Price:
|
||||
|
||||
def cb(replacementMap):
|
||||
changes = False
|
||||
for container in (fit.modules,):
|
||||
for container in (fit.modules, fit.drones, fit.fighters):
|
||||
for obj in container:
|
||||
charge = getattr(obj, 'charge', None)
|
||||
if charge is not None and charge in replacementMap:
|
||||
|
||||
Reference in New Issue
Block a user