Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add circuit analysis tool quality [RDY] #17061

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion data/json/faults.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
]
}
},
{
Expand Down
6 changes: 4 additions & 2 deletions data/json/itemgroups/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion data/json/items/generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
40 changes: 40 additions & 0 deletions data/json/items/tool/electronic.json
Original file line number Diff line number Diff line change
@@ -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 ] ]
}
]
65 changes: 65 additions & 0 deletions data/json/recipes/electronics/components.json
Original file line number Diff line number Diff line change
@@ -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 }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm skeptical that a multimeter is strictly required for assembling an amplifier, it's in "faster if you have one" territory, but otherwise you should be able to do something janky like find a led and resistor that has the appropriate resistance for voltage, something similar for current, etc.

],
"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 ] ]
]
}
]
26 changes: 26 additions & 0 deletions data/json/recipes/electronics/tools.json
Original file line number Diff line number Diff line change
@@ -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 ] ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used in many recipes and so should have an autolearn recipe. Can be lvl 5 or 6, but should exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not used in any at present. The multimeter is the common tool providing MULTIMETER 2. The oscilloscopes are required for a higher level of circuit analysis of MULTIMETER 3

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no reason to craft a tool with lower qualities, unless it offers some advantages over the one with higher qualities.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

digital multimeter is level 2
oscilloscope is level 3

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Coolthulhu; there should be some means of bootstrapping an improvised tool with sufficient MULTIMETER quality to start this process.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I quite like the idea of not having access to a tool forcing alternate strategy (in this case dismantling electrical items for parts you are unable to craft). That said MULTIMETER 1 is reserved for a good example of an improvised multimeter and I'm open to suggestions as to this?

"qualities": [
{ "id": "SCREW_FINE", "level": 1 },
{ "id": "MULTIMETER", "level": 2 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multimeter requires a multimeter to craft? That would make the recipe totally useless...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makeshift_oscilloscope provides the better level MULTIMETER 3

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you craft the [ "MULTIMETER" 2 ] in the first place? Electronics is already "drop-locked" enough as it is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to find it but its commonly available. The intended balance is that you need MULTIMETER 2 for crafting new circuit parts from scratch and MULTIMETER 3 for high-end electronics. Without the meter your other option remains dismantling scavenged consumer electronics.

],
"tools": [ [ [ "soldering_iron", 20 ], [ "toolset", 20 ] ] ],
"components": [
[ [ "television", 1 ] ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LCD screens would be better here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure. An old CRT monitor is nearly equivalent in design to an analog oscilloscope.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are all modern TVs though. A CRT would be a museum piece at best.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. I suppose the television also has an LCD screen but I can add the specific part as an alternative?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean TV or LCD? Adding TV as an alternative part would mean uncraft recipe would be quite weird (craft with TV, uncraft into ram and processors?) and would also prevent the recipe for being properly reversible (reversing an item made with TV would drop a TV).

LCD needs more uses anyway. It would be better to make it with LCD by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who says anything about cutting it up? It's a makeshift bulky replacement when nothing better is available

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who says anything about cutting it up?

Volume of TV vs. volume of makeshift 'scope.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both 12?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TV is just 12? I was pretty sure it was 20.

Well, it can be 12.

Though why use the entire TV when you could just use a small screen from a PDA or something like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's improvised. The latter would probably require custom firmware to drive the LCD. The former already has a wide range of built-in inputs that could be adapted.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why entire TV when we only need a small display?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The survivor opens the casing and adds some custom circuitry. If it's being produced entirely from spare parts then that's not improvised.

[ [ "processor", 1 ] ],
[ [ "amplifier", 2 ] ],
[ [ "circuit", 2 ] ],
[ [ "cable", 50 ] ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

50 copper cable is a lot. It's more than truck alternators.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternators should be increased markedly then - they need a lot of wire

]
}
]
37 changes: 37 additions & 0 deletions data/json/recipes/recipe_deconstruction.json
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@
"reversible": true,
"qualities": [ { "id": "SCREW","level": 1 } ],
"components": [
[ [ "small_lcd_screen", 1 ] ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How big is small_lcd_screen supposed to be?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you can get one by disassembling a PDA.

Though I also realized that LCD screens don't work well when cut up, so 1 is fine.

[ ["processor", 1] ],
[ ["RAM", 2] ],
[ ["cable", 8] ],
Expand All @@ -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",
Expand Down
24 changes: 0 additions & 24 deletions data/json/recipes/recipe_electronics.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions data/json/tool_qualities.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,9 @@
"type" : "tool_quality",
"id" : "CHISEL",
"name" : "chiseling"
},{
"type" : "tool_quality",
"id" : "MULTIMETER",
"name" : "cicuit analysis"
}
]
5 changes: 5 additions & 0 deletions src/requirements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<tool_comp> &tcv ) {
Expand Down