From 0a1be7d966f73e8e975c657e5d741e1a07ff227f Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Mon, 6 Jun 2016 16:16:56 -0700 Subject: [PATCH 1/7] Update adaptivearmorhardener.py --- eos/effects/adaptivearmorhardener.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/eos/effects/adaptivearmorhardener.py b/eos/effects/adaptivearmorhardener.py index c3955ebf0..f2951320b 100644 --- a/eos/effects/adaptivearmorhardener.py +++ b/eos/effects/adaptivearmorhardener.py @@ -6,13 +6,5 @@ type = "active" def handler(fit, module, context): for type in ("kinetic", "thermal", "explosive", "em"): attr = "armor%sDamageResonance" % type.capitalize() - - #Adjust RAH to match the current damage pattern - damagePattern = fit.damagePattern - attrDamagePattern = "%sAmount" % type - damagePatternModifier = getattr(damagePattern,attrDamagePattern)/float(sum((damagePattern.emAmount,damagePattern.thermalAmount,damagePattern.kineticAmount,damagePattern.explosiveAmount))) - modifiedResistModifier = (1-(((1-module.getModifiedItemAttr(attr))*4)*(damagePatternModifier))) - module.forceItemAttr(attr, modifiedResistModifier) - fit.ship.multiplyItemAttr(attr, module.getModifiedItemAttr(attr), stackingPenalties=True, penaltyGroup="preMul") From 4c55827aa4bfbf0d695408417a13ea0ec997de7a Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Mon, 6 Jun 2016 16:18:16 -0700 Subject: [PATCH 2/7] call function to import defaults to database --- service/prefetch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service/prefetch.py b/service/prefetch.py index 664e5168c..fc2745533 100644 --- a/service/prefetch.py +++ b/service/prefetch.py @@ -56,3 +56,5 @@ else: # create and set version eos.db.saveddata_meta.create_all() eos.db.saveddata_engine.execute('PRAGMA user_version = {}'.format(migration.getAppVersion())) + #Import default database values + databaseDefaults.defaultDatabaseValues.importDefaults() From 8eb0b942c82aecec9e81fd8b202ce062e0dea4aa Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Mon, 6 Jun 2016 16:22:08 -0700 Subject: [PATCH 3/7] Remove _init_ hack to import the default pattern Removed the kludgey method of using _init_ to check to see if the Uniform 25/25/25/25 damage pattern exists, and if missing create it. Moved creation of it to prefetch.py. --- service/damagePattern.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/service/damagePattern.py b/service/damagePattern.py index b67b10956..7ce9fb4e9 100644 --- a/service/damagePattern.py +++ b/service/damagePattern.py @@ -33,13 +33,6 @@ class DamagePattern(): return cls.instance - def __init__(self): - uniform = eos.db.getDamagePattern("Uniform") - if uniform is None: - uniform = eos.types.DamagePattern(25, 25, 25, 25) - uniform.name = "Uniform" - eos.db.save(uniform) - def getDamagePatternList(self): return eos.db.getDamagePatternList() From 111e2cc0de1786585438f42f083c65bd702071db Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Mon, 6 Jun 2016 16:25:20 -0700 Subject: [PATCH 4/7] Loads default database values on DB creation Loads defaults for target resists and damage profiles....for now. Can be extended to add anything we want on DB creation. Can be extended to add a "load default value to database" button somewhere down the line, to support people who have existing databases and don't want to recreate them. --- eos/db/saveddata/loadDefaultDatabaseValues.py | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 eos/db/saveddata/loadDefaultDatabaseValues.py diff --git a/eos/db/saveddata/loadDefaultDatabaseValues.py b/eos/db/saveddata/loadDefaultDatabaseValues.py new file mode 100644 index 000000000..5f03c4d5b --- /dev/null +++ b/eos/db/saveddata/loadDefaultDatabaseValues.py @@ -0,0 +1,166 @@ +#=============================================================================== +# Copyright (C) 2010 Diego Duclos +# +# This file is part of pyfa. +# +# pyfa is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# pyfa is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with pyfa. If not, see . +#=============================================================================== + +import eos.db +import eos.types + +class ImportError(Exception): + pass + +class defaultDatabaseValues(): + instance = None + @classmethod + + def importDefaults(self): + damageProfileList = [] + damageProfileList.append(["Uniform", "25", "25", "25", "25"]) + damageProfileList.append(["[Generic)EM", "100", "0", "0", "0"]) + damageProfileList.append(["[Generic)Thermal", "0", "100", "0", "0"]) + damageProfileList.append(["[Generic)Kinetic", "0", "0", "100", "0"]) + damageProfileList.append(["[Generic)Explosive", "0", "0", "0", "100"]) + damageProfileList.append(["[NPC)[Asteroid) Blood Raiders", "5067", "4214", "0", "0"]) + damageProfileList.append(["[Bombs)Concussion Bomb", "0", "0", "6400", "0"]) + damageProfileList.append(["[Bombs)Electron Bomb", "6400", "0", "0", "0"]) + damageProfileList.append(["[Bombs)Scorch Bomb", "0", "6400", "0", "0"]) + damageProfileList.append(["[Bombs)Shrapnel Bomb", "0", "0", "0", "6400"]) + damageProfileList.append(["[Frequency Crystals)[T2) Gleam", "56", "56", "0", "0"]) + damageProfileList.append(["[Frequency Crystals)[T2) Aurora", "40", "24", "0", "0"]) + damageProfileList.append(["[Frequency Crystals)[T2) Scorch", "72", "16", "0", "0"]) + damageProfileList.append(["[Frequency Crystals)[T2) Conflagration", "61.6", "61.6", "0", "0"]) + damageProfileList.append(["[Frequency Crystals)Gamma", "61.6", "35.2", "0", "0"]) + damageProfileList.append(["[Frequency Crystals)Infrared", "44", "17.6", "0", "0"]) + damageProfileList.append(["[Frequency Crystals)Microwave", "35.2", "17.6", "0", "0"]) + damageProfileList.append(["[Frequency Crystals)Multifrequency", "61.6", "44", "0", "0"]) + damageProfileList.append(["[Frequency Crystals)Radio", "44", "0", "0", "0"]) + damageProfileList.append(["[Frequency Crystals)Standard", "44", "26.4", "0", "0"]) + damageProfileList.append(["[Frequency Crystals)Ultraviolet", "52.8", "26.4", "0", "0"]) + damageProfileList.append(["[Frequency Crystals)Xray", "52.8", "35.2", "0", "0"]) + damageProfileList.append(["[Hybrid Charges)[T2) Void", "0", "61.6", "61.6", "0"]) + damageProfileList.append(["[Hybrid Charges)[T2) Null", "0", "48", "40", "0"]) + damageProfileList.append(["[Hybrid Charges)[T2) Javelin", "0", "64", "48", "0"]) + damageProfileList.append(["[Hybrid Charges)[T2) Spike", "0", "32", "32", "0"]) + damageProfileList.append(["[Hybrid Charges)Antimatter", "0", "48", "67.2", "0"]) + damageProfileList.append(["[Hybrid Charges)Iridium", "0", "28.8", "38.4", "0"]) + damageProfileList.append(["[Hybrid Charges)Iron", "0", "19.2", "28.8", "0"]) + damageProfileList.append(["[Hybrid Charges)Lead", "0", "28.8", "48", "0"]) + damageProfileList.append(["[Hybrid Charges)Plutonium", "0", "48", "57.6", "0"]) + damageProfileList.append(["[Hybrid Charges)Thorium", "0", "38.4", "48", "0"]) + damageProfileList.append(["[Hybrid Charges)Tungsten", "0", "19.2", "38.4", "0"]) + damageProfileList.append(["[Hybrid Charges)Uranium", "0", "38.4", "57.6", "0"]) + damageProfileList.append(["[Missiles)Mjolnir", "100", "0", "0", "0"]) + damageProfileList.append(["[Missiles)Inferno", "0", "100", "0", "0"]) + damageProfileList.append(["[Missiles)Scourge", "0", "0", "100", "0"]) + damageProfileList.append(["[Missiles)Nova", "0", "0", "0", "100"]) + damageProfileList.append(["[Missiles)[Structure) Standup Missile", "100", "100", "100", "100"]) + damageProfileList.append(["[Projectile Ammo)[T2) Tremor", "0", "0", "24", "40"]) + damageProfileList.append(["[Projectile Ammo)[T2) Quake", "0", "0", "40", "72"]) + damageProfileList.append(["[Projectile Ammo)[T2) Hail", "0", "0", "26.4", "96.8"]) + damageProfileList.append(["[Projectile Ammo)[T2) Barrage", "0", "0", "40", "48"]) + damageProfileList.append(["[Projectile Ammo)Carbonized Lead", "0", "0", "35.2", "8.8"]) + damageProfileList.append(["[Projectile Ammo)Depleted Uranium", "0", "26.4", "17.6", "26.4"]) + damageProfileList.append(["[Projectile Ammo)EMP", "79.2", "0", "8.8", "17.6"]) + damageProfileList.append(["[Projectile Ammo)Fusion", "0", "0", "17.6", "88"]) + damageProfileList.append(["[Projectile Ammo)Nuclear", "0", "0", "8.8", "35.2"]) + damageProfileList.append(["[Projectile Ammo)Phased Plasma", "0", "88", "17.6", "0"]) + damageProfileList.append(["[Projectile Ammo)Proton", "26.4", "0", "17.6", "0"]) + damageProfileList.append(["[Projectile Ammo)Titanium Sabot", "0", "0", "52.8", "176"]) + damageProfileList.append(["[NPC (Burner)) Cruor (Blood Raiders)", "90", "90", "0", "0"]) + damageProfileList.append(["[NPC (Burner)) Dramiel (Angel)", "55", "0", "20", "96"]) + damageProfileList.append(["[NPC (Burner)) Daredevil (Serpentis)", "0", "110", "154", "0"]) + damageProfileList.append(["[NPC (Burner)) Succubus (Sanshas Nation)", "135", "30", "0", "0"]) + damageProfileList.append(["[NPC (Burner)) Worm (Guristas)", "0", "0", "228", "0"]) + damageProfileList.append(["[NPC (Burner)) Enyo", "0", "147", "147", "0"]) + damageProfileList.append(["[NPC (Burner)) Hawk", "0", "0", "247", "0"]) + damageProfileList.append(["[NPC (Burner)) Jaguar", "36", "0", "50", "182"]) + damageProfileList.append(["[NPC (Burner)) Vengeance", "232", "0", "0", "0"]) + damageProfileList.append(["[NPC (Burner)) Ashimmu (Blood Raiders)", "260", "100", "0", "0"]) + damageProfileList.append(["[NPC (Burner)) Talos", "0", "413", "413", "0"]) + damageProfileList.append(["[NPC (Burner)) Sentinel", "0", "75", "0", "90"]) + damageProfileList.append(["[NPC)[Asteroid) Angel Cartel", "1838", "562", "2215", "3838"]) + damageProfileList.append(["[NPC)[Deadspace) Angel Cartel", "369", "533", "1395", "3302"]) + damageProfileList.append(["[NPC)[Deadspace) Blood Raiders", "6040", "5052", "10", "15"]) + damageProfileList.append(["[NPC)[Asteroid) Guristas", "0", "1828", "7413", "0"]) + damageProfileList.append(["[NPC)[Deadspace) Guristas", "0", "1531", "9680", "0"]) + damageProfileList.append(["[NPC)[Asteroid) Rogue Drone", "394", "666", "1090", "1687"]) + damageProfileList.append(["[NPC)[Deadspace) Rogue Drone", "276", "1071", "1069", "871"]) + damageProfileList.append(["[NPC)[Asteroid) Sanshas Nation", "5586", "4112", "0", "0"]) + damageProfileList.append(["[NPC)[Deadspace) Sanshas Nation", "3009", "2237", "0", "0"]) + damageProfileList.append(["[NPC)[Asteroid) Serpentis", "0", "5373", "4813", "0"]) + damageProfileList.append(["[NPC)[Deadspace) Serpentis", "0", "3110", "1929", "0"]) + damageProfileList.append(["[NPC)[Mission) Amarr Empire", "4464", "3546", "97", "0"]) + damageProfileList.append(["[NPC)[Mission) Caldari State", "0", "2139", "4867", "0"]) + damageProfileList.append(["[NPC)[Mission) CONCORD", "336", "134", "212", "412"]) + damageProfileList.append(["[NPC)[Mission) Gallente Federation", "9", "3712", "2758", "0"]) + damageProfileList.append(["[NPC)[Mission) Khanid", "612", "483", "43", "6"]) + damageProfileList.append(["[NPC)[Mission) Minmatar Republic", "1024", "388", "1655", "4285"]) + damageProfileList.append(["[NPC)[Mission) Mordus Legion", "25", "262", "625", "0"]) + damageProfileList.append(["[NPC)[Mission) Thukker", "0", "52", "10", "79"]) + damageProfileList.append(["[NPC)[Other) Sleepers", "1472", "1472", "1384", "1384"]) + damageProfileList.append(["[NPC)[Other) Sansha Incursion", "1682", "1347", "3678", "3678"]) + for damageProfileRow in damageProfileList: + damageProfile = eos.db.getDamagePattern(damageProfileRow[0]) + if damageProfile is None: + damageProfile = eos.types.DamagePattern(damageProfileRow[1], damageProfileRow[2], damageProfileRow[3], damageProfileRow[4]) + damageProfile.name = damageProfileRow[0] + eos.db.save(damageProfile) + + targetResistProfileList = [] + targetResistProfileList.append(["Uniform", "25.0", "25.0", "25.0", "25.0"]) + targetResistProfileList.append(["[NPC][Other] Sleepers", "276344.0", "282094.0", "276344.0", "276344.0"]) + targetResistProfileList.append(["[NPC][Other] Sansha Incursion", "3426857.48", "3426682.48", "3427332.48", "3428257.48"]) + targetResistProfileList.append(["[NPC][Mission] Thukker", "2634.0", "2515.5", "3055.5", "3277.0"]) + targetResistProfileList.append(["[NPC][Mission] Mordus Legion", "36159.5", "34354.25", "25749.25", "30217.5"]) + targetResistProfileList.append(["[NPC][Mission] Minmatar Republic", "589004.85", "503918.35", "433839.85", "353693.35"]) + targetResistProfileList.append(["[NPC][Mission] Khanid", "15507.25", "19317.25", "24721.25", "29248.25"]) + targetResistProfileList.append(["[NPC][Mission] Gallente Federation", "424438.0", "359996.2", "304695.75", "491406.5"]) + targetResistProfileList.append(["[NPC][Mission] Caldari State", "566594.5", "420853.5", "347228.0", "496174.25"]) + targetResistProfileList.append(["[NPC][Mission] CONCORD", "31078.75", "30868.75", "31078.75", "31078.75"]) + targetResistProfileList.append(["[NPC][Mission] Amarr Empire", "342504.0", "412979.95", "485898.25", "556514.0"]) + targetResistProfileList.append(["[NPC][Deadspace] Serpentis", "193953.25", "163280.0", "132962.25", "225117.25"]) + targetResistProfileList.append(["[NPC][Deadspace] Sanshas Nation", "145001.25", "180259.5", "215316.0", "250180.75"]) + targetResistProfileList.append(["[NPC][Deadspace] Rogue Drone", "101197.1", "119606.05", "140270.65", "159592.2"]) + targetResistProfileList.append(["[NPC][Deadspace] Guristas", "258913.25", "188927.75", "153524.75", "224637.5"]) + targetResistProfileList.append(["[NPC][Deadspace] Blood Raiders", "152864.5", "188922.8", "224795.0", "260472.0"]) + targetResistProfileList.append(["[NPC][Deadspace] Angel Cartel", "266066.85", "229245.35", "193690.6", "157547.1"]) + targetResistProfileList.append(["[NPC][Asteroid] Serpentis", "306253.74", "274712.59", "253115.29", "339831.19"]) + targetResistProfileList.append(["[NPC][Asteroid] Sanshas Nation", "259921.52", "283226.65", "322865.57", "357884.28"]) + targetResistProfileList.append(["[NPC][Asteroid] Rogue Drone", "138988.6", "169915.05", "203907.15", "236665.7"]) + targetResistProfileList.append(["[NPC][Asteroid] Guristas", "333718.82", "266658.76", "228592.64", "296350.35"]) + targetResistProfileList.append(["[NPC][Asteroid] Blood Raiders", "253672.83", "282098.6", "326577.52", "362882.07"]) + targetResistProfileList.append(["[NPC][Asteroid] Angel Cartel", "283011.68", "252440.67", "230021.79", "200059.26"]) + targetResistProfileList.append(["[NPC (Burner)] Worm (Guristas)", "2787.0", "3193.0", "3501.0", "3583.0"]) + targetResistProfileList.append(["[NPC (Burner)] Vengeance", "2153.1", "1997.6", "2979.75", "3454.1"]) + targetResistProfileList.append(["[NPC (Burner)] Talos", "4470.0", "4440.0", "4980.0", "4260.0"]) + targetResistProfileList.append(["[NPC (Burner)] Succubus (Sanshas Nation)", "1805.0", "2130.0", "2495.0", "2700.0"]) + targetResistProfileList.append(["[NPC (Burner)] Sentinel", "3545.0", "2850.0", "3425.0", "4350.0"]) + targetResistProfileList.append(["[NPC (Burner)] Jaguar", "2760.02", "2273.37", "1580.76", "1741.44"]) + targetResistProfileList.append(["[NPC (Burner)] Hawk", "1142.9", "2998.82", "2677.29", "2000.35"]) + targetResistProfileList.append(["[NPC (Burner)] Enyo", "1910.07", "2598.33", "3147.09", "1025.76"]) + targetResistProfileList.append(["[NPC (Burner)] Dramiel (Angel)", "1729.0", "1734.0", "1907.0", "1900.0"]) + targetResistProfileList.append(["[NPC (Burner)] Daredevil (Serpentis)", "1855.0", "1775.0", "1955.0", "1635.0"]) + targetResistProfileList.append(["[NPC (Burner)] Cruor (Blood Raiders)", "7460.0", "7170.0", "7170.0", "7150.0"]) + targetResistProfileList.append(["[NPC (Burner)] Ashimmu (Blood Raiders)", "8480.0", "8800.0", "8720.0", "9240.0"]) + + + for targetResistProfileRow in targetResistProfileList: + resistsProfile = eos.db.getTargetResists(targetResistProfileRow[0]) + if resistsProfile is None: + resistsProfile = eos.types.eos.types.TargetResists(targetResistProfileRow[1], targetResistProfileRow[2], targetResistProfileRow[3], targetResistProfileRow[4]) + resistsProfile.name = targetResistProfileRow[0] + eos.db.save(resistsProfile) From ea106b60641f80a2023606f87364b4b78faa621b Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Sun, 12 Jun 2016 17:24:49 -0700 Subject: [PATCH 5/7] Updated to round values that are floats to int Only ints are handled currently, if you throw a float at it, you'll get a stacktrace. This is just a little safety to convert it to an int, so if we somehow get a float (like via database injection/modification), we quietly convert it to the expected format --- gui/patternEditor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/patternEditor.py b/gui/patternEditor.py index 46837ad28..c36a1e80c 100644 --- a/gui/patternEditor.py +++ b/gui/patternEditor.py @@ -239,7 +239,7 @@ class DmgPatternEditorDlg(wx.Dialog): for field in self.DAMAGE_TYPES: edit = getattr(self, "%sEdit" % field) - amount = getattr(p, "%sAmount" % field) + amount = int(round(getattr(p, "%sAmount" % field))) edit.SetValue(amount) self.block = False From 53da2f9bb215df97911db2201f1d68b6e1b250a4 Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Mon, 13 Jun 2016 13:49:56 -0700 Subject: [PATCH 6/7] Many updates Redid all the values, especially updated target resist profiles. Re-implemented the _init_ on service\damagePattern.py to check for default values. --- eos/db/saveddata/__init__.py | 3 +- eos/db/saveddata/loadDefaultDatabaseValues.py | 262 ++++++++++-------- gui/mainMenuBar.py | 3 +- service/damagePattern.py | 8 +- service/prefetch.py | 10 +- 5 files changed, 161 insertions(+), 125 deletions(-) diff --git a/eos/db/saveddata/__init__.py b/eos/db/saveddata/__init__.py index e43c6e601..c97707f68 100644 --- a/eos/db/saveddata/__init__.py +++ b/eos/db/saveddata/__init__.py @@ -14,6 +14,7 @@ __all__ = [ "targetResists", "override", "crest", - "implantSet" + "implantSet", + "loadDefaultDatabaseValues" ] diff --git a/eos/db/saveddata/loadDefaultDatabaseValues.py b/eos/db/saveddata/loadDefaultDatabaseValues.py index 5f03c4d5b..6eb38ef1d 100644 --- a/eos/db/saveddata/loadDefaultDatabaseValues.py +++ b/eos/db/saveddata/loadDefaultDatabaseValues.py @@ -27,92 +27,93 @@ class defaultDatabaseValues(): instance = None @classmethod - def importDefaults(self): + def importDamageProfileDefaults(self): damageProfileList = [] damageProfileList.append(["Uniform", "25", "25", "25", "25"]) - damageProfileList.append(["[Generic)EM", "100", "0", "0", "0"]) - damageProfileList.append(["[Generic)Thermal", "0", "100", "0", "0"]) - damageProfileList.append(["[Generic)Kinetic", "0", "0", "100", "0"]) - damageProfileList.append(["[Generic)Explosive", "0", "0", "0", "100"]) - damageProfileList.append(["[NPC)[Asteroid) Blood Raiders", "5067", "4214", "0", "0"]) - damageProfileList.append(["[Bombs)Concussion Bomb", "0", "0", "6400", "0"]) - damageProfileList.append(["[Bombs)Electron Bomb", "6400", "0", "0", "0"]) - damageProfileList.append(["[Bombs)Scorch Bomb", "0", "6400", "0", "0"]) - damageProfileList.append(["[Bombs)Shrapnel Bomb", "0", "0", "0", "6400"]) - damageProfileList.append(["[Frequency Crystals)[T2) Gleam", "56", "56", "0", "0"]) - damageProfileList.append(["[Frequency Crystals)[T2) Aurora", "40", "24", "0", "0"]) - damageProfileList.append(["[Frequency Crystals)[T2) Scorch", "72", "16", "0", "0"]) - damageProfileList.append(["[Frequency Crystals)[T2) Conflagration", "61.6", "61.6", "0", "0"]) - damageProfileList.append(["[Frequency Crystals)Gamma", "61.6", "35.2", "0", "0"]) - damageProfileList.append(["[Frequency Crystals)Infrared", "44", "17.6", "0", "0"]) - damageProfileList.append(["[Frequency Crystals)Microwave", "35.2", "17.6", "0", "0"]) - damageProfileList.append(["[Frequency Crystals)Multifrequency", "61.6", "44", "0", "0"]) - damageProfileList.append(["[Frequency Crystals)Radio", "44", "0", "0", "0"]) - damageProfileList.append(["[Frequency Crystals)Standard", "44", "26.4", "0", "0"]) - damageProfileList.append(["[Frequency Crystals)Ultraviolet", "52.8", "26.4", "0", "0"]) - damageProfileList.append(["[Frequency Crystals)Xray", "52.8", "35.2", "0", "0"]) - damageProfileList.append(["[Hybrid Charges)[T2) Void", "0", "61.6", "61.6", "0"]) - damageProfileList.append(["[Hybrid Charges)[T2) Null", "0", "48", "40", "0"]) - damageProfileList.append(["[Hybrid Charges)[T2) Javelin", "0", "64", "48", "0"]) - damageProfileList.append(["[Hybrid Charges)[T2) Spike", "0", "32", "32", "0"]) - damageProfileList.append(["[Hybrid Charges)Antimatter", "0", "48", "67.2", "0"]) - damageProfileList.append(["[Hybrid Charges)Iridium", "0", "28.8", "38.4", "0"]) - damageProfileList.append(["[Hybrid Charges)Iron", "0", "19.2", "28.8", "0"]) - damageProfileList.append(["[Hybrid Charges)Lead", "0", "28.8", "48", "0"]) - damageProfileList.append(["[Hybrid Charges)Plutonium", "0", "48", "57.6", "0"]) - damageProfileList.append(["[Hybrid Charges)Thorium", "0", "38.4", "48", "0"]) - damageProfileList.append(["[Hybrid Charges)Tungsten", "0", "19.2", "38.4", "0"]) - damageProfileList.append(["[Hybrid Charges)Uranium", "0", "38.4", "57.6", "0"]) - damageProfileList.append(["[Missiles)Mjolnir", "100", "0", "0", "0"]) - damageProfileList.append(["[Missiles)Inferno", "0", "100", "0", "0"]) - damageProfileList.append(["[Missiles)Scourge", "0", "0", "100", "0"]) - damageProfileList.append(["[Missiles)Nova", "0", "0", "0", "100"]) - damageProfileList.append(["[Missiles)[Structure) Standup Missile", "100", "100", "100", "100"]) - damageProfileList.append(["[Projectile Ammo)[T2) Tremor", "0", "0", "24", "40"]) - damageProfileList.append(["[Projectile Ammo)[T2) Quake", "0", "0", "40", "72"]) - damageProfileList.append(["[Projectile Ammo)[T2) Hail", "0", "0", "26.4", "96.8"]) - damageProfileList.append(["[Projectile Ammo)[T2) Barrage", "0", "0", "40", "48"]) - damageProfileList.append(["[Projectile Ammo)Carbonized Lead", "0", "0", "35.2", "8.8"]) - damageProfileList.append(["[Projectile Ammo)Depleted Uranium", "0", "26.4", "17.6", "26.4"]) - damageProfileList.append(["[Projectile Ammo)EMP", "79.2", "0", "8.8", "17.6"]) - damageProfileList.append(["[Projectile Ammo)Fusion", "0", "0", "17.6", "88"]) - damageProfileList.append(["[Projectile Ammo)Nuclear", "0", "0", "8.8", "35.2"]) - damageProfileList.append(["[Projectile Ammo)Phased Plasma", "0", "88", "17.6", "0"]) - damageProfileList.append(["[Projectile Ammo)Proton", "26.4", "0", "17.6", "0"]) - damageProfileList.append(["[Projectile Ammo)Titanium Sabot", "0", "0", "52.8", "176"]) - damageProfileList.append(["[NPC (Burner)) Cruor (Blood Raiders)", "90", "90", "0", "0"]) - damageProfileList.append(["[NPC (Burner)) Dramiel (Angel)", "55", "0", "20", "96"]) - damageProfileList.append(["[NPC (Burner)) Daredevil (Serpentis)", "0", "110", "154", "0"]) - damageProfileList.append(["[NPC (Burner)) Succubus (Sanshas Nation)", "135", "30", "0", "0"]) - damageProfileList.append(["[NPC (Burner)) Worm (Guristas)", "0", "0", "228", "0"]) - damageProfileList.append(["[NPC (Burner)) Enyo", "0", "147", "147", "0"]) - damageProfileList.append(["[NPC (Burner)) Hawk", "0", "0", "247", "0"]) - damageProfileList.append(["[NPC (Burner)) Jaguar", "36", "0", "50", "182"]) - damageProfileList.append(["[NPC (Burner)) Vengeance", "232", "0", "0", "0"]) - damageProfileList.append(["[NPC (Burner)) Ashimmu (Blood Raiders)", "260", "100", "0", "0"]) - damageProfileList.append(["[NPC (Burner)) Talos", "0", "413", "413", "0"]) - damageProfileList.append(["[NPC (Burner)) Sentinel", "0", "75", "0", "90"]) - damageProfileList.append(["[NPC)[Asteroid) Angel Cartel", "1838", "562", "2215", "3838"]) - damageProfileList.append(["[NPC)[Deadspace) Angel Cartel", "369", "533", "1395", "3302"]) - damageProfileList.append(["[NPC)[Deadspace) Blood Raiders", "6040", "5052", "10", "15"]) - damageProfileList.append(["[NPC)[Asteroid) Guristas", "0", "1828", "7413", "0"]) - damageProfileList.append(["[NPC)[Deadspace) Guristas", "0", "1531", "9680", "0"]) - damageProfileList.append(["[NPC)[Asteroid) Rogue Drone", "394", "666", "1090", "1687"]) - damageProfileList.append(["[NPC)[Deadspace) Rogue Drone", "276", "1071", "1069", "871"]) - damageProfileList.append(["[NPC)[Asteroid) Sanshas Nation", "5586", "4112", "0", "0"]) - damageProfileList.append(["[NPC)[Deadspace) Sanshas Nation", "3009", "2237", "0", "0"]) - damageProfileList.append(["[NPC)[Asteroid) Serpentis", "0", "5373", "4813", "0"]) - damageProfileList.append(["[NPC)[Deadspace) Serpentis", "0", "3110", "1929", "0"]) - damageProfileList.append(["[NPC)[Mission) Amarr Empire", "4464", "3546", "97", "0"]) - damageProfileList.append(["[NPC)[Mission) Caldari State", "0", "2139", "4867", "0"]) - damageProfileList.append(["[NPC)[Mission) CONCORD", "336", "134", "212", "412"]) - damageProfileList.append(["[NPC)[Mission) Gallente Federation", "9", "3712", "2758", "0"]) - damageProfileList.append(["[NPC)[Mission) Khanid", "612", "483", "43", "6"]) - damageProfileList.append(["[NPC)[Mission) Minmatar Republic", "1024", "388", "1655", "4285"]) - damageProfileList.append(["[NPC)[Mission) Mordus Legion", "25", "262", "625", "0"]) - damageProfileList.append(["[NPC)[Mission) Thukker", "0", "52", "10", "79"]) - damageProfileList.append(["[NPC)[Other) Sleepers", "1472", "1472", "1384", "1384"]) - damageProfileList.append(["[NPC)[Other) Sansha Incursion", "1682", "1347", "3678", "3678"]) + damageProfileList.append(["[Generic]EM", "100", "0", "0", "0"]) + damageProfileList.append(["[Generic]Thermal", "0", "100", "0", "0"]) + damageProfileList.append(["[Generic]Kinetic", "0", "0", "100", "0"]) + damageProfileList.append(["[Generic]Explosive", "0", "0", "0", "100"]) + damageProfileList.append(["[NPC][Asteroid] Blood Raiders", "5067", "4214", "0", "0"]) + damageProfileList.append(["[Bombs]Concussion Bomb", "0", "0", "6400", "0"]) + damageProfileList.append(["[Bombs]Electron Bomb", "6400", "0", "0", "0"]) + damageProfileList.append(["[Bombs]Scorch Bomb", "0", "6400", "0", "0"]) + damageProfileList.append(["[Bombs]Shrapnel Bomb", "0", "0", "0", "6400"]) + damageProfileList.append(["[Frequency Crystals][T2] Gleam", "56", "56", "0", "0"]) + damageProfileList.append(["[Frequency Crystals][T2] Aurora", "40", "24", "0", "0"]) + damageProfileList.append(["[Frequency Crystals][T2] Scorch", "72", "16", "0", "0"]) + damageProfileList.append(["[Frequency Crystals][T2] Conflagration", "61.6", "61.6", "0", "0"]) + damageProfileList.append(["[Frequency Crystals]Gamma", "61.6", "35.2", "0", "0"]) + damageProfileList.append(["[Frequency Crystals]Infrared", "44", "17.6", "0", "0"]) + damageProfileList.append(["[Frequency Crystals]Microwave", "35.2", "17.6", "0", "0"]) + damageProfileList.append(["[Frequency Crystals]Multifrequency", "61.6", "44", "0", "0"]) + damageProfileList.append(["[Frequency Crystals]Radio", "44", "0", "0", "0"]) + damageProfileList.append(["[Frequency Crystals]Standard", "44", "26.4", "0", "0"]) + damageProfileList.append(["[Frequency Crystals]Ultraviolet", "52.8", "26.4", "0", "0"]) + damageProfileList.append(["[Frequency Crystals]Xray", "52.8", "35.2", "0", "0"]) + damageProfileList.append(["[Hybrid Charges][T2] Void", "0", "61.6", "61.6", "0"]) + damageProfileList.append(["[Hybrid Charges][T2] Null", "0", "48", "40", "0"]) + damageProfileList.append(["[Hybrid Charges][T2] Javelin", "0", "64", "48", "0"]) + damageProfileList.append(["[Hybrid Charges][T2] Spike", "0", "32", "32", "0"]) + damageProfileList.append(["[Hybrid Charges]Antimatter", "0", "48", "67.2", "0"]) + damageProfileList.append(["[Hybrid Charges]Iridium", "0", "28.8", "38.4", "0"]) + damageProfileList.append(["[Hybrid Charges]Iron", "0", "19.2", "28.8", "0"]) + damageProfileList.append(["[Hybrid Charges]Lead", "0", "28.8", "48", "0"]) + damageProfileList.append(["[Hybrid Charges]Plutonium", "0", "48", "57.6", "0"]) + damageProfileList.append(["[Hybrid Charges]Thorium", "0", "38.4", "48", "0"]) + damageProfileList.append(["[Hybrid Charges]Tungsten", "0", "19.2", "38.4", "0"]) + damageProfileList.append(["[Hybrid Charges]Uranium", "0", "38.4", "57.6", "0"]) + damageProfileList.append(["[Missiles]Mjolnir", "100", "0", "0", "0"]) + damageProfileList.append(["[Missiles]Inferno", "0", "100", "0", "0"]) + damageProfileList.append(["[Missiles]Scourge", "0", "0", "100", "0"]) + damageProfileList.append(["[Missiles]Nova", "0", "0", "0", "100"]) + damageProfileList.append(["[Missiles][Structure) Standup Missile", "100", "100", "100", "100"]) + damageProfileList.append(["[Projectile Ammo][T2] Tremor", "0", "0", "24", "40"]) + damageProfileList.append(["[Projectile Ammo][T2] Quake", "0", "0", "40", "72"]) + damageProfileList.append(["[Projectile Ammo][T2] Hail", "0", "0", "26.4", "96.8"]) + damageProfileList.append(["[Projectile Ammo][T2] Barrage", "0", "0", "40", "48"]) + damageProfileList.append(["[Projectile Ammo]Carbonized Lead", "0", "0", "35.2", "8.8"]) + damageProfileList.append(["[Projectile Ammo]Depleted Uranium", "0", "26.4", "17.6", "26.4"]) + damageProfileList.append(["[Projectile Ammo]EMP", "79.2", "0", "8.8", "17.6"]) + damageProfileList.append(["[Projectile Ammo]Fusion", "0", "0", "17.6", "88"]) + damageProfileList.append(["[Projectile Ammo]Nuclear", "0", "0", "8.8", "35.2"]) + damageProfileList.append(["[Projectile Ammo]Phased Plasma", "0", "88", "17.6", "0"]) + damageProfileList.append(["[Projectile Ammo]Proton", "26.4", "0", "17.6", "0"]) + damageProfileList.append(["[Projectile Ammo]Titanium Sabot", "0", "0", "52.8", "176"]) + damageProfileList.append(["[NPC][Burner] Cruor (Blood Raiders)", "90", "90", "0", "0"]) + damageProfileList.append(["[NPC][Burner] Dramiel (Angel)", "55", "0", "20", "96"]) + damageProfileList.append(["[NPC][Burner] Daredevil (Serpentis)", "0", "110", "154", "0"]) + damageProfileList.append(["[NPC][Burner] Succubus (Sanshas Nation)", "135", "30", "0", "0"]) + damageProfileList.append(["[NPC][Burner] Worm (Guristas)", "0", "0", "228", "0"]) + damageProfileList.append(["[NPC][Burner] Enyo", "0", "147", "147", "0"]) + damageProfileList.append(["[NPC][Burner] Hawk", "0", "0", "247", "0"]) + damageProfileList.append(["[NPC][Burner] Jaguar", "36", "0", "50", "182"]) + damageProfileList.append(["[NPC][Burner] Vengeance", "232", "0", "0", "0"]) + damageProfileList.append(["[NPC][Burner] Ashimmu (Blood Raiders)", "260", "100", "0", "0"]) + damageProfileList.append(["[NPC][Burner] Talos", "0", "413", "413", "0"]) + damageProfileList.append(["[NPC][Burner] Sentinel", "0", "75", "0", "90"]) + damageProfileList.append(["[NPC][Asteroid] Angel Cartel", "1838", "562", "2215", "3838"]) + damageProfileList.append(["[NPC][Deadspace] Angel Cartel", "369", "533", "1395", "3302"]) + damageProfileList.append(["[NPC][Deadspace] Blood Raiders", "6040", "5052", "10", "15"]) + damageProfileList.append(["[NPC][Asteroid] Guristas", "0", "1828", "7413", "0"]) + damageProfileList.append(["[NPC][Deadspace] Guristas", "0", "1531", "9680", "0"]) + damageProfileList.append(["[NPC][Asteroid] Rogue Drone", "394", "666", "1090", "1687"]) + damageProfileList.append(["[NPC][Deadspace] Rogue Drone", "276", "1071", "1069", "871"]) + damageProfileList.append(["[NPC][Asteroid] Sanshas Nation", "5586", "4112", "0", "0"]) + damageProfileList.append(["[NPC][Deadspace] Sanshas Nation", "3009", "2237", "0", "0"]) + damageProfileList.append(["[NPC][Asteroid] Serpentis", "0", "5373", "4813", "0"]) + damageProfileList.append(["[NPC][Deadspace] Serpentis", "0", "3110", "1929", "0"]) + damageProfileList.append(["[NPC][Mission] Amarr Empire", "4464", "3546", "97", "0"]) + damageProfileList.append(["[NPC][Mission] Caldari State", "0", "2139", "4867", "0"]) + damageProfileList.append(["[NPC][Mission] CONCORD", "336", "134", "212", "412"]) + damageProfileList.append(["[NPC][Mission] Gallente Federation", "9", "3712", "2758", "0"]) + damageProfileList.append(["[NPC][Mission] Khanid", "612", "483", "43", "6"]) + damageProfileList.append(["[NPC][Mission] Minmatar Republic", "1024", "388", "1655", "4285"]) + damageProfileList.append(["[NPC][Mission] Mordus Legion", "25", "262", "625", "0"]) + damageProfileList.append(["[NPC][Mission] Thukker", "0", "52", "10", "79"]) + damageProfileList.append(["[NPC][Other] Sleepers", "1472", "1472", "1384", "1384"]) + damageProfileList.append(["[NPC][Other] Sansha Incursion", "1682", "1347", "3678", "3678"]) + for damageProfileRow in damageProfileList: damageProfile = eos.db.getDamagePattern(damageProfileRow[0]) if damageProfile is None: @@ -120,47 +121,66 @@ class defaultDatabaseValues(): damageProfile.name = damageProfileRow[0] eos.db.save(damageProfile) + def importResistProfileDefaults(self): targetResistProfileList = [] - targetResistProfileList.append(["Uniform", "25.0", "25.0", "25.0", "25.0"]) - targetResistProfileList.append(["[NPC][Other] Sleepers", "276344.0", "282094.0", "276344.0", "276344.0"]) - targetResistProfileList.append(["[NPC][Other] Sansha Incursion", "3426857.48", "3426682.48", "3427332.48", "3428257.48"]) - targetResistProfileList.append(["[NPC][Mission] Thukker", "2634.0", "2515.5", "3055.5", "3277.0"]) - targetResistProfileList.append(["[NPC][Mission] Mordus Legion", "36159.5", "34354.25", "25749.25", "30217.5"]) - targetResistProfileList.append(["[NPC][Mission] Minmatar Republic", "589004.85", "503918.35", "433839.85", "353693.35"]) - targetResistProfileList.append(["[NPC][Mission] Khanid", "15507.25", "19317.25", "24721.25", "29248.25"]) - targetResistProfileList.append(["[NPC][Mission] Gallente Federation", "424438.0", "359996.2", "304695.75", "491406.5"]) - targetResistProfileList.append(["[NPC][Mission] Caldari State", "566594.5", "420853.5", "347228.0", "496174.25"]) - targetResistProfileList.append(["[NPC][Mission] CONCORD", "31078.75", "30868.75", "31078.75", "31078.75"]) - targetResistProfileList.append(["[NPC][Mission] Amarr Empire", "342504.0", "412979.95", "485898.25", "556514.0"]) - targetResistProfileList.append(["[NPC][Deadspace] Serpentis", "193953.25", "163280.0", "132962.25", "225117.25"]) - targetResistProfileList.append(["[NPC][Deadspace] Sanshas Nation", "145001.25", "180259.5", "215316.0", "250180.75"]) - targetResistProfileList.append(["[NPC][Deadspace] Rogue Drone", "101197.1", "119606.05", "140270.65", "159592.2"]) - targetResistProfileList.append(["[NPC][Deadspace] Guristas", "258913.25", "188927.75", "153524.75", "224637.5"]) - targetResistProfileList.append(["[NPC][Deadspace] Blood Raiders", "152864.5", "188922.8", "224795.0", "260472.0"]) - targetResistProfileList.append(["[NPC][Deadspace] Angel Cartel", "266066.85", "229245.35", "193690.6", "157547.1"]) - targetResistProfileList.append(["[NPC][Asteroid] Serpentis", "306253.74", "274712.59", "253115.29", "339831.19"]) - targetResistProfileList.append(["[NPC][Asteroid] Sanshas Nation", "259921.52", "283226.65", "322865.57", "357884.28"]) - targetResistProfileList.append(["[NPC][Asteroid] Rogue Drone", "138988.6", "169915.05", "203907.15", "236665.7"]) - targetResistProfileList.append(["[NPC][Asteroid] Guristas", "333718.82", "266658.76", "228592.64", "296350.35"]) - targetResistProfileList.append(["[NPC][Asteroid] Blood Raiders", "253672.83", "282098.6", "326577.52", "362882.07"]) - targetResistProfileList.append(["[NPC][Asteroid] Angel Cartel", "283011.68", "252440.67", "230021.79", "200059.26"]) - targetResistProfileList.append(["[NPC (Burner)] Worm (Guristas)", "2787.0", "3193.0", "3501.0", "3583.0"]) - targetResistProfileList.append(["[NPC (Burner)] Vengeance", "2153.1", "1997.6", "2979.75", "3454.1"]) - targetResistProfileList.append(["[NPC (Burner)] Talos", "4470.0", "4440.0", "4980.0", "4260.0"]) - targetResistProfileList.append(["[NPC (Burner)] Succubus (Sanshas Nation)", "1805.0", "2130.0", "2495.0", "2700.0"]) - targetResistProfileList.append(["[NPC (Burner)] Sentinel", "3545.0", "2850.0", "3425.0", "4350.0"]) - targetResistProfileList.append(["[NPC (Burner)] Jaguar", "2760.02", "2273.37", "1580.76", "1741.44"]) - targetResistProfileList.append(["[NPC (Burner)] Hawk", "1142.9", "2998.82", "2677.29", "2000.35"]) - targetResistProfileList.append(["[NPC (Burner)] Enyo", "1910.07", "2598.33", "3147.09", "1025.76"]) - targetResistProfileList.append(["[NPC (Burner)] Dramiel (Angel)", "1729.0", "1734.0", "1907.0", "1900.0"]) - targetResistProfileList.append(["[NPC (Burner)] Daredevil (Serpentis)", "1855.0", "1775.0", "1955.0", "1635.0"]) - targetResistProfileList.append(["[NPC (Burner)] Cruor (Blood Raiders)", "7460.0", "7170.0", "7170.0", "7150.0"]) - targetResistProfileList.append(["[NPC (Burner)] Ashimmu (Blood Raiders)", "8480.0", "8800.0", "8720.0", "9240.0"]) - - + targetResistProfileList.append(["Uniform (25%)", "0.25", "0.25", "0.25", "0.25"]) + targetResistProfileList.append(["Uniform (50%)", "0.50", "0.50", "0.50", "0.50"]) + targetResistProfileList.append(["Uniform (75%)", "0.75", "0.75", "0.75", "0.75"]) + targetResistProfileList.append(["[T1 Resist]Shield", "0.0", "0.20", "0.40", "0.50"]) + targetResistProfileList.append(["[T1 Resist]Armor", "0.50", "0.45", "0.25", "0.10"]) + targetResistProfileList.append(["[T1 Resist]Hull", "0.33", "0.33", "0.33", "0.33"]) + targetResistProfileList.append(["[T1 Resist]Shield (+T2 DCU)", "0.125", "0.30", "0.475", "0.562"]) + targetResistProfileList.append(["[T1 Resist]Armor (+T2 DCU)", "0.575", "0.532", "0.363", "0.235"]) + targetResistProfileList.append(["[T1 Resist]Hull (+T2 DCU)", "0.598", "0.598", "0.598", "0.598"]) + targetResistProfileList.append(["[NPC][Asteroid] Angel Cartel", "0.54", "0.42", "0.37", "0.32"]) + targetResistProfileList.append(["[NPC][Asteroid] Blood Raiders", "0.34", "0.39", "0.45", "0.52"]) + targetResistProfileList.append(["[NPC][Asteroid] Guristas", "0.55", "0.35", "0.3", "0.48"]) + targetResistProfileList.append(["[NPC][Asteroid] Rogue Drones", "0.35", "0.38", "0.44", "0.49"]) + targetResistProfileList.append(["[NPC][Asteroid] Sanshas Nation", "0.35", "0.4", "0.47", "0.53"]) + targetResistProfileList.append(["[NPC][Asteroid] Serpentis", "0.49", "0.38", "0.29", "0.51"]) + targetResistProfileList.append(["[NPC][Deadspace] Angel Cartel", "0.59", "0.48", "0.4", "0.32"]) + targetResistProfileList.append(["[NPC][Deadspace] Blood Raiders", "0.31", "0.39", "0.47", "0.56"]) + targetResistProfileList.append(["[NPC][Deadspace] Guristas", "0.57", "0.39", "0.31", "0.5"]) + targetResistProfileList.append(["[NPC][Deadspace] Rogue Drones", "0.42", "0.42", "0.47", "0.49"]) + targetResistProfileList.append(["[NPC][Deadspace] Sanshas Nation", "0.31", "0.39", "0.47", "0.56"]) + targetResistProfileList.append(["[NPC][Deadspace] Serpentis", "0.49", "0.38", "0.29", "0.56"]) + targetResistProfileList.append(["[NPC][Mission] Amarr Empire", "0.34", "0.38", "0.42", "0.46"]) + targetResistProfileList.append(["[NPC][Mission] Caldari State", "0.51", "0.38", "0.3", "0.51"]) + targetResistProfileList.append(["[NPC][Mission] CONCORD", "0.47", "0.46", "0.47", "0.47"]) + targetResistProfileList.append(["[NPC][Mission] Gallente Federation", "0.51", "0.38", "0.31", "0.52"]) + targetResistProfileList.append(["[NPC][Mission] Khanid", "0.51", "0.42", "0.36", "0.4"]) + targetResistProfileList.append(["[NPC][Mission] Minmatar Republic", "0.51", "0.46", "0.41", "0.35"]) + targetResistProfileList.append(["[NPC][Mission] Mordus Legion", "0.32", "0.48", "0.4", "0.62"]) + targetResistProfileList.append(["[NPC][Other] Sleeper", "0.61", "0.61", "0.61", "0.61"]) + targetResistProfileList.append(["[NPC][Other] Sansha Incursion", "0.65", "0.63", "0.64", "0.65"]) + targetResistProfileList.append(["[NPC][Burner] Cruor (Blood Raiders)", "0.8", "0.73", "0.69", "0.67"]) + targetResistProfileList.append(["[NPC][Burner] Dramiel (Angel)", "0.35", "0.48", "0.61", "0.68"]) + targetResistProfileList.append(["[NPC][Burner] Daredevil (Serpentis)", "0.69", "0.59", "0.59", "0.43"]) + targetResistProfileList.append(["[NPC][Burner] Succubus (Sanshas Nation)", "0.35", "0.48", "0.61", "0.68"]) + targetResistProfileList.append(["[NPC][Burner] Worm (Guristas)", "0.48", "0.58", "0.69", "0.74"]) + targetResistProfileList.append(["[NPC][Burner] Enyo", "0.58", "0.72", "0.86", "0.24"]) + targetResistProfileList.append(["[NPC][Burner] Hawk", "0.3", "0.86", "0.79", "0.65"]) + targetResistProfileList.append(["[NPC][Burner] Jaguar", "0.78", "0.65", "0.48", "0.56"]) + targetResistProfileList.append(["[NPC][Burner] Vengeance", "0.66", "0.56", "0.75", "0.86"]) + targetResistProfileList.append(["[NPC][Burner] Ashimmu (Blood Raiders)", "0.8", "0.76", "0.68", "0.7"]) + targetResistProfileList.append(["[NPC][Burner] Talos", "0.68", "0.59", "0.59", "0.43"]) + targetResistProfileList.append(["[NPC][Burner] Sentinel", "0.58", "0.45", "0.52", "0.66"]) + for targetResistProfileRow in targetResistProfileList: resistsProfile = eos.db.getTargetResists(targetResistProfileRow[0]) if resistsProfile is None: resistsProfile = eos.types.eos.types.TargetResists(targetResistProfileRow[1], targetResistProfileRow[2], targetResistProfileRow[3], targetResistProfileRow[4]) resistsProfile.name = targetResistProfileRow[0] eos.db.save(resistsProfile) + + def importRequiredDefaults(self): + damageProfileList = [] + damageProfileList.append(["Uniform", "25", "25", "25", "25"]) + + for damageProfileRow in damageProfileList: + damageProfile = eos.db.getDamagePattern(damageProfileRow[0]) + if damageProfile is None: + damageProfile = eos.types.DamagePattern(damageProfileRow[1], damageProfileRow[2], damageProfileRow[3], + damageProfileRow[4]) + damageProfile.name = damageProfileRow[0] + eos.db.save(damageProfile) diff --git a/gui/mainMenuBar.py b/gui/mainMenuBar.py index e8c3cb614..291c4c947 100644 --- a/gui/mainMenuBar.py +++ b/gui/mainMenuBar.py @@ -73,6 +73,8 @@ class MainMenuBar(wx.MenuBar): fileMenu.Append(self.exportSkillsNeededId, "Export &Skills Needed", "Export skills needed for this fitting") fileMenu.Append(self.importCharacterId, "Import C&haracter File", "Import characters into pyfa from file") fileMenu.AppendSeparator() + fileMenu.Append(self.importDatabaseDefaults, "Import D&atabase Defaults", "Imports missing database defaults") + fileMenu.AppendSeparator() fileMenu.Append(wx.ID_EXIT) # Edit menu @@ -139,7 +141,6 @@ class MainMenuBar(wx.MenuBar): attrItem = wx.MenuItem(windowMenu, self.attrEditorId, "Attribute Overrides\tCTRL+B") attrItem.SetBitmap(BitmapLoader.getBitmap("fit_rename_small", "gui")) windowMenu.AppendItem(attrItem) - editMenu.AppendSeparator() editMenu.Append(self.toggleOverridesId, "Turn Overrides On") diff --git a/service/damagePattern.py b/service/damagePattern.py index 7ce9fb4e9..b379c5ed7 100644 --- a/service/damagePattern.py +++ b/service/damagePattern.py @@ -19,6 +19,7 @@ import eos.db import eos.types +import eos.db.saveddata.loadDefaultDatabaseValues as loadDefaultDatabaseValues import copy class ImportError(Exception): @@ -33,6 +34,12 @@ class DamagePattern(): return cls.instance + def __init__(self): + uniform = eos.db.getDamagePattern("Uniform") + importDBDefaults = loadDefaultDatabaseValues.defaultDatabaseValues() + if uniform is None: + importDBDefaults.importRequiredDefaults() + def getDamagePatternList(self): return eos.db.getDamagePatternList() @@ -89,4 +96,3 @@ class DamagePattern(): patterns.sort(key=lambda p: p.name) return eos.types.DamagePattern.exportPatterns(*patterns) - diff --git a/service/prefetch.py b/service/prefetch.py index fc2745533..4d7330728 100644 --- a/service/prefetch.py +++ b/service/prefetch.py @@ -22,6 +22,7 @@ import config import os import eos.types import eos.db.migration as migration +import eos.db.saveddata.loadDefaultDatabaseValues as loadDefaultDatabaseValues class PrefetchThread(threading.Thread): def run(self): @@ -57,4 +58,11 @@ else: eos.db.saveddata_meta.create_all() eos.db.saveddata_engine.execute('PRAGMA user_version = {}'.format(migration.getAppVersion())) #Import default database values - databaseDefaults.defaultDatabaseValues.importDefaults() + importDBDefaults = loadDefaultDatabaseValues.defaultDatabaseValues() + #Import values that must exist otherwise Pyfa breaks + importDBDefaults.importRequiredDefaults() + #Import default values for damage profiles + importDBDefaults.importDamageProfileDefaults() + #Import default values for target resist profiles + importDBDefaults.importResistProfileDefaults() + From b4694dcf03ed4a0b8947b5bd4a0ff0eb424fa0e9 Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Mon, 13 Jun 2016 14:13:38 -0700 Subject: [PATCH 7/7] Implemented menu option to import default database values Allows for existing databases to be updated with the current default profiles. Can also be used to inject other defaults (maybe 0 and V chars?) --- gui/mainFrame.py | 13 +++++++++++++ gui/mainMenuBar.py | 5 ++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 7557813db..91e16566a 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -38,6 +38,7 @@ import gui.aboutData import gui.chromeTabs import gui.utils.animUtils as animUtils import gui.globalEvents as GE +import eos.db.saveddata.loadDefaultDatabaseValues as loadDefaultDatabaseValues from gui.bitmapLoader import BitmapLoader from gui.mainMenuBar import MainMenuBar @@ -405,10 +406,22 @@ class MainFrame(wx.Frame): def goForums(self, event): webbrowser.open('https://forums.eveonline.com/default.aspx?g=posts&t=466425') + def loadDatabaseDefaults(self, event): + # Import default database values + importDBDefaults = loadDefaultDatabaseValues.defaultDatabaseValues() + # Import values that must exist otherwise Pyfa breaks + importDBDefaults.importRequiredDefaults() + # Import default values for damage profiles + importDBDefaults.importDamageProfileDefaults() + # Import default values for target resist profiles + importDBDefaults.importResistProfileDefaults() + def registerMenu(self): menuBar = self.GetMenuBar() # Quit self.Bind(wx.EVT_MENU, self.ExitApp, id=wx.ID_EXIT) + # Load Default Database values + self.Bind(wx.EVT_MENU, self.loadDatabaseDefaults, id=menuBar.importDatabaseDefaultsId) # Widgets Inspector if config.debug: self.Bind(wx.EVT_MENU, self.openWXInspectTool, id = self.widgetInspectMenuID) diff --git a/gui/mainMenuBar.py b/gui/mainMenuBar.py index 291c4c947..169ed4e6c 100644 --- a/gui/mainMenuBar.py +++ b/gui/mainMenuBar.py @@ -49,6 +49,7 @@ class MainMenuBar(wx.MenuBar): self.ssoLoginId = wx.NewId() self.attrEditorId = wx.NewId() self.toggleOverridesId = wx.NewId() + self.importDatabaseDefaultsId = wx.NewId() if 'wxMac' in wx.PlatformInfo and wx.VERSION >= (3,0): wx.ID_COPY = wx.NewId() @@ -73,7 +74,7 @@ class MainMenuBar(wx.MenuBar): fileMenu.Append(self.exportSkillsNeededId, "Export &Skills Needed", "Export skills needed for this fitting") fileMenu.Append(self.importCharacterId, "Import C&haracter File", "Import characters into pyfa from file") fileMenu.AppendSeparator() - fileMenu.Append(self.importDatabaseDefaults, "Import D&atabase Defaults", "Imports missing database defaults") + fileMenu.Append(self.importDatabaseDefaultsId, "Import D&atabase Defaults", "Imports missing database defaults") fileMenu.AppendSeparator() fileMenu.Append(wx.ID_EXIT) @@ -173,5 +174,3 @@ class MainMenuBar(wx.MenuBar): self.Enable(self.revertCharId, char.isDirty) event.Skip() - -