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

weapons: add tests to confirm melee weapon value and adjust some weapons (part 2) #41089

Merged
merged 5 commits into from
Jun 7, 2020
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
45 changes: 22 additions & 23 deletions data/json/items/melee/bludgeons.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"category": "weapons",
"name": { "str": "war flail" },
"description": "This is a stout pole with a large steel flanged mace head on a short chain attached to it, based on the peasant flail agricultural tool except now with a metal head and made to thresh people in metal armor rather than grain.",
"weight": "4550 g",
"volume": "3750 ml",
"weight": "3550 g",
"volume": "2250 ml",
"price": 25000,
"price_postapoc": 3000,
"bashing": 50,
"bashing": 65,
"material": [ "wood", "steel" ],
"symbol": "\\",
"color": "dark_gray",
Expand All @@ -23,10 +23,10 @@
"name": { "str": "peasant flail" },
"description": "This is a stout pole with a wooden club on a leather cord attached to it, this is a tool used to thresh wheat and occasionally people when the peasants got angry at their feudal lords.",
"weight": "1700 g",
"volume": "3750 ml",
"volume": "2250 ml",
"price": 4000,
"price_postapoc": 1000,
"bashing": 26,
"bashing": 35,
"material": [ "wood" ],
"symbol": "\\",
"color": "brown",
Expand All @@ -47,7 +47,7 @@
"techniques": [ "WBLOCK_1" ],
"flags": [ "DURABLE_MELEE" ],
"volume": "1750 ml",
"bashing": 26,
"bashing": 22,
"price": 16000
},
{
Expand All @@ -65,7 +65,7 @@
"qualities": [ [ "HAMMER", 1 ] ],
"flags": [ "DURABLE_MELEE" ],
"volume": "1750 ml",
"bashing": 26,
"bashing": 22,
"price": 16000
},
{
Expand Down Expand Up @@ -116,7 +116,7 @@
"flags": [ "DURABLE_MELEE", "BELT_CLIP" ],
"use_action": { "menu_text": "Collapse", "type": "transform", "target": "baton", "msg": "You collapse your baton." },
"volume": "750 ml",
"bashing": 18,
"bashing": 21,
"price": 17500
},
{
Expand Down Expand Up @@ -209,9 +209,9 @@
"weight": "1133 g",
"volume": "2 L",
"//": "MA reference I used held that a bokken crushes rather than cuts (or impales) but is otherwise just as damaging as a katana. Nerfed by popular demand.",
"bashing": 26,
"bashing": 24,
"cutting": 1,
"to_hit": 2,
"to_hit": 3,
"category": "weapons"
},
{
Expand All @@ -230,7 +230,7 @@
"weight": "680 g",
"volume": "2 L",
"bashing": 13,
"to_hit": 1,
"to_hit": 2,
"category": "weapons"
},
{
Expand All @@ -248,8 +248,8 @@
"flags": [ "SHEATH_SWORD" ],
"weight": "1133 g",
"volume": "2 L",
"bashing": 26,
"to_hit": 1,
"bashing": 17,
"to_hit": 2,
"category": "weapons"
},
{
Expand Down Expand Up @@ -301,7 +301,7 @@
"techniques": [ "WBLOCK_1" ],
"flags": [ "DURABLE_MELEE", "NONCONDUCTIVE" ],
"volume": "2 L",
"bashing": 26,
"bashing": 22,
"cutting": 8,
"price": 20000
},
Expand Down Expand Up @@ -336,7 +336,7 @@
"techniques": [ "WBLOCK_2", "RAPID", "PRECISE" ],
"flags": [ "DURABLE_MELEE" ],
"volume": "600 ml",
"bashing": 8,
"bashing": 10,
"price": 1000
},
{
Expand Down Expand Up @@ -701,14 +701,13 @@
"name": { "str": "morningstar" },
"description": "A medieval weapon consisting of a wood handle with a heavy, spiked iron ball on the end. It deals devastating crushing damage, with a small amount of piercing to boot.",
"weight": "1400 g",
"to_hit": -1,
"color": "dark_gray",
"symbol": "/",
"material": [ "iron", "wood" ],
"techniques": [ "SWEEP" ],
"volume": "1500 ml",
"bashing": 38,
"cutting": 6,
"cutting": 8,
"flags": [ "DURABLE_MELEE", "SPEAR", "NONCONDUCTIVE" ],
"price": 120000,
"price_postapoc": 8000,
Expand All @@ -727,7 +726,7 @@
"material": [ "aluminum", "wood" ],
"techniques": [ "SWEEP" ],
"volume": "1500 ml",
"bashing": 26,
"bashing": 13,
"cutting": 1,
"flags": [ "SPEAR", "NONCONDUCTIVE", "FRAGILE_MELEE" ],
"price": 12000,
Expand Down Expand Up @@ -765,7 +764,7 @@
"material": [ "wood" ],
"techniques": [ "WBLOCK_1" ],
"volume": "1750 ml",
"bashing": 26,
"bashing": 22,
"cutting": 4,
"flags": [ "STAB" ],
"price": 16000,
Expand Down Expand Up @@ -821,7 +820,7 @@
"flags": [ "DURABLE_MELEE", "BELT_CLIP" ],
"use_action": { "menu_text": "Retract", "type": "transform", "target": "PR24-retracted", "msg": "You collapse your PR-24 baton." },
"volume": "2 L",
"bashing": 20,
"bashing": 22,
"price": 30000,
"price_postapoc": 750
},
Expand Down Expand Up @@ -909,7 +908,7 @@
"flags": [ "DURABLE_MELEE" ],
"weight": "910 g",
"volume": "1500 ml",
"bashing": 26,
"bashing": 24,
"to_hit": 2,
"price_postapoc": 1250,
"category": "weapons"
Expand All @@ -927,7 +926,7 @@
"flags": [ "DURABLE_MELEE", "NONCONDUCTIVE" ],
"weight": "1135 g",
"volume": "1500 ml",
"bashing": 30,
"bashing": 27,
"to_hit": 2,
"price_postapoc": 1750,
"category": "weapons"
Expand All @@ -945,7 +944,7 @@
"flags": [ "FRAGILE_MELEE" ],
"weight": "850 g",
"volume": "1500 ml",
"bashing": 26,
"bashing": 12,
"to_hit": 1,
"price_postapoc": 50,
"category": "weapons"
Expand Down
4 changes: 2 additions & 2 deletions data/json/items/melee/swords_and_blades.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"description": "A two by four with a cross guard and whittled down point; not much for slashing, but much better than your bare hands.",
"material": "wood",
"volume": "1250 ml",
"weight": "600 g",
"weight": "1000 g",
"longest_side": "100 cm",
"bashing": 12,
"cutting": 1,
Expand All @@ -26,7 +26,7 @@
"description": "The nail sword, or nord for short. This wooden sword has a dozen nails sticking at jagged angles from edge of the blade, making it much better at chopping than slashing.",
"material": "wood",
"volume": "1750 ml",
"weight": "648 g",
"weight": "1148 g",
"longest_side": "100 cm",
"bashing": 12,
"cutting": 4,
Expand Down
13 changes: 7 additions & 6 deletions data/json/items/melee/unarmed_weapons.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"description": "A metal weapon made of brass, designed to be gripped in the palm and cause punches to do extra damage. A good, quick weapon - but you have to get within punching range to use it.",
"material": "brass",
"weight": "320 g",
"bashing": 3,
"volume": "250 ml",
"bashing": 4,
"price_postapoc": 250,
"flags": [ "UNARMED_WEAPON", "DURABLE_MELEE" ]
},
Expand All @@ -57,7 +58,7 @@
"cutting": 14,
"price_postapoc": 500,
"qualities": [ [ "CUT", 1 ], [ "BUTCHER", 8 ] ],
"flags": [ "UNARMED_WEAPON" ],
"flags": [ "UNARMED_WEAPON", "STAB" ],
"techniques": [ "WBLOCK_1" ]
},
{
Expand All @@ -70,10 +71,10 @@
"material": "wood",
"volume": "250 ml",
"weight": "430 g",
"bashing": 3,
"cutting": 4,
"bashing": 2,
"cutting": 3,
"price_postapoc": 50,
"flags": [ "UNARMED_WEAPON" ]
"flags": [ "UNARMED_WEAPON", "STAB" ]
},
{
"type": "GENERIC",
Expand All @@ -85,7 +86,7 @@
"material": "steel",
"volume": "250 ml",
"weight": "430 g",
"bashing": 3,
"bashing": 4,
"price_postapoc": 50,
"qualities": [ [ "HAMMER", 1 ] ],
"flags": [ "UNARMED_WEAPON" ]
Expand Down
10 changes: 5 additions & 5 deletions data/json/items/tool/firefighting.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"techniques": [ "WBLOCK_1" ],
"weight": "907 g",
"volume": "1 L",
"bashing": 14,
"cutting": 8,
"to_hit": -1,
"bashing": 17,
"cutting": 28,
"to_hit": -2,
"flags": [ "DURABLE_MELEE", "BELT_CLIP", "NONCONDUCTIVE", "SHEATH_AXE" ],
"qualities": [ [ "AXE", 2 ], [ "CUT", 1 ], [ "PRY", 2 ], [ "BUTCHER", 16 ] ]
},
Expand Down Expand Up @@ -130,7 +130,7 @@
"volume": "3250 ml",
"bashing": 20,
"cutting": 6,
"to_hit": 2,
"to_hit": -1,
"qualities": [ [ "COOK", 1 ] ]
},
{
Expand All @@ -149,7 +149,7 @@
"volume": "1900 ml",
"bashing": 15,
"cutting": 13,
"to_hit": 1,
"to_hit": -1,
"qualities": [ [ "PRY", 3 ], [ "HAMMER", 1 ], [ "DIG", 1 ] ],
"use_action": [ "HAMMER", "CROWBAR" ]
}
Expand Down
23 changes: 11 additions & 12 deletions data/json/items/tool/woodworking.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@
{
"id": "hand_axe",
"type": "TOOL",
"name": { "str": "stone hand axe" },
"name": { "str": "stone axe head" },
"description": "This is a broad piece of stone with an edge narrow enough to roughly chop wood.",
"weight": "453 g",
"volume": "500 ml",
"price": 0,
"price_postapoc": 50,
"to_hit": -2,
"bashing": 14,
"cutting": 8,
"to_hit": -3,
"bashing": 7,
"cutting": 11,
"material": "stone",
"symbol": ";",
"color": "light_gray",
Expand All @@ -206,12 +206,11 @@
"id": "makeshift_axe",
"copy-from": "hand_axe",
"type": "TOOL",
"name": { "str": "metal hand axe" },
"name": { "str": "metal axe head" },
"description": "This is a chunk of steel with one edge hammered down to something resembling a cutting edge. It works passably well as an axe but really can't compare to a proper axe.",
"material": "steel",
"to_hit": -3,
"bashing": 9,
"cutting": 15,
"bashing": 8,
"cutting": 12,
"flags": [ "SHEATH_AXE" ]
},
{
Expand All @@ -221,7 +220,7 @@
"description": "This is a stone adze, somewhat useful for smoothing wood objects.",
"weight": "1300 g",
"volume": "1 L",
"price": 1000,
"price": 0,
"price_postapoc": 50,
"bashing": 9,
"cutting": 15,
Expand All @@ -230,15 +229,15 @@
"symbol": ";",
"color": "brown",
"qualities": [ [ "SAW_W", 1 ], [ "BUTCHER", -56 ] ],
"flags": [ "BELT_CLIP" ]
"flags": [ "BELT_CLIP", "SHEATH_AXE" ]
},
{
"id": "primitive_axe",
"type": "TOOL",
"name": { "str": "stone axe" },
"description": "This is a stone with a narrow edge affixed to a stick. It can chop wood, but requires much more effort than a modern axe.",
"weight": "3154 g",
"volume": "3500 ml",
"weight": "1300 g",
"volume": "1 L",
"price": 0,
"price_postapoc": 50,
"bashing": 9,
Expand Down
4 changes: 2 additions & 2 deletions data/json/items/tool/workshop.json
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,8 @@
"price": 16000,
"price_postapoc": 1250,
"to_hit": -2,
"bashing": 20,
"cutting": 12,
"bashing": 30,
"cutting": 15,
"material": [ "wood", "steel" ],
"symbol": "/",
"color": "dark_gray",
Expand Down
11 changes: 11 additions & 0 deletions src/character_martial_arts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ void character_martial_arts::reset_style()
style_selected = style_none;
}

void character_martial_arts::clear_styles()
{
keep_hands_free = false;

ma_styles = { {
style_none, style_kicks
}
};
reset_style();
}

void character_martial_arts::selected_style_check()
{
// check if player knows current style naturally, otherwise drop them back to style_none
Expand Down
1 change: 1 addition & 0 deletions src/character_martial_arts.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class character_martial_arts
void learn_current_style_CQB( bool is_avatar );
void learn_style( const matype_id &mastyle, bool is_avatar );
void set_style( const matype_id &mastyle, bool force = false );
void clear_styles();
/** Displays a message if the player can or cannot use the martial art */
void martialart_use_message( const Character &owner ) const;

Expand Down
Loading