mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-16 12:07:48 +00:00
72 lines
2.0 KiB
Plaintext
72 lines
2.0 KiB
Plaintext
/obj/item/weapon/reagent_containers/blood
|
|
name = "blood pack"
|
|
desc = "Contains blood used for transfusion. Must be attached to an IV drip."
|
|
icon = 'icons/obj/bloodpack.dmi'
|
|
icon_state = "empty"
|
|
volume = 200
|
|
|
|
var/blood_type = null
|
|
|
|
/obj/item/weapon/reagent_containers/blood/New()
|
|
..()
|
|
if(blood_type != null)
|
|
name = "blood pack [blood_type]"
|
|
reagents.add_reagent("blood", 200, list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_type"=blood_type,"resistances"=null,"trace_chem"=null))
|
|
update_icon()
|
|
|
|
/obj/item/weapon/reagent_containers/blood/on_reagent_change()
|
|
update_icon()
|
|
|
|
/obj/item/weapon/reagent_containers/blood/update_icon()
|
|
var/percent = round((reagents.total_volume / volume) * 100)
|
|
switch(percent)
|
|
if(0 to 9)
|
|
icon_state = "empty"
|
|
if(10 to 50)
|
|
icon_state = "half"
|
|
if(51 to INFINITY)
|
|
icon_state = "full"
|
|
|
|
/obj/item/weapon/reagent_containers/blood/random/New()
|
|
blood_type = pick("A+", "A-", "B+", "B-", "O+", "O-")
|
|
..()
|
|
|
|
/obj/item/weapon/reagent_containers/blood/APlus
|
|
blood_type = "A+"
|
|
|
|
/obj/item/weapon/reagent_containers/blood/AMinus
|
|
blood_type = "A-"
|
|
|
|
/obj/item/weapon/reagent_containers/blood/BPlus
|
|
blood_type = "B+"
|
|
|
|
/obj/item/weapon/reagent_containers/blood/BMinus
|
|
blood_type = "B-"
|
|
|
|
/obj/item/weapon/reagent_containers/blood/OPlus
|
|
blood_type = "O+"
|
|
|
|
/obj/item/weapon/reagent_containers/blood/OMinus
|
|
blood_type = "O-"
|
|
|
|
/obj/item/weapon/reagent_containers/blood/empty
|
|
name = "empty blood pack"
|
|
desc = "Seems pretty useless... Maybe if there were a way to fill it?"
|
|
icon_state = "empty"
|
|
|
|
/obj/item/weapon/reagent_containers/blood/attackby(obj/item/I, mob/user, params)
|
|
if (istype(I, /obj/item/weapon/pen) || istype(I, /obj/item/toy/crayon))
|
|
|
|
var/t = stripped_input(user, "What would you like to label the blood pack?", name, null, 53)
|
|
if(!user.canUseTopic(src))
|
|
return
|
|
if(user.get_active_hand() != I)
|
|
return
|
|
if(!in_range(src, user) && loc != user)
|
|
return
|
|
if(t)
|
|
name = "blood pack - [t]"
|
|
else
|
|
name = "blood pack"
|
|
return
|