Merge remote-tracking branch 'origin/master' into singularity

This commit is contained in:
blitzmann
2015-02-14 01:32:44 -05:00
132 changed files with 1396 additions and 772 deletions

180
config.py
View File

@@ -1,90 +1,90 @@
import os
import sys
# Load variable overrides specific to distribution type
try:
import configforced
except ImportError:
configforced = None
# Turns on debug mode
debug = False
# Defines if our saveddata will be in pyfa root or not
saveInRoot = False
# Version data
version = "1.6.2"
tag = "git"
expansionName = "Phoebe"
expansionVersion = "1.0"
evemonMinVersion = "4081"
# Database version (int ONLY)
# Increment every time we need to flag for user database upgrade/modification
dbversion = 3
pyfaPath = None
savePath = None
staticPath = None
saveDB = None
gameDB = None
def defPaths():
global pyfaPath
global savePath
global staticPath
global saveDB
global gameDB
global saveInRoot
# The main pyfa directory which contains run.py
# Python 2.X uses ANSI by default, so we need to convert the character encoding
pyfaPath = getattr(configforced, "pyfaPath", pyfaPath)
if pyfaPath is None:
pyfaPath = unicode(os.path.dirname(os.path.realpath(os.path.abspath(
sys.modules['__main__'].__file__))), sys.getfilesystemencoding())
# Where we store the saved fits etc, default is the current users home directory
if saveInRoot is True:
savePath = getattr(configforced, "savePath", None)
if savePath is None:
savePath = os.path.join(pyfaPath, "saveddata")
else:
savePath = getattr(configforced, "savePath", None)
if savePath is None:
savePath = unicode(os.path.expanduser(os.path.join("~", ".pyfa")),
sys.getfilesystemencoding())
# Redirect stderr to file if we're requested to do so
stderrToFile = getattr(configforced, "stderrToFile", None)
if stderrToFile is True:
if not os.path.exists(savePath):
os.mkdir(savePath)
sys.stderr = open(os.path.join(savePath, "error_log.txt"), "w")
# Same for stdout
stdoutToFile = getattr(configforced, "stdoutToFile", None)
if stdoutToFile is True:
if not os.path.exists(savePath):
os.mkdir(savePath)
sys.stdout = open(os.path.join(savePath, "output_log.txt"), "w")
# Static EVE Data from the staticdata repository, should be in the staticdata
# directory in our pyfa directory
staticPath = os.path.join(pyfaPath, "staticdata")
# The database where we store all the fits etc
saveDB = os.path.join(savePath, "saveddata.db")
# 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(staticPath, "eve.db")
## DON'T MODIFY ANYTHING BELOW ##
import eos.config
#Caching modifiers, disable all gamedata caching, its unneeded.
eos.config.gamedataCache = False
# saveddata db location modifier, shouldn't ever need to touch this
eos.config.saveddata_connectionstring = "sqlite:///" + saveDB + "?check_same_thread=False"
eos.config.gamedata_connectionstring = "sqlite:///" + gameDB + "?check_same_thread=False"
import os
import sys
# Load variable overrides specific to distribution type
try:
import configforced
except ImportError:
configforced = None
# Turns on debug mode
debug = False
# Defines if our saveddata will be in pyfa root or not
saveInRoot = False
# Version data
version = "1.8.2"
tag = "git"
expansionName = "Proteus"
expansionVersion = "1.0"
evemonMinVersion = "4081"
# Database version (int ONLY)
# Increment every time we need to flag for user database upgrade/modification
dbversion = 5
pyfaPath = None
savePath = None
staticPath = None
saveDB = None
gameDB = None
def defPaths():
global pyfaPath
global savePath
global staticPath
global saveDB
global gameDB
global saveInRoot
# The main pyfa directory which contains run.py
# Python 2.X uses ANSI by default, so we need to convert the character encoding
pyfaPath = getattr(configforced, "pyfaPath", pyfaPath)
if pyfaPath is None:
pyfaPath = unicode(os.path.dirname(os.path.realpath(os.path.abspath(
sys.modules['__main__'].__file__))), sys.getfilesystemencoding())
# Where we store the saved fits etc, default is the current users home directory
if saveInRoot is True:
savePath = getattr(configforced, "savePath", None)
if savePath is None:
savePath = os.path.join(pyfaPath, "saveddata")
else:
savePath = getattr(configforced, "savePath", None)
if savePath is None:
savePath = unicode(os.path.expanduser(os.path.join("~", ".pyfa")),
sys.getfilesystemencoding())
# Redirect stderr to file if we're requested to do so
stderrToFile = getattr(configforced, "stderrToFile", None)
if stderrToFile is True:
if not os.path.exists(savePath):
os.mkdir(savePath)
sys.stderr = open(os.path.join(savePath, "error_log.txt"), "w")
# Same for stdout
stdoutToFile = getattr(configforced, "stdoutToFile", None)
if stdoutToFile is True:
if not os.path.exists(savePath):
os.mkdir(savePath)
sys.stdout = open(os.path.join(savePath, "output_log.txt"), "w")
# Static EVE Data from the staticdata repository, should be in the staticdata
# directory in our pyfa directory
staticPath = os.path.join(pyfaPath, "staticdata")
# The database where we store all the fits etc
saveDB = os.path.join(savePath, "saveddata.db")
# 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(staticPath, "eve.db")
## DON'T MODIFY ANYTHING BELOW ##
import eos.config
#Caching modifiers, disable all gamedata caching, its unneeded.
eos.config.gamedataCache = False
# saveddata db location modifier, shouldn't ever need to touch this
eos.config.saveddata_connectionstring = "sqlite:///" + saveDB + "?check_same_thread=False"
eos.config.gamedata_connectionstring = "sqlite:///" + gameDB + "?check_same_thread=False"

View File

@@ -1,11 +1,11 @@
import os.path
from os.path import realpath, join, dirname, abspath
import sys
debug = False
gamedataCache = True
saveddataCache = True
gamedata_connectionstring = 'sqlite:///' + os.path.expanduser(os.path.join("~", ".pyfa","eve.db"))
gamedata_connectionstring = 'sqlite:///' + unicode(realpath(join(dirname(abspath(__file__)), "..", "staticdata", "eve.db")), sys.getfilesystemencoding())
saveddata_connectionstring = 'sqlite:///:memory:'
#Autodetect path, only change if the autodetection bugs out.
path = os.path.dirname(unicode(__file__, sys.getfilesystemencoding()))
path = dirname(unicode(__file__, sys.getfilesystemencoding()))

View File

@@ -75,7 +75,7 @@ from eos.db.saveddata.queries import getUser, getCharacter, getFit, getFitsWithS
getFitList, getFleetList, getFleet, save, remove, commit, add, \
getCharactersForUser, getMiscData, getSquadsIDsWithFitID, getWing, \
getSquad, getBoosterFits, getProjectedFits, getTargetResistsList, getTargetResists,\
clearPrices
clearPrices, countAllFits
#If using in memory saveddata, you'll want to reflect it so the data structure is good.
if config.saveddata_connectionstring == "sqlite:///:memory:":

View File

@@ -30,6 +30,7 @@ items_table = Table("invtypes", gamedata_meta,
Column("typeName", String, index=True),
Column("description", String),
Column("raceID", Integer),
Column("factionID", Integer),
Column("volume", Float),
Column("mass", Float),
Column("capacity", Float),

View File

@@ -8,6 +8,6 @@ import sqlalchemy
def upgrade(saveddata_engine):
try:
saveddata_engine.execute("SELECT mode FROM fits LIMIT 1")
saveddata_engine.execute("SELECT modeID FROM fits LIMIT 1")
except sqlalchemy.exc.DatabaseError:
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN modeID INTEGER")

View File

@@ -0,0 +1,141 @@
"""
Migration 4
- Converts modules based on Proteus Module Tiericide
Some modules have been unpublished (and unpublished module attributes are removed
from database), which causes pyfa to crash. We therefore replace these
modules with their new replacements
Based on http://community.eveonline.com/news/patch-notes/patch-notes-for-proteus/
and output of itemDiff.py
"""
CONVERSIONS = {
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
8173, # Beta Reactor Control: Capacitor Power Relay I
),
8175: ( # Type-D Restrained Capacitor Power Relay
8171, # Local Power Plant Manager: Capacity Power Relay I
),
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
4433, # Barton Reactor Capacitor Recharger I
4431, # F-b10 Nominal Capacitor Regenerator
4437, # Fixed Parallel Link-Capacitor I
),
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
5491, # Beta Hull Mod Expanded Cargo
5489, # Local Hull Conversion Expanded Cargo I
5487, # Mark I Modified SS Expanded Cargo
),
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
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
5241, # Dual Diode Mining Laser I
),
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
5243, # XeCl Drilling Beam I
),
22619: ( # Frigoris Restrained Ice Harvester Upgrade
22617, # Crisium Ice Harvester Upgrade
),
22611: ( # Elara Restrained Mining Laser Upgrade
22609, # Erin Mining Laser Upgrade
),
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
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
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
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
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
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
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
5645, # Beta Hull Mod Reinforced Bulkheads
),
5647: ( # Type-D Restrained Reinforced Bulkheads
5643, # Local Hull Conversion Reinforced Bulkheads I
),
}
def upgrade(saveddata_engine):
# Convert modules
for replacement_item, list in CONVERSIONS.iteritems():
for retired_item in list:
saveddata_engine.execute('UPDATE "modules" SET "itemID" = ? WHERE "itemID" = ?', (replacement_item, retired_item))
saveddata_engine.execute('UPDATE "cargo" SET "itemID" = ? WHERE "itemID" = ?', (replacement_item, retired_item))

View File

@@ -0,0 +1,8 @@
"""
Migration 5
Simply deletes damage profiles with a blank name. See GH issue #256
"""
def upgrade(saveddata_engine):
saveddata_engine.execute('DELETE FROM damagePatterns WHERE name LIKE ?', ("",))

View File

@@ -267,6 +267,11 @@ def getBoosterFits(ownerID=None, where=None, eager=None):
fits = saveddata_session.query(Fit).options(*eager).filter(filter).all()
return fits
def countAllFits():
with sd_lock:
count = saveddata_session.query(Fit).count()
return count
def countFitsWithShip(shipID, ownerID=None, where=None, eager=None):
"""
Get all the fits using a certain ship.

View File

@@ -1,9 +1,9 @@
# agilityMultiplierEffect
#
# Used by:
# Modules from group: Inertia Stabilizer (12 of 12)
# Modules from group: Nanofiber Internal Structure (14 of 14)
# Modules from group: Reinforced Bulkhead (12 of 12)
# Modules from group: Inertial Stabilizer (7 of 7)
# Modules from group: Nanofiber Internal Structure (7 of 7)
# Modules from group: Reinforced Bulkhead (8 of 8)
type = "passive"
def handler(fit, module, context):
fit.ship.boostItemAttr("agility",

View File

@@ -2,8 +2,8 @@
#
# Used by:
# Modules from group: Capacitor Flux Coil (6 of 6)
# Modules from group: Capacitor Power Relay (26 of 26)
# Modules from group: Power Diagnostic System (31 of 31)
# Modules from group: Capacitor Power Relay (20 of 20)
# Modules from group: Power Diagnostic System (23 of 23)
# Modules from group: Propulsion Module (107 of 107)
# Modules from group: Reactor Control Unit (22 of 22)
# Modules from group: Shield Flux Coil (11 of 11)

View File

@@ -1,9 +1,9 @@
# cargoCapacityMultiply
#
# Used by:
# Modules from group: Expanded Cargohold (13 of 13)
# Modules from group: Overdrive Injector System (14 of 14)
# Modules from group: Reinforced Bulkhead (12 of 12)
# Modules from group: Expanded Cargohold (7 of 7)
# Modules from group: Overdrive Injector System (7 of 7)
# Modules from group: Reinforced Bulkhead (8 of 8)
type = "passive"
def handler(fit, module, context):
fit.ship.multiplyItemAttr("capacity", module.getModifiedItemAttr("cargoCapacityMultiplier"))

View File

@@ -1,7 +1,7 @@
# drawbackArmorHP
#
# Used by:
# Modules from group: Rig Navigation (48 of 68)
# Modules from group: Rig Navigation (48 of 64)
type = "passive"
def handler(fit, module, context):
fit.ship.boostItemAttr("armorHP", module.getModifiedItemAttr("drawback"))

View File

@@ -1,7 +1,7 @@
# drawbackWarpSpeed
#
# Used by:
# Modules named like: Higgs Anchor I (4 of 4)
# Modules from group: Rig Anchor (4 of 4)
type = "passive"
def handler(fit, module, context):
fit.ship.boostItemAttr("warpSpeedMultiplier", module.getModifiedItemAttr("drawback"), stackingPenalties=True)

View File

@@ -1,7 +1,7 @@
# dreadnoughtMD1ProjDmgBonus
#
# Used by:
# Ship: Naglfar
# Ships named like: Naglfar (2 of 2)
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Minmatar Dreadnought").level

View File

@@ -1,7 +1,7 @@
# dreadnoughtMD3ProjRoFBonus
#
# Used by:
# Ship: Naglfar
# Ships named like: Naglfar (2 of 2)
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Minmatar Dreadnought").level

View File

@@ -1,7 +1,7 @@
# dreadnoughtShipBonusHybridDmgG1
#
# Used by:
# Ship: Moros
# Ships named like: Moros (2 of 2)
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Gallente Dreadnought").level

View File

@@ -1,7 +1,7 @@
# dreadnoughtShipBonusHybridRoFG2
#
# Used by:
# Ship: Moros
# Ships named like: Moros (2 of 2)
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Gallente Dreadnought").level

View File

@@ -1,7 +1,7 @@
# dreadnoughtShipBonusLaserCapNeedA1
#
# Used by:
# Ship: Revelation
# Ships named like: Revelation (2 of 2)
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Amarr Dreadnought").level

View File

@@ -1,7 +1,7 @@
# dreadnoughtShipBonusLaserRofA2
#
# Used by:
# Ship: Revelation
# Ships named like: Revelation (2 of 2)
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Amarr Dreadnought").level

View File

@@ -1,7 +1,7 @@
# dreadnoughtShipBonusShieldResistancesC2
#
# Used by:
# Ship: Phoenix
# Ships named like: Phoenix (2 of 2)
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Caldari Dreadnought").level

View File

@@ -1,10 +0,0 @@
# eliteReconBonusAssaultLauncherROF1
#
# Used by:
# Ship: Huginn
# Ship: Lachesis
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Recon Ships").level
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Missile Launcher Rapid Light",
"speed", ship.getModifiedItemAttr("eliteBonusReconShip1") * level)

View File

@@ -1,9 +0,0 @@
# eliteReconBonusHeavyAssaultLauncherROF1
#
# Used by:
# Ship: Huginn
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Recon Ships").level
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Missile Launcher Heavy Assault",
"speed", ship.getModifiedItemAttr("eliteBonusReconShip1") * level)

View File

@@ -1,10 +0,0 @@
# eliteReconBonusHeavyLauncherROF1
#
# Used by:
# Ship: Huginn
# Ship: Lachesis
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Recon Ships").level
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Missile Launcher Heavy",
"speed", ship.getModifiedItemAttr("eliteBonusReconShip1") * level)

View File

@@ -0,0 +1,9 @@
# eliteReconBonusMHTOptimalRange1
#
# Used by:
# Ship: Lachesis
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Recon Ships").level
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Medium Hybrid Turret"),
"maxRange", ship.getModifiedItemAttr("eliteBonusReconShip1") * level)

View File

@@ -0,0 +1,9 @@
# eliteReconBonusMPTdamage1
#
# Used by:
# Ship: Huginn
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Recon Ships").level
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Medium Projectile Turret"),
"damageMultiplier", ship.getModifiedItemAttr("eliteBonusReconShip1") * level)

View File

@@ -0,0 +1,9 @@
# eliteReconBonusNeutRange3
#
# Used by:
# Ship: Pilgrim
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Recon Ships").level
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Destabilizer",
"energyDestabilizationRange", ship.getModifiedItemAttr("eliteBonusReconShip3") * level)

View File

@@ -0,0 +1,9 @@
# eliteReconBonusVampRange3
#
# Used by:
# Ship: Pilgrim
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Recon Ships").level
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Vampire",
"powerTransferRange", ship.getModifiedItemAttr("eliteBonusReconShip3") * level)

View File

@@ -1,9 +1,9 @@
# evasiveManeuveringAgilityBonusPostPercentAgilityShip
#
# Used by:
# Modules from group: Rig Anchor (4 of 4)
# Implants named like: Eifyr and Co. 'Rogue' Evasive Maneuvering EM (6 of 6)
# Implants named like: grade Nomad (10 of 12)
# Modules named like: Higgs Anchor I (4 of 4)
# Modules named like: Low Friction Nozzle Joints (8 of 8)
# Implant: Genolution Core Augmentation CA-4
# Skill: Evasive Maneuvering

View File

@@ -1,3 +1,7 @@
# freighterAgilityBonus2O2
#
# Used by:
# Ship: Bowhead
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("ORE Freighter").level

View File

@@ -1,3 +1,7 @@
# freighterSMACapacityBonusO1
#
# Used by:
# Ship: Bowhead
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("ORE Freighter").level

View File

@@ -1,7 +1,7 @@
# iceHarvestCycleTimeModulesRequiringIceHarvestingOnline
#
# Used by:
# Variations of module: Ice Harvester Upgrade I (6 of 6)
# Variations of module: Ice Harvester Upgrade I (5 of 5)
type = "passive"
def handler(fit, module, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Ice Harvesting"),

View File

@@ -1,7 +1,7 @@
# iceMinerCpuUsagePercent
#
# Used by:
# Variations of module: Ice Harvester Upgrade I (6 of 6)
# Variations of module: Ice Harvester Upgrade I (5 of 5)
type = "passive"
def handler(fit, module, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Ice Harvesting"),

View File

@@ -1,7 +1,7 @@
# increaseSignatureRadiusOnline
#
# Used by:
# Modules from group: Inertia Stabilizer (12 of 12)
# Modules from group: Inertial Stabilizer (7 of 7)
type = "passive"
def handler(fit, module, context):
fit.ship.boostItemAttr("signatureRadius", module.getModifiedItemAttr("signatureRadiusBonus"))

View File

@@ -1,7 +1,7 @@
# massReductionBonusPassive
#
# Used by:
# Modules named like: Higgs Anchor I (4 of 4)
# Modules from group: Rig Anchor (4 of 4)
type = "passive"
def handler(fit, module, context):
fit.ship.boostItemAttr("mass", module.getModifiedItemAttr("massBonusPercentage"), stackingPenalties=True)

View File

@@ -1,7 +1,7 @@
# minerCpuUsageMultiplyPercent2
#
# Used by:
# Variations of module: Mining Laser Upgrade I (6 of 6)
# Variations of module: Mining Laser Upgrade I (5 of 5)
type = "passive"
def handler(fit, module, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining"),

View File

@@ -2,7 +2,7 @@
#
# Used by:
# Modules from group: Frequency Mining Laser (3 of 3)
# Modules from group: Mining Laser (17 of 17)
# Modules from group: Mining Laser (12 of 12)
# Modules from group: Strip Miner (5 of 5)
type = 'active'
def handler(fit, module, context):

View File

@@ -1,7 +1,7 @@
# miningYieldMultiplyPercent
#
# Used by:
# Variations of module: Mining Laser Upgrade I (6 of 6)
# Variations of module: Mining Laser Upgrade I (5 of 5)
type = "passive"
def handler(fit, module, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining"),

View File

@@ -1,3 +1,7 @@
# modeAgilityPostDiv
#
# Used by:
# Module: Amarr Tactical Destroyer Propulsion Mode
type = "passive"
def handler(fit, module, context):
fit.ship.multiplyItemAttr("agility", 1/module.getModifiedItemAttr("modeAgilityPostDiv"),

View File

@@ -1,3 +1,7 @@
# modeArmorResonancePostDiv
#
# Used by:
# Module: Amarr Tactical Destroyer Defense Mode
type = "passive"
def handler(fit, module, context):
for resType in ("Em", "Explosive", "Kinetic"):

View File

@@ -1,5 +1,8 @@
# modeSigRadiusPostDiv
#
# Used by:
# Module: Amarr Tactical Destroyer Defense Mode
type = "passive"
def handler(fit, module, context):
level = fit.character.getSkill("Minmatar Destroyer").level
fit.ship.multiplyItemAttr("signatureRadius", 1/module.getModifiedItemAttr("modeSignatureRadiusPostDiv"),
stackingPenalties = True, penaltyGroup="postDiv")

View File

@@ -1,3 +1,7 @@
# modeVelocityPostDiv
#
# Used by:
# Module: Amarr Tactical Destroyer Propulsion Mode
type = "passive"
def handler(fit, module, context):
fit.ship.multiplyItemAttr("maxVelocity", 1/module.getModifiedItemAttr("modeVelocityPostDiv"),

View File

@@ -1,7 +1,7 @@
# modifyMaxVelocityOfShipPassive
#
# Used by:
# Modules from group: Expanded Cargohold (13 of 13)
# Modules from group: Expanded Cargohold (7 of 7)
type = "passive"
def handler(fit, module, context):
fit.ship.multiplyItemAttr("maxVelocity", module.getModifiedItemAttr("maxVelocityBonus"),

View File

@@ -2,9 +2,9 @@
#
# Used by:
# Modules from group: Capacitor Flux Coil (6 of 6)
# Modules from group: Capacitor Power Relay (26 of 26)
# Modules from group: Capacitor Recharger (25 of 25)
# Modules from group: Power Diagnostic System (31 of 31)
# Modules from group: Capacitor Power Relay (20 of 20)
# Modules from group: Capacitor Recharger (18 of 18)
# Modules from group: Power Diagnostic System (23 of 23)
# Modules from group: Reactor Control Unit (22 of 22)
# Modules from group: Shield Flux Coil (11 of 11)
# Modules from group: Shield Power Relay (11 of 11)

View File

@@ -2,8 +2,8 @@
#
# Used by:
# Modules from group: Capacitor Flux Coil (6 of 6)
# Modules from group: Capacitor Power Relay (26 of 26)
# Modules from group: Power Diagnostic System (31 of 31)
# Modules from group: Capacitor Power Relay (20 of 20)
# Modules from group: Power Diagnostic System (23 of 23)
# Modules from group: Reactor Control Unit (22 of 22)
# Modules from group: Shield Flux Coil (11 of 11)
# Modules from group: Shield Recharger (6 of 6)

View File

@@ -2,7 +2,7 @@
#
# Used by:
# Ships from group: Assault Frigate (8 of 12)
# Ships from group: Heavy Assault Cruiser (8 of 11)
# Ships from group: Heavy Assault Cruiser (10 of 13)
type = "passive"
def handler(fit, ship, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("High Speed Maneuvering"),

View File

@@ -1,9 +1,9 @@
# navigationVelocityBonusPostPercentMaxVelocityShip
#
# Used by:
# Modules from group: Rig Anchor (4 of 4)
# Implants named like: grade Snake (16 of 18)
# Modules named like: Auxiliary Thrusters (8 of 8)
# Modules named like: Higgs Anchor I (4 of 4)
# Implant: Quafe Zero
# Skill: Navigation
type = "passive"

View File

@@ -2,8 +2,8 @@
#
# Used by:
# Modules from group: Capacitor Flux Coil (6 of 6)
# Modules from group: Capacitor Power Relay (26 of 26)
# Modules from group: Power Diagnostic System (31 of 31)
# Modules from group: Capacitor Power Relay (20 of 20)
# Modules from group: Power Diagnostic System (23 of 23)
# Modules from group: Reactor Control Unit (22 of 22)
# Modules from group: Shield Flux Coil (11 of 11)
# Modules from group: Shield Power Relay (11 of 11)

View File

@@ -1,3 +1,7 @@
# probeLauncherCPUPercentBonusTacticalDestroyer
#
# Used by:
# Ship: Confessor
type = "passive"
def handler(fit, ship, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Astrometrics"),

View File

@@ -1,7 +1,7 @@
# roleBonusBulkheadCPU
#
# Used by:
# Ships from group: Freighter (4 of 4)
# Ships from group: Freighter (4 of 5)
# Ships from group: Jump Freighter (4 of 4)
type = "passive"
def handler(fit, ship, context):

View File

@@ -1,7 +1,7 @@
# shieldBoostAmplifier
#
# Used by:
# Modules from group: Capacitor Power Relay (26 of 26)
# Modules from group: Capacitor Power Relay (20 of 20)
# Modules from group: Shield Boost Amplifier (25 of 25)
type = "passive"
def handler(fit, module, context):

View File

@@ -2,8 +2,8 @@
#
# Used by:
# Modules from group: Capacitor Flux Coil (6 of 6)
# Modules from group: Capacitor Power Relay (26 of 26)
# Modules from group: Power Diagnostic System (31 of 31)
# Modules from group: Capacitor Power Relay (20 of 20)
# Modules from group: Power Diagnostic System (23 of 23)
# Modules from group: Reactor Control Unit (22 of 22)
# Modules from group: Shield Flux Coil (11 of 11)
# Modules from group: Shield Power Relay (11 of 11)

View File

@@ -1,7 +1,7 @@
# shipAdvancedSpaceshipCommandAgilityBonus
#
# Used by:
# Items from market group: Ships > Capital Ships (27 of 29)
# Items from market group: Ships > Capital Ships (32 of 34)
type = "passive"
def handler(fit, ship, context):
skill = fit.character.getSkill("Advanced Spaceship Command")

View File

@@ -1,7 +1,7 @@
# shipBonusDreadCitadelCruiseRofC1
#
# Used by:
# Ship: Phoenix
# Ships named like: Phoenix (2 of 2)
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Caldari Dreadnought").level

View File

@@ -1,7 +1,7 @@
# shipBonusDreadCitadelTorpRofC1
#
# Used by:
# Ship: Phoenix
# Ships named like: Phoenix (2 of 2)
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Caldari Dreadnought").level

View File

@@ -2,6 +2,7 @@
#
# Used by:
# Variations of ship: Dominix (3 of 3)
# Ship: Dominix Quafe Edition
# Ship: Nestor
type = "passive"
def handler(fit, ship, context):

View File

@@ -3,6 +3,7 @@
# Used by:
# Ships named like: Stratios (2 of 2)
# Variations of ship: Vexor (3 of 4)
# Ship: Vexor Quafe Edition
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Gallente Cruiser").level

View File

@@ -2,6 +2,7 @@
#
# Used by:
# Variations of ship: Dominix (3 of 3)
# Ship: Dominix Quafe Edition
# Ship: Nestor
type = "passive"
def handler(fit, ship, context):

View File

@@ -3,6 +3,7 @@
# Used by:
# Ships named like: Stratios (2 of 2)
# Variations of ship: Vexor (3 of 4)
# Ship: Vexor Quafe Edition
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Gallente Cruiser").level

View File

@@ -1,8 +1,8 @@
# shipBonusDroneHitpointsGF
#
# Used by:
# Ships named like: Tristan (2 of 2)
# Ship: Astero
# Ship: Tristan
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Gallente Frigate").level

View File

@@ -1,8 +1,7 @@
# shipBonusDroneMiningAmountGC2
#
# Used by:
# Ship: Vexor
# Ship: Vexor Navy Issue
# Ships named like: Vexor (3 of 4)
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Gallente Cruiser").level

View File

@@ -2,6 +2,7 @@
#
# Used by:
# Ship: Dominix
# Ship: Dominix Quafe Edition
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Gallente Battleship").level

View File

@@ -2,6 +2,7 @@
#
# Used by:
# Ship: Dominix
# Ship: Dominix Quafe Edition
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Gallente Battleship").level

View File

@@ -1,7 +1,7 @@
# shipBonusDroneTrackingGF
#
# Used by:
# Ship: Tristan
# Ships named like: Tristan (2 of 2)
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Gallente Frigate").level

View File

@@ -1,9 +0,0 @@
# shipBonusHeavyAssaultLauncherRateOfFireCC2
#
# Used by:
# Ship: Rook
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Caldari Cruiser").level
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Missile Launcher Heavy Assault",
"speed", ship.getModifiedItemAttr("shipBonusCC2") * level)

View File

@@ -1,9 +0,0 @@
# shipBonusHeavyLauncherRateOfFireCC2
#
# Used by:
# Ship: Rook
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Caldari Cruiser").level
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Missile Launcher Heavy",
"speed", ship.getModifiedItemAttr("shipBonusCC2") * level)

View File

@@ -1,10 +1,10 @@
# shipBonusHybridTrackingGF2
#
# Used by:
# Ships named like: Tristan (2 of 2)
# Ship: Ares
# Ship: Federation Navy Comet
# Ship: Police Pursuit Comet
# Ship: Tristan
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Gallente Frigate").level

View File

@@ -3,6 +3,7 @@
# Used by:
# Ship: Chameleon
# Ship: Gila
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Gallente Cruiser").level

View File

@@ -1,3 +1,7 @@
# shipHeatDamageAmarrTacticalDestroyer3
#
# Used by:
# Ship: Confessor
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Amarr Tactical Destroyer").level

View File

@@ -2,13 +2,11 @@
#
# Used by:
# Ships named like: Thorax (3 of 3)
# Ships named like: Vexor (3 of 4)
# Ship: Adrestia
# Ship: Arazu
# Ship: Deimos
# Ship: Exequror Navy Issue
# Ship: Guardian-Vexor
# Ship: Lachesis
# Ship: Vexor
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Gallente Cruiser").level

View File

@@ -1,6 +1,7 @@
# shipHybridTrackingGC
#
# Used by:
# Ship: Lachesis
# Ship: Phobos
type = "passive"
def handler(fit, ship, context):

View File

@@ -0,0 +1,9 @@
# shipMissileBonusEMdmgMC
#
# Used by:
# Ship: Rapier
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Minmatar Cruiser").level
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"),
"emDamage", ship.getModifiedItemAttr("shipBonusMC") * level)

View File

@@ -0,0 +1,9 @@
# shipMissileBonusExpdmgMC
#
# Used by:
# Ship: Rapier
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Minmatar Cruiser").level
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"),
"explosiveDamage", ship.getModifiedItemAttr("shipBonusMC") * level)

View File

@@ -0,0 +1,9 @@
# shipMissileBonusKindmgMC
#
# Used by:
# Ship: Rapier
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Minmatar Cruiser").level
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"),
"kineticDamage", ship.getModifiedItemAttr("shipBonusMC") * level)

View File

@@ -0,0 +1,9 @@
# shipMissileBonusThermdmgMC
#
# Used by:
# Ship: Rapier
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Minmatar Cruiser").level
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"),
"thermalDamage", ship.getModifiedItemAttr("shipBonusMC") * level)

View File

@@ -2,6 +2,7 @@
#
# Used by:
# Ship: Osprey Navy Issue
# Ship: Rook
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Caldari Cruiser").level

View File

@@ -0,0 +1,9 @@
# shipMissileLauncherRoFAD1Fixed
#
# Used by:
# Ship: Heretic
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Amarr Destroyer").level
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Missile Launcher Operation"),
"speed", ship.getModifiedItemAttr("shipBonusAD1") * level)

View File

@@ -1,3 +1,7 @@
# shipModeMaxTargetRangePostDiv
#
# Used by:
# Module: Amarr Tactical Destroyer Sharpshooter Mode
type = "passive"
def handler(fit, module, context):
fit.ship.multiplyItemAttr("maxTargetRange", 1/module.getModifiedItemAttr("modeMaxTargetRangePostDiv"),

View File

@@ -1,3 +1,7 @@
# shipModeScanResPostDiv
#
# Used by:
# Module: Amarr Tactical Destroyer Sharpshooter Mode
type = "passive"
def handler(fit, module, context):
fit.ship.multiplyItemAttr("scanResolution", 1/module.getModifiedItemAttr("modeScanResPostDiv"),

View File

@@ -1,3 +1,7 @@
# shipModeScanStrengthPostDiv
#
# Used by:
# Module: Amarr Tactical Destroyer Sharpshooter Mode
type = "passive"
def handler(fit, module, context):
fit.ship.multiplyItemAttr("scanRadarStrength", 1/module.getModifiedItemAttr("modeRadarStrengthPostDiv"),

View File

@@ -1,3 +1,7 @@
# shipModeSETOptimalRangePostDiv
#
# Used by:
# Module: Amarr Tactical Destroyer Sharpshooter Mode
type = "passive"
def handler(fit, module, context):
fit.modules.filteredItemMultiply(lambda mod: mod.item.requiresSkill("Small Energy Turret"),

View File

@@ -6,4 +6,4 @@ type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Gallente Battleship").level
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Large Projectile Turret"),
"falloff", ship.getModifiedItemAttr("shipBonusGB") * level)
"falloff", ship.getModifiedItemAttr("shipBonusGB") * level)

View File

@@ -5,7 +5,6 @@
# Variations of ship: Rupture (3 of 3)
# Variations of ship: Stabber (3 of 3)
# Ship: Huginn
# Ship: Rapier
# Ship: Scythe Fleet Issue
type = "passive"
def handler(fit, ship, context):

View File

@@ -1,3 +1,7 @@
# shipSETCapNeedAmarrTacticalDestroyer2
#
# Used by:
# Ship: Confessor
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Amarr Tactical Destroyer").level

View File

@@ -1,3 +1,7 @@
# shipSETDamageAmarrTacticalDestroyer1
#
# Used by:
# Ship: Confessor
type = "passive"
def handler(fit, ship, context):
level = fit.character.getSkill("Amarr Tactical Destroyer").level

View File

@@ -1,7 +1,7 @@
# shipXLProjectileDamageRole
#
# Used by:
# Ship: Naglfar
# Ships named like: Naglfar (2 of 2)
type = "passive"
def handler(fit, ship, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Projectile Turret"),

View File

@@ -1,8 +1,8 @@
# structureHPMultiply
#
# Used by:
# Modules from group: Nanofiber Internal Structure (14 of 14)
# Modules from group: Reinforced Bulkhead (12 of 12)
# Modules from group: Nanofiber Internal Structure (7 of 7)
# Modules from group: Reinforced Bulkhead (8 of 8)
# Modules named like: QA Multiship Module Players (4 of 4)
type = "passive"
def handler(fit, module, context):

View File

@@ -1,7 +1,7 @@
# structureHPMultiplyPassive
#
# Used by:
# Modules from group: Expanded Cargohold (13 of 13)
# Modules from group: Expanded Cargohold (7 of 7)
type = "passive"
def handler(fit, module, context):
fit.ship.multiplyItemAttr("hp", module.getModifiedItemAttr("structureHPMultiplier"))

View File

@@ -1,8 +1,8 @@
# velocityBonusOnline
#
# Used by:
# Modules from group: Nanofiber Internal Structure (14 of 14)
# Modules from group: Overdrive Injector System (14 of 14)
# Modules from group: Nanofiber Internal Structure (7 of 7)
# Modules from group: Overdrive Injector System (7 of 7)
type = "passive"
def handler(fit, module, context):
fit.ship.boostItemAttr("maxVelocity", module.getModifiedItemAttr("implantBonusVelocity"),

View File

@@ -120,7 +120,12 @@ class Effect(EqBase):
'''
try:
self.__effectModule = effectModule = __import__('eos.effects.' + self.handlerName, fromlist=True)
self.__handler = getattr(effectModule, "handler")
try:
self.__handler = getattr(effectModule, "handler")
except AttributeError:
print "effect {} exists, but no handler".format(self.handlerName)
raise
try:
self.__runTime = getattr(effectModule, "runTime") or "normal"
except AttributeError:
@@ -133,7 +138,7 @@ class Effect(EqBase):
t = t if isinstance(t, tuple) or t is None else (t,)
self.__type = t
except ImportError as e:
except (ImportError, AttributeError) as e:
self.__handler = effectDummy
self.__runTime = "normal"
self.__type = None
@@ -235,47 +240,63 @@ class Item(EqBase):
requiredSkills[item] = skillLvl
return self.__requiredSkills
factionMap = {
500001: "caldari",
500002: "minmatar",
500003: "amarr",
500004: "gallente",
500005: "jove",
500010: "guristas",
500011: "angel",
500012: "blood",
500014: "ore",
500016: "sisters",
500018: "mordu",
500019: "sansha",
500020: "serpentis"
}
@property
def race(self):
if self.__race is None:
# Define race map
map = {1: "caldari",
2: "minmatar",
4: "amarr",
5: "sansha", # Caldari + Amarr
6: "blood", # Minmatar + Amarr
8: "gallente",
9: "guristas", # Caldari + Gallente
10: "angelserp", # Minmatar + Gallente, final race depends on the order of skills
12: "sisters", # Amarr + Gallente
16: "jove",
32: "sansha", # Incrusion Sansha
128: "ore"}
# Race is None by default
race = None
# Check primary and secondary required skills' races
if race is None:
# Currently Assault Frigates skill has raceID set, which is actually
# EVE's bug
ignoredSkills = ('Assault Frigates',)
skills = tuple(filter(lambda i: i.name not in ignoredSkills, self.requiredSkills.keys()))
skillRaces = tuple(filter(lambda rid: rid, (s.raceID for s in skills)))
if sum(skillRaces) in map:
race = map[sum(skillRaces)]
if race == "angelserp":
if skillRaces == (2, 8):
race = "angel"
else:
race = "serpentis"
# Rely on item's own raceID as last resort
if race is None:
race = map.get(self.raceID, None)
# Store our final value
self.__race = race
try:
self.__race = self.factionMap[self.factionID]
# Some ships (like few limited issue ships) do not have factionID set,
# thus keep old mechanism for now
except KeyError:
# Define race map
map = {1: "caldari",
2: "minmatar",
4: "amarr",
5: "sansha", # Caldari + Amarr
6: "blood", # Minmatar + Amarr
8: "gallente",
9: "guristas", # Caldari + Gallente
10: "angelserp", # Minmatar + Gallente, final race depends on the order of skills
12: "sisters", # Amarr + Gallente
16: "jove",
32: "sansha", # Incrusion Sansha
128: "ore"}
# Race is None by default
race = None
# Check primary and secondary required skills' races
if race is None:
skillRaces = tuple(filter(lambda rid: rid, (s.raceID for s in tuple(self.requiredSkills.keys()))))
if sum(skillRaces) in map:
race = map[sum(skillRaces)]
if race == "angelserp":
if skillRaces == (2, 8):
race = "angel"
else:
race = "serpentis"
# Rely on item's own raceID as last resort
if race is None:
race = map.get(self.raceID, None)
# Store our final value
self.__race = race
return self.__race
@property
def assistive(self):
"""Detects if item can be used as assistance"""

View File

@@ -71,7 +71,7 @@ class FitDpsGraph(Graph):
if distance <= fit.extraAttributes["droneControlRange"]:
for drone in fit.drones:
multiplier = 1 if drone.getModifiedItemAttr("maxVelocity") > 0 else self.calculateTurretMultiplier(drone, data)
dps = drone.damageStats(fit.targetResists)
dps, _ = drone.damageStats(fit.targetResists)
total += dps * multiplier
return total

View File

@@ -35,6 +35,7 @@ class Drone(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
self.amount = 0
self.amountActive = 0
self.__dps = None
self.__volley = None
self.__miningyield = None
self.projected = False
self.__itemModifiedAttributes = ModifiedAttributeDict()
@@ -43,6 +44,7 @@ class Drone(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
@reconstructor
def init(self):
self.__dps = None
self.__volley = None
self.__miningyield = None
self.__item = None
self.__charge = None
@@ -115,6 +117,8 @@ class Drone(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
def damageStats(self, targetResists = None):
if self.__dps == None:
self.__volley = 0
self.__dps = 0
if self.dealsDamage is True and self.amountActive > 0:
if self.hasAmmo:
attr = "missileLaunchDuration"
@@ -128,11 +132,10 @@ class Drone(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
volley = sum(map(lambda d: (getter("%sDamage"%d) or 0) * (1-getattr(targetResists, "%sAmount"%d, 0)), self.DAMAGE_TYPES))
volley *= self.amountActive
volley *= self.getModifiedItemAttr("damageMultiplier") or 1
self.__volley = volley
self.__dps = volley / (cycleTime / 1000.0)
else:
self.__dps = 0
return self.__dps
return self.__dps, self.__volley
@property
def miningStats(self):
@@ -186,6 +189,7 @@ class Drone(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
def clear(self):
self.__dps = None
self.__volley = None
self.__miningyield = None
self.itemModifiedAttributes.clear()
self.chargeModifiedAttributes.clear()

View File

@@ -82,6 +82,7 @@ class Fit(object):
self.__minerYield = None
self.__weaponVolley = None
self.__droneDPS = None
self.__droneVolley = None
self.__droneYield = None
self.__sustainableTank = None
self.__effectiveSustainableTank = None
@@ -115,6 +116,7 @@ class Fit(object):
self.__weaponDPS = None
self.__weaponVolley = None
self.__droneDPS = None
self.__droneVolley = None
@property
def damagePattern(self):
@@ -151,6 +153,8 @@ class Fit(object):
def ship(self, ship):
self.__ship = ship
self.shipID = ship.item.ID if ship is not None else None
# set mode of new ship
self.mode = self.ship.checkModeItem(None) if ship is not None else None
@property
def drones(self):
@@ -205,10 +209,21 @@ class Fit(object):
return self.__droneDPS
@property
def droneVolley(self):
if self.__droneVolley is None:
self.calculateWeaponStats()
return self.__droneVolley
@property
def totalDPS(self):
return self.droneDPS + self.weaponDPS
@property
def totalVolley(self):
return self.droneVolley + self.weaponVolley
@property
def minerYield(self):
if self.__minerYield is None:
@@ -294,6 +309,7 @@ class Fit(object):
self.__effectiveSustainableTank = None
self.__sustainableTank = None
self.__droneDPS = None
self.__droneVolley = None
self.__droneYield = None
self.__ehp = None
self.__calculated = False
@@ -390,12 +406,14 @@ class Fit(object):
(effect.isType("active") and thing.state >= State.ACTIVE):
# Run effect, and get proper bonuses applied
try:
self.register(thing)
effect.handler(self, thing, context)
except:
pass
else:
# Run effect, and get proper bonuses applied
try:
self.register(thing)
effect.handler(self, thing, context)
except:
pass
@@ -840,6 +858,7 @@ class Fit(object):
weaponDPS = 0
droneDPS = 0
weaponVolley = 0
droneVolley = 0
for mod in self.modules:
dps, volley = mod.damageStats(self.targetResists)
@@ -847,11 +866,14 @@ class Fit(object):
weaponVolley += volley
for drone in self.drones:
droneDPS += drone.damageStats(self.targetResists)
dps, volley = drone.damageStats(self.targetResists)
droneDPS += dps
droneVolley += volley
self.__weaponDPS = weaponDPS
self.__weaponVolley = weaponVolley
self.__droneDPS = droneDPS
self.__droneVolley = droneVolley
@property
def fits(self):

View File

@@ -29,6 +29,7 @@ class Ship(ItemAttrShortcut, HandledItem):
self.__item = item
self.__itemModifiedAttributes = ModifiedAttributeDict()
self.__modeItems = self._getModeItems()
if not isinstance(item, int):
self.__buildOriginal()
@@ -76,7 +77,7 @@ class Ship(ItemAttrShortcut, HandledItem):
@todo: rename this
"""
items = self.getModeItems()
items = self.__modeItems
if items != None:
if item == None or item not in items:
@@ -87,11 +88,15 @@ class Ship(ItemAttrShortcut, HandledItem):
return Mode(item)
return None
def getModes(self):
items = self.getModeItems()
return [Mode(item) for item in items] if items else None
@property
def modeItems(self):
return self.__modeItems
def getModeItems(self):
@property
def modes(self):
return [Mode(item) for item in self.__modeItems] if self.__modeItems else None
def _getModeItems(self):
"""
Returns a list of valid mode items for ship. Note that this returns the
valid Item objects, not the Mode objects. Returns None if not a

View File

@@ -24,7 +24,7 @@ class DamagePattern(ContextMenu):
self.fit = sFit.getFit(fitID)
self.patterns = sDP.getDamagePatternList()
self.patterns.sort(key=lambda p: (p.name not in ["Uniform","Selected Ammo"], p.name))
self.patterns.sort(key=lambda p: (p.name not in ["Uniform", "Selected Ammo"], p.name))
self.patternIds = {}
self.subMenus = OrderedDict()
@@ -71,7 +71,6 @@ class DamagePattern(ContextMenu):
def getSubMenu(self, context, selection, rootMenu, i, pitem):
msw = True if "wxMSW" in wx.PlatformInfo else False
rootMenu.Bind(wx.EVT_MENU, self.handlePatternSwitch) # this bit is required for some reason
if self.m[i] not in self.subMenus:
# if we're trying to get submenu to something that shouldn't have one,
@@ -79,10 +78,11 @@ class DamagePattern(ContextMenu):
# our patternIds mapping, then return None for no submenu
id = pitem.GetId()
self.patternIds[id] = self.singles[i]
rootMenu.Bind(wx.EVT_MENU, self.handlePatternSwitch, pitem)
if self.patternIds[id] == self.fit.damagePattern:
bitmap = bitmapLoader.getBitmap("state_active_small", "icons")
pitem.SetBitmap(bitmap)
return None
return False
sub = wx.Menu()

View File

@@ -16,7 +16,7 @@ class TacticalMode(ContextMenu):
fitID = self.mainFrame.getActiveFit()
fit = sFit.getFit(fitID)
self.modes = fit.ship.getModes()
self.modes = fit.ship.modes
self.currMode = fit.mode
return srcContext == "fittingShip" and self.modes is not None

View File

@@ -53,6 +53,9 @@ class PFGeneralPref ( PreferenceView):
labelSizer.Add( self.cbRackLabels, 0, wx.ALL|wx.EXPAND, 5 )
mainSizer.Add( labelSizer, 0, wx.LEFT|wx.EXPAND, 30 )
self.cbShowTooltip = wx.CheckBox( panel, wx.ID_ANY, u"Show tab tooltips", wx.DefaultPosition, wx.DefaultSize, 0 )
mainSizer.Add( self.cbShowTooltip, 0, wx.ALL|wx.EXPAND, 5 )
defCharSizer = wx.BoxSizer( wx.HORIZONTAL )
self.sFit = service.Fit.getInstance()
@@ -65,6 +68,7 @@ class PFGeneralPref ( PreferenceView):
self.cbRackLabels.SetValue(self.sFit.serviceFittingOptions["rackLabels"] or False)
self.cbCompactSkills.SetValue(self.sFit.serviceFittingOptions["compactSkills"] or False)
self.cbReopenFits.SetValue(self.openFitsSettings["enabled"])
self.cbShowTooltip.SetValue(self.sFit.serviceFittingOptions["showTooltip"] or False)
self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange)
self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalDmgPatternStateChange)
@@ -74,6 +78,7 @@ class PFGeneralPref ( PreferenceView):
self.cbRackLabels.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackLabels)
self.cbCompactSkills.Bind(wx.EVT_CHECKBOX, self.onCBCompactSkills)
self.cbReopenFits.Bind(wx.EVT_CHECKBOX, self.onCBReopenFits)
self.cbShowTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowTooltip)
self.cbRackLabels.Enable(self.sFit.serviceFittingOptions["rackSlots"] or False)
@@ -127,6 +132,9 @@ class PFGeneralPref ( PreferenceView):
def onCBReopenFits(self, event):
self.openFitsSettings["enabled"] = self.cbReopenFits.GetValue()
def onCBShowTooltip(self, event):
self.sFit.serviceFittingOptions["showTooltip"] = self.cbShowTooltip.GetValue()
def getImage(self):
return bitmapLoader.getBitmap("prefs_settings", "icons")

View File

@@ -30,6 +30,7 @@ class FirepowerViewFull(StatsView):
StatsView.__init__(self)
self.parent = parent
self._cachedValues = []
def getHeaderText(self, fit):
return "Firepower"
@@ -42,23 +43,21 @@ class FirepowerViewFull(StatsView):
parent = self.panel = contentPanel
self.headerPanel = headerPanel
headerContentSizer = wx.BoxSizer(wx.HORIZONTAL)
hsizer = headerPanel.GetSizer()
hsizer.Add(headerContentSizer,0,0,0)
self.stEff = wx.StaticText(headerPanel, wx.ID_ANY, "( Effective )")
headerContentSizer.Add(self.stEff)
headerPanel.GetParent().AddToggleItem(self.stEff)
hsizer = self.headerPanel.GetSizer()
self.stEff = wx.StaticText(self.headerPanel, wx.ID_ANY, "( Effective )")
hsizer.Add(self.stEff)
self.headerPanel.GetParent().AddToggleItem(self.stEff)
panel = "full"
sizerFirepower = wx.FlexGridSizer(1, 4)
sizerFirepower.AddGrowableCol(1)
contentSizer.Add( sizerFirepower, 0, wx.EXPAND, 0)
contentSizer.Add(sizerFirepower, 0, wx.EXPAND, 0)
counter = 0
for damageType, image in (("weapon", "turret") , ("drone", "droneDPS")):
for damageType, image in (("weapon", "turret"), ("drone", "droneDPS")):
baseBox = wx.BoxSizer(wx.HORIZONTAL)
sizerFirepower.Add(baseBox, 1, wx.ALIGN_LEFT if counter == 0 else wx.ALIGN_CENTER_HORIZONTAL)
@@ -73,10 +72,9 @@ class FirepowerViewFull(StatsView):
box.Add(hbox, 1, wx.ALIGN_CENTER)
lbl = wx.StaticText(parent, wx.ID_ANY, "0.0 DPS")
setattr(self, "label%sDps%s" % (panel.capitalize() ,damageType.capitalize()), lbl)
setattr(self, "label%sDps%s" % (panel.capitalize(), damageType.capitalize()), lbl)
hbox.Add(lbl, 0, wx.ALIGN_CENTER)
# hbox.Add(wx.StaticText(parent, wx.ID_ANY, " DPS"), 0, wx.ALIGN_CENTER)
self._cachedValues.append(0)
counter += 1
targetSizer = sizerFirepower
@@ -124,6 +122,12 @@ class FirepowerViewFull(StatsView):
# And no longer display us
self.panel.GetSizer().Clear(True)
self.panel.GetSizer().Layout()
# Remove effective label
hsizer = self.headerPanel.GetSizer()
hsizer.Remove(self.stEff)
self.stEff.Destroy()
# Get the new view
view = StatsView.getView("miningyieldViewFull")(self.parent)
view.populatePanel(self.panel, self.headerPanel)
@@ -143,7 +147,7 @@ class FirepowerViewFull(StatsView):
stats = (("labelFullDpsWeapon", lambda: fit.weaponDPS, 3, 0, 0, "%s DPS",None),
("labelFullDpsDrone", lambda: fit.droneDPS, 3, 0, 0, "%s DPS", None),
("labelFullVolleyTotal", lambda: fit.weaponVolley, 3, 0, 0, "%s", "Volley: %.1f"),
("labelFullVolleyTotal", lambda: fit.totalVolley, 3, 0, 0, "%s", "Volley: %.1f"),
("labelFullDpsTotal", lambda: fit.totalDPS, 3, 0, 0, "%s", None))
# See GH issue #
#if fit is not None and fit.totalYield > 0:

View File

@@ -42,7 +42,6 @@ class Ammo(ViewColumn):
return text
def getImageId(self, mod):
return -1

View File

@@ -48,4 +48,8 @@ class AmmoIcon(ViewColumn):
else:
return -1
def getToolTip(self, mod):
if isinstance(mod, Module) and mod.charge is not None:
return mod.charge.name
AmmoIcon.register()

View File

@@ -89,6 +89,12 @@ class AttributeDisplay(ViewColumn):
def getImageId(self, mod):
return -1
def getToolTip(self, stuff):
if self.info.name == "cpu":
return "CPU"
else:
return self.info.name.title()
@staticmethod
def getParameters():
return (("attribute", str, None),

Some files were not shown because too many files have changed in this diff Show More