Skip to content

Commit

Permalink
Adds the XM51 Breaching Scattergun (#5086)
Browse files Browse the repository at this point in the history
# About the pull request

[Design doc (a bit out of
date).](https://hackmd.io/uVhllc-KQSGcvjhEUw66bw?edit)

The XM51 breaching scattergun is a 16-gauge, pump-action mag-fed shotgun
that utilizes specialized breaching shells. It allows marines to break
through doors and walls alike with ease at a safe distance. Each shell
fires out four groups of pellets, the main one dealing 55 damage and the
other three dealing 10 each. Though it has decent damage, this weapon
performs weakly in direct combat compared to other options and is
entirely designed for a support role. Its maximum effective range is
about 4 tiles.

It takes:
- 1 shot for doors
- 2 shots for regular resin walls
- 3 shots for thick resin walls
- 2 shots for regular walls,
- 4 shots for reinforced walls.
- 4 shots for pylons,

Each XM51 kit comes with a dedicated holster for the weapon, along with
two spare magazines, two boxes of shells and a stock. Being able to wear
the weapon around your waist gives the user a great deal of flexibility
when it comes to their loadout. The stock makes it unable to be
holstered, but it does give it a very devastating two shot burst-mode
that quickly clears out walls.

Ammo for the weapon is a bit scarce but still present in a decent
quantity. Requisitions starts with a single 120 round shell box which
they can purchase more of, along with a couple of spare magazines. More
magazines can be purchased, and ASRS has a chance of sending up spare
ammo as well.

This weapon is based on the [actual M51 breaching
scattergun.](https://avp.fandom.com/wiki/M51_Breaching_Scattergun)

# Explain why it's good for the game

Marines are very cowardly when it comes to pushing. Especially so when
they're facing countless thick resin walls and doors. This contributes
to a stale meta where the best option is to just sit behind cades and
wait for the other team to make a mistake, because why would you risk
dying to take down one resin door? That's not fun for anyone. Marines
have a few ways of making some breathing room for themselves from a safe
distance, with one of the best ones being the U7 underbarrel shotgun.
It's a very good and fun attachment, even putting aside the combat
capabilities it has.

However, it's entirely exclusive to the M41A rifles. Any marine that
wants to experiment with their weapon choice a bit and forgo the rifle
lose one of the best tools they have access to. The XM51 gives marines
another, more effective way to breach resin bunkers. In exchange for the
ease of use, abundance of ammo and good combat capabilities of the U7,
you gain a safer, faster, flexible and more potent tool.

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>


https://github.com/cmss13-devs/cmss13/assets/17518895/6f4441d2-740e-4110-a9a6-32c39c424576

combat capabilities vs the u7


https://github.com/cmss13-devs/cmss13/assets/17518895/c0cb1359-cfd0-4b86-8c77-3885c86c5c8c



https://github.com/cmss13-devs/cmss13/assets/17518895/834d9bbb-3aee-4203-93a7-af40e28b7805



![xm51camo](https://github.com/cmss13-devs/cmss13/assets/17518895/1ada72ac-2b4a-441b-ac26-c0152a0eb62b)

![xm51ammo](https://github.com/cmss13-devs/cmss13/assets/17518895/471c2654-c242-4440-8b67-8e19bad8eb45)

![xm51statnostock](https://github.com/cmss13-devs/cmss13/assets/17518895/a672ec8a-3401-4830-a1db-821198dabf91)


</details>


# Changelog
:cl:
add: Added the XM51 breaching scattergun, available in small quantities
as a restricted weapon within Requisitions.

/:cl:
  • Loading branch information
VileBeggar authored Feb 1, 2024
1 parent d729472 commit 07455a5
Show file tree
Hide file tree
Showing 56 changed files with 378 additions and 3 deletions.
8 changes: 8 additions & 0 deletions code/datums/ASRS.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@
reference_package = /datum/supply_packs/ammo_shell_box_flechette
cost = ASRS_VERY_LOW_WEIGHT

/datum/supply_packs_asrs/ammo_shell_box_breaching
reference_package = /datum/supply_packs/ammo_shell_box_breaching
cost = ASRS_VERY_LOW_WEIGHT

/datum/supply_packs_asrs/ammo_xm51
reference_package = /datum/supply_packs/ammo_xm51
cost = ASRS_VERY_LOW_WEIGHT

/datum/supply_packs_asrs/ammo_smartgun
reference_package = /datum/supply_packs/ammo_smartgun

Expand Down
26 changes: 26 additions & 0 deletions code/datums/ammo/bullet/shotgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,32 @@
penetration = ARMOR_PENETRATION_TIER_10
scatter = SCATTER_AMOUNT_TIER_4

/*
16 GAUGE SHOTGUN AMMO
*/

/datum/ammo/bullet/shotgun/light/breaching
name = "light breaching shell"
icon_state = "flechette"
handful_state = "breaching_shell"
multiple_handful_name = TRUE
bonus_projectiles_type = /datum/ammo/bullet/shotgun/light/breaching/spread

accuracy_var_low = PROJECTILE_VARIANCE_TIER_6
accuracy_var_high = PROJECTILE_VARIANCE_TIER_6
damage = 55
max_range = 5
bonus_projectiles_amount = EXTRA_PROJECTILES_TIER_3
penetration = ARMOR_PENETRATION_TIER_1

/datum/ammo/bullet/shotgun/light/breaching/spread
name = "additional light breaching fragments"
bonus_projectiles_amount = 0
accuracy_var_low = PROJECTILE_VARIANCE_TIER_6
accuracy_var_high = PROJECTILE_VARIANCE_TIER_6
scatter = SCATTER_AMOUNT_TIER_3
damage = 10

//Enormous shell for Van Bandolier's superheavy double-barreled hunting gun.
/datum/ammo/bullet/shotgun/twobore
name = "two bore bullet"
Expand Down
2 changes: 2 additions & 0 deletions code/datums/elements/bullet_trait/damage_boost.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
GLOBAL_LIST_INIT(damage_boost_turfs, typecacheof(/turf))

GLOBAL_LIST_INIT(damage_boost_turfs_xeno, typecacheof(/turf/closed/wall/resin))

GLOBAL_LIST_INIT(damage_boost_breaching, typecacheof(list(
/obj/structure/machinery/door,
/obj/structure/mineral_door,
Expand Down
22 changes: 22 additions & 0 deletions code/datums/supply_packs/ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,16 @@
containername = "\improper shotgun flechette crate"
group = "Ammo"

/datum/supply_packs/ammo_shell_box_breaching
name = "Shell box (16g) (120x breaching shells)"
contains = list(
/obj/item/ammo_box/magazine/shotgun/light/breaching,
)
cost = 40
containertype = /obj/structure/closet/crate/ammo
containername = "\improper shotgun breaching crate"
group = "Ammo"

//------------------------For 88M4 ----------------

/datum/supply_packs/ammo_mod88_mag_box_ap
Expand Down Expand Up @@ -296,6 +306,18 @@
containername = "\improper M41AE2 HPR holo-target magazines crate"
group = "Ammo"

/datum/supply_packs/ammo_xm51
contains = list(
/obj/item/ammo_magazine/rifle/xm51,
/obj/item/ammo_magazine/rifle/xm51,
/obj/item/ammo_magazine/shotgun/light/breaching,
)
name = "XM51 Ammo (2x mags) (1x small breaching shell box)"
cost = 20
containertype = /obj/structure/closet/crate/ammo
containername = "\improper XM51 ammo crate"
group = "Ammo"

//------------------------Smartgunner stuff----------------

/datum/supply_packs/ammo_smartgun_battery_pack
Expand Down
13 changes: 12 additions & 1 deletion code/datums/supply_packs/weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,18 @@
)
cost = 30
containertype = /obj/structure/closet/crate/weapon
containername = "MOU-53 Breack Action Shotgun Crate"
containername = "MOU-53 Break Action Shotgun Crate"
group = "Weapons"

/datum/supply_packs/xm51
name = "XM51 Breaching Scattergun Crate (x2)"
contains = list(
/obj/item/storage/box/guncase/xm51,
/obj/item/storage/box/guncase/xm51,
)
cost = 30
containertype = /obj/structure/closet/crate/weapon
containername = "XM51 Breaching Scattergun Crate"
group = "Weapons"

/datum/supply_packs/smartpistol
Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/vending/vendor_types/requisitions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
list("M2C Heavy Machine Gun", round(scale * 2), /obj/item/storage/box/guncase/m2c, VENDOR_ITEM_REGULAR),
list("M240 Incinerator Unit", round(scale * 2), /obj/item/storage/box/guncase/flamer, VENDOR_ITEM_REGULAR),
list("M79 Grenade Launcher", round(scale * 3), /obj/item/storage/box/guncase/m79, VENDOR_ITEM_REGULAR),
list("XM51 Breaching Scattergun", round(scale * 3), /obj/item/storage/box/guncase/xm51, VENDOR_ITEM_REGULAR),

list("EXPLOSIVES", -1, null, null),
list("M15 Fragmentation Grenade", round(scale * 2), /obj/item/explosive/grenade/high_explosive/m15, VENDOR_ITEM_REGULAR),
Expand Down Expand Up @@ -244,11 +245,13 @@
list("M41A MK1 AP Magazine (10x24mm)", round(scale * 2), /obj/item/ammo_magazine/rifle/m41aMK1/ap, VENDOR_ITEM_REGULAR),
list("M56D Drum Magazine", round(scale * 2), /obj/item/ammo_magazine/m56d, VENDOR_ITEM_REGULAR),
list("M2C Box Magazine", round(scale * 2), /obj/item/ammo_magazine/m2c, VENDOR_ITEM_REGULAR),
list("XM51 Magazine (16g)", round(scale * 3), /obj/item/ammo_magazine/rifle/xm51, VENDOR_ITEM_REGULAR),

list("SHOTGUN SHELL BOXES", -1, null, null),
list("Shotgun Shell Box (Buckshot x 100)", round(scale * 2), /obj/item/ammo_box/magazine/shotgun/buckshot, VENDOR_ITEM_REGULAR),
list("Shotgun Shell Box (Flechette x 100)", round(scale * 2), /obj/item/ammo_box/magazine/shotgun/flechette, VENDOR_ITEM_REGULAR),
list("Shotgun Shell Box (Slugs x 100)", round(scale * 2), /obj/item/ammo_box/magazine/shotgun, VENDOR_ITEM_REGULAR),
list("Shotgun Shell Box (16g) (Breaching x 120)", 1, /obj/item/ammo_box/magazine/shotgun/light/breaching, VENDOR_ITEM_REGULAR),
)

/obj/structure/machinery/cm_vending/sorted/cargo_ammo/stock(obj/item/item_to_stock, mob/user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@
list("M240 Incinerator Tank", round(scale * 3), /obj/item/ammo_magazine/flamer_tank, VENDOR_ITEM_REGULAR),
list("M56D Drum Magazine", round(scale * 2), /obj/item/ammo_magazine/m56d, VENDOR_ITEM_REGULAR),
list("M2C Box Magazine", round(scale * 2), /obj/item/ammo_magazine/m2c, VENDOR_ITEM_REGULAR),
list("Box of Breaching Shells (16g)", round(scale * 2), /obj/item/ammo_magazine/shotgun/light/breaching, VENDOR_ITEM_REGULAR),
list("HIRR Baton Slugs", round(scale * 6), /obj/item/explosive/grenade/slug/baton, VENDOR_ITEM_REGULAR),
list("M74 AGM-S Star Shell", round(scale * 4), /obj/item/explosive/grenade/high_explosive/airburst/starshell, VENDOR_ITEM_REGULAR),
list("M74 AGM-S Hornet Shell", round(scale * 4), /obj/item/explosive/grenade/high_explosive/airburst/hornet_shell, VENDOR_ITEM_REGULAR),
Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/items/stacks/sheets/sheet_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ GLOBAL_LIST_INIT_TYPED(cardboard_recipes, /datum/stack_recipe, list ( \
new/datum/stack_recipe("empty magazine box (M41A Incen)", /obj/item/ammo_box/magazine/incen/empty), \
new/datum/stack_recipe("empty magazine box (M41A LE)", /obj/item/ammo_box/magazine/le/empty), \
null, \
new/datum/stack_recipe("empty magazine box (XM51)", /obj/item/ammo_box/magazine/xm51/empty), \
null, \
new/datum/stack_recipe("empty magazine box (M41A MK1)", /obj/item/ammo_box/magazine/mk1/empty), \
new/datum/stack_recipe("empty magazine box (M41A MK1 AP)", /obj/item/ammo_box/magazine/mk1/ap/empty), \
null, \
Expand All @@ -281,6 +283,7 @@ GLOBAL_LIST_INIT_TYPED(cardboard_recipes, /datum/stack_recipe, list ( \
new/datum/stack_recipe("empty shotgun shell box (Incendiary)", /obj/item/ammo_box/magazine/shotgun/incendiary/empty), \
new/datum/stack_recipe("empty shotgun shell box (Incendiary Buckshot)", /obj/item/ammo_box/magazine/shotgun/incendiarybuck/empty), \
new/datum/stack_recipe("empty shotgun shell box (Slugs)", /obj/item/ammo_box/magazine/shotgun/empty), \
new/datum/stack_recipe("empty shotgun shell box (16g) (Breaching)", /obj/item/ammo_box/magazine/shotgun/light/breaching/empty), \
null, \
new/datum/stack_recipe("empty 45-70 bullets box", /obj/item/ammo_box/magazine/lever_action/empty), \
new/datum/stack_recipe("empty 45-70 bullets box (Blanks)", /obj/item/ammo_box/magazine/lever_action/training/empty), \
Expand Down
63 changes: 63 additions & 0 deletions code/game/objects/items/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@
var/drawSound = 'sound/weapons/gun_pistol_draw.ogg'
///Used to get flap overlay states as inserting a gun changes icon state.
var/base_icon
var/gun_has_gamemode_skin
can_hold = list(
/obj/item/weapon/gun/pistol,
/obj/item/ammo_magazine/pistol,
Expand Down Expand Up @@ -966,6 +967,14 @@
*/
playsound(src, drawSound, 7, TRUE)
var/image/gun_underlay = image(icon, current_gun.base_gun_icon)
if(gun_has_gamemode_skin)
switch(SSmapping.configs[GROUND_MAP].camouflage_type)
if("snow")
gun_underlay = image(icon, "s_" + current_gun.base_gun_icon)
if("desert")
gun_underlay = image(icon, "d_" + current_gun.base_gun_icon)
if("classic")
gun_underlay = image(icon, "c_" + current_gun.base_gun_icon)
gun_underlay.pixel_x = holster_slots[slot]["icon_x"]
gun_underlay.pixel_y = holster_slots[slot]["icon_y"]
gun_underlay.color = current_gun.color
Expand Down Expand Up @@ -1186,6 +1195,60 @@
"icon_x" = -11,
"icon_y" = -5))

#define MAXIMUM_MAGAZINE_COUNT 2

/obj/item/storage/belt/gun/xm51
name = "\improper M276 pattern XM51 holster rig"
desc = "The M276 is the standard load-bearing equipment of the USCM. It consists of a modular belt with various clips. This version is for the XM51 breaching scattergun, allowing easier storage of the weapon. It features pouches for storing two magazines along with extra shells."
icon_state = "xm51_holster"
has_gamemode_skin = TRUE
gun_has_gamemode_skin = TRUE
storage_slots = 8
max_w_class = 5
can_hold = list(
/obj/item/weapon/gun/rifle/xm51,
/obj/item/ammo_magazine/rifle/xm51,
/obj/item/ammo_magazine/handful,
)
holster_slots = list(
"1" = list(
"icon_x" = 10,
"icon_y" = -1))

//Keep a track of how many magazines are inside the belt.
var/magazines = 0

/obj/item/storage/belt/gun/xm51/attackby(obj/item/item, mob/user)
if(istype(item, /obj/item/ammo_magazine/shotgun/light/breaching))
var/obj/item/ammo_magazine/shotgun/light/breaching/ammo_box = item
dump_ammo_to(ammo_box, user, ammo_box.transfer_handful_amount)
else
return ..()

/obj/item/storage/belt/gun/xm51/can_be_inserted(obj/item/item, mob/user, stop_messages = FALSE)
. = ..()
if(magazines >= MAXIMUM_MAGAZINE_COUNT && istype(item, /obj/item/ammo_magazine/rifle/xm51))
if(!stop_messages)
to_chat(usr, SPAN_WARNING("[src] can't hold any more magazines."))
return FALSE

/obj/item/storage/belt/gun/xm51/handle_item_insertion(obj/item/item, prevent_warning = FALSE, mob/user)
. = ..()
if(istype(item, /obj/item/ammo_magazine/rifle/xm51))
magazines++

/obj/item/storage/belt/gun/xm51/remove_from_storage(obj/item/item as obj, atom/new_location)
. = ..()
if(istype(item, /obj/item/ammo_magazine/rifle/xm51))
magazines--

//If a magazine disintegrates due to acid or something else while in the belt, remove it from the count.
/obj/item/storage/belt/gun/xm51/on_stored_atom_del(atom/movable/item)
if(istype(item, /obj/item/ammo_magazine/rifle/xm51))
magazines--

#undef MAXIMUM_MAGAZINE_COUNT

/obj/item/storage/belt/gun/m44
name = "\improper M276 pattern M44 holster rig"
desc = "The M276 is the standard load-bearing equipment of the USCM. It consists of a modular belt with various clips. This version is for the M44 magnum revolver, along with six small pouches for speedloaders. It smells faintly of hay."
Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/suits/marine_armor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
/obj/item/device/motiondetector,
/obj/item/device/walkman,
/obj/item/storage/belt/gun/m39,
/obj/item/storage/belt/gun/xm51,
)
valid_accessory_slots = list(ACCESSORY_SLOT_MEDAL, ACCESSORY_SLOT_PONCHO)

Expand Down
15 changes: 15 additions & 0 deletions code/modules/cm_marines/equipment/guncases.dm
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,21 @@
new /obj/item/device/vulture_spotter_scope/skillless(src, WEAKREF(rifle))
new /obj/item/tool/screwdriver(src) // Spotter scope needs a screwdriver to disassemble

/obj/item/storage/box/guncase/xm51
name = "\improper XM51 breaching scattergun case"
desc = "A gun case containing the XM51 Breaching Scattergun. Comes with two spare magazines, two spare shell boxes, an optional stock and a belt to holster the weapon."
storage_slots = 7
can_hold = list(/obj/item/weapon/gun/rifle/xm51, /obj/item/ammo_magazine/rifle/xm51, /obj/item/storage/belt/gun/xm51, /obj/item/attachable/stock/xm51)

/obj/item/storage/box/guncase/xm51/fill_preset_inventory()
new /obj/item/attachable/stock/xm51(src)
new /obj/item/weapon/gun/rifle/xm51(src)
new /obj/item/ammo_magazine/rifle/xm51(src)
new /obj/item/ammo_magazine/rifle/xm51(src)
new /obj/item/ammo_magazine/shotgun/light/breaching(src)
new /obj/item/ammo_magazine/shotgun/light/breaching(src)
new /obj/item/storage/belt/gun/xm51(src)

//Handgun case for Military police vendor three mag , a railflashligh and the handgun.

//88 Mod 4 Combat Pistol
Expand Down
14 changes: 14 additions & 0 deletions code/modules/projectiles/ammo_boxes/handful_boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@
/obj/item/ammo_box/magazine/shotgun/beanbag/empty
empty = TRUE


//-----------------------16 GAUGE SHOTGUN SHELL BOXES-----------------------

/obj/item/ammo_box/magazine/shotgun/light/breaching
name = "\improper 16-gauge shotgun shell box (Breaching x 120)"
icon_state = "base_breach"
overlay_content = "_breach"
magazine_type = /obj/item/ammo_magazine/shotgun/light/breaching
num_of_magazines = 120 //10 full mag reloads.
can_explode = FALSE

/obj/item/ammo_box/magazine/shotgun/light/breaching/empty
empty = TRUE

//-----------------------R4T Lever-action rifle handfuls box-----------------------

/obj/item/ammo_box/magazine/lever_action
Expand Down
13 changes: 13 additions & 0 deletions code/modules/projectiles/ammo_boxes/magazine_boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,19 @@
/obj/item/ammo_box/magazine/m4ra/heap/empty
empty = TRUE

//-----------------------XM51 Breaching Scattergun Mag Box-----------------------

/obj/item/ammo_box/magazine/xm51
name = "\improper magazine box (XM51 x 8)"
icon_state = "base_breach"
flags_equip_slot = SLOT_BACK
overlay_gun_type = "_xm51"
num_of_magazines = 8
magazine_type = /obj/item/ammo_magazine/rifle/xm51

/obj/item/ammo_box/magazine/xm51/empty
empty = TRUE

//-----------------------L42A Battle Rifle Mag Boxes-----------------------

/obj/item/ammo_box/magazine/l42a
Expand Down
37 changes: 37 additions & 0 deletions code/modules/projectiles/gun_attachables.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2105,6 +2105,43 @@ Defined in conflicts.dm of the #defines folder.
flags_attach_features = NO_FLAGS
hud_offset_mod = 2

/obj/item/attachable/stock/xm51
name = "\improper XM51 stock"
desc = "A specialized stock designed for XM51 breaching shotguns. Helps the user absorb the recoil of the weapon while also reducing scatter. Integrated mechanisms inside the stock allow use of a devastating two-shot burst. This comes at a cost of the gun becoming too unwieldy to holster, worse handling and mobility."
icon_state = "xm51_stock"
attach_icon = "xm51_stock_a"
wield_delay_mod = WIELD_DELAY_FAST
hud_offset_mod = 3
melee_mod = 10

/obj/item/attachable/stock/xm51/Initialize(mapload, ...)
. = ..()
select_gamemode_skin(type)
//it makes stuff much better when two-handed
accuracy_mod = HIT_ACCURACY_MULT_TIER_3
recoil_mod = -RECOIL_AMOUNT_TIER_4
scatter_mod = -SCATTER_AMOUNT_TIER_8
movement_onehanded_acc_penalty_mod = -MOVEMENT_ACCURACY_PENALTY_MULT_TIER_4
//and allows for burst-fire
burst_mod = BURST_AMOUNT_TIER_2
//but it makes stuff much worse when one handed
accuracy_unwielded_mod = -HIT_ACCURACY_MULT_TIER_5
recoil_unwielded_mod = RECOIL_AMOUNT_TIER_5
scatter_unwielded_mod = SCATTER_AMOUNT_TIER_6
//and makes you slower
aim_speed_mod = CONFIG_GET(number/slowdown_med)

/obj/item/attachable/stock/xm51/select_gamemode_skin(expected_type, list/override_icon_state, list/override_protection)
. = ..()
var/new_attach_icon
switch(SSmapping.configs[GROUND_MAP].camouflage_type)
if("snow")
attach_icon = new_attach_icon ? new_attach_icon : "s_" + attach_icon
if("desert")
attach_icon = new_attach_icon ? new_attach_icon : "d_" + attach_icon
if("classic")
attach_icon = new_attach_icon ? new_attach_icon : "c_" + attach_icon

/obj/item/attachable/stock/mod88
name = "\improper Mod 88 burst stock"
desc = "Increases the fire rate and burst amount on the Mod 88. Some versions act as a holster for the weapon when un-attached. This is a test item and should not be used in normal gameplay (yet)."
Expand Down
Loading

0 comments on commit 07455a5

Please sign in to comment.