Revert "Makes the TEG deconstructable" (#38616)

* Revert "Makes the TEG deconstructable (#38056)"

This reverts commit 67ff23a9a1.

* Revert "Automatic changelog generation for PR #38056 [ci skip]"

This reverts commit 36d5170868.
This commit is contained in:
Nich
2018-06-27 20:49:31 +12:00
committed by oranges
parent b8ee4350e9
commit 40e071e71e
5 changed files with 42 additions and 166 deletions
@@ -1,40 +1,23 @@
//node2, air2, network2 correspond to input
//node1, air1, network1 correspond to output
#define CIRCULATOR_COLD 0
#define CIRCULATOR_HOT 1
/obj/machinery/atmospherics/components/binary/circulator
name = "circulator/heat exchanger"
desc = "A gas circulator pump and heat exchanger."
icon_state = "circ-off"
icon_state = "circ1-off"
var/active = FALSE
var/side = CIRC_LEFT
var/status = 0
var/last_pressure_delta = 0
pipe_flags = PIPING_ONE_PER_TURF
density = TRUE
var/global/const/CIRC_LEFT = 1
var/global/const/CIRC_RIGHT = 2
var/mode = CIRCULATOR_HOT
var/obj/machinery/power/generator/generator
//default cold circ for mappers
/obj/machinery/atmospherics/components/binary/circulator/cold
mode = CIRCULATOR_COLD
/obj/machinery/atmospherics/components/binary/circulator/Initialize(mapload)
.=..()
component_parts = list(new /obj/item/circuitboard/machine/circulator)
/obj/machinery/atmospherics/components/binary/circulator/ComponentInitialize()
. = ..()
AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS )
/obj/machinery/atmospherics/components/binary/circulator/Destroy()
if(generator)
disconnectFromGenerator()
..()
/obj/machinery/atmospherics/components/binary/circulator/proc/return_transfer_air()
@@ -73,55 +56,11 @@
/obj/machinery/atmospherics/components/binary/circulator/update_icon()
if(!is_operational())
icon_state = "circ-p"
icon_state = "circ[side]-p"
else if(last_pressure_delta > 0)
if(last_pressure_delta > ONE_ATMOSPHERE)
icon_state = "circ-run"
icon_state = "circ[side]-run"
else
icon_state = "circ-slow"
icon_state = "circ[side]-slow"
else
icon_state = "circ-off"
/obj/machinery/atmospherics/components/binary/circulator/wrench_act(mob/living/user, obj/item/I)
if(!panel_open)
return
anchored = !anchored
I.play_tool_sound(src)
if(generator)
disconnectFromGenerator()
to_chat(user, "<span class='notice'>You [anchored?"secure":"unsecure"] [src].</span>")
return TRUE
/obj/machinery/atmospherics/components/binary/circulator/multitool_act(mob/living/user, obj/item/I)
if(generator)
disconnectFromGenerator()
mode = !mode
to_chat(user, "<span class='notice'>You set [src] to [mode?"cold":"hot"] mode.</span>")
return TRUE
/obj/machinery/atmospherics/components/binary/circulator/screwdriver_act(mob/user, obj/item/I)
panel_open = !panel_open
I.play_tool_sound(src)
to_chat(user, "<span class='notice'>You [panel_open?"open":"close"] the panel on [src].</span>")
return TRUE
/obj/machinery/atmospherics/components/binary/circulator/crowbar_act(mob/user, obj/item/I)
default_deconstruction_crowbar(I)
return TRUE
/obj/machinery/atmospherics/components/binary/circulator/on_deconstruction()
if(generator)
disconnectFromGenerator()
/obj/machinery/atmospherics/components/binary/circulator/proc/disconnectFromGenerator()
if(mode)
generator.cold_circ = null
else
generator.hot_circ = null
generator.update_icon()
generator = null
/obj/machinery/atmospherics/components/binary/circulator/setPipingLayer(new_layer)
..()
pixel_x = 0
pixel_y = 0
icon_state = "circ[side]-off"
+32 -87
View File
@@ -8,6 +8,10 @@
var/obj/machinery/atmospherics/components/binary/circulator/cold_circ
var/obj/machinery/atmospherics/components/binary/circulator/hot_circ
//note: these currently only support EAST and WEST
var/cold_dir = WEST
var/hot_dir = EAST
var/lastgen = 0
var/lastgenlev = -1
var/lastcirc = "00"
@@ -15,18 +19,34 @@
/obj/machinery/power/generator/Initialize(mapload)
. = ..()
find_circs()
var/obj/machinery/atmospherics/components/binary/circulator/circpath = /obj/machinery/atmospherics/components/binary/circulator
cold_circ = locate(circpath) in get_step(src, cold_dir)
hot_circ = locate(circpath) in get_step(src, hot_dir)
connect_to_network()
SSair.atmos_machinery += src
update_icon()
component_parts = list(new /obj/item/circuitboard/machine/generator)
/obj/machinery/power/generator/ComponentInitialize()
. = ..()
AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS )
if(cold_circ)
switch(cold_dir)
if(EAST)
cold_circ.side = circpath.CIRC_RIGHT
if(WEST)
cold_circ.side = circpath.CIRC_LEFT
cold_circ.update_icon()
if(hot_circ)
switch(hot_dir)
if(EAST)
hot_circ.side = circpath.CIRC_RIGHT
if(WEST)
hot_circ.side = circpath.CIRC_LEFT
hot_circ.update_icon()
if(!cold_circ || !hot_circ)
stat |= BROKEN
update_icon()
/obj/machinery/power/generator/Destroy()
kill_circs()
SSair.atmos_machinery -= src
return ..()
@@ -41,8 +61,7 @@
if(L != 0)
add_overlay(image('icons/obj/power.dmi', "teg-op[L]"))
if(hot_circ && cold_circ)
add_overlay("teg-oc[lastcirc]")
add_overlay("teg-oc[lastcirc]")
#define GENRATE 800 // generator output coefficient from Q
@@ -103,7 +122,7 @@
lastgen -= power_output
..()
/obj/machinery/power/generator/proc/get_menu(include_link = TRUE)
/obj/machinery/power/generator/proc/get_menu(include_link = 1)
var/t = ""
if(!powernet)
t += "<span class='bad'>Unable to connect to the power network!</span>"
@@ -128,12 +147,8 @@
t += "Pressure Inlet: [round(hot_circ_air2.return_pressure(), 0.1)] kPa / Outlet: [round(hot_circ_air1.return_pressure(), 0.1)] kPa<BR>"
t += "</div>"
else if(!hot_circ && cold_circ)
t += "<span class='bad'>Unable to locate hot circulator!</span>"
else if(hot_circ && !cold_circ)
t += "<span class='bad'>Unable to locate cold circulator!</span>"
else
t += "<span class='bad'>Unable to locate any parts!</span>"
t += "<span class='bad'>Unable to locate all parts!</span>"
if(include_link)
t += "<BR><A href='?src=[REF(src)];close=1'>Close</A>"
@@ -152,80 +167,10 @@
if( href_list["close"] )
usr << browse(null, "window=teg")
usr.unset_machine()
return FALSE
return TRUE
return 0
return 1
/obj/machinery/power/generator/power_change()
..()
update_icon()
/obj/machinery/power/generator/proc/find_circs()
kill_circs()
var/list/circs = list()
var/obj/machinery/atmospherics/components/binary/circulator/C
var/circpath = /obj/machinery/atmospherics/components/binary/circulator
if(dir == NORTH || dir == SOUTH)
C = locate(circpath) in get_step(src, EAST)
if(C && C.dir == WEST)
circs += C
C = locate(circpath) in get_step(src, WEST)
if(C && C.dir == EAST)
circs += C
else
C = locate(circpath) in get_step(src, NORTH)
if(C && C.dir == SOUTH)
circs += C
C = locate(circpath) in get_step(src, SOUTH)
if(C && C.dir == NORTH)
circs += C
if(circs.len)
for(C in circs)
if(C.mode == CIRCULATOR_COLD && !cold_circ)
cold_circ = C
C.generator = src
else if(C.mode == CIRCULATOR_HOT && !hot_circ)
hot_circ = C
C.generator = src
/obj/machinery/power/generator/wrench_act(mob/living/user, obj/item/I)
if(!panel_open)
return
anchored = !anchored
I.play_tool_sound(src)
if(!anchored)
kill_circs()
to_chat(user, "<span class='notice'>You [anchored?"secure":"unsecure"] [src].</span>")
return TRUE
/obj/machinery/power/generator/multitool_act(mob/living/user, obj/item/I)
if(!anchored)
return
find_circs()
to_chat(user, "<span class='notice'>You update [src]'s circulator links.</span>")
return TRUE
/obj/machinery/power/generator/screwdriver_act(mob/user, obj/item/I)
panel_open = !panel_open
I.play_tool_sound(src)
to_chat(user, "<span class='notice'>You [panel_open?"open":"close"] the panel on [src].</span>")
return TRUE
/obj/machinery/power/generator/crowbar_act(mob/user, obj/item/I)
default_deconstruction_crowbar(I)
return TRUE
/obj/machinery/power/generator/on_deconstruction()
kill_circs()
/obj/machinery/power/generator/proc/kill_circs()
if(hot_circ)
hot_circ.generator = null
hot_circ = null
if(cold_circ)
cold_circ.generator = null
cold_circ = null