From 1b9a92b1fcef62537e3b6e4b0645d0b040b48056 Mon Sep 17 00:00:00 2001 From: scarf Date: Tue, 24 Oct 2023 01:44:36 +0900 Subject: [PATCH] perf: make stuff stackable rag was also made GENERIC because TOOL worked poorly --- data/json/items/comestibles/med.json | 7 +--- data/json/items/generic.json | 58 +++++++++++++++++++------- data/json/items/generic/string.json | 1 + data/json/items/resources/metal.json | 3 +- data/json/items/resources/misc.json | 3 +- data/json/items/resources/plastic.json | 10 +++-- data/json/items/resources/wood.json | 9 ++-- data/json/items/tool/toiletries.json | 16 ------- 8 files changed, 62 insertions(+), 45 deletions(-) diff --git a/data/json/items/comestibles/med.json b/data/json/items/comestibles/med.json index 70557269b993..d51dc3337c78 100644 --- a/data/json/items/comestibles/med.json +++ b/data/json/items/comestibles/med.json @@ -1751,17 +1751,12 @@ { "id": "disinrag", "type": "COMESTIBLE", + "copy-from": "rag_abstract", "comestible_type": "MED", "name": { "str": "antiseptic soaked rag" }, "description": "A rag soaked in antiseptic. Useful for light wounds, probably won't help with deep bites.", - "weight": "80 g", - "//": "Can't copy-from rag, it breaks the stacking for some reason!", - "volume": "250 ml", "price": "250 cent", "price_postapoc": "50 cent", - "material": "cotton", - "symbol": ",", - "color": "white", "flags": [ "NO_INGEST" ], "use_action": { "type": "heal", diff --git a/data/json/items/generic.json b/data/json/items/generic.json index f72c45a227b9..23876a466db9 100644 --- a/data/json/items/generic.json +++ b/data/json/items/generic.json @@ -196,7 +196,8 @@ "flags": [ "NO_SALVAGE" ], "weight": "114 g", "volume": "250 ml", - "category": "spare_parts" + "category": "spare_parts", + "stackable": true }, { "type": "GENERIC", @@ -223,7 +224,8 @@ "weight": "100 g", "volume": "250 ml", "category": "spare_parts", - "to_hit": -1 + "to_hit": -1, + "stackable": true }, { "type": "GENERIC", @@ -239,7 +241,8 @@ "weight": "100 g", "volume": "250 ml", "category": "spare_parts", - "to_hit": -1 + "to_hit": -1, + "stackable": true }, { "type": "GENERIC", @@ -254,7 +257,8 @@ "material": [ "nomex" ], "flags": [ "NO_SALVAGE" ], "weight": "42 g", - "volume": "250 ml" + "volume": "250 ml", + "stackable": true }, { "type": "GENERIC", @@ -270,7 +274,8 @@ "weight": "45 g", "volume": "250 ml", "to_hit": -2, - "flags": [ "UNRECOVERABLE" ] + "flags": [ "UNRECOVERABLE" ], + "stackable": true }, { "type": "GENERIC", @@ -623,7 +628,8 @@ "material": "steel", "weight": "151 g", "volume": "500 ml", - "to_hit": -2 + "to_hit": -2, + "stackable": true }, { "type": "GENERIC", @@ -637,7 +643,8 @@ "material": "steel", "weight": "302 g", "volume": "500 ml", - "to_hit": -2 + "to_hit": -2, + "stackable": true }, { "type": "GENERIC", @@ -669,7 +676,8 @@ "volume": "1500 ml", "bashing": 12, "to_hit": -1, - "qualities": [ [ "HAMMER", 1 ] ] + "qualities": [ [ "HAMMER", 1 ] ], + "stackable": true }, { "type": "GENERIC", @@ -1677,16 +1685,37 @@ "to_hit": -6 }, { + "abstract": "rag_abstract", "type": "GENERIC", - "id": "rag_bloody", + "name": { "str": "rag" }, + "description": "This is a largish piece of cloth, useful in crafting and possibly for staunching bleeding. It's a bug if you see this.", + "category": "spare_parts", + "weight": "80 g", + "volume": "250 ml", + "price": 0, + "price_postapoc": 0, + "material": "cotton", "symbol": ",", + "color": "white", + "flags": [ "NO_SALVAGE" ], + "stackable": true + }, + { + "id": "rag", + "type": "GENERIC", + "name": { "str": "rag" }, + "description": "This is a largish piece of cloth, useful in crafting and possibly for staunching bleeding.", + "copy-from": "rag_abstract", + "use_action": [ { "type": "heal", "move_cost": 200, "used_up_item": "rag_bloody", "bleed": 0.5, "limb_power": 0 }, "WASH_HARD_ITEMS" ] + }, + { + "type": "GENERIC", + "id": "rag_bloody", + "copy-from": "rag_abstract", "color": "red", "name": { "str": "blood soaked rag" }, "description": "A large rag, drenched in blood. It could be cleaned with boiling water.", - "material": "cotton", - "flags": [ "NO_SALVAGE", "TRADER_AVOID" ], - "weight": "80 g", - "volume": "250 ml" + "extend": { "flags": "TRADER_AVOID" } }, { "id": "pipe_cleaner", @@ -2651,7 +2680,8 @@ "flags": [ "NO_SALVAGE" ], "weight": "80 g", "volume": "250 ml", - "category": "spare_parts" + "category": "spare_parts", + "stackable": true }, { "id": "cerberus_laser", diff --git a/data/json/items/generic/string.json b/data/json/items/generic/string.json index 0c76cffd6d23..48a9e40829b6 100644 --- a/data/json/items/generic/string.json +++ b/data/json/items/generic/string.json @@ -20,6 +20,7 @@ { "id": "string_6", "type": "GENERIC", + "stackable": true, "category": "spare_parts", "name": { "str": "short string" }, "description": "A 6-inch (or about 15 cm) long piece of cotton string.", diff --git a/data/json/items/resources/metal.json b/data/json/items/resources/metal.json index a0a503f5402e..bf84326727bc 100644 --- a/data/json/items/resources/metal.json +++ b/data/json/items/resources/metal.json @@ -16,7 +16,8 @@ "volume": "500 ml", "bashing": 12, "price": "75 USD", - "price_postapoc": "10 cent" + "price_postapoc": "10 cent", + "stackable": true }, { "id": "scrap", diff --git a/data/json/items/resources/misc.json b/data/json/items/resources/misc.json index e5ba1bab6724..bbf70124f936 100644 --- a/data/json/items/resources/misc.json +++ b/data/json/items/resources/misc.json @@ -47,7 +47,8 @@ "bashing": 5, "cutting": 2, "to_hit": -1, - "qualities": [ [ "BUTCHER", -66 ] ] + "qualities": [ [ "BUTCHER", -66 ] ], + "stackable": true }, { "id": "fighter_sting", diff --git a/data/json/items/resources/plastic.json b/data/json/items/resources/plastic.json index 1a9fc5c4e9a3..af332d8a10ca 100644 --- a/data/json/items/resources/plastic.json +++ b/data/json/items/resources/plastic.json @@ -1,7 +1,7 @@ [ { "id": "plastic_chunk", - "type": "TOOL", + "type": "GENERIC", "category": "spare_parts", "name": { "str": "plastic chunk" }, "description": "This is a piece of plastic. It could be used to fabricate, repair, or reinforce plastic items.", @@ -12,11 +12,12 @@ "material": "plastic", "symbol": ",", "color": "light_blue", - "flags": [ "NO_SALVAGE" ] + "flags": [ "NO_SALVAGE" ], + "stackable": true }, { "id": "nylon", - "type": "TOOL", + "type": "GENERIC", "category": "spare_parts", "name": { "str_sp": "synthetic fabric" }, "description": "This is small bolt of synthetic fabric. Unlike you and other natural materials, it won't degrade much with age. Maybe that's less of a bad thing now.", @@ -27,7 +28,8 @@ "material": "nylon", "symbol": ",", "color": "white", - "flags": [ "NO_SALVAGE" ] + "flags": [ "NO_SALVAGE" ], + "stackable": true }, { "id": "plastic_sheet", diff --git a/data/json/items/resources/wood.json b/data/json/items/resources/wood.json index 38d4f9163012..d3ebcd88faf2 100644 --- a/data/json/items/resources/wood.json +++ b/data/json/items/resources/wood.json @@ -30,7 +30,8 @@ "bashing": 4, "to_hit": 1, "qualities": [ [ "COOK", 1 ] ], - "flags": [ "NO_SALVAGE", "TRADER_AVOID", "FIREWOOD" ] + "flags": [ "NO_SALVAGE", "TRADER_AVOID", "FIREWOOD" ], + "stackable": true }, { "id": "stick", @@ -102,7 +103,8 @@ "bashing": 10, "price": "10 USD", "price_postapoc": "10 cent", - "flags": [ "FIREWOOD" ] + "flags": [ "FIREWOOD" ], + "stackable": true }, { "type": "GENERIC", @@ -140,7 +142,8 @@ "bashing": 8, "price": "80 USD", "price_postapoc": "10 cent", - "flags": [ "FIREWOOD" ] + "flags": [ "FIREWOOD" ], + "stackable": true }, { "type": "GENERIC", diff --git a/data/json/items/tool/toiletries.json b/data/json/items/tool/toiletries.json index 80b92f071b57..db4e5bdefddb 100644 --- a/data/json/items/tool/toiletries.json +++ b/data/json/items/tool/toiletries.json @@ -74,22 +74,6 @@ "techniques": "WBLOCK_1", "use_action": "MOP" }, - { - "id": "rag", - "type": "TOOL", - "category": "spare_parts", - "name": { "str": "rag" }, - "description": "This is a largish piece of cloth, useful in crafting and possibly for staunching bleeding.", - "weight": "80 g", - "volume": "250 ml", - "price": 0, - "price_postapoc": 0, - "material": "cotton", - "symbol": ",", - "color": "white", - "use_action": [ { "type": "heal", "move_cost": 200, "used_up_item": "rag_bloody", "bleed": 0.5, "limb_power": 0 }, "WASH_HARD_ITEMS" ], - "flags": [ "NO_SALVAGE" ] - }, { "type": "GENERIC", "category": "tools",