Files
CHOMPStation2/code/game/objects/items/gunbox.dm
Sabess c96781499f Allows detectives to take an optional revolver + some other stuff (#4217)
* I'm like 99% sure this works

* uhm

* accidentally broke something after I tested but before I PRed, fixed now
2017-11-05 22:53:11 -06:00

19 lines
995 B
Plaintext

/obj/item/gunbox
name = "detective's gun box"
desc = "A secure box containing a Detective's sidearm."
icon = 'icons/obj/storage.dmi'
icon_state = "gunbox"
w_class = ITEMSIZE_HUGE
/obj/item/gunbox/attack_self(mob/living/user)
var/list/options = list()
options[".45 Pistol"] = list(/obj/item/weapon/gun/projectile/colt/detective, /obj/item/ammo_magazine/m45/rubber, /obj/item/ammo_magazine/m45/rubber)
options[".45 Revolver"] = list(/obj/item/weapon/gun/projectile/revolver/detective45, /obj/item/ammo_magazine/s45/rubber, /obj/item/ammo_magazine/s45/rubber)
var/choice = input(user,"Would you prefer a pistol or a revolver?") as null|anything in options
if(src && choice)
var/list/things_to_spawn = options[choice]
for(var/new_type in things_to_spawn) // Spawn all the things, the gun and the ammo.
var/atom/movable/AM = new new_type(get_turf(src))
if(istype(AM, /obj/item/weapon/gun))
to_chat(user, "You have chosen \the [AM]. Say hello to your new friend.")
qdel(src)