From e6a94df943edc0fdefaa3146a6242d9c9ba85b41 Mon Sep 17 00:00:00 2001 From: Chaosvolt Date: Sat, 29 Apr 2023 21:18:56 -0500 Subject: [PATCH] Implement use of E_NO_POWER_DECAY on top-tier engines/motors (#2726) * Implement use of E_NO_POWER_DECAY on top-tier engines/motors * Description updates per feedback * Update vehicle_drag_test.cpp --- data/json/items/vehicle/engine.json | 6 +++--- data/json/items/vehicle/motors.json | 4 ++-- data/json/vehicleparts/combustion.json | 3 ++- data/json/vehicleparts/motor.json | 4 ++++ tests/vehicle_drag_test.cpp | 4 ++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/data/json/items/vehicle/engine.json b/data/json/items/vehicle/engine.json index 2eecf4fca5c7..3a044f8e96f9 100644 --- a/data/json/items/vehicle/engine.json +++ b/data/json/items/vehicle/engine.json @@ -279,7 +279,7 @@ "copy-from": "engine_gasoline", "type": "ENGINE", "name": { "str": "1350 hp gas turbine engine" }, - "description": "A gas turbine engine, usually used for military vehicles. Known for its high rate of fuel consumption.", + "description": "A gas turbine engine, usually used for military vehicles. Known for its high rate of fuel consumption, but installing multiple turbines will not affect vehicle power.", "weight": "1130000 g", "volume": "45 L", "price": 96000, @@ -291,7 +291,7 @@ "copy-from": "engine_gasoline", "type": "ENGINE", "name": { "str": "1900 hp gas turbine engine" }, - "description": "A large gas turbine engine, usually used for military helicopters. Known for its high rate of fuel consumption.", + "description": "A large gas turbine engine, usually used for military helicopters. Known for its high rate of fuel consumption, but installing multiple turbines will not affect vehicle power.", "weight": "1582000 g", "volume": "63 L", "price": 192000, @@ -303,7 +303,7 @@ "copy-from": "engine_gasoline", "type": "ENGINE", "name": { "str": "6000 hp gas turbine engine" }, - "description": "A massive gas turbine engine, used to power the V-22 Osprey. Known for its high rate of fuel consumption.", + "description": "A massive gas turbine engine, used to power the V-22 Osprey. Known for its high rate of fuel consumption, but installing multiple turbines will not affect vehicle power.", "weight": "3164000 g", "volume": "95 L", "price": 960000, diff --git a/data/json/items/vehicle/motors.json b/data/json/items/vehicle/motors.json index cec854f5df8b..6b05f38c7b9a 100644 --- a/data/json/items/vehicle/motors.json +++ b/data/json/items/vehicle/motors.json @@ -18,7 +18,7 @@ "type": "GENERIC", "id": "motor_enhanced", "name": { "str": "enhanced electric motor" }, - "description": "A very powerful and yet lightweight electric motor. Useful for crafting.", + "description": "A very powerful and yet lightweight electric motor. Useful for crafting, and its advanced design means it won't suffer power loss if multiple are installed on a vehicle.", "weight": "100 kg", "material": [ "superalloy" ], "volume": "20 L", @@ -30,7 +30,7 @@ "type": "GENERIC", "id": "motor_super", "name": { "str": "super electric motor" }, - "description": "The most powerfull electric motor on the market. Useful for crafting.", + "description": "The most powerfull electric motor on the market. Useful for crafting, and its advanced design means it won't suffer power loss if multiple are installed on a vehicle.", "weight": "125 kg", "volume": "25 L", "price": 80000, diff --git a/data/json/vehicleparts/combustion.json b/data/json/vehicleparts/combustion.json index 79a237f69b8a..e1cb90c3c065 100644 --- a/data/json/vehicleparts/combustion.json +++ b/data/json/vehicleparts/combustion.json @@ -43,7 +43,8 @@ "fuel_options": [ "gasoline", "diesel", "lamp_oil", "jp8", "motor_oil", "avgas", "biodiesel" ], "m2c": 60, "//": "25% energy efficiency", - "description": "An advanced combustion engine. Burns gasoline or diesel or aviation fuel from a tank in the vehicle. Can also burn lamp oil, though somewhat less efficiently. Better power-to-weight ratio than a traditional engine, but consumes more fuel." + "extend": { "flags": [ "E_NO_POWER_DECAY" ] }, + "description": "An advanced combustion engine. Burns gasoline or diesel or aviation fuel from a tank in the vehicle. Can also burn lamp oil, though somewhat less efficiently. Better power-to-weight ratio than a traditional engine but consumes more fuel, its power will not diminish even when multiple of them are installed." }, { "id": "diesel_engine_i6", diff --git a/data/json/vehicleparts/motor.json b/data/json/vehicleparts/motor.json index 2a61223a0167..a707e57e2457 100644 --- a/data/json/vehicleparts/motor.json +++ b/data/json/vehicleparts/motor.json @@ -115,6 +115,7 @@ "type": "vehicle_part", "name": { "str": "enhanced electric motor" }, "item": "motor_enhanced", + "description": "A more advanced electric motor, its power will not diminish even when multiple of them are installed.", "durability": 200, "power": 282000, "energy_consumption": 300000, @@ -132,6 +133,7 @@ { "item": "bearing", "count": [ 20, 50 ] }, { "item": "cable", "charges": [ 10, 15 ] } ], + "extend": { "flags": [ "E_NO_POWER_DECAY" ] }, "damage_reduction": { "all": 50 } }, { @@ -140,6 +142,7 @@ "type": "vehicle_part", "name": { "str": "super electric motor" }, "item": "motor_super", + "description": "A more advanced electric motor, its power will not diminish even when multiple of them are installed.", "durability": 400, "power": 475000, "energy_consumption": 500000, @@ -157,6 +160,7 @@ { "item": "bearing", "count": [ 25, 60 ] }, { "item": "cable", "charges": [ 20, 30 ] } ], + "extend": { "flags": [ "E_NO_POWER_DECAY" ] }, "damage_reduction": { "all": 60 } } ] diff --git a/tests/vehicle_drag_test.cpp b/tests/vehicle_drag_test.cpp index b82c3ce99ec9..43d4cfedfc6c 100644 --- a/tests/vehicle_drag_test.cpp +++ b/tests/vehicle_drag_test.cpp @@ -245,8 +245,8 @@ TEST_CASE( "vehicle_drag", "[vehicle] [engine]" ) test_vehicle_drag( "car", 0.294604, 2.473484, 1167.310417, 11916, 14350 ); test_vehicle_drag( "car_mini", 0.294604, 1.816015, 1285.546875, 12157, 14580 ); test_vehicle_drag( "car_sports", 0.294604, 2.547639, 1442.767500, 20848, 24904 ); - test_vehicle_drag( "car_sports_atomic", 0.294604, 3.788275, 1787.798958, 23696, 24593 ); - test_vehicle_drag( "car_sports_electric", 0.294604, 3.397004, 1923.776250, 23815, 24712 ); + test_vehicle_drag( "car_sports_atomic", 0.294604, 3.788275, 1787.798958, 25635, 26601 ); + test_vehicle_drag( "car_sports_electric", 0.294604, 3.397004, 1923.776250, 25753, 26718 ); test_vehicle_drag( "electric_car", 0.304762, 2.485556, 1173.007292, 16208, 16826 ); test_vehicle_drag( "rara_x", 0.880425, 2.267517, 1180.809267, 8353, 8670 ); test_vehicle_drag( "suv", 0.294604, 2.914201, 1178.826786, 13988, 16827 );