diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm index 74bfc952852..984c7051aac 100644 --- a/code/modules/projectiles/guns/projectile/shotgun.dm +++ b/code/modules/projectiles/guns/projectile/shotgun.dm @@ -4,6 +4,7 @@ desc_info = "This is a shotgun, chambered for various shells and slugs. To fire the weapon, toggle the safety with CTRL-Click or enable 'HARM' intent, then click where \ you want to fire. To pump a pump-action shotgun, use the Unique-Action hotkey or the button in the bottom right of your screen. To reload, insert shells or a magazine \ into the shotgun, then pump the shotgun to chamber a fresh round." + accuracy = 1 var/can_sawoff = FALSE var/sawnoff_workmsg var/sawing_in_progress = FALSE @@ -48,6 +49,7 @@ icon = 'icons/obj/guns/shotgun.dmi' icon_state = "shotgun" item_state = "shotgun" + accuracy = 0 max_shells = 4 w_class = ITEMSIZE_LARGE force = 10 @@ -112,6 +114,7 @@ icon_state = "cshotgun" item_state = "cshotgun" origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 2) + accuracy = 2 max_shells = 7 //match the ammo box capacity, also it can hold a round in the chamber anyways, for a total of 8. ammo_type = /obj/item/ammo_casing/shotgun fire_sound = 'sound/weapons/gunshot/gunshot_shotgun.ogg' @@ -183,6 +186,7 @@ icon = 'icons/obj/guns/sawnshotgun.dmi' icon_state = "sawnshotgun" item_state = "sawnshotgun" + accuracy = 0 is_wieldable = FALSE w_class = ITEMSIZE_NORMAL force = 5 @@ -198,6 +202,7 @@ icon = 'icons/obj/guns/sawnshotgun.dmi' icon_state = "sawnshotgun" item_state = "sawnshotgun" + accuracy = 0 is_wieldable = FALSE slot_flags = SLOT_BELT|SLOT_HOLSTER ammo_type = /obj/item/ammo_casing/shotgun/pellet diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index ebb0044de64..f5e6e51ae9f 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -92,11 +92,21 @@ if(target_mob.lying && target_mob != original && prob(prone_chance)) continue - //pellet hits spread out across different zones, but 'aim at' the targeted zone with higher probability - //whether the pellet actually hits the def_zone or a different zone should still be determined by the parent using get_zone_with_miss_chance(). + // pellet hits spread out across different zones, but 'aim at' the targeted zone with higher probability + // whether the pellet actually hits the def_zone or a different zone should still be determined by the parent using get_zone_with_miss_chance(). var/old_zone = def_zone def_zone = ran_zone(def_zone, spread) - if (..()) hits++ + // relatively hacky way of basing a shotgun pellet's likelihood of hitting on the first pellet of the burst while not affecting shrapnel explosions. + if (base_spread > 0) + if (i == 1) + if (..()) + hits++ + else + return 0 + else if (..(target_mob, distance, -100)) + hits++ + else if (..()) + hits++ def_zone = old_zone //restore the original zone the projectile was aimed at pellets -= hits //each hit reduces the number of pellets left diff --git a/html/changelogs/geeves-shotgun_stuff.yml b/html/changelogs/geeves-shotgun_stuff.yml new file mode 100644 index 00000000000..b9e9e0648f4 --- /dev/null +++ b/html/changelogs/geeves-shotgun_stuff.yml @@ -0,0 +1,7 @@ +author: Geeves + +delete-after: True + +changes: + - tweak: "Buckshot accuracy is now calculated once per shot, rather than individually for each pellet." + - tweak: "Shotguns are generally more accurate at range (to account for accuracy only being calculated once)"