Merge branch 'master' into spike-loot-differentces

This commit is contained in:
Trilbyspaceclone
2020-08-12 15:10:37 -04:00
committed by GitHub
760 changed files with 27169 additions and 10617 deletions
@@ -177,11 +177,10 @@
beaker = null
update_icon()
/obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
/obj/machinery/chem_dispenser/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, ui_key, "ChemDispenser", name, 565, 550, master_ui, state)
ui = new(user, src, "ChemDispenser", name)
if(user.hallucinating())
ui.set_autoupdate(FALSE) //to not ruin the immersion by constantly changing the fake chemicals
ui.open()
@@ -216,7 +215,7 @@
data["beakerTransferAmounts"] = null
data["beakerCurrentpH"] = null
var/list/chemicals = list()
var/chemicals[0]
var/is_hallucinating = FALSE
if(user.hallucinating())
is_hallucinating = TRUE
@@ -275,7 +274,7 @@
. = TRUE
if("eject")
replace_beaker(usr)
. = TRUE //no afterattack
. = TRUE
if("dispense_recipe")
if(!is_operational() || QDELETED(cell))
return
@@ -326,9 +325,9 @@
for(var/reagent in recording_recipe)
var/reagent_id = GLOB.name2reagent[translate_legacy_chem_id(reagent)]
if(!dispensable_reagents.Find(reagent_id))
visible_message("<span class='warning'>[src] buzzes.</span>", "<span class='italics'>You hear a faint buzz.</span>")
visible_message("<span class='warning'>[src] buzzes.</span>", "<span class='hear'>You hear a faint buzz.</span>")
to_chat(usr, "<span class ='danger'>[src] cannot find <b>[reagent]</b>!</span>")
playsound(src, 'sound/machines/buzz-two.ogg', 50, 1)
playsound(src, 'sound/machines/buzz-two.ogg', 50, TRUE)
return
saved_recipes[name] = recording_recipe
recording_recipe = null
@@ -7,6 +7,7 @@
idle_power_usage = 40
resistance_flags = FIRE_PROOF | ACID_PROOF
circuit = /obj/item/circuitboard/machine/chem_heater
var/obj/item/reagent_containers/beaker = null
var/target_temperature = 300
var/heater_coefficient = 0.1
@@ -30,22 +31,20 @@
/obj/machinery/chem_heater/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
if(!can_interact(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
replace_beaker(user)
return TRUE
/obj/machinery/chem_heater/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
if(!user)
return FALSE
if(beaker)
beaker.forceMove(drop_location())
if(user && Adjacent(user) && user.can_hold_items())
user.put_in_hands(beaker)
user.put_in_hands(beaker)
beaker = null
if(new_beaker)
beaker = new_beaker
else
beaker = null
update_icon()
return TRUE
update_icon()
return TRUE
/obj/machinery/chem_heater/RefreshParts()
heater_coefficient = 0.1
@@ -63,6 +62,7 @@
return
if(on)
if(beaker && beaker.reagents.total_volume)
//keep constant with the chemical acclimator please
beaker.reagents.adjust_thermal_energy((target_temperature - beaker.reagents.chem_temp) * heater_coefficient * SPECIFIC_HEAT_DEFAULT * beaker.reagents.total_volume)
beaker.reagents.handle_reactions()
@@ -83,27 +83,16 @@
updateUsrDialog()
update_icon()
return
if(beaker)
if(istype(I, /obj/item/reagent_containers/dropper))
var/obj/item/reagent_containers/dropper/D = I
D.afterattack(beaker, user, 1)
if(istype(I, /obj/item/reagent_containers/syringe))
var/obj/item/reagent_containers/syringe/S = I
S.afterattack(beaker, user, 1)
return ..()
/obj/machinery/chem_heater/on_deconstruction()
replace_beaker()
return ..()
/obj/machinery/chem_heater/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
/obj/machinery/chem_heater/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, ui_key, "ChemHeater", name, 300, 400, master_ui, state)
ui = new(user, src, "ChemHeater", name)
ui.open()
/obj/machinery/chem_heater/ui_data()
@@ -140,14 +129,7 @@
. = TRUE
if("temperature")
var/target = params["target"]
var/adjust = text2num(params["adjust"])
if(target == "input")
target = input("New target temperature:", name, target_temperature) as num|null
if(!isnull(target) && !..())
. = TRUE
else if(adjust)
target = target_temperature + adjust
else if(text2num(target) != null)
if(text2num(target) != null)
target = text2num(target)
. = TRUE
if(.)
@@ -12,6 +12,7 @@
idle_power_usage = 20
resistance_flags = FIRE_PROOF | ACID_PROOF
circuit = /obj/item/circuitboard/machine/chem_master
var/obj/item/reagent_containers/beaker = null
var/obj/item/storage/pill_bottle/bottle = null
var/mode = 1
@@ -154,19 +155,15 @@
bottle?.forceMove(A)
return ..()
//Insert our custom spritesheet css link into the html
/obj/machinery/chem_master/ui_base_html(html)
var/datum/asset/spritesheet/assets = get_asset_datum(/datum/asset/spritesheet/simple/pills)
. = replacetext(html, "<!--customheadhtml-->", assets.css_tag())
/obj/machinery/chem_master/ui_assets(mob/user)
return list(
get_asset_datum(/datum/asset/spritesheet/simple/pills),
)
/obj/machinery/chem_master/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
/obj/machinery/chem_master/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
var/datum/asset/assets = get_asset_datum(/datum/asset/spritesheet/simple/pills)
assets.send(user)
ui = new(user, src, ui_key, "ChemMaster", name, 520, 550, master_ui, state)
ui = new(user, src, "ChemMaster", name)
ui.open()
/obj/machinery/chem_master/ui_data(mob/user)
@@ -183,8 +180,8 @@
data["isPillBottleLoaded"] = bottle ? 1 : 0
if(bottle)
var/datum/component/storage/STRB = bottle.GetComponent(/datum/component/storage)
data["pillBotContent"] = bottle.contents.len
data["pillBotMaxContent"] = STRB.max_items
data["pillBottleCurrentAmount"] = bottle.contents.len
data["pillBottleMaxAmount"] = STRB.max_items
var/beakerContents[0]
if(beaker)
@@ -206,213 +203,219 @@
if(..())
return
switch(action)
if("eject")
replace_beaker(usr)
. = TRUE
if(action == "eject")
replace_beaker(usr)
return TRUE
if("ejectPillBottle")
replace_pillbottle(usr)
. = TRUE
if("transfer")
if(!beaker)
return FALSE
var/reagent = GLOB.name2reagent[params["id"]]
var/amount = text2num(params["amount"])
var/to_container = params["to"]
// Custom amount
if (amount == -1)
amount = text2num(input(
"Enter the amount you want to transfer:",
name, ""))
if (amount == null || amount <= 0)
return FALSE
if (to_container == "buffer")
end_fermi_reaction()
beaker.reagents.trans_id_to(src, reagent, amount)
return TRUE
if (to_container == "beaker" && mode)
end_fermi_reaction()
reagents.trans_id_to(beaker, reagent, amount)
return TRUE
if (to_container == "beaker" && !mode)
end_fermi_reaction()
reagents.remove_reagent(reagent, amount)
return TRUE
if(action == "ejectPillBottle")
if(!bottle)
return FALSE
bottle.forceMove(drop_location())
adjust_item_drop_location(bottle)
bottle = null
return TRUE
if("toggleMode")
mode = !mode
. = TRUE
if(action == "transfer")
if(!beaker)
return FALSE
var/reagent = GLOB.name2reagent[params["id"]]
var/amount = text2num(params["amount"])
var/to_container = params["to"]
// Custom amount
if (amount == -1)
amount = text2num(input(
"Enter the amount you want to transfer:",
name, ""))
if (amount == null || amount <= 0)
return FALSE
if (to_container == "buffer")
end_fermi_reaction()
beaker.reagents.trans_id_to(src, reagent, amount)
return TRUE
if (to_container == "beaker" && mode)
end_fermi_reaction()
reagents.trans_id_to(beaker, reagent, amount)
return TRUE
if (to_container == "beaker" && !mode)
end_fermi_reaction()
reagents.remove_reagent(reagent, amount)
return TRUE
return FALSE
if("pillStyle")
var/id = text2num(params["id"])
chosenPillStyle = id
if(action == "toggleMode")
mode = !mode
return TRUE
if(action == "pillStyle")
var/id = text2num(params["id"])
chosenPillStyle = id
return TRUE
if(action == "create")
if(reagents.total_volume == 0)
return FALSE
var/item_type = params["type"]
// Get amount of items
var/amount = text2num(params["amount"])
if(amount == null)
amount = text2num(input(usr,
"Max 10. Buffer content will be split evenly.",
"How many to make?", 1))
amount = clamp(round(amount), 0, 10)
if (amount <= 0)
return FALSE
// Get units per item
var/vol_each = text2num(params["volume"])
var/vol_each_text = params["volume"]
var/vol_each_max = reagents.total_volume / amount
if (item_type == "pill")
vol_each_max = min(50, vol_each_max)
else if (item_type == "patch")
vol_each_max = min(40, vol_each_max)
else if (item_type == "bottle")
vol_each_max = min(30, vol_each_max)
else if (item_type == "condimentPack")
vol_each_max = min(10, vol_each_max)
else if (item_type == "condimentBottle")
vol_each_max = min(50, vol_each_max)
else if (item_type == "hypoVial")
vol_each_max = min(60, vol_each_max)
else if (item_type == "smartDart")
vol_each_max = min(20, vol_each_max)
else
return FALSE
if(vol_each_text == "auto")
vol_each = vol_each_max
if(vol_each == null)
vol_each = text2num(input(usr,
"Maximum [vol_each_max] units per item.",
"How many units to fill?",
vol_each_max))
vol_each = clamp(vol_each, 0, vol_each_max)
if(vol_each <= 0)
return FALSE
// Get item name
var/name = params["name"]
var/name_has_units = item_type == "pill" || item_type == "patch"
if(!name)
var/name_default = reagents.get_master_reagent_name()
if (name_has_units)
name_default += " ([vol_each]u)"
name = stripped_input(usr,
"Name:",
"Give it a name!",
name_default,
MAX_NAME_LEN)
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !issilicon(usr)))
return FALSE
// Start filling
if(item_type == "pill")
var/obj/item/reagent_containers/pill/P
var/target_loc = drop_location()
var/drop_threshold = INFINITY
if(bottle)
var/datum/component/storage/STRB = bottle.GetComponent(
/datum/component/storage)
if(STRB)
drop_threshold = STRB.max_items - bottle.contents.len
for(var/i = 0; i < amount; i++)
if(i < drop_threshold)
P = new/obj/item/reagent_containers/pill(target_loc)
else
P = new/obj/item/reagent_containers/pill(drop_location())
P.name = trim("[name] pill")
if(chosenPillStyle == RANDOM_PILL_STYLE)
P.icon_state ="pill[rand(1,21)]"
else
P.icon_state = "pill[chosenPillStyle]"
if(P.icon_state == "pill4")
P.desc = "A tablet or capsule, but not just any, a red one, one taken by the ones not scared of knowledge, freedom, uncertainty and the brutal truths of reality."
adjust_item_drop_location(P)
reagents.trans_to(P, vol_each)//, transfered_by = usr)
return TRUE
if(item_type == "patch")
var/obj/item/reagent_containers/pill/patch/P
for(var/i = 0; i < amount; i++)
P = new/obj/item/reagent_containers/pill/patch(drop_location())
P.name = trim("[name] patch")
adjust_item_drop_location(P)
reagents.trans_to(P, vol_each)//, transfered_by = usr)
return TRUE
if(item_type == "bottle")
var/obj/item/reagent_containers/glass/bottle/P
for(var/i = 0; i < amount; i++)
P = new/obj/item/reagent_containers/glass/bottle(drop_location())
P.name = trim("[name] bottle")
adjust_item_drop_location(P)
reagents.trans_to(P, vol_each)//, transfered_by = usr)
return TRUE
if(item_type == "condimentPack")
var/obj/item/reagent_containers/food/condiment/pack/P
for(var/i = 0; i < amount; i++)
P = new/obj/item/reagent_containers/food/condiment/pack(drop_location())
P.originalname = name
P.name = trim("[name] pack")
P.desc = "A small condiment pack. The label says it contains [name]."
reagents.trans_to(P, vol_each)//, transfered_by = usr)
return TRUE
if(item_type == "condimentBottle")
var/obj/item/reagent_containers/food/condiment/P
for(var/i = 0; i < amount; i++)
P = new/obj/item/reagent_containers/food/condiment(drop_location())
P.originalname = name
P.name = trim("[name] bottle")
reagents.trans_to(P, vol_each)//, transfered_by = usr)
return TRUE
if(item_type == "hypoVial")
var/obj/item/reagent_containers/glass/bottle/vial/small/P
for(var/i = 0; i < amount; i++)
P = new/obj/item/reagent_containers/glass/bottle/vial/small(drop_location())
P.name = trim("[name] hypovial")
adjust_item_drop_location(P)
reagents.trans_to(P, vol_each)//, transfered_by = usr)
return TRUE
if(item_type == "smartDart")
var/obj/item/reagent_containers/syringe/dart/P
for(var/i = 0; i < amount; i++)
P = new /obj/item/reagent_containers/syringe/dart(drop_location())
P.name = trim("[name] SmartDart")
adjust_item_drop_location(P)
reagents.trans_to(P, vol_each)//, transfered_by = usr)
P.mode=!mode
P.update_icon()
return TRUE
return FALSE
if(action == "analyze")
// var/datum/reagent/R = GLOB.name2reagent[params["id"]]
var/reagent = GLOB.name2reagent[params["id"]]
var/datum/reagent/R = GLOB.chemical_reagents_list[reagent]
if(R)
var/state = "Unknown"
if(initial(R.reagent_state) == 1)
state = "Solid"
else if(initial(R.reagent_state) == 2)
state = "Liquid"
else if(initial(R.reagent_state) == 3)
state = "Gas"
var/const/P = 3 //The number of seconds between life ticks
var/T = initial(R.metabolization_rate) * (60 / P)
if(istype(R, /datum/reagent/fermi))
fermianalyze = TRUE
var/datum/chemical_reaction/Rcr = get_chemical_reaction(reagent)
var/pHpeakCache = (Rcr.OptimalpHMin + Rcr.OptimalpHMax)/2
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "purityF" = R.purity, "inverseRatioF" = initial(R.inverse_chem_val), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache)
else
fermianalyze = FALSE
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold))
screen = "analyze"
return TRUE
if("create")
if(reagents.total_volume == 0)
return FALSE
var/item_type = params["type"]
// Get amount of items
var/amount = text2num(params["amount"])
if(amount == null)
amount = text2num(input(usr,
"Max 20. Buffer content will be split evenly.",
"How many to make?", 1))
amount = clamp(round(amount), 0, 20)
if (amount <= 0)
return FALSE
// Get units per item
var/vol_each = text2num(params["volume"])
var/vol_each_text = params["volume"]
var/vol_each_max = reagents.total_volume / amount
if (item_type == "pill")
vol_each_max = min(50, vol_each_max)
else if (item_type == "patch")
vol_each_max = min(40, vol_each_max)
else if (item_type == "bottle")
vol_each_max = min(30, vol_each_max)
else if (item_type == "condimentPack")
vol_each_max = min(10, vol_each_max)
else if (item_type == "condimentBottle")
vol_each_max = min(50, vol_each_max)
else if (item_type == "hypoVial")
vol_each_max = min(60, vol_each_max)
else if (item_type == "smartDart")
vol_each_max = min(20, vol_each_max)
else
return FALSE
if(vol_each_text == "auto")
vol_each = vol_each_max
if(vol_each == null)
vol_each = text2num(input(usr,
"Maximum [vol_each_max] units per item.",
"How many units to fill?",
vol_each_max))
vol_each = clamp(vol_each, 0, vol_each_max)
if(vol_each <= 0)
return FALSE
// Get item name
var/name = params["name"]
var/name_has_units = item_type == "pill" || item_type == "patch"
if(!name)
var/name_default = reagents.get_master_reagent_name()
if (name_has_units)
name_default += " ([vol_each]u)"
name = stripped_input(usr,
"Name:",
"Give it a name!",
name_default,
MAX_NAME_LEN)
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !issilicon(usr)))
return FALSE
// Start filling
if(item_type == "pill")
var/obj/item/reagent_containers/pill/P
var/target_loc = drop_location()
var/drop_threshold = INFINITY
if(bottle)
var/datum/component/storage/STRB = bottle.GetComponent(
/datum/component/storage)
if(STRB)
drop_threshold = STRB.max_items - bottle.contents.len
for(var/i = 0; i < amount; i++)
if(i < drop_threshold)
P = new/obj/item/reagent_containers/pill(target_loc)
else
P = new/obj/item/reagent_containers/pill(drop_location())
P.name = trim("[name] pill")
if(chosenPillStyle == RANDOM_PILL_STYLE)
P.icon_state ="pill[rand(1,21)]"
else
P.icon_state = "pill[chosenPillStyle]"
if(P.icon_state == "pill4")
P.desc = "A tablet or capsule, but not just any, a red one, one taken by the ones not scared of knowledge, freedom, uncertainty and the brutal truths of reality."
adjust_item_drop_location(P)
reagents.trans_to(P, vol_each)
return TRUE
if(item_type == "patch")
var/obj/item/reagent_containers/pill/patch/P
for(var/i = 0; i < amount; i++)
P = new/obj/item/reagent_containers/pill/patch(drop_location())
P.name = trim("[name] patch")
adjust_item_drop_location(P)
reagents.trans_to(P, vol_each)
return TRUE
if(item_type == "bottle")
var/obj/item/reagent_containers/glass/bottle/P
for(var/i = 0; i < amount; i++)
P = new/obj/item/reagent_containers/glass/bottle(drop_location())
P.name = trim("[name] bottle")
adjust_item_drop_location(P)
reagents.trans_to(P, vol_each)
return TRUE
if(item_type == "condimentPack")
var/obj/item/reagent_containers/food/condiment/pack/P
for(var/i = 0; i < amount; i++)
P = new/obj/item/reagent_containers/food/condiment/pack(drop_location())
P.originalname = name
P.name = trim("[name] pack")
P.desc = "A small condiment pack. The label says it contains [name]."
reagents.trans_to(P, vol_each)
return TRUE
if(item_type == "condimentBottle")
var/obj/item/reagent_containers/food/condiment/P
for(var/i = 0; i < amount; i++)
P = new/obj/item/reagent_containers/food/condiment(drop_location())
P.originalname = name
P.name = trim("[name] bottle")
reagents.trans_to(P, vol_each)
return TRUE
if(item_type == "hypoVial")
var/obj/item/reagent_containers/glass/bottle/vial/small/P
for(var/i = 0; i < amount; i++)
P = new/obj/item/reagent_containers/glass/bottle/vial/small(drop_location())
P.name = trim("[name] hypovial")
adjust_item_drop_location(P)
reagents.trans_to(P, vol_each)
return TRUE
if(item_type == "smartDart")
var/obj/item/reagent_containers/syringe/dart/P
for(var/i = 0; i < amount; i++)
P = new /obj/item/reagent_containers/syringe/dart(drop_location())
P.name = trim("[name] SmartDart")
adjust_item_drop_location(P)
reagents.trans_to(P, vol_each)
P.mode=!mode
P.update_icon()
return TRUE
return FALSE
if(action == "goScreen")
screen = params["screen"]
return TRUE
if("analyze")
var/reagent = GLOB.name2reagent[params["id"]]
var/datum/reagent/R = GLOB.chemical_reagents_list[reagent]
if(R)
var/state = "Unknown"
if(initial(R.reagent_state) == 1)
state = "Solid"
else if(initial(R.reagent_state) == 2)
state = "Liquid"
else if(initial(R.reagent_state) == 3)
state = "Gas"
var/const/P = 3 //The number of seconds between life ticks
var/T = initial(R.metabolization_rate) * (60 / P)
if(istype(R, /datum/reagent/fermi))
fermianalyze = TRUE
var/datum/chemical_reaction/Rcr = get_chemical_reaction(reagent)
var/pHpeakCache = (Rcr.OptimalpHMin + Rcr.OptimalpHMax)/2
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "purityF" = R.purity, "inverseRatioF" = initial(R.inverse_chem_val), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache)
else
fermianalyze = FALSE
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold))
screen = "analyze"
return TRUE
if("goScreen")
screen = params["screen"]
. = TRUE
return FALSE
@@ -12,11 +12,10 @@
"tricord" = /datum/reagent/medicine/tricordrazine
)
/obj/machinery/chem_dispenser/chem_synthesizer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
/obj/machinery/chem_dispenser/chem_synthesizer/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, ui_key, "ChemDebugSynthesizer", name, 390, 330, master_ui, state)
ui = new(user, src, "ChemDebugSynthesizer", name)
ui.open()
/obj/machinery/chem_dispenser/chem_synthesizer/ui_act(action, params)
@@ -31,7 +30,11 @@
beaker = null
. = TRUE
if("input")
var/input_reagent = replacetext(lowertext(input("Enter the name of any reagent", "Input") as text), " ", "") //95% of the time, the reagent types is a lowercase, no spaces / underscored version of the name
var/input_reagent = replacetext(lowertext(input("Enter the name of any reagent", "Input") as text|null), " ", "") //95% of the time, the reagent id is a lowercase/no spaces version of the name
if (isnull(input_reagent))
return
if(shortcuts[input_reagent])
input_reagent = shortcuts[input_reagent]
else
@@ -51,7 +54,7 @@
beaker = new /obj/item/reagent_containers/glass/beaker/bluespace(src)
visible_message("<span class='notice'>[src] dispenses a bluespace beaker.</span>")
if("amount")
var/input = input("Units to dispense", "Units") as num|null
var/input = text2num(params["amount"])
if(input)
amount = input
update_icon()
@@ -7,10 +7,11 @@
density = TRUE
icon = 'icons/obj/chemical.dmi'
icon_state = "mixer0"
circuit = /obj/item/circuitboard/computer/pandemic
use_power = TRUE
idle_power_usage = 20
resistance_flags = ACID_PROOF
circuit = /obj/item/circuitboard/computer/pandemic
var/wait
var/datum/symptom/selected_symptom
var/obj/item/reagent_containers/beaker
@@ -23,11 +24,27 @@
QDEL_NULL(beaker)
return ..()
/obj/machinery/computer/pandemic/handle_atom_del(atom/A)
/obj/machinery/computer/pandemic/examine(mob/user)
. = ..()
if(beaker)
var/is_close
if(Adjacent(user)) //don't reveal exactly what's inside unless they're close enough to see the UI anyway.
. += "It contains \a [beaker]."
is_close = TRUE
else
. += "It has a beaker inside it."
. += "<span class='info'>Alt-click to eject [is_close ? beaker : "the beaker"].</span>"
/obj/machinery/computer/pandemic/AltClick(mob/user)
. = ..()
if(user.canUseTopic(src, BE_CLOSE))
eject_beaker()
/obj/machinery/computer/pandemic/handle_atom_del(atom/A)
if(A == beaker)
beaker = null
update_icon()
return ..()
/obj/machinery/computer/pandemic/proc/get_by_index(thing, index)
if(!beaker || !beaker.reagents)
@@ -107,7 +124,7 @@
/obj/machinery/computer/pandemic/proc/reset_replicator_cooldown()
wait = FALSE
update_icon()
playsound(loc, 'sound/machines/ping.ogg', 30, 1)
playsound(src, 'sound/machines/ping.ogg', 30, TRUE)
/obj/machinery/computer/pandemic/update_icon_state()
if(stat & BROKEN)
@@ -117,13 +134,19 @@
/obj/machinery/computer/pandemic/update_overlays()
. = ..()
if(!(stat & BROKEN) && wait)
if(wait)
. += "waitlight"
/obj/machinery/computer/pandemic/ui_interact(mob/user, ui_key = "main", datum/tgui/ui, force_open = FALSE, datum/tgui/master_ui, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
/obj/machinery/computer/pandemic/proc/eject_beaker()
if(beaker)
beaker.forceMove(drop_location())
beaker = null
update_icon()
/obj/machinery/computer/pandemic/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, ui_key, "Pandemic", name, 520, 550, master_ui, state)
ui = new(user, src, "Pandemic", name)
ui.open()
/obj/machinery/computer/pandemic/ui_data(mob/user)
@@ -135,9 +158,9 @@
var/datum/reagent/blood/B = locate() in beaker.reagents.reagent_list
if(B)
data["has_blood"] = TRUE
data[/datum/reagent/blood] = list()
data[/datum/reagent/blood]["dna"] = B.data["blood_DNA"] || "none"
data[/datum/reagent/blood]["type"] = B.data["blood_type"] || "none"
data["blood"] = list() //wha why the fuck are we sending pathtypes to tgui frontend?
data["blood"]["dna"] = B.data["blood_DNA"] || "none"
data["blood"]["type"] = B.data["blood_type"] || "none"
data["viruses"] = get_viruses_data(B)
data["resistances"] = get_resistance_data(B)
else
@@ -153,7 +176,7 @@
return
switch(action)
if("eject_beaker")
replace_beaker(usr)
eject_beaker()
. = TRUE
if("empty_beaker")
if(beaker)
@@ -162,7 +185,7 @@
if("empty_eject_beaker")
if(beaker)
beaker.reagents.clear_reagents()
replace_beaker(usr)
eject_beaker()
. = TRUE
if("rename_disease")
var/id = get_virus_id_by_index(text2num(params["index"]))
@@ -170,75 +193,62 @@
if(!A.mutable)
return
if(A)
var/new_name = sanitize_name(html_encode(trim(params["name"], 50)))
var/new_name = sanitize_name(html_encode(trim(params["name"], 50)))//, allow_numbers = TRUE)
if(!new_name || ..())
return
A.AssignName(new_name)
. = TRUE
if("create_culture_bottle")
if (wait)
return
var/id = get_virus_id_by_index(text2num(params["index"]))
var/datum/disease/advance/A = SSdisease.archive_diseases[id]
if(!istype(A) || !A.mutable)
to_chat(usr, "<span class='warning'>ERROR: Cannot replicate virus strain.</span>")
return
wait = TRUE
addtimer(CALLBACK(src, .proc/reset_replicator_cooldown), 50)
A = A.Copy()
var/list/data = list("blood_DNA" = "UNKNOWN DNA", "blood_type" = "SY", "viruses" = list(A))
var/list/data = list("viruses" = list(A))
var/obj/item/reagent_containers/glass/bottle/B = new(drop_location())
B.name = "[A.name] culture bottle"
B.desc = "A small bottle. Contains [A.agent] culture in synthblood medium."
B.reagents.add_reagent(/datum/reagent/blood/synthetics, 10, data)
wait = TRUE
update_icon()
var/turf/source_turf = get_turf(src)
log_virus("A culture bottle was printed for the virus [A.admin_details()] at [loc_name(source_turf)] by [key_name(usr)]")
addtimer(CALLBACK(src, .proc/reset_replicator_cooldown), 50)
. = TRUE
if("create_vaccine_bottle")
wait = TRUE
addtimer(CALLBACK(src, .proc/reset_replicator_cooldown), 400)
if (wait)
return
var/id = params["index"]
var/datum/disease/D = SSdisease.archive_diseases[id]
var/obj/item/reagent_containers/glass/bottle/B = new(drop_location())
B.name = "[D.name] vaccine bottle"
B.reagents.add_reagent(/datum/reagent/vaccine, 15, list(id))
wait = TRUE
update_icon()
addtimer(CALLBACK(src, .proc/reset_replicator_cooldown), 200)
. = TRUE
/obj/machinery/computer/pandemic/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
. = TRUE //no afterattack
if(stat & (NOPOWER|BROKEN))
return
var/obj/item/reagent_containers/B = I
if(!user.transferItemToLoc(B, src))
if(beaker)
to_chat(user, "<span class='warning'>A container is already loaded into [src]!</span>")
return
replace_beaker(user, B)
if(!user.transferItemToLoc(I, src))
return
beaker = I
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
update_icon()
else
return ..()
/obj/machinery/computer/pandemic/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
replace_beaker(user)
return TRUE
/obj/machinery/computer/pandemic/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
if(beaker)
if(user && Adjacent(user) && user.can_hold_items())
if(!user.put_in_hands(beaker))
beaker.forceMove(drop_location())
if(new_beaker)
beaker = new_beaker
else
beaker = null
update_icon()
return TRUE
/obj/machinery/computer/pandemic/on_deconstruction()
replace_beaker(usr)
eject_beaker()
. = ..()
@@ -7,6 +7,7 @@
icon_state = "smoke0"
density = TRUE
circuit = /obj/item/circuitboard/machine/smoke_machine
var/efficiency = 10
var/on = FALSE
var/cooldown = 0
@@ -31,6 +32,7 @@
/obj/machinery/smoke_machine/Initialize()
. = ..()
create_reagents(REAGENTS_BASE_VOLUME)
// AddComponent(/datum/component/plumbing/simple_demand)
for(var/obj/item/stock_parts/matter_bin/B in component_parts)
reagents.maximum_volume += REAGENTS_BASE_VOLUME * B.rating
@@ -81,10 +83,9 @@
add_fingerprint(user)
if(istype(I, /obj/item/reagent_containers) && I.is_open_container())
var/obj/item/reagent_containers/RC = I
var/units = RC.reagents.trans_to(src, RC.amount_per_transfer_from_this)
var/units = RC.reagents.trans_to(src, RC.amount_per_transfer_from_this) //, transfered_by = user)
if(units)
to_chat(user, "<span class='notice'>You transfer [units] units of the solution to [src].</span>")
log_combat(usr, src, "has added [english_list(RC.reagents.reagent_list)] to [src]")
return
if(default_unfasten_wrench(user, I, 40))
on = FALSE
@@ -100,11 +101,10 @@
reagents.clear_reagents()
return ..()
/obj/machinery/smoke_machine/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
/obj/machinery/smoke_machine/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, ui_key, "SmokeMachine", name, 350, 350, master_ui, state)
ui = new(user, src, "SmokeMachine", name)
ui.open()
/obj/machinery/smoke_machine/ui_data(mob/user)
@@ -1044,12 +1044,6 @@
M.emote("nya")
if(prob(20))
to_chat(M, "<span class = 'notice'>[pick("Headpats feel nice.", "Backrubs would be nice.", "Mew")]</span>")
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/list/adjusted = H.adjust_arousal(5,aphro = TRUE)
for(var/g in adjusted)
var/obj/item/organ/genital/G = g
to_chat(M, "<span class='userlove'>You feel like playing with your [G.name]!</span>")
..()
/datum/reagent/consumable/monkey_energy
@@ -559,128 +559,3 @@
var/mob/living/carbon/C = M
if(!C.undergoing_cardiac_arrest())
C.set_heartattack(TRUE)
//aphrodisiac & anaphrodisiac
/datum/reagent/drug/aphrodisiac
name = "Crocin"
description = "Naturally found in the crocus and gardenia flowers, this drug acts as a natural and safe aphrodisiac."
taste_description = "strawberries"
color = "#FFADFF"//PINK, rgb(255, 173, 255)
can_synth = FALSE
/datum/reagent/drug/aphrodisiac/on_mob_life(mob/living/M)
if(M && M.client?.prefs.arousable && !(M.client?.prefs.cit_toggles & NO_APHRO))
if((prob(min(current_cycle/2,5))))
M.emote(pick("moan","blush"))
if(prob(min(current_cycle/4,10)))
var/aroused_message = pick("You feel frisky.", "You're having trouble suppressing your urges.", "You feel in the mood.")
to_chat(M, "<span class='userlove'>[aroused_message]</span>")
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/list/genits = H.adjust_arousal(current_cycle, aphro = TRUE) // redundant but should still be here
for(var/g in genits)
var/obj/item/organ/genital/G = g
to_chat(M, "<span class='userlove'>[G.arousal_verb]!</span>")
..()
/datum/reagent/drug/aphrodisiacplus
name = "Hexacrocin"
description = "Chemically condensed form of basic crocin. This aphrodisiac is extremely powerful and addictive in most animals.\
Addiction withdrawals can cause brain damage and shortness of breath. Overdosage can lead to brain damage and a \
permanent increase in libido (commonly referred to as 'bimbofication')."
taste_description = "liquid desire"
color = "#FF2BFF"//dark pink
addiction_threshold = 20
overdose_threshold = 20
can_synth = FALSE
/datum/reagent/drug/aphrodisiacplus/on_mob_life(mob/living/M)
if(M && M.client?.prefs.arousable && !(M.client?.prefs.cit_toggles & NO_APHRO))
if(prob(5))
if(prob(current_cycle))
M.say(pick("Hnnnnngghh...", "Ohh...", "Mmnnn..."))
else
M.emote(pick("moan","blush"))
if(prob(5))
var/aroused_message
if(current_cycle>25)
aroused_message = pick("You need to fuck someone!", "You're bursting with sexual tension!", "You can't get sex off your mind!")
else
aroused_message = pick("You feel a bit hot.", "You feel strong sexual urges.", "You feel in the mood.", "You're ready to go down on someone.")
to_chat(M, "<span class='userlove'>[aroused_message]</span>")
REMOVE_TRAIT(M,TRAIT_NEVERBONER,APHRO_TRAIT)
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/list/genits = H.adjust_arousal(100, aphro = TRUE) // redundant but should still be here
for(var/g in genits)
var/obj/item/organ/genital/G = g
to_chat(M, "<span class='userlove'>[G.arousal_verb]!</span>")
..()
/datum/reagent/drug/aphrodisiacplus/addiction_act_stage2(mob/living/M)
if(prob(30))
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2)
..()
/datum/reagent/drug/aphrodisiacplus/addiction_act_stage3(mob/living/M)
if(prob(30))
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3)
..()
/datum/reagent/drug/aphrodisiacplus/addiction_act_stage4(mob/living/M)
if(prob(30))
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 4)
..()
/datum/reagent/drug/aphrodisiacplus/overdose_process(mob/living/M)
if(M && M.client?.prefs.arousable && !(M.client?.prefs.cit_toggles & NO_APHRO) && prob(33))
if(prob(5) && ishuman(M) && M.has_dna() && (M.client?.prefs.cit_toggles & BIMBOFICATION))
if(!HAS_TRAIT(M,TRAIT_PERMABONER))
to_chat(M, "<span class='userlove'>Your libido is going haywire!</span>")
ADD_TRAIT(M,TRAIT_PERMABONER,APHRO_TRAIT)
..()
/datum/reagent/drug/anaphrodisiac
name = "Camphor"
description = "Naturally found in some species of evergreen trees, camphor is a waxy substance. When injested by most animals, it acts as an anaphrodisiac\
, reducing libido and calming them. Non-habit forming and not addictive."
taste_description = "dull bitterness"
taste_mult = 2
color = "#D9D9D9"//rgb(217, 217, 217)
reagent_state = SOLID
can_synth = FALSE
/datum/reagent/drug/anaphrodisiac/on_mob_life(mob/living/M)
if(M && M.client?.prefs.arousable && prob(16))
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/list/genits = H.adjust_arousal(-100, aphro = TRUE)
if(genits.len)
to_chat(M, "<span class='notice'>You no longer feel aroused.")
..()
/datum/reagent/drug/anaphrodisiacplus
name = "Hexacamphor"
description = "Chemically condensed camphor. Causes an extreme reduction in libido and a permanent one if overdosed. Non-addictive."
taste_description = "tranquil celibacy"
color = "#D9D9D9"//rgb(217, 217, 217)
reagent_state = SOLID
overdose_threshold = 20
can_synth = FALSE
/datum/reagent/drug/anaphrodisiacplus/on_mob_life(mob/living/M)
if(M && M.client?.prefs.arousable)
REMOVE_TRAIT(M,TRAIT_PERMABONER,APHRO_TRAIT)
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/list/genits = H.adjust_arousal(-100, aphro = TRUE)
if(genits.len)
to_chat(M, "<span class='notice'>You no longer feel aroused.")
..()
/datum/reagent/drug/anaphrodisiacplus/overdose_process(mob/living/M)
if(M && M.client?.prefs.arousable && prob(5))
to_chat(M, "<span class='userlove'>You feel like you'll never feel aroused again...</span>")
ADD_TRAIT(M,TRAIT_NEVERBONER,APHRO_TRAIT)
..()
@@ -768,7 +768,6 @@
color = "#97ee63"
taste_description = "pure electricity"
/* //We don't have ethereals here, so I'll just comment it out.
/datum/reagent/consumable/liquidelectricity/reaction_mob(mob/living/M, method=TOUCH, reac_volume) //can't be on life because of the way blood works.
if((method == INGEST || method == INJECT || method == PATCH) && iscarbon(M))
@@ -776,10 +775,9 @@
var/obj/item/organ/stomach/ethereal/stomach = C.getorganslot(ORGAN_SLOT_STOMACH)
if(istype(stomach))
stomach.adjust_charge(reac_volume * REM)
*/
/datum/reagent/consumable/liquidelectricity/on_mob_life(mob/living/carbon/M)
if(prob(25)) // && !isethereal(M))
if(prob(25) && !isethereal(M))
M.electrocute_act(rand(10,15), "Liquid Electricity in their body", 1) //lmao at the newbs who eat energy bars
playsound(M, "sparks", 50, TRUE)
return ..()
@@ -2197,13 +2197,6 @@
M.emote("nya")
if(prob(20))
to_chat(M, "<span class = 'notice'>[pick("Headpats feel nice.", "The feeling of a hairball...", "Backrubs would be nice.", "Whats behind those doors?")]</span>")
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/list/adjusted = H.adjust_arousal(2,aphro = TRUE)
for(var/g in adjusted)
var/obj/item/organ/genital/G = g
to_chat(M, "<span class='userlove'>You feel like playing with your [G.name]!</span>")
..()
/datum/reagent/preservahyde
@@ -62,34 +62,3 @@
results = list(/datum/reagent/moonsugar = 1, /datum/reagent/medicine/morphine = 2.5)
required_temp = 315 //a little above normal body temperature
required_reagents = list(/datum/reagent/drug/skooma = 1)
/datum/chemical_reaction/aphro
name = "crocin"
id = /datum/reagent/drug/aphrodisiac
results = list(/datum/reagent/drug/aphrodisiac = 6)
required_reagents = list(/datum/reagent/carbon = 2, /datum/reagent/hydrogen = 2, /datum/reagent/oxygen = 2, /datum/reagent/water = 1)
required_temp = 400
mix_message = "The mixture boils off a pink vapor..."//The water boils off, leaving the crocin
/datum/chemical_reaction/aphroplus
name = "hexacrocin"
id = /datum/reagent/drug/aphrodisiacplus
results = list(/datum/reagent/drug/aphrodisiacplus = 1)
required_reagents = list(/datum/reagent/drug/aphrodisiac = 6, /datum/reagent/phenol = 1)
required_temp = 400
mix_message = "The mixture rapidly condenses and darkens in color..."
/datum/chemical_reaction/anaphro
name = "camphor"
id = /datum/reagent/drug/anaphrodisiac
results = list(/datum/reagent/drug/anaphrodisiac = 6)
required_reagents = list(/datum/reagent/carbon = 2, /datum/reagent/hydrogen = 2, /datum/reagent/oxygen = 2, /datum/reagent/sulfur = 1)
required_temp = 400
mix_message = "The mixture boils off a yellow, smelly vapor..."//Sulfur burns off, leaving the camphor
/datum/chemical_reaction/anaphroplus
name = "pentacamphor"
id = /datum/reagent/drug/anaphrodisiacplus
results = list(/datum/reagent/drug/anaphrodisiacplus = 1)
required_reagents = list(/datum/reagent/drug/aphrodisiac = 5, /datum/reagent/acetone = 1)
required_temp = 300
mix_message = "The mixture thickens and heats up slighty..."
@@ -684,10 +684,10 @@
required_reagents = list(/datum/reagent/toxin/mindbreaker = 1, /datum/reagent/medicine/synaptizine = 1, /datum/reagent/water = 1)
/datum/chemical_reaction/cat
name = "felined mutation toxic"
name = "felinid mutation toxic"
id = /datum/reagent/mutationtoxin/felinid
results = list(/datum/reagent/mutationtoxin/felinid = 1)
required_reagents = list(/datum/reagent/toxin/mindbreaker = 1, /datum/reagent/ammonia = 1, /datum/reagent/water = 1, /datum/reagent/drug/aphrodisiac = 10, /datum/reagent/mutationtoxin = 1) // Maybe aphro+ if it becomes a shitty meme
required_reagents = list(/datum/reagent/toxin/mindbreaker = 1, /datum/reagent/ammonia = 1, /datum/reagent/water = 1, /datum/reagent/pax/catnip = 1, /datum/reagent/mutationtoxin = 1)
required_temp = 450
/datum/chemical_reaction/moff
@@ -837,4 +837,4 @@
/datum/chemical_reaction/cellulose_carbonization
results = list(/datum/reagent/carbon = 1)
required_reagents = list(/datum/reagent/cellulose = 1)
required_temp = 512
required_temp = 512
@@ -432,26 +432,4 @@
/obj/item/reagent_containers/glass/bottle/ichor/green
name = "green potion"
list_reagents = list(/datum/reagent/green_ichor = 1)
//Lewd Stuff
/obj/item/reagent_containers/glass/bottle/crocin
name = "Crocin bottle"
desc = "A bottle of mild aphrodisiac. Increases libido."
list_reagents = list(/datum/reagent/drug/aphrodisiac = 30)
/obj/item/reagent_containers/glass/bottle/hexacrocin
name = "Hexacrocin bottle"
desc = "A bottle of strong aphrodisiac. Increases libido."
list_reagents = list(/datum/reagent/drug/aphrodisiacplus = 30)
/obj/item/reagent_containers/glass/bottle/camphor
name = "Camphor bottle"
desc = "A bottle of mild anaphrodisiac. Reduces libido."
list_reagents = list(/datum/reagent/drug/anaphrodisiac = 30)
/obj/item/reagent_containers/glass/bottle/hexacamphor
name = "Hexacamphor bottle"
desc = "A bottle of strong anaphrodisiac. Reduces libido."
list_reagents = list(/datum/reagent/drug/anaphrodisiacplus = 30)
list_reagents = list(/datum/reagent/green_ichor = 1)
@@ -222,19 +222,6 @@
icon_state = "orangekeg"
reagent_id = /datum/reagent/consumable/ethanol/mead
/obj/structure/reagent_dispensers/keg/aphro
name = "keg of aphrodisiac"
desc = "A keg of aphrodisiac."
icon_state = "pinkkeg"
reagent_id = /datum/reagent/drug/aphrodisiac
tank_volume = 150
/obj/structure/reagent_dispensers/keg/aphro/strong
name = "keg of strong aphrodisiac"
desc = "A keg of strong and addictive aphrodisiac."
reagent_id = /datum/reagent/drug/aphrodisiacplus
tank_volume = 120
/obj/structure/reagent_dispensers/keg/milk
name = "keg of milk"
desc = "A keg of pasteurised, homogenised, filtered and semi-skimmed space milk."