mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-18 19:39:53 +01:00
f91cd25b64
added a chem, vendor item and trash variant for the item. Also reorganized some files. The blueberry chem does nothing more than recoloring the player, that's it
372 lines
14 KiB
Plaintext
372 lines
14 KiB
Plaintext
/obj/item/reagent_containers/glass
|
|
name = "glass"
|
|
amount_per_transfer_from_this = 10
|
|
possible_transfer_amounts = list(5, 10, 15, 20, 25, 30, 50)
|
|
volume = 50
|
|
reagent_flags = OPENCONTAINER
|
|
spillable = TRUE
|
|
resistance_flags = ACID_PROOF
|
|
container_HP = 2
|
|
|
|
|
|
/obj/item/reagent_containers/glass/attack(mob/M, mob/user, obj/target)
|
|
if(!canconsume(M, user))
|
|
return
|
|
|
|
if(!spillable)
|
|
return
|
|
|
|
if(!reagents || !reagents.total_volume)
|
|
to_chat(user, "<span class='warning'>[src] is empty!</span>")
|
|
return
|
|
|
|
if(istype(M))
|
|
if(user.a_intent == INTENT_HARM)
|
|
M.visible_message("<span class='danger'>[user] splashes the contents of [src] onto [M]!</span>", \
|
|
"<span class='userdanger'>[user] splashes the contents of [src] onto [M]!</span>")
|
|
var/R = reagents?.log_list()
|
|
if(isturf(target) && reagents.reagent_list.len && thrownby)
|
|
log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]")
|
|
message_admins("[ADMIN_LOOKUPFLW(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] at [ADMIN_VERBOSEJMP(target)].")
|
|
reagents.reaction(M, TOUCH)
|
|
log_combat(user, M, "splashed", R)
|
|
reagents.clear_reagents()
|
|
else
|
|
if(M != user)
|
|
M.visible_message("<span class='danger'>[user] attempts to feed something to [M].</span>", \
|
|
"<span class='userdanger'>[user] attempts to feed something to you.</span>")
|
|
if(!do_mob(user, M))
|
|
return
|
|
if(!reagents || !reagents.total_volume)
|
|
return // The drink might be empty after the delay, such as by spam-feeding
|
|
M.visible_message("<span class='danger'>[user] feeds something to [M].</span>", "<span class='userdanger'>[user] feeds something to you.</span>")
|
|
log_combat(user, M, "fed", reagents.log_list())
|
|
else
|
|
to_chat(user, "<span class='notice'>You swallow a gulp of [src].</span>")
|
|
var/fraction = min(5/reagents.total_volume, 1)
|
|
reagents.reaction(M, INGEST, fraction)
|
|
addtimer(CALLBACK(reagents, /datum/reagents.proc/trans_to, M, 5), 5)
|
|
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
|
|
|
|
/obj/item/reagent_containers/glass/afterattack(obj/target, mob/user, proximity)
|
|
. = ..()
|
|
if((!proximity) || !check_allowed_items(target,target_self=1))
|
|
return
|
|
|
|
if(target.is_refillable()) //Something like a glass. Player probably wants to transfer TO it.
|
|
if(!reagents.total_volume)
|
|
to_chat(user, "<span class='warning'>[src] is empty!</span>")
|
|
return
|
|
|
|
if(target.reagents.holder_full())
|
|
to_chat(user, "<span class='warning'>[target] is full.</span>")
|
|
return
|
|
|
|
var/trans = reagents.trans_to(target, amount_per_transfer_from_this)
|
|
to_chat(user, "<span class='notice'>You transfer [trans] unit\s of the solution to [target].</span>")
|
|
|
|
else if(target.is_drainable()) //A dispenser. Transfer FROM it TO us.
|
|
if(!target.reagents.total_volume)
|
|
to_chat(user, "<span class='warning'>[target] is empty and can't be refilled!</span>")
|
|
return
|
|
|
|
if(reagents.holder_full())
|
|
to_chat(user, "<span class='warning'>[src] is full.</span>")
|
|
return
|
|
|
|
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
|
|
to_chat(user, "<span class='notice'>You fill [src] with [trans] unit\s of the contents of [target].</span>")
|
|
|
|
else if(reagents.total_volume)
|
|
if(user.a_intent == INTENT_HARM)
|
|
user.visible_message("<span class='danger'>[user] splashes the contents of [src] onto [target]!</span>", \
|
|
"<span class='notice'>You splash the contents of [src] onto [target].</span>")
|
|
reagents.reaction(target, TOUCH)
|
|
reagents.clear_reagents()
|
|
|
|
/obj/item/reagent_containers/glass/attackby(obj/item/I, mob/user, params)
|
|
var/hotness = I.is_hot()
|
|
if(hotness && reagents)
|
|
reagents.expose_temperature(hotness)
|
|
to_chat(user, "<span class='notice'>You heat [name] with [I]!</span>")
|
|
|
|
if(istype(I, /obj/item/reagent_containers/food/snacks/egg)) //breaking eggs
|
|
var/obj/item/reagent_containers/food/snacks/egg/E = I
|
|
if(reagents)
|
|
if(reagents.total_volume >= reagents.maximum_volume)
|
|
to_chat(user, "<span class='notice'>[src] is full.</span>")
|
|
else
|
|
to_chat(user, "<span class='notice'>You break [E] in [src].</span>")
|
|
E.reagents.trans_to(src, E.reagents.total_volume)
|
|
qdel(E)
|
|
return
|
|
..()
|
|
|
|
|
|
/obj/item/reagent_containers/glass/beaker
|
|
name = "beaker"
|
|
desc = "A beaker. It can hold up to 50 units. Unable to withstand extreme pHes"
|
|
icon = 'icons/obj/chemical.dmi'
|
|
icon_state = "beaker"
|
|
item_state = "beaker"
|
|
materials = list(MAT_GLASS=500)
|
|
beaker_weakness_bitflag = PH_WEAK
|
|
|
|
/obj/item/reagent_containers/glass/beaker/Initialize()
|
|
. = ..()
|
|
update_icon()
|
|
|
|
/obj/item/reagent_containers/glass/beaker/get_part_rating()
|
|
return reagents.maximum_volume
|
|
|
|
/obj/item/reagent_containers/glass/beaker/on_reagent_change(changetype)
|
|
update_icon()
|
|
|
|
/obj/item/reagent_containers/glass/beaker/update_icon()
|
|
if(!cached_icon)
|
|
cached_icon = icon_state
|
|
cut_overlays()
|
|
|
|
if(reagents.total_volume)
|
|
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[cached_icon]10")
|
|
|
|
var/percent = round((reagents.total_volume / volume) * 100)
|
|
switch(percent)
|
|
if(0 to 9)
|
|
filling.icon_state = "[cached_icon]-10"
|
|
if(10 to 24)
|
|
filling.icon_state = "[cached_icon]10"
|
|
if(25 to 49)
|
|
filling.icon_state = "[cached_icon]25"
|
|
if(50 to 74)
|
|
filling.icon_state = "[cached_icon]50"
|
|
if(75 to 79)
|
|
filling.icon_state = "[cached_icon]75"
|
|
if(80 to 90)
|
|
filling.icon_state = "[cached_icon]80"
|
|
if(91 to INFINITY)
|
|
filling.icon_state = "[cached_icon]100"
|
|
|
|
filling.color = mix_color_from_reagents(reagents.reagent_list)
|
|
add_overlay(filling)
|
|
|
|
/obj/item/reagent_containers/glass/beaker/jar
|
|
name = "honey jar"
|
|
desc = "A jar for honey. It can hold up to 50 units of sweet delight. Unable to withstand reagents of an extreme pH."
|
|
icon = 'icons/obj/chemical.dmi'
|
|
icon_state = "vapour"
|
|
|
|
/obj/item/reagent_containers/glass/beaker/large
|
|
name = "large beaker"
|
|
desc = "A large beaker. Can hold up to 100 units. Unable to withstand reagents of an extreme pH."
|
|
icon_state = "beakerlarge"
|
|
materials = list(MAT_GLASS=2500)
|
|
volume = 100
|
|
amount_per_transfer_from_this = 10
|
|
possible_transfer_amounts = list(5,10,15,20,25,30,50,100)
|
|
container_HP = 3
|
|
|
|
/obj/item/reagent_containers/glass/beaker/plastic
|
|
name = "x-large beaker"
|
|
desc = "An extra-large beaker. Can hold up to 150 units. Is able to resist acid and alkaline solutions, but melts at 444K"
|
|
icon_state = "beakerwhite"
|
|
materials = list(MAT_GLASS=2500, MAT_PLASTIC=3000)
|
|
volume = 150
|
|
amount_per_transfer_from_this = 10
|
|
possible_transfer_amounts = list(5,10,15,20,25,30,50,100,150)
|
|
|
|
/obj/item/reagent_containers/glass/beaker/plastic/Initialize()
|
|
beaker_weakness_bitflag &= ~PH_WEAK
|
|
beaker_weakness_bitflag |= TEMP_WEAK
|
|
. = ..()
|
|
|
|
/obj/item/reagent_containers/glass/beaker/plastic/update_icon()
|
|
icon_state = "beakerlarge" // hack to lets us reuse the large beaker reagent fill states
|
|
..()
|
|
icon_state = "beakerwhite"
|
|
|
|
/obj/item/reagent_containers/glass/beaker/meta
|
|
name = "metamaterial beaker"
|
|
desc = "A large beaker. Can hold up to 200 units. Is able to withstand all chemical situations."
|
|
icon_state = "beakergold"
|
|
materials = list(MAT_GLASS=2500, MAT_PLASTIC=3000, MAT_GOLD=1000, MAT_TITANIUM=1000)
|
|
volume = 200
|
|
amount_per_transfer_from_this = 10
|
|
possible_transfer_amounts = list(5,10,15,20,25,30,50,100,200)
|
|
|
|
/obj/item/reagent_containers/glass/beaker/meta/Initialize()
|
|
beaker_weakness_bitflag &= ~PH_WEAK
|
|
. = ..()
|
|
|
|
/obj/item/reagent_containers/glass/beaker/noreact
|
|
name = "cryostasis beaker"
|
|
desc = "A cryostasis beaker that allows for chemical storage without \
|
|
reactions. Can hold up to 50 units."
|
|
icon_state = "beakernoreact"
|
|
materials = list(MAT_METAL=3000)
|
|
reagent_flags = OPENCONTAINER | NO_REACT
|
|
volume = 50
|
|
amount_per_transfer_from_this = 10
|
|
container_HP = 10//shouldn't be needed
|
|
|
|
/obj/item/reagent_containers/glass/beaker/noreact/Initialize()
|
|
beaker_weakness_bitflag &= ~PH_WEAK
|
|
. = ..()
|
|
//reagents.set_reacting(FALSE) was this removed in a recent pr?
|
|
|
|
/obj/item/reagent_containers/glass/beaker/bluespace
|
|
name = "bluespace beaker"
|
|
desc = "A bluespace beaker, powered by experimental bluespace technology \
|
|
and Element Cuban combined with the Compound Pete. Can hold up to \
|
|
300 units. Unable to withstand reagents of an extreme pH."
|
|
icon_state = "beakerbluespace"
|
|
materials = list(MAT_GLASS=3000)
|
|
volume = 300
|
|
amount_per_transfer_from_this = 10
|
|
possible_transfer_amounts = list(5,10,15,20,25,30,50,100,300)
|
|
container_HP = 4
|
|
|
|
/obj/item/reagent_containers/glass/beaker/cryoxadone
|
|
list_reagents = list(/datum/reagent/medicine/cryoxadone = 30)
|
|
|
|
/obj/item/reagent_containers/glass/beaker/sulphuric
|
|
list_reagents = list(/datum/reagent/toxin/acid = 50)
|
|
|
|
/obj/item/reagent_containers/glass/beaker/slime
|
|
list_reagents = list(/datum/reagent/toxin/slimejelly = 50)
|
|
|
|
/obj/item/reagent_containers/glass/beaker/large/styptic
|
|
name = "styptic reserve tank"
|
|
list_reagents = list(/datum/reagent/medicine/styptic_powder = 50)
|
|
|
|
/obj/item/reagent_containers/glass/beaker/large/silver_sulfadiazine
|
|
name = "silver sulfadiazine reserve tank"
|
|
list_reagents = list(/datum/reagent/medicine/silver_sulfadiazine = 50)
|
|
|
|
/obj/item/reagent_containers/glass/beaker/large/charcoal
|
|
name = "charcoal reserve tank"
|
|
list_reagents = list(/datum/reagent/medicine/charcoal = 50)
|
|
|
|
/obj/item/reagent_containers/glass/beaker/large/epinephrine
|
|
name = "epinephrine reserve tank"
|
|
list_reagents = list(/datum/reagent/medicine/epinephrine = 50)
|
|
|
|
/obj/item/reagent_containers/glass/beaker/synthflesh
|
|
list_reagents = list(/datum/reagent/medicine/synthflesh = 50)
|
|
|
|
/obj/item/reagent_containers/glass/bucket
|
|
name = "bucket"
|
|
desc = "It's a bucket."
|
|
icon = 'icons/obj/janitor.dmi'
|
|
icon_state = "bucket"
|
|
item_state = "bucket"
|
|
lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi'
|
|
materials = list(MAT_METAL=200)
|
|
w_class = WEIGHT_CLASS_NORMAL
|
|
amount_per_transfer_from_this = 20
|
|
possible_transfer_amounts = list(5,10,15,20,25,30,50,70)
|
|
volume = 70
|
|
flags_inv = HIDEHAIR
|
|
slot_flags = ITEM_SLOT_HEAD
|
|
resistance_flags = NONE
|
|
armor = list("melee" = 10, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 75, "acid" = 50) //Weak melee protection, because you can wear it on your head
|
|
slot_equipment_priority = list( \
|
|
SLOT_BACK, SLOT_WEAR_ID,\
|
|
SLOT_W_UNIFORM, SLOT_WEAR_SUIT,\
|
|
SLOT_WEAR_MASK, SLOT_HEAD, SLOT_NECK,\
|
|
SLOT_SHOES, SLOT_GLOVES,\
|
|
SLOT_EARS, SLOT_GLASSES,\
|
|
SLOT_BELT, SLOT_S_STORE,\
|
|
SLOT_L_STORE, SLOT_R_STORE,\
|
|
SLOT_GENERC_DEXTROUS_STORAGE
|
|
)
|
|
container_HP = 1
|
|
|
|
/obj/item/reagent_containers/glass/bucket/Initialize()
|
|
beaker_weakness_bitflag |= TEMP_WEAK
|
|
. = ..()
|
|
|
|
/obj/item/reagent_containers/glass/bucket/attackby(obj/O, mob/user, params)
|
|
if(istype(O, /obj/item/mop))
|
|
if(reagents.total_volume < 1)
|
|
to_chat(user, "<span class='warning'>[src] is out of water!</span>")
|
|
else
|
|
reagents.trans_to(O, 5)
|
|
to_chat(user, "<span class='notice'>You wet [O] in [src].</span>")
|
|
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
|
else if(isprox(O))
|
|
to_chat(user, "<span class='notice'>You add [O] to [src].</span>")
|
|
qdel(O)
|
|
qdel(src)
|
|
user.put_in_hands(new /obj/item/bot_assembly/cleanbot)
|
|
else
|
|
..()
|
|
|
|
/obj/item/reagent_containers/glass/bucket/equipped(mob/user, slot)
|
|
..()
|
|
if (slot == SLOT_HEAD)
|
|
if(reagents.total_volume)
|
|
to_chat(user, "<span class='userdanger'>[src]'s contents spill all over you!</span>")
|
|
reagents.reaction(user, TOUCH)
|
|
reagents.clear_reagents()
|
|
reagent_flags = NONE
|
|
|
|
/obj/item/reagent_containers/glass/bucket/dropped(mob/user)
|
|
. = ..()
|
|
reagent_flags = initial(reagent_flags)
|
|
|
|
/obj/item/reagent_containers/glass/bucket/equip_to_best_slot(var/mob/M)
|
|
if(reagents.total_volume) //If there is water in a bucket, don't quick equip it to the head
|
|
var/index = slot_equipment_priority.Find(SLOT_HEAD)
|
|
slot_equipment_priority.Remove(SLOT_HEAD)
|
|
. = ..()
|
|
slot_equipment_priority.Insert(index, SLOT_HEAD)
|
|
return
|
|
return ..()
|
|
|
|
/obj/item/reagent_containers/glass/beaker/waterbottle
|
|
name = "bottle of water"
|
|
desc = "A bottle of water filled at some factory in space."
|
|
icon = 'icons/obj/drinks.dmi'
|
|
icon_state = "smallbottle"
|
|
item_state = "bottle"
|
|
list_reagents = list(/datum/reagent/water = 50)//see desc, don't think about it too hard
|
|
materials = list(MAT_GLASS=0)
|
|
volume = 50
|
|
amount_per_transfer_from_this = 10
|
|
container_HP = 1
|
|
price = 1
|
|
|
|
/obj/item/reagent_containers/glass/beaker/waterbottle/Initialize()
|
|
beaker_weakness_bitflag |= TEMP_WEAK
|
|
. = ..()
|
|
|
|
/obj/item/reagent_containers/glass/beaker/waterbottle/empty
|
|
list_reagents = list()
|
|
|
|
/obj/item/reagent_containers/glass/beaker/waterbottle/large
|
|
desc = "A fresh commercial-sized bottle of water."
|
|
icon_state = "largebottle"
|
|
materials = list(MAT_GLASS=0)
|
|
list_reagents = list(/datum/reagent/water = 100)
|
|
volume = 100
|
|
amount_per_transfer_from_this = 20
|
|
container_HP = 1
|
|
|
|
/obj/item/reagent_containers/glass/beaker/waterbottle/large/empty
|
|
list_reagents = list()
|
|
|
|
/obj/item/reagent_containers/glass/beaker/waterbottle/wataur
|
|
name = "Bottled Wataur"
|
|
desc = "Finally, a bottle as proportionate as you. Incredible!"
|
|
icon = 'icons/obj/drinks.dmi'
|
|
icon_state = "wataur"
|
|
list_reagents = list(/datum/reagent/water = 100) //robust ass wataur
|
|
volume = 100
|
|
amount_per_transfer_from_this = 20
|
|
container_HP = 1
|
|
|
|
/obj/item/reagent_containers/glass/get_belt_overlay()
|
|
return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "bottle")
|