From 418e3dd76250898b6a7709941de1df610d51347c Mon Sep 17 00:00:00 2001 From: Roy Falk Date: Wed, 20 Nov 2024 11:08:21 +0200 Subject: [PATCH 1/2] Fix issue caused by new drive PR Resource now save in format x/y/z which breaks ship_info --- python/base_computer/ship_view.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/python/base_computer/ship_view.py b/python/base_computer/ship_view.py index e6c4198e..cb469693 100644 --- a/python/base_computer/ship_view.py +++ b/python/base_computer/ship_view.py @@ -276,8 +276,25 @@ def get_durability(ship_stats): return text +def clean_ship_stats(ship_stats): + skip = ['Directory'] + for key, value in ship_stats.items(): + resource = value.split('/') + + # Check if resource + if len(resource) != 3: + continue + + # Skip? + if key in skip: + continue + + ship_stats[key] = float(resource[0]) + + def get_ship_description(ship_stats): + clean_ship_stats(ship_stats) locale.setlocale(locale.LC_ALL, '') text = get_notes(ship_stats) From 64d39e5946c33e25db2f7d4a43cea6fab9a4d964 Mon Sep 17 00:00:00 2001 From: Roy Falk Date: Fri, 22 Nov 2024 09:47:41 +0200 Subject: [PATCH 2/2] Merge (sort of) from task_drives --- units/ships.json | 8 ++++---- units/units.json | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/units/ships.json b/units/ships.json index c06e7293..07b6b37e 100644 --- a/units/ships.json +++ b/units/ships.json @@ -6183,9 +6183,9 @@ "Use_Rapid": "1", "Mass": "250", "Shield_Recharge": "8", - "Warp_Capacitor": "325", + "Warp_Capacitor": "400", "Primary_Capacitor": "200", - "Reactor_Recharge": "30", + "Reactor_Recharge": "44", "Outsystem_Jump_Cost": "200", "Afterburner_Speed_Governor": "120", "Default_Speed_Governor": "120", @@ -6195,7 +6195,7 @@ "Lock_Cone": "25", "Light": "{supernova.bmp.bfxm;0;0.35;-2.09200;2;;;;;}{supernova.bmp.bfxm;1.31;0;-1.82200;2;;;;;}{supernova.bmp.bfxm;-1.32800;0;-1.82200;2;;;;;}{supernova.bmp.bfxm;1.316;0.450;-1.37;0.5;1;1;1;1;0.0005;0;-1;0}{supernova.bmp.bfxm;1.963;0.010;-1.37;0.5;1;1;1;1;0.0005;-1;0;0}{supernova.bmp.bfxm;1.316;-0.431;-1.37;0.5;1;1;1;1;0.0005;0;1;0}{supernova.bmp.bfxm;-1.316;0.450;-1.37;0.5;1;1;1;1;0.0005;0;-1;0}{supernova.bmp.bfxm;-1.963;0.010;-1.37;0.5;1;1;1;1;0.0005;1;0;0}{supernova.bmp.bfxm;-1.316;-0.431;-1.37;0.5;1;1;1;1;0.0005;0;1;0}{supernova.bmp.bfxm;1.059;0.346;2.327;0.5;1;1;1;1;0.0005;0;-1;0}{supernova.bmp.bfxm;1.454;0.094;2.327;0.5;1;1;1;1;0.0005;-1;0;0}{supernova.bmp.bfxm;1.059;-0.157;2.327;0.5;1;1;1;1;0.0005;0;1;0}{supernova.bmp.bfxm;-1.059;0.346;2.327;0.5;1;1;1;1;0.0005;0;-1;0}{supernova.bmp.bfxm;-1.454;0.094;2.327;0.5;1;1;1;1;0.0005;1;0;0}{supernova.bmp.bfxm;-1.059;-0.157;2.327;0.5;1;1;1;1;0.0005;0;1;0}{supernova.bmp.bfxm;1.652;0.208;1.565;0.8;1;1;1;1;0.0005;0;0;-1}{supernova.bmp.bfxm;-1.652;0.208;1.565;0.8;1;1;1;1;0.0005;0;0;-1}", "Mounts": "{laser;;15;Light;1.01200;-6.80000e-2;3.40800;;;;;;;;;1;1}{laser;;15;Light;-0.964000;-6.80000e-2;3.40800;;;;;;;;;1;1}{laser;;3;Light;0.380000;0.176000;1.07600;;;;;;;;;1;1}{laser;;3;Light;-0.336000;0.176000;1.07600;;;;;;;;;1;1}{Dumbfire;48;48;light-missile medium-missile special-missile;0;0;0;;;;;;;;;1;1}{;;48;light-missile medium-missile special-missile;0;0;0;;;;;;;;;1;1}", - "Cargo": "{skyscope1;upgrades/Sensors/Common;200;1;0.01;1;1;1;@upgrades/skyscope_alpha.png@Refurbished Part;0}{capacitor02;upgrades/Capacitors/Standard;200;1;4;4;1;1;@upgrades/capacitor.png@Refurbished Part;0}{reactor02;upgrades/Reactors/Standard;200;1;2;3.5;1;1;@upgrades/reactor.png@Refurbished Part;0}{add_spec_capacitor01;upgrades/SPEC_Capacitors;200;1;5;4;1;1;@upgrades/reactor_capacitance.png@Refurbished Part;0}{quadshield02;upgrades/Shield_Systems/Standard_Quad_Shields;200;1;2;8;1;1;@upgrades/shield.png@Refurbished Part;0}{armor02;upgrades/Armor;200;1;20;0;1;1;@cargo/plasteel.png@Refurbished Part;0}", + "Cargo": "{skyscope1;upgrades/Sensors/Common;200;1;0.01;1;1;1;@upgrades/skyscope_alpha.png@Refurbished Part;0}{capacitor02;upgrades/Capacitors/Standard;200;1;4;4;1;1;@upgrades/capacitor.png@Refurbished Part;0}{reactor03;upgrades/Reactors/Standard;200;1;2;3.5;1;1;@upgrades/reactor.png@Refurbished Part;0}{add_spec_capacitor01;upgrades/SPEC_Capacitors;200;1;5;4;1;1;@upgrades/reactor_capacitance.png@Refurbished Part;0}{quadshield02;upgrades/Shield_Systems/Standard_Quad_Shields;200;1;2;8;1;1;@upgrades/shield.png@Refurbished Part;0}{armor02;upgrades/Armor;200;1;20;0;1;1;@cargo/plasteel.png@Refurbished Part;0}", "shield_facets": "4", "armor": "100", "shield_strength": "150" @@ -7363,4 +7363,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/units/units.json b/units/units.json index db28d4a9..4c464d49 100644 --- a/units/units.json +++ b/units/units.json @@ -767,7 +767,7 @@ { "Key": "mult_overdrive01__upgrades", "Name": "Overdrive I", - "Upgrade_Type": "Afterburner", + "Upgrade_Type": "Afterburner_Upgrade", "Object_Type": "Upgrade_Replacement", "Textual_Description": "\"@upgrades/afterburner_generic.png@Engine overdrive. Increases thrust at the expense of decreased fuel efficiency. Comes bundled with appropriate vector-governor firmware updates.\"\n", "Mass": "1", @@ -779,7 +779,7 @@ { "Key": "mult_overdrive02__upgrades", "Name": "Overdrive II", - "Upgrade_Type": "Afterburner", + "Upgrade_Type": "Afterburner_Upgrade", "Object_Type": "Upgrade_Replacement", "Textual_Description": "\"@upgrades/afterburner_generic.png@Engine overdrive. Increases thrust at the expense of decreased fuel efficiency. Comes bundled with appropriate vector-governor firmware updates.\"\n", "Mass": "1", @@ -791,7 +791,7 @@ { "Key": "mult_overdrive03__upgrades", "Name": "Overdrive III", - "Upgrade_Type": "Afterburner", + "Upgrade_Type": "Afterburner_Upgrade", "Object_Type": "Upgrade_Replacement", "Textual_Description": "\"@upgrades/afterburner_generic.png@Engine overdrive. Increases thrust at the expense of decreased fuel efficiency. Comes bundled with appropriate vector-governor firmware updates.\"\n", "Mass": "1", @@ -803,7 +803,7 @@ { "Key": "mult_overdrive04__upgrades", "Name": "Overdrive IV", - "Upgrade_Type": "Afterburner", + "Upgrade_Type": "Afterburner_Upgrade", "Object_Type": "Upgrade_Replacement", "Textual_Description": "\"@upgrades/afterburner.png@Engine overdrive. Increases thrust at the expense of decreased fuel efficiency. Comes bundled with appropriate vector-governor firmware updates.\"\n", "Mass": "1", @@ -815,7 +815,7 @@ { "Key": "mult_overdrive05__upgrades", "Name": "Overdrive V", - "Upgrade_Type": "Afterburner", + "Upgrade_Type": "Afterburner_Upgrade", "Object_Type": "Upgrade_Replacement", "Textual_Description": "\"@upgrades/afterburner.png@Engine overdrive. Increases thrust at the expense of decreased fuel efficiency. Comes bundled with appropriate vector-governor firmware updates.\"\n", "Mass": "1", @@ -827,7 +827,7 @@ { "Key": "mult_overdrive06__upgrades", "Name": "Overdrive VI", - "Upgrade_Type": "Afterburner", + "Upgrade_Type": "Afterburner_Upgrade", "Object_Type": "Upgrade_Replacement", "Textual_Description": "\"@upgrades/afterburner.png@Engine overdrive. Increases thrust at the expense of decreased fuel efficiency. Comes bundled with appropriate vector-governor firmware updates.\"\n", "Mass": "1", @@ -13663,4 +13663,4 @@ "Key": "AeraNerveStimuli", "Textual_Description": "\"@cargo/cargo-hud.png@Ever watched an Aera spasm in something that looks like a cross between an epileptic fit and an orgasm? Give them some of this and sit back. Way back. Preferably behind a barrier, because when the Aera in question starts to go into withdrawl induced fits of berserker rage, you might live to tell the tale.\"\n" } -] \ No newline at end of file +]