Do not activate ADC and PANIC upon fitting
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import wx
|
||||
from eos.saveddata.module import Module
|
||||
from eos.const import FittingModuleState
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.saveddata.module import Module
|
||||
from gui.fitCommands.helpers import stateLimit
|
||||
from service.fit import Fit
|
||||
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
@@ -53,8 +56,9 @@ class FitAddModuleCommand(wx.Command):
|
||||
self.module.owner = fit
|
||||
numSlots = len(fit.modules)
|
||||
fit.modules.append(self.module)
|
||||
if self.module.isValidState(FittingModuleState.ACTIVE):
|
||||
self.module.state = FittingModuleState.ACTIVE
|
||||
desiredState = stateLimit(self.module.item)
|
||||
if self.module.isValidState(desiredState):
|
||||
self.module.state = desiredState
|
||||
|
||||
# todo: fix these
|
||||
# As some items may affect state-limiting attributes of the ship, calculate new attributes first
|
||||
|
||||
@@ -3,8 +3,7 @@ from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.saveddata.module import Module
|
||||
from eos.const import FittingModuleState
|
||||
from gui.fitCommands.helpers import ModuleInfoCache
|
||||
from gui.fitCommands.helpers import ModuleInfoCache, stateLimit
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
@@ -79,8 +78,9 @@ class FitReplaceModuleCommand(wx.Command):
|
||||
|
||||
self.module.owner = fit
|
||||
fit.modules.toModule(self.position, self.module)
|
||||
if self.module.isValidState(FittingModuleState.ACTIVE):
|
||||
self.module.state = FittingModuleState.ACTIVE
|
||||
desiredState = stateLimit(self.module.item)
|
||||
if self.module.isValidState(desiredState):
|
||||
self.module.state = desiredState
|
||||
|
||||
if self.old_module and self.old_module.charge and self.module.isValidCharge(self.old_module.charge):
|
||||
self.module.charge = self.old_module.charge
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
from collections import namedtuple
|
||||
|
||||
from eos.const import FittingModuleState
|
||||
|
||||
|
||||
ModuleInfoCache = namedtuple('ModuleInfoCache', ['modPosition', 'itemID', 'state', 'charge', 'baseID', 'mutaplasmidID'])
|
||||
|
||||
|
||||
def stateLimit(item):
|
||||
if {'moduleBonusAssaultDamageControl', 'moduleBonusIndustrialInvulnerability'}.intersection(item.effects):
|
||||
return FittingModuleState.ONLINE
|
||||
return FittingModuleState.ACTIVE
|
||||
|
||||
@@ -161,6 +161,8 @@ car: Capital Armor Repairer
|
||||
cpl: 25000mm Plates
|
||||
dc: Damage Control
|
||||
dcu: Damage Control
|
||||
adc: Assault Damage Control
|
||||
adcu: Assault Damage Control
|
||||
eanm: Energized Adaptive Nano Membrane
|
||||
enam: Energized Adaptive Nano Membrane
|
||||
laar: Large Ancillary Armor Repairer
|
||||
|
||||
Reference in New Issue
Block a user