Skip to content

Commit

Permalink
perf: make stuff stackable
Browse files Browse the repository at this point in the history
rag was also made GENERIC because TOOL worked poorly
  • Loading branch information
scarf005 committed Dec 25, 2023
1 parent 91ecd80 commit 1b9a92b
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 45 deletions.
7 changes: 1 addition & 6 deletions data/json/items/comestibles/med.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
58 changes: 44 additions & 14 deletions data/json/items/generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@
"flags": [ "NO_SALVAGE" ],
"weight": "114 g",
"volume": "250 ml",
"category": "spare_parts"
"category": "spare_parts",
"stackable": true
},
{
"type": "GENERIC",
Expand All @@ -223,7 +224,8 @@
"weight": "100 g",
"volume": "250 ml",
"category": "spare_parts",
"to_hit": -1
"to_hit": -1,
"stackable": true
},
{
"type": "GENERIC",
Expand All @@ -239,7 +241,8 @@
"weight": "100 g",
"volume": "250 ml",
"category": "spare_parts",
"to_hit": -1
"to_hit": -1,
"stackable": true
},
{
"type": "GENERIC",
Expand All @@ -254,7 +257,8 @@
"material": [ "nomex" ],
"flags": [ "NO_SALVAGE" ],
"weight": "42 g",
"volume": "250 ml"
"volume": "250 ml",
"stackable": true
},
{
"type": "GENERIC",
Expand All @@ -270,7 +274,8 @@
"weight": "45 g",
"volume": "250 ml",
"to_hit": -2,
"flags": [ "UNRECOVERABLE" ]
"flags": [ "UNRECOVERABLE" ],
"stackable": true
},
{
"type": "GENERIC",
Expand Down Expand Up @@ -623,7 +628,8 @@
"material": "steel",
"weight": "151 g",
"volume": "500 ml",
"to_hit": -2
"to_hit": -2,
"stackable": true
},
{
"type": "GENERIC",
Expand All @@ -637,7 +643,8 @@
"material": "steel",
"weight": "302 g",
"volume": "500 ml",
"to_hit": -2
"to_hit": -2,
"stackable": true
},
{
"type": "GENERIC",
Expand Down Expand Up @@ -669,7 +676,8 @@
"volume": "1500 ml",
"bashing": 12,
"to_hit": -1,
"qualities": [ [ "HAMMER", 1 ] ]
"qualities": [ [ "HAMMER", 1 ] ],
"stackable": true
},
{
"type": "GENERIC",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -2651,7 +2680,8 @@
"flags": [ "NO_SALVAGE" ],
"weight": "80 g",
"volume": "250 ml",
"category": "spare_parts"
"category": "spare_parts",
"stackable": true
},
{
"id": "cerberus_laser",
Expand Down
1 change: 1 addition & 0 deletions data/json/items/generic/string.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
3 changes: 2 additions & 1 deletion data/json/items/resources/metal.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"volume": "500 ml",
"bashing": 12,
"price": "75 USD",
"price_postapoc": "10 cent"
"price_postapoc": "10 cent",
"stackable": true
},
{
"id": "scrap",
Expand Down
3 changes: 2 additions & 1 deletion data/json/items/resources/misc.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"bashing": 5,
"cutting": 2,
"to_hit": -1,
"qualities": [ [ "BUTCHER", -66 ] ]
"qualities": [ [ "BUTCHER", -66 ] ],
"stackable": true
},
{
"id": "fighter_sting",
Expand Down
10 changes: 6 additions & 4 deletions data/json/items/resources/plastic.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand All @@ -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.",
Expand All @@ -27,7 +28,8 @@
"material": "nylon",
"symbol": ",",
"color": "white",
"flags": [ "NO_SALVAGE" ]
"flags": [ "NO_SALVAGE" ],
"stackable": true
},
{
"id": "plastic_sheet",
Expand Down
9 changes: 6 additions & 3 deletions data/json/items/resources/wood.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -102,7 +103,8 @@
"bashing": 10,
"price": "10 USD",
"price_postapoc": "10 cent",
"flags": [ "FIREWOOD" ]
"flags": [ "FIREWOOD" ],
"stackable": true
},
{
"type": "GENERIC",
Expand Down Expand Up @@ -140,7 +142,8 @@
"bashing": 8,
"price": "80 USD",
"price_postapoc": "10 cent",
"flags": [ "FIREWOOD" ]
"flags": [ "FIREWOOD" ],
"stackable": true
},
{
"type": "GENERIC",
Expand Down
16 changes: 0 additions & 16 deletions data/json/items/tool/toiletries.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 1b9a92b

Please sign in to comment.