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

feat(content): Add salvage action for metal items #4207

Merged
merged 5 commits into from
Feb 18, 2024
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
3 changes: 2 additions & 1 deletion data/json/items/ammo/nail.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"range": 3,
"damage": { "damage_type": "stab", "amount": 4, "armor_penetration": 3 },
"dispersion": 120,
"effects": [ "NON_FOULING" ]
"effects": [ "NON_FOULING" ],
"flags": [ "NO_SALVAGE" ]
}
]
29 changes: 20 additions & 9 deletions data/json/items/resources/metal.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"material": "steel",
"symbol": ",",
"color": "light_gray",
"ammo_type": "components"
"ammo_type": "components",
"flags": [ "NO_SALVAGE" ]
},
{
"id": "spike",
Expand Down Expand Up @@ -104,7 +105,8 @@
"material": [ "lead" ],
"symbol": "=",
"color": "dark_gray",
"ammo_type": "components"
"ammo_type": "components",
"flags": [ "NO_SALVAGE" ]
},
{
"id": "gold_small",
Expand All @@ -122,7 +124,8 @@
"material": [ "gold" ],
"symbol": "/",
"color": "yellow",
"ammo_type": "components"
"ammo_type": "components",
"flags": [ "NO_SALVAGE" ]
},
{
"id": "platinum_small",
Expand All @@ -140,7 +143,8 @@
"material": [ "platinum" ],
"symbol": "/",
"color": "light_gray",
"ammo_type": "components"
"ammo_type": "components",
"flags": [ "NO_SALVAGE" ]
},
{
"id": "zinc_metal",
Expand All @@ -157,7 +161,8 @@
"material": [ "zinc" ],
"symbol": "/",
"color": "blue",
"ammo_type": "components"
"ammo_type": "components",
"flags": [ "NO_SALVAGE" ]
},
{
"id": "lead",
Expand All @@ -175,7 +180,8 @@
"material": [ "lead" ],
"symbol": "=",
"color": "dark_gray",
"ammo_type": "components"
"ammo_type": "components",
"flags": [ "NO_SALVAGE" ]
},
{
"id": "magnesium",
Expand Down Expand Up @@ -212,7 +218,8 @@
"material": [ "silver" ],
"symbol": "/",
"color": "light_gray",
"ammo_type": "components"
"ammo_type": "components",
"flags": [ "NO_SALVAGE" ]
},
{
"id": "sheet_metal_small",
Expand Down Expand Up @@ -252,6 +259,7 @@
"symbol": ",",
"color": "light_gray",
"ammo_type": "components",
"flags": [ "NO_SALVAGE" ],
"qualities": [ [ "HAMMER", 1 ] ]
},
{
Expand All @@ -272,6 +280,7 @@
"symbol": ",",
"color": "light_gray",
"ammo_type": "components",
"flags": [ "NO_SALVAGE" ],
"qualities": [ [ "HAMMER", 1 ] ]
},
{
Expand Down Expand Up @@ -308,7 +317,8 @@
"weight": "50 g",
"volume": "25 ml",
"bashing": 1,
"to_hit": -2
"to_hit": -2,
"flags": [ "NO_SALVAGE" ]
},
{
"id": "tin",
Expand All @@ -326,7 +336,8 @@
"//": "Density 7.28g/cm³ ~ 1820kg/250ml @ stack 1000 = 2g/unit",
"ammo_type": "components",
"count": 100,
"stack_size": 200
"stack_size": 200,
"flags": [ "NO_SALVAGE" ]
},
{
"id": "solder_wire",
Expand Down
108 changes: 106 additions & 2 deletions data/json/items/tool/workshop.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,11 @@
"material": "steel",
"symbol": ";",
"color": "light_gray",
"use_action": {
"type": "salvage",
"moves_per_part": 1000,
"material_whitelist": [ "steel", "hardsteel", "budget_steel", "tin", "silver_small", "gold_small", "copper", "iron" ]
},
"qualities": [ [ "SAW_M", 2 ], [ "SAW_W", 1 ], [ "SAW_M_FINE", 1 ], [ "BUTCHER", -90 ] ],
"flags": [ "BELT_CLIP" ]
},
Expand Down Expand Up @@ -936,7 +941,41 @@
[ "SCREW_FINE", 1 ],
[ "BUTCHER", 11 ]
],
"use_action": [ "HAMMER", "CROWBAR" ]
"use_action": [
"HAMMER",
"CROWBAR",
{
"type": "salvage",
"moves_per_part": 1000,
"material_whitelist": [
"steel",
"hardsteel",
"budget_steel",
"tin",
"silver_small",
"gold_small",
"copper",
"iron",
"acidchitin",
"alien_resin",
"bone",
"chitin",
"cotton",
"faux_fur",
"fur",
"kevlar",
"kevlar_rigid",
"leather",
"neoprene",
"nomex",
"nylon",
"plastic",
"rubber",
"wood",
"wool"
]
}
]
},
{
"id": "toolbox_workshop",
Expand Down Expand Up @@ -972,7 +1011,41 @@
[ "REAM", 1 ],
[ "VISE", 1 ]
],
"use_action": [ "HAMMER", "CROWBAR" ]
"use_action": [
"HAMMER",
"CROWBAR",
{
"type": "salvage",
"moves_per_part": 1000,
"material_whitelist": [
"steel",
"hardsteel",
"budget_steel",
"tin",
"silver_small",
"gold_small",
"copper",
"iron",
"acidchitin",
"alien_resin",
"bone",
"chitin",
"cotton",
"faux_fur",
"fur",
"kevlar",
"kevlar_rigid",
"leather",
"neoprene",
"nomex",
"nylon",
"plastic",
"rubber",
"wood",
"wool"
]
}
]
},
{
"id": "toolset_extended",
Expand Down Expand Up @@ -1000,6 +1073,37 @@
"cost_scaling": 0.1,
"move_cost": 1000
},
{
"type": "salvage",
"moves_per_part": 1000,
"material_whitelist": [
"steel",
"hardsteel",
"budget_steel",
"tin",
"silver_small",
"gold_small",
"copper",
"iron",
"acidchitin",
"alien_resin",
"bone",
"chitin",
"cotton",
"faux_fur",
"fur",
"kevlar",
"kevlar_rigid",
"leather",
"neoprene",
"nomex",
"nylon",
"plastic",
"rubber",
"wood",
"wool"
]
},
{ "flame": false, "type": "cauterize" }
],
"qualities": [
Expand Down
8 changes: 8 additions & 0 deletions data/json/materials.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
"fire_resist": 3,
"elec_resist": 0,
"chip_resist": 11,
"salvaged_into": "steel_chunk",
Copy link
Member

Choose a reason for hiding this comment

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

These and related salvaging into chunks of steel instead of scrap is prolly why some of the behavior you observed during was a touch janky.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think scrap metal is too small, you'd be sawing all day to get your item that small. The hacksaw is 20 scrap metal or 4 chunks of steel, so we're increasing the sawing required by a factor of 5.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm. Might be worth testing if making it saw into scrap metal fixes the weird issue of it salvaging super-fast however. If it doesn't then keeping them as steel chunks may be best, who knows.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"dmg_adj": [ "marked", "dented", "smashed", "shattered" ],
"bash_dmg_verb": "dented",
"cut_dmg_verb": "scratched",
Expand Down Expand Up @@ -315,6 +316,7 @@
"elec_resist": 0,
"chip_resist": 10,
"repaired_with": "scrap_copper",
"salvaged_into": "scrap_copper",
"dmg_adj": [ "marked", "dented", "smashed", "shattered" ],
"bash_dmg_verb": "dented",
"cut_dmg_verb": "scratched",
Expand Down Expand Up @@ -614,6 +616,7 @@
"elec_resist": 0,
"chip_resist": 8,
"repaired_with": "gold_small",
"salvaged_into": "gold_small",
"dmg_adj": [ "marked", "dented", "smashed", "shattered" ],
"bash_dmg_verb": "dented",
"cut_dmg_verb": "scratched",
Expand All @@ -637,6 +640,7 @@
"elec_resist": 0,
"chip_resist": 30,
"repaired_with": "scrap",
"salvaged_into": "steel_chunk",
"dmg_adj": [ "marked", "dented", "smashed", "shattered" ],
"bash_dmg_verb": "dented",
"cut_dmg_verb": "scratched",
Expand Down Expand Up @@ -761,6 +765,7 @@
"elec_resist": 0,
"chip_resist": 15,
"repaired_with": "scrap",
"salvaged_into": "steel_chunk",
"dmg_adj": [ "marked", "dented", "smashed", "shattered" ],
"bash_dmg_verb": "dented",
"cut_dmg_verb": "scratched",
Expand Down Expand Up @@ -1173,6 +1178,7 @@
"elec_resist": 0,
"chip_resist": 8,
"repaired_with": "silver_small",
"salvaged_into": "silver_small",
"dmg_adj": [ "marked", "dented", "smashed", "shattered" ],
"bash_dmg_verb": "dented",
"cut_dmg_verb": "scratched",
Expand Down Expand Up @@ -1249,6 +1255,7 @@
"elec_resist": 0,
"chip_resist": 20,
"repaired_with": "scrap",
"salvaged_into": "steel_chunk",
"dmg_adj": [ "marked", "dented", "smashed", "shattered" ],
"bash_dmg_verb": "dented",
"cut_dmg_verb": "scratched",
Expand Down Expand Up @@ -1371,6 +1378,7 @@
"elec_resist": 0,
"chip_resist": 8,
"repaired_with": "tin",
"salvaged_into": "tin",
"dmg_adj": [ "marked", "dented", "smashed", "shattered" ],
"bash_dmg_verb": "dented",
"cut_dmg_verb": "scratched",
Expand Down
Loading