Skip to content

Commit

Permalink
fix: differentiate more SPEAR and STAB flag (#4214)
Browse files Browse the repository at this point in the history
* Update item_factory.cpp

* Update spears_and_polearms.json

* Update items.json

* style(autofix.ci): automated formatting

* feat: script to migrate spear to stab

* chore: migrate `SPEAR` without`REACH_ATTACK` into `STAB`

* docs: `STAB` flag

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: scarf <[email protected]>
Co-authored-by: nocontribute <>
  • Loading branch information
3 people authored Feb 10, 2024
1 parent 6545e8a commit 0d8e532
Show file tree
Hide file tree
Showing 13 changed files with 209 additions and 43 deletions.
2 changes: 1 addition & 1 deletion data/json/items/fake.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"to_hit": 2,
"cutting": 8,
"techniques": "PRECISE",
"flags": [ "TRADER_AVOID", "NO_DROP", "UNBREAKABLE_MELEE", "SPEAR" ],
"flags": [ "TRADER_AVOID", "NO_DROP", "UNBREAKABLE_MELEE", "STAB" ],
"qualities": [ [ "CUT", 1 ], [ "CUT_FINE", 5 ], [ "BUTCHER", 50 ] ]
},
{
Expand Down
12 changes: 6 additions & 6 deletions data/json/items/melee/bludgeons.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@
"description": "This is a versatile polearm with a spiked hammer head, a spike, and a hook attached to a long stick.",
"price": "500 USD",
"material": [ "wood", "steel" ],
"flags": [ "DURABLE_MELEE", "REACH_ATTACK", "NONCONDUCTIVE", "POLEARM", "SHEATH_SPEAR", "SPEAR", "ALWAYS_TWOHAND" ],
"flags": [ "DURABLE_MELEE", "REACH_ATTACK", "NONCONDUCTIVE", "POLEARM", "SHEATH_SPEAR", "SPEAR", "ALWAYS_TWOHAND", "STAB" ],
"techniques": [ "WBLOCK_1", "WIDE", "SWEEP" ],
"weight": "3200 g",
"volume": "3750 ml",
Expand All @@ -488,7 +488,7 @@
"price": "40 USD",
"price_postapoc": "5 USD",
"material": [ "wood", "aluminum" ],
"flags": [ "REACH_ATTACK", "NONCONDUCTIVE", "POLEARM", "SHEATH_SPEAR", "SPEAR", "ALWAYS_TWOHAND", "FRAGILE_MELEE" ],
"flags": [ "REACH_ATTACK", "NONCONDUCTIVE", "POLEARM", "SHEATH_SPEAR", "SPEAR", "ALWAYS_TWOHAND", "FRAGILE_MELEE", "STAB" ],
"techniques": [ "WBLOCK_1", "SWEEP" ],
"weight": "2700 g",
"volume": "3750 ml",
Expand Down Expand Up @@ -601,7 +601,7 @@
"volume": "1500 ml",
"bashing": 38,
"cutting": 6,
"flags": [ "DURABLE_MELEE", "SPEAR", "NONCONDUCTIVE" ],
"flags": [ "DURABLE_MELEE", "STAB", "NONCONDUCTIVE" ],
"price": "1200 USD",
"price_postapoc": "80 USD",
"qualities": [ [ "HAMMER", 1 ] ]
Expand All @@ -617,7 +617,7 @@
"material": [ "budget_steel", "wood" ],
"bashing": 26,
"cutting": 1,
"flags": [ "SPEAR", "NONCONDUCTIVE" ],
"flags": [ "STAB", "NONCONDUCTIVE" ],
"price": "120 USD",
"price_postapoc": "10 USD"
},
Expand All @@ -632,7 +632,7 @@
"material": [ "aluminum", "wood" ],
"bashing": 26,
"cutting": 1,
"flags": [ "SPEAR", "NONCONDUCTIVE", "FRAGILE_MELEE" ],
"flags": [ "STAB", "NONCONDUCTIVE", "FRAGILE_MELEE" ],
"price": "120 USD",
"price_postapoc": "5 USD",
"qualities": [ ]
Expand Down Expand Up @@ -902,7 +902,7 @@
"//": "Craftable from steel, shouldn't be silver. A warhammer is essentially one end of a pickaxe with balancing weight on the other and crushes/pierces the armor.",
"material": [ "iron", "wood" ],
"techniques": [ "WBLOCK_1", "BRUTAL", "SWEEP" ],
"flags": [ "DURABLE_MELEE", "SPEAR", "NONCONDUCTIVE", "BELT_CLIP" ],
"flags": [ "DURABLE_MELEE", "STAB", "NONCONDUCTIVE", "BELT_CLIP" ],
"volume": "1250 ml",
"bashing": 22,
"cutting": 23,
Expand Down
60 changes: 35 additions & 25 deletions data/json/items/melee/spears_and_polearms.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"bashing": 5,
"cutting": 23,
"qualities": [ [ "COOK", 1 ] ],
"flags": [ "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR" ],
"flags": [ "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR", "STAB" ],
"price": "20 USD",
"price_postapoc": "5 USD"
},
Expand All @@ -34,7 +34,7 @@
"bashing": 5,
"cutting": 11,
"price_postapoc": "10 cent",
"flags": [ "SPEAR" ],
"flags": [ "STAB" ],
"techniques": [ "WBLOCK_1" ],
"qualities": [ [ "COOK", 1 ] ]
},
Expand Down Expand Up @@ -69,7 +69,7 @@
"volume": "1250 ml",
"bashing": 4,
"cutting": 13,
"flags": [ "SPEAR", "REACH_ATTACK", "NPC_THROWN", "SHEATH_SPEAR" ],
"flags": [ "SPEAR", "REACH_ATTACK", "NPC_THROWN", "SHEATH_SPEAR", "STAB" ],
"price": "40 USD",
"qualities": [ [ "COOK", 1 ] ]
},
Expand All @@ -91,7 +91,7 @@
"color": "brown",
"techniques": "WBLOCK_1",
"qualities": [ [ "COOK", 1 ] ],
"flags": [ "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR" ]
"flags": [ "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR", "STAB" ]
},
{
"id": "spear_knife",
Expand All @@ -112,7 +112,7 @@
"color": "brown",
"techniques": "WBLOCK_1",
"qualities": [ [ "CUT", 1 ], [ "COOK", 1 ] ],
"flags": [ "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR" ]
"flags": [ "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR", "STAB" ]
},
{
"id": "spear_knife_superior",
Expand Down Expand Up @@ -141,7 +141,7 @@
"symbol": "/",
"color": "brown",
"qualities": [ [ "COOK", 1 ] ],
"flags": [ "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR" ]
"flags": [ "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR", "STAB" ]
},
{
"id": "spear_forked",
Expand All @@ -159,7 +159,7 @@
"volume": "1500 ml",
"bashing": 6,
"cutting": 18,
"flags": [ "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR" ],
"flags": [ "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR", "STAB" ],
"price": "49 USD",
"qualities": [ [ "COOK", 1 ] ]
},
Expand All @@ -181,7 +181,7 @@
"to_hit": -1,
"bashing": 6,
"cutting": 25,
"flags": [ "SPEAR", "REACH_ATTACK", "SHEATH_SPEAR" ],
"flags": [ "SPEAR", "REACH_ATTACK", "SHEATH_SPEAR", "STAB" ],
"qualities": [ [ "COOK", 1 ] ]
},
{
Expand All @@ -199,7 +199,7 @@
"techniques": [ "WBLOCK_1", "IMPALE" ],
"to_hit": 1,
"cutting": 20,
"flags": [ "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR" ],
"flags": [ "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR", "STAB" ],
"qualities": [ [ "COOK", 1 ] ]
},
{
Expand All @@ -215,7 +215,7 @@
"material": [ "steel", "wood" ],
"to_hit": 1,
"cutting": 30,
"flags": [ "DURABLE_MELEE", "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR" ]
"flags": [ "DURABLE_MELEE", "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR", "STAB" ]
},
{
"id": "spear_rebar",
Expand All @@ -232,7 +232,7 @@
"bashing": 5,
"cutting": 15,
"techniques": [ "WBLOCK_1" ],
"flags": [ "SPEAR", "REACH_ATTACK", "SHEATH_SPEAR" ],
"flags": [ "SPEAR", "REACH_ATTACK", "SHEATH_SPEAR", "STAB" ],
"qualities": [ [ "COOK", 1 ], [ "HAMMER", 1 ] ]
},
{
Expand All @@ -253,7 +253,7 @@
"color": "light_gray",
"techniques": [ "WBLOCK_1" ],
"qualities": [ [ "COOK", 1 ] ],
"flags": [ "SPEAR", "REACH_ATTACK", "SHEATH_SPEAR" ]
"flags": [ "SPEAR", "REACH_ATTACK", "SHEATH_SPEAR", "STAB" ]
},
{
"id": "qiang",
Expand All @@ -271,7 +271,7 @@
"volume": "2500 ml",
"bashing": 5,
"cutting": 31,
"flags": [ "DURABLE_MELEE", "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR" ],
"flags": [ "DURABLE_MELEE", "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "SHEATH_SPEAR", "STAB" ],
"price": "800 USD",
"qualities": [ [ "COOK", 1 ] ]
},
Expand Down Expand Up @@ -334,7 +334,7 @@
"color": "light_gray",
"techniques": "WBLOCK_1",
"qualities": [ [ "CUT", 1 ], [ "BUTCHER", -42 ] ],
"flags": [ "REACH_ATTACK", "POLEARM", "NONCONDUCTIVE", "SHEATH_SPEAR", "FRAGILE_MELEE" ]
"flags": [ "REACH_ATTACK", "POLEARM", "NONCONDUCTIVE", "SHEATH_SPEAR", "FRAGILE_MELEE", "SPEAR", "STAB" ]
},
{
"id": "glaive",
Expand All @@ -348,7 +348,7 @@
"price": "500 USD",
"material": [ "steel", "wood" ],
"qualities": [ [ "CUT", 1 ], [ "BUTCHER", -28 ] ],
"flags": [ "DURABLE_MELEE", "REACH_ATTACK", "NONCONDUCTIVE", "POLEARM", "SHEATH_SPEAR", "ALWAYS_TWOHAND" ],
"flags": [ "DURABLE_MELEE", "REACH_ATTACK", "NONCONDUCTIVE", "POLEARM", "SHEATH_SPEAR", "ALWAYS_TWOHAND", "SPEAR", "STAB" ],
"techniques": [ "WIDE", "WBLOCK_1" ],
"weight": "2100 g",
"volume": "2500 ml",
Expand All @@ -372,7 +372,7 @@
"bashing": 7,
"cutting": 45,
"qualities": [ [ "CUT", 1 ], [ "BUTCHER", -24 ] ],
"flags": [ "DURABLE_MELEE", "REACH_ATTACK", "NONCONDUCTIVE", "POLEARM", "SHEATH_SPEAR", "ALWAYS_TWOHAND" ],
"flags": [ "DURABLE_MELEE", "REACH_ATTACK", "NONCONDUCTIVE", "POLEARM", "SHEATH_SPEAR", "ALWAYS_TWOHAND", "SPEAR", "STAB" ],
"price": "800 USD",
"price_postapoc": "95 USD"
},
Expand All @@ -385,7 +385,7 @@
"material": [ "budget_steel", "wood" ],
"bashing": 29,
"cutting": 11,
"flags": [ "REACH_ATTACK", "NONCONDUCTIVE", "POLEARM", "SHEATH_SPEAR", "ALWAYS_TWOHAND" ],
"flags": [ "REACH_ATTACK", "NONCONDUCTIVE", "POLEARM", "SHEATH_SPEAR", "ALWAYS_TWOHAND", "SPEAR", "STAB" ],
"price_postapoc": "15 USD"
},
{
Expand Down Expand Up @@ -420,7 +420,7 @@
"volume": "2250 ml",
"bashing": 6,
"cutting": 40,
"flags": [ "STAB", "POLEARM", "REACH_ATTACK", "SHEATH_SPEAR" ],
"flags": [ "STAB", "POLEARM", "REACH_ATTACK", "SHEATH_SPEAR", "SPEAR" ],
"//": "Description says it can slash. STAB currently doesn't slash, but at least it doesn't give the spear bonus",
"price": "80 USD",
"price_postapoc": "45 USD",
Expand All @@ -442,7 +442,7 @@
"volume": "1 L",
"cutting": 11,
"thrown_damage": [ { "damage_type": "bash", "amount": 5 }, { "damage_type": "stab", "amount": 11 } ],
"flags": [ "SPEAR", "SHEATH_SPEAR", "JAVELIN" ],
"flags": [ "SHEATH_SPEAR", "JAVELIN", "STAB" ],
"price": "40 USD",
"price_postapoc": "250 cent",
"qualities": [ [ "COOK", 1 ] ]
Expand All @@ -460,7 +460,7 @@
"bashing": 5,
"cutting": 19,
"thrown_damage": [ { "damage_type": "bash", "amount": 5 }, { "damage_type": "stab", "amount": 17 } ],
"flags": [ "SPEAR", "NONCONDUCTIVE", "SHEATH_SPEAR", "JAVELIN" ],
"flags": [ "NONCONDUCTIVE", "SHEATH_SPEAR", "JAVELIN", "STAB" ],
"price": "90 USD",
"price_postapoc": "5 USD"
},
Expand Down Expand Up @@ -507,7 +507,17 @@
"color": "brown",
"techniques": [ "IMPALE", "WBLOCK_1" ],
"qualities": [ [ "COOK", 1 ] ],
"flags": [ "DURABLE_MELEE", "POLEARM", "SPEAR", "REACH_ATTACK", "REACH3", "NONCONDUCTIVE", "SHEATH_SPEAR", "ALWAYS_TWOHAND" ]
"flags": [
"DURABLE_MELEE",
"POLEARM",
"SPEAR",
"REACH_ATTACK",
"REACH3",
"NONCONDUCTIVE",
"SHEATH_SPEAR",
"ALWAYS_TWOHAND",
"STAB"
]
},
{
"id": "pike_inferior",
Expand All @@ -521,7 +531,7 @@
"cutting": 8,
"material": [ "budget_steel", "wood" ],
"looks_like": "pike",
"flags": [ "POLEARM", "SPEAR", "REACH_ATTACK", "REACH3", "NONCONDUCTIVE", "ALWAYS_TWOHAND" ]
"flags": [ "POLEARM", "SPEAR", "REACH_ATTACK", "REACH3", "NONCONDUCTIVE", "ALWAYS_TWOHAND", "STAB" ]
},
{
"id": "pike_fake",
Expand All @@ -537,7 +547,7 @@
"cutting": 2,
"material": [ "aluminum", "wood" ],
"looks_like": "pike",
"flags": [ "POLEARM", "SPEAR", "REACH_ATTACK", "REACH3", "NONCONDUCTIVE", "ALWAYS_TWOHAND", "FRAGILE_MELEE" ]
"flags": [ "POLEARM", "SPEAR", "REACH_ATTACK", "REACH3", "NONCONDUCTIVE", "ALWAYS_TWOHAND", "FRAGILE_MELEE", "STAB" ]
},
{
"id": "spear_dory",
Expand All @@ -558,7 +568,7 @@
"color": "yellow",
"techniques": [ "WBLOCK_1", "IMPALE" ],
"qualities": [ [ "COOK", 1 ] ],
"flags": [ "SPEAR", "REACH_ATTACK", "DURABLE_MELEE", "SHEATH_SPEAR", "NONCONDUCTIVE" ]
"flags": [ "SPEAR", "REACH_ATTACK", "DURABLE_MELEE", "SHEATH_SPEAR", "NONCONDUCTIVE", "STAB" ]
},
{
"id": "ji",
Expand All @@ -579,6 +589,6 @@
"symbol": "/",
"color": "yellow",
"techniques": [ "WBLOCK_1", "DEF_DISARM" ],
"flags": [ "DURABLE_MELEE", "POLEARM", "REACH_ATTACK", "ALWAYS_TWOHAND", "NONCONDUCTIVE", "SHEATH_SPEAR" ]
"flags": [ "DURABLE_MELEE", "POLEARM", "REACH_ATTACK", "ALWAYS_TWOHAND", "NONCONDUCTIVE", "SHEATH_SPEAR", "SPEAR", "STAB" ]
}
]
2 changes: 1 addition & 1 deletion data/json/items/resources/wood.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"weight": "2250 g",
"volume": "3750 ml",
"bashing": 25,
"flags": [ "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE" ],
"flags": [ "SPEAR", "REACH_ATTACK", "NONCONDUCTIVE", "STAB" ],
"price": "40 USD",
"price_postapoc": "50 cent",
"qualities": [ [ "HAMMER", 1 ] ]
Expand Down
4 changes: 2 additions & 2 deletions data/json/items/tool/med.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"color": "light_gray",
"techniques": "PRECISE",
"qualities": [ [ "CUT", 1 ], [ "CUT_FINE", 3 ] ],
"flags": [ "SPEAR", "SHEATH_KNIFE" ]
"flags": [ "STAB", "SHEATH_KNIFE" ]
},
{
"id": "smoxygen_tank",
Expand Down Expand Up @@ -189,7 +189,7 @@
"seals": true,
"watertight": true,
"use_action": "BLOOD_DRAW",
"flags": [ "SPEAR" ]
"flags": [ "STAB" ]
},
{
"id": "wrapped_rad_badge",
Expand Down
2 changes: 1 addition & 1 deletion data/json/items/tool/tailoring.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"symbol": ";",
"color": "yellow",
"qualities": [ [ "LEATHER_AWL", 1 ] ],
"flags": [ "SPEAR", "BELT_CLIP", "FRAGILE_MELEE" ]
"flags": [ "STAB", "BELT_CLIP", "FRAGILE_MELEE" ]
},
{
"id": "awl_steel",
Expand Down
8 changes: 4 additions & 4 deletions data/json/items/tool/workshop.json
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@
"color": "dark_gray",
"use_action": "PICKAXE",
"techniques": [ "WBLOCK_1" ],
"flags": [ "SPEAR", "DURABLE_MELEE", "NONCONDUCTIVE", "DIG_TOOL", "SHEATH_AXE" ]
"flags": [ "STAB", "DURABLE_MELEE", "NONCONDUCTIVE", "DIG_TOOL", "SHEATH_AXE" ]
},
{
"id": "pin_reamer",
Expand Down Expand Up @@ -799,7 +799,7 @@
"symbol": ";",
"color": "yellow",
"qualities": [ [ "SCREW", 1 ] ],
"flags": [ "SPEAR", "BELT_CLIP" ]
"flags": [ "STAB", "BELT_CLIP" ]
},
{
"id": "screwdriver_set",
Expand Down Expand Up @@ -889,7 +889,7 @@
},
{ "flame": false, "type": "cauterize" }
],
"flags": [ "SPEAR", "BELT_CLIP", "ALLOWS_REMOTE_USE" ],
"flags": [ "STAB", "BELT_CLIP", "ALLOWS_REMOTE_USE" ],
"magazines": [
[
"battery",
Expand Down Expand Up @@ -1147,7 +1147,7 @@
"color": "light_gray",
"techniques": "PRECISE",
"qualities": [ [ "CUT", 1 ], [ "CUT_FINE", 2 ] ],
"flags": [ "SPEAR", "SHEATH_KNIFE" ]
"flags": [ "STAB", "SHEATH_KNIFE" ]
},
{
"id": "wrench",
Expand Down
2 changes: 1 addition & 1 deletion data/mods/TEST_DATA/items.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"symbol": ";",
"color": "yellow",
"qualities": [ [ "SCREW", 1 ] ],
"flags": [ "SPEAR", "BELT_CLIP" ]
"flags": [ "STAB", "BELT_CLIP" ]
},
{
"id": "test_sonic_screwdriver",
Expand Down
2 changes: 2 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0d8e532

Please sign in to comment.