From a0d2b13dd63f373cfb5b614da0936a3009645d57 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Tue, 7 Dec 2021 15:11:32 +0300 Subject: [PATCH] Add conversions --- eos/db/migrations/upgrade46.py | 68 +++++++++++++++++++++++++++ scripts/conversion.py | 36 ++++++++++++-- service/conversions/releaseDec2021.py | 31 ++++++++++++ 3 files changed, 130 insertions(+), 5 deletions(-) create mode 100644 eos/db/migrations/upgrade46.py diff --git a/eos/db/migrations/upgrade46.py b/eos/db/migrations/upgrade46.py new file mode 100644 index 0000000000..39868a15c1 --- /dev/null +++ b/eos/db/migrations/upgrade46.py @@ -0,0 +1,68 @@ +""" +Migration 46 + +- Mining crystal changes +""" + +CONVERSIONS = { + 60276: ( # Simple Asteroid Mining Crystal Type A I + 18066, # Veldspar Mining Crystal I + 18062, # Scordite Mining Crystal I + 18060, # Pyroxeres Mining Crystal I + 18058, # Plagioclase Mining Crystal I + ), + 60281: ( # Simple Asteroid Mining Crystal Type A II + 18618, # Veldspar Mining Crystal II + 18616, # Scordite Mining Crystal II + 18614, # Pyroxeres Mining Crystal II + 18612, # Plagioclase Mining Crystal II + ), + 60285: ( # Coherent Asteroid Mining Crystal Type A I + 18056, # Omber Mining Crystal I + 18052, # Kernite Mining Crystal I + 18050, # Jaspet Mining Crystal I + 18048, # Hemorphite Mining Crystal I + 18046, # Hedbergite Mining Crystal I + ), + 60288: ( # Coherent Asteroid Mining Crystal Type A II + 18610, # Omber Mining Crystal II + 18604, # Jaspet Mining Crystal II + 18606, # Kernite Mining Crystal II + 18600, # Hedbergite Mining Crystal II + 18602, # Hemorphite Mining Crystal II + ), + 60291: ( # Variegated Asteroid Mining Crystal Type A I + 18044, # Gneiss Mining Crystal I + 18042, # Dark Ochre Mining Crystal I + 18040, # Crokite Mining Crystal I + ), + 60294: ( # Variegated Asteroid Mining Crystal Type A II + 18598, # Gneiss Mining Crystal II + 18596, # Dark Ochre Mining Crystal II + 18594, # Crokite Mining Crystal II + ), + 60297: ( # Complex Asteroid Mining Crystal Type A I + 18038, # Bistot Mining Crystal I + 18036, # Arkonor Mining Crystal I + 18064, # Spodumain Mining Crystal I + ), + 60300: ( # Complex Asteroid Mining Crystal Type A II + 18592, # Bistot Mining Crystal II + 18590, # Arkonor Mining Crystal II + 18624, # Spodumain Mining Crystal II + ), +} + + +def upgrade(saveddata_engine): + # Convert modules + for replacement_item, list in CONVERSIONS.items(): + for retired_item in list: + saveddata_engine.execute('UPDATE "modules" SET "itemID" = ? WHERE "itemID" = ?', + (replacement_item, retired_item)) + saveddata_engine.execute('UPDATE "modules" SET "baseItemID" = ? WHERE "baseItemID" = ?', + (replacement_item, retired_item)) + saveddata_engine.execute('UPDATE "modules" SET "chargeID" = ? WHERE "chargeID" = ?', + (replacement_item, retired_item)) + saveddata_engine.execute('UPDATE "cargo" SET "itemID" = ? WHERE "itemID" = ?', + (replacement_item, retired_item)) diff --git a/scripts/conversion.py b/scripts/conversion.py index 75d2bb9358..6dc6a9d380 100644 --- a/scripts/conversion.py +++ b/scripts/conversion.py @@ -13,13 +13,39 @@ # change to correct conversion rename_phrase = " renamed to " -conversion_phrase = " converted to " +conversion_phrase = " -> " text = """ - 'Hypnos' Signal Distortion Amplifier I renamed to Hypnos Compact Signal Distortion Amplifier I - Initiated Signal Distortion Amplifier I converted to Hypnos Compact Signal Distortion Amplifier I - Induced Signal Distortion Amplifier I converted to Hypnos Compact Signal Distortion Amplifier I - Compulsive Signal Distortion Amplifier I converted to Hypnos Compact Signal Distortion Amplifier I +Veldspar Mining Crystal I -> Simple Asteroid Mining Crystal Type A I +Scordite Mining Crystal I -> Simple Asteroid Mining Crystal Type A I +Pyroxeres Mining Crystal I -> Simple Asteroid Mining Crystal Type A I +Plagioclase Mining Crystal I -> Simple Asteroid Mining Crystal Type A I +Veldspar Mining Crystal II -> Simple Asteroid Mining Crystal Type A II +Scordite Mining Crystal II -> Simple Asteroid Mining Crystal Type A II +Pyroxeres Mining Crystal II -> Simple Asteroid Mining Crystal Type A II +Plagioclase Mining Crystal II -> Simple Asteroid Mining Crystal Type A II +Omber Mining Crystal I -> Coherent Asteroid Mining Crystal Type A I +Kernite Mining Crystal I -> Coherent Asteroid Mining Crystal Type A I +Jaspet Mining Crystal I -> Coherent Asteroid Mining Crystal Type A I +Hemorphite Mining Crystal I -> Coherent Asteroid Mining Crystal Type A I +Hedbergite Mining Crystal I -> Coherent Asteroid Mining Crystal Type A I +Omber Mining Crystal II -> Coherent Asteroid Mining Crystal Type A II +Jaspet Mining Crystal II -> Coherent Asteroid Mining Crystal Type A II +Kernite Mining Crystal II -> Coherent Asteroid Mining Crystal Type A II +Hedbergite Mining Crystal II -> Coherent Asteroid Mining Crystal Type A II +Hemorphite Mining Crystal II -> Coherent Asteroid Mining Crystal Type A II +Gneiss Mining Crystal I -> Variegated Asteroid Mining Crystal Type A I +Dark Ochre Mining Crystal I -> Variegated Asteroid Mining Crystal Type A I +Crokite Mining Crystal I -> Variegated Asteroid Mining Crystal Type A I +Gneiss Mining Crystal II -> Variegated Asteroid Mining Crystal Type A II +Dark Ochre Mining Crystal II -> Variegated Asteroid Mining Crystal Type A II +Crokite Mining Crystal II -> Variegated Asteroid Mining Crystal Type A II +Bistot Mining Crystal I -> Complex Asteroid Mining Crystal Type A I +Arkonor Mining Crystal I -> Complex Asteroid Mining Crystal Type A I +Spodumain Mining Crystal I -> Complex Asteroid Mining Crystal Type A I +Bistot Mining Crystal II -> Complex Asteroid Mining Crystal Type A II +Arkonor Mining Crystal II -> Complex Asteroid Mining Crystal Type A II +Spodumain Mining Crystal II -> Complex Asteroid Mining Crystal Type A II """ def main(old, new): diff --git a/service/conversions/releaseDec2021.py b/service/conversions/releaseDec2021.py index 97730d6964..921a482299 100644 --- a/service/conversions/releaseDec2021.py +++ b/service/conversions/releaseDec2021.py @@ -19,4 +19,35 @@ "Exceptional Moon Ore Mining Crystal II": "Exceptional Moon Mining Crystal Type A II", "Industrial Core I": "Capital Industrial Core I", "Industrial Core II": "Capital Industrial Core II", + # Converted items + "Veldspar Mining Crystal I": "Simple Asteroid Mining Crystal Type A I", + "Scordite Mining Crystal I": "Simple Asteroid Mining Crystal Type A I", + "Pyroxeres Mining Crystal I": "Simple Asteroid Mining Crystal Type A I", + "Plagioclase Mining Crystal I": "Simple Asteroid Mining Crystal Type A I", + "Veldspar Mining Crystal II": "Simple Asteroid Mining Crystal Type A II", + "Scordite Mining Crystal II": "Simple Asteroid Mining Crystal Type A II", + "Pyroxeres Mining Crystal II": "Simple Asteroid Mining Crystal Type A II", + "Plagioclase Mining Crystal II": "Simple Asteroid Mining Crystal Type A II", + "Omber Mining Crystal I": "Coherent Asteroid Mining Crystal Type A I", + "Kernite Mining Crystal I": "Coherent Asteroid Mining Crystal Type A I", + "Jaspet Mining Crystal I": "Coherent Asteroid Mining Crystal Type A I", + "Hemorphite Mining Crystal I": "Coherent Asteroid Mining Crystal Type A I", + "Hedbergite Mining Crystal I": "Coherent Asteroid Mining Crystal Type A I", + "Omber Mining Crystal II": "Coherent Asteroid Mining Crystal Type A II", + "Jaspet Mining Crystal II": "Coherent Asteroid Mining Crystal Type A II", + "Kernite Mining Crystal II": "Coherent Asteroid Mining Crystal Type A II", + "Hedbergite Mining Crystal II": "Coherent Asteroid Mining Crystal Type A II", + "Hemorphite Mining Crystal II": "Coherent Asteroid Mining Crystal Type A II", + "Gneiss Mining Crystal I": "Variegated Asteroid Mining Crystal Type A I", + "Dark Ochre Mining Crystal I": "Variegated Asteroid Mining Crystal Type A I", + "Crokite Mining Crystal I": "Variegated Asteroid Mining Crystal Type A I", + "Gneiss Mining Crystal II": "Variegated Asteroid Mining Crystal Type A II", + "Dark Ochre Mining Crystal II": "Variegated Asteroid Mining Crystal Type A II", + "Crokite Mining Crystal II": "Variegated Asteroid Mining Crystal Type A II", + "Bistot Mining Crystal I": "Complex Asteroid Mining Crystal Type A I", + "Arkonor Mining Crystal I": "Complex Asteroid Mining Crystal Type A I", + "Spodumain Mining Crystal I": "Complex Asteroid Mining Crystal Type A I", + "Bistot Mining Crystal II": "Complex Asteroid Mining Crystal Type A II", + "Arkonor Mining Crystal II": "Complex Asteroid Mining Crystal Type A II", + "Spodumain Mining Crystal II": "Complex Asteroid Mining Crystal Type A II", }