/obj/item/weapon/gun/shotgun/attackby(obj/item/weapon/A as obj, mob/user as mob)
if (istype(A, /obj/item/weapon/ammo/a12))
var/obj/item/weapon/ammo/a12/B
if (src.bullets >= 8)
user << "\blue It's already fully loaded!"
return 1
if (B.amount_left <= 0)
user << "\red There is no more slugs!"
return 1
if (B.amount_left < (8 - src.bullets))
src.bullets += B.amount_left
user << text("\red You reload [] slug\s!", B.amount_left)
B.amount_left = 0
else
user << text("\red You reload [] slug\s!", 8 - src.bullets)
B.amount_left -= 8 - src.bullets
src.bullets = 8
B.update_icon()
return 1
if (istype(A, /obj/item/weapon/circular_saw))
user << "\blue <B>You saw the barrel off of the shotgun.</B>"
src.icon_state = text("sawnoffshotgun")
src.w_class = 3.0
return
return
Problem description:
Basically, I want it to be able to reload. But I also want it to be able to be sawn off with a circular saw object. I can't figure out how to do both of these depending on the weapon, whereas I am very new to this. Any help would be appreciated!
Second, you should use switch(A.type) to check what item is being used with the saw.