Permalink
Browse files

Specific guns can be targetted in json gunmods (#27360)

* Add recipe, gun-specific mod, and addn'l check for itemID in gunmod->usable

In support of some discord-discourse on most gun modifications being specific, I've added support for the item ids to act as valid mod targets in the json data for each gunmod.  I've also added a not so-easy ecipe for a drop-in auto sear for AR-15s.

* Increase time a not-inconsequential amt.

Time to craft increased. All the major time-consuming work is still in the fit and uninstall/reinstall process, but the increased time in gross dimensioning is to be accounted for here.

* Add lightning link

added lightning link.
  • Loading branch information...
tenmillimaster authored and kevingranade committed Jan 5, 2019
1 parent 1492552 commit c606f39b89ede87672c8a979529c392e70799f56
Showing with 87 additions and 1 deletion.
  1. +43 −0 data/json/items/gunmod/mechanism.json
  2. +42 −0 data/json/recipes/recipe_weapon.json
  3. +2 −1 src/item.cpp
@@ -17,6 +17,49 @@
"dispersion_modifier": -1,
"min_skills": [ [ "weapon", 4 ], [ "mechanics", 3 ], [ "gun", 2 ] ]
},
{
"id": "dias",
"type": "GUNMOD",
"name": "drop-in auto sear",
"description": "This is a vaguely 'U' shaped piece of metal with a vaguely 'T' shaped flapper on a pin. Once tucked into an AR-15's lower receiver, the rifle will become selective fire-capable. The handcrafted-sear surface isn't as good as actual full-auto parts, so precision and reliability suffer slightly.",
"weight": 113,
"volume": 1,
"integral_volume": 0,
"price": 65000,
"material": [ "steel" ],
"symbol": ":",
"color": "red",
"location": "mechanism",
"mod_targets": [ "ar15" ],
"//": "Install time short since it drops in, hinging open the AR being all the 'skill' necessary. Precision drop marginal since it'd change how semi and FA trigger pulls feel.",
"install_time": 5000,
"dispersion_modifier": 10,
"durability_modifier": -1,
"mode_modifier": [ [ "AUTO", "auto", 13 ] ],
"min_skills": [ [ "rifle", 2 ] ]
},
{
"id": "llink",
"type": "GUNMOD",
"name": "lightning link",
"description": "Originally designed for the Colt SP-1, this 'reproduction' is intended to convert an AR-15 into a full-auto only rifle. Once the necessary modifications are made and the link is in place, semi-auto is disabled and full-auto is enabled. Reliability and precision suffer greatly due to questionable craftsmanship and lack of unobtainium SP-1 parts.",
"weight": 60,
"volume": 1,
"integral_volume": 0,
"price": 24000,
"material": [ "steel" ],
"symbol": ":",
"color": "red",
"location": "mechanism",
"mod_targets": [ "ar15" ],
"//": "Sort of long install time. Gotta grind down the carrier trip to SP1-ish length. Unfortunately, since you're sort of guessing how long that is, the AR's timing with this installed will be borked.(disco might be disengaged at non-ideal times).",
"install_time": 25000,
"dispersion_modifier": 40,
"durability_modifier": -3,
"mode_modifier": [ [ "DEFAULT", "auto", 14 ] ],
"min_skills": [ [ "mechanics", 2 ], [ "rifle", 3 ] ],
"flags": [ "INSTALL_DIFFICULT" ]
},
{
"id": "waterproof_gunmod",
"type": "GUNMOD",
@@ -1556,6 +1556,48 @@
"qualities": [ { "id": "CUT", "level": 1 } ],
"components": [ [ [ "plastic_chunk", 3 ] ] ]
},
{
"type": "recipe",
"result": "dias",
"category": "CC_WEAPON",
"subcategory": "CSC_WEAPON_MODS",
"skill_used": "fabrication",
"skills_required": [ [ "rifle", 3 ] ],
"difficulty": 5,
"time": 140000,
"//": "Pipe/sheet metal is to add trip to non M16-style carriers, since both types are in civilian AR's.",
"book_learn": [ [ "manual_rifle", 5 ], [ "textbook_anarch", 5 ] ],
"qualities": [ { "id": "HAMMER", "level": 1 }, { "id": "SAW_M_FINE", "level": 1 }, { "id": "DRILL", "level": 1 } ],
"tools": [
[ [ "ar15", -1 ], [ "h&k416a5", -1 ], [ "m27iar", -1 ], [ "m4a1", -1 ] ],
[
[ "oxy_torch", 4 ],
[ "welder", 20 ],
[ "welder_crude", 40 ],
[ "toolset", 40 ]
],
[
[ "small_repairkit", 40 ],
[ "large_repairkit", 40 ]
]
],
"components": [ [ [ "steel_plate", 1 ], [ "steel_lump", 2 ] ], [ [ "pipe", 1 ], [ "sheet_metal_small", 1 ] ], [ [ "scrap", 1 ] ] ]
},
{
"type": "recipe",
"result": "llink",
"category": "CC_WEAPON",
"subcategory": "CSC_WEAPON_MODS",
"skill_used": "fabrication",
"skills_required": [ [ "rifle", 3 ] ],
"difficulty": 4,
"time": 60000,
"//": "Simple to manufacture, hence it's not gonna be in published in too much detail in gun-mags.",
"book_learn": [ [ "manual_rifle", 6 ], [ "textbook_anarch", 3 ] ],
"qualities": [ { "id": "SAW_M", "level": 1 }, { "id": "HAMMER", "level": 1 } ],
"tools": [ [ [ "ar15", -1 ] ], [ [ "small_repairkit", 40 ], [ "large_repairkit", 40 ] ] ],
"components": [ [ [ "sheet_metal_small", 2 ] ] ]
},
{
"type": "recipe",
"result": "bow_sight",
@@ -5318,7 +5318,8 @@ ret_val<bool> item::is_gunmod_compatible( const item &mod ) const
return ret_val<bool>::make_failure( _( "doesn't have enough room for another %s mod" ),
mod.type->gunmod->location.name().c_str() );

} else if( !mod.type->gunmod->usable.count( gun_type() ) ) {
} else if( !mod.type->gunmod->usable.count( gun_type() ) &&
!mod.type->gunmod->usable.count( typeId() ) ) {
return ret_val<bool>::make_failure( _( "cannot have a %s" ), mod.tname().c_str() );

} else if( typeId() == "hand_crossbow" && !mod.type->gunmod->usable.count( pistol_gun_type ) ) {

0 comments on commit c606f39

Please sign in to comment.