32
.travis.yml
32
.travis.yml
@@ -1,4 +1,5 @@
|
||||
language: python
|
||||
cache: pip
|
||||
python:
|
||||
- '2.7'
|
||||
env:
|
||||
@@ -6,20 +7,33 @@ env:
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
# for wxPython:
|
||||
- python-wxgtk2.8
|
||||
- python-wxtools
|
||||
- wx2.8-doc
|
||||
- wx2.8-examples
|
||||
- wx2.8-headers
|
||||
- wx2.8-i18n
|
||||
before_install:
|
||||
- pip install -U tox
|
||||
- sudo apt-get update && sudo apt-get --reinstall install -qq language-pack-en language-pack-ru language-pack-he language-pack-zh-hans
|
||||
- pip install tox
|
||||
# We're not actually installing Tox, but have to run it before we install wxPython via Conda. This is fugly but vOv
|
||||
- tox
|
||||
# get Conda
|
||||
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
|
||||
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
|
||||
else
|
||||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
|
||||
fi
|
||||
- bash miniconda.sh -b -p $HOME/miniconda
|
||||
- export PATH="$HOME/miniconda/bin:$PATH"
|
||||
- hash -r
|
||||
- conda config --set always_yes yes --set changeps1 no
|
||||
- conda update -q conda
|
||||
# Useful for debugging any issues with conda
|
||||
- conda info -a
|
||||
install:
|
||||
# install wxPython 3.0.0.0
|
||||
- conda install -c https://conda.anaconda.org/travis wxpython
|
||||
before_script:
|
||||
- pip install -r requirements.txt
|
||||
- pip install -r requirements_test.txt
|
||||
script:
|
||||
- tox
|
||||
- py.test --cov=./
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
before_deploy:
|
||||
- pip install -r requirements_build_linux.txt
|
||||
|
||||
0
_development/__init__.py
Normal file
0
_development/__init__.py
Normal file
145
_development/helpers.py
Normal file
145
_development/helpers.py
Normal file
@@ -0,0 +1,145 @@
|
||||
# noinspection PyPackageRequirements
|
||||
import pytest
|
||||
|
||||
import os
|
||||
import sys
|
||||
import threading
|
||||
|
||||
from sqlalchemy import MetaData, create_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
# Add root folder to python paths
|
||||
sys.path.append(os.path.realpath(os.path.join(script_dir, '..', '..')))
|
||||
sys._called_from_test = True
|
||||
|
||||
# noinspection PyUnresolvedReferences,PyUnusedLocal
|
||||
@pytest.fixture
|
||||
def DBInMemory_test():
|
||||
def rollback():
|
||||
with sd_lock:
|
||||
saveddata_session.rollback()
|
||||
|
||||
|
||||
print("Creating database in memory")
|
||||
from os.path import realpath, join, dirname, abspath
|
||||
|
||||
debug = False
|
||||
gamedataCache = True
|
||||
saveddataCache = True
|
||||
gamedata_version = ""
|
||||
gamedata_connectionstring = 'sqlite:///' + realpath(join(dirname(abspath(unicode(__file__))), "..", "eve.db"))
|
||||
saveddata_connectionstring = 'sqlite:///:memory:'
|
||||
|
||||
class ReadOnlyException(Exception):
|
||||
pass
|
||||
|
||||
if callable(gamedata_connectionstring):
|
||||
gamedata_engine = create_engine("sqlite://", creator=gamedata_connectionstring, echo=debug)
|
||||
else:
|
||||
gamedata_engine = create_engine(gamedata_connectionstring, echo=debug)
|
||||
|
||||
gamedata_meta = MetaData()
|
||||
gamedata_meta.bind = gamedata_engine
|
||||
gamedata_session = sessionmaker(bind=gamedata_engine, autoflush=False, expire_on_commit=False)()
|
||||
|
||||
# This should be moved elsewhere, maybe as an actual query. Current, without try-except, it breaks when making a new
|
||||
# game db because we haven't reached gamedata_meta.create_all()
|
||||
try:
|
||||
gamedata_version = gamedata_session.execute(
|
||||
"SELECT `field_value` FROM `metadata` WHERE `field_name` LIKE 'client_build'"
|
||||
).fetchone()[0]
|
||||
except Exception as e:
|
||||
print("Missing gamedata version.")
|
||||
gamedata_version = None
|
||||
|
||||
if saveddata_connectionstring is not None:
|
||||
if callable(saveddata_connectionstring):
|
||||
saveddata_engine = create_engine(creator=saveddata_connectionstring, echo=debug)
|
||||
else:
|
||||
saveddata_engine = create_engine(saveddata_connectionstring, echo=debug)
|
||||
|
||||
saveddata_meta = MetaData()
|
||||
saveddata_meta.bind = saveddata_engine
|
||||
saveddata_session = sessionmaker(bind=saveddata_engine, autoflush=False, expire_on_commit=False)()
|
||||
else:
|
||||
saveddata_meta = None
|
||||
|
||||
# Lock controlling any changes introduced to session
|
||||
sd_lock = threading.Lock()
|
||||
|
||||
# Import all the definitions for all our database stuff
|
||||
# noinspection PyPep8
|
||||
#from eos.db.gamedata import alphaClones, attribute, category, effect, group, icon, item, marketGroup, metaData, metaGroup, queries, traits, unit
|
||||
# noinspection PyPep8
|
||||
#from eos.db.saveddata import booster, cargo, character, crest, damagePattern, databaseRepair, drone, fighter, fit, implant, implantSet, loadDefaultDatabaseValues, miscData, module, override, price, queries, skill, targetResists, user
|
||||
|
||||
# If using in memory saveddata, you'll want to reflect it so the data structure is good.
|
||||
if saveddata_connectionstring == "sqlite:///:memory:":
|
||||
saveddata_meta.create_all()
|
||||
|
||||
# Output debug info to help us troubleshoot Travis
|
||||
print(saveddata_engine)
|
||||
print(gamedata_engine)
|
||||
|
||||
helper = {
|
||||
#'config': eos.config,
|
||||
'gamedata_session' : gamedata_session,
|
||||
'saveddata_session' : saveddata_session,
|
||||
}
|
||||
return helper
|
||||
|
||||
# noinspection PyUnresolvedReferences,PyUnusedLocal
|
||||
@pytest.fixture
|
||||
def DBInMemory():
|
||||
print("Creating database in memory")
|
||||
|
||||
import eos.config
|
||||
|
||||
import eos
|
||||
import eos.db
|
||||
|
||||
# Output debug info to help us troubleshoot Travis
|
||||
print(eos.db.saveddata_engine)
|
||||
print(eos.db.gamedata_engine)
|
||||
|
||||
helper = {
|
||||
'config': eos.config,
|
||||
'db' : eos.db,
|
||||
'gamedata_session' : eos.db.gamedata_session,
|
||||
'saveddata_session' : eos.db.saveddata_session,
|
||||
}
|
||||
return helper
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def Gamedata():
|
||||
print("Building Gamedata")
|
||||
from eos.gamedata import Item
|
||||
|
||||
helper = {
|
||||
'Item': Item,
|
||||
}
|
||||
return helper
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def Saveddata():
|
||||
print("Building Saveddata")
|
||||
from eos.saveddata.ship import Ship
|
||||
from eos.saveddata.fit import Fit
|
||||
from eos.saveddata.character import Character
|
||||
from eos.saveddata.module import Module, State
|
||||
from eos.saveddata.citadel import Citadel
|
||||
from eos.saveddata.booster import Booster
|
||||
|
||||
helper = {
|
||||
'Structure': Citadel,
|
||||
'Ship' : Ship,
|
||||
'Fit' : Fit,
|
||||
'Character': Character,
|
||||
'Module' : Module,
|
||||
'State' : State,
|
||||
'Booster' : Booster,
|
||||
}
|
||||
return helper
|
||||
66
_development/helpers_fits.py
Normal file
66
_development/helpers_fits.py
Normal file
@@ -0,0 +1,66 @@
|
||||
import pytest
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
from _development.helpers import DBInMemory as DB, Gamedata, Saveddata
|
||||
|
||||
|
||||
# noinspection PyShadowingNames
|
||||
@pytest.fixture
|
||||
def RifterFit(DB, Gamedata, Saveddata):
|
||||
print("Creating Rifter")
|
||||
item = DB['gamedata_session'].query(Gamedata['Item']).filter(Gamedata['Item'].name == "Rifter").first()
|
||||
ship = Saveddata['Ship'](item)
|
||||
# setup fit
|
||||
fit = Saveddata['Fit'](ship, "My Rifter Fit")
|
||||
|
||||
return fit
|
||||
|
||||
|
||||
# noinspection PyShadowingNames
|
||||
@pytest.fixture
|
||||
def KeepstarFit(DB, Gamedata, Saveddata):
|
||||
print("Creating Keepstar")
|
||||
item = DB['gamedata_session'].query(Gamedata['Item']).filter(Gamedata['Item'].name == "Keepstar").first()
|
||||
ship = Saveddata['Structure'](item)
|
||||
# setup fit
|
||||
fit = Saveddata['Fit'](ship, "Keepstar Fit")
|
||||
|
||||
return fit
|
||||
|
||||
|
||||
# noinspection PyShadowingNames
|
||||
@pytest.fixture
|
||||
def CurseFit(DB, Gamedata, Saveddata):
|
||||
print("Creating Curse - With Neuts")
|
||||
item = DB['gamedata_session'].query(Gamedata['Item']).filter(Gamedata['Item'].name == "Curse").first()
|
||||
ship = Saveddata['Ship'](item)
|
||||
# setup fit
|
||||
fit = Saveddata['Fit'](ship, "Curse - With Neuts")
|
||||
|
||||
mod = Saveddata['Module'](DB['db'].getItem("Medium Energy Neutralizer II"))
|
||||
mod.state = Saveddata['State'].ONLINE
|
||||
|
||||
# Add 5 neuts
|
||||
for _ in xrange(5):
|
||||
fit.modules.append(mod)
|
||||
|
||||
return fit
|
||||
|
||||
|
||||
# noinspection PyShadowingNames
|
||||
@pytest.fixture
|
||||
def HeronFit(DB, Gamedata, Saveddata):
|
||||
print("Creating Heron - RemoteSebo")
|
||||
item = DB['gamedata_session'].query(Gamedata['Item']).filter(Gamedata['Item'].name == "Heron").first()
|
||||
ship = Saveddata['Ship'](item)
|
||||
# setup fit
|
||||
fit = Saveddata['Fit'](ship, "Heron - RemoteSebo")
|
||||
|
||||
mod = Saveddata['Module'](DB['db'].getItem("Remote Sensor Booster II"))
|
||||
mod.state = Saveddata['State'].ONLINE
|
||||
|
||||
# Add 5 neuts
|
||||
for _ in xrange(4):
|
||||
fit.modules.append(mod)
|
||||
|
||||
return fit
|
||||
12
_development/helpers_items.py
Normal file
12
_development/helpers_items.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import pytest
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
from _development.helpers import DBInMemory as DB, Gamedata, Saveddata
|
||||
|
||||
|
||||
# noinspection PyShadowingNames
|
||||
@pytest.fixture
|
||||
def StrongBluePillBooster (DB, Gamedata, Saveddata):
|
||||
print("Creating Strong Blue Pill Booster")
|
||||
item = DB['gamedata_session'].query(Gamedata['Item']).filter(Gamedata['Item'].name == "Strong Blue Pill Booster").first()
|
||||
return Saveddata['Booster'](item)
|
||||
101
_development/helpers_locale.py
Normal file
101
_development/helpers_locale.py
Normal file
@@ -0,0 +1,101 @@
|
||||
import os
|
||||
|
||||
# https://msdn.microsoft.com/en-us/library/windows/desktop/dd317756(v=vs.85).aspx
|
||||
windows_codecs = {
|
||||
'cp1252', # Standard Windows
|
||||
'cp1251', # Russian
|
||||
'cp037',
|
||||
'cp424',
|
||||
'cp437',
|
||||
'cp500',
|
||||
'cp720',
|
||||
'cp737',
|
||||
'cp775',
|
||||
'cp850',
|
||||
'cp852',
|
||||
'cp855',
|
||||
'cp856',
|
||||
'cp857',
|
||||
'cp858',
|
||||
'cp860',
|
||||
'cp861',
|
||||
'cp862',
|
||||
'cp863',
|
||||
'cp864',
|
||||
'cp865',
|
||||
'cp866',
|
||||
'cp869',
|
||||
'cp874',
|
||||
'cp875',
|
||||
'cp932',
|
||||
'cp949',
|
||||
'cp950',
|
||||
'cp1006',
|
||||
'cp1026',
|
||||
'cp1140',
|
||||
'cp1250',
|
||||
'cp1253',
|
||||
'cp1254',
|
||||
'cp1255',
|
||||
'cp1256',
|
||||
'cp1257',
|
||||
'cp1258',
|
||||
}
|
||||
|
||||
linux_codecs = {
|
||||
'utf_8', # Generic Linux/Mac
|
||||
}
|
||||
|
||||
mac_codecs = [
|
||||
'utf_8', # Generic Linux/Mac
|
||||
'mac_cyrillic',
|
||||
'mac_greek',
|
||||
'mac_iceland',
|
||||
'mac_latin2',
|
||||
'mac_roman',
|
||||
'mac_turkish',
|
||||
]
|
||||
|
||||
universal_codecs = [
|
||||
'utf_16', 'utf_32', 'utf_32_be', 'utf_32_le', 'utf_16_be', 'utf_16_le', 'utf_7', 'utf_8_sig',
|
||||
]
|
||||
|
||||
other_codecs = [
|
||||
'scii', 'big5', 'big5hkscs', 'euc_jp', 'euc_jis_2004', 'euc_jisx0213', 'euc_kr', 'gb2312', 'gbk', 'gb18030', 'hz', 'iso2022_jp', 'iso2022_jp_1',
|
||||
'iso2022_jp_2', 'iso2022_jp_2004', 'iso2022_jp_3', 'iso2022_jp_ext', 'iso2022_kr', 'latin_1', 'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5',
|
||||
'iso8859_6', 'iso8859_7', 'iso8859_8', 'iso8859_9', 'iso8859_10', 'iso8859_11', 'iso8859_13', 'iso8859_14', 'iso8859_15', 'iso8859_16', 'johab', 'koi8_r',
|
||||
'koi8_u', 'ptcp154', 'shift_jis', 'shift_jis_2004', 'shift_jisx0213'
|
||||
]
|
||||
|
||||
system_names = {
|
||||
'Windows': windows_codecs,
|
||||
'Linux': linux_codecs,
|
||||
'Darwin': mac_codecs,
|
||||
}
|
||||
|
||||
|
||||
def GetPath(root, file=None, codec=None):
|
||||
# Replace this with the function we actually use for this
|
||||
path = os.path.realpath(os.path.abspath(root))
|
||||
|
||||
if file:
|
||||
path = os.path.join(path, file)
|
||||
|
||||
if codec:
|
||||
path = path.decode(codec)
|
||||
|
||||
return path
|
||||
|
||||
def GetUnicodePath(root, file=None, codec=None):
|
||||
# Replace this with the function we actually use for this
|
||||
path = os.path.realpath(os.path.abspath(root))
|
||||
|
||||
if file:
|
||||
path = os.path.join(path, file)
|
||||
|
||||
if codec:
|
||||
path = unicode(path, codec)
|
||||
else:
|
||||
path = unicode(path)
|
||||
|
||||
return path
|
||||
11
config.py
11
config.py
@@ -19,9 +19,9 @@ debug = False
|
||||
saveInRoot = False
|
||||
|
||||
# Version data
|
||||
version = "1.28.2"
|
||||
tag = "git"
|
||||
expansionName = "YC119.3"
|
||||
version = "1.29.0"
|
||||
tag = "Stable"
|
||||
expansionName = "YC119.5"
|
||||
expansionVersion = "1.0"
|
||||
evemonMinVersion = "4081"
|
||||
|
||||
@@ -29,6 +29,7 @@ pyfaPath = None
|
||||
savePath = None
|
||||
saveDB = None
|
||||
gameDB = None
|
||||
logPath = None
|
||||
|
||||
|
||||
def isFrozen():
|
||||
@@ -95,7 +96,9 @@ def defPaths(customSavePath):
|
||||
# The database where the static EVE data from the datadump is kept.
|
||||
# This is not the standard sqlite datadump but a modified version created by eos
|
||||
# maintenance script
|
||||
gameDB = os.path.join(pyfaPath, "eve.db")
|
||||
gameDB = getattr(configforced, "gameDB", gameDB)
|
||||
if not gameDB:
|
||||
gameDB = os.path.join(pyfaPath, "eve.db")
|
||||
|
||||
# DON'T MODIFY ANYTHING BELOW
|
||||
import eos.config
|
||||
|
||||
@@ -1,17 +1,30 @@
|
||||
import sys
|
||||
from os.path import realpath, join, dirname, abspath
|
||||
|
||||
from logbook import Logger
|
||||
import os
|
||||
|
||||
istravis = os.environ.get('TRAVIS') == 'true'
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
debug = False
|
||||
gamedataCache = True
|
||||
saveddataCache = True
|
||||
gamedata_version = ""
|
||||
gamedata_connectionstring = 'sqlite:///' + unicode(realpath(join(dirname(abspath(__file__)), "..", "eve.db")),
|
||||
sys.getfilesystemencoding())
|
||||
saveddata_connectionstring = 'sqlite:///' + unicode(
|
||||
realpath(join(dirname(abspath(__file__)), "..", "saveddata", "saveddata.db")), sys.getfilesystemencoding())
|
||||
gamedata_connectionstring = 'sqlite:///' + unicode(realpath(join(dirname(abspath(__file__)), "..", "eve.db")), sys.getfilesystemencoding())
|
||||
pyfalog.debug("Gamedata connection string: {0}", gamedata_connectionstring)
|
||||
|
||||
if istravis is True or hasattr(sys, '_called_from_test'):
|
||||
# Running in Travis. Run saveddata database in memory.
|
||||
saveddata_connectionstring = 'sqlite:///:memory:'
|
||||
else:
|
||||
saveddata_connectionstring = 'sqlite:///' + unicode(realpath(join(dirname(abspath(__file__)), "..", "saveddata", "saveddata.db")), sys.getfilesystemencoding())
|
||||
|
||||
pyfalog.debug("Saveddata connection string: {0}", saveddata_connectionstring)
|
||||
|
||||
settings = {
|
||||
"setting1": True
|
||||
"useStaticAdaptiveArmorHardener": False,
|
||||
"strictSkillLevels": True,
|
||||
}
|
||||
|
||||
# Autodetect path, only change if the autodetection bugs out.
|
||||
|
||||
@@ -27,7 +27,9 @@ from eos import config
|
||||
from logbook import Logger
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
pyfalog.info("Initializing database")
|
||||
pyfalog.info("Gamedata connection: {0}", config.gamedata_connectionstring)
|
||||
pyfalog.info("Saveddata connection: {0}", config.saveddata_connectionstring)
|
||||
|
||||
class ReadOnlyException(Exception):
|
||||
pass
|
||||
@@ -47,7 +49,7 @@ gamedata_session = sessionmaker(bind=gamedata_engine, autoflush=False, expire_on
|
||||
# game db because we haven't reached gamedata_meta.create_all()
|
||||
try:
|
||||
config.gamedata_version = gamedata_session.execute(
|
||||
"SELECT `field_value` FROM `metadata` WHERE `field_name` LIKE 'client_build'"
|
||||
"SELECT `field_value` FROM `metadata` WHERE `field_name` LIKE 'client_build'"
|
||||
).fetchone()[0]
|
||||
except Exception as e:
|
||||
pyfalog.warning("Missing gamedata version.")
|
||||
@@ -68,13 +70,14 @@ else:
|
||||
saveddata_meta = None
|
||||
|
||||
# Lock controlling any changes introduced to session
|
||||
sd_lock = threading.Lock()
|
||||
sd_lock = threading.RLock()
|
||||
|
||||
# Import all the definitions for all our database stuff
|
||||
# noinspection PyPep8
|
||||
from eos.db.gamedata import alphaClones, attribute, category, effect, group, icon, item, marketGroup, metaData, metaGroup, queries, traits, unit
|
||||
# noinspection PyPep8
|
||||
from eos.db.saveddata import booster, cargo, character, crest, damagePattern, databaseRepair, drone, fighter, fit, implant, implantSet, loadDefaultDatabaseValues, miscData, module, override, price, queries, skill, targetResists, user
|
||||
from eos.db.saveddata import booster, cargo, character, crest, damagePattern, databaseRepair, drone, fighter, fit, implant, implantSet, loadDefaultDatabaseValues, \
|
||||
miscData, module, override, price, queries, skill, targetResists, user
|
||||
|
||||
# Import queries
|
||||
# noinspection PyPep8
|
||||
@@ -85,8 +88,10 @@ from eos.db.saveddata.queries import *
|
||||
# If using in memory saveddata, you'll want to reflect it so the data structure is good.
|
||||
if config.saveddata_connectionstring == "sqlite:///:memory:":
|
||||
saveddata_meta.create_all()
|
||||
pyfalog.info("Running database out of memory.")
|
||||
|
||||
|
||||
def rollback():
|
||||
with sd_lock:
|
||||
pyfalog.warning("Session rollback triggered.")
|
||||
saveddata_session.rollback()
|
||||
|
||||
@@ -40,11 +40,11 @@ alphacloneskskills_table = Table(
|
||||
|
||||
mapper(AlphaClone, alphaclones_table,
|
||||
properties={
|
||||
"ID": synonym("alphaCloneID"),
|
||||
"ID" : synonym("alphaCloneID"),
|
||||
"skills": relation(
|
||||
AlphaCloneSkill,
|
||||
cascade="all,delete-orphan",
|
||||
backref="clone")
|
||||
AlphaCloneSkill,
|
||||
cascade="all,delete-orphan",
|
||||
backref="clone")
|
||||
})
|
||||
|
||||
mapper(AlphaCloneSkill, alphacloneskskills_table)
|
||||
|
||||
@@ -45,11 +45,13 @@ mapper(Attribute, typeattributes_table,
|
||||
properties={"info": relation(AttributeInfo, lazy=False)})
|
||||
|
||||
mapper(AttributeInfo, attributes_table,
|
||||
properties={"icon": relation(Icon),
|
||||
"unit": relation(Unit),
|
||||
"ID": synonym("attributeID"),
|
||||
"name": synonym("attributeName"),
|
||||
"description": deferred(attributes_table.c.description)})
|
||||
properties={
|
||||
"icon" : relation(Icon),
|
||||
"unit" : relation(Unit),
|
||||
"ID" : synonym("attributeID"),
|
||||
"name" : synonym("attributeName"),
|
||||
"description": deferred(attributes_table.c.description)
|
||||
})
|
||||
|
||||
Attribute.ID = association_proxy("info", "attributeID")
|
||||
Attribute.name = association_proxy("info", "attributeName")
|
||||
|
||||
@@ -31,7 +31,9 @@ categories_table = Table("invcategories", gamedata_meta,
|
||||
Column("iconID", Integer, ForeignKey("icons.iconID")))
|
||||
|
||||
mapper(Category, categories_table,
|
||||
properties={"icon": relation(Icon),
|
||||
"ID": synonym("categoryID"),
|
||||
"name": synonym("categoryName"),
|
||||
"description": deferred(categories_table.c.description)})
|
||||
properties={
|
||||
"icon" : relation(Icon),
|
||||
"ID" : synonym("categoryID"),
|
||||
"name" : synonym("categoryName"),
|
||||
"description": deferred(categories_table.c.description)
|
||||
})
|
||||
|
||||
@@ -18,11 +18,10 @@
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Column, String, Integer, Boolean, Table, ForeignKey
|
||||
from sqlalchemy.ext.associationproxy import association_proxy
|
||||
from sqlalchemy.orm import mapper, synonym, relation, deferred
|
||||
from sqlalchemy.orm import mapper, synonym, deferred
|
||||
|
||||
from eos.db import gamedata_meta
|
||||
from eos.gamedata import Effect, EffectInfo
|
||||
from eos.gamedata import Effect, ItemEffect
|
||||
|
||||
typeeffects_table = Table("dgmtypeeffects", gamedata_meta,
|
||||
Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key=True, index=True),
|
||||
@@ -34,17 +33,14 @@ effects_table = Table("dgmeffects", gamedata_meta,
|
||||
Column("description", String),
|
||||
Column("published", Boolean),
|
||||
Column("isAssistance", Boolean),
|
||||
Column("isOffensive", Boolean))
|
||||
Column("isOffensive", Boolean),
|
||||
Column("resistanceID", Integer))
|
||||
|
||||
mapper(EffectInfo, effects_table,
|
||||
properties={"ID": synonym("effectID"),
|
||||
"name": synonym("effectName"),
|
||||
"description": deferred(effects_table.c.description)})
|
||||
mapper(Effect, effects_table,
|
||||
properties={
|
||||
"ID" : synonym("effectID"),
|
||||
"name" : synonym("effectName"),
|
||||
"description": deferred(effects_table.c.description)
|
||||
})
|
||||
|
||||
mapper(Effect, typeeffects_table,
|
||||
properties={"ID": synonym("effectID"),
|
||||
"info": relation(EffectInfo, lazy=False)})
|
||||
|
||||
Effect.name = association_proxy("info", "name")
|
||||
Effect.description = association_proxy("info", "description")
|
||||
Effect.published = association_proxy("info", "published")
|
||||
mapper(ItemEffect, typeeffects_table)
|
||||
|
||||
@@ -32,8 +32,10 @@ groups_table = Table("invgroups", gamedata_meta,
|
||||
Column("iconID", Integer, ForeignKey("icons.iconID")))
|
||||
|
||||
mapper(Group, groups_table,
|
||||
properties={"category": relation(Category, backref="groups"),
|
||||
"icon": relation(Icon),
|
||||
"ID": synonym("groupID"),
|
||||
"name": synonym("groupName"),
|
||||
"description": deferred(groups_table.c.description)})
|
||||
properties={
|
||||
"category" : relation(Category, backref="groups"),
|
||||
"icon" : relation(Icon),
|
||||
"ID" : synonym("groupID"),
|
||||
"name" : synonym("groupName"),
|
||||
"description": deferred(groups_table.c.description)
|
||||
})
|
||||
|
||||
@@ -29,5 +29,7 @@ icons_table = Table("icons", gamedata_meta,
|
||||
Column("iconFile", String))
|
||||
|
||||
mapper(Icon, icons_table,
|
||||
properties={"ID": synonym("iconID"),
|
||||
"description": deferred(icons_table.c.description)})
|
||||
properties={
|
||||
"ID" : synonym("iconID"),
|
||||
"description": deferred(icons_table.c.description)
|
||||
})
|
||||
|
||||
@@ -21,6 +21,7 @@ from sqlalchemy import Column, String, Integer, Boolean, ForeignKey, Table, Floa
|
||||
from sqlalchemy.ext.associationproxy import association_proxy
|
||||
from sqlalchemy.orm import relation, mapper, synonym, deferred
|
||||
from sqlalchemy.orm.collections import attribute_mapped_collection
|
||||
from eos.db.gamedata.effect import typeeffects_table
|
||||
|
||||
from eos.db import gamedata_meta
|
||||
from eos.gamedata import Attribute, Effect, Group, Icon, Item, MetaType, Traits
|
||||
@@ -43,19 +44,20 @@ from .metaGroup import metatypes_table # noqa
|
||||
from .traits import traits_table # noqa
|
||||
|
||||
mapper(Item, items_table,
|
||||
properties={"group": relation(Group, backref="items"),
|
||||
"icon": relation(Icon),
|
||||
"_Item__attributes": relation(Attribute, collection_class=attribute_mapped_collection('name')),
|
||||
"effects": relation(Effect, collection_class=attribute_mapped_collection('name')),
|
||||
"metaGroup": relation(MetaType,
|
||||
properties={
|
||||
"group" : relation(Group, backref="items"),
|
||||
"icon" : relation(Icon),
|
||||
"_Item__attributes": relation(Attribute, collection_class=attribute_mapped_collection('name')),
|
||||
"effects": relation(Effect, secondary=typeeffects_table, collection_class=attribute_mapped_collection('name')),
|
||||
"metaGroup" : relation(MetaType,
|
||||
primaryjoin=metatypes_table.c.typeID == items_table.c.typeID,
|
||||
uselist=False),
|
||||
"ID": synonym("typeID"),
|
||||
"name": synonym("typeName"),
|
||||
"description": deferred(items_table.c.description),
|
||||
"traits": relation(Traits,
|
||||
primaryjoin=traits_table.c.typeID == items_table.c.typeID,
|
||||
uselist=False)
|
||||
})
|
||||
"ID" : synonym("typeID"),
|
||||
"name" : synonym("typeName"),
|
||||
"description" : deferred(items_table.c.description),
|
||||
"traits" : relation(Traits,
|
||||
primaryjoin=traits_table.c.typeID == items_table.c.typeID,
|
||||
uselist=False)
|
||||
})
|
||||
|
||||
Item.category = association_proxy("group", "category")
|
||||
|
||||
@@ -33,10 +33,12 @@ marketgroups_table = Table("invmarketgroups", gamedata_meta,
|
||||
Column("iconID", Integer, ForeignKey("icons.iconID")))
|
||||
|
||||
mapper(MarketGroup, marketgroups_table,
|
||||
properties={"items": relation(Item, backref="marketGroup"),
|
||||
"parent": relation(MarketGroup, backref="children",
|
||||
remote_side=[marketgroups_table.c.marketGroupID]),
|
||||
"icon": relation(Icon),
|
||||
"ID": synonym("marketGroupID"),
|
||||
"name": synonym("marketGroupName"),
|
||||
"description": deferred(marketgroups_table.c.description)})
|
||||
properties={
|
||||
"items" : relation(Item, backref="marketGroup"),
|
||||
"parent" : relation(MarketGroup, backref="children",
|
||||
remote_side=[marketgroups_table.c.marketGroupID]),
|
||||
"icon" : relation(Icon),
|
||||
"ID" : synonym("marketGroupID"),
|
||||
"name" : synonym("marketGroupName"),
|
||||
"description": deferred(marketgroups_table.c.description)
|
||||
})
|
||||
|
||||
@@ -35,13 +35,17 @@ metatypes_table = Table("invmetatypes", gamedata_meta,
|
||||
Column("metaGroupID", Integer, ForeignKey("invmetagroups.metaGroupID")))
|
||||
|
||||
mapper(MetaGroup, metagroups_table,
|
||||
properties={"ID": synonym("metaGroupID"),
|
||||
"name": synonym("metaGroupName")})
|
||||
properties={
|
||||
"ID" : synonym("metaGroupID"),
|
||||
"name": synonym("metaGroupName")
|
||||
})
|
||||
|
||||
mapper(MetaType, metatypes_table,
|
||||
properties={"ID": synonym("metaGroupID"),
|
||||
"parent": relation(Item, primaryjoin=metatypes_table.c.parentTypeID == items_table.c.typeID),
|
||||
"items": relation(Item, primaryjoin=metatypes_table.c.typeID == items_table.c.typeID),
|
||||
"info": relation(MetaGroup, lazy=False)})
|
||||
properties={
|
||||
"ID" : synonym("metaGroupID"),
|
||||
"parent": relation(Item, primaryjoin=metatypes_table.c.parentTypeID == items_table.c.typeID),
|
||||
"items" : relation(Item, primaryjoin=metatypes_table.c.typeID == items_table.c.typeID),
|
||||
"info" : relation(MetaGroup, lazy=False)
|
||||
})
|
||||
|
||||
MetaType.name = association_proxy("info", "name")
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy.orm import join, exc
|
||||
from sqlalchemy.orm import join, exc, aliased
|
||||
from sqlalchemy.sql import and_, or_, select
|
||||
|
||||
import eos.config
|
||||
@@ -27,12 +27,11 @@ from eos.db.gamedata.group import groups_table
|
||||
from eos.db.util import processEager, processWhere
|
||||
from eos.gamedata import AlphaClone, Attribute, Category, Group, Item, MarketGroup, MetaGroup, AttributeInfo, MetaData
|
||||
|
||||
cache = {}
|
||||
configVal = getattr(eos.config, "gamedataCache", None)
|
||||
if configVal is True:
|
||||
def cachedQuery(amount, *keywords):
|
||||
def deco(function):
|
||||
cache = {}
|
||||
|
||||
def checkAndReturn(*args, **kwargs):
|
||||
useCache = kwargs.pop("useCache", True)
|
||||
cacheKey = []
|
||||
@@ -98,6 +97,35 @@ def getItem(lookfor, eager=None):
|
||||
return item
|
||||
|
||||
|
||||
@cachedQuery(1, "lookfor")
|
||||
def getItems(lookfor, eager=None):
|
||||
"""
|
||||
Gets a list of items. Does a bit of cache hackery to get working properly -- cache
|
||||
is usually based on function calls with the parameters, needed to extract data directly.
|
||||
Works well enough. Not currently used, but it's here for possible future inclusion
|
||||
"""
|
||||
|
||||
toGet = []
|
||||
results = []
|
||||
|
||||
for id in lookfor:
|
||||
if (id, None) in cache:
|
||||
results.append(cache.get((id, None)))
|
||||
else:
|
||||
toGet.append(id)
|
||||
|
||||
if len(toGet) > 0:
|
||||
# Get items that aren't currently cached, and store them in the cache
|
||||
items = gamedata_session.query(Item).filter(Item.ID.in_(toGet)).all()
|
||||
for item in items:
|
||||
cache[(item.ID, None)] = item
|
||||
results += items
|
||||
|
||||
# sort the results based on the original indexing
|
||||
results.sort(key=lambda x: lookfor.index(x.ID))
|
||||
return results
|
||||
|
||||
|
||||
@cachedQuery(1, "lookfor")
|
||||
def getAlphaClone(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
@@ -152,7 +180,7 @@ def getCategory(lookfor, eager=None):
|
||||
category = gamedata_session.query(Category).get(lookfor)
|
||||
else:
|
||||
category = gamedata_session.query(Category).options(*processEager(eager)).filter(
|
||||
Category.ID == lookfor).first()
|
||||
Category.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
if lookfor in categoryNameMap:
|
||||
id = categoryNameMap[lookfor]
|
||||
@@ -160,11 +188,11 @@ def getCategory(lookfor, eager=None):
|
||||
category = gamedata_session.query(Category).get(id)
|
||||
else:
|
||||
category = gamedata_session.query(Category).options(*processEager(eager)).filter(
|
||||
Category.ID == id).first()
|
||||
Category.ID == id).first()
|
||||
else:
|
||||
# Category names are unique, so we can use first() instead of one()
|
||||
category = gamedata_session.query(Category).options(*processEager(eager)).filter(
|
||||
Category.name == lookfor).first()
|
||||
Category.name == lookfor).first()
|
||||
categoryNameMap[lookfor] = category.ID
|
||||
else:
|
||||
raise TypeError("Need integer or string as argument")
|
||||
@@ -181,7 +209,7 @@ def getMetaGroup(lookfor, eager=None):
|
||||
metaGroup = gamedata_session.query(MetaGroup).get(lookfor)
|
||||
else:
|
||||
metaGroup = gamedata_session.query(MetaGroup).options(*processEager(eager)).filter(
|
||||
MetaGroup.ID == lookfor).first()
|
||||
MetaGroup.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
if lookfor in metaGroupNameMap:
|
||||
id = metaGroupNameMap[lookfor]
|
||||
@@ -189,11 +217,11 @@ def getMetaGroup(lookfor, eager=None):
|
||||
metaGroup = gamedata_session.query(MetaGroup).get(id)
|
||||
else:
|
||||
metaGroup = gamedata_session.query(MetaGroup).options(*processEager(eager)).filter(
|
||||
MetaGroup.ID == id).first()
|
||||
MetaGroup.ID == id).first()
|
||||
else:
|
||||
# MetaGroup names are unique, so we can use first() instead of one()
|
||||
metaGroup = gamedata_session.query(MetaGroup).options(*processEager(eager)).filter(
|
||||
MetaGroup.name == lookfor).first()
|
||||
MetaGroup.name == lookfor).first()
|
||||
metaGroupNameMap[lookfor] = metaGroup.ID
|
||||
else:
|
||||
raise TypeError("Need integer or string as argument")
|
||||
@@ -207,7 +235,7 @@ def getMarketGroup(lookfor, eager=None):
|
||||
marketGroup = gamedata_session.query(MarketGroup).get(lookfor)
|
||||
else:
|
||||
marketGroup = gamedata_session.query(MarketGroup).options(*processEager(eager)).filter(
|
||||
MarketGroup.ID == lookfor).first()
|
||||
MarketGroup.ID == lookfor).first()
|
||||
else:
|
||||
raise TypeError("Need integer as argument")
|
||||
return marketGroup
|
||||
@@ -224,7 +252,7 @@ def getItemsByCategory(filter, where=None, eager=None):
|
||||
|
||||
filter = processWhere(filter, where)
|
||||
return gamedata_session.query(Item).options(*processEager(eager)).join(Item.group, Group.category).filter(
|
||||
filter).all()
|
||||
filter).all()
|
||||
|
||||
|
||||
@cachedQuery(3, "where", "nameLike", "join")
|
||||
@@ -249,6 +277,22 @@ def searchItems(nameLike, where=None, join=None, eager=None):
|
||||
return items
|
||||
|
||||
|
||||
@cachedQuery(3, "where", "nameLike", "join")
|
||||
def searchSkills(nameLike, where=None, eager=None):
|
||||
if not isinstance(nameLike, basestring):
|
||||
raise TypeError("Need string as argument")
|
||||
|
||||
items = gamedata_session.query(Item).options(*processEager(eager)).join(Item.group, Group.category)
|
||||
for token in nameLike.split(' '):
|
||||
token_safe = u"%{0}%".format(sqlizeString(token))
|
||||
if where is not None:
|
||||
items = items.filter(and_(Item.name.like(token_safe, escape="\\"), Category.ID == 16, where))
|
||||
else:
|
||||
items = items.filter(and_(Item.name.like(token_safe, escape="\\"), Category.ID == 16))
|
||||
items = items.limit(100).all()
|
||||
return items
|
||||
|
||||
|
||||
@cachedQuery(2, "where", "itemids")
|
||||
def getVariations(itemids, groupIDs=None, where=None, eager=None):
|
||||
for itemid in itemids:
|
||||
@@ -262,7 +306,7 @@ def getVariations(itemids, groupIDs=None, where=None, eager=None):
|
||||
filter = processWhere(itemfilter, where)
|
||||
joinon = items_table.c.typeID == metatypes_table.c.typeID
|
||||
vars = gamedata_session.query(Item).options(*processEager(eager)).join((metatypes_table, joinon)).filter(
|
||||
filter).all()
|
||||
filter).all()
|
||||
|
||||
if vars:
|
||||
return vars
|
||||
@@ -271,7 +315,7 @@ def getVariations(itemids, groupIDs=None, where=None, eager=None):
|
||||
filter = processWhere(itemfilter, where)
|
||||
joinon = items_table.c.groupID == groups_table.c.groupID
|
||||
vars = gamedata_session.query(Item).options(*processEager(eager)).join((groups_table, joinon)).filter(
|
||||
filter).all()
|
||||
filter).all()
|
||||
|
||||
return vars
|
||||
|
||||
@@ -315,3 +359,25 @@ def directAttributeRequest(itemIDs, attrIDs):
|
||||
|
||||
result = gamedata_session.execute(q).fetchall()
|
||||
return result
|
||||
|
||||
|
||||
def getRequiredFor(itemID, attrMapping):
|
||||
Attribute1 = aliased(Attribute)
|
||||
Attribute2 = aliased(Attribute)
|
||||
|
||||
skillToLevelClauses = []
|
||||
|
||||
for attrSkill, attrLevel in attrMapping.iteritems():
|
||||
skillToLevelClauses.append(and_(Attribute1.attributeID == attrSkill, Attribute2.attributeID == attrLevel))
|
||||
|
||||
queryOr = or_(*skillToLevelClauses)
|
||||
|
||||
q = select((Attribute2.typeID, Attribute2.value),
|
||||
and_(Attribute1.value == itemID, queryOr),
|
||||
from_obj=[
|
||||
join(Attribute1, Attribute2, Attribute1.typeID == Attribute2.typeID)
|
||||
])
|
||||
|
||||
result = gamedata_session.execute(q).fetchall()
|
||||
|
||||
return result
|
||||
|
||||
@@ -29,5 +29,7 @@ groups_table = Table("dgmunits", gamedata_meta,
|
||||
Column("displayName", String))
|
||||
|
||||
mapper(Unit, groups_table,
|
||||
properties={"ID": synonym("unitID"),
|
||||
"name": synonym("unitName")})
|
||||
properties={
|
||||
"ID" : synonym("unitID"),
|
||||
"name": synonym("unitName")
|
||||
})
|
||||
|
||||
@@ -14,32 +14,32 @@ Migration 1
|
||||
import sqlalchemy
|
||||
|
||||
CONVERSIONS = {
|
||||
6135: [ # Scoped Cargo Scanner
|
||||
6135 : [ # Scoped Cargo Scanner
|
||||
6133, # Interior Type-E Cargo Identifier
|
||||
],
|
||||
6527: [ # Compact Ship Scanner
|
||||
6527 : [ # Compact Ship Scanner
|
||||
6525, # Ta3 Perfunctory Vessel Probe
|
||||
6529, # Speculative Ship Identifier I
|
||||
6531, # Practical Type-E Ship Probe
|
||||
],
|
||||
6569: [ # Scoped Survey Scanner
|
||||
6569 : [ # Scoped Survey Scanner
|
||||
6567, # ML-3 Amphilotite Mining Probe
|
||||
6571, # Rock-Scanning Sensor Array I
|
||||
6573, # 'Dactyl' Type-E Asteroid Analyzer
|
||||
],
|
||||
509: [ # 'Basic' Capacitor Flux Coil
|
||||
509 : [ # 'Basic' Capacitor Flux Coil
|
||||
8163, # Partial Power Plant Manager: Capacitor Flux
|
||||
8165, # Alpha Reactor Control: Capacitor Flux
|
||||
8167, # Type-E Power Core Modification: Capacitor Flux
|
||||
8169, # Marked Generator Refitting: Capacitor Flux
|
||||
],
|
||||
8135: [ # Restrained Capacitor Flux Coil
|
||||
8135 : [ # Restrained Capacitor Flux Coil
|
||||
8131, # Local Power Plant Manager: Capacitor Flux I
|
||||
],
|
||||
8133: [ # Compact Capacitor Flux Coil
|
||||
8133 : [ # Compact Capacitor Flux Coil
|
||||
8137, # Mark I Generator Refitting: Capacitor Flux
|
||||
],
|
||||
3469: [ # Basic Co-Processor
|
||||
3469 : [ # Basic Co-Processor
|
||||
8744, # Nanoelectrical Co-Processor
|
||||
8743, # Nanomechanical CPU Enhancer
|
||||
8746, # Quantum Co-Processor
|
||||
@@ -47,17 +47,17 @@ CONVERSIONS = {
|
||||
15425, # Naiyon's Modified Co-Processor (never existed but convert
|
||||
# anyway as some fits may include it)
|
||||
],
|
||||
8748: [ # Upgraded Co-Processor
|
||||
8748 : [ # Upgraded Co-Processor
|
||||
8747, # Nanomechanical CPU Enhancer I
|
||||
8750, # Quantum Co-Processor I
|
||||
8749, # Photonic CPU Enhancer I
|
||||
],
|
||||
1351: [ # Basic Reactor Control Unit
|
||||
1351 : [ # Basic Reactor Control Unit
|
||||
8251, # Partial Power Plant Manager: Reaction Control
|
||||
8253, # Alpha Reactor Control: Reaction Control
|
||||
8257, # Marked Generator Refitting: Reaction Control
|
||||
],
|
||||
8263: [ # Compact Reactor Control Unit
|
||||
8263 : [ # Compact Reactor Control Unit
|
||||
8259, # Local Power Plant Manager: Reaction Control I
|
||||
8265, # Mark I Generator Refitting: Reaction Control
|
||||
8261, # Beta Reactor Control: Reaction Control I
|
||||
@@ -69,15 +69,15 @@ CONVERSIONS = {
|
||||
31936: [ # Navy Micro Auxiliary Power Core
|
||||
16543, # Micro 'Vigor' Core Augmentation
|
||||
],
|
||||
8089: [ # Compact Light Missile Launcher
|
||||
8089 : [ # Compact Light Missile Launcher
|
||||
8093, # Prototype 'Arbalest' Light Missile Launcher
|
||||
],
|
||||
8091: [ # Ample Light Missile Launcher
|
||||
8091 : [ # Ample Light Missile Launcher
|
||||
7993, # Experimental TE-2100 Light Missile Launcher
|
||||
],
|
||||
# Surface Cargo Scanner I was removed from game, however no mention of
|
||||
# replacement module in patch notes. Morphing it to meta 0 module to be safe
|
||||
442: [ # Cargo Scanner I
|
||||
442 : [ # Cargo Scanner I
|
||||
6129, # Surface Cargo Scanner I
|
||||
]
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ CONVERSIONS = {
|
||||
22947: ( # 'Beatnik' Small Remote Armor Repairer
|
||||
23414, # 'Brotherhood' Small Remote Armor Repairer
|
||||
),
|
||||
8295: ( # Type-D Restrained Shield Flux Coil
|
||||
8295 : ( # Type-D Restrained Shield Flux Coil
|
||||
8293, # Beta Reactor Control: Shield Flux I
|
||||
),
|
||||
16499: ( # Heavy Knave Scoped Energy Nosferatu
|
||||
@@ -29,13 +29,13 @@ CONVERSIONS = {
|
||||
16447: ( # Medium Solace Scoped Remote Armor Repairer
|
||||
16445, # Medium 'Arup' Remote Armor Repairer
|
||||
),
|
||||
508: ( # 'Basic' Shield Flux Coil
|
||||
508 : ( # 'Basic' Shield Flux Coil
|
||||
8325, # Alpha Reactor Shield Flux
|
||||
8329, # Marked Generator Refitting: Shield Flux
|
||||
8323, # Partial Power Plant Manager: Shield Flux
|
||||
8327, # Type-E Power Core Modification: Shield Flux
|
||||
),
|
||||
1419: ( # 'Basic' Shield Power Relay
|
||||
1419 : ( # 'Basic' Shield Power Relay
|
||||
8341, # Alpha Reactor Shield Power Relay
|
||||
8345, # Marked Generator Refitting: Shield Power Relay
|
||||
8339, # Partial Power Plant Manager: Shield Power Relay
|
||||
@@ -47,57 +47,57 @@ CONVERSIONS = {
|
||||
16505: ( # Medium Ghoul Compact Energy Nosferatu
|
||||
16511, # Medium Diminishing Power System Drain I
|
||||
),
|
||||
8297: ( # Mark I Compact Shield Flux Coil
|
||||
8297 : ( # Mark I Compact Shield Flux Coil
|
||||
8291, # Local Power Plant Manager: Reaction Shield Flux I
|
||||
),
|
||||
16455: ( # Large Solace Scoped Remote Armor Repairer
|
||||
16453, # Large 'Arup' Remote Armor Repairer
|
||||
),
|
||||
6485: ( # M51 Benefactor Compact Shield Recharger
|
||||
6485 : ( # M51 Benefactor Compact Shield Recharger
|
||||
6491, # Passive Barrier Compensator I
|
||||
6489, # 'Benefactor' Ward Reconstructor
|
||||
6487, # Supplemental Screen Generator I
|
||||
),
|
||||
5137: ( # Small Knave Scoped Energy Nosferatu
|
||||
5137 : ( # Small Knave Scoped Energy Nosferatu
|
||||
5135, # E5 Prototype Energy Vampire
|
||||
),
|
||||
8579: ( # Medium Murky Compact Remote Shield Booster
|
||||
8579 : ( # Medium Murky Compact Remote Shield Booster
|
||||
8581, # Medium 'Atonement' Remote Shield Booster
|
||||
),
|
||||
8531: ( # Small Murky Compact Remote Shield Booster
|
||||
8531 : ( # Small Murky Compact Remote Shield Booster
|
||||
8533, # Small 'Atonement' Remote Shield Booster
|
||||
),
|
||||
16497: ( # Heavy Ghoul Compact Energy Nosferatu
|
||||
16503, # Heavy Diminishing Power System Drain I
|
||||
),
|
||||
4477: ( # Small Gremlin Compact Energy Neutralizer
|
||||
4477 : ( # Small Gremlin Compact Energy Neutralizer
|
||||
4475, # Small Unstable Power Fluctuator I
|
||||
),
|
||||
8337: ( # Mark I Compact Shield Power Relay
|
||||
8337 : ( # Mark I Compact Shield Power Relay
|
||||
8331, # Local Power Plant Manager: Reaction Shield Power Relay I
|
||||
),
|
||||
23416: ( # 'Peace' Large Remote Armor Repairer
|
||||
22951, # 'Pacifier' Large Remote Armor Repairer
|
||||
),
|
||||
5141: ( # Small Ghoul Compact Energy Nosferatu
|
||||
5141 : ( # Small Ghoul Compact Energy Nosferatu
|
||||
5139, # Small Diminishing Power System Drain I
|
||||
),
|
||||
4471: ( # Small Infectious Scoped Energy Neutralizer
|
||||
4471 : ( # Small Infectious Scoped Energy Neutralizer
|
||||
4473, # Small Rudimentary Energy Destabilizer I
|
||||
),
|
||||
16469: ( # Medium Infectious Scoped Energy Neutralizer
|
||||
16465, # Medium Rudimentary Energy Destabilizer I
|
||||
),
|
||||
8335: ( # Type-D Restrained Shield Power Relay
|
||||
8335 : ( # Type-D Restrained Shield Power Relay
|
||||
8333, # Beta Reactor Control: Shield Power Relay I
|
||||
),
|
||||
405: ( # 'Micro' Remote Shield Booster
|
||||
405 : ( # 'Micro' Remote Shield Booster
|
||||
8631, # Micro Asymmetric Remote Shield Booster
|
||||
8627, # Micro Murky Remote Shield Booster
|
||||
8629, # Micro 'Atonement' Remote Shield Booster
|
||||
8633, # Micro S95a Remote Shield Booster
|
||||
),
|
||||
8635: ( # Large Murky Compact Remote Shield Booster
|
||||
8635 : ( # Large Murky Compact Remote Shield Booster
|
||||
8637, # Large 'Atonement' Remote Shield Booster
|
||||
),
|
||||
16507: ( # Medium Knave Scoped Energy Nosferatu
|
||||
|
||||
@@ -13,26 +13,26 @@ CONVERSIONS = {
|
||||
16461, # Multiphasic Bolt Array I
|
||||
16463, # 'Pandemonium' Ballistic Enhancement
|
||||
),
|
||||
5281: ( # Coadjunct Scoped Remote Sensor Booster
|
||||
5281 : ( # Coadjunct Scoped Remote Sensor Booster
|
||||
7218, # Piercing ECCM Emitter I
|
||||
),
|
||||
5365: ( # Cetus Scoped Burst Jammer
|
||||
5365 : ( # Cetus Scoped Burst Jammer
|
||||
5359, # 1Z-3 Subversive ECM Eruption
|
||||
),
|
||||
1973: ( # Sensor Booster I
|
||||
1973 : ( # Sensor Booster I
|
||||
1947, # ECCM - Radar I
|
||||
2002, # ECCM - Ladar I
|
||||
2003, # ECCM - Magnetometric I
|
||||
2004, # ECCM - Gravimetric I
|
||||
2005, # ECCM - Omni I
|
||||
),
|
||||
1951: ( # 'Basic' Tracking Enhancer
|
||||
1951 : ( # 'Basic' Tracking Enhancer
|
||||
6322, # Beta-Nought Tracking Mode
|
||||
6323, # Azimuth Descalloping Tracking Enhancer
|
||||
6324, # F-AQ Delay-Line Scan Tracking Subroutines
|
||||
6321, # Beam Parallax Tracking Program
|
||||
),
|
||||
521: ( # 'Basic' Damage Control
|
||||
521 : ( # 'Basic' Damage Control
|
||||
5829, # GLFF Containment Field
|
||||
5831, # Interior Force Field Array
|
||||
5835, # F84 Local Damage System
|
||||
@@ -42,13 +42,13 @@ CONVERSIONS = {
|
||||
22939, # 'Boss' Remote Sensor Booster
|
||||
22941, # 'Entrepreneur' Remote Sensor Booster
|
||||
),
|
||||
5443: ( # Faint Epsilon Scoped Warp Scrambler
|
||||
5443 : ( # Faint Epsilon Scoped Warp Scrambler
|
||||
5441, # Fleeting Progressive Warp Scrambler I
|
||||
),
|
||||
1963: ( # Remote Sensor Booster I
|
||||
1963 : ( # Remote Sensor Booster I
|
||||
1959, # ECCM Projector I
|
||||
),
|
||||
6325: ( # Fourier Compact Tracking Enhancer
|
||||
6325 : ( # Fourier Compact Tracking Enhancer
|
||||
6326, # Sigma-Nought Tracking Mode I
|
||||
6327, # Auto-Gain Control Tracking Enhancer I
|
||||
6328, # F-aQ Phase Code Tracking Subroutines
|
||||
@@ -68,19 +68,19 @@ CONVERSIONS = {
|
||||
22919: ( # 'Monopoly' Magnetic Field Stabilizer
|
||||
22917, # 'Capitalist' Magnetic Field Stabilizer I
|
||||
),
|
||||
5839: ( # IFFA Compact Damage Control
|
||||
5839 : ( # IFFA Compact Damage Control
|
||||
5841, # Emergency Damage Control I
|
||||
5843, # F85 Peripheral Damage System I
|
||||
5837, # Pseudoelectron Containment Field I
|
||||
),
|
||||
522: ( # 'Micro' Cap Battery
|
||||
522 : ( # 'Micro' Cap Battery
|
||||
4747, # Micro Ld-Acid Capacitor Battery I
|
||||
4751, # Micro Ohm Capacitor Reserve I
|
||||
4745, # Micro F-4a Ld-Sulfate Capacitor Charge Unit
|
||||
4749, # Micro Peroxide Capacitor Power Cell
|
||||
3480, # Micro Capacitor Battery II
|
||||
),
|
||||
518: ( # 'Basic' Gyrostabilizer
|
||||
518 : ( # 'Basic' Gyrostabilizer
|
||||
5915, # Lateral Gyrostabilizer
|
||||
5919, # F-M2 Weapon Inertial Suspensor
|
||||
5913, # Hydraulic Stabilization Actuator
|
||||
@@ -89,19 +89,19 @@ CONVERSIONS = {
|
||||
19931: ( # Compulsive Scoped Multispectral ECM
|
||||
19933, # 'Hypnos' Multispectral ECM I
|
||||
),
|
||||
5403: ( # Faint Scoped Warp Disruptor
|
||||
5403 : ( # Faint Scoped Warp Disruptor
|
||||
5401, # Fleeting Warp Disruptor I
|
||||
),
|
||||
23902: ( # 'Trebuchet' Heat Sink I
|
||||
23900, # 'Mangonel' Heat Sink I
|
||||
),
|
||||
1893: ( # 'Basic' Heat Sink
|
||||
1893 : ( # 'Basic' Heat Sink
|
||||
5845, # Heat Exhaust System
|
||||
5856, # C3S Convection Thermal Radiator
|
||||
5855, # 'Boreas' Coolant System
|
||||
5854, # Stamped Heat Sink
|
||||
),
|
||||
6160: ( # F-90 Compact Sensor Booster
|
||||
6160 : ( # F-90 Compact Sensor Booster
|
||||
20214, # Extra Radar ECCM Scanning Array I
|
||||
20220, # Extra Ladar ECCM Scanning Array I
|
||||
20226, # Extra Gravimetric ECCM Scanning Array I
|
||||
@@ -123,40 +123,40 @@ CONVERSIONS = {
|
||||
19952: ( # Umbra Scoped Radar ECM
|
||||
9520, # 'Penumbra' White Noise ECM
|
||||
),
|
||||
1952: ( # Sensor Booster II
|
||||
1952 : ( # Sensor Booster II
|
||||
2258, # ECCM - Omni II
|
||||
2259, # ECCM - Gravimetric II
|
||||
2260, # ECCM - Ladar II
|
||||
2261, # ECCM - Magnetometric II
|
||||
2262, # ECCM - Radar II
|
||||
),
|
||||
5282: ( # Linked Enduring Sensor Booster
|
||||
5282 : ( # Linked Enduring Sensor Booster
|
||||
7219, # Scattering ECCM Projector I
|
||||
),
|
||||
1986: ( # Signal Amplifier I
|
||||
1986 : ( # Signal Amplifier I
|
||||
2579, # Gravimetric Backup Array I
|
||||
2583, # Ladar Backup Array I
|
||||
2587, # Magnetometric Backup Array I
|
||||
2591, # Multi Sensor Backup Array I
|
||||
4013, # RADAR Backup Array I
|
||||
),
|
||||
4871: ( # Large Compact Pb-Acid Cap Battery
|
||||
4871 : ( # Large Compact Pb-Acid Cap Battery
|
||||
4875, # Large Ohm Capacitor Reserve I
|
||||
4869, # Large F-4a Ld-Sulfate Capacitor Charge Unit
|
||||
4873, # Large Peroxide Capacitor Power Cell
|
||||
),
|
||||
1964: ( # Remote Sensor Booster II
|
||||
1964 : ( # Remote Sensor Booster II
|
||||
1960, # ECCM Projector II
|
||||
),
|
||||
5933: ( # Counterbalanced Compact Gyrostabilizer
|
||||
5933 : ( # Counterbalanced Compact Gyrostabilizer
|
||||
5931, # Cross-Lateral Gyrostabilizer I
|
||||
5935, # F-M3 Munition Inertial Suspensor
|
||||
5929, # Pneumatic Stabilization Actuator I
|
||||
),
|
||||
4025: ( # X5 Enduring Stasis Webifier
|
||||
4025 : ( # X5 Enduring Stasis Webifier
|
||||
4029, # 'Langour' Drive Disruptor I
|
||||
),
|
||||
4027: ( # Fleeting Compact Stasis Webifier
|
||||
4027 : ( # Fleeting Compact Stasis Webifier
|
||||
4031, # Patterned Stasis Web I
|
||||
),
|
||||
22937: ( # 'Enterprise' Remote Tracking Computer
|
||||
@@ -165,7 +165,7 @@ CONVERSIONS = {
|
||||
22929: ( # 'Marketeer' Tracking Computer
|
||||
22927, # 'Economist' Tracking Computer I
|
||||
),
|
||||
1987: ( # Signal Amplifier II
|
||||
1987 : ( # Signal Amplifier II
|
||||
2580, # Gravimetric Backup Array II
|
||||
2584, # Ladar Backup Array II
|
||||
2588, # Magnetometric Backup Array II
|
||||
@@ -175,13 +175,13 @@ CONVERSIONS = {
|
||||
19939: ( # Enfeebling Scoped Ladar ECM
|
||||
9522, # Faint Phase Inversion ECM I
|
||||
),
|
||||
5340: ( # P-S Compact Remote Tracking Computer
|
||||
5340 : ( # P-S Compact Remote Tracking Computer
|
||||
5341, # 'Prayer' Remote Tracking Computer
|
||||
),
|
||||
19814: ( # Phased Scoped Target Painter
|
||||
19808, # Partial Weapon Navigation
|
||||
),
|
||||
1949: ( # 'Basic' Signal Amplifier
|
||||
1949 : ( # 'Basic' Signal Amplifier
|
||||
1946, # Basic RADAR Backup Array
|
||||
1982, # Basic Ladar Backup Array
|
||||
1983, # Basic Gravimetric Backup Array
|
||||
@@ -222,10 +222,10 @@ CONVERSIONS = {
|
||||
23416: ( # 'Peace' Large Remote Armor Repairer
|
||||
None, # 'Pacifier' Large Remote Armor Repairer
|
||||
),
|
||||
6176: ( # F-12 Enduring Tracking Computer
|
||||
6176 : ( # F-12 Enduring Tracking Computer
|
||||
6174, # Monopulse Tracking Mechanism I
|
||||
),
|
||||
6159: ( # Alumel-Wired Enduring Sensor Booster
|
||||
6159 : ( # Alumel-Wired Enduring Sensor Booster
|
||||
7917, # Alumel Radar ECCM Sensor Array I
|
||||
7918, # Alumel Ladar ECCM Sensor Array I
|
||||
7922, # Alumel Gravimetric ECCM Sensor Array I
|
||||
@@ -247,7 +247,7 @@ CONVERSIONS = {
|
||||
7914, # Prototype ECCM Magnetometric Sensor Cluster
|
||||
6158, # Prototype Sensor Booster
|
||||
),
|
||||
5849: ( # Extruded Compact Heat Sink
|
||||
5849 : ( # Extruded Compact Heat Sink
|
||||
5846, # Thermal Exhaust System I
|
||||
5858, # C4S Coiled Circuit Thermal Radiator
|
||||
5857, # 'Skadi' Coolant System I
|
||||
@@ -263,15 +263,15 @@ CONVERSIONS = {
|
||||
22945: ( # 'Executive' Remote Sensor Dampener
|
||||
22943, # 'Broker' Remote Sensor Dampener I
|
||||
),
|
||||
6173: ( # Optical Compact Tracking Computer
|
||||
6173 : ( # Optical Compact Tracking Computer
|
||||
6175, # 'Orion' Tracking CPU I
|
||||
),
|
||||
5279: ( # F-23 Compact Remote Sensor Booster
|
||||
5279 : ( # F-23 Compact Remote Sensor Booster
|
||||
7217, # Spot Pulsing ECCM I
|
||||
7220, # Phased Muon ECCM Caster I
|
||||
5280, # Connected Remote Sensor Booster
|
||||
),
|
||||
4787: ( # Small Compact Pb-Acid Cap Battery
|
||||
4787 : ( # Small Compact Pb-Acid Cap Battery
|
||||
4791, # Small Ohm Capacitor Reserve I
|
||||
4785, # Small F-4a Ld-Sulfate Capacitor Charge Unit
|
||||
4789, # Small Peroxide Capacitor Power Cell
|
||||
@@ -279,7 +279,7 @@ CONVERSIONS = {
|
||||
19946: ( # BZ-5 Scoped Gravimetric ECM
|
||||
9519, # FZ-3 Subversive Spatial Destabilizer ECM
|
||||
),
|
||||
6073: ( # Medium Compact Pb-Acid Cap Battery
|
||||
6073 : ( # Medium Compact Pb-Acid Cap Battery
|
||||
6097, # Medium Ohm Capacitor Reserve I
|
||||
6111, # Medium F-4a Ld-Sulfate Capacitor Charge Unit
|
||||
6083, # Medium Peroxide Capacitor Power Cell
|
||||
@@ -287,7 +287,7 @@ CONVERSIONS = {
|
||||
21484: ( # 'Full Duplex' Ballistic Control System
|
||||
21482, # Ballistic 'Purge' Targeting System I
|
||||
),
|
||||
6296: ( # F-89 Compact Signal Amplifier
|
||||
6296 : ( # F-89 Compact Signal Amplifier
|
||||
6218, # Protected Gravimetric Backup Cluster I
|
||||
6222, # Protected Ladar Backup Cluster I
|
||||
6226, # Protected Magnetometric Backup Cluster I
|
||||
@@ -324,7 +324,7 @@ CONVERSIONS = {
|
||||
6293, # Wavelength Signal Enhancer I
|
||||
6295, # Type-D Attenuation Signal Augmentation
|
||||
),
|
||||
5302: ( # Phased Muon Scoped Sensor Dampener
|
||||
5302 : ( # Phased Muon Scoped Sensor Dampener
|
||||
5300, # Indirect Scanning Dampening Unit I
|
||||
),
|
||||
}
|
||||
|
||||
45
eos/db/migrations/upgrade22.py
Normal file
45
eos/db/migrations/upgrade22.py
Normal file
@@ -0,0 +1,45 @@
|
||||
"""
|
||||
Migration 22
|
||||
|
||||
- Adds the created and modified fields to most tables
|
||||
"""
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
|
||||
# 1 = created only
|
||||
# 2 = created and modified
|
||||
tables = {
|
||||
"boosters": 2,
|
||||
"cargo": 2,
|
||||
"characters": 2,
|
||||
"crest": 1,
|
||||
"damagePatterns": 2,
|
||||
"drones": 2,
|
||||
"fighters": 2,
|
||||
"fits": 2,
|
||||
"projectedFits": 2,
|
||||
"commandFits": 2,
|
||||
"implants": 2,
|
||||
"implantSets": 2,
|
||||
"modules": 2,
|
||||
"overrides": 2,
|
||||
"characterSkills": 2,
|
||||
"targetResists": 2
|
||||
}
|
||||
|
||||
for table in tables.keys():
|
||||
|
||||
# midnight brain, there's probably a much more simple way to do this, but fuck it
|
||||
if tables[table] > 0:
|
||||
try:
|
||||
saveddata_engine.execute("SELECT created FROM {0} LIMIT 1;".format(table))
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE {} ADD COLUMN created DATETIME;".format(table))
|
||||
|
||||
if tables[table] > 1:
|
||||
try:
|
||||
saveddata_engine.execute("SELECT modified FROM {0} LIMIT 1;".format(table))
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE {} ADD COLUMN modified DATETIME;".format(table))
|
||||
13
eos/db/migrations/upgrade23.py
Normal file
13
eos/db/migrations/upgrade23.py
Normal file
@@ -0,0 +1,13 @@
|
||||
"""
|
||||
Migration 23
|
||||
|
||||
- Adds a sec status field to the character table
|
||||
"""
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
try:
|
||||
saveddata_engine.execute("SELECT secStatus FROM characters LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE characters ADD COLUMN secStatus FLOAT;")
|
||||
14
eos/db/migrations/upgrade24.py
Normal file
14
eos/db/migrations/upgrade24.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""
|
||||
Migration 24
|
||||
|
||||
- Adds a boolean value to fit to signify if fit should ignore restrictions
|
||||
"""
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
try:
|
||||
saveddata_engine.execute("SELECT ignoreRestrictions FROM fits LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN ignoreRestrictions BOOLEAN")
|
||||
saveddata_engine.execute("UPDATE fits SET ignoreRestrictions = 0")
|
||||
@@ -11,64 +11,64 @@ Migration 4
|
||||
"""
|
||||
|
||||
CONVERSIONS = {
|
||||
506: ( # 'Basic' Capacitor Power Relay
|
||||
506 : ( # 'Basic' Capacitor Power Relay
|
||||
8205, # Alpha Reactor Control: Capacitor Power Relay
|
||||
8209, # Marked Generator Refitting: Capacitor Power Relay
|
||||
8203, # Partial Power Plant Manager: Capacity Power Relay
|
||||
8207, # Type-E Power Core Modification: Capacitor Power Relay
|
||||
),
|
||||
8177: ( # Mark I Compact Capacitor Power Relay
|
||||
8177 : ( # Mark I Compact Capacitor Power Relay
|
||||
8173, # Beta Reactor Control: Capacitor Power Relay I
|
||||
),
|
||||
8175: ( # Type-D Restrained Capacitor Power Relay
|
||||
8175 : ( # Type-D Restrained Capacitor Power Relay
|
||||
8171, # Local Power Plant Manager: Capacity Power Relay I
|
||||
),
|
||||
|
||||
421: ( # 'Basic' Capacitor Recharger
|
||||
421 : ( # 'Basic' Capacitor Recharger
|
||||
4425, # AGM Capacitor Charge Array,
|
||||
4421, # F-a10 Buffer Capacitor Regenerator
|
||||
4423, # Industrial Capacitor Recharger
|
||||
4427, # Secondary Parallel Link-Capacitor
|
||||
),
|
||||
4435: ( # Eutectic Compact Cap Recharger
|
||||
4435 : ( # Eutectic Compact Cap Recharger
|
||||
4433, # Barton Reactor Capacitor Recharger I
|
||||
4431, # F-b10 Nominal Capacitor Regenerator
|
||||
4437, # Fixed Parallel Link-Capacitor I
|
||||
),
|
||||
|
||||
1315: ( # 'Basic' Expanded Cargohold
|
||||
1315 : ( # 'Basic' Expanded Cargohold
|
||||
5483, # Alpha Hull Mod Expanded Cargo
|
||||
5479, # Marked Modified SS Expanded Cargo
|
||||
5481, # Partial Hull Conversion Expanded Cargo
|
||||
5485, # Type-E Altered SS Expanded Cargo
|
||||
),
|
||||
5493: ( # Type-D Restrained Expanded Cargo
|
||||
5493 : ( # Type-D Restrained Expanded Cargo
|
||||
5491, # Beta Hull Mod Expanded Cargo
|
||||
5489, # Local Hull Conversion Expanded Cargo I
|
||||
5487, # Mark I Modified SS Expanded Cargo
|
||||
),
|
||||
|
||||
1401: ( # 'Basic' Inertial Stabilizers
|
||||
1401 : ( # 'Basic' Inertial Stabilizers
|
||||
5523, # Alpha Hull Mod Inertial Stabilizers
|
||||
5521, # Partial Hull Conversion Inertial Stabilizers
|
||||
5525, # Type-E Altered SS Inertial Stabilizers
|
||||
),
|
||||
5533: ( # Type-D Restrained Inertial Stabilizers
|
||||
5533 : ( # Type-D Restrained Inertial Stabilizers
|
||||
5531, # Beta Hull Mod Inertial Stabilizers
|
||||
5529, # Local Hull Conversion Inertial Stabilizers I
|
||||
5527, # Mark I Modified SS Inertial Stabilizers
|
||||
5519, # Marked Modified SS Inertial Stabilizers
|
||||
),
|
||||
|
||||
5239: ( # EP-S Gaussian Scoped Mining Laser
|
||||
5239 : ( # EP-S Gaussian Scoped Mining Laser
|
||||
5241, # Dual Diode Mining Laser I
|
||||
),
|
||||
5233: ( # Single Diode Basic Mining Laser
|
||||
5233 : ( # Single Diode Basic Mining Laser
|
||||
5231, # EP-R Argon Ion Basic Excavation Pulse
|
||||
5237, # Rubin Basic Particle Bore Stream
|
||||
5235, # Xenon Basic Drilling Beam
|
||||
),
|
||||
5245: ( # Particle Bore Compact Mining Laser
|
||||
5245 : ( # Particle Bore Compact Mining Laser
|
||||
5243, # XeCl Drilling Beam I
|
||||
),
|
||||
|
||||
@@ -79,53 +79,53 @@ CONVERSIONS = {
|
||||
22609, # Erin Mining Laser Upgrade
|
||||
),
|
||||
|
||||
1242: ( # 'Basic' Nanofiber Internal Structure
|
||||
1242 : ( # 'Basic' Nanofiber Internal Structure
|
||||
5591, # Alpha Hull Mod Nanofiber Structure
|
||||
5595, # Marked Modified SS Nanofiber Structure
|
||||
5559, # Partial Hull Conversion Nanofiber Structure
|
||||
5593, # Type-E Altered SS Nanofiber Structure
|
||||
),
|
||||
5599: ( # Type-D Restrained Nanofiber Structure
|
||||
5599 : ( # Type-D Restrained Nanofiber Structure
|
||||
5597, # Beta Hull Mod Nanofiber Structure
|
||||
5561, # Local Hull Conversion Nanofiber Structure I
|
||||
5601, # Mark I Modified SS Nanofiber Structure
|
||||
),
|
||||
|
||||
1192: ( # 'Basic' Overdrive Injector System
|
||||
1192 : ( # 'Basic' Overdrive Injector System
|
||||
5613, # Alpha Hull Mod Overdrive Injector
|
||||
5617, # Marked Modified SS Overdrive Injector
|
||||
5611, # Partial Hull Conversion Overdrive Injector
|
||||
5615, # Type-E Altered SS Overdrive Injector
|
||||
),
|
||||
5631: ( # Type-D Restrained Overdrive Injector
|
||||
5631 : ( # Type-D Restrained Overdrive Injector
|
||||
5629, # Beta Hull Mod Overdrive Injector
|
||||
5627, # Local Hull Conversion Overdrive Injector I
|
||||
5633, # Mark I Modified SS Overdrive Injector
|
||||
),
|
||||
|
||||
1537: ( # 'Basic' Power Diagnostic System
|
||||
1537 : ( # 'Basic' Power Diagnostic System
|
||||
8213, # Alpha Reactor Control: Diagnostic System
|
||||
8217, # Marked Generator Refitting: Diagnostic System
|
||||
8211, # Partial Power Plant Manager: Diagnostic System
|
||||
8215, # Type-E Power Core Modification: Diagnostic System
|
||||
8255, # Type-E Power Core Modification: Reaction Control
|
||||
),
|
||||
8225: ( # Mark I Compact Power Diagnostic System
|
||||
8225 : ( # Mark I Compact Power Diagnostic System
|
||||
8221, # Beta Reactor Control: Diagnostic System I
|
||||
8219, # Local Power Plant Manager: Diagnostic System I
|
||||
8223, # Type-D Power Core Modification: Diagnostic System
|
||||
),
|
||||
|
||||
1240: ( # 'Basic' Reinforced Bulkheads
|
||||
1240 : ( # 'Basic' Reinforced Bulkheads
|
||||
5677, # Alpha Hull Mod Reinforced Bulkheads
|
||||
5681, # Marked Modified SS Reinforced Bulkheads
|
||||
5675, # Partial Hull Conversion Reinforced Bulkheads
|
||||
5679, # Type-E Altered SS Reinforced Bulkheads
|
||||
),
|
||||
5649: ( # Mark I Compact Reinforced Bulkheads
|
||||
5649 : ( # Mark I Compact Reinforced Bulkheads
|
||||
5645, # Beta Hull Mod Reinforced Bulkheads
|
||||
),
|
||||
5647: ( # Type-D Restrained Reinforced Bulkheads
|
||||
5647 : ( # Type-D Restrained Reinforced Bulkheads
|
||||
5643, # Local Hull Conversion Reinforced Bulkheads I
|
||||
),
|
||||
}
|
||||
|
||||
@@ -8,16 +8,16 @@ Migration 8
|
||||
"""
|
||||
|
||||
CONVERSIONS = {
|
||||
8529: ( # Large F-S9 Regolith Compact Shield Extender
|
||||
8529 : ( # Large F-S9 Regolith Compact Shield Extender
|
||||
8409, # Large Subordinate Screen Stabilizer I
|
||||
),
|
||||
8419: ( # Large Azeotropic Restrained Shield Extender
|
||||
8419 : ( # Large Azeotropic Restrained Shield Extender
|
||||
8489, # Large Supplemental Barrier Emitter I
|
||||
),
|
||||
8517: ( # Medium F-S9 Regolith Compact Shield Extender
|
||||
8517 : ( # Medium F-S9 Regolith Compact Shield Extender
|
||||
8397, # Medium Subordinate Screen Stabilizer I
|
||||
),
|
||||
8433: ( # Medium Azeotropic Restrained Shield Extender
|
||||
8433 : ( # Medium Azeotropic Restrained Shield Extender
|
||||
8477, # Medium Supplemental Barrier Emitter I
|
||||
),
|
||||
20627: ( # Small 'Trapper' Shield Extender
|
||||
@@ -28,10 +28,10 @@ CONVERSIONS = {
|
||||
8387, # Micro Subordinate Screen Stabilizer I
|
||||
8465, # Micro Supplemental Barrier Emitter I
|
||||
),
|
||||
8521: ( # Small F-S9 Regolith Compact Shield Extender
|
||||
8521 : ( # Small F-S9 Regolith Compact Shield Extender
|
||||
8401, # Small Subordinate Screen Stabilizer I
|
||||
),
|
||||
8427: ( # Small Azeotropic Restrained Shield Extender
|
||||
8427 : ( # Small Azeotropic Restrained Shield Extender
|
||||
8481, # Small Supplemental Barrier Emitter I
|
||||
),
|
||||
11343: ( # 100mm Crystalline Carbonide Restrained Plates
|
||||
|
||||
@@ -20,6 +20,6 @@ CREATE TABLE boostersTemp (
|
||||
def upgrade(saveddata_engine):
|
||||
saveddata_engine.execute(tmpTable)
|
||||
saveddata_engine.execute(
|
||||
"INSERT INTO boostersTemp (ID, itemID, fitID, active) SELECT ID, itemID, fitID, active FROM boosters")
|
||||
"INSERT INTO boostersTemp (ID, itemID, fitID, active) SELECT ID, itemID, fitID, active FROM boosters")
|
||||
saveddata_engine.execute("DROP TABLE boosters")
|
||||
saveddata_engine.execute("ALTER TABLE boostersTemp RENAME TO boosters")
|
||||
|
||||
@@ -17,18 +17,21 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, ForeignKey, Integer, Boolean
|
||||
from sqlalchemy import Table, Column, ForeignKey, Integer, Boolean, DateTime
|
||||
from sqlalchemy.ext.associationproxy import association_proxy
|
||||
from sqlalchemy.orm import mapper, relation
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.booster import Booster
|
||||
|
||||
boosters_table = Table("boosters", saveddata_meta,
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("itemID", Integer),
|
||||
Column("fitID", Integer, ForeignKey("fits.ID"), nullable=False),
|
||||
Column("active", Boolean),
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("itemID", Integer),
|
||||
Column("fitID", Integer, ForeignKey("fits.ID"), nullable=False),
|
||||
Column("active", Boolean),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now),
|
||||
)
|
||||
|
||||
# Legacy booster side effect code, should disable but a mapper relies on it.
|
||||
|
||||
@@ -17,16 +17,25 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey
|
||||
from sqlalchemy.orm import mapper
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, DateTime
|
||||
from sqlalchemy.orm import mapper, relation
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.cargo import Cargo
|
||||
from eos.saveddata.fit import Fit
|
||||
|
||||
cargo_table = Table("cargo", saveddata_meta,
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("fitID", Integer, ForeignKey("fits.ID"), nullable=False, index=True),
|
||||
Column("itemID", Integer, nullable=False),
|
||||
Column("amount", Integer, nullable=False))
|
||||
Column("amount", Integer, nullable=False),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now),
|
||||
)
|
||||
|
||||
mapper(Cargo, cargo_table)
|
||||
mapper(Cargo, cargo_table,
|
||||
properties={
|
||||
"owner": relation(Fit)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, String
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, String, DateTime, Float
|
||||
from sqlalchemy.orm import relation, mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.db.saveddata.implant import charImplants_table
|
||||
@@ -36,27 +37,31 @@ characters_table = Table("characters", saveddata_meta,
|
||||
Column("chars", String, nullable=True),
|
||||
Column("defaultLevel", Integer, nullable=True),
|
||||
Column("alphaCloneID", Integer, nullable=True),
|
||||
Column("ownerID", ForeignKey("users.ID"), nullable=True))
|
||||
Column("ownerID", ForeignKey("users.ID"), nullable=True),
|
||||
Column("secStatus", Float, nullable=True, default=0.0),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now))
|
||||
|
||||
mapper(Character, characters_table,
|
||||
properties={
|
||||
"_Character__alphaCloneID": characters_table.c.alphaCloneID,
|
||||
"savedName": characters_table.c.name,
|
||||
"_Character__owner": relation(
|
||||
User,
|
||||
backref="characters"),
|
||||
"_Character__skills": relation(
|
||||
Skill,
|
||||
backref="character",
|
||||
cascade="all,delete-orphan"),
|
||||
"_Character__implants": relation(
|
||||
Implant,
|
||||
collection_class=HandledImplantBoosterList,
|
||||
cascade='all,delete-orphan',
|
||||
backref='character',
|
||||
single_parent=True,
|
||||
primaryjoin=charImplants_table.c.charID == characters_table.c.ID,
|
||||
secondaryjoin=charImplants_table.c.implantID == Implant.ID,
|
||||
secondary=charImplants_table),
|
||||
"savedName" : characters_table.c.name,
|
||||
"_Character__secStatus": characters_table.c.secStatus,
|
||||
"_Character__owner" : relation(
|
||||
User,
|
||||
backref="characters"),
|
||||
"_Character__skills" : relation(
|
||||
Skill,
|
||||
backref="character",
|
||||
cascade="all,delete-orphan"),
|
||||
"_Character__implants" : relation(
|
||||
Implant,
|
||||
collection_class=HandledImplantBoosterList,
|
||||
cascade='all,delete-orphan',
|
||||
backref='character',
|
||||
single_parent=True,
|
||||
primaryjoin=charImplants_table.c.charID == characters_table.c.ID,
|
||||
secondaryjoin=charImplants_table.c.implantID == Implant.ID,
|
||||
secondary=charImplants_table),
|
||||
}
|
||||
)
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, String
|
||||
from sqlalchemy import Table, Column, Integer, String, DateTime
|
||||
from sqlalchemy.orm import mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.crestchar import CrestChar
|
||||
@@ -26,6 +27,8 @@ from eos.saveddata.crestchar import CrestChar
|
||||
crest_table = Table("crest", saveddata_meta,
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("name", String, nullable=False, unique=True),
|
||||
Column("refresh_token", String, nullable=False))
|
||||
Column("refresh_token", String, nullable=False),
|
||||
# These records aren't updated. Instead, they are dropped and created, hence we don't have a modified field
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now))
|
||||
|
||||
mapper(CrestChar, crest_table)
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, String
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, String, DateTime
|
||||
from sqlalchemy.orm import mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.damagePattern import DamagePattern
|
||||
@@ -30,6 +31,9 @@ damagePatterns_table = Table("damagePatterns", saveddata_meta,
|
||||
Column("thermalAmount", Integer),
|
||||
Column("kineticAmount", Integer),
|
||||
Column("explosiveAmount", Integer),
|
||||
Column("ownerID", ForeignKey("users.ID"), nullable=True))
|
||||
Column("ownerID", ForeignKey("users.ID"), nullable=True),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
mapper(DamagePattern, damagePatterns_table)
|
||||
|
||||
@@ -168,7 +168,7 @@ class DatabaseCleanup(object):
|
||||
for table in ['drones', 'cargo', 'fighters']:
|
||||
pyfalog.debug("Running database cleanup for orphaned {0} items.", table)
|
||||
query = "SELECT COUNT(*) AS num FROM {} WHERE itemID IS NULL OR itemID = '' or itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format(
|
||||
table)
|
||||
table)
|
||||
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
|
||||
if results is None:
|
||||
@@ -178,14 +178,14 @@ class DatabaseCleanup(object):
|
||||
|
||||
if row and row['num']:
|
||||
query = "DELETE FROM {} WHERE itemID IS NULL OR itemID = '' or itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format(
|
||||
table)
|
||||
table)
|
||||
delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
pyfalog.error("Database corruption found. Cleaning up {0} records.", delete.rowcount)
|
||||
|
||||
for table in ['modules']:
|
||||
pyfalog.debug("Running database cleanup for orphaned {0} items.", table)
|
||||
query = "SELECT COUNT(*) AS num FROM {} WHERE itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format(
|
||||
table)
|
||||
table)
|
||||
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
|
||||
if results is None:
|
||||
@@ -216,7 +216,7 @@ class DatabaseCleanup(object):
|
||||
|
||||
if row and row['num']:
|
||||
query = "UPDATE '{0}' SET '{1}Amount' = '0' WHERE {1}Amount IS NULL OR {1}Amount = ''".format(profileType,
|
||||
damageType)
|
||||
damageType)
|
||||
delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
pyfalog.error("Database corruption found. Cleaning up {0} records.", delete.rowcount)
|
||||
|
||||
|
||||
@@ -17,11 +17,13 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, Boolean
|
||||
from sqlalchemy.orm import mapper
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, Boolean, DateTime
|
||||
from sqlalchemy.orm import mapper, relation
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.fit import Fit
|
||||
|
||||
drones_table = Table("drones", saveddata_meta,
|
||||
Column("groupID", Integer, primary_key=True),
|
||||
@@ -29,6 +31,13 @@ drones_table = Table("drones", saveddata_meta,
|
||||
Column("itemID", Integer, nullable=False),
|
||||
Column("amount", Integer, nullable=False),
|
||||
Column("amountActive", Integer, nullable=False),
|
||||
Column("projected", Boolean, default=False))
|
||||
Column("projected", Boolean, default=False),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
mapper(Drone, drones_table)
|
||||
mapper(Drone, drones_table,
|
||||
properties={
|
||||
"owner": relation(Fit)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, Boolean
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, Boolean, DateTime
|
||||
from sqlalchemy.orm import mapper, relation
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.fighterAbility import FighterAbility
|
||||
@@ -31,7 +32,10 @@ fighters_table = Table("fighters", saveddata_meta,
|
||||
Column("itemID", Integer, nullable=False),
|
||||
Column("active", Boolean, nullable=True),
|
||||
Column("amount", Integer, nullable=False),
|
||||
Column("projected", Boolean, default=False))
|
||||
Column("projected", Boolean, default=False),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
fighter_abilities_table = Table("fightersAbilities", saveddata_meta,
|
||||
Column("groupID", Integer, ForeignKey("fighters.groupID"), primary_key=True,
|
||||
@@ -41,11 +45,11 @@ fighter_abilities_table = Table("fightersAbilities", saveddata_meta,
|
||||
|
||||
mapper(Fighter, fighters_table,
|
||||
properties={
|
||||
"owner": relation(Fit),
|
||||
"owner" : relation(Fit),
|
||||
"_Fighter__abilities": relation(
|
||||
FighterAbility,
|
||||
backref="fighter",
|
||||
cascade='all, delete, delete-orphan'),
|
||||
FighterAbility,
|
||||
backref="fighter",
|
||||
cascade='all, delete, delete-orphan'),
|
||||
})
|
||||
|
||||
mapper(FighterAbility, fighter_abilities_table)
|
||||
|
||||
@@ -21,7 +21,8 @@ from sqlalchemy.ext.associationproxy import association_proxy
|
||||
from sqlalchemy.orm.collections import attribute_mapped_collection
|
||||
from sqlalchemy.sql import and_
|
||||
from sqlalchemy.orm import relation, reconstructor, mapper, relationship
|
||||
from sqlalchemy import ForeignKey, Column, Integer, String, Table, Boolean
|
||||
from sqlalchemy import ForeignKey, Column, Integer, String, Table, Boolean, DateTime
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.db import saveddata_session
|
||||
@@ -57,6 +58,9 @@ fits_table = Table("fits", saveddata_meta,
|
||||
Column("modeID", Integer, nullable=True),
|
||||
Column("implantLocation", Integer, nullable=False, default=ImplantLocation.FIT),
|
||||
Column("notes", String, nullable=True),
|
||||
Column("ignoreRestrictions", Boolean, default=0),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, default=datetime.datetime.now, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
projectedFits_table = Table("projectedFits", saveddata_meta,
|
||||
@@ -64,12 +68,16 @@ projectedFits_table = Table("projectedFits", saveddata_meta,
|
||||
Column("victimID", ForeignKey("fits.ID"), primary_key=True),
|
||||
Column("amount", Integer, nullable=False, default=1),
|
||||
Column("active", Boolean, nullable=False, default=1),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
commandFits_table = Table("commandFits", saveddata_meta,
|
||||
Column("boosterID", ForeignKey("fits.ID"), primary_key=True),
|
||||
Column("boostedID", ForeignKey("fits.ID"), primary_key=True),
|
||||
Column("active", Boolean, nullable=False, default=1)
|
||||
Column("active", Boolean, nullable=False, default=1),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
|
||||
@@ -100,7 +108,7 @@ class ProjectedFit(object):
|
||||
|
||||
def __repr__(self):
|
||||
return "ProjectedFit(sourceID={}, victimID={}, amount={}, active={}) at {}".format(
|
||||
self.sourceID, self.victimID, self.amount, self.active, hex(id(self))
|
||||
self.sourceID, self.victimID, self.amount, self.active, hex(id(self))
|
||||
)
|
||||
|
||||
|
||||
@@ -120,120 +128,131 @@ class CommandFit(object):
|
||||
|
||||
def __repr__(self):
|
||||
return "CommandFit(boosterID={}, boostedID={}, active={}) at {}".format(
|
||||
self.boosterID, self.boostedID, self.active, hex(id(self))
|
||||
self.boosterID, self.boostedID, self.active, hex(id(self))
|
||||
)
|
||||
|
||||
|
||||
es_Fit._Fit__projectedFits = association_proxy(
|
||||
"victimOf", # look at the victimOf association...
|
||||
"source_fit", # .. and return the source fits
|
||||
creator=lambda sourceID, source_fit: ProjectedFit(sourceID, source_fit)
|
||||
"victimOf", # look at the victimOf association...
|
||||
"source_fit", # .. and return the source fits
|
||||
creator=lambda sourceID, source_fit: ProjectedFit(sourceID, source_fit)
|
||||
)
|
||||
|
||||
es_Fit._Fit__commandFits = association_proxy(
|
||||
"boostedOf", # look at the boostedOf association...
|
||||
"booster_fit", # .. and return the booster fit
|
||||
creator=lambda boosterID, booster_fit: CommandFit(boosterID, booster_fit)
|
||||
"boostedOf", # look at the boostedOf association...
|
||||
"booster_fit", # .. and return the booster fit
|
||||
creator=lambda boosterID, booster_fit: CommandFit(boosterID, booster_fit)
|
||||
)
|
||||
|
||||
|
||||
# These relationships are broken out so that we can easily access it in the events stuff
|
||||
# We sometimes don't want particular relationships to cause a fit modified update (eg: projecting
|
||||
# a fit onto another would 'modify' both fits unless the following relationship is ignored)
|
||||
projectedFitSourceRel = relationship(
|
||||
ProjectedFit,
|
||||
primaryjoin=projectedFits_table.c.sourceID == fits_table.c.ID,
|
||||
backref='source_fit',
|
||||
collection_class=attribute_mapped_collection('victimID'),
|
||||
cascade='all, delete, delete-orphan')
|
||||
|
||||
|
||||
boostedOntoRel = relationship(
|
||||
CommandFit,
|
||||
primaryjoin=commandFits_table.c.boosterID == fits_table.c.ID,
|
||||
backref='booster_fit',
|
||||
collection_class=attribute_mapped_collection('boostedID'),
|
||||
cascade='all, delete, delete-orphan')
|
||||
|
||||
mapper(es_Fit, fits_table,
|
||||
properties={
|
||||
"_Fit__modules": relation(
|
||||
Module,
|
||||
collection_class=HandledModuleList,
|
||||
primaryjoin=and_(modules_table.c.fitID == fits_table.c.ID, modules_table.c.projected == False), # noqa
|
||||
order_by=modules_table.c.position,
|
||||
cascade='all, delete, delete-orphan'),
|
||||
Module,
|
||||
collection_class=HandledModuleList,
|
||||
primaryjoin=and_(modules_table.c.fitID == fits_table.c.ID, modules_table.c.projected == False), # noqa
|
||||
order_by=modules_table.c.position,
|
||||
cascade='all, delete, delete-orphan'),
|
||||
"_Fit__projectedModules": relation(
|
||||
Module,
|
||||
collection_class=HandledProjectedModList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(modules_table.c.fitID == fits_table.c.ID, modules_table.c.projected == True)), # noqa
|
||||
Module,
|
||||
collection_class=HandledProjectedModList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(modules_table.c.fitID == fits_table.c.ID, modules_table.c.projected == True)), # noqa
|
||||
"owner": relation(
|
||||
User,
|
||||
backref="fits"),
|
||||
User,
|
||||
backref="fits"),
|
||||
"itemID": fits_table.c.shipID,
|
||||
"shipID": fits_table.c.shipID,
|
||||
"_Fit__boosters": relation(
|
||||
Booster,
|
||||
collection_class=HandledImplantBoosterList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True),
|
||||
Booster,
|
||||
collection_class=HandledImplantBoosterList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
backref='owner',
|
||||
single_parent=True),
|
||||
"_Fit__drones": relation(
|
||||
Drone,
|
||||
collection_class=HandledDroneCargoList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(drones_table.c.fitID == fits_table.c.ID, drones_table.c.projected == False)), # noqa
|
||||
Drone,
|
||||
collection_class=HandledDroneCargoList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(drones_table.c.fitID == fits_table.c.ID, drones_table.c.projected == False)), # noqa
|
||||
"_Fit__fighters": relation(
|
||||
Fighter,
|
||||
collection_class=HandledDroneCargoList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(fighters_table.c.fitID == fits_table.c.ID, fighters_table.c.projected == False)), # noqa
|
||||
Fighter,
|
||||
collection_class=HandledDroneCargoList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(fighters_table.c.fitID == fits_table.c.ID, fighters_table.c.projected == False)), # noqa
|
||||
"_Fit__cargo": relation(
|
||||
Cargo,
|
||||
collection_class=HandledDroneCargoList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(cargo_table.c.fitID == fits_table.c.ID)),
|
||||
Cargo,
|
||||
collection_class=HandledDroneCargoList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(cargo_table.c.fitID == fits_table.c.ID)),
|
||||
"_Fit__projectedDrones": relation(
|
||||
Drone,
|
||||
collection_class=HandledProjectedDroneList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(drones_table.c.fitID == fits_table.c.ID, drones_table.c.projected == True)), # noqa
|
||||
Drone,
|
||||
collection_class=HandledProjectedDroneList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(drones_table.c.fitID == fits_table.c.ID, drones_table.c.projected == True)), # noqa
|
||||
"_Fit__projectedFighters": relation(
|
||||
Fighter,
|
||||
collection_class=HandledProjectedDroneList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(fighters_table.c.fitID == fits_table.c.ID, fighters_table.c.projected == True)), # noqa
|
||||
Fighter,
|
||||
collection_class=HandledProjectedDroneList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(fighters_table.c.fitID == fits_table.c.ID, fighters_table.c.projected == True)), # noqa
|
||||
"_Fit__implants": relation(
|
||||
Implant,
|
||||
collection_class=HandledImplantBoosterList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
backref='fit',
|
||||
single_parent=True,
|
||||
primaryjoin=fitImplants_table.c.fitID == fits_table.c.ID,
|
||||
secondaryjoin=fitImplants_table.c.implantID == Implant.ID,
|
||||
secondary=fitImplants_table),
|
||||
Implant,
|
||||
collection_class=HandledImplantBoosterList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
backref='owner',
|
||||
single_parent=True,
|
||||
primaryjoin=fitImplants_table.c.fitID == fits_table.c.ID,
|
||||
secondaryjoin=fitImplants_table.c.implantID == Implant.ID,
|
||||
secondary=fitImplants_table),
|
||||
"_Fit__character": relation(
|
||||
Character,
|
||||
backref="fits"),
|
||||
Character,
|
||||
backref="fits"),
|
||||
"_Fit__damagePattern": relation(DamagePattern),
|
||||
"_Fit__targetResists": relation(TargetResists),
|
||||
"projectedOnto": relationship(
|
||||
ProjectedFit,
|
||||
primaryjoin=projectedFits_table.c.sourceID == fits_table.c.ID,
|
||||
backref='source_fit',
|
||||
collection_class=attribute_mapped_collection('victimID'),
|
||||
cascade='all, delete, delete-orphan'),
|
||||
"projectedOnto": projectedFitSourceRel,
|
||||
"victimOf": relationship(
|
||||
ProjectedFit,
|
||||
primaryjoin=fits_table.c.ID == projectedFits_table.c.victimID,
|
||||
backref='victim_fit',
|
||||
collection_class=attribute_mapped_collection('sourceID'),
|
||||
cascade='all, delete, delete-orphan'),
|
||||
"boostedOnto": relationship(
|
||||
CommandFit,
|
||||
primaryjoin=commandFits_table.c.boosterID == fits_table.c.ID,
|
||||
backref='booster_fit',
|
||||
collection_class=attribute_mapped_collection('boostedID'),
|
||||
cascade='all, delete, delete-orphan'),
|
||||
ProjectedFit,
|
||||
primaryjoin=fits_table.c.ID == projectedFits_table.c.victimID,
|
||||
backref='victim_fit',
|
||||
collection_class=attribute_mapped_collection('sourceID'),
|
||||
cascade='all, delete, delete-orphan'),
|
||||
"boostedOnto": boostedOntoRel,
|
||||
"boostedOf": relationship(
|
||||
CommandFit,
|
||||
primaryjoin=fits_table.c.ID == commandFits_table.c.boostedID,
|
||||
backref='boosted_fit',
|
||||
collection_class=attribute_mapped_collection('boosterID'),
|
||||
cascade='all, delete, delete-orphan'),
|
||||
CommandFit,
|
||||
primaryjoin=fits_table.c.ID == commandFits_table.c.boostedID,
|
||||
backref='boosted_fit',
|
||||
collection_class=attribute_mapped_collection('boosterID'),
|
||||
cascade='all, delete, delete-orphan'),
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
mapper(ProjectedFit, projectedFits_table,
|
||||
properties={
|
||||
"_ProjectedFit__amount": projectedFits_table.c.amount,
|
||||
}
|
||||
)
|
||||
properties={
|
||||
"_ProjectedFit__amount": projectedFits_table.c.amount,
|
||||
}
|
||||
)
|
||||
|
||||
mapper(CommandFit, commandFits_table)
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, Boolean
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, Boolean, DateTime
|
||||
from sqlalchemy.orm import mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.implant import Implant
|
||||
@@ -26,7 +27,10 @@ from eos.saveddata.implant import Implant
|
||||
implants_table = Table("implants", saveddata_meta,
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("itemID", Integer),
|
||||
Column("active", Boolean))
|
||||
Column("active", Boolean),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
fitImplants_table = Table("fitImplants", saveddata_meta,
|
||||
Column("fitID", ForeignKey("fits.ID"), index=True),
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, String
|
||||
from sqlalchemy import Table, Column, Integer, String, DateTime
|
||||
from sqlalchemy.orm import relation, mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.db.saveddata.implant import implantsSetMap_table
|
||||
@@ -29,18 +30,20 @@ from eos.saveddata.implantSet import ImplantSet
|
||||
implant_set_table = Table("implantSets", saveddata_meta,
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("name", String, nullable=False),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
mapper(ImplantSet, implant_set_table,
|
||||
properties={
|
||||
"_ImplantSet__implants": relation(
|
||||
Implant,
|
||||
collection_class=HandledImplantBoosterList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
backref='set',
|
||||
single_parent=True,
|
||||
primaryjoin=implantsSetMap_table.c.setID == implant_set_table.c.ID,
|
||||
secondaryjoin=implantsSetMap_table.c.implantID == Implant.ID,
|
||||
secondary=implantsSetMap_table),
|
||||
Implant,
|
||||
collection_class=HandledImplantBoosterList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
backref='set',
|
||||
single_parent=True,
|
||||
primaryjoin=implantsSetMap_table.c.setID == implant_set_table.c.ID,
|
||||
secondaryjoin=implantsSetMap_table.c.implantID == Implant.ID,
|
||||
secondary=implantsSetMap_table),
|
||||
}
|
||||
)
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, CheckConstraint, Boolean
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, CheckConstraint, Boolean, DateTime
|
||||
from sqlalchemy.orm import relation, mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.module import Module
|
||||
@@ -33,6 +34,8 @@ modules_table = Table("modules", saveddata_meta,
|
||||
Column("state", Integer, CheckConstraint("state >= -1"), CheckConstraint("state <= 2")),
|
||||
Column("projected", Boolean, default=False, nullable=False),
|
||||
Column("position", Integer),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now),
|
||||
CheckConstraint('("dummySlot" = NULL OR "itemID" = NULL) AND "dummySlot" != "itemID"'))
|
||||
|
||||
mapper(Module, modules_table,
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, Float
|
||||
from sqlalchemy import Table, Column, Integer, Float, DateTime
|
||||
from sqlalchemy.orm import mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.override import Override
|
||||
@@ -26,6 +27,9 @@ from eos.saveddata.override import Override
|
||||
overrides_table = Table("overrides", saveddata_meta,
|
||||
Column("itemID", Integer, primary_key=True, index=True),
|
||||
Column("attrID", Integer, primary_key=True, index=True),
|
||||
Column("value", Float, nullable=False))
|
||||
Column("value", Float, nullable=False),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
mapper(Override, overrides_table)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy.sql import and_
|
||||
from sqlalchemy import desc, select
|
||||
|
||||
from eos.db import saveddata_session, sd_lock
|
||||
from eos.db.saveddata.fit import projectedFits_table
|
||||
@@ -30,6 +31,7 @@ from eos.saveddata.targetResists import TargetResists
|
||||
from eos.saveddata.character import Character
|
||||
from eos.saveddata.implantSet import ImplantSet
|
||||
from eos.saveddata.fit import Fit
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.miscData import MiscData
|
||||
from eos.saveddata.override import Override
|
||||
|
||||
@@ -175,7 +177,7 @@ def getCharacter(lookfor, eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
character = saveddata_session.query(Character).options(*eager).filter(
|
||||
Character.savedName == lookfor).first()
|
||||
Character.savedName == lookfor).first()
|
||||
else:
|
||||
raise TypeError("Need integer or string as argument")
|
||||
return character
|
||||
@@ -241,22 +243,34 @@ def getFitsWithShip(shipID, ownerID=None, where=None, eager=None):
|
||||
return fits
|
||||
|
||||
|
||||
def getBoosterFits(ownerID=None, where=None, eager=None):
|
||||
"""
|
||||
Get all the fits that are flagged as a boosting ship
|
||||
If no user is passed, do this for all users.
|
||||
"""
|
||||
|
||||
if ownerID is not None and not isinstance(ownerID, int):
|
||||
raise TypeError("OwnerID must be integer")
|
||||
filter = Fit.booster == 1
|
||||
if ownerID is not None:
|
||||
filter = and_(filter, Fit.ownerID == ownerID)
|
||||
|
||||
filter = processWhere(filter, where)
|
||||
def getRecentFits(ownerID=None, where=None, eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
fits = removeInvalid(saveddata_session.query(Fit).options(*eager).filter(filter).all())
|
||||
q = select((
|
||||
Fit.ID,
|
||||
Fit.shipID,
|
||||
Fit.name,
|
||||
Fit.modified,
|
||||
Fit.created,
|
||||
Fit.timestamp,
|
||||
Fit.notes
|
||||
)).order_by(desc(Fit.modified), desc(Fit.timestamp)).limit(50)
|
||||
fits = eos.db.saveddata_session.execute(q).fetchall()
|
||||
|
||||
return fits
|
||||
|
||||
|
||||
def getFitsWithModules(typeIDs, eager=None):
|
||||
"""
|
||||
Get all the fits that have typeIDs fitted to them
|
||||
"""
|
||||
|
||||
if not hasattr(typeIDs, "__iter__"):
|
||||
typeIDs = (typeIDs,)
|
||||
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
fits = removeInvalid(saveddata_session.query(Fit).join(Module).options(*eager).filter(Module.itemID.in_(typeIDs)).all())
|
||||
|
||||
return fits
|
||||
|
||||
@@ -336,6 +350,13 @@ def getDamagePatternList(eager=None):
|
||||
return patterns
|
||||
|
||||
|
||||
def clearDamagePatterns():
|
||||
with sd_lock:
|
||||
deleted_rows = saveddata_session.query(DamagePattern).filter(DamagePattern.name != 'Uniform').delete()
|
||||
commit()
|
||||
return deleted_rows
|
||||
|
||||
|
||||
def getTargetResistsList(eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
@@ -343,6 +364,13 @@ def getTargetResistsList(eager=None):
|
||||
return patterns
|
||||
|
||||
|
||||
def clearTargetResists():
|
||||
with sd_lock:
|
||||
deleted_rows = saveddata_session.query(TargetResists).delete()
|
||||
commit()
|
||||
return deleted_rows
|
||||
|
||||
|
||||
def getImplantSetList(eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
@@ -360,12 +388,12 @@ def getDamagePattern(lookfor, eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(DamagePattern).options(*eager).filter(
|
||||
DamagePattern.ID == lookfor).first()
|
||||
DamagePattern.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(DamagePattern).options(*eager).filter(
|
||||
DamagePattern.name == lookfor).first()
|
||||
DamagePattern.name == lookfor).first()
|
||||
else:
|
||||
raise TypeError("Need integer or string as argument")
|
||||
return pattern
|
||||
@@ -381,12 +409,12 @@ def getTargetResists(lookfor, eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(TargetResists).options(*eager).filter(
|
||||
TargetResists.ID == lookfor).first()
|
||||
TargetResists.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(TargetResists).options(*eager).filter(
|
||||
TargetResists.name == lookfor).first()
|
||||
TargetResists.name == lookfor).first()
|
||||
else:
|
||||
raise TypeError("Need integer or string as argument")
|
||||
return pattern
|
||||
@@ -402,7 +430,7 @@ def getImplantSet(lookfor, eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(ImplantSet).options(*eager).filter(
|
||||
TargetResists.ID == lookfor).first()
|
||||
TargetResists.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
|
||||
@@ -17,15 +17,20 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, DateTime
|
||||
from sqlalchemy.orm import mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.character import Skill
|
||||
|
||||
|
||||
skills_table = Table("characterSkills", saveddata_meta,
|
||||
Column("characterID", ForeignKey("characters.ID"), primary_key=True, index=True),
|
||||
Column("itemID", Integer, primary_key=True),
|
||||
Column("_Skill__level", Integer, nullable=True))
|
||||
Column("_Skill__level", Integer, nullable=True),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
mapper(Skill, skills_table)
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, Float, ForeignKey, String
|
||||
from sqlalchemy import Table, Column, Integer, Float, ForeignKey, String, DateTime
|
||||
from sqlalchemy.orm import mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.targetResists import TargetResists
|
||||
@@ -30,6 +31,9 @@ targetResists_table = Table("targetResists", saveddata_meta,
|
||||
Column("thermalAmount", Float),
|
||||
Column("kineticAmount", Float),
|
||||
Column("explosiveAmount", Float),
|
||||
Column("ownerID", ForeignKey("users.ID"), nullable=True))
|
||||
Column("ownerID", ForeignKey("users.ID"), nullable=True),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
mapper(TargetResists, targetResists_table)
|
||||
|
||||
@@ -20,16 +20,18 @@
|
||||
from sqlalchemy.orm import eagerload
|
||||
from sqlalchemy.sql import and_
|
||||
|
||||
replace = {"attributes": "_Item__attributes",
|
||||
"modules": "_Fit__modules",
|
||||
"projectedModules": "_Fit__projectedModules",
|
||||
"boosters": "_Fit__boosters",
|
||||
"drones": "_Fit__drones",
|
||||
"projectedDrones": "_Fit__projectedDrones",
|
||||
"implants": "_Fit__implants",
|
||||
"character": "_Fit__character",
|
||||
"damagePattern": "_Fit__damagePattern",
|
||||
"projectedFits": "_Fit__projectedFits"}
|
||||
replace = {
|
||||
"attributes" : "_Item__attributes",
|
||||
"modules" : "_Fit__modules",
|
||||
"projectedModules": "_Fit__projectedModules",
|
||||
"boosters" : "_Fit__boosters",
|
||||
"drones" : "_Fit__drones",
|
||||
"projectedDrones" : "_Fit__projectedDrones",
|
||||
"implants" : "_Fit__implants",
|
||||
"character" : "_Fit__character",
|
||||
"damagePattern" : "_Fit__damagePattern",
|
||||
"projectedFits" : "_Fit__projectedFits"
|
||||
}
|
||||
|
||||
|
||||
def processEager(eager):
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# Used by:
|
||||
# Module: Reactive Armor Hardener
|
||||
from logbook import Logger
|
||||
import eos.config
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
@@ -13,6 +14,12 @@ type = "active"
|
||||
def handler(fit, module, context):
|
||||
damagePattern = fit.damagePattern
|
||||
|
||||
static_adaptive_behavior = eos.config.settings['useStaticAdaptiveArmorHardener']
|
||||
|
||||
if (damagePattern.emAmount == damagePattern.thermalAmount == damagePattern.kineticAmount == damagePattern.explosiveAmount) and static_adaptive_behavior:
|
||||
pyfalog.debug("Setting adaptivearmorhardener resists to uniform profile.")
|
||||
return
|
||||
|
||||
# Skip if there is no damage pattern. Example: projected ships or fleet boosters
|
||||
if damagePattern:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# ammoInfluenceCapNeed
|
||||
#
|
||||
# Used by:
|
||||
# Items from category: Charge (465 of 912)
|
||||
# Items from category: Charge (466 of 913)
|
||||
# Charges from group: Frequency Crystal (185 of 185)
|
||||
# Charges from group: Hybrid Charge (209 of 209)
|
||||
type = "passive"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# ammoInfluenceRange
|
||||
#
|
||||
# Used by:
|
||||
# Items from category: Charge (571 of 912)
|
||||
# Items from category: Charge (571 of 913)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
# Ships from group: Carrier (4 of 4)
|
||||
# Ships from group: Combat Battlecruiser (13 of 13)
|
||||
# Ships from group: Command Ship (8 of 8)
|
||||
# Ships from group: Force Auxiliary (4 of 4)
|
||||
# Ships from group: Force Auxiliary (5 of 5)
|
||||
# Ships from group: Supercarrier (6 of 6)
|
||||
# Ships from group: Titan (5 of 5)
|
||||
# Ships from group: Titan (6 of 6)
|
||||
# Subsystems named like: Defensive Warfare Processor (4 of 4)
|
||||
# Ship: Orca
|
||||
# Ship: Rorqual
|
||||
|
||||
22
eos/effects/concordsecstatustankbonus.py
Normal file
22
eos/effects/concordsecstatustankbonus.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# concordSecStatusTankBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Enforcer
|
||||
# Ship: Pacifier
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
|
||||
# Get pilot sec status bonus directly here, instead of going through the intermediary effects
|
||||
# via https://forums.eveonline.com/default.aspx?g=posts&t=515826
|
||||
try:
|
||||
bonus = max(0, min(50.0, (src.parent.character.secStatus * 10)))
|
||||
except:
|
||||
bonus = None
|
||||
|
||||
if bonus is not None:
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Repair Systems"),
|
||||
"armorDamageAmount", bonus, stackingPenalties=True)
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Operation"),
|
||||
"shieldBonus", bonus, stackingPenalties=True)
|
||||
@@ -3,9 +3,9 @@
|
||||
# Used by:
|
||||
# Ships from group: Black Ops (4 of 4)
|
||||
# Ships from group: Blockade Runner (4 of 4)
|
||||
# Ships from group: Covert Ops (6 of 6)
|
||||
# Ships from group: Covert Ops (7 of 7)
|
||||
# Ships from group: Expedition Frigate (2 of 2)
|
||||
# Ships from group: Force Recon Ship (6 of 6)
|
||||
# Ships from group: Force Recon Ship (7 of 7)
|
||||
# Ships from group: Stealth Bomber (4 of 4)
|
||||
# Ships named like: Stratios (2 of 2)
|
||||
# Subsystems named like: Offensive Covert Reconfiguration (4 of 4)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# covertOpsCloakCpuPercentBonus1
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Covert Ops (5 of 6)
|
||||
# Ships from group: Covert Ops (5 of 7)
|
||||
type = "passive"
|
||||
runTime = "early"
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# covertOpsCloakCPUPercentBonusPirateFaction
|
||||
# covertOpsCloakCPUPercentRoleBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Expedition Frigate (2 of 2)
|
||||
# Ship: Astero
|
||||
# Ship: Enforcer
|
||||
# Ship: Pacifier
|
||||
# Ship: Victorieux Luxury Yacht
|
||||
type = "passive"
|
||||
runTime = "early"
|
||||
@@ -10,4 +12,4 @@ runTime = "early"
|
||||
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Cloaking"),
|
||||
"cpu", ship.getModifiedItemAttr("shipBonusPirateFaction"))
|
||||
"cpu", ship.getModifiedItemAttr("shipBonusRole7"))
|
||||
@@ -1,7 +1,7 @@
|
||||
# cynosuralDurationBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Force Recon Ship (5 of 6)
|
||||
# Ships from group: Force Recon Ship (6 of 7)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# cynosuralTheoryConsumptionBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Force Recon Ship (5 of 6)
|
||||
# Ships from group: Force Recon Ship (6 of 7)
|
||||
# Skill: Cynosural Field Theory
|
||||
type = "passive"
|
||||
|
||||
|
||||
@@ -2,12 +2,17 @@
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Burst Jammer (11 of 11)
|
||||
from eos.modifiedAttributeDict import ModifiedAttributeDict
|
||||
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
def handler(fit, module, context, **kwargs):
|
||||
if "projected" in context:
|
||||
# jam formula: 1 - (1- (jammer str/ship str))^(# of jam mods with same str))
|
||||
strModifier = 1 - module.getModifiedItemAttr("scan{0}StrengthBonus".format(fit.scanType)) / fit.scanStrength
|
||||
|
||||
if 'effect' in kwargs:
|
||||
strModifier *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])
|
||||
|
||||
fit.ecmProjectedStr *= strModifier
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# eliteBonusCoverOpsScanProbeStrength2
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Covert Ops (6 of 6)
|
||||
# Ships from group: Covert Ops (7 of 7)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
9
eos/effects/elitebonuscoveropswarpvelocity1.py
Normal file
9
eos/effects/elitebonuscoveropswarpvelocity1.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# eliteBonusCoverOpsWarpVelocity1
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Pacifier
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.ship.boostItemAttr("warpSpeedMultiplier", src.getModifiedItemAttr("eliteBonusCoverOps1"), skill="Covert Ops")
|
||||
9
eos/effects/elitebonusreconwarpvelocity3.py
Normal file
9
eos/effects/elitebonusreconwarpvelocity3.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# eliteBonusReconWarpVelocity3
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Enforcer
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.ship.boostItemAttr("warpSpeedMultiplier", src.getModifiedItemAttr("eliteBonusReconShip3"), skill="Recon Ships")
|
||||
@@ -1,7 +1,8 @@
|
||||
# eliteReconJumpScramblerRangeBonus2
|
||||
# eliteReconScramblerRangeBonus2
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Arazu
|
||||
# Ship: Enforcer
|
||||
# Ship: Lachesis
|
||||
type = "passive"
|
||||
|
||||
9
eos/effects/elitereconstasiswebbonus1.py
Normal file
9
eos/effects/elitereconstasiswebbonus1.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# eliteReconStasisWebBonus1
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Enforcer
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Stasis Web", "maxRange", src.getModifiedItemAttr("eliteBonusReconShip1"), skill="Recon Ships")
|
||||
@@ -3,14 +3,19 @@
|
||||
# Used by:
|
||||
# Modules from group: Energy Neutralizer (51 of 51)
|
||||
from eos.saveddata.module import State
|
||||
from eos.modifiedAttributeDict import ModifiedAttributeDict
|
||||
|
||||
type = "active", "projected"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
def handler(fit, src, context, **kwargs):
|
||||
if "projected" in context and ((hasattr(src, "state") and src.state >= State.ACTIVE) or
|
||||
hasattr(src, "amountActive")):
|
||||
amount = src.getModifiedItemAttr("energyNeutralizerAmount")
|
||||
|
||||
if 'effect' in kwargs:
|
||||
amount *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])
|
||||
|
||||
time = src.getModifiedItemAttr("duration")
|
||||
|
||||
fit.addDrain(src, time, amount, 0)
|
||||
|
||||
@@ -2,14 +2,19 @@
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Energy Nosferatu (51 of 51)
|
||||
from eos.modifiedAttributeDict import ModifiedAttributeDict
|
||||
|
||||
type = "active", "projected"
|
||||
runTime = "late"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
def handler(fit, src, context, **kwargs):
|
||||
amount = src.getModifiedItemAttr("powerTransferAmount")
|
||||
time = src.getModifiedItemAttr("duration")
|
||||
|
||||
if 'effect' in kwargs:
|
||||
amount *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])
|
||||
|
||||
if "projected" in context:
|
||||
fit.addDrain(src, time, amount, 0)
|
||||
elif "module" in context:
|
||||
|
||||
@@ -2,12 +2,17 @@
|
||||
#
|
||||
# Used by:
|
||||
# Drones named like: EC (3 of 3)
|
||||
from eos.modifiedAttributeDict import ModifiedAttributeDict
|
||||
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
def handler(fit, module, context, **kwargs):
|
||||
if "projected" in context:
|
||||
# jam formula: 1 - (1- (jammer str/ship str))^(# of jam mods with same str))
|
||||
strModifier = 1 - module.getModifiedItemAttr("scan{0}StrengthBonus".format(fit.scanType)) / fit.scanStrength
|
||||
|
||||
if 'effect' in kwargs:
|
||||
strModifier *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])
|
||||
|
||||
fit.ecmProjectedStr *= strModifier
|
||||
|
||||
@@ -3,14 +3,18 @@
|
||||
# Used by:
|
||||
# Drones from group: Energy Neutralizer Drone (3 of 3)
|
||||
from eos.saveddata.module import State
|
||||
from eos.modifiedAttributeDict import ModifiedAttributeDict
|
||||
|
||||
type = "active", "projected"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
def handler(fit, src, context, **kwargs):
|
||||
if "projected" in context and ((hasattr(src, "state") and src.state >= State.ACTIVE) or
|
||||
hasattr(src, "amountActive")):
|
||||
amount = src.getModifiedItemAttr("energyNeutralizerAmount")
|
||||
time = src.getModifiedItemAttr("energyNeutralizerDuration")
|
||||
|
||||
if 'effect' in kwargs:
|
||||
amount *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])
|
||||
|
||||
fit.addDrain(src, time, amount, 0)
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
# entosisDurationMultiply
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Carrier (4 of 4)
|
||||
# Ships from group: Dreadnought (5 of 5)
|
||||
# Ships from group: Force Auxiliary (4 of 4)
|
||||
# Ships from group: Supercarrier (6 of 6)
|
||||
# Ships from group: Titan (5 of 5)
|
||||
# Ship: Rorqual
|
||||
# Items from market group: Ships > Capital Ships (28 of 37)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
Since fighter abilities do not have any sort of item entity in the EVE database, we must derive the abilities from the
|
||||
effects, and thus this effect file contains some custom information useful only to fighters.
|
||||
"""
|
||||
from eos.modifiedAttributeDict import ModifiedAttributeDict
|
||||
|
||||
# User-friendly name for the ability
|
||||
displayName = "ECM"
|
||||
@@ -12,10 +13,13 @@ prefix = "fighterAbilityECM"
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
def handler(fit, module, context, **kwargs):
|
||||
if "projected" not in context:
|
||||
return
|
||||
# jam formula: 1 - (1- (jammer str/ship str))^(# of jam mods with same str))
|
||||
strModifier = 1 - module.getModifiedItemAttr("{}Strength{}".format(prefix, fit.scanType)) / fit.scanStrength
|
||||
|
||||
if 'effect' in kwargs:
|
||||
strModifier *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])
|
||||
|
||||
fit.ecmProjectedStr *= strModifier
|
||||
|
||||
@@ -4,14 +4,19 @@ Since fighter abilities do not have any sort of item entity in the EVE database,
|
||||
effects, and thus this effect file contains some custom information useful only to fighters.
|
||||
"""
|
||||
# User-friendly name for the ability
|
||||
from eos.modifiedAttributeDict import ModifiedAttributeDict
|
||||
|
||||
displayName = "Energy Neutralizer"
|
||||
prefix = "fighterAbilityEnergyNeutralizer"
|
||||
type = "active", "projected"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
def handler(fit, src, context, **kwargs):
|
||||
if "projected" in context:
|
||||
amount = src.getModifiedItemAttr("{}Amount".format(prefix))
|
||||
time = src.getModifiedItemAttr("{}Duration".format(prefix))
|
||||
|
||||
if 'effect' in kwargs:
|
||||
amount *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])
|
||||
|
||||
fit.addDrain(src, time, amount, 0)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# minigameVirusStrengthBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Covert Ops (6 of 6)
|
||||
# Ships from group: Covert Ops (7 of 7)
|
||||
# Ships named like: Stratios (2 of 2)
|
||||
# Subsystems named like: Electronics Emergent Locus Analyzer (4 of 4)
|
||||
# Ship: Astero
|
||||
|
||||
@@ -6,7 +6,7 @@ runTime = "late"
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
def handler(fit, module, context, **kwargs):
|
||||
if "projected" not in context:
|
||||
return
|
||||
|
||||
@@ -17,4 +17,4 @@ def handler(fit, module, context):
|
||||
|
||||
amount = module.getModifiedItemAttr("armorDamageAmount") * multiplier
|
||||
speed = module.getModifiedItemAttr("duration") / 1000.0
|
||||
fit.extraAttributes.increase("armorRepair", amount / speed)
|
||||
fit.extraAttributes.increase("armorRepair", amount / speed, **kwargs)
|
||||
|
||||
@@ -6,9 +6,9 @@ runTime = "late"
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
def handler(fit, module, context, **kwargs):
|
||||
if "projected" not in context:
|
||||
return
|
||||
amount = module.getModifiedItemAttr("shieldBonus")
|
||||
speed = module.getModifiedItemAttr("duration") / 1000.0
|
||||
fit.extraAttributes.increase("shieldRepair", amount / speed)
|
||||
fit.extraAttributes.increase("shieldRepair", amount / speed, **kwargs)
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
def handler(fit, module, context, *args, **kwargs):
|
||||
if "projected" in context:
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"),
|
||||
"trackingSpeed", module.getModifiedItemAttr("trackingSpeedBonus"),
|
||||
stackingPenalties=True, remoteResists=True)
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"),
|
||||
"maxRange", module.getModifiedItemAttr("maxRangeBonus"),
|
||||
stackingPenalties=True, remoteResists=True)
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"),
|
||||
"falloff", module.getModifiedItemAttr("falloffBonus"),
|
||||
stackingPenalties=True, remoteResists=True)
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# reconShipCloakCpuBonus1
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Force Recon Ship (6 of 6)
|
||||
# Ships from group: Force Recon Ship (6 of 7)
|
||||
type = "passive"
|
||||
runTime = "early"
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, container, context):
|
||||
def handler(fit, container, context, **kwargs):
|
||||
if "projected" in context:
|
||||
bonus = container.getModifiedItemAttr("armorDamageAmount")
|
||||
duration = container.getModifiedItemAttr("duration") / 1000.0
|
||||
fit.extraAttributes.increase("armorRepair", bonus / duration)
|
||||
fit.extraAttributes.increase("armorRepair", bonus / duration, **kwargs)
|
||||
|
||||
@@ -2,12 +2,17 @@
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: ECM (39 of 39)
|
||||
from eos.modifiedAttributeDict import ModifiedAttributeDict
|
||||
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
def handler(fit, module, context, **kwargs):
|
||||
if "projected" in context:
|
||||
# jam formula: 1 - (1- (jammer str/ship str))^(# of jam mods with same str))
|
||||
strModifier = 1 - module.getModifiedItemAttr("scan{0}StrengthBonus".format(fit.scanType)) / fit.scanStrength
|
||||
|
||||
if 'effect' in kwargs:
|
||||
strModifier *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])
|
||||
|
||||
fit.ecmProjectedStr *= strModifier
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
def handler(fit, module, context, *args, **kwargs):
|
||||
if "projected" not in context:
|
||||
return
|
||||
|
||||
fit.ship.boostItemAttr("maxTargetRange", module.getModifiedItemAttr("maxTargetRangeBonus"),
|
||||
stackingPenalties=True, remoteResists=True)
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
|
||||
fit.ship.boostItemAttr("scanResolution", module.getModifiedItemAttr("scanResolutionBonus"),
|
||||
stackingPenalties=True, remoteResists=True)
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
def handler(fit, module, context, *args, **kwargs):
|
||||
if "projected" not in context:
|
||||
return
|
||||
|
||||
fit.ship.boostItemAttr("maxTargetRange", module.getModifiedItemAttr("maxTargetRangeBonus"),
|
||||
stackingPenalties=True, remoteResists=True)
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
|
||||
fit.ship.boostItemAttr("scanResolution", module.getModifiedItemAttr("scanResolutionBonus"),
|
||||
stackingPenalties=True, remoteResists=True)
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, container, context):
|
||||
def handler(fit, container, context, **kwargs):
|
||||
if "projected" in context:
|
||||
bonus = container.getModifiedItemAttr("shieldBonus")
|
||||
duration = container.getModifiedItemAttr("duration") / 1000.0
|
||||
fit.extraAttributes.increase("shieldRepair", bonus / duration)
|
||||
fit.extraAttributes.increase("shieldRepair", bonus / duration, **kwargs)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, container, context):
|
||||
def handler(fit, container, context, *args, **kwargs):
|
||||
if "projected" in context:
|
||||
fit.ship.boostItemAttr("signatureRadius", container.getModifiedItemAttr("signatureRadiusBonus"),
|
||||
stackingPenalties=True, remoteResists=True)
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, container, context):
|
||||
def handler(fit, container, context, *args, **kwargs):
|
||||
if "projected" in context:
|
||||
fit.ship.boostItemAttr("signatureRadius", container.getModifiedItemAttr("signatureRadiusBonus"),
|
||||
stackingPenalties=True, remoteResists=True)
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
type = "active", "projected"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
def handler(fit, module, context, *args, **kwargs):
|
||||
if "projected" not in context:
|
||||
return
|
||||
fit.ship.boostItemAttr("maxVelocity", module.getModifiedItemAttr("speedFactor"),
|
||||
stackingPenalties=True, remoteResists=True)
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
type = "active", "projected"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
def handler(fit, module, context, *args, **kwargs):
|
||||
if "projected" not in context:
|
||||
return
|
||||
fit.ship.boostItemAttr("maxVelocity", module.getModifiedItemAttr("speedFactor"),
|
||||
stackingPenalties=True, remoteResists=True)
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# scriptDurationBonus
|
||||
#
|
||||
# Used by:
|
||||
# Charge: Focused Warp Disruption Script
|
||||
# Charges from group: Warp Disruption Script (2 of 2)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# scriptMassBonusPercentageBonus
|
||||
#
|
||||
# Used by:
|
||||
# Charge: Focused Warp Disruption Script
|
||||
# Charges from group: Warp Disruption Script (2 of 2)
|
||||
type = "passive"
|
||||
runTime = "early"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# scriptSignatureRadiusBonusBonus
|
||||
#
|
||||
# Used by:
|
||||
# Charge: Focused Warp Disruption Script
|
||||
# Charges from group: Warp Disruption Script (2 of 2)
|
||||
type = "passive"
|
||||
runTime = "early"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# scriptSpeedBoostFactorBonusBonus
|
||||
#
|
||||
# Used by:
|
||||
# Charge: Focused Warp Disruption Script
|
||||
# Charges from group: Warp Disruption Script (2 of 2)
|
||||
type = "passive"
|
||||
runTime = "early"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# scriptSpeedFactorBonusBonus
|
||||
#
|
||||
# Used by:
|
||||
# Charge: Focused Warp Disruption Script
|
||||
# Charges from group: Warp Disruption Script (2 of 2)
|
||||
type = "passive"
|
||||
runTime = "early"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# scriptWarpDisruptionFieldGeneratorSetDisallowInEmpireSpace
|
||||
#
|
||||
# Used by:
|
||||
# Charge: Focused Warp Disruption Script
|
||||
# Charges from group: Warp Disruption Script (2 of 2)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# scriptWarpScrambleRangeBonus
|
||||
#
|
||||
# Used by:
|
||||
# Charge: Focused Warp Disruption Script
|
||||
# Charges from group: Warp Disruption Script (2 of 2)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
# Used by:
|
||||
# Implants named like: Zainou 'Gnome' Shield Management SM (6 of 6)
|
||||
# Modules named like: Core Defense Field Extender (8 of 8)
|
||||
# Modules named like: QA Multiship Module Players (4 of 4)
|
||||
# Implant: Genolution Core Augmentation CA-3
|
||||
# Implant: Sansha Modified 'Gnome' Implant
|
||||
# Skill: Shield Management
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# shipAdvancedSpaceshipCommandAgilityBonus
|
||||
#
|
||||
# Used by:
|
||||
# Items from market group: Ships > Capital Ships (34 of 34)
|
||||
# Items from market group: Ships > Capital Ships (37 of 37)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# shipBonusDreadnoughtA1EnergyWarfareAmountBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Chemosh
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu",
|
||||
"powerTransferAmount", src.getModifiedItemAttr("shipBonusDreadnoughtA1"), skill="Amarr Dreadnought")
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer",
|
||||
"energyNeutralizerAmount", src.getModifiedItemAttr("shipBonusDreadnoughtA1"), skill="Amarr Dreadnought")
|
||||
10
eos/effects/shipbonusdreadnoughtm1webrangebonus.py
Normal file
10
eos/effects/shipbonusdreadnoughtm1webrangebonus.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# shipBonusDreadnoughtM1WebRangeBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Chemosh
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Stasis Web",
|
||||
"maxRange", src.getModifiedItemAttr("shipBonusDreadnoughtM1"), skill="Minmatar Dreadnought")
|
||||
@@ -1,4 +1,4 @@
|
||||
# shipBonusDreadnoughtM1WebBonus
|
||||
# shipBonusDreadnoughtM1WebStrengthBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Vehement
|
||||
@@ -8,4 +8,4 @@ type = "passive"
|
||||
|
||||
def handler(fit, ship, context):
|
||||
fit.drones.filteredItemBoost(lambda drone: drone.item.requiresSkill("Drones"),
|
||||
"maxVelocity", ship.getModifiedItemAttr("shipBonusPirateFaction"))
|
||||
"maxVelocity", ship.getModifiedItemAttr("shipBonusRole7"))
|
||||
|
||||
10
eos/effects/shipbonusforceauxiliarya1nosferatudrainamount.py
Normal file
10
eos/effects/shipbonusforceauxiliarya1nosferatudrainamount.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# shipBonusForceAuxiliaryA1NosferatuDrainAmount
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Dagon
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu",
|
||||
"powerTransferAmount", src.getModifiedItemAttr("shipBonusForceAuxiliaryA1"), skill="Amarr Carrier")
|
||||
12
eos/effects/shipbonusforceauxiliarya1nosferaturangebonus.py
Normal file
12
eos/effects/shipbonusforceauxiliarya1nosferaturangebonus.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# shipBonusForceAuxiliaryA1NosferatuRangeBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Dagon
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu",
|
||||
"maxRange", src.getModifiedItemAttr("shipBonusForceAuxiliaryA1"), skill="Amarr Carrier")
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu",
|
||||
"falloffEffectiveness", src.getModifiedItemAttr("shipBonusForceAuxiliaryA1"), skill="Amarr Carrier")
|
||||
@@ -0,0 +1,10 @@
|
||||
# shipBonusForceAuxiliaryM1RemoteArmorRepairDuration
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Dagon
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"),
|
||||
"duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryM1"), skill="Minmatar Carrier")
|
||||
@@ -1,4 +1,4 @@
|
||||
# shipBonusForceAuxiliaryM1RemoteCycleTime
|
||||
# shipBonusForceAuxiliaryM1RemoteDuration
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Lif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user