mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-25 01:22:24 +00:00
Beakers and other glass containers now hide their contents, only showing the amount.
Additionally, they can be labeled with a pen, up to a max of 10 characters. Signed-off-by: Mloc-Argent <colmohici@gmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/obj/item/weapon/reagent_containers/glass
|
||||
name = " "
|
||||
var/base_name = " "
|
||||
desc = " "
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "null"
|
||||
@@ -13,6 +14,8 @@
|
||||
volume = 50
|
||||
flags = FPRINT | TABLEPASS | OPENCONTAINER
|
||||
|
||||
var/label_text = ""
|
||||
|
||||
var/list/can_be_placed_into = list(
|
||||
/obj/machinery/chem_master/,
|
||||
/obj/machinery/chem_dispenser/,
|
||||
@@ -34,14 +37,17 @@
|
||||
/mob/living/simple_animal/hostile/retaliate/goat,
|
||||
/obj/machinery/computer/centrifuge )
|
||||
|
||||
New()
|
||||
..()
|
||||
base_name = name
|
||||
|
||||
examine()
|
||||
set src in view()
|
||||
..()
|
||||
if (!(usr in view(2)) && usr!=src.loc) return
|
||||
usr << "\blue It contains:"
|
||||
if(reagents && reagents.reagent_list.len)
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
usr << "\blue [R.volume] units of [R.name]"
|
||||
usr << "\blue [src.reagents.total_volume] units of liquid."
|
||||
else
|
||||
usr << "\blue Nothing."
|
||||
if (!is_open_container())
|
||||
@@ -122,6 +128,22 @@
|
||||
spawn(5) src.reagents.clear_reagents()
|
||||
return
|
||||
|
||||
attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen))
|
||||
var/tmp_label = sanitize(input(user, "Enter a label for [src.name]","Label",src.label_text))
|
||||
if(length(tmp_label) > 10)
|
||||
user << "\red The label can be at most 10 characters long."
|
||||
else
|
||||
user << "\blue You set the label to \"[tmp_label]\"."
|
||||
src.label_text = tmp_label
|
||||
src.update_name_label()
|
||||
|
||||
proc/update_name_label()
|
||||
if(src.label_text == "")
|
||||
src.name = src.base_name
|
||||
else
|
||||
src.name = "[src.base_name] ([src.label_text])"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker
|
||||
name = "beaker"
|
||||
desc = "A beaker. Can hold up to 50 units."
|
||||
|
||||
@@ -88,8 +88,7 @@
|
||||
/obj/item/weapon/reagent_containers/spray/examine()
|
||||
set src in usr
|
||||
..()
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
usr << "[round(R.volume)] units of [R.name] left."
|
||||
usr << "[round(src.reagents.total_volume)] units left."
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/verb/empty()
|
||||
|
||||
Reference in New Issue
Block a user