diff --git a/data/json/construction.json b/data/json/construction.json index 17ed9ef7675db..7b0bfc39a672d 100644 --- a/data/json/construction.json +++ b/data/json/construction.json @@ -5329,6 +5329,32 @@ "post_special": "done_appliance", "activity_level": "LIGHT_EXERCISE" }, + { + "type": "construction", + "id": "app_stationary_solar", + "group": "place_stationary_solar_panel", + "category": "APPLIANCE", + "required_skills": [ [ "fabrication", 1 ] ], + "time": "12 m", + "qualities": [ [ { "id": "WRENCH", "level": 1 } ] ], + "components": [ [ [ "stationary_solar_panel", 1 ] ] ], + "pre_special": "check_empty", + "post_special": "done_appliance", + "activity_level": "LIGHT_EXERCISE" + }, + { + "type": "construction", + "id": "app_stationary_solar_v2", + "group": "place_stationary_solar_panel_v2", + "category": "APPLIANCE", + "required_skills": [ [ "fabrication", 1 ] ], + "time": "12 m", + "qualities": [ [ { "id": "WRENCH", "level": 1 } ] ], + "components": [ [ [ "stationary_solar_panel_v2", 1 ] ] ], + "pre_special": "check_empty", + "post_special": "done_appliance", + "activity_level": "LIGHT_EXERCISE" + }, { "type": "construction", "id": "app_wind_turbine", diff --git a/data/json/construction_group.json b/data/json/construction_group.json index fc8aa2f99c42c..beea2f406d540 100644 --- a/data/json/construction_group.json +++ b/data/json/construction_group.json @@ -1339,6 +1339,16 @@ "id": "place_reinforced_solar_panel_v2", "name": "Place Advanced Reinforced Solar Panel" }, + { + "type": "construction_group", + "id": "place_stationary_solar_panel", + "name": "Place Stationary Solar Panel" + }, + { + "type": "construction_group", + "id": "place_stationary_solar_panel_v2", + "name": "Place Advanced Stationary Solar Panel" + }, { "type": "construction_group", "id": "place_wind_turbine", diff --git a/data/json/furniture_and_terrain/appliances.json b/data/json/furniture_and_terrain/appliances.json index 278209d962947..5e2df2da40703 100644 --- a/data/json/furniture_and_terrain/appliances.json +++ b/data/json/furniture_and_terrain/appliances.json @@ -712,6 +712,31 @@ "requirements": { "removal": { "time": "3 m", "using": [ [ "vehicle_wrench_2", 1 ] ] } }, "variants": [ { "symbols": "#", "symbols_broken": "x" } ] }, + { + "type": "vehicle_part", + "id": "ap_stationary_solar_panel", + "flags": [ "SOLAR_PANEL", "OBSTACLE", "APPLIANCE" ], + "description": "A stationary solar panel, mounted on a frame and ready to power other appliances.", + "name": { "str": "stationary solar panel" }, + "categories": [ "energy" ], + "color": "blue", + "broken_color": "blue", + "damage_modifier": 10, + "durability": 20, + "epower": "480 W", + "item": "stationary_solar_panel", + "requirements": { "removal": { "time": "6 m", "using": [ [ "vehicle_wrench_2", 1 ] ] } }, + "variants": [ { "symbols": "#", "symbols_broken": "x" } ] + }, + { + "type": "vehicle_part", + "id": "ap_stationary_solar_panel_v2", + "copy-from": "ap_stationary_solar_panel", + "name": { "str": "advanced stationary solar panel" }, + "description": "A high-performance stationary solar panel, mounted on a frame and ready to power other appliances.", + "item": "stationary_solar_panel_v2", + "epower": "960 W" + }, { "type": "vehicle_part", "id": "ap_wind_turbine", diff --git a/data/json/furniture_and_terrain/furniture-appliances.json b/data/json/furniture_and_terrain/furniture-appliances.json index a38ed590df05f..1c89ed3c8d881 100644 --- a/data/json/furniture_and_terrain/furniture-appliances.json +++ b/data/json/furniture_and_terrain/furniture-appliances.json @@ -703,7 +703,7 @@ "sound": "whack!", "sound_fail": "clang!", "items": [ - { "item": "solar_cell", "count": [ 1, 5 ] }, + { "item": "solar_cell", "count": [ 1, 4 ] }, { "item": "scrap", "count": [ 3, 6 ] }, { "item": "amplifier", "prob": 50 }, { "item": "cable", "charges": [ 10, 15 ] }, @@ -714,6 +714,63 @@ ] } }, + { + "type": "furniture", + "id": "f_stationary_solar_panel", + "name": "mounted stationary solar panel", + "description": "A large panel with photovoltaic power generators, which turn solar radiation into useable electricity. While useful before the Cataclysm, they have become priceless tools, invaluable to any survivor.", + "symbol": "#", + "color": "blue", + "move_cost_mod": 2, + "required_str": -1, + "examine_action": { "type": "appliance_convert", "furn_set": "f_null", "item": "stationary_solar_panel" }, + "flags": [ "TRANSPARENT" ], + "deconstruct": { "items": [ { "item": "stationary_solar_panel", "count": 1 } ] }, + "bash": { + "str_min": 10, + "str_max": 20, + "sound": "whack!", + "sound_fail": "clang!", + "items": [ + { "item": "solar_cell", "count": [ 2, 8 ] }, + { "item": "scrap_aluminum", "count": [ 20, 30 ] }, + { "item": "amplifier", "count": [ 0, 2 ] }, + { "item": "cable", "charges": [ 20, 30 ] }, + { "item": "power_supply", "count": [ 0, 2 ] }, + { "item": "scrap", "count": [ 4, 6 ] }, + { "item": "glass_shard", "count": [ 1, 16 ] } + ] + } + }, + { + "type": "furniture", + "//1": "IDK if this will be ever pre-placed on map, but I'll add it just to complete the set.", + "id": "f_stationary_solar_panel_v2", + "name": "mounted stationary solar panel_v2", + "description": "A large panel with photovoltaic power generators, which turn solar radiation into useable electricity. While useful before the Cataclysm, they have become priceless tools, invaluable to any survivor. This panel uses high-performance monocrystalline silicon cells.", + "symbol": "#", + "color": "blue", + "move_cost_mod": 2, + "required_str": -1, + "examine_action": { "type": "appliance_convert", "furn_set": "f_null", "item": "stationary_solar_panel_v2" }, + "flags": [ "TRANSPARENT" ], + "deconstruct": { "items": [ { "item": "stationary_solar_panel_v2", "count": 1 } ] }, + "bash": { + "str_min": 10, + "str_max": 20, + "sound": "whack!", + "sound_fail": "clang!", + "items": [ + { "item": "solar_cell_v2", "count": [ 2, 8 ] }, + { "item": "scrap_aluminum", "count": [ 20, 30 ] }, + { "item": "amplifier", "count": [ 0, 2 ] }, + { "item": "cable", "charges": [ 20, 30 ] }, + { "item": "power_supply", "count": [ 0, 2 ] }, + { "item": "scrap", "count": [ 4, 6 ] }, + { "item": "glass_shard", "count": [ 1, 16 ] } + ] + } + }, { "type": "furniture", "id": "f_oxygen_concentrator", diff --git a/data/json/items/vehicle/solar.json b/data/json/items/vehicle/solar.json index c5191fcec3f87..99d962a63dcbc 100644 --- a/data/json/items/vehicle/solar.json +++ b/data/json/items/vehicle/solar.json @@ -4,25 +4,55 @@ "id": "solar_panel", "name": { "str": "solar panel" }, "description": "An electronic device that can convert solar radiation into electric power. Useful for a vehicle or a static power grid.", - "weight": "14000 g", + "weight": "9500 g", "to_hit": -4, "color": "yellow", "symbol": "]", "material": [ "glass" ], - "volume": "3 L", + "//1": "Solar cells on themselves are only 3.5 mm thick, so without extra volume added by frame the volume is 0.0035 x 1.065 = 3.6E-3 m3 or 3.6 l.", + "//2": "Let's add some volume for 2 power converters etc.", + "volume": "6 L", + "//3": "Considering selected geometry of basic solar cells and making a 4x2 array and forming long side out of short edges.", + "longest_side": "120 cm", "flags": [ "NO_REPAIR", "WATER_BREAK" ], "category": "veh_parts", "price": 90000, "price_postapoc": 1000, "melee_damage": { "bash": 1 } }, + { + "type": "GENERIC", + "id": "stationary_solar_panel", + "name": { "str": "disconnected stationary solar panel" }, + "description": "An electronic device that can convert solar radiation into electric power. It is mot mountable on a vehicle and is intended to be mounted on a rooftop as an appliance.", + "weight": "21000 g", + "to_hit": -6, + "color": "blue", + "symbol": "]", + "material": [ "glass", "aluminum" ], + "volume": "81 L", + "longest_side": "240 cm", + "flags": [ "NO_REPAIR", "WATER_BREAK" ], + "price": 180000, + "price_postapoc": 2000, + "melee_damage": { "bash": 1 } + }, + { + "type": "GENERIC", + "copy-from": "stationary_solar_panel", + "id": "stationary_solar_panel_v2", + "name": { "str": "disconnected advanced stationary solar panel" }, + "description": "An electronic device that can convert solar radiation into electric power. It is mot mountable on a vehicle and is intended to be mounted on a rooftop as an appliance. This model uses high-performance monocrystalline silicon cells.", + "price": 360000, + "price_postapoc": 6000 + }, { "type": "GENERIC", "copy-from": "solar_panel", "id": "folding_solar_panel", "name": { "str": "collapsible solar array" }, "description": "An electronic device that can convert solar radiation into electric power, mounted on a folding frame. This one is a common, inexpensive type made with polycrystalline silicon cells.", - "weight": "14500 g", + "weight": "10000 g", "price": 120000, "price_postapoc": 1500 }, @@ -40,10 +70,11 @@ "id": "reinforced_solar_panel", "name": { "str": "reinforced solar panel" }, "description": "A solar panel that has been covered with a pane of reinforced glass to protect the delicate solar cells from zombies or errant baseballs. The glass causes this panel to produce slightly less power than a normal panel.", - "weight": "24153 g", + "//1": "Another 11.5 kg and 5.5 l is added by a pane of reinforced glass.", + "weight": "20000 g", "color": "light_blue", "material": [ "glass", "steel" ], - "volume": "6500 ml", + "volume": "11500 ml", "price": 120000, "price_postapoc": 1500, "copy-from": "solar_panel" @@ -71,9 +102,12 @@ "id": "solar_cell", "name": { "str": "solar cell" }, "description": "A small electronic device that can convert solar radiation into electric power. This one is a common, inexpensive type made of polycrystalline silicon.", - "weight": "500 g", + "//1": "Density of silicon is 2.33 kg/l. Approx. area of 0.13125 m3 and thickness of 3.5 mm. That gives us volume of ~470 ml and weight of 1.1 kg.", + "weight": "1100 g", "symbol": ";", - "volume": "250 ml", + "volume": "470 ml", + "//2": "Assumingh a 2/3 ration between height and length. Given the area this gives us ~0.44 m max length and ~0.3 m height.", + "longest_side": "44 cm", "category": "spare_parts", "price": 5000, "price_postapoc": 100, diff --git a/data/json/recipes/other/power_supplies.json b/data/json/recipes/other/power_supplies.json index 53b1d0dd9c53c..732ccdf2df0ad 100644 --- a/data/json/recipes/other/power_supplies.json +++ b/data/json/recipes/other/power_supplies.json @@ -247,7 +247,63 @@ { "proficiency": "prof_elec_circuits" }, { "proficiency": "prof_elec_semiconductors" } ], - "components": [ [ [ "power_supply", 2 ] ], [ [ "amplifier", 2 ] ], [ [ "solar_cell", 12 ] ], [ [ "cable", 20 ] ] ] + "components": [ [ [ "power_supply", 2 ] ], [ [ "amplifier", 2 ] ], [ [ "solar_cell", 8 ] ], [ [ "cable", 20 ] ] ] + }, + { + "type": "recipe", + "activity_level": "LIGHT_EXERCISE", + "result": "stationary_solar_panel", + "category": "CC_ELECTRONIC", + "subcategory": "CSC_ELECTRONIC_PARTS", + "skill_used": "electronics", + "difficulty": 8, + "time": "80 m", + "reversible": true, + "decomp_learn": 5, + "autolearn": true, + "book_learn": [ [ "manual_electronics", 7 ], [ "textbook_electronics", 6 ], [ "advanced_electronics", 6 ] ], + "using": [ [ "soldering_standard", 70 ] ], + "qualities": [ { "id": "SCREW", "level": 1 } ], + "proficiencies": [ + { "proficiency": "prof_elec_soldering" }, + { "proficiency": "prof_elec_circuits" }, + { "proficiency": "prof_elec_semiconductors" } + ], + "components": [ + [ [ "power_supply", 2 ] ], + [ [ "amplifier", 2 ] ], + [ [ "solar_cell", 16 ] ], + [ [ "cable", 40 ] ], + [ [ "xlframe", 1 ] ] + ] + }, + { + "type": "recipe", + "activity_level": "LIGHT_EXERCISE", + "result": "stationary_solar_panel_v2", + "category": "CC_ELECTRONIC", + "subcategory": "CSC_ELECTRONIC_PARTS", + "skill_used": "electronics", + "difficulty": 8, + "time": "80 m", + "reversible": true, + "decomp_learn": 5, + "autolearn": true, + "book_learn": [ [ "manual_electronics", 7 ], [ "textbook_electronics", 6 ], [ "advanced_electronics", 6 ] ], + "using": [ [ "soldering_standard", 70 ] ], + "qualities": [ { "id": "SCREW", "level": 1 } ], + "proficiencies": [ + { "proficiency": "prof_elec_soldering" }, + { "proficiency": "prof_elec_circuits" }, + { "proficiency": "prof_elec_semiconductors" } + ], + "components": [ + [ [ "power_supply", 2 ] ], + [ [ "amplifier", 2 ] ], + [ [ "solar_cell_v2", 16 ] ], + [ [ "cable", 40 ] ], + [ [ "xlframe", 1 ] ] + ] }, { "type": "recipe", @@ -480,7 +536,7 @@ { "proficiency": "prof_elec_circuits" }, { "proficiency": "prof_elec_semiconductors" } ], - "components": [ [ [ "power_supply", 2 ] ], [ [ "amplifier", 2 ] ], [ [ "solar_cell_v2", 12 ] ], [ [ "cable", 20 ] ] ] + "components": [ [ [ "power_supply", 2 ] ], [ [ "amplifier", 2 ] ], [ [ "solar_cell_v2", 8 ] ], [ [ "cable", 20 ] ] ] }, { "type": "recipe", diff --git a/data/json/vehicleparts/vehicle_parts.json b/data/json/vehicleparts/vehicle_parts.json index ffe3f0c6f6d5e..58deb0a8b03eb 100644 --- a/data/json/vehicleparts/vehicle_parts.json +++ b/data/json/vehicleparts/vehicle_parts.json @@ -1660,7 +1660,7 @@ "damage_modifier": 10, "durability": 20, "description": "A solar panel.", - "epower": "50 W", + "epower": "200 W", "item": "solar_panel", "location": "on_roof", "requirements": { @@ -1677,7 +1677,7 @@ { "item": "steel_lump", "count": [ 2, 4 ] }, { "item": "steel_chunk", "count": [ 2, 4 ] }, { "item": "scrap", "count": [ 2, 4 ] }, - { "item": "solar_cell", "count": [ 1, 4 ] } + { "item": "solar_cell", "count": [ 1, 3 ] } ], "variants": [ { "symbols": "#", "symbols_broken": "x" } ] }, @@ -1754,7 +1754,7 @@ "name": { "str": "collapsible solar array" }, "color": "light_blue", "broken_color": "light_gray", - "proportional": { "epower": 0.68, "durability": 0.5 }, + "proportional": { "durability": 0.5 }, "folded_volume": "2 L", "description": "A small array of solar panels designed to be able to fold into one another.", "item": "folding_solar_panel" @@ -1791,7 +1791,7 @@ { "item": "steel_lump", "count": [ 4, 7 ] }, { "item": "steel_chunk", "count": [ 4, 7 ] }, { "item": "scrap", "count": [ 4, 7 ] }, - { "item": "solar_cell", "count": [ 1, 4 ] } + { "item": "solar_cell", "count": [ 1, 3 ] } ], "damage_reduction": { "all": 12 } }, @@ -1816,7 +1816,7 @@ { "item": "steel_lump", "count": [ 2, 4 ] }, { "item": "steel_chunk", "count": [ 2, 4 ] }, { "item": "scrap", "count": [ 2, 4 ] }, - { "item": "solar_cell_v2", "count": [ 1, 6 ] } + { "item": "solar_cell_v2", "count": [ 1, 4 ] } ] }, { @@ -1843,7 +1843,7 @@ { "item": "steel_lump", "count": [ 4, 7 ] }, { "item": "steel_chunk", "count": [ 4, 7 ] }, { "item": "scrap", "count": [ 4, 7 ] }, - { "item": "solar_cell", "count": [ 1, 6 ] } + { "item": "solar_cell", "count": [ 1, 4 ] } ], "damage_reduction": { "all": 10 } }, diff --git a/data/mods/TEST_DATA/known_bad_density.json b/data/mods/TEST_DATA/known_bad_density.json index 857a7ea2557f7..12581bcc5e01a 100644 --- a/data/mods/TEST_DATA/known_bad_density.json +++ b/data/mods/TEST_DATA/known_bad_density.json @@ -52,7 +52,6 @@ "art_sphere", "cooked_marrow", "fruit_pancakes", - "folding_solar_panel_v2", "broken_mech_combat", "beer", "sandwich_sauce_wheat_free", @@ -182,7 +181,6 @@ "survivor_scope", "triffid_fungicide", "pine_resin", - "folding_solar_panel", "rehydration_drink", "bee_sting", "test_cracklins", @@ -581,7 +579,6 @@ "test_liquid_1ml", "compositecrossbow", "toothbrush_plain", - "solar_panel", "homemade_burrito", "bot_lab_security_drone_BM", "bot_manhack", @@ -605,7 +602,6 @@ "thermal_suit", "flavored_bonemeal_tablet", "chaw", - "solar_panel_v2", "moisturizer", "8mm_hvp", "load_bearing_vest", diff --git a/data/mods/TEST_DATA/vehicle_drag_test.json b/data/mods/TEST_DATA/vehicle_drag_test.json index 36a436e9ced67..d65ddc3369930 100644 --- a/data/mods/TEST_DATA/vehicle_drag_test.json +++ b/data/mods/TEST_DATA/vehicle_drag_test.json @@ -54,7 +54,7 @@ "kayak_racing": [ 0.609525, 2.604776, 0.983417, 779, 1406 ], "DUKW": [ 0.918158, 3.636234, 78.648471, 9801, 11742 ], "raft": [ 0.997815, 9.743243, 5.51775, 239, 508 ], - "rara_x": [ 0.930735, 1.251436, 699.958333, 8357, 8665 ], + "rara_x": [ 0.930735, 1.131798, 633.041667, 8374, 8682 ], "aapc-mg": [ 1.9866, 8.699023, 4398.563988, 7576, 8873 ], "quad_bike": [ 0.690795, 1.093925, 698.691964, 6893, 8235 ], "golf_cart": [ 1.069088, 1.127783, 709.645833, 6813, 7065 ], diff --git a/data/mods/TEST_DATA/vehicle_efficiency_test.json b/data/mods/TEST_DATA/vehicle_efficiency_test.json index 4d0e6e0ddda2b..7211a15d2facb 100644 --- a/data/mods/TEST_DATA/vehicle_efficiency_test.json +++ b/data/mods/TEST_DATA/vehicle_efficiency_test.json @@ -12,7 +12,7 @@ "car_sports": { "forward": [ 999590, 665500, 483000, 44490, 32080 ], "reverse": [ 999590, 667700, 484600, 43340, 29190 ] }, "ambulance": { "forward": [ 1718161, 581100, 494600, 92170, 74550 ], "reverse": [ 1718161, 54450, 54030, 41110, 39970 ] }, "superbike": { "forward": [ 233585, 126400, 73470, 45480, 26130 ], "reverse": [ 233585, 19660, 11160, 13860, 8875 ] }, - "electric_car": { "forward": [ 715829, 203700, 173900, 16850, 14030 ], "reverse": [ 715829, 204000, 174200, 16890, 14060 ] }, + "electric_car": { "forward": [ 697829, 209600, 182700, 17300, 15000 ], "reverse": [ 697829, 209900, 182900, 17300, 15000 ] }, "beetle": { "forward": [ 711045, 499600, 434400, 116300, 95800 ], "reverse": [ 711045, 60380, 60270, 47140, 45680 ] }, "scooter": { "forward": [ 38191, 309800, 309800, 237100, 237100 ], "reverse": [ 38191, 89140, 89140, 68680, 68680 ] }, "truck_swat": { "forward": [ 6046751, 629000, 112300, 34510, 7719 ], "reverse": [ 6046751, 126300, 127100, 32650, 7898 ] }, diff --git a/tests/vehicle_power_test.cpp b/tests/vehicle_power_test.cpp index 20b3ed9b3bb07..33e03069705c4 100644 --- a/tests/vehicle_power_test.cpp +++ b/tests/vehicle_power_test.cpp @@ -192,7 +192,7 @@ TEST_CASE( "Solar_power", "[vehicle][power]" ) WHEN( "30 minutes elapse" ) { veh_ptr->update_time( calendar::turn + 30_minutes ); int power = veh_ptr->fuel_left( fuel_type_battery ); - CHECK( power == Approx( 425 ).margin( 1 ) ); + CHECK( power == Approx( 1700 ).margin( 1 ) ); } } @@ -217,7 +217,7 @@ TEST_CASE( "Solar_power", "[vehicle][power]" ) WHEN( "30 minutes elapse" ) { veh_ptr->update_time( calendar::turn + 30_minutes ); int power = veh_ptr->fuel_left( fuel_type_battery ); - CHECK( power == Approx( 184 ).margin( 1 ) ); + CHECK( power == Approx( 734 ).margin( 1 ) ); } } @@ -270,7 +270,7 @@ TEST_CASE( "Daily_solar_power", "[vehicle][power]" ) WHEN( "24 hours pass" ) { veh_ptr->update_time( calendar::turn + 24_hours ); int power = veh_ptr->fuel_left( fuel_type_battery ); - CHECK( power == Approx( 5259 ).margin( 1 ) ); + CHECK( power == Approx( 21037 ).margin( 1 ) ); } } @@ -282,7 +282,7 @@ TEST_CASE( "Daily_solar_power", "[vehicle][power]" ) WHEN( "24 hours pass" ) { veh_ptr->update_time( calendar::turn + 24_hours ); int power = veh_ptr->fuel_left( fuel_type_battery ); - CHECK( power == Approx( 7925 ).margin( 1 ) ); + CHECK( power == Approx( 31703 ).margin( 1 ) ); } } @@ -294,7 +294,7 @@ TEST_CASE( "Daily_solar_power", "[vehicle][power]" ) WHEN( "24 hours pass" ) { veh_ptr->update_time( calendar::turn + 24_hours ); int power = veh_ptr->fuel_left( fuel_type_battery ); - CHECK( power == Approx( 5138 ).margin( 1 ) ); + CHECK( power == Approx( 20554 ).margin( 1 ) ); } } @@ -306,7 +306,7 @@ TEST_CASE( "Daily_solar_power", "[vehicle][power]" ) WHEN( "24 hours pass" ) { veh_ptr->update_time( calendar::turn + 24_hours ); int power = veh_ptr->fuel_left( fuel_type_battery ); - CHECK( power == Approx( 2137 ).margin( 1 ) ); + CHECK( power == Approx( 8546 ).margin( 1 ) ); } } }