Skip to content

Commit

Permalink
Merge pull request CleverRaven#71533 from anothersimulacrum/finish-of…
Browse files Browse the repository at this point in the history
…f-variants

Create standards for gun variants and enforce through CI
  • Loading branch information
Maleclypse authored Feb 28, 2024
2 parents d8ebc75 + d1c26b2 commit d660a13
Show file tree
Hide file tree
Showing 22 changed files with 1,256 additions and 456 deletions.
2 changes: 2 additions & 0 deletions build-scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ then

tools/json_tools/generic_guns_validator.py

tools/json_tools/gun_variant_validator.py -v -cin data/json

# Also build chkjson (even though we're not using it), to catch any
# compile errors there
make -j "$num_jobs" chkjson
Expand Down
2 changes: 2 additions & 0 deletions build-scripts/gha_compile_only.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ then

tools/json_tools/generic_guns_validator.py

tools/json_tools/gun_variant_validator.py -v -cin data/json

# Also build chkjson (even though we're not using it), to catch any
# compile errors there
make -j "$num_jobs" chkjson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
[ "win70_458", 1 ],
[ "combination_gun", 1 ],
[ "458wm", 1 ],
[ "ruger_redhawk", 3 ],
[ "sw629", 3 ],
{ "group": "modular_deagle_44", "prob": 2 },
[ "lemat_revolver", 1 ],
[ "m1911", 5 ],
Expand Down
9 changes: 3 additions & 6 deletions data/json/itemgroups/Weapons_Mods_Ammo/guns.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,10 @@
{ "group": "nested_modular_deagle_50", "prob": 6 },
{ "group": "nested_m1911a1_38super", "prob": 20 },
{ "group": "nested_fn57", "prob": 60 },
{ "group": "nested_ruger_redhawk", "prob": 25 },
{ "group": "nested_sig_40", "prob": 35 },
{ "group": "nested_sig_p230", "prob": 45 },
{ "group": "nested_sw_500", "prob": 15 },
{ "group": "nested_sw629", "prob": 40 },
{ "group": "nested_sw629", "prob": 65 },
{ "group": "nested_usp_45", "prob": 50 },
{ "group": "nested_usp_9mm", "prob": 60 },
{ "group": "nested_walther_p38", "prob": 15 },
Expand Down Expand Up @@ -217,11 +216,10 @@
{ "group": "modular_deagle_complete", "prob": 1 },
{ "item": "m1911a1_38super", "prob": 25 },
{ "item": "fn57", "prob": 15 },
{ "item": "ruger_redhawk", "prob": 25 },
{ "item": "sig_40", "prob": 15 },
{ "item": "sig_p230", "prob": 15 },
{ "item": "sw_500", "prob": 15 },
{ "item": "sw629", "prob": 15 },
{ "item": "sw629", "prob": 40 },
{ "item": "usp_45", "prob": 15 },
{ "item": "usp_9mm", "prob": 35 },
{ "item": "walther_p38", "prob": 10 },
Expand Down Expand Up @@ -259,8 +257,7 @@
{ "group": "modular_deagle_44", "prob": 5 },
{ "group": "modular_deagle_50", "prob": 1 },
{ "group": "nested_deagle_with_kits", "prob": 1 },
{ "item": "sw629", "prob": 15 },
{ "item": "ruger_redhawk", "prob": 15 }
{ "item": "sw629", "prob": 30 }
]
},
{
Expand Down
8 changes: 0 additions & 8 deletions data/json/itemgroups/Weapons_Mods_Ammo/nested_guns.json
Original file line number Diff line number Diff line change
Expand Up @@ -710,14 +710,6 @@
"ammo": 100,
"entries": [ { "item": "ruger_lcr_22", "charges-min": 0, "charges-max": 8 }, { "group": "on_hand_22" } ]
},
{
"id": "nested_ruger_redhawk",
"type": "item_group",
"//": "this is a distribution for the gun, reasonable number of backup mags, and some ammo to repack",
"subtype": "collection",
"ammo": 100,
"entries": [ { "item": "ruger_redhawk", "charges-min": 0, "charges-max": 6 }, { "group": "on_hand_44" } ]
},
{
"id": "nested_sig_40",
"type": "item_group",
Expand Down
2 changes: 1 addition & 1 deletion data/json/items/classes/gun.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"copy-from": "pistol_base",
"type": "GUN",
"name": { "str": "revolver" },
"proportional": { "reload": 0.7 },
"//proportional": { "reload": 0.7 },
"extend": { "flags": [ "RELOAD_ONE", "RELOAD_EJECT", "NEVER_JAMS", "EASY_CLEAN" ] },
"//": "Revolvers exclude the muzzle location preventing installation of suppressors",
"faults": [ "fault_gun_blackpowder", "fault_gun_dirt" ],
Expand Down
2 changes: 1 addition & 1 deletion data/json/items/gun/32.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"looks_like": "glock_17",
"type": "GUN",
"reload_noise_volume": 10,
"name": { "str_sp": "SIG Sauer P230" },
"name": { "str_sp": "P230 pistol" },
"description": "The SIG Sauer P230 is a small, semi-automatic handgun chambered in .32 ACP. Due to its small dimensions, it was often carried as a backup weapon.",
"weight": "460 g",
"volume": "312 ml",
Expand Down
57 changes: 14 additions & 43 deletions data/json/items/gun/44.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,56 +123,27 @@
"melee_damage": { "bash": 10 }
},
{
"id": "ruger_redhawk",
"id": "sw629",
"copy-from": "pistol_revolver",
"looks_like": "sw_619",
"type": "GUN",
"name": { "str": "Ruger Redhawk revolver" },
"description": "One of the most powerful handguns in the world when it was released in 1979, the Redhawk offers very sturdy construction, with an appearance that is reminiscent of \"Wild West\" revolvers.",
"name": { "str": ".44 revolver" },
"description": "A stainless steel, six-shot, double-action revolver with a matte black plastic handle manufactured by Smith & Wesson. Though hardly the most powerful handgun in the world any more, it could still blow a zombie's head clean off.",
"//1": "If someone makes a sw269 ascii picture, make this only the ruger's art",
"ascii_picture": "redhawk",
"weight": "1389 g",
"volume": "699 ml",
"longest_side": "31 cm",
"barrel_length": "181 mm",
"//": "139.7mm + 41mm max OAL for 44mag. Revolvers just built different.",
"price": 86100,
"price_postapoc": 2750,
"to_hit": -2,
"material": [ "steel", "wood" ],
"symbol": "(",
"color": "dark_gray",
"ammo": [ "44" ],
"dispersion": 280,
"durability": 8,
"blackpowder_tolerance": 56,
"clip_size": 6,
"valid_mod_locations": [
[ "barrel", 1 ],
[ "bore", 1 ],
[ "grip", 1 ],
[ "mechanism", 4 ],
[ "rail", 1 ],
[ "sights", 1 ],
[ "stock", 1 ],
[ "underbarrel", 1 ]
],
"pocket_data": [
"variant_type": "gun",
"variants": [
{
"pocket_type": "MAGAZINE",
"rigid": true,
"ammo_restriction": { "44": 6 },
"allowed_speedloaders": [ "44_speedloader6" ]
"id": "ruger_redhawk",
"name": { "str": "Ruger Redhawk revolver" },
"description": "One of the most powerful handguns in the world when it was released in 1979, the Redhawk offers very sturdy construction, with an appearance that is reminiscent of \"Wild West\" revolvers."
},
{
"id": "sw629",
"name": { "str": "S&W 629 revolver" },
"description": "A stainless steel, six-shot, double-action revolver with a matte black plastic handle manufactured by Smith & Wesson. Though hardly the most powerful handgun in the world any more, it could still blow a zombie's head clean off."
}
],
"melee_damage": { "bash": 10 }
},
{
"id": "sw629",
"copy-from": "pistol_revolver",
"looks_like": "sw_619",
"type": "GUN",
"name": { "str": "S&W 629 revolver" },
"description": "A stainless steel, six-shot, double-action revolver with a matte black plastic handle manufactured by Smith & Wesson. Though hardly the most powerful handgun in the world any more, it could still blow a zombie's head clean off.",
"weight": "1267 g",
"volume": "675 ml",
"longest_side": "30 cm",
Expand Down
2 changes: 1 addition & 1 deletion data/json/items/gun/45colt.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"durability": 8,
"clip_size": 6,
"blackpowder_tolerance": 56,
"proportional": { "reload": 1.5 },
"//proportional": { "reload": 1.5 },
"pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "45colt": 6 } } ],
"melee_damage": { "bash": 8 }
}
Expand Down
2 changes: 1 addition & 1 deletion data/json/items/gun/exodii.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
"id": "pamd68mountable",
"copy-from": "pamd68",
"type": "GUN",
"name": { "str": "mountable PA md. 68 battle rifle" },
"name": { "str": "mountable Exodii battle rifle" },
"description": "The most popular gun to use the 12.3ln cartridge was, of course, the PA md. 71. Its predecessor, the md. 68, was viewed by many as a sort of failure: although it was reliable and powerful, it was too heavy to be used as a good infantry weapon, and not really heavy enough to be a good support gun. Enough were made, though, that during the zombie apocalypse, it gained a great deal of resurgent popularity as a light emplacement gun that used readily available ammunition. It perfectly served the purposes of the Exodii, who had far less concern about its unwieldiness. This one has been modified for use in vehicle turrets on Earth.",
"weight": "9630 g",
"volume": "2865 ml",
Expand Down
10 changes: 9 additions & 1 deletion data/json/items/magazine/22.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,16 @@
"id": "marlin_tubeloader",
"looks_like": "stanag30",
"type": "MAGAZINE",
"name": { "str": ".22 19-round tube loader" },
"name": { "str": "small game rifle 19-round tube loader" },
"description": "A tube which holds 19 rounds of .22, designed for quick reloading of a compatible rifle with a tubular magazine.",
"variant_type": "gun",
"variants": [
{
"id": "marlin_tubeloader",
"name": { "str": "Marlin 39A 19-round tube loader" },
"description": "A tube which holds 19 rounds of .22, designed for quick reloading of a compatible rifle with a tubular magazine."
}
],
"weight": "10 g",
"volume": "14 ml",
"longest_side": "49 cm",
Expand Down
22 changes: 14 additions & 8 deletions data/json/monster_special_attacks/monster_gun.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"material": [ "hflesh" ],
"flags": [
"PRIMITIVE_RANGED_WEAPON",
"PSEUDO",
"NEVER_JAMS",
"NONCONDUCTIVE",
"NO_REPAIR",
Expand Down Expand Up @@ -42,6 +43,7 @@
"material": [ "hflesh" ],
"flags": [
"PRIMITIVE_RANGED_WEAPON",
"PSEUDO",
"NEVER_JAMS",
"NONCONDUCTIVE",
"NO_REPAIR",
Expand Down Expand Up @@ -74,6 +76,7 @@
"material": [ "steel" ],
"flags": [
"PRIMITIVE_RANGED_WEAPON",
"PSEUDO",
"NEVER_JAMS",
"NONCONDUCTIVE",
"NO_REPAIR",
Expand Down Expand Up @@ -106,6 +109,7 @@
"material": [ "stone" ],
"flags": [
"PRIMITIVE_RANGED_WEAPON",
"PSEUDO",
"NEVER_JAMS",
"NONCONDUCTIVE",
"NO_REPAIR",
Expand Down Expand Up @@ -145,7 +149,7 @@
"type": "GUN",
"energy_drain": "0 kJ",
"name": { "str": "mounted laser" },
"flags": [ "NEVER_JAMS", "NO_UNLOAD", "NON_FOULING", "NEEDS_NO_LUBE", "NO_TURRET" ]
"flags": [ "PSEUDO", "NEVER_JAMS", "NO_UNLOAD", "NON_FOULING", "NEEDS_NO_LUBE", "NO_TURRET" ]
},
{
"id": "yrax_deterrent_laser",
Expand All @@ -155,7 +159,7 @@
"energy_drain": "0 kJ",
"ammo_effects": [ "LASER" ],
"ranged_damage": { "damage_type": "electric", "amount": 10, "armor_penetration": 4 },
"flags": [ "NEVER_JAMS", "NO_UNLOAD", "NON_FOULING", "NEEDS_NO_LUBE", "NO_TURRET" ]
"flags": [ "PSEUDO", "NEVER_JAMS", "NO_UNLOAD", "NON_FOULING", "NEEDS_NO_LUBE", "NO_TURRET" ]
},
{
"id": "feral_militia_gun",
Expand All @@ -166,7 +170,7 @@
"description": "A fake semi-auto rifle for feral militiamen (because monster aiming is too lethal).",
"material": [ "steel", "plastic" ],
"skill": "rifle",
"flags": [ "NONCONDUCTIVE", "NO_REPAIR", "NO_SALVAGE", "NO_UNLOAD", "RELOAD_AND_SHOOT" ],
"flags": [ "PSEUDO", "NONCONDUCTIVE", "NO_REPAIR", "NO_SALVAGE", "NO_UNLOAD", "RELOAD_AND_SHOOT" ],
"ammo": [ "223" ],
"clip_size": 30,
"longest_side": "83200 cm",
Expand All @@ -187,7 +191,7 @@
"description": "A fake shotgun for feral bikers (because monster aiming is too lethal).",
"material": [ "steel", "aluminum", "plastic" ],
"skill": "shotgun",
"flags": [ "NONCONDUCTIVE", "NO_REPAIR", "NO_SALVAGE", "NO_UNLOAD", "RELOAD_AND_SHOOT" ],
"flags": [ "PSEUDO", "NONCONDUCTIVE", "NO_REPAIR", "NO_SALVAGE", "NO_UNLOAD", "RELOAD_AND_SHOOT" ],
"ammo": [ "shot" ],
"clip_size": 6,
"longest_side": "1166 cm",
Expand All @@ -209,6 +213,7 @@
"ascii_picture": "beretta_m9",
"weight": "961 g",
"volume": "570 ml",
"flags": [ "PSEUDO" ],
"longest_side": "249 mm",
"price": 65000,
"price_postapoc": 2500,
Expand Down Expand Up @@ -236,6 +241,7 @@
"id": "civilian_cop_glock22",
"copy-from": "glock_22",
"looks_like": "glock_22",
"flags": [ "PSEUDO" ],
"type": "GUN",
"name": { "str_sp": "Cops' Glock 22" },
"description": "A gun carried by overconfident officer monsters, more inaccurate for balancing reasons.",
Expand All @@ -248,7 +254,7 @@
"copy-from": "fake_item",
"name": { "str": "acid spit gun" },
"description": "Fake gun that fires acid globs.",
"flags": [ "NEVER_JAMS", "NO_TURRET" ],
"flags": [ "PSEUDO", "NEVER_JAMS", "NO_TURRET" ],
"ammo_effects": [ "BLINDS_EYES", "NEVER_MISFIRES", "NO_DAMAGE_SCALING", "NO_PENETRATE_OBSTACLES" ],
"material": [ "flesh" ],
"skill": "rifle",
Expand All @@ -265,7 +271,7 @@
"description": "Fake gun that fires acid globs.",
"flags": [ "NEVER_JAMS", "NO_TURRET" ],
"modes": [ [ "DEFAULT", "auto", 3 ] ],
"ammo_effects": [ "BLINDS_EYES", "NO_PENETRATE_OBSTACLES", "NEVER_MISFIRES", "NO_DAMAGE_SCALING" ],
"ammo_effects": [ "PSEUDO", "BLINDS_EYES", "NO_PENETRATE_OBSTACLES", "NEVER_MISFIRES", "NO_DAMAGE_SCALING" ],
"material": [ "flesh" ],
"skill": "rifle",
"durability": 10,
Expand All @@ -280,7 +286,7 @@
"name": { "str": "acid dart gun" },
"description": "Fake gun that fires acid globs.",
"flags": [ "NEVER_JAMS", "NO_TURRET" ],
"ammo_effects": [ "BLINDS_EYES", "NO_PENETRATE_OBSTACLES", "NEVER_MISFIRES", "NO_DAMAGE_SCALING" ],
"ammo_effects": [ "PSEUDO", "BLINDS_EYES", "NO_PENETRATE_OBSTACLES", "NEVER_MISFIRES", "NO_DAMAGE_SCALING" ],
"material": [ "flesh" ],
"skill": "rifle",
"durability": 10,
Expand All @@ -295,7 +301,7 @@
"name": { "str": "mi-go bio-gun" },
"description": "Fake gun that fires some sort of solidified organic matter at very high speed by unknown means of propulsion.",
"flags": [ "NEVER_JAMS", "NO_TURRET" ],
"ammo_effects": [ "NEVER_MISFIRES", "NO_PENETRATE_OBSTACLES" ],
"ammo_effects": [ "PSEUDO", "NEVER_MISFIRES", "NO_PENETRATE_OBSTACLES" ],
"material": [ "flesh" ],
"skill": "rifle",
"durability": 10,
Expand Down
2 changes: 1 addition & 1 deletion data/json/npcs/NC_EVAC_BROKER.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{ "item": "usp_45", "prob": 30 },
{ "item": "sw_619", "prob": 30 },
{ "item": "sw_610", "prob": 30 },
{ "item": "ruger_redhawk", "prob": 5 },
{ "item": "sw629", "prob": 5 },
{ "item": "makarov", "prob": 5 },
{ "item": "m9", "prob": 50 }
]
Expand Down
2 changes: 1 addition & 1 deletion data/json/npcs/NC_SCAVENGER.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{ "item": "usp_45", "prob": 30 },
{ "item": "sw_619", "prob": 30 },
{ "item": "sw_610", "prob": 30 },
{ "item": "ruger_redhawk", "prob": 5 },
{ "item": "sw629", "prob": 5 },
{ "item": "makarov", "prob": 5 },
{ "item": "m9", "prob": 50 }
]
Expand Down
10 changes: 9 additions & 1 deletion data/json/npcs/exodii/exodii_merchant_definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,16 @@
"id": "pamd68rubik",
"copy-from": "pamd68",
"type": "GUN",
"name": { "str": "Rubik's PA md. 68 Battle Rifle" },
"name": { "str": "Rubik's Exodii battle rifle" },
"description": "The most popular gun to use the 12.3ln cartridge was, of course, the PA md. 71. Its predecessor, the md. 68, was viewed by many as a sort of failure: although it was reliable and powerful, it was too heavy to be used as a good infantry weapon, and not really heavy enough to be a good support gun. Enough were made, though, that during the zombie apocalypse, it gained a great deal of resurgent popularity as a light emplacement gun that used readily available ammunition. It perfectly served the purposes of the Exodii, who had far less concern about its unwieldiness.\n\nThis particular rifle has been painted a dusty pink color and has a picture of a smiling eel twisting along the barrel.",
"variant_type": "gun",
"variants": [
{
"id": "pamd68",
"name": { "str": "Rubik's PA md. 68 battle rifle" },
"description": "The most popular gun to use the 12.3ln cartridge was, of course, the PA md. 71. Its predecessor, the md. 68, was viewed by many as a sort of failure: although it was reliable and powerful, it was too heavy to be used as a good infantry weapon, and not really heavy enough to be a good support gun. Enough were made, though, that during the zombie apocalypse, it gained a great deal of resurgent popularity as a light emplacement gun that used readily available ammunition. It perfectly served the purposes of the Exodii, who had far less concern about its unwieldiness.\n\nThis particular rifle has been painted a dusty pink color and has a picture of a smiling eel twisting along the barrel."
}
],
"extend": { "flags": [ "TRADER_KEEP_EQUIPPED", "NO_TURRET" ] }
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
},
"update_mapgen": { "place_npcs": [ { "class": "bandit", "x": 17, "y": 9, "target": true } ] },
"effect": [
{ "u_spawn_item": "ruger_redhawk" },
{ "u_spawn_item": "sw629" },
{ "u_spawn_item": "44magnum", "count": 17 },
{ "u_spawn_item": "western_holster" },
{ "u_spawn_item": "badge_marshal" },
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Aftershock/items/gun/8x40mm.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"id": "afs_rm99_pistol",
"type": "GUN",
"copy-from": "ruger_redhawk",
"copy-from": "sw629",
"name": { "str": "RM99 revolver" },
"//": "Bear in mind that most revolvers don't reach $1K. Expensive.",
"description": "Considered overkill by some, the Rivtech M99 remains an exceedingly powerful addition to the arsenal of any gunslinger.",
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Generic_Guns/firearms/gg_firearms_migration.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"replace": "pistol_magnum_pipe"
},
{
"id": [ "sw_619", "mr73", "ruger_redhawk", "sw629", "bfr", "sw_500", "raging_bull", "raging_judge" ],
"id": [ "sw_619", "mr73", "sw629", "bfr", "sw_500", "raging_bull", "raging_judge" ],
"type": "MIGRATION",
"replace": "pistol_magnum_revolver"
},
Expand Down
Loading

0 comments on commit d660a13

Please sign in to comment.