Merge pull request #12506 from BonniePandora/Comp-shotgun-updoot

Overhauls the warden's compact shotgun stock-folding
This commit is contained in:
Casey
2022-03-21 23:00:16 -04:00
committed by CHOMPStation2
parent f8325863d6
commit 12c80b9aeb

View File

@@ -37,9 +37,12 @@
projectile_type = /obj/item/projectile/bullet/shotgun projectile_type = /obj/item/projectile/bullet/shotgun
one_handed_penalty = 30 //You madman, one-handing a 12g shotgun. one_handed_penalty = 30 //You madman, one-handing a 12g shotgun.
recoil = 5 //Unfold the damn stock you fool! recoil = 5 //Unfold the damn stock you fool!
action_button_name = "Toggle stock"
var/stock = FALSE var/stock = FALSE
/obj/item/weapon/gun/projectile/shotgun/compact/attack_self(mob/user as mob)
/obj/item/weapon/gun/projectile/shotgun/compact/proc/toggle_stock()
var/mob/living/user = loc
stock = !stock stock = !stock
if(stock) if(stock)
user.visible_message("<span class='warning'>With a fluid movement, [user] unfolds their shotgun's stock and foregrip.</span>",\ user.visible_message("<span class='warning'>With a fluid movement, [user] unfolds their shotgun's stock and foregrip.</span>",\
@@ -60,13 +63,43 @@
one_handed_penalty = 30 one_handed_penalty = 30
recoil = 5 recoil = 5
if(istype(user,/mob/living/carbon/human)) if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/H = user var/mob/living/carbon/human/H = user
H.update_inv_l_hand() H.update_inv_l_hand()
H.update_inv_r_hand() H.update_inv_r_hand()
playsound(src, 'sound/weapons/empty.ogg', 50, 1) playsound(src, 'sound/weapons/targeton.ogg', 50, 1)
user.update_action_buttons()
/obj/item/weapon/gun/projectile/shotgun/compact/verb/verb_toggle_stock(mob/user as mob)
set category = "Object"
set name = "Toggle stock"
set src in usr
if(issilicon(usr))
return
if (isliving(usr))
toggle_stock()
else
to_chat(usr, "<span class='notice'>You cannot do this in your current state.</span>")
/obj/item/weapon/gun/projectile/shotgun/compact/attack_self(mob/user as mob)
if(issilicon(usr))
return
if (isliving(usr))
toggle_stock()
else
to_chat(usr, "<span class='notice'>You cannot do this in your current state.</span>")
/obj/item/weapon/gun/projectile/shotgun/compact/ui_action_click()
var/mob/living/user = loc
if(!isliving(user))
return
else
toggle_stock()
/obj/item/weapon/gun/projectile/shotgun/compact/warden /obj/item/weapon/gun/projectile/shotgun/compact/warden
name = "warden's compact shotgun" name = "warden's compact shotgun"