Skip to content

Commit

Permalink
Merge pull request #5857 from Ryan180602/shotgunsound
Browse files Browse the repository at this point in the history
Change shotgun sounds + clean up shotgun code slightly
  • Loading branch information
Trilbyspaceclone authored Nov 26, 2024
2 parents 0f9ad1f + 250cf5d commit 9522001
Show file tree
Hide file tree
Showing 48 changed files with 100 additions and 148 deletions.
8 changes: 4 additions & 4 deletions code/datums/autolathe/guns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -186,23 +186,23 @@

/datum/design/autolathe/gun/riot_shotgun
name = "Seinemetall Defense GmbH SG \"State\""
build_path = /obj/item/gun/projectile/automatic/riot_autoshotgun
build_path = /obj/item/gun/projectile/shotgun/riot

/datum/design/autolathe/gun/sbaw
name = "SF ASG \"Mjolnir\""
build_path = /obj/item/gun/projectile/automatic/sbaw
build_path = /obj/item/gun/projectile/shotgun/sbaw

/datum/design/autolathe/gun/sixshot
name = "SA \"Six Shooter\" revolving shotgun"
build_path = /obj/item/gun/projectile/revolver/sixshot

/datum/design/autolathe/gun/buffalo
name = "BR \"Buffalo\" tactical shotgun"
build_path = /obj/item/gun/projectile/automatic/buff_autoshotgun
build_path = /obj/item/gun/projectile/shotgun/buffalo

/datum/design/autolathe/gun/opshot
name = "NM \"Operator\" tactical shotgun"
build_path = /obj/item/gun/projectile/automatic/riot_autoshotgun/opshot
build_path = /obj/item/gun/projectile/shotgun/riot/opshot

/datum/design/autolathe/gun/ak47_saiga
name = "SA CAR 20mm \"Saiga\""
Expand Down
4 changes: 2 additions & 2 deletions code/datums/craft/recipes/guild.dm
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,9 @@

/datum/craft_recipe/guild/guild_bull
name = "bison double barrel shotgun"
result = /obj/item/gun/projectile/shotgun/bull/bison
result = /obj/item/gun/projectile/shotgun/pump/bull/bison
steps = list(
list(/obj/item/gun/projectile/shotgun/bull, 1, "time" = 80),
list(/obj/item/gun/projectile/shotgun/pump/bull, 1, "time" = 80),
list(/obj/item/gun_upgrade/barrel/bore, 1, "time" = 60),
list(CRAFT_MATERIAL, 10, MATERIAL_PLASTEEL, "time" = 60),
list(QUALITY_DRILLING, 60, "time" = 90),
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/weapons/storage/marshal_kits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
desc = "The standard Marshal box kit containing a Operator shotgun, a folding stock shotgun for only TRUE operators!"

populate_contents()
new /obj/item/gun/projectile/automatic/riot_autoshotgun/opshot(src)
new /obj/item/gun/projectile/shotgun/riot/opshot(src)
new /obj/item/ammo_magazine/speed_loader_shotgun/beanbag/pepperball(src)
new /obj/item/ammo_magazine/speed_loader_shotgun(src)
new /obj/item/ammo_magazine/speed_loader_shotgun(src)
Expand All @@ -77,7 +77,7 @@
desc = "The standard Marshal box kit containing a state auto shotgun. What is lacks in penetration it makes up for with ammo capacity and fire rate."

populate_contents()
new /obj/item/gun/projectile/automatic/riot_autoshotgun(src)
new /obj/item/gun/projectile/shotgun/riot(src)
new /obj/item/ammo_casing/shotgun/beanbag/pepperball/prespawned(src)
new /obj/item/ammo_casing/shotgun/prespawned(src)
new /obj/item/ammo_casing/shotgun/prespawned(src)
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/random/guns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
/obj/item/gun/projectile/shotgun/pump = 1,\
/obj/item/gun/projectile/shotgun/pump/sawn = 2,\
/obj/item/gun/projectile/shotgun/pump/obrez = 2,\
/obj/item/gun/projectile/shotgun/bull = 0.3,\
/obj/item/gun/projectile/shotgun/pump/bull = 0.3,\
/obj/item/gun/projectile/shotgun/doublebarrel/sawn = 2,\
/obj/item/gun/projectile/shotgun/pump/combat/sawn = 1,\
/obj/item/gun/projectile/shotgun/pump/gladstone/sawn = 1,\
Expand Down Expand Up @@ -275,7 +275,7 @@
/obj/random/gun_parts/frames/better_spawns = 2,

/obj/item/gun/projectile/automatic/pulse_rifle = 2,
/obj/item/gun/projectile/automatic/sbaw = 0.7, // Too good, needs to be rare.
/obj/item/gun/projectile/shotgun/sbaw = 0.7, // Too good, needs to be rare.
/obj/item/gun/projectile/automatic/chaingun = 1,
/obj/item/gun/projectile/automatic/lmg/pk = 3,
/obj/item/gun/projectile/automatic/dp = 2,
Expand Down
5 changes: 5 additions & 0 deletions code/game/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ var/list/gunshot_sound = list('sound/weapons/Gunshot.ogg',
'sound/weapons/guns/fire/m41_shoot.ogg',
'sound/weapons/guns/fire/revolver_fire.ogg',
'sound/weapons/guns/fire/sfrifle_fire.ogg',
'sound/weapons/guns/fire/shotgun_fire.ogg',
'sound/weapons/guns/fire/shotgunp_fire.ogg',
'sound/weapons/guns/fire/riot_fire.ogg',
'sound/weapons/guns/fire/state_fire.ogg',
'sound/weapons/guns/fire/saiga_fire.ogg',
'sound/weapons/guns/fire/smg_fire.ogg',
'sound/weapons/guns/fire/sniper_fire.ogg'
)
Expand Down Expand Up @@ -181,6 +185,7 @@ var/list/gun_interact_sound = list(
'sound/weapons/guns/interact/sfrifle_magin.ogg',
'sound/weapons/guns/interact/sfrifle_magout.ogg',
'sound/weapons/guns/interact/shotgun_insert.ogg',
'sound/weapons/guns/interact/state_insert.ogg',
'sound/weapons/guns/interact/smg_cock.ogg',
'sound/weapons/guns/interact/smg_magin.ogg',
'sound/weapons/guns/interact/smg_magout.ogg'
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/silicon/robot/robot_modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ var/global/list/robot_modules = list(
src.modules += new /obj/item/tool/weldingtool/robotic/weaker(src) //cracks and the like.
src.modules += new /obj/item/tool/knife/tacknife/robo(src)
src.modules += new /obj/item/taperoll/police(src)
src.modules += new /obj/item/gun/energy/riot_autoshotgun(src)
src.modules += new /obj/item/gun/energy/riot(src)
src.modules += new /obj/item/gripper/ammo(src)
src.modules += new /obj/item/gripper/upgrade(src)
src.modules += new /obj/item/device/gps(src)
Expand Down Expand Up @@ -1174,7 +1174,7 @@ var/global/list/robot_modules = list(
src.modules += new /obj/item/gripper/no_use/loader(src) //They have to sell materials over desks at times.
src.modules += new /obj/item/device/scanner/mining(src)
src.modules += new /obj/item/device/t_scanner(src)
src.modules += new /obj/item/gun/energy/riot_autoshotgun(src)
src.modules += new /obj/item/gun/energy/riot(src)
src.modules += new /obj/item/gripper/ammo(src)
src.modules += new /obj/item/gripper/upgrade(src)
src.modules += new /obj/item/device/scanner/price(src)
Expand Down
2 changes: 0 additions & 2 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ For the sake of consistency, I suggest always rounding up on even values when ap
var/vision_flags = 0
var/see_invisible_gun = -1

var/pumpshotgun_sound = 'sound/weapons/shotgunpump.ogg'

var/folding_stock = FALSE //Can we fold are stock?
var/folded = TRUE //IS are stock folded? - and that is yes we start folded
var/currently_firing = FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/energy/misc/robotguns.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//Adding in robot energy powered variants of guns, to avoid the hassle of needing to reload, etc. Centralising them all here for ease of use.

/obj/item/gun/energy/riot_autoshotgun
/obj/item/gun/energy/riot
name = "intergrated \"State\" riot shotgun"
desc = "A Seinemetall Defense GmbH riot auto action shotgun, its uncommonly seen deployed in most police operation due to the success of the \"stolen\" \"Regulator\" design. \
This particular shotgun has been redesigned many times, never quite reaching a standard everyone was happy with, with some lauding it as confusing for a shotgun. \
Expand Down
3 changes: 0 additions & 3 deletions code/modules/projectiles/guns/oddity_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@
desc = "An anomalous weapon created by an unknown person (or group?), their work marked by a blue cross, these items are known to vanish and reappear when left alone. \
The replication of a prized legendary royal shotgun wielded by a king that was once prophesized to have used it for their own undoing."
icon_state = "shotgun"
load_method = SINGLE_CASING|SPEEDLOADER
handle_casings = CYCLE_CASINGS
flags = CONDUCT
slot_flags = SLOT_BACK
caliber = CAL_SHOTGUN
matter = list(MATERIAL_PLASTEEL = 20, MATERIAL_STEEL = 10)
max_shells = 1
damage_multiplier = 2
Expand Down
4 changes: 2 additions & 2 deletions code/modules/projectiles/guns/projectile/automatic/ak47.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
icon = 'icons/obj/guns/projectile/saiga12.dmi'
icon_state = "saiga"
item_state = "saiga"
fire_sound = 'sound/weapons/guns/fire/shotgun.ogg'
fire_sound = 'sound/weapons/guns/fire/saiga_fire.ogg'
excelsior = TRUE
caliber = CAL_SHOTGUN
origin_tech = list(TECH_COMBAT = 9, TECH_MATERIAL = 1, TECH_ILLEGAL = 4)
Expand Down Expand Up @@ -224,7 +224,7 @@
/obj/item/gun/projectile/automatic/underslung/shotgun_3
name = "built in shotgun"
desc = "Not much more than a tube and a firing mechanism, this shotgun is designed to be fitted to another gun."
fire_sound = 'sound/weapons/guns/fire/shotgun.ogg'
fire_sound = 'sound/weapons/guns/fire/shotgun_fire.ogg'
bulletinsert_sound = 'sound/weapons/guns/interact/shotgun_insert.ogg'
w_class = ITEM_SIZE_NORMAL
matter = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/obj/item/gun/projectile/automatic/motherfucker/attack_self(mob/living/user)
if(world.time >= recentpumpmsg + 10)
recentpumpmsg = world.time
playsound(user, 'sound/weapons/shotgunpump.ogg', 60, 1)
playsound(user, 'sound/weapons/guns/interact/shotgun_pump.ogg', 60, 1)
pumped = TRUE

/obj/item/gun/projectile/automatic/motherfucker/special_check(mob/user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
/obj/item/gun/projectile/automatic/underslung/shotgun_3
name = "built in shotgun"
desc = "Not much more than a tube and a firing mechanism, this shotgun is designed to be fitted to another gun."
fire_sound = 'sound/weapons/guns/fire/shotgun.ogg'
fire_sound = 'sound/weapons/guns/fire/shotgun_fire.ogg'
bulletinsert_sound = 'sound/weapons/guns/interact/shotgun_insert.ogg'
w_class = ITEM_SIZE_NORMAL
matter = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
item_state = "mares"
w_class = ITEM_SIZE_BULKY
caliber = CAL_SHOTGUN
fire_sound = 'sound/weapons/guns/fire/shotgun.ogg'
fire_sound = 'sound/weapons/guns/fire/shotgun_fire.ogg'
max_shells = 6
price_tag = 650
init_recoil = HMG_RECOIL(1.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

//revolves the magazine, allowing players to choose between multiple grenade types
/obj/item/gun/projectile/grenade/proc/pump(mob/user as mob)
playsound(user, 'sound/weapons/shotgunpump.ogg', 60, 1)
playsound(user, 'sound/weapons/guns/interact/shotgun_pump.ogg', 60, 1)

var/obj/item/ammo_casing/next
if(loaded.len)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
/obj/item/gun/projectile/underslung_shotgun
name = "underslung shotgun"
desc = "Not much more than a tube and a firing mechanism, this shotgun is designed to be fitted to another gun."
fire_sound = 'sound/weapons/guns/fire/shotgun.ogg'
fire_sound = 'sound/weapons/guns/fire/shotgun_fire.ogg'
bulletinsert_sound = 'sound/weapons/guns/interact/shotgun_insert.ogg'
w_class = ITEM_SIZE_NORMAL
matter = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
caliber = CAL_SHOTGUN
origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 2)
max_shells = 6
fire_sound = 'sound/weapons/guns/fire/shotgun.ogg'
fire_sound = 'sound/weapons/guns/fire/shotgun_fire.ogg'
matter = list(MATERIAL_PLASTEEL = 20, MATERIAL_WOOD = 15, MATERIAL_STEEL = 5)
price_tag = 500
damage_multiplier = 0.8
Expand Down
14 changes: 13 additions & 1 deletion code/modules/projectiles/guns/projectile/shotgun.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
/obj/item/gun/projectile/shotgun
// New shotgun dm, could be expanded
var/recentpumpmsg = 0 // Variable to prevent chat message spam

caliber = CAL_SHOTGUN
force = WEAPON_FORCE_PAINFUL
flags = CONDUCT
load_method = SINGLE_CASING|SPEEDLOADER

bulletinsert_sound = 'sound/weapons/guns/interact/shotgun_insert.ogg'
fire_sound = 'sound/weapons/guns/fire/shotgunp_fire.ogg'
cocked_sound = 'sound/weapons/guns/interact/shotgun_pump.ogg'

ammo_type = /obj/item/ammo_casing/shotgun

gun_tags = list(GUN_PROJECTILE, GUN_INTERNAL_MAG)

wield_delay = 2 SECOND
wield_delay_factor = 0.5// 50 vig

perk_plusone_eligible = TRUE //sideload edit.
alt_plus_one_loading = TRUE //also sideload
alt_plus_one_loading = TRUE //also sideload
6 changes: 1 addition & 5 deletions code/modules/projectiles/guns/projectile/shotgun/buffalo.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/item/gun/projectile/automatic/buff_autoshotgun
/obj/item/gun/projectile/shotgun/buffalo
name = "\"Buffalo\" tactical shotgun" //With correct mods this can be better then the pug
desc = "Lightweight, ergonomic and with a fast cycling speed, this semi-automatic shotgun is a breacher's dream. \
The internal components are a work of art, able to operate smoothly no matter the circumstance. \
Expand All @@ -11,15 +11,11 @@
max_shells = 8
w_class = ITEM_SIZE_HUGE
force = WEAPON_FORCE_PAINFUL
flags = CONDUCT
slot_flags = SLOT_BACK
caliber = CAL_SHOTGUN
origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 2)
load_method = SINGLE_CASING
ammo_type = /obj/item/ammo_casing/shotgun/beanbag
handle_casings = EJECT_CASINGS
fire_sound = 'sound/weapons/guns/fire/buffalo.ogg'
bulletinsert_sound = 'sound/weapons/guns/interact/shotgun_insert.ogg'
matter = list(MATERIAL_PLASTEEL = 20, MATERIAL_PLASTIC = 10)
price_tag = 800
penetration_multiplier = 1.5
Expand Down
43 changes: 11 additions & 32 deletions code/modules/projectiles/guns/projectile/shotgun/bull.dm
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
/obj/item/gun/projectile/shotgun/bull
/obj/item/gun/projectile/shotgun/pump/bull
name = "\"Bull\" shotgun"
desc = "A \"Holland & Sullivan\" double-barreled pump-action shotgun. An engineering nightmare, this gun is often regarded as one of the worst firearms ever produced. \
Due to shorter than usual barrels, damage is somewhat lower and recoil is increased. The ability to fire both barrels at once seems more of a gimmick than a feature. \
A number of scratches marr the finish by the ejection ports."
icon = 'icons/obj/guns/projectile/PeaceWalker.dmi'
icon_state = "PeaceWalker"
item_state = "PW"
load_method = SINGLE_CASING|SPEEDLOADER
handle_casings = HOLD_CASINGS
max_shells = 7
w_class = ITEM_SIZE_BULKY
force = WEAPON_FORCE_PAINFUL
flags = CONDUCT
slot_flags = SLOT_BACK
caliber = CAL_SHOTGUN
var/reload = 1
origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 4)
matter = list(MATERIAL_PLASTEEL = 20, MATERIAL_PLASTIC = 6)
Expand All @@ -23,7 +20,6 @@
init_recoil = RIFLE_RECOIL(1.8)
burst_delay = null
fire_delay = null
bulletinsert_sound = 'sound/weapons/guns/interact/shotgun_insert.ogg'
fire_sound = 'sound/weapons/guns/fire/max_sawn_off.ogg' // It's a double barrel, gets a double barrel sound
move_delay = null
init_firemodes = list(
Expand All @@ -40,13 +36,13 @@
name = "Bull frame"
desc = "A Bull shotgun frame. Double-barrel and pump action, a marvel of engineering."
icon_state = "frame_bull"
result = /obj/item/gun/projectile/shotgun/bull
resultvars = list(/obj/item/gun/projectile/shotgun/bull)
result = /obj/item/gun/projectile/shotgun/pump/bull
resultvars = list(/obj/item/gun/projectile/shotgun/pump/bull)
gripvars = list(/obj/item/part/gun/grip/rubber)
mechanismvar = /obj/item/part/gun/mechanism/shotgun
barrelvars = list(/obj/item/part/gun/barrel/shotgun)

/obj/item/gun/projectile/shotgun/bull/bison
/obj/item/gun/projectile/shotgun/pump/bull/bison
name = "\"Bison\" shotgun"
desc = "A \"Holland & Sullivan\" double-barreled pump-action shotgun. An engineering nightmare turned sleek room-clearer by the Artificers guild. Its snub barrel reinforced and lengthened, \
a proper stock affixed and even the poorly machined bits replaced and given a bit of TLC. A work of true artificer skill."
Expand All @@ -62,29 +58,12 @@
init_recoil = RIFLE_RECOIL(1.6)
serial_type = "AG"


/obj/item/gun/projectile/shotgun/bull/proc/pump(mob/M as mob)
var/turf/newloc = get_turf(src)
playsound(M, 'sound/weapons/shotgunpump.ogg', 60, 1)
if(chambered)
if(!chambered.BB)
chambered.forceMove(newloc) //Eject casing
chambered = null
if(!chambered)
if(loaded.len)
var/obj/item/ammo_casing/AC = loaded[1] //load next casing.
loaded -= AC //Remove casing from loaded list.
chambered = AC
if(chambered.BB != null)
reload = 0
update_icon()

/obj/item/gun/projectile/shotgun/bull/consume_next_projectile()
/obj/item/gun/projectile/shotgun/pump/bull/consume_next_projectile()
if (chambered)
return chambered.BB
return null

/obj/item/gun/projectile/shotgun/bull/handle_post_fire()
/obj/item/gun/projectile/shotgun/pump/bull/handle_post_fire()
..()
var/turf/newloc = get_turf(src)
if(chambered)
Expand All @@ -97,15 +76,15 @@
chambered = AC
reload = 1

/obj/item/gun/projectile/shotgun/bull/unload_ammo(user, allow_dump)
/obj/item/gun/projectile/shotgun/pump/bull/unload_ammo(user, allow_dump)
var/turf/newloc = get_turf(src)
if(chambered)
chambered.forceMove(newloc) //Eject casing
chambered = null
reload = 1
..(user, allow_dump=1)

/obj/item/gun/projectile/shotgun/bull/attack_self(mob/user as mob)
/obj/item/gun/projectile/shotgun/pump/bull/attack_self(mob/user as mob)
if(reload)
if(wielded)
pump(user)
Expand All @@ -118,7 +97,7 @@
else
unload_ammo(user)

/obj/item/gun/projectile/shotgun/bull/bison/attack_self(mob/user as mob)
/obj/item/gun/projectile/shotgun/pump/bull/bison/attack_self(mob/user as mob)
if(reload)
if(world.time >= recentpumpmsg + 10)
pump(user)
Expand All @@ -131,13 +110,13 @@
unload_ammo(user)


/obj/item/gun/projectile/shotgun/bull/proc/update_charge()
/obj/item/gun/projectile/shotgun/pump/bull/proc/update_charge()
var/ratio = get_ammo() / (max_shells + 1)//1 in the chamber
ratio = round(ratio, 0.25) * 100
add_overlay("[ratio]_PW")


/obj/item/gun/projectile/shotgun/bull/update_icon()
/obj/item/gun/projectile/shotgun/pump/bull/update_icon()
..()
cut_overlays()
update_charge()
Expand Down
Loading

0 comments on commit 9522001

Please sign in to comment.