Suppressors now can be attached to toy guns (#20415)

* Suppressors now can be attached to toy guns

* Same sound while suppressed, but lower volume

* better description

* GDN review
This commit is contained in:
Henri215
2023-03-04 05:44:16 -03:00
committed by GitHub
parent a31299d49e
commit 0e6da50c3f
3 changed files with 8 additions and 7 deletions

View File

@@ -6,10 +6,10 @@
item_state = "saber" item_state = "saber"
mag_type = /obj/item/ammo_box/magazine/toy/smg mag_type = /obj/item/ammo_box/magazine/toy/smg
fire_sound = 'sound/weapons/gunshots/gunshot_smg.ogg' fire_sound = 'sound/weapons/gunshots/gunshot_smg.ogg'
suppressed_sound = 'sound/weapons/gunshots/gunshot_smg.ogg'
force = 0 force = 0
throwforce = 0 throwforce = 0
burst_size = 3 burst_size = 3
can_suppress = FALSE
clumsy_check = FALSE clumsy_check = FALSE
needs_permit = FALSE needs_permit = FALSE
@@ -24,15 +24,12 @@
w_class = WEIGHT_CLASS_SMALL w_class = WEIGHT_CLASS_SMALL
mag_type = /obj/item/ammo_box/magazine/toy/pistol mag_type = /obj/item/ammo_box/magazine/toy/pistol
fire_sound = 'sound/weapons/gunshots/gunshot.ogg' fire_sound = 'sound/weapons/gunshots/gunshot.ogg'
can_suppress = FALSE suppressed_sound = 'sound/weapons/gunshots/gunshot.ogg'
burst_size = 1 burst_size = 1
fire_delay = 0 fire_delay = 0
can_holster = TRUE can_holster = TRUE
actions_types = list() actions_types = list()
/obj/item/gun/projectile/automatic/toy/pistol/update_icon_state()
icon_state = "[initial(icon_state)][magazine ? "-[magazine.max_ammo]" : ""][chambered ? "" : "-e"]"
/obj/item/gun/projectile/automatic/toy/pistol/riot /obj/item/gun/projectile/automatic/toy/pistol/riot
name = "foam force riot pistol" name = "foam force riot pistol"
desc = "RIOT! Ages 8 and up." desc = "RIOT! Ages 8 and up."
@@ -50,6 +47,8 @@
/obj/item/gun/projectile/automatic/toy/pistol/enforcer/update_overlays() /obj/item/gun/projectile/automatic/toy/pistol/enforcer/update_overlays()
. = ..() . = ..()
if(suppressed)
. += image(icon = 'icons/obj/guns/projectile.dmi', icon_state = "enforcer_supp", pixel_x = 5)
if(gun_light) if(gun_light)
var/flashlight = "Enforcer_light" var/flashlight = "Enforcer_light"
if(gun_light.on) if(gun_light.on)
@@ -97,7 +96,7 @@
name = "donksoft SMG" name = "donksoft SMG"
desc = "A bullpup two-round burst toy SMG, designated 'C-20r'. Ages 8 and up." desc = "A bullpup two-round burst toy SMG, designated 'C-20r'. Ages 8 and up."
icon = 'icons/obj/guns/toy.dmi' icon = 'icons/obj/guns/toy.dmi'
can_suppress = FALSE suppressed_sound = 'sound/weapons/gunshots/gunshot_smg.ogg'
needs_permit = FALSE needs_permit = FALSE
mag_type = /obj/item/ammo_box/magazine/toy/smgm45 mag_type = /obj/item/ammo_box/magazine/toy/smgm45

View File

@@ -9,6 +9,8 @@
var/mag_type = /obj/item/ammo_box/magazine/m10mm //Removes the need for max_ammo and caliber info var/mag_type = /obj/item/ammo_box/magazine/m10mm //Removes the need for max_ammo and caliber info
var/obj/item/ammo_box/magazine/magazine var/obj/item/ammo_box/magazine/magazine
var/can_tactical = FALSE //check to see if the gun can tactically reload var/can_tactical = FALSE //check to see if the gun can tactically reload
/// The sound it will make when the gun suppression is TRUE
var/suppressed_sound = 'sound/weapons/gunshots/gunshot_silenced.ogg'
/obj/item/gun/projectile/Initialize(mapload) /obj/item/gun/projectile/Initialize(mapload)
. = ..() . = ..()
@@ -122,7 +124,7 @@
suppressed = A suppressed = A
S.oldsound = fire_sound S.oldsound = fire_sound
S.initial_w_class = w_class S.initial_w_class = w_class
fire_sound = 'sound/weapons/gunshots/gunshot_silenced.ogg' fire_sound = suppressed_sound
w_class = WEIGHT_CLASS_NORMAL //so pistols do not fit in pockets when suppressed w_class = WEIGHT_CLASS_NORMAL //so pistols do not fit in pockets when suppressed
A.loc = src A.loc = src
update_icon() update_icon()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB