Restrict citadels to only use citadel modules. Rename Ships tab to Fittings as it no longer just carries ships :(. Fix crash on item stats.

This commit is contained in:
blitzmann
2016-05-15 23:18:39 -04:00
parent 4041ecddc4
commit 62fd545d24
5 changed files with 15 additions and 6 deletions

View File

@@ -24,6 +24,7 @@ from eos.effectHandlerHelpers import HandledItem, HandledCharge
from eos.enum import Enum
from eos.mathUtils import floorFloat
import eos.db
from eos.types import Citadel
import logging
logger = logging.getLogger(__name__)
@@ -395,6 +396,11 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
if (len(fitsOnGroup) > 0 or len(fitsOnType) > 0) and fit.ship.item.group.ID not in fitsOnGroup and fit.ship.item.ID not in fitsOnType:
return False
# AFAIK Citadel modules will always be restricted based on canFitShipType/Group. If we are fitting to a Citadel
# and the module does not have these properties, return false to prevent regular ship modules from being used
if isinstance(fit.ship, Citadel) and len(fitsOnGroup) == 0 and len(fitsOnType) == 0:
return False
# If the mod is a subsystem, don't let two subs in the same slot fit
if self.slot == Slot.SUBSYSTEM:
subSlot = self.getModifiedItemAttr("subSystemSlot")

View File

@@ -25,6 +25,8 @@ from eos.saveddata.crestchar import CrestChar
from eos.saveddata.damagePattern import DamagePattern
from eos.saveddata.targetResists import TargetResists
from eos.saveddata.character import Character, Skill
from eos.saveddata.ship import Ship
from eos.saveddata.citadel import Citadel
from eos.saveddata.module import Module, State, Slot, Hardpoint, Rack
from eos.saveddata.drone import Drone
from eos.saveddata.fighterAbility import FighterAbility
@@ -34,8 +36,6 @@ from eos.saveddata.implant import Implant
from eos.saveddata.implantSet import ImplantSet
from eos.saveddata.booster import SideEffect
from eos.saveddata.booster import Booster
from eos.saveddata.ship import Ship
from eos.saveddata.citadel import Citadel
from eos.saveddata.fit import Fit, ImplantLocation
from eos.saveddata.mode import Mode
from eos.saveddata.fleet import Fleet, Wing, Squad

View File

@@ -24,7 +24,7 @@ from gui.bitmapLoader import BitmapLoader
import sys
import wx.lib.mixins.listctrl as listmix
import wx.html
from eos.types import Fit, Ship, Module, Skill, Booster, Implant, Drone, Mode, Fighter
from eos.types import Fit, Ship, Citadel, Module, Skill, Booster, Implant, Drone, Mode, Fighter
from gui.utils.numberFormatter import formatAmount
import service
import config
@@ -561,7 +561,7 @@ class ItemEffects (wx.Panel):
class ItemAffectedBy (wx.Panel):
ORDER = [Fit, Ship, Mode, Module, Drone, Fighter, Implant, Booster, Skill]
ORDER = [Fit, Ship, Citadel, Mode, Module, Drone, Fighter, Implant, Booster, Skill]
def __init__(self, parent, stuff, item):
wx.Panel.__init__(self, parent)
self.stuff = stuff

View File

@@ -155,7 +155,7 @@ class MainFrame(wx.Frame):
self.marketBrowser.splitter.SetSashPosition(self.marketHeight)
self.shipBrowser = ShipBrowser(self.notebookBrowsers)
self.notebookBrowsers.AddPage(self.shipBrowser, "Ships", tabImage = shipBrowserImg, showClose = False)
self.notebookBrowsers.AddPage(self.shipBrowser, "Fittings", tabImage = shipBrowserImg, showClose = False)
#=======================================================================
# DISABLED FOR RC2 RELEASE

View File

@@ -157,7 +157,10 @@ class Fit(object):
return fit.modules[pos]
def newFit(self, shipID, name=None):
ship = eos.types.Ship(eos.db.getItem(shipID))
try:
ship = eos.types.Ship(eos.db.getItem(shipID))
except ValueError:
ship = eos.types.Citadel(eos.db.getItem(shipID))
fit = eos.types.Fit(ship)
fit.name = name if name is not None else "New %s" % fit.ship.item.name
fit.damagePattern = self.pattern