diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm
index 78a56a386f0..5889d0301a4 100644
--- a/code/game/machinery/Freezer.dm
+++ b/code/game/machinery/Freezer.dm
@@ -98,6 +98,7 @@
usr.set_machine(src)
if (href_list["start"])
src.on = !src.on
+ use_power = 1 + src.on
update_icon()
if(href_list["temp"])
var/amount = text2num(href_list["temp"])
@@ -105,6 +106,7 @@
src.current_temperature = min(T20C, src.current_temperature+amount)
else
src.current_temperature = max(min_temperature, src.current_temperature+amount)
+ active_power_usage = (current_heat_capacity * (T20C - current_temperature) / 100) + idle_power_usage
src.updateUsrDialog()
/obj/machinery/atmospherics/unary/cold_sink/freezer/process()
@@ -210,7 +212,8 @@
//user << browse(dat, "window=freezer;size=400x500")
//onclose(user, "freezer")
- var/datum/browser/popup = new(user, "freezer", "Cryo Gas Heating System", 400, 240) // Set up the popup browser window
+ var/datum/browser/popup = new(user, "freezer", "Pyro Gas Heating System", 400, 240) // Set up the popup browser window
+
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.set_content(dat)
popup.open()
@@ -221,13 +224,15 @@
usr.set_machine(src)
if (href_list["start"])
src.on = !src.on
+ use_power = 1 + src.on
update_icon()
if(href_list["temp"])
var/amount = text2num(href_list["temp"])
if(amount > 0)
- src.current_temperature = min((T20C+max_temperature), src.current_temperature+amount)
+ src.current_temperature = min((max_temperature), src.current_temperature+amount)
else
src.current_temperature = max(T20C, src.current_temperature+amount)
+ active_power_usage = (current_heat_capacity * (current_temperature - T20C) / 100) + idle_power_usage
src.updateUsrDialog()
src.add_fingerprint(usr)
return
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index f3e5dad90ca..bc533479088 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -125,6 +125,9 @@ Class Procs:
dropContents()
..()
+/obj/machinery/proc/locate_machinery()
+ return
+
/obj/machinery/process()//If you dont use process or power why are you here
return PROCESS_KILL
diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm
index ea569bfd9c2..3e82df3d402 100644
--- a/code/modules/power/turbine.dm
+++ b/code/modules/power/turbine.dm
@@ -84,7 +84,7 @@
inturf = get_step(src, dir)
spawn(5)
- turbine = locate() in get_step(src, get_dir(inturf, src))
+ locate_machinery()
if(!turbine)
stat |= BROKEN
@@ -98,6 +98,13 @@
// /obj/machinery/power/compressor/CanPass(atom/movable/mover, turf/target, height=0)
// return !density
+/obj/machinery/power/compressor/locate_machinery()
+ if(turbine)
+ return
+ turbine = locate() in get_step(src, get_dir(inturf, src))
+ if(turbine)
+ turbine.locate_machinery()
+
/obj/machinery/power/compressor/RefreshParts()
var/E = 0
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
@@ -111,7 +118,7 @@
if(default_change_direction_wrench(user, I))
turbine = null
inturf = get_step(src, dir)
- turbine = locate() in get_step(src, get_dir(inturf, src))
+ locate_machinery()
if(turbine)
user << "Turbine connected."
stat &= ~BROKEN
@@ -129,14 +136,14 @@
return !density
/obj/machinery/power/compressor/process()
+ if(!turbine)
+ stat = BROKEN
+ if(stat & BROKEN || panel_open)
+ return
if(!starter)
return
overlays.Cut()
- if(stat & BROKEN)
- return
- if(!turbine)
- stat |= BROKEN
- return
+
rpm = 0.9* rpm + 0.1 * rpmtarget
var/datum/gas_mixture/environment = inturf.return_air()
@@ -199,7 +206,7 @@
// compressor is found in the opposite direction
- compressor = locate() in get_step(src, get_dir(outturf, src))
+ locate_machinery()
if(!compressor)
stat |= BROKEN
@@ -218,15 +225,22 @@
P += C.rating
productivity = P / 6
+/obj/machinery/power/turbine/locate_machinery()
+ if(compressor)
+ return
+ compressor = locate() in get_step(src, get_dir(outturf, src))
+ if(compressor)
+ compressor.locate_machinery()
+
/obj/machinery/power/turbine/CanAtmosPass(var/turf/T)
return !density
/obj/machinery/power/turbine/process()
- if(stat & BROKEN)
- return
if(!compressor)
- stat |= BROKEN
+ stat = BROKEN
+
+ if((stat & BROKEN) || panel_open)
return
if(!compressor.starter)
return
@@ -274,7 +288,7 @@
if(default_change_direction_wrench(user, I))
compressor = null
outturf = get_step(src, dir)
- compressor = locate() in get_step(src, get_dir(outturf, src))
+ locate_machinery()
if(compressor)
user << "Compressor connected."
stat &= ~BROKEN
@@ -341,9 +355,9 @@
/obj/machinery/computer/turbine_computer/New()
..()
spawn(5)
- search_turbine()
+ locate_machinery()
-/obj/machinery/computer/turbine_computer/proc/search_turbine()
+/obj/machinery/computer/turbine_computer/locate_machinery()
compressor = locate(/obj/machinery/power/compressor) in range(5)
/obj/machinery/computer/turbine_computer/attack_hand(var/mob/user as mob)
@@ -356,17 +370,20 @@
var/dat
if(compressor && compressor.turbine)
- dat += {"
Gas turbine remote control system