diff --git a/data/json/faults.json b/data/json/faults.json index dad792d2109ab..cc4aa27ce7776 100644 --- a/data/json/faults.json +++ b/data/json/faults.json @@ -31,7 +31,10 @@ "time": 30000, "skills": [ [ "mechanics", 2 ], [ "electronics", 5 ] ], "requirements": { - "qualities": [ { "id": "SCREW_FINE", "level": 1 } ] + "qualities": [ + { "id": "SCREW_FINE", "level": 1 }, + { "id": "MULTIMETER", "level": 2 } + ] } }, { diff --git a/data/json/itemgroups/tools.json b/data/json/itemgroups/tools.json index 230330eaa0b74..8ada40b1b00a0 100644 --- a/data/json/itemgroups/tools.json +++ b/data/json/itemgroups/tools.json @@ -77,8 +77,10 @@ "//": "Portable tools used by electricians and for electronics repair", "items": [ { "group": "tools_common", "prob": 100 }, - [ "soldering_iron", 100 ], - [ "magnifying_glass", 100 ] + [ "magnifying_glass", 100 ], + [ "multimeter", 100 ], + [ "oscilloscope", 10 ], + [ "soldering_iron", 100 ] ] }, { diff --git a/data/json/items/generic.json b/data/json/items/generic.json index e5dd5a915ff52..af4206fc16892 100644 --- a/data/json/items/generic.json +++ b/data/json/items/generic.json @@ -702,7 +702,7 @@ "symbol": ";", "color": "dark_gray", "name": "television", - "description": "A large cathode ray tube television, full of delicious electronics.", + "description": "An LCD television, full of delicious electronics.", "price": 0, "material": "plastic", "weight": 22600, diff --git a/data/json/items/tool/electronic.json b/data/json/items/tool/electronic.json new file mode 100644 index 0000000000000..04f3cd24688cd --- /dev/null +++ b/data/json/items/tool/electronic.json @@ -0,0 +1,40 @@ +[ + { + "id": "multimeter", + "type": "TOOL", + "name": "digital multimeter", + "description": "A portable measuring instrument with a number of functions useful for testing electronic circuits.", + "weight": 250, + "volume": 2, + "price": 1400, + "material": [ "plastic" ], + "symbol": ";", + "color": "yellow", + "qualities": [ [ "MULTIMETER", 2 ] ] + }, + { + "id": "makeshift_oscilloscope", + "copy-from": "oscilloscope", + "type": "TOOL", + "name": "makeshift oscilloscope", + "description": "Improvised from an LCD television display this makeshift oscilloscope is bulky but functional.", + "proportional": { + "weight": 1.5, + "volume": 2.0, + "price": 0.3 + } + }, + { + "id": "oscilloscope", + "type": "TOOL", + "name": "oscilloscope", + "description": "A compact digital oscilloscope required for more advanced electronics projects.", + "weight": 2350, + "volume": 6, + "price": 32600, + "material": [ "plastic" ], + "symbol": ";", + "color": "yellow", + "qualities": [ [ "MULTIMETER", 3 ] ] + } +] diff --git a/data/json/recipes/electronics/components.json b/data/json/recipes/electronics/components.json new file mode 100644 index 0000000000000..3532d26392ac7 --- /dev/null +++ b/data/json/recipes/electronics/components.json @@ -0,0 +1,65 @@ +[ + { + "type" : "recipe", + "result": "amplifier", + "category": "CC_ELECTRONIC", + "subcategory": "CSC_ELECTRONIC_COMPONENTS", + "skill_used": "electronics", + "difficulty": 1, + "time": 30000, + "book_learn": [ [ "radio_book", 3 ] , [ "manual_electronics", 1 ] ], + "decomp_learn": 1, + "qualities" : [ + { "id": "SCREW", "level": 1 }, + { "id": "MULTIMETER", "level": 2 } + ], + "tools": [ [ [ "soldering_iron", 10 ], [ "toolset", 10 ] ] ], + "components": [ + [ [ "circuit", 1 ] ], + [ [ "e_scrap", 3 ] ], + [ [ "cable", 1 ] ] + ] + }, + { + "type" : "recipe", + "result": "receiver", + "category": "CC_ELECTRONIC", + "subcategory": "CSC_ELECTRONIC_COMPONENTS", + "skill_used": "electronics", + "difficulty": 1, + "time": 60000, + "book_learn": [ [ "radio_book", 4 ] , [ "manual_electronics", 2 ] ], + "decomp_learn": 2, + "qualities" : [ + { "id": "SCREW", "level": 1 }, + { "id": "MULTIMETER", "level": 2 } + ], + "tools": [ [ [ "soldering_iron", 20 ], [ "toolset", 20 ] ] ], + "components": [ + [ [ "circuit", 2 ] ], + [ [ "e_scrap", 6 ] ], + [ [ "cable", 2 ] ] + ] + }, + { + "type" : "recipe", + "result": "transponder", + "category": "CC_ELECTRONIC", + "subcategory": "CSC_ELECTRONIC_COMPONENTS", + "skill_used": "electronics", + "difficulty": 3, + "time": 60000, + "book_learn": [ [ "radio_book", 5 ] , [ "manual_electronics", 3 ] ], + "decomp_learn": 3, + "qualities" : [ + { "id": "SCREW", "level": 1 }, + { "id": "MULTIMETER", "level": 3 } + ], + "tools": [ [ [ "soldering_iron", 20 ], [ "toolset", 20 ] ] ], + "components": [ + [ [ "circuit", 2 ] ], + [ [ "e_scrap", 6 ] ], + [ [ "cable", 2 ] ] + ] + } +] diff --git a/data/json/recipes/electronics/tools.json b/data/json/recipes/electronics/tools.json new file mode 100644 index 0000000000000..210a0aa47fa94 --- /dev/null +++ b/data/json/recipes/electronics/tools.json @@ -0,0 +1,26 @@ +[ + { + "result": "makeshift_oscilloscope", + "type" : "recipe", + "category": "CSC_ELECTRONIC", + "subcategory": "CSC_ELECTRONIC_TOOLS", + "skill_used": "electronics", + "difficulty": 4, + "skills_required": [ "fabrication", 2 ], + "time": 240000, + "reversible": true, + "book_learn": [ [ "advanced_electronics", 4 ], [ "mag_electronics", 6 ] , [ "manual_electronics", 5 ] ], + "qualities": [ + { "id": "SCREW_FINE", "level": 1 }, + { "id": "MULTIMETER", "level": 2 } + ], + "tools": [ [ [ "soldering_iron", 20 ], [ "toolset", 20 ] ] ], + "components": [ + [ [ "television", 1 ] ], + [ [ "processor", 1 ] ], + [ [ "amplifier", 2 ] ], + [ [ "circuit", 2 ] ], + [ [ "cable", 50 ] ] + ] + } +] diff --git a/data/json/recipes/recipe_deconstruction.json b/data/json/recipes/recipe_deconstruction.json index c9408e45093f0..3987d2bb3f84b 100644 --- a/data/json/recipes/recipe_deconstruction.json +++ b/data/json/recipes/recipe_deconstruction.json @@ -497,6 +497,7 @@ "reversible": true, "qualities": [ { "id": "SCREW","level": 1 } ], "components": [ + [ [ "small_lcd_screen", 1 ] ], [ ["processor", 1] ], [ ["RAM", 2] ], [ ["cable", 8] ], @@ -505,6 +506,42 @@ [ ["plastic_chunk", 8] ] ] }, + { + "result": "oscilloscope", + "id_suffix": "uncraft", + "type": "recipe", + "category": "CC_NONCRAFT", + "subcategory": "CSC_NONCRAFT", + "skill_used": "electronics", + "difficulty": 0, + "time": 60000, + "qualities": [ { "id": "SCREW","level": 1 } ], + "components": [ + [ [ "processor", 1 ] ], + [ [ "small_lcd_screen", 1 ] ], + [ [ "RAM", 2 ] ], + [ [ "cable", 8 ] ], + [ [ "amplifier", 4 ] ], + [ [ "power_supply", 2 ] ], + [ [ "plastic_chunk", 8 ] ] + ] + }, + { + "result": "multimeter", + "id_suffix": "uncraft", + "type": "recipe", + "category": "CC_NONCRAFT", + "subcategory": "CSC_NONCRAFT", + "skill_used": "electronics", + "difficulty": 0, + "time": 60000, + "qualities": [ { "id": "SCREW","level": 1 } ], + "components": [ + [ [ "processor", 1 ] ], + [ [ "small_lcd_screen", 1 ] ], + [ [ "plastic_chunk", 2 ] ] + ] + }, { "result": "microwave", "type": "recipe", diff --git a/data/json/recipes/recipe_electronics.json b/data/json/recipes/recipe_electronics.json index c04654f43b3e6..36c5e9c7302bd 100644 --- a/data/json/recipes/recipe_electronics.json +++ b/data/json/recipes/recipe_electronics.json @@ -190,30 +190,6 @@ [ [ "2x4", 2 ] ], [ [ "nail", 12 ] ] ] -},{ - "type" : "recipe", - "result": "amplifier", - "category": "CC_ELECTRONIC", - "subcategory": "CSC_ELECTRONIC_COMPONENTS", - "skill_used": "electronics", - "difficulty": 1, - "time": 4000, - "reversible": true, - "decomp_learn": 1, - "autolearn": false, - "book_learn": [[ "radio_book", 3 ] , [ "manual_electronics", 1 ]], - "qualities" : [ {"id":"SCREW","level":1,"amount":1} ], - "tools": [ - [ - [ "soldering_iron", 4 ], - [ "toolset", 4 ] - ] - ], - "components": [ - [ [ "circuit", 1 ] ], - [ [ "e_scrap", 3 ] ], - [ [ "cable", 1 ] ] - ] },{ "type" : "recipe", "result": "power_supply", diff --git a/data/json/tool_qualities.json b/data/json/tool_qualities.json index e594ec162d1f8..a59378d1b1b51 100644 --- a/data/json/tool_qualities.json +++ b/data/json/tool_qualities.json @@ -113,5 +113,9 @@ "type" : "tool_quality", "id" : "CHISEL", "name" : "chiseling" + },{ + "type" : "tool_quality", + "id" : "MULTIMETER", + "name" : "cicuit analysis" } ] diff --git a/src/requirements.cpp b/src/requirements.cpp index 2d4468a7b4f3b..dfbb83d5964b0 100644 --- a/src/requirements.cpp +++ b/src/requirements.cpp @@ -655,6 +655,11 @@ const requirement_data requirement_data::disassembly_requirements() const qualities.resize( std::distance( qualities.begin(), itr ) ); } + static quality_id quality_multimeter( "MULTIMETER" ); + qualities.erase( std::remove_if( qualities.begin(), qualities.end(), [&]( const quality_requirement &e ) { + return e.type == quality_multimeter; + } ), qualities.end() ); + // Remove empty variant sections ret.tools.erase( std::remove_if( ret.tools.begin(), ret.tools.end(), []( const std::vector &tcv ) {