From 84632045490dd038ed6458ac4621ead70353080f Mon Sep 17 00:00:00 2001
From: 81Denton <32391752+81Denton@users.noreply.github.com>
Date: Sun, 13 May 2018 01:53:46 +0200
Subject: [PATCH] Runtime: fixes RTG power, adjusts pipenet, adds debug chem
dispensers
---
_maps/map_files/debug/runtimestation.dmm | 174 +++++++++++-------
.../chemistry/machinery/chem_dispenser.dm | 14 ++
.../chemistry/machinery/chem_synthesizer.dm | 85 +++++++++
code/modules/reagents/chemistry/reagents.dm | 3 +-
tgstation.dme | 1 +
tgui/src/interfaces/chem_synthesizer.ract | 21 +++
6 files changed, 230 insertions(+), 68 deletions(-)
create mode 100644 code/modules/reagents/chemistry/machinery/chem_synthesizer.dm
create mode 100644 tgui/src/interfaces/chem_synthesizer.ract
diff --git a/_maps/map_files/debug/runtimestation.dmm b/_maps/map_files/debug/runtimestation.dmm
index a308ce62f2..3629dd5f05 100644
--- a/_maps/map_files/debug/runtimestation.dmm
+++ b/_maps/map_files/debug/runtimestation.dmm
@@ -25,6 +25,9 @@
/area/engine/atmos)
"ai" = (
/obj/machinery/power/rtg/advanced,
+/obj/structure/cable{
+ icon_state = "0-2"
+ },
/turf/open/floor/plating/airless,
/area/space/nearstation)
"aj" = (
@@ -73,7 +76,7 @@
/obj/structure/cable{
icon_state = "0-4"
},
-/turf/open/floor/plating,
+/turf/open/floor/plasteel,
/area/engine/engineering)
"aq" = (
/obj/machinery/computer/monitor,
@@ -84,11 +87,11 @@
/obj/machinery/light{
dir = 1
},
-/turf/open/floor/plating,
+/turf/open/floor/plasteel,
/area/engine/engineering)
"ar" = (
/obj/structure/closet/secure_closet/engineering_welding,
-/turf/open/floor/plating,
+/turf/open/floor/plasteel,
/area/engine/engineering)
"as" = (
/obj/machinery/power/smes{
@@ -182,12 +185,6 @@
/obj/machinery/door/airlock/external/glass,
/turf/open/floor/plating,
/area/engine/engineering)
-"aD" = (
-/obj/structure/cable{
- icon_state = "4-8"
- },
-/turf/open/floor/plating,
-/area/engine/engineering)
"aE" = (
/obj/structure/cable{
icon_state = "1-2"
@@ -195,10 +192,16 @@
/obj/structure/cable{
icon_state = "2-8"
},
-/turf/open/floor/plating,
+/obj/machinery/atmospherics/pipe/simple/supply/hidden{
+ dir = 6
+ },
+/turf/open/floor/plasteel,
/area/engine/engineering)
"aF" = (
-/turf/open/floor/plating,
+/obj/machinery/atmospherics/components/unary/vent_pump/on{
+ dir = 8
+ },
+/turf/open/floor/plasteel,
/area/engine/engineering)
"aG" = (
/obj/machinery/power/terminal{
@@ -292,7 +295,7 @@
},
/obj/item/storage/toolbox/syndicate,
/obj/item/stock_parts/cell/infinite,
-/turf/open/floor/plating,
+/turf/open/floor/plasteel,
/area/engine/engineering)
"aT" = (
/obj/structure/cable{
@@ -301,7 +304,8 @@
/obj/structure/cable{
icon_state = "2-4"
},
-/turf/open/floor/plating,
+/obj/machinery/atmospherics/pipe/simple/supply/hidden,
+/turf/open/floor/plasteel,
/area/engine/engineering)
"aU" = (
/obj/machinery/door/airlock/engineering/glass{
@@ -382,17 +386,18 @@
/obj/structure/table,
/obj/item/weldingtool/experimental,
/obj/item/inducer,
-/turf/open/floor/plating,
+/turf/open/floor/plasteel,
/area/engine/engineering)
"be" = (
/obj/structure/cable{
icon_state = "1-2"
},
-/turf/open/floor/plating,
+/obj/machinery/atmospherics/pipe/simple/supply/hidden,
+/turf/open/floor/plasteel,
/area/engine/engineering)
"bf" = (
/obj/machinery/suit_storage_unit/captain,
-/turf/open/floor/plating,
+/turf/open/floor/plasteel,
/area/engine/engineering)
"bg" = (
/obj/effect/turf_decal/stripes/line{
@@ -453,16 +458,15 @@
/turf/open/floor/plating,
/area/engine/atmos)
"bo" = (
-/obj/machinery/atmospherics/components/unary/vent_pump/on,
/obj/structure/table,
/obj/item/screwdriver/power,
/obj/item/wirecutters/power,
-/turf/open/floor/plating,
+/turf/open/floor/plasteel,
/area/engine/engineering)
"bp" = (
/obj/machinery/light,
/obj/structure/tank_dispenser,
-/turf/open/floor/plating,
+/turf/open/floor/plasteel,
/area/engine/engineering)
"bq" = (
/obj/effect/turf_decal/stripes/line{
@@ -496,15 +500,12 @@
/obj/effect/spawner/structure/window/reinforced,
/turf/open/floor/plating,
/area/bridge)
-"bw" = (
-/obj/machinery/atmospherics/pipe/simple/supply/hidden,
-/turf/closed/wall/r_wall,
-/area/engine/engineering)
"bx" = (
/obj/machinery/door/airlock,
/obj/structure/cable{
icon_state = "1-2"
},
+/obj/machinery/atmospherics/pipe/simple/supply/hidden,
/turf/open/floor/plating,
/area/engine/engineering)
"by" = (
@@ -628,7 +629,7 @@
/turf/open/floor/plasteel/dark,
/area/medical/chemistry)
"bS" = (
-/obj/machinery/chem_dispenser,
+/obj/machinery/chem_dispenser/fullupgrade,
/turf/open/floor/plasteel/dark,
/area/medical/chemistry)
"bU" = (
@@ -741,16 +742,6 @@
/obj/machinery/door/airlock,
/turf/open/floor/plating,
/area/bridge)
-"ci" = (
-/obj/machinery/atmospherics/pipe/simple/supply/hidden,
-/obj/structure/cable{
- icon_state = "4-8"
- },
-/obj/structure/cable{
- icon_state = "1-8"
- },
-/turf/open/floor/plasteel,
-/area/medical/chemistry)
"cj" = (
/obj/structure/cable{
icon_state = "4-8"
@@ -791,8 +782,10 @@
/area/science)
"cp" = (
/obj/machinery/light,
-/obj/machinery/atmospherics/components/unary/vent_pump/on,
/obj/structure/closet/secure_closet/engineering_chief,
+/obj/machinery/atmospherics/pipe/simple/supply/hidden{
+ dir = 6
+ },
/turf/open/floor/plasteel/blue/side{
dir = 10
},
@@ -814,7 +807,6 @@
/turf/closed/wall/r_wall,
/area/bridge)
"ct" = (
-/obj/machinery/atmospherics/pipe/simple/supply/hidden,
/obj/machinery/light{
dir = 8
},
@@ -888,8 +880,10 @@
/turf/closed/wall/r_wall,
/area/medical/chemistry)
"cF" = (
-/obj/machinery/atmospherics/pipe/manifold4w/supply/hidden,
/obj/effect/spawner/structure/window/reinforced,
+/obj/machinery/atmospherics/pipe/simple/supply/hidden{
+ dir = 4
+ },
/turf/open/floor/plasteel,
/area/medical/chemistry)
"cG" = (
@@ -1003,12 +997,6 @@
/obj/structure/cable,
/turf/open/floor/plating,
/area/storage/primary)
-"db" = (
-/obj/machinery/atmospherics/components/unary/vent_pump/on{
- dir = 1
- },
-/turf/open/floor/plating,
-/area/storage/primary)
"dc" = (
/obj/effect/turf_decal/stripes/line{
dir = 8
@@ -1310,6 +1298,15 @@
/obj/effect/spawner/structure/window/reinforced,
/turf/open/floor/plating,
/area/science)
+"gM" = (
+/obj/effect/turf_decal/stripes/line{
+ dir = 8
+ },
+/obj/machinery/atmospherics/components/unary/vent_pump/on{
+ dir = 1
+ },
+/turf/open/floor/plasteel,
+/area/storage/primary)
"gY" = (
/obj/machinery/atmospherics/components/unary/vent_pump/on{
dir = 8
@@ -1317,7 +1314,6 @@
/turf/open/floor/plasteel,
/area/science)
"hD" = (
-/obj/machinery/atmospherics/pipe/simple/supply/hidden,
/obj/machinery/power/apc{
dir = 1;
pixel_y = 25
@@ -1398,6 +1394,11 @@
},
/turf/open/floor/plasteel,
/area/medical/chemistry)
+"sE" = (
+/obj/machinery/power/rtg/advanced,
+/obj/structure/cable,
+/turf/open/floor/plating/airless,
+/area/space/nearstation)
"vv" = (
/obj/machinery/door/airlock,
/turf/open/floor/plating,
@@ -1433,6 +1434,16 @@
/obj/machinery/atmospherics/pipe/simple/supply/hidden,
/turf/open/floor/plasteel,
/area/medical/chemistry)
+"yp" = (
+/obj/structure/cable{
+ icon_state = "4-8"
+ },
+/obj/structure/cable{
+ icon_state = "1-8"
+ },
+/obj/machinery/atmospherics/pipe/simple/supply/hidden,
+/turf/open/floor/plasteel,
+/area/medical/chemistry)
"AP" = (
/obj/machinery/atmospherics/pipe/manifold/supply/hidden{
dir = 8
@@ -1462,12 +1473,24 @@
/obj/machinery/rnd/production/circuit_imprinter/department,
/turf/open/floor/plasteel,
/area/science)
+"CK" = (
+/obj/effect/spawner/structure/window/reinforced,
+/obj/machinery/atmospherics/pipe/manifold4w/supply/hidden,
+/turf/open/floor/plasteel,
+/area/medical/chemistry)
"CV" = (
/obj/structure/cable{
icon_state = "1-2"
},
+/obj/machinery/atmospherics/pipe/simple/supply/hidden,
/turf/open/floor/plasteel,
/area/medical/chemistry)
+"EI" = (
+/obj/machinery/atmospherics/components/unary/vent_pump/on{
+ dir = 8
+ },
+/turf/open/floor/plasteel/blue/side,
+/area/bridge)
"If" = (
/obj/structure/cable{
icon_state = "1-2"
@@ -1489,6 +1512,10 @@
/obj/machinery/door/airlock,
/turf/open/floor/plating,
/area/hallway/primary/central)
+"Ly" = (
+/obj/machinery/chem_dispenser/chem_synthesizer,
+/turf/open/floor/plasteel/dark,
+/area/medical/chemistry)
"NZ" = (
/obj/machinery/rnd/production/protolathe/department,
/turf/open/floor/plasteel,
@@ -1500,6 +1527,13 @@
/obj/machinery/door/airlock/external/glass,
/turf/open/floor/plating,
/area/medical/medbay)
+"RC" = (
+/obj/machinery/power/rtg/advanced,
+/obj/structure/cable{
+ icon_state = "0-4"
+ },
+/turf/open/floor/plating/airless,
+/area/space/nearstation)
"RY" = (
/obj/structure/cable{
icon_state = "4-8"
@@ -1515,6 +1549,12 @@
/obj/machinery/light,
/turf/open/floor/plasteel,
/area/hallway/primary/central)
+"Vy" = (
+/obj/structure/cable{
+ icon_state = "4-8"
+ },
+/turf/open/floor/plasteel,
+/area/engine/engineering)
"WT" = (
/obj/structure/cable{
icon_state = "4-8"
@@ -2627,14 +2667,14 @@ ae
ab
ai
an
-ai
+RC
aQ
-ai
+sE
ab
bv
bI
cf
-cq
+EI
bv
dU
bE
@@ -2683,7 +2723,7 @@ ai
ao
aA
aR
-ai
+sE
ab
bv
BG
@@ -2897,7 +2937,7 @@ ae
ac
ac
aj
-aD
+Vy
aj
ac
ac
@@ -3005,20 +3045,20 @@ ad
af
aj
ap
-aD
+Vy
aS
bd
bo
-bw
+aj
hD
-ci
+cj
ct
-wT
+Ce
cF
-bN
-bN
-cU
-db
+bE
+bE
+cS
+dl
dl
dl
dl
@@ -3065,14 +3105,14 @@ be
be
bx
CV
-cj
-Ce
-Ce
-oV
-bE
-bE
-cS
-dc
+yp
+wT
+wT
+CK
+bN
+bN
+cU
+gM
dc
dA
dl
@@ -3114,7 +3154,7 @@ af
aj
ar
aF
-aD
+Vy
bf
bp
aj
@@ -3334,7 +3374,7 @@ aX
aI
aI
ak
-bS
+Ly
pQ
Xg
Ce
diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
index 2db6058852..ff05a66d47 100644
--- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
@@ -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()
diff --git a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm
new file mode 100644
index 0000000000..4c57eb3524
--- /dev/null
+++ b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm
@@ -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("[src] dispenses a bluespace beaker.")
+
+/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
diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm
index 7369fd6042..f61644db0c 100644
--- a/code/modules/reagents/chemistry/reagents.dm
+++ b/code/modules/reagents/chemistry/reagents.dm
@@ -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
diff --git a/tgstation.dme b/tgstation.dme
index 93fb08da2f..ad3026a14a 100755
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -2331,6 +2331,7 @@
#include "code\modules\reagents\chemistry\machinery\chem_dispenser.dm"
#include "code\modules\reagents\chemistry\machinery\chem_heater.dm"
#include "code\modules\reagents\chemistry\machinery\chem_master.dm"
+#include "code\modules\reagents\chemistry\machinery\chem_synthesizer.dm"
#include "code\modules\reagents\chemistry\machinery\pandemic.dm"
#include "code\modules\reagents\chemistry\machinery\reagentgrinder.dm"
#include "code\modules\reagents\chemistry\machinery\smoke_machine.dm"
diff --git a/tgui/src/interfaces/chem_synthesizer.ract b/tgui/src/interfaces/chem_synthesizer.ract
new file mode 100644
index 0000000000..f57bd4ba71
--- /dev/null
+++ b/tgui/src/interfaces/chem_synthesizer.ract
@@ -0,0 +1,21 @@
+
+
+ Eject
+ Input
+ Create Beaker
+
+
+
+
+ {{#if data.isBeakerLoaded}}
+ {{Math.round(adata.beakerCurrentVolume)}}/{{data.beakerMaxVolume}} Units
+ {{#each adata.beakerContents}}
+ {{Math.fixed(volume, 2)}} units of {{name}}
+ {{else}}
+ Recipient Empty
+ {{/each}}
+ {{else}}
+ No Recipient
+ {{/if}}
+
+