mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-30 12:02:24 +00:00
Merge pull request #3823 from Iamgoofball/boozetaketwo
Added the Booze Dispenser, the Soda Dispenser, the Bluespace Beaker, and the Cryostasis Beaker.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
var/amount = 30
|
||||
var/beaker = null
|
||||
var/recharged = 0
|
||||
var/hackedcheck = 0
|
||||
var/list/dispensable_reagents = list("hydrogen","lithium","carbon","nitrogen","oxygen","fluorine",
|
||||
"sodium","aluminum","silicon","phosphorus","sulfur","chlorine","potassium","iron",
|
||||
"copper","mercury","radium","water","ethanol","sugar","sacid","tungsten")
|
||||
@@ -74,11 +75,10 @@
|
||||
*
|
||||
* @param user /mob The mob who is interacting with this ui
|
||||
* @param ui_key string A string key to use for this ui. Allows for multiple unique uis on one obj/mob (defaut value "main")
|
||||
* @param ui /datum/nanoui This parameter is passed by the nanoui process() proc when updating an open ui
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
/obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
/obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main")
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
if(user.stat || user.restrained()) return
|
||||
|
||||
@@ -111,13 +111,10 @@
|
||||
chemicals.Add(list(list("title" = temp.name, "id" = temp.id, "commands" = list("dispense" = temp.id)))) // list in a list because Byond merges the first list...
|
||||
data["chemicals"] = chemicals
|
||||
|
||||
if (!ui) // no ui has been passed, so we'll search for one
|
||||
{
|
||||
ui = nanomanager.get_open_ui(user, src, ui_key)
|
||||
}
|
||||
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, ui_key)
|
||||
if (!ui)
|
||||
// the ui does not exist, so we'll create a new one
|
||||
ui = new(user, src, ui_key, "chem_dispenser.tmpl", "Chem Dispenser 5000", 374, 640)
|
||||
ui = new(user, src, ui_key, "chem_dispenser.tmpl", "Chem Dispenser 5000", 370, 605)
|
||||
// When the UI is first opened this is the data it will use
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
@@ -159,18 +156,16 @@
|
||||
if(isrobot(user))
|
||||
return
|
||||
|
||||
if(!istype(B, /obj/item/weapon/reagent_containers/glass))
|
||||
return
|
||||
|
||||
if(src.beaker)
|
||||
user << "A beaker is already loaded into the machine."
|
||||
user << "Something is already loaded into the machine."
|
||||
return
|
||||
if(istype(B, /obj/item/weapon/reagent_containers/glass||/obj/item/weapon/reagent_containers/food))
|
||||
src.beaker = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
user << "You set [B] on the machine."
|
||||
nanomanager.update_uis(src) // update all UIs attached to src
|
||||
return
|
||||
|
||||
src.beaker = B
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
user << "You add the beaker to the machine!"
|
||||
nanomanager.update_uis(src) // update all UIs attached to src
|
||||
|
||||
/obj/machinery/chem_dispenser/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
@@ -184,6 +179,50 @@
|
||||
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/chem_dispenser/soda
|
||||
icon_state = "soda_dispenser"
|
||||
name = "soda fountain"
|
||||
desc = "A drink fabricating machine, capable of producing many sugary drinks with just one touch."
|
||||
energy = 100
|
||||
max_energy = 100
|
||||
dispensable_reagents = list("water","ice","coffee","tea","icetea","space_cola","spacemountainwind","dr_gibb","space_up","tonic","sodawater","lemon_lime","sugar","orangejuice","limejuice")
|
||||
|
||||
/obj/machinery/chem_dispenser/soda/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob)
|
||||
..()
|
||||
if(istype(B, /obj/item/device/multitool))
|
||||
if(hackedcheck == 0)
|
||||
user << "You change the mode from 'McNano' to 'Pizza King'."
|
||||
dispensable_reagents += list("thirteenloko")
|
||||
hackedcheck = 1
|
||||
return
|
||||
|
||||
else
|
||||
user << "You change the mode from 'Pizza King' to 'McNano'."
|
||||
dispensable_reagents -= list("thirteenloko")
|
||||
hackedcheck = 0
|
||||
return
|
||||
/obj/machinery/chem_dispenser/beer
|
||||
icon_state = "booze_dispenser"
|
||||
name = "booze dispenser"
|
||||
energy = 100
|
||||
max_energy = 100
|
||||
desc = "A technological marvel, supposedly able to mix just the mixture you'd like to drink the moment you ask for one."
|
||||
dispensable_reagents = list("water","ice","coffee","tea","cream","lemon_lime","sugar","orangejuice","limejuice","cola","sodawater","tonic","beer","kahlua","whisky","wine","vodka","gin","rum","tequila","vermouth","cognac","ale","mead")
|
||||
|
||||
/obj/machinery/chem_dispenser/beer/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob)
|
||||
..()
|
||||
if(istype(B, /obj/item/device/multitool))
|
||||
if(hackedcheck == 0)
|
||||
user << "You disable the 'nanotrasen-are-cheap-bastards' lock, enabling hidden and very expensive boozes."
|
||||
dispensable_reagents += list("goldschlager","patron","watermelonjuice","berryjuice")
|
||||
hackedcheck = 1
|
||||
return
|
||||
|
||||
else
|
||||
user << "You re-enable the 'nanotrasen-are-cheap-bastards' lock, disabling hidden and very expensive boozes."
|
||||
dispensable_reagents -= list("goldschlager","patron","watermelonjuice","berryjuice")
|
||||
hackedcheck = 0
|
||||
return
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -347,15 +386,15 @@
|
||||
reagents.clear_reagents()
|
||||
icon_state = "mixer0"
|
||||
else if (href_list["createpill"] || href_list["createpill_multiple"])
|
||||
var/name = reject_bad_text(input(usr,"Name:","Name your pill!",reagents.get_master_reagent_name()))
|
||||
var/count = 1
|
||||
if (href_list["createpill_multiple"]) count = isgoodnumber(input("Select the number of pills to make.", 10, pillamount) as num)
|
||||
if (count > 20) count = 20 //Pevent people from creating huge stacks of pills easily. Maybe move the number to defines?
|
||||
var/amount_per_pill = reagents.total_volume/count
|
||||
if (amount_per_pill > 50) amount_per_pill = 50
|
||||
var/name = reject_bad_text(input(usr,"Name:","Name your pill!","[reagents.get_master_reagent_name()] ([amount_per_pill] units)"))
|
||||
while (count--)
|
||||
var/obj/item/weapon/reagent_containers/pill/P = new/obj/item/weapon/reagent_containers/pill(src.loc)
|
||||
if(!name) name = "[reagents.get_master_reagent_name()] ([amount_per_pill] units)"
|
||||
if(!name) name = reagents.get_master_reagent_name()
|
||||
P.name = "[name] pill"
|
||||
P.pixel_x = rand(-7, 7) //random position
|
||||
P.pixel_y = rand(-7, 7)
|
||||
@@ -367,9 +406,9 @@
|
||||
src.updateUsrDialog()
|
||||
else if (href_list["createbottle"])
|
||||
if(!condi)
|
||||
var/name = reject_bad_text(input(usr,"Name:","Name your bottle!","[reagents.get_master_reagent_name()] ([reagents.total_volume] units)"))
|
||||
var/name = reject_bad_text(input(usr,"Name:","Name your bottle!",reagents.get_master_reagent_name()))
|
||||
var/obj/item/weapon/reagent_containers/glass/bottle/P = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc)
|
||||
if(!name) name = "[reagents.get_master_reagent_name()] ([reagents.total_volume] units)"
|
||||
if(!name) name = reagents.get_master_reagent_name()
|
||||
P.name = "[name] bottle"
|
||||
P.pixel_x = rand(-7, 7) //random position
|
||||
P.pixel_y = rand(-7, 7)
|
||||
|
||||
@@ -1,318 +1,336 @@
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// (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,50)
|
||||
volume = 50
|
||||
flags = FPRINT | TABLEPASS | OPENCONTAINER
|
||||
|
||||
var/label_text = ""
|
||||
|
||||
var/list/can_be_placed_into = list(
|
||||
/obj/machinery/chem_master/,
|
||||
/obj/machinery/chem_dispenser/,
|
||||
/obj/machinery/reagentgrinder,
|
||||
/obj/structure/table,
|
||||
/obj/structure/closet,
|
||||
/obj/structure/sink,
|
||||
/obj/item/weapon/storage,
|
||||
/obj/machinery/atmospherics/unary/cryo_cell,
|
||||
/obj/machinery/dna_scannernew,
|
||||
/obj/item/weapon/grenade/chem_grenade,
|
||||
/obj/machinery/bot/medbot,
|
||||
/obj/machinery/computer/pandemic,
|
||||
/obj/item/weapon/storage/secure/safe,
|
||||
/obj/machinery/iv_drip,
|
||||
/obj/machinery/disease2/incubator,
|
||||
/obj/machinery/disposal,
|
||||
/obj/machinery/apiary,
|
||||
/mob/living/simple_animal/cow,
|
||||
/mob/living/simple_animal/hostile/retaliate/goat,
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// (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,50)
|
||||
volume = 50
|
||||
flags = FPRINT | TABLEPASS | OPENCONTAINER
|
||||
|
||||
var/label_text = ""
|
||||
|
||||
var/list/can_be_placed_into = list(
|
||||
/obj/machinery/chem_master/,
|
||||
/obj/machinery/chem_dispenser/,
|
||||
/obj/machinery/reagentgrinder,
|
||||
/obj/structure/table,
|
||||
/obj/structure/closet,
|
||||
/obj/structure/sink,
|
||||
/obj/item/weapon/storage,
|
||||
/obj/machinery/atmospherics/unary/cryo_cell,
|
||||
/obj/machinery/dna_scannernew,
|
||||
/obj/item/weapon/grenade/chem_grenade,
|
||||
/obj/machinery/bot/medbot,
|
||||
/obj/machinery/computer/pandemic,
|
||||
/obj/item/weapon/storage/secure/safe,
|
||||
/obj/machinery/iv_drip,
|
||||
/obj/machinery/disease2/incubator,
|
||||
/obj/machinery/disposal,
|
||||
/obj/machinery/apiary,
|
||||
/mob/living/simple_animal/cow,
|
||||
/mob/living/simple_animal/hostile/retaliate/goat,
|
||||
/obj/machinery/computer/centrifuge,
|
||||
/obj/machinery/sleeper )
|
||||
|
||||
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)
|
||||
usr << "\blue [src.reagents.total_volume] units of liquid."
|
||||
else
|
||||
usr << "\blue Nothing."
|
||||
if (!is_open_container())
|
||||
usr << "\blue Airtight lid seals it completely."
|
||||
|
||||
attack_self()
|
||||
..()
|
||||
if (is_open_container())
|
||||
usr << "<span class = 'notice'>You put the lid on \the [src]."
|
||||
flags ^= OPENCONTAINER
|
||||
else
|
||||
usr << "<span class = 'notice'>You take the lid off \the [src]."
|
||||
flags |= OPENCONTAINER
|
||||
update_icon()
|
||||
|
||||
afterattack(obj/target, mob/user, proximity)
|
||||
if(!proximity) return
|
||||
if (!is_open_container())
|
||||
return
|
||||
|
||||
for(var/type in src.can_be_placed_into)
|
||||
if(istype(target, type))
|
||||
return
|
||||
|
||||
if(ismob(target) && target.reagents && reagents.total_volume)
|
||||
user << "\blue You splash the solution onto [target]."
|
||||
|
||||
var/mob/living/M = target
|
||||
var/list/injected = list()
|
||||
for(var/datum/reagent/R in src.reagents.reagent_list)
|
||||
injected += R.name
|
||||
var/contained = english_list(injected)
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been splashed with [src.name] by [user.name] ([user.ckey]). Reagents: [contained]</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to splash [M.name] ([M.key]). Reagents: [contained]</font>")
|
||||
msg_admin_attack("[user.name] ([user.ckey]) splashed [M.name] ([M.key]) with [src.name]. Reagents: [contained] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
|
||||
for(var/mob/O in viewers(world.view, user))
|
||||
O.show_message(text("\red [] has been splashed with something by []!", target, user), 1)
|
||||
src.reagents.reaction(target, TOUCH)
|
||||
spawn(5) src.reagents.clear_reagents()
|
||||
return
|
||||
else if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us.
|
||||
|
||||
if(!target.reagents.total_volume && target.reagents)
|
||||
user << "\red [target] is empty."
|
||||
return
|
||||
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
user << "\red [src] is full."
|
||||
return
|
||||
|
||||
var/trans = target.reagents.trans_to(src, target:amount_per_transfer_from_this)
|
||||
user << "\blue You fill [src] with [trans] units of the contents of [target]."
|
||||
|
||||
else if(target.is_open_container() && target.reagents) //Something like a glass. Player probably wants to transfer TO it.
|
||||
if(!reagents.total_volume)
|
||||
user << "\red [src] is empty."
|
||||
return
|
||||
|
||||
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
||||
user << "\red [target] is full."
|
||||
return
|
||||
|
||||
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
user << "\blue You transfer [trans] units of the solution to [target]."
|
||||
|
||||
//Safety for dumping stuff into a ninja suit. It handles everything through attackby() and this is unnecessary.
|
||||
else if(istype(target, /obj/item/clothing/suit/space/space_ninja))
|
||||
return
|
||||
|
||||
else if(istype(target, /obj/machinery/bunsen_burner))
|
||||
return
|
||||
|
||||
else if(istype(target, /obj/machinery/anomaly))
|
||||
return
|
||||
|
||||
else if(reagents.total_volume)
|
||||
user << "\blue You splash the solution onto [target]."
|
||||
src.reagents.reaction(target, TOUCH)
|
||||
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."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "beaker"
|
||||
item_state = "beaker"
|
||||
m_amt = 0
|
||||
g_amt = 500
|
||||
|
||||
on_reagent_change()
|
||||
update_icon()
|
||||
|
||||
pickup(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
dropped(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
attack_hand()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
update_icon()
|
||||
overlays.Cut()
|
||||
|
||||
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.icon += mix_color_from_reagents(reagents.reagent_list)
|
||||
overlays += filling
|
||||
|
||||
if (!is_open_container())
|
||||
var/image/lid = image(icon, src, "lid_[initial(icon_state)]")
|
||||
overlays += lid
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/large
|
||||
name = "large beaker"
|
||||
desc = "A large beaker. Can hold up to 100 units."
|
||||
icon_state = "beakerlarge"
|
||||
g_amt = 5000
|
||||
volume = 100
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,50,100)
|
||||
flags = FPRINT | TABLEPASS | OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/vial
|
||||
name = "vial"
|
||||
desc = "A small glass vial. Can hold up to 25 units."
|
||||
icon_state = "vial"
|
||||
g_amt = 250
|
||||
volume = 25
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25)
|
||||
flags = FPRINT | TABLEPASS | OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/cryoxadone
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("cryoxadone", 30)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/sulphuric
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("sacid", 50)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/slime
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("slimejelly", 50)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bucket
|
||||
desc = "It's a bucket."
|
||||
name = "bucket"
|
||||
icon = 'icons/obj/janitor.dmi'
|
||||
icon_state = "bucket"
|
||||
item_state = "bucket"
|
||||
m_amt = 200
|
||||
g_amt = 0
|
||||
w_class = 3.0
|
||||
amount_per_transfer_from_this = 20
|
||||
possible_transfer_amounts = list(10,20,30,50,70)
|
||||
volume = 70
|
||||
flags = FPRINT | OPENCONTAINER
|
||||
|
||||
attackby(var/obj/D, mob/user as mob)
|
||||
if(isprox(D))
|
||||
user << "You add [D] to [src]."
|
||||
del(D)
|
||||
user.put_in_hands(new /obj/item/weapon/bucket_sensor)
|
||||
user.drop_from_inventory(src)
|
||||
del(src)
|
||||
|
||||
// vials are defined twice, what?
|
||||
/*
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/vial
|
||||
name = "vial"
|
||||
desc = "Small glass vial. Looks fragile."
|
||||
icon_state = "vial"
|
||||
g_amt = 500
|
||||
volume = 15
|
||||
amount_per_transfer_from_this = 5
|
||||
possible_transfer_amounts = list(1,5,15)
|
||||
flags = FPRINT | TABLEPASS | OPENCONTAINER */
|
||||
|
||||
/*
|
||||
/obj/item/weapon/reagent_containers/glass/blender_jug
|
||||
name = "Blender Jug"
|
||||
desc = "A blender jug, part of a blender."
|
||||
icon = 'icons/obj/kitchen.dmi'
|
||||
icon_state = "blender_jug_e"
|
||||
volume = 100
|
||||
|
||||
on_reagent_change()
|
||||
switch(src.reagents.total_volume)
|
||||
if(0)
|
||||
icon_state = "blender_jug_e"
|
||||
if(1 to 75)
|
||||
icon_state = "blender_jug_h"
|
||||
if(76 to 100)
|
||||
icon_state = "blender_jug_f"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/canister //not used apparantly
|
||||
desc = "It's a canister. Mainly used for transporting fuel."
|
||||
name = "canister"
|
||||
icon = 'icons/obj/tank.dmi'
|
||||
icon_state = "canister"
|
||||
item_state = "canister"
|
||||
m_amt = 300
|
||||
g_amt = 0
|
||||
w_class = 4.0
|
||||
|
||||
amount_per_transfer_from_this = 20
|
||||
possible_transfer_amounts = list(10,20,30,60)
|
||||
volume = 120
|
||||
flags = FPRINT
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/dispenser
|
||||
name = "reagent glass"
|
||||
desc = "A reagent glass."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "beaker0"
|
||||
amount_per_transfer_from_this = 10
|
||||
flags = FPRINT | TABLEPASS | OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/dispenser/surfactant
|
||||
name = "reagent glass (surfactant)"
|
||||
icon_state = "liquid"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("fluorosurfactant", 20)
|
||||
|
||||
*/
|
||||
|
||||
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)
|
||||
usr << "\blue [src.reagents.total_volume] units of liquid."
|
||||
else
|
||||
usr << "\blue Nothing."
|
||||
if (!is_open_container())
|
||||
usr << "\blue Airtight lid seals it completely."
|
||||
|
||||
attack_self()
|
||||
..()
|
||||
if (is_open_container())
|
||||
usr << "<span class = 'notice'>You put the lid on \the [src]."
|
||||
flags ^= OPENCONTAINER
|
||||
else
|
||||
usr << "<span class = 'notice'>You take the lid off \the [src]."
|
||||
flags |= OPENCONTAINER
|
||||
update_icon()
|
||||
|
||||
afterattack(obj/target, mob/user , flag)
|
||||
if (!is_open_container())
|
||||
return
|
||||
|
||||
for(var/type in src.can_be_placed_into)
|
||||
if(istype(target, type))
|
||||
return
|
||||
|
||||
if(ismob(target) && target.reagents && reagents.total_volume)
|
||||
user << "\blue You splash the solution onto [target]."
|
||||
|
||||
var/mob/living/M = target
|
||||
var/list/injected = list()
|
||||
for(var/datum/reagent/R in src.reagents.reagent_list)
|
||||
injected += R.name
|
||||
var/contained = english_list(injected)
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been splashed with [src.name] by [user.name] ([user.ckey]). Reagents: [contained]</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to splash [M.name] ([M.key]). Reagents: [contained]</font>")
|
||||
msg_admin_attack("[user.name] ([user.ckey]) splashed [M.name] ([M.key]) with [src.name]. Reagents: [contained] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
|
||||
for(var/mob/O in viewers(world.view, user))
|
||||
O.show_message(text("\red [] has been splashed with something by []!", target, user), 1)
|
||||
src.reagents.reaction(target, TOUCH)
|
||||
spawn(5) src.reagents.clear_reagents()
|
||||
return
|
||||
else if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us.
|
||||
|
||||
if(!target.reagents.total_volume && target.reagents)
|
||||
user << "\red [target] is empty."
|
||||
return
|
||||
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
user << "\red [src] is full."
|
||||
return
|
||||
|
||||
var/trans = target.reagents.trans_to(src, target:amount_per_transfer_from_this)
|
||||
user << "\blue You fill [src] with [trans] units of the contents of [target]."
|
||||
|
||||
else if(target.is_open_container() && target.reagents) //Something like a glass. Player probably wants to transfer TO it.
|
||||
if(!reagents.total_volume)
|
||||
user << "\red [src] is empty."
|
||||
return
|
||||
|
||||
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
||||
user << "\red [target] is full."
|
||||
return
|
||||
|
||||
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
user << "\blue You transfer [trans] units of the solution to [target]."
|
||||
|
||||
//Safety for dumping stuff into a ninja suit. It handles everything through attackby() and this is unnecessary.
|
||||
else if(istype(target, /obj/item/clothing/suit/space/space_ninja))
|
||||
return
|
||||
|
||||
else if(istype(target, /obj/machinery/bunsen_burner))
|
||||
return
|
||||
|
||||
else if(istype(target, /obj/machinery/anomaly))
|
||||
return
|
||||
|
||||
else if(reagents.total_volume)
|
||||
user << "\blue You splash the solution onto [target]."
|
||||
src.reagents.reaction(target, TOUCH)
|
||||
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."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "beaker"
|
||||
item_state = "beaker"
|
||||
m_amt = 0
|
||||
g_amt = 500
|
||||
|
||||
on_reagent_change()
|
||||
update_icon()
|
||||
|
||||
pickup(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
dropped(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
attack_hand()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
update_icon()
|
||||
overlays.Cut()
|
||||
|
||||
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.icon += mix_color_from_reagents(reagents.reagent_list)
|
||||
overlays += filling
|
||||
|
||||
if (!is_open_container())
|
||||
var/image/lid = image(icon, src, "lid_[initial(icon_state)]")
|
||||
overlays += lid
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/large
|
||||
name = "large beaker"
|
||||
desc = "A large beaker. Can hold up to 100 units."
|
||||
icon_state = "beakerlarge"
|
||||
g_amt = 5000
|
||||
volume = 100
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,50,100)
|
||||
flags = FPRINT | TABLEPASS | OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/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"
|
||||
g_amt = 500
|
||||
volume = 50
|
||||
amount_per_transfer_from_this = 10
|
||||
flags = FPRINT | TABLEPASS | OPENCONTAINER | NOREACT
|
||||
|
||||
/obj/item/weapon/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."
|
||||
icon_state = "beakerbluespace"
|
||||
g_amt = 5000
|
||||
volume = 300
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,50,100,300)
|
||||
flags = FPRINT | TABLEPASS | OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/vial
|
||||
name = "vial"
|
||||
desc = "A small glass vial. Can hold up to 25 units."
|
||||
icon_state = "vial"
|
||||
g_amt = 250
|
||||
volume = 25
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25)
|
||||
flags = FPRINT | TABLEPASS | OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/cryoxadone
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("cryoxadone", 30)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/sulphuric
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("sacid", 50)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/slime
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("slimejelly", 50)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bucket
|
||||
desc = "It's a bucket."
|
||||
name = "bucket"
|
||||
icon = 'icons/obj/janitor.dmi'
|
||||
icon_state = "bucket"
|
||||
item_state = "bucket"
|
||||
m_amt = 200
|
||||
g_amt = 0
|
||||
w_class = 3.0
|
||||
amount_per_transfer_from_this = 20
|
||||
possible_transfer_amounts = list(10,20,30,50,70)
|
||||
volume = 70
|
||||
flags = FPRINT | OPENCONTAINER
|
||||
|
||||
attackby(var/obj/D, mob/user as mob)
|
||||
if(isprox(D))
|
||||
user << "You add [D] to [src]."
|
||||
del(D)
|
||||
user.put_in_hands(new /obj/item/weapon/bucket_sensor)
|
||||
user.drop_from_inventory(src)
|
||||
del(src)
|
||||
|
||||
// vials are defined twice, what?
|
||||
/*
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/vial
|
||||
name = "vial"
|
||||
desc = "Small glass vial. Looks fragile."
|
||||
icon_state = "vial"
|
||||
g_amt = 500
|
||||
volume = 15
|
||||
amount_per_transfer_from_this = 5
|
||||
possible_transfer_amounts = list(1,5,15)
|
||||
flags = FPRINT | TABLEPASS | OPENCONTAINER */
|
||||
|
||||
/*
|
||||
/obj/item/weapon/reagent_containers/glass/blender_jug
|
||||
name = "Blender Jug"
|
||||
desc = "A blender jug, part of a blender."
|
||||
icon = 'icons/obj/kitchen.dmi'
|
||||
icon_state = "blender_jug_e"
|
||||
volume = 100
|
||||
|
||||
on_reagent_change()
|
||||
switch(src.reagents.total_volume)
|
||||
if(0)
|
||||
icon_state = "blender_jug_e"
|
||||
if(1 to 75)
|
||||
icon_state = "blender_jug_h"
|
||||
if(76 to 100)
|
||||
icon_state = "blender_jug_f"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/canister //not used apparantly
|
||||
desc = "It's a canister. Mainly used for transporting fuel."
|
||||
name = "canister"
|
||||
icon = 'icons/obj/tank.dmi'
|
||||
icon_state = "canister"
|
||||
item_state = "canister"
|
||||
m_amt = 300
|
||||
g_amt = 0
|
||||
w_class = 4.0
|
||||
|
||||
amount_per_transfer_from_this = 20
|
||||
possible_transfer_amounts = list(10,20,30,60)
|
||||
volume = 120
|
||||
flags = FPRINT
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/dispenser
|
||||
name = "reagent glass"
|
||||
desc = "A reagent glass."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "beaker0"
|
||||
amount_per_transfer_from_this = 10
|
||||
flags = FPRINT | TABLEPASS | OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/dispenser/surfactant
|
||||
name = "reagent glass (surfactant)"
|
||||
icon_state = "liquid"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("fluorosurfactant", 20)
|
||||
|
||||
*/
|
||||
|
||||
@@ -1340,6 +1340,28 @@ datum/design/nanopaste
|
||||
build_type = PROTOLATHE
|
||||
materials = list("$metal" = 7000, "$glass" = 7000)
|
||||
build_path = "/obj/item/stack/nanopaste"
|
||||
|
||||
datum/design/bluespacebeaker
|
||||
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."
|
||||
id = "bluespacebeaker"
|
||||
req_tech = list("bluespace" = 2, "materials" = 6)
|
||||
build_type = PROTOLATHE
|
||||
materials = list("$metal" = 3000, "$plasma" = 3000, "$diamond" = 500)
|
||||
reliability_base = 76
|
||||
build_path = "/obj/item/weapon/reagent_containers/glass/beaker/bluespace"
|
||||
category = "Misc"
|
||||
|
||||
datum/design/noreactbeaker
|
||||
name = "cryostasis beaker"
|
||||
desc = "A cryostasis beaker that allows for chemical storage without reactions. Can hold up to 50 units."
|
||||
id = "splitbeaker"
|
||||
req_tech = list("materials" = 2)
|
||||
build_type = PROTOLATHE
|
||||
materials = list("$metal" = 3000)
|
||||
reliability_base = 76
|
||||
build_path = "/obj/item/weapon/reagent_containers/glass/beaker/noreact"
|
||||
category = "Misc"
|
||||
/////////////////////////////////////////
|
||||
/////////////////Weapons/////////////////
|
||||
/////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user