Merge pull request #4058 from FalseIncarnate/reagents

Reagent Container Tweaks
This commit is contained in:
Fox McCloud
2016-04-02 04:12:23 -04:00
3 changed files with 200 additions and 172 deletions
@@ -215,9 +215,14 @@
use_to_pickup = 1
storage_slots = 14
display_contents_with_number = 1
var/base_name = ""
var/label_text = ""
/obj/item/weapon/storage/pill_bottle/New()
..()
base_name = name
/obj/item/weapon/storage/pill_bottle/MouseDrop(obj/over_object as obj) //Quick pillbottle fix. -Agouri
if (ishuman(usr)) //Can monkeys even place items in the pocket slots? Leaving this in just in case~
var/mob/M = usr
if (!( istype(over_object, /obj/screen) ))
@@ -239,6 +244,24 @@
return
return
/obj/item/weapon/storage/pill_bottle/attackby(var/obj/item/I, mob/user as mob, params)
if(istype(I, /obj/item/weapon/pen) || istype(I, /obj/item/device/flashlight/pen))
var/tmp_label = sanitize(input(user, "Enter a label for [name]","Label",label_text))
if(length(tmp_label) > MAX_NAME_LEN)
user << "<span class='warning'>The label can be at most [MAX_NAME_LEN] characters long.</span>"
else
user << "<span class='notice'>You set the label to \"[tmp_label]\".</span>"
label_text = tmp_label
update_name_label()
else
..()
/obj/item/weapon/storage/pill_bottle/proc/update_name_label()
if(label_text == "")
name = base_name
else
name = "[base_name] ([label_text])"
/obj/item/weapon/storage/pill_bottle/charcoal
name = "Pill bottle (Charcoal)"
desc = "Contains pills used to counter toxins."