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

Allow repairing items with forges #2188

Merged
merged 2 commits into from
Dec 17, 2022
Merged
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
1 change: 1 addition & 0 deletions data/json/furniture_and_terrain/furniture-appliances.json
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@
"coverage": 10,
"required_str": -1,
"crafting_pseudo_item": "fake_gridforge",
"examine_action": "use_furn_fake_item",
"flags": [ "TRANSPARENT", "MOUNTABLE", "EASY_DECONSTRUCT" ],
"deconstruct": {
"items": [ { "item": "forge", "count": 1 }, { "item": "cable", "charges": 5 }, { "item": "power_supply", "count": 1 } ]
Expand Down
26 changes: 26 additions & 0 deletions data/json/items/fake.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,32 @@
"name": { "str": "grid forge" },
"sub": "forge",
"max_charges": 2500,
"charges_per_use": 4,
"use_action": [
{
"type": "repair_item",
"item_action_type": "repair_metal",
"materials": [
"iron",
"steel",
"hardsteel",
"aluminum",
"copper",
"bronze",
"silver",
"gold",
"platinum",
"superalloy",
"lead",
"tin",
"zinc"
],
"skill": "fabrication",
"tool_quality": 8,
"cost_scaling": 0.1,
"move_cost": 500
}
],
"flags": [ "USES_GRID_POWER" ]
},
{
Expand Down
56 changes: 54 additions & 2 deletions data/json/items/tool/metalworking.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"type": "TOOL",
"category": "tools",
"name": { "str": "charcoal forge" },
"description": "This is a portable, charcoal fired, metalworking forge. If combined with the right tools, you could use this for metalworking.",
"description": "This is a portable, charcoal fired, metalworking forge. If combined with the right tools, you could use this for metalworking, or it could be used to repair metal items.",
"weight": "8600 g",
"volume": "8 L",
"price": 20000,
Expand All @@ -71,6 +71,32 @@
"ammo": "charcoal",
"sub": "forge",
"max_charges": 500,
"charges_per_use": 8,
"use_action": [
{
"type": "repair_item",
"item_action_type": "repair_metal",
"materials": [
"iron",
"steel",
"hardsteel",
"aluminum",
"copper",
"bronze",
"silver",
"gold",
"platinum",
"superalloy",
"lead",
"tin",
"zinc"
],
"skill": "fabrication",
"tool_quality": 4,
"cost_scaling": 0.1,
"move_cost": 500
}
],
"flags": [ "ALLOWS_REMOTE_USE" ]
},
{
Expand Down Expand Up @@ -148,7 +174,7 @@
"type": "TOOL",
"category": "tools",
"name": { "str": "electric forge" },
"description": "This is a portable electric metalworking forge, powered by batteries. Combined with the right tools, you could use this for metalworking. With a little mechanical know-how, you could probably even convert it to run directly off a vehicle's power system.",
"description": "This is a portable electric metalworking forge, powered by batteries. Combined with the right tools, you could use this for metalworking, or it could be used to repair metal items. With a little mechanical know-how, you could probably even convert it to run directly off a vehicle's power system.",
"weight": "10000 g",
"volume": "6 L",
"price": 40000,
Expand All @@ -159,6 +185,32 @@
"symbol": ";",
"color": "light_gray",
"ammo": "battery",
"charges_per_use": 4,
"use_action": [
{
"type": "repair_item",
"item_action_type": "repair_metal",
"materials": [
"iron",
"steel",
"hardsteel",
"aluminum",
"copper",
"bronze",
"silver",
"gold",
"platinum",
"superalloy",
"lead",
"tin",
"zinc"
],
"skill": "fabrication",
"tool_quality": 8,
"cost_scaling": 0.1,
"move_cost": 500
}
],
"flags": [ "ALLOWS_REMOTE_USE" ],
"magazines": [
[ "battery", [ "heavy_battery_cell", "heavy_plus_battery_cell", "heavy_atomic_battery_cell", "heavy_disposable_cell" ] ]
Expand Down
2 changes: 1 addition & 1 deletion tests/iteminfo_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ TEST_CASE( "repairable and with what tools", "[item][iteminfo][repair]" )

test_info_contains(
item( "test_halligan" ), q,
"<color_c_white>Repair</color> using grid welder, extended toolset, arc welder, or makeshift arc welder.\n" );
"<color_c_white>Repair</color> using charcoal forge, grid forge, grid welder, electric forge, extended toolset, arc welder, or makeshift arc welder.\n" );

test_info_contains(
item( "test_hazmat_suit" ), q,
Expand Down