mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
* I'm like 99% sure this works * uhm * accidentally broke something after I tested but before I PRed, fixed now
19 lines
995 B
Plaintext
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) |