Merge pull request #6724 from Citadel-Station-13/upstream-merge-37673
[MIRROR] Runtime: fixes RTG power, adjusts pipenet, adds debug chem dispensers
This commit is contained in:
@@ -499,3 +499,17 @@ obj/machinery/chem_dispenser/proc/work_animation()
|
||||
"ammonia",
|
||||
"ash",
|
||||
"diethylamine")
|
||||
|
||||
/obj/machinery/chem_dispenser/fullupgrade //fully upgraded stock parts
|
||||
|
||||
/obj/machinery/chem_dispenser/fullupgrade/Initialize()
|
||||
. = ..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/circuitboard/machine/chem_dispenser(null)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null)
|
||||
component_parts += new /obj/item/stock_parts/capacitor/quadratic(null)
|
||||
component_parts += new /obj/item/stock_parts/manipulator/femto(null)
|
||||
component_parts += new /obj/item/stack/sheet/glass(null)
|
||||
component_parts += new /obj/item/stock_parts/cell/bluespace(null)
|
||||
RefreshParts()
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
/obj/machinery/chem_dispenser/chem_synthesizer //formerly SCP-294 made by mrty, but now only for testing purposes
|
||||
name = "\improper debug chemical synthesizer"
|
||||
desc = "If you see this, yell at adminbus."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "dispenser"
|
||||
amount = 10
|
||||
resistance_flags = INDESTRUCTIBLE | FIRE_PROOF | ACID_PROOF | LAVA_PROOF
|
||||
working_state = null
|
||||
nopower_state = null
|
||||
flags_1 = NODECONSTRUCT_1
|
||||
var/static/list/shortcuts = list(
|
||||
"meth" = "methamphetamine",
|
||||
"tricord" = "tricordrazine"
|
||||
)
|
||||
var/mutable_appearance/top_overlay
|
||||
|
||||
/obj/machinery/chem_dispenser/chem_synthesizer/Initialize()
|
||||
. = ..()
|
||||
GLOB.poi_list += src
|
||||
top_overlay = mutable_appearance(icon, "disp_beaker", layer = ABOVE_ALL_MOB_LAYER)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/chem_dispenser/chem_synthesizer/update_icon()
|
||||
cut_overlays()
|
||||
add_overlay(top_overlay)
|
||||
|
||||
/obj/machinery/chem_dispenser/chem_synthesizer/Destroy()
|
||||
. = ..()
|
||||
GLOB.poi_list -= src
|
||||
QDEL_NULL(top_overlay)
|
||||
|
||||
/obj/machinery/chem_dispenser/chem_synthesizer/display_beaker()
|
||||
return
|
||||
|
||||
/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)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "chem_synthesizer", name, 390, 315, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/chem_dispenser/chem_synthesizer/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
update_icon()
|
||||
switch(action)
|
||||
if("ejectBeaker")
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
if(Adjacent(usr) && !issilicon(usr))
|
||||
usr.put_in_hands(beaker)
|
||||
beaker = null
|
||||
. = TRUE
|
||||
if("input")
|
||||
var/input_reagent = replacetext(lowertext(input("Enter the name of any liquid", "Input") as text), " ", "") //95% of the time, the reagent id is a lowercase/no spaces version of the name
|
||||
if(shortcuts[input_reagent])
|
||||
input_reagent = shortcuts[input_reagent]
|
||||
else
|
||||
input_reagent = find_reagent(input_reagent)
|
||||
if(!input_reagent || !GLOB.chemical_reagents_list[input_reagent])
|
||||
say("OUT OF RANGE")
|
||||
return
|
||||
else
|
||||
if(!beaker)
|
||||
return
|
||||
else if(!beaker.reagents && !QDELETED(beaker))
|
||||
beaker.create_reagents(beaker.volume)
|
||||
beaker.reagents.add_reagent(input_reagent, amount)
|
||||
if("makecup")
|
||||
if(beaker)
|
||||
return
|
||||
beaker = new /obj/item/reagent_containers/glass/beaker/bluespace(src)
|
||||
visible_message("<span class='notice'>[src] dispenses a bluespace beaker.</span>")
|
||||
|
||||
/obj/machinery/chem_dispenser/chem_synthesizer/proc/find_reagent(input)
|
||||
. = FALSE
|
||||
if(GLOB.chemical_reagents_list[input]) //prefer IDs!
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[input]
|
||||
if(R.can_synth_debug)
|
||||
return input
|
||||
else
|
||||
for(var/X in GLOB.chemical_reagents_list)
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[X]
|
||||
if(R.can_synth_debug && input == replacetext(lowertext(R.name), " ", ""))
|
||||
return X
|
||||
@@ -20,7 +20,8 @@
|
||||
var/current_cycle = 0
|
||||
var/volume = 0
|
||||
var/color = "#000000" // rgb: 0, 0, 0
|
||||
var/can_synth = TRUE
|
||||
var/can_synth = TRUE // can this reagent be synthesized? (for example: odysseus syringe gun)
|
||||
var/can_synth_debug = TRUE // can this reagent be synthesized by the debug chem synthesizer?
|
||||
var/metabolization_rate = REAGENTS_METABOLISM //how fast the reagent is metabolized by the mob
|
||||
var/overrides_metab = 0
|
||||
var/overdose_threshold = 0
|
||||
|
||||
Reference in New Issue
Block a user