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

Stocks, stock accessories, new C++ handling for Folding Stocks #55802

Merged
merged 7 commits into from
Mar 4, 2022
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
14 changes: 14 additions & 0 deletions data/json/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,21 @@
},
{
"id": "COLLAPSIBLE_STOCK",
"//": "this is deprecated for the COLLAPSED_STOCK and FOLDED_STOCK, kept around for mod support",
"type": "json_flag"
},
{
"id": "FOLDED_STOCK",
"//": "for weapons that stock folds to one side, no change in volume.",
"type": "json_flag",
"info": "This items stock is folded it will be hard to shoot with."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

items → item's

Copy link
Contributor

@Faalagorn Faalagorn Mar 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also missing comma before "it" (or better yet, ", so it")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also give tag as well while at it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally (sorry about the comment streak); "item" or "gun"? I think there's no other items that can have stocks.

},
{
"id": "COLLAPSED_STOCK",
"//": "for weapons that stock collapses into the body reducing volume as well.",
"type": "json_flag",
"info": "This items stock is collapsed it will be hard to shoot with."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

items → item's

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also missing comma before "it" (same as above)

},
{
"id": "CONDUCTIVE",
"type": "json_flag"
Expand Down Expand Up @@ -1369,6 +1382,7 @@
},
{
"id": "NEEDS_UNFOLD",
"//": "should not be used for folding mods, use a transforming mod instead",
"type": "json_flag"
},
{
Expand Down
2 changes: 1 addition & 1 deletion data/json/itemgroups/Weapons_Mods_Ammo/gunmod.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
[ "pistol_scope", 10 ],
[ "pistol_stock", 10 ],
[ "tail_hook_stock", 30 ],
[ "bthk_stock", 20 ],
[ "butt_hook", 20 ],
[ "arredondo_chute", 20 ],
[ "recoil_stock", 60 ],
[ "shot_suppressor", 10 ],
Expand Down
10 changes: 10 additions & 0 deletions data/json/items/classes/gun.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"abstract": "gun_base",
"type": "GUN",
"reload_noise_volume": 10,
"//": "this is the default handling for anything with a stock",
"handling": 20,
"name": { "str": "base gun" },
"symbol": "(",
"color": "light_gray",
Expand Down Expand Up @@ -30,6 +32,8 @@
"name": { "str": "base launcher" },
"skill": "launcher",
"modes": [ [ "DEFAULT", "single", 1, "NPC_AVOID" ] ],
"//": "default handling for anything without a recoil stock",
"handling": 10,
"valid_mod_locations": [ [ "accessories", 2 ], [ "barrel", 1 ], [ "sights", 1 ], [ "sling", 1 ] ],
"flags": [ "RELOAD_ONE", "RELOAD_EJECT", "NEVER_JAMS" ],
"faults": [ "fault_gun_blackpowder", "fault_gun_dirt" ]
Expand All @@ -41,6 +45,8 @@
"name": { "str": "base pistol" },
"skill": "pistol",
"sight_dispersion": 60,
"//": "default handling for anything without a stock",
"handling": 10,
"valid_mod_locations": [
[ "accessories", 2 ],
[ "barrel", 1 ],
Expand Down Expand Up @@ -155,6 +161,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
]
},
Expand All @@ -177,6 +184,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
]
},
Expand Down Expand Up @@ -213,6 +221,7 @@
[ "sights mount", 1 ],
[ "sling", 1 ],
[ "stock mount", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel mount", 1 ]
]
},
Expand Down Expand Up @@ -244,6 +253,7 @@
[ "sights mount", 1 ],
[ "sling", 1 ],
[ "stock mount", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel mount", 1 ]
]
},
Expand Down
1 change: 1 addition & 0 deletions data/json/items/gun/12mm.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"flags": [ "NEVER_JAMS" ],
Expand Down
3 changes: 3 additions & 0 deletions data/json/items/gun/20x66mm.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"flags": [ "RELOAD_ONE", "WATERPROOF_GUN", "NEVER_JAMS", "PUMP_ACTION" ],
Expand Down Expand Up @@ -70,6 +71,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"flags": [ "WATERPROOF_GUN", "NEVER_JAMS" ],
Expand Down Expand Up @@ -106,6 +108,7 @@
[ "rail", 1 ],
[ "sights", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel mount", 1 ]
],
"flags": [ "WATERPROOF_GUN", "NEVER_JAMS" ],
Expand Down
3 changes: 3 additions & 0 deletions data/json/items/gun/22.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"faults": [ "fault_gun_blackpowder", "fault_gun_dirt", "fault_gun_chamber_spent" ],
Expand Down Expand Up @@ -80,6 +81,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"faults": [ "fault_gun_blackpowder", "fault_gun_dirt" ],
Expand Down Expand Up @@ -208,6 +210,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"faults": [ "fault_gun_blackpowder", "fault_gun_dirt", "fault_gun_chamber_spent" ],
Expand Down
3 changes: 2 additions & 1 deletion data/json/items/gun/223.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@
[ "rail", 1 ],
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ]
[ "stock", 1 ],
[ "stock accessory", 2 ]
],
"pocket_data": [
{
Expand Down
3 changes: 3 additions & 0 deletions data/json/items/gun/3006.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"faults": [ "fault_gun_blackpowder", "fault_gun_dirt" ],
Expand Down Expand Up @@ -75,6 +76,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"faults": [ "fault_gun_blackpowder", "fault_gun_dirt", "fault_gun_chamber_spent" ],
Expand Down Expand Up @@ -158,6 +160,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"faults": [ "fault_gun_blackpowder", "fault_gun_dirt", "fault_gun_chamber_spent" ],
Expand Down
7 changes: 5 additions & 2 deletions data/json/items/gun/308.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
]
},
Expand Down Expand Up @@ -184,7 +185,8 @@
[ "rail", 1 ],
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ]
[ "stock", 1 ],
[ "stock accessory", 2 ]
],
"pocket_data": [ { "pocket_type": "MAGAZINE_WELL", "item_restriction": [ "belt308" ] } ]
},
Expand Down Expand Up @@ -224,7 +226,8 @@
[ "rail", 1 ],
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ]
[ "stock", 1 ],
[ "stock accessory", 2 ]
],
"pocket_data": [ { "pocket_type": "MAGAZINE_WELL", "item_restriction": [ "belt308" ] } ]
},
Expand Down
1 change: 1 addition & 0 deletions data/json/items/gun/40x46mm.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"flags": [ "RELOAD_ONE", "WATERPROOF_GUN", "NEVER_JAMS" ],
Expand Down
1 change: 1 addition & 0 deletions data/json/items/gun/45.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"faults": [ "fault_gun_blackpowder", "fault_gun_dirt", "fault_gun_chamber_spent" ],
Expand Down
2 changes: 2 additions & 0 deletions data/json/items/gun/50.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
[ "muzzle", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "grip", 1 ],
[ "rail mount", 1 ],
[ "underbarrel mount", 1 ]
Expand Down Expand Up @@ -187,6 +188,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"default_mods": [ "bipod", "rifle_scope", "muzzle_brake" ],
Expand Down
1 change: 1 addition & 0 deletions data/json/items/gun/500.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "rail mount", 1 ],
[ "underbarrel mount", 1 ]
],
Expand Down
3 changes: 2 additions & 1 deletion data/json/items/gun/545x39.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"flags": [ "NEVER_JAMS" ],
Expand Down Expand Up @@ -62,7 +63,7 @@
"min_cycle_recoil": 1260,
"modes": [ [ "DEFAULT", "semi-auto", 1 ], [ "BURST", "burst", 2 ], [ "AUTO", "auto", 4 ] ],
"barrel_volume": "250 ml",
"default_mods": [ "bars" ],
"default_mods": [ "bars", "wire_stock" ],
"valid_mod_locations": [
[ "accessories", 4 ],
[ "barrel", 1 ],
Expand Down
1 change: 1 addition & 0 deletions data/json/items/gun/57.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"faults": [ "fault_gun_blackpowder", "fault_gun_dirt", "fault_gun_chamber_spent" ],
Expand Down
1 change: 1 addition & 0 deletions data/json/items/gun/5x50.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"flags": [ "WATERPROOF_GUN", "NEVER_JAMS" ],
Expand Down
1 change: 1 addition & 0 deletions data/json/items/gun/700nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"flags": [ "NEVER_JAMS", "RELOAD_EJECT" ],
Expand Down
4 changes: 4 additions & 0 deletions data/json/items/gun/762.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
[ "sights mount", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel mount", 1 ]
],
"pocket_data": [ { "pocket_type": "MAGAZINE_WELL", "item_restriction": [ "akmag30", "akmag10", "akmag20", "akmag40", "akdrum75" ] } ]
Expand Down Expand Up @@ -72,6 +73,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"pocket_data": [ { "pocket_type": "MAGAZINE_WELL", "item_restriction": [ "akmag30", "akmag10", "akmag20", "akmag40" ] } ]
Expand Down Expand Up @@ -113,6 +115,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"flags": [ "RELOAD_ONE", "NEVER_JAMS" ],
Expand Down Expand Up @@ -158,6 +161,7 @@
[ "sights mount", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel mount", 1 ]
],
"pocket_data": [ { "pocket_type": "MAGAZINE_WELL", "item_restriction": [ "akmag30", "akmag10", "akmag20", "akmag40", "akdrum75" ] } ]
Expand Down
3 changes: 3 additions & 0 deletions data/json/items/gun/762R.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"relative": { "price": 10000 }
Expand Down Expand Up @@ -78,6 +79,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock mount", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel mount", 1 ]
],
"flags": [ "RELOAD_ONE" ],
Expand Down Expand Up @@ -108,6 +110,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ]
],
"relative": { "price": 10000 }
Expand Down
1 change: 1 addition & 0 deletions data/json/items/gun/762x25.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
[ "sights", 1 ],
[ "sling", 1 ],
[ "stock", 1 ],
[ "stock accessory", 2 ],
[ "underbarrel", 1 ],
[ "rail mount", 1 ]
],
Expand Down
Loading