mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-24 09:02:27 +00:00
259 lines
8.3 KiB
Plaintext
259 lines
8.3 KiB
Plaintext
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
/// (Mixing)Glass.
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
/obj/item/weapon/reagent_containers/glass
|
|
name = " "
|
|
var/base_name = " "
|
|
desc = " "
|
|
icon = 'icons/obj/chemical.dmi'
|
|
icon_state = "null"
|
|
item_state = "null"
|
|
amount_per_transfer_from_this = 10
|
|
possible_transfer_amounts = list(5,10,15,25,30,60)
|
|
volume = 60
|
|
accuracy = 0.1
|
|
w_class = 2
|
|
flags = OPENCONTAINER
|
|
unacidable = 1 //glass doesn't dissolve in acid
|
|
|
|
var/label_text = ""
|
|
|
|
/obj/item/weapon/reagent_containers/glass/Initialize()
|
|
. = ..()
|
|
base_name = name
|
|
|
|
/obj/item/weapon/reagent_containers/glass/examine(var/mob/user)
|
|
if(!..(user, 2))
|
|
return
|
|
if(reagents && reagents.reagent_list.len)
|
|
to_chat(user, "<span class='notice'>It contains [round(reagents.total_volume, accuracy)] units of liquid.</span>")
|
|
for(var/datum/reagent/T in reagents.reagent_list)
|
|
if(T.reagent_state == SOLID)
|
|
to_chat(user, "<span class='notice'>You see something solid in the beaker.</span>")
|
|
break // to stop multiple messages of this
|
|
else
|
|
to_chat(user, "<span class='notice'>It is empty.</span>")
|
|
if(!is_open_container())
|
|
to_chat(user, "<span class='notice'>Airtight lid seals it completely.</span>")
|
|
|
|
/obj/item/weapon/reagent_containers/glass/attack_self()
|
|
..()
|
|
if(is_open_container())
|
|
to_chat(usr, "<span class = 'notice'>You put the lid on \the [src].</span>")
|
|
flags ^= OPENCONTAINER
|
|
else
|
|
to_chat(usr, "<span class = 'notice'>You take the lid off \the [src].</span>")
|
|
flags |= OPENCONTAINER
|
|
update_icon()
|
|
|
|
/obj/item/weapon/reagent_containers/glass/AltClick(var/mob/user)
|
|
set_APTFT()
|
|
|
|
/obj/item/weapon/reagent_containers/glass/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
if(istype(W,/obj/item/weapon/storage/part_replacer))
|
|
if(!reagents || !reagents.total_volume)
|
|
return ..()
|
|
if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen))
|
|
var/tmp_label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN)
|
|
if(length(tmp_label) > 15)
|
|
to_chat(user, "<span class='notice'>The label can be at most 15 characters long.</span>")
|
|
else
|
|
to_chat(user, "<span class='notice'>You set the label to \"[tmp_label]\".</span>")
|
|
label_text = tmp_label
|
|
update_name_label()
|
|
|
|
/obj/item/weapon/reagent_containers/glass/proc/update_name_label()
|
|
if(label_text == "")
|
|
name = base_name
|
|
else
|
|
name = "[base_name] ([label_text])"
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker
|
|
name = "beaker"
|
|
desc = "A beaker."
|
|
icon = 'icons/obj/chemical.dmi'
|
|
icon_state = "beaker"
|
|
item_state = "beaker"
|
|
matter = list("glass" = 500)
|
|
drop_sound = 'sound/items/drop/glass.ogg'
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker/Initialize()
|
|
. = ..()
|
|
desc += " Can hold up to [volume] units."
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker/self_feed_message(var/mob/user)
|
|
to_chat(user, "<span class='notice'>You drink from \the [src].</span>")
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker/on_reagent_change()
|
|
update_icon()
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker/pickup(mob/user)
|
|
..()
|
|
update_icon()
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker/dropped(mob/user)
|
|
..()
|
|
update_icon()
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker/attack_hand()
|
|
..()
|
|
update_icon()
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker/update_icon()
|
|
cut_overlays()
|
|
|
|
if(reagents.total_volume)
|
|
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]10")
|
|
|
|
var/percent = round((reagents.total_volume / volume) * 100)
|
|
switch(percent)
|
|
if(0 to 9) filling.icon_state = "[icon_state]-10"
|
|
if(10 to 24) filling.icon_state = "[icon_state]10"
|
|
if(25 to 49) filling.icon_state = "[icon_state]25"
|
|
if(50 to 74) filling.icon_state = "[icon_state]50"
|
|
if(75 to 79) filling.icon_state = "[icon_state]75"
|
|
if(80 to 90) filling.icon_state = "[icon_state]80"
|
|
if(91 to INFINITY) filling.icon_state = "[icon_state]100"
|
|
|
|
filling.color = reagents.get_color()
|
|
add_overlay(filling)
|
|
|
|
if (!is_open_container())
|
|
add_overlay("lid_[initial(icon_state)]")
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker/large
|
|
name = "large beaker"
|
|
desc = "A large beaker."
|
|
icon_state = "beakerlarge"
|
|
matter = list("glass" = 5000)
|
|
volume = 120
|
|
amount_per_transfer_from_this = 10
|
|
possible_transfer_amounts = list(5,10,15,25,30,60,120)
|
|
flags = OPENCONTAINER
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker/bowl
|
|
name = "mixing bowl"
|
|
desc = "A large mixing bowl."
|
|
icon = 'icons/obj/kitchen.dmi'
|
|
icon_state = "mixingbowl"
|
|
matter = list(DEFAULT_WALL_MATERIAL = 300)
|
|
volume = 180
|
|
amount_per_transfer_from_this = 10
|
|
possible_transfer_amounts = list(5,10,15,25,30,60,180)
|
|
flags = OPENCONTAINER
|
|
unacidable = 0
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker/noreact
|
|
name = "cryostasis beaker"
|
|
desc = "A cryostasis beaker that allows for chemical storage without reactions."
|
|
icon_state = "beakernoreact"
|
|
matter = list("glass" = 500)
|
|
volume = 60
|
|
amount_per_transfer_from_this = 10
|
|
flags = OPENCONTAINER | NOREACT
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker/bluespace
|
|
name = "bluespace beaker"
|
|
desc = "A bluespace beaker, powered by experimental bluespace technology."
|
|
icon_state = "beakerbluespace"
|
|
matter = list("glass" = 5000)
|
|
volume = 300
|
|
amount_per_transfer_from_this = 10
|
|
possible_transfer_amounts = list(5,10,15,25,30,60,120,300)
|
|
flags = OPENCONTAINER
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker/vial
|
|
name = "vial"
|
|
desc = "A small glass vial."
|
|
icon_state = "vial"
|
|
matter = list("glass" = 250)
|
|
volume = 30
|
|
amount_per_transfer_from_this = 10
|
|
possible_transfer_amounts = list(5,10,15,25)
|
|
flags = OPENCONTAINER
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker/cryoxadone
|
|
/obj/item/weapon/reagent_containers/glass/beaker/cryoxadone/Initialize()
|
|
. = ..()
|
|
reagents.add_reagent("cryoxadone", 30)
|
|
update_icon()
|
|
|
|
/obj/item/weapon/reagent_containers/glass/beaker/sulphuric
|
|
/obj/item/weapon/reagent_containers/glass/beaker/sulphuric/Initialize()
|
|
. = ..()
|
|
reagents.add_reagent("sacid", 60)
|
|
update_icon()
|
|
|
|
/obj/item/weapon/reagent_containers/glass/bucket
|
|
desc = "A blue plastic bucket."
|
|
name = "bucket"
|
|
icon = 'icons/obj/janitor.dmi'
|
|
icon_state = "bucket"
|
|
item_state = "bucket"
|
|
accuracy = 1
|
|
matter = list(DEFAULT_WALL_MATERIAL = 200)
|
|
w_class = 3.0
|
|
amount_per_transfer_from_this = 20
|
|
possible_transfer_amounts = list(10,20,30,60,120)
|
|
volume = 120
|
|
flags = OPENCONTAINER
|
|
unacidable = 0
|
|
drop_sound = 'sound/items/drop/helm.ogg'
|
|
var/carving_weapon = /obj/item/weapon/wirecutters
|
|
var/helmet_type = /obj/item/clothing/head/helmet/bucket
|
|
|
|
/obj/item/weapon/reagent_containers/glass/bucket/attackby(var/obj/D, mob/user as mob)
|
|
if(isprox(D))
|
|
to_chat(user, "You add [D] to [src].")
|
|
qdel(D)
|
|
user.put_in_hands(new /obj/item/weapon/bucket_sensor)
|
|
qdel(src)
|
|
return
|
|
else if(istype(D, carving_weapon))
|
|
to_chat(user, "<span class='notice'>You cut a big hole in \the [src] with \the [D].</span>")
|
|
user.put_in_hands(new helmet_type)
|
|
qdel(src)
|
|
return
|
|
else if(istype(D, /obj/item/weapon/mop))
|
|
if(reagents.total_volume < 1)
|
|
to_chat(user, "<span class='warning'>\The [src] is empty!</span>")
|
|
else
|
|
reagents.trans_to_obj(D, 5)
|
|
to_chat(user, "<span class='notice'>You wet \the [D] in \the [src].</span>")
|
|
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
|
return
|
|
else
|
|
return ..()
|
|
|
|
/obj/item/weapon/reagent_containers/glass/bucket/update_icon()
|
|
cut_overlays()
|
|
if(reagents.total_volume > 0)
|
|
add_overlay("water_[initial(icon_state)]")
|
|
if(!is_open_container())
|
|
add_overlay("lid_[initial(icon_state)]")
|
|
|
|
/obj/item/weapon/reagent_containers/glass/bucket/on_reagent_change()
|
|
update_icon()
|
|
|
|
/obj/item/weapon/reagent_containers/glass/bucket/self_feed_message(var/mob/user)
|
|
to_chat(user, "<span class='notice'>You drink heavily from \the [src].</span>")
|
|
|
|
|
|
obj/item/weapon/reagent_containers/glass/bucket/wood
|
|
desc = "An old wooden bucket."
|
|
name = "wooden bucket"
|
|
icon = 'icons/obj/janitor.dmi'
|
|
icon_state = "woodbucket"
|
|
item_state = "woodbucket"
|
|
matter = list("wood" = 50)
|
|
drop_sound = 'sound/items/drop/wooden.ogg'
|
|
carving_weapon = /obj/item/weapon/material/hatchet
|
|
helmet_type = /obj/item/clothing/head/helmet/bucket/wood
|
|
|
|
/obj/item/weapon/reagent_containers/glass/bucket/wood/attackby(var/obj/D, mob/user as mob)
|
|
if(isprox(D))
|
|
to_chat(user, "This wooden bucket doesn't play well with electronics.")
|
|
return
|
|
..()
|