From ef87801641b707874f3b613bdf90bc99d9715825 Mon Sep 17 00:00:00 2001 From: atermonera Date: Wed, 26 Jan 2022 20:13:48 -0800 Subject: [PATCH] Adds caseless BB rounds for common gun types --- code/modules/projectiles/ammunition/rounds.dm | 56 ++++++++++++++++++- code/modules/projectiles/gun.dm | 2 +- code/modules/projectiles/projectile.dm | 10 ++-- .../modules/projectiles/projectile/bullets.dm | 24 +++++++- 4 files changed, 82 insertions(+), 10 deletions(-) diff --git a/code/modules/projectiles/ammunition/rounds.dm b/code/modules/projectiles/ammunition/rounds.dm index ee824cd38d..382dc91b6b 100644 --- a/code/modules/projectiles/ammunition/rounds.dm +++ b/code/modules/projectiles/ammunition/rounds.dm @@ -43,6 +43,12 @@ projectile_type = /obj/item/projectile/bullet/pistol/strong matter = list(MAT_STEEL = 210) +/obj/item/ammo_casing/a357/bb + desc = "A .357 BB." + projectile_type = /obj/item/projectile/bullet/bb + matter = list(MAT_PLASTIC = 20) + caseless = TRUE + /* * .38 */ @@ -65,6 +71,12 @@ projectile_type = /obj/item/projectile/ion/small matter = list(MAT_STEEL = 130, "uranium" = 100) +/obj/item/ammo_casing/a38/bb + desc = "A .38 BB." + projectile_type = /obj/item/projectile/bullet/bb + matter = list(MAT_PLASTIC = 20) + caseless = TRUE + /* * .44 */ @@ -86,6 +98,12 @@ projectile_type = /obj/item/projectile/bullet/rifle/a44rifle matter = list(MAT_STEEL = 210) +/obj/item/ammo_casing/a44/bb + desc = "A .44 BB." + projectile_type = /obj/item/projectile/bullet/bb + matter = list(MAT_PLASTIC = 20) + caseless = TRUE + /* * .75 (aka Gyrojet Rockets, aka admin abuse) */ @@ -115,7 +133,6 @@ desc = "A 9mm hollow-point bullet casing." projectile_type = /obj/item/projectile/bullet/pistol/hp - /obj/item/ammo_casing/a9mm/flash desc = "A 9mm flash shell casing." icon_state = "r-casing" @@ -131,6 +148,12 @@ icon_state = "r-casing" projectile_type = /obj/item/projectile/bullet/practice +/obj/item/ammo_casing/a9mm/bb + desc = "A 9mm BB." + projectile_type = /obj/item/projectile/bullet/bb + matter = list(MAT_PLASTIC = 20) + caseless = TRUE + /* * .45 */ @@ -177,6 +200,12 @@ projectile_type = /obj/item/projectile/bullet/pistol/medium/hp matter = list(MAT_STEEL = 60, MAT_PLASTIC = 15) +/obj/item/ammo_casing/a45/bb + desc = "A .45 BB." + projectile_type = /obj/item/projectile/bullet/bb + matter = list(MAT_PLASTIC = 20) + caseless = TRUE + /* * 10mm */ @@ -194,6 +223,12 @@ icon_state = "empcasing" matter = list(MAT_STEEL = 130, "uranium" = 100) +/obj/item/ammo_casing/a10mm/bb + desc = "A 10mm BB." + projectile_type = /obj/item/projectile/bullet/bb + matter = list(MAT_PLASTIC = 20) + caseless = TRUE + /* * 12g (aka shotgun ammo) */ @@ -270,6 +305,11 @@ projectile_type = /obj/item/projectile/scatter/flechette matter = list(MAT_STEEL = 360, MAT_PLASTEEL = 100) +/obj/item/ammo_casing/a12g/bb + desc = "A shotgun BB shell." + projectile_type = /obj/item/projectile/bullet/pellet/shotgun/bb // Shotgun + matter = list(MAT_PLASTIC = 120) // 6 pellets + /* * 7.62mm */ @@ -305,6 +345,12 @@ desc = "A 7.62mm hunting bullet casing." projectile_type = /obj/item/projectile/bullet/rifle/a762/hunter +/obj/item/ammo_casing/a762/bb + desc = "A 7.62mm BB." + projectile_type = /obj/item/projectile/bullet/bb + matter = list(MAT_PLASTIC = 20) + caseless = TRUE + /* * 14.5mm (anti-materiel rifle round) */ @@ -359,6 +405,12 @@ desc = "A 5.45mm hunting bullet casing." projectile_type = /obj/item/projectile/bullet/rifle/a545/hunter +/obj/item/ammo_casing/a545/bb + desc = "A 5.45mm BB." + projectile_type = /obj/item/projectile/bullet/bb + matter = list(MAT_PLASTIC = 20) + caseless = TRUE + /* * 5mm Caseless */ @@ -399,4 +451,4 @@ /obj/item/ammo_casing/spent // For simple hostile mobs only, so they don't cough up usable bullets when firing. This is for literally nothing else. icon_state = "s-casing-spent" BB = null - projectile_type = null \ No newline at end of file + projectile_type = null diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 89130c3ff9..08e680b7db 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -430,7 +430,7 @@ P.dispersion = disp P.shot_from = src.name - P.silenced = silenced + P.silenced |= silenced // A silent bullet (e.g., BBs) can be fired quietly from any gun. P.old_style_target(target) P.fire() diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 04313cc473..0aa9fb0a8d 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -79,10 +79,10 @@ //Misc/Polaris variables - var/def_zone = "" //Aiming at - var/mob/firer = null//Who shot it - var/silenced = 0 //Attack message - var/shot_from = "" // name of the object which shot us + var/def_zone = "" //Aiming at + var/mob/firer = null //Who shot it + var/silenced = FALSE //Attack message + var/shot_from = "" // name of the object which shot us var/accuracy = 0 var/dispersion = 0.0 @@ -744,7 +744,7 @@ /obj/item/projectile/proc/launch_from_gun(atom/target, target_zone, mob/user, params, angle_override, forced_spread, obj/item/weapon/gun/launcher) shot_from = launcher.name - silenced = launcher.silenced + silenced |= launcher.silenced // Silent bullets (e.g., BBs) are always silent if(user) firer = user diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index 1c4529f314..2f6e2452ad 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -234,7 +234,7 @@ SA_bonus_damage = 35 // 50 total on animals. SA_vulnerability = SA_ANIMAL -/obj/item/projectile/bullet/rifle/a145 // 14.5×114mm is bigger than a .50 BMG round. +/obj/item/projectile/bullet/rifle/a145 // 14.5�114mm is bigger than a .50 BMG round. fire_sound = 'sound/weapons/Gunshot_cannon.ogg' // This is literally an anti-tank rifle caliber. It better sound like a fucking cannon. damage = 80 stun = 3 @@ -349,4 +349,24 @@ /obj/item/projectile/bullet/blank/cap/process() loc = null - qdel(src) \ No newline at end of file + qdel(src) + +/* BB Rounds */ +/obj/item/projectile/bullet/bb // Generic single BB + name = "BB" + damage = 0 + agony = 0 + embed_chance = 0 + sharp = FALSE + silenced = TRUE + +/obj/item/projectile/bullet/pellet/shotgun/bb // Shotgun + name = "BB" + damage = 0 + agony = 0 + embed_chance = 0 + sharp = FALSE + pellets = 6 + range_step = 1 + spread_step = 10 + silenced = TRUE \ No newline at end of file