From 6d269d01a3976bcd00dbe0799d89c3dda5044b6c Mon Sep 17 00:00:00 2001 From: RoyalFox2140 Date: Thu, 8 Feb 2024 22:37:18 -0500 Subject: [PATCH 1/5] salvage action for metal items --- data/json/items/resources/metal.json | 29 +++++++++---- data/json/items/tool/workshop.json | 65 +++++++++++++++++++++++++++- data/json/materials.json | 5 +++ 3 files changed, 88 insertions(+), 11 deletions(-) diff --git a/data/json/items/resources/metal.json b/data/json/items/resources/metal.json index a0a503f5402e..381a82f0276d 100644 --- a/data/json/items/resources/metal.json +++ b/data/json/items/resources/metal.json @@ -34,7 +34,8 @@ "material": "steel", "symbol": ",", "color": "light_gray", - "ammo_type": "components" + "ammo_type": "components", + "flags": [ "NO_SALVAGE" ] }, { "id": "spike", @@ -104,7 +105,8 @@ "material": [ "lead" ], "symbol": "=", "color": "dark_gray", - "ammo_type": "components" + "ammo_type": "components", + "flags": [ "NO_SALVAGE" ] }, { "id": "gold_small", @@ -122,7 +124,8 @@ "material": [ "gold" ], "symbol": "/", "color": "yellow", - "ammo_type": "components" + "ammo_type": "components", + "flags": [ "NO_SALVAGE" ] }, { "id": "platinum_small", @@ -140,7 +143,8 @@ "material": [ "platinum" ], "symbol": "/", "color": "light_gray", - "ammo_type": "components" + "ammo_type": "components", + "flags": [ "NO_SALVAGE" ] }, { "id": "zinc_metal", @@ -157,7 +161,8 @@ "material": [ "zinc" ], "symbol": "/", "color": "blue", - "ammo_type": "components" + "ammo_type": "components", + "flags": [ "NO_SALVAGE" ] }, { "id": "lead", @@ -175,7 +180,8 @@ "material": [ "lead" ], "symbol": "=", "color": "dark_gray", - "ammo_type": "components" + "ammo_type": "components", + "flags": [ "NO_SALVAGE" ] }, { "id": "magnesium", @@ -212,7 +218,8 @@ "material": [ "silver" ], "symbol": "/", "color": "light_gray", - "ammo_type": "components" + "ammo_type": "components", + "flags": [ "NO_SALVAGE" ] }, { "id": "sheet_metal_small", @@ -252,6 +259,7 @@ "symbol": ",", "color": "light_gray", "ammo_type": "components", + "flags": [ "NO_SALVAGE" ], "qualities": [ [ "HAMMER", 1 ] ] }, { @@ -272,6 +280,7 @@ "symbol": ",", "color": "light_gray", "ammo_type": "components", + "flags": [ "NO_SALVAGE" ], "qualities": [ [ "HAMMER", 1 ] ] }, { @@ -308,7 +317,8 @@ "weight": "50 g", "volume": "25 ml", "bashing": 1, - "to_hit": -2 + "to_hit": -2, + "flags": [ "NO_SALVAGE" ] }, { "id": "tin", @@ -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", diff --git a/data/json/items/tool/workshop.json b/data/json/items/tool/workshop.json index 53eb355a4ff1..0d302fe35ecc 100644 --- a/data/json/items/tool/workshop.json +++ b/data/json/items/tool/workshop.json @@ -287,6 +287,20 @@ "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" ] }, @@ -936,7 +950,24 @@ [ "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" + ] + } + ] }, { "id": "toolbox_workshop", @@ -972,7 +1003,23 @@ [ "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" + ] + } ] }, { "id": "toolset_extended", @@ -1000,6 +1047,20 @@ "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" + ] + }, { "flame": false, "type": "cauterize" } ], "qualities": [ diff --git a/data/json/materials.json b/data/json/materials.json index 368c5bffa9c7..eefc3c76541a 100644 --- a/data/json/materials.json +++ b/data/json/materials.json @@ -183,6 +183,7 @@ "fire_resist": 3, "elec_resist": 0, "chip_resist": 11, + "salvaged_into": "steel_chunk", "dmg_adj": [ "marked", "dented", "smashed", "shattered" ], "bash_dmg_verb": "dented", "cut_dmg_verb": "scratched", @@ -637,6 +638,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", @@ -1173,6 +1175,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", @@ -1249,6 +1252,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", @@ -1371,6 +1375,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", From c1682df7b74951937e2b849ac24b4479b067fe16 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 9 Feb 2024 03:43:52 +0000 Subject: [PATCH 2/5] style(autofix.ci): automated formatting --- data/json/items/tool/workshop.json | 87 +++++++++--------------------- 1 file changed, 26 insertions(+), 61 deletions(-) diff --git a/data/json/items/tool/workshop.json b/data/json/items/tool/workshop.json index 0d302fe35ecc..3119bab4cbe6 100644 --- a/data/json/items/tool/workshop.json +++ b/data/json/items/tool/workshop.json @@ -288,19 +288,10 @@ "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" - ] - }, + "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" ] }, @@ -950,24 +941,15 @@ [ "SCREW_FINE", 1 ], [ "BUTCHER", 11 ] ], - "use_action": [ - "HAMMER", - "CROWBAR", - { - "type": "salvage", - "moves_per_part": 1000, - "material_whitelist": [ - "steel", - "hardsteel", - "budget_steel", - "tin", - "silver_small", - "gold_small", - "copper", - "iron" - ] - } - ] + "use_action": [ + "HAMMER", + "CROWBAR", + { + "type": "salvage", + "moves_per_part": 1000, + "material_whitelist": [ "steel", "hardsteel", "budget_steel", "tin", "silver_small", "gold_small", "copper", "iron" ] + } + ] }, { "id": "toolbox_workshop", @@ -1003,23 +985,15 @@ [ "REAM", 1 ], [ "VISE", 1 ] ], - "use_action": [ - "HAMMER", - "CROWBAR", - { - "type": "salvage", - "moves_per_part": 1000, - "material_whitelist": [ - "steel", - "hardsteel", - "budget_steel", - "tin", - "silver_small", - "gold_small", - "copper", - "iron" - ] - } ] + "use_action": [ + "HAMMER", + "CROWBAR", + { + "type": "salvage", + "moves_per_part": 1000, + "material_whitelist": [ "steel", "hardsteel", "budget_steel", "tin", "silver_small", "gold_small", "copper", "iron" ] + } + ] }, { "id": "toolset_extended", @@ -1048,19 +1022,10 @@ "move_cost": 1000 }, { - "type": "salvage", - "moves_per_part": 1000, - "material_whitelist": [ - "steel", - "hardsteel", - "budget_steel", - "tin", - "silver_small", - "gold_small", - "copper", - "iron" - ] - }, + "type": "salvage", + "moves_per_part": 1000, + "material_whitelist": [ "steel", "hardsteel", "budget_steel", "tin", "silver_small", "gold_small", "copper", "iron" ] + }, { "flame": false, "type": "cauterize" } ], "qualities": [ From 0485ca5c42254cf2044fec47675e59cbe8706c7c Mon Sep 17 00:00:00 2001 From: RoyalFox2140 Date: Fri, 9 Feb 2024 00:16:48 -0500 Subject: [PATCH 3/5] fixes fix nails, add missing salvage actions --- data/json/items/ammo/nail.json | 3 ++- data/json/materials.json | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/data/json/items/ammo/nail.json b/data/json/items/ammo/nail.json index ebec913c3d53..3cf856cce2cd 100644 --- a/data/json/items/ammo/nail.json +++ b/data/json/items/ammo/nail.json @@ -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" ] } ] diff --git a/data/json/materials.json b/data/json/materials.json index eefc3c76541a..a0fc9b96ffc0 100644 --- a/data/json/materials.json +++ b/data/json/materials.json @@ -316,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", @@ -615,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", @@ -763,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", From 3b207bfa1a1f079ccc90cf1ad8c5792b5801f516 Mon Sep 17 00:00:00 2001 From: RoyalFox2140 Date: Fri, 9 Feb 2024 20:31:28 -0500 Subject: [PATCH 4/5] fix fabric cutting --- data/json/items/tool/workshop.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/json/items/tool/workshop.json b/data/json/items/tool/workshop.json index 3119bab4cbe6..1859634f1817 100644 --- a/data/json/items/tool/workshop.json +++ b/data/json/items/tool/workshop.json @@ -947,7 +947,7 @@ { "type": "salvage", "moves_per_part": 1000, - "material_whitelist": [ "steel", "hardsteel", "budget_steel", "tin", "silver_small", "gold_small", "copper", "iron" ] + "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" ] } ] }, @@ -991,7 +991,7 @@ { "type": "salvage", "moves_per_part": 1000, - "material_whitelist": [ "steel", "hardsteel", "budget_steel", "tin", "silver_small", "gold_small", "copper", "iron" ] + "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" ] } ] }, @@ -1024,7 +1024,7 @@ { "type": "salvage", "moves_per_part": 1000, - "material_whitelist": [ "steel", "hardsteel", "budget_steel", "tin", "silver_small", "gold_small", "copper", "iron" ] + "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" } ], From ddc5d4277d3ef479666e4b811398b682c24aeb5c Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sat, 10 Feb 2024 01:32:19 +0000 Subject: [PATCH 5/5] style(autofix.ci): automated formatting --- data/json/items/tool/workshop.json | 84 ++++++++++++++++++++++++++++-- 1 file changed, 81 insertions(+), 3 deletions(-) diff --git a/data/json/items/tool/workshop.json b/data/json/items/tool/workshop.json index 1859634f1817..02aa52171412 100644 --- a/data/json/items/tool/workshop.json +++ b/data/json/items/tool/workshop.json @@ -947,7 +947,33 @@ { "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" ] + "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" + ] } ] }, @@ -991,7 +1017,33 @@ { "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" ] + "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" + ] } ] }, @@ -1024,7 +1076,33 @@ { "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" ] + "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" } ],