Merge pull request #2164 from Fox-McCloud/gas-turbine

Gas Turbine
This commit is contained in:
Mark van Alphen
2015-09-26 21:27:11 +02:00
6 changed files with 307 additions and 164 deletions
+4 -4
View File
@@ -8015,7 +8015,7 @@
"cYg" = (/obj/machinery/light/small,/turf/simulated/floor/plating,/area/maintenance/asmaint2)
"cYh" = (/turf/simulated/wall/r_wall,/area/maintenance/turbine)
"cYi" = (/turf/simulated/wall,/area/maintenance/turbine)
"cYj" = (/obj/machinery/door/airlock/atmos{name = "Turbine Access"; req_access_txt = "12;24"},/obj/structure/barricade/wooden,/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,/turf/simulated/floor/plating,/area/maintenance/turbine)
"cYj" = (/obj/machinery/door/airlock/atmos{name = "Turbine Access"; req_access_txt = "12;24"},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,/turf/simulated/floor/plating,/area/maintenance/turbine)
"cYk" = (/obj/machinery/atmospherics/pipe/simple/hidden/supply,/turf/simulated/wall,/area/maintenance/turbine)
"cYl" = (/obj/structure/rack,/obj/effect/spawner/lootdrop/maintenance{lootcount = 2; name = "2maintenance loot spawner"},/obj/item/toy/minimeteor,/obj/item/weapon/contraband/poster,/turf/simulated/floor/plating,/area/maintenance/asmaint)
"cYm" = (/obj/structure/rack,/obj/effect/spawner/lootdrop/maintenance,/obj/item/weapon/reagent_containers/food/snacks/donkpocket,/turf/simulated/floor/plating,/area/maintenance/asmaint)
@@ -8102,7 +8102,7 @@
"cZP" = (/obj/structure/disposalpipe/segment,/turf/simulated/wall,/area/maintenance/asmaint2)
"cZQ" = (/mob/living/simple_animal/mouse,/turf/simulated/floor/plating,/area/maintenance/asmaint2)
"cZR" = (/obj/structure/reagent_dispensers/fueltank,/obj/item/weapon/storage/toolbox/emergency,/obj/item/device/radio/intercom{pixel_y = -30},/turf/simulated/floor{icon_state = "floorgrime"},/area/maintenance/turbine)
"cZS" = (/obj/machinery/atmospherics/pipe/simple/visible/purple,/turf/simulated/floor{icon_state = "floorgrime"},/area/maintenance/turbine)
"cZS" = (/obj/machinery/atmospherics/pipe/simple/visible/purple,/obj/machinery/computer/turbine_computer{id = "incineratorturbine"},/turf/simulated/floor{icon_state = "floorgrime"},/area/maintenance/turbine)
"cZT" = (/obj/structure/reagent_dispensers/watertank,/obj/item/weapon/extinguisher,/obj/structure/extinguisher_cabinet{pixel_y = -30},/obj/machinery/light/small,/turf/simulated/floor{icon_state = "floorgrime"},/area/maintenance/turbine)
"cZU" = (/obj/machinery/atmospherics/pipe/simple/visible,/obj/machinery/door_control{id = "auxiliaryturbinevent"; name = "Auxiliary Vent"; pixel_x = 6; pixel_y = -24; req_access_txt = "32"},/obj/machinery/door_control{id = "turbinevent"; name = "Turbine Vent"; pixel_x = -6; pixel_y = -24; req_access_txt = "32"},/turf/simulated/floor{icon_state = "floorgrime"},/area/maintenance/turbine)
"cZV" = (/obj/machinery/atmospherics/pipe/simple/visible,/obj/machinery/embedded_controller/radio/airlock/access_controller{frequency = 1449; id_tag = "turbine_control"; name = "Turbine Access Console"; pixel_x = 6; pixel_y = -26; req_access_txt = "12"; tag_exterior_door = "gas_turbine_exterior"; tag_interior_door = "gas_turbine_interior"},/obj/machinery/ignition_switch{id = "gasturbine"; pixel_x = -6; pixel_y = -24},/turf/simulated/floor{icon_state = "floorgrime"},/area/maintenance/turbine)
@@ -8157,10 +8157,10 @@
"daS" = (/obj/machinery/door/poddoor{id_tag = "auxiliaryturbinevent"; name = "Auxiliary Turbine Vent"},/turf/simulated/floor/engine{name = "vacuum floor"; nitrogen = 0.01; oxygen = 0.01},/area/maintenance/turbine)
"daT" = (/obj/effect/spawner/window/reinforced,/obj/machinery/atmospherics/pipe/simple/visible/purple,/turf/simulated/floor/plating,/area/maintenance/asmaint)
"daU" = (/obj/structure/disposalpipe/segment,/turf/simulated/wall/r_wall,/area/maintenance/asmaint2)
"daV" = (/obj/structure/cable{d2 = 2; icon_state = "0-2"},/obj/structure/cable,/turf/simulated/floor/engine,/area/maintenance/turbine)
"daV" = (/obj/structure/cable{d2 = 2; icon_state = "0-2"},/obj/structure/cable,/obj/machinery/power/compressor{comp_id = "incineratorturbine"; dir = 1},/turf/simulated/floor/engine,/area/maintenance/turbine)
"daW" = (/obj/structure/lattice,/obj/machinery/atmospherics/pipe/simple/visible/purple,/turf/space,/area/space)
"daX" = (/obj/effect/decal/warning_stripes/northeast,/obj/structure/table/glass,/obj/item/weapon/wirerod,/obj/effect/spawner/lootdrop/maintenance,/turf/simulated/floor/plating,/area/maintenance/asmaint2)
"daY" = (/obj/structure/cable,/turf/simulated/floor/engine,/area/maintenance/turbine)
"daY" = (/obj/structure/cable,/obj/machinery/power/turbine,/turf/simulated/floor/engine,/area/maintenance/turbine)
"daZ" = (/obj/item/weapon/wrench,/turf/simulated/floor/plating/airless/catwalk,/area/space)
"dba" = (/obj/machinery/portable_atmospherics/canister/air,/obj/machinery/atmospherics/unary/portables_connector{dir = 8},/turf/simulated/floor/plating,/area/maintenance/asmaint2)
"dbb" = (/obj/machinery/access_button{command = "cycle_interior"; frequency = 1450; master_tag = "sci_maint"; name = "interior access button"; pixel_x = -28; pixel_y = -5; req_access_txt = "13"},/obj/effect/decal/warning_stripes/west,/obj/machinery/atmospherics/pipe/simple/hidden{dir = 6},/turf/simulated/floor/plating,/area/maintenance/asmaint2)
@@ -125,9 +125,6 @@
name = "circuit board (Orion Trail)"
build_path = /obj/machinery/computer/arcade/orion_trail
origin_tech = "programming=2"
/obj/item/weapon/circuitboard/turbine_control
name = "Circuit board (Turbine Control)"
build_path = /obj/machinery/computer/turbine_computer
/obj/item/weapon/circuitboard/solar_control
name = "Circuit board (Solar Control)"
build_path = /obj/machinery/power/solar_control
@@ -245,6 +242,11 @@
name = "Circuit board (Atmospheric Tank Control)"
build_path = /obj/machinery/computer/general_air_control/large_tank_control
/obj/item/weapon/circuitboard/turbine_computer
name = "circuit board (Turbine Computer)"
build_path = /obj/machinery/computer/turbine_computer
origin_tech = "programming=4;engineering=4;powerstorage=4"
/obj/item/weapon/circuitboard/HONKputer
name = "Circuit board (HONKputer)"
build_path = /obj/machinery/computer/HONKputer
@@ -235,6 +235,24 @@ to destroy them and players will be able to make replacements.
/obj/item/weapon/stock_parts/micro_laser = 1,
/obj/item/weapon/stock_parts/manipulator = 1)
/obj/item/weapon/circuitboard/power_compressor
name = "circuit board (Power Compressor)"
build_path = /obj/machinery/power/compressor
board_type = "machine"
origin_tech = "programming=4;powerstorage=5;engineering=4"
req_components = list(
/obj/item/stack/cable_coil = 5,
/obj/item/weapon/stock_parts/manipulator = 6)
/obj/item/weapon/circuitboard/power_turbine
name = "circuit board (Power Turbine)"
build_path = /obj/machinery/power/turbine
board_type = "machine"
origin_tech = "programming=4;powerstorage=4;engineering=5"
req_components = list(
/obj/item/stack/cable_coil = 5,
/obj/item/weapon/stock_parts/capacitor = 6)
/obj/item/weapon/circuitboard/thermomachine
name = "circuit board (Freezer)"
desc = "Use screwdriver to switch between heating and cooling modes."
+4 -1
View File
@@ -139,6 +139,9 @@ Class Procs:
return ..()
/obj/machinery/proc/locate_machinery()
return
/obj/machinery/process() // If you dont use process or power why are you here
return PROCESS_KILL
@@ -544,7 +547,7 @@ Class Procs:
if(user.stunned)
return 1
return 0
//called on machinery construction (i.e from frame to machinery) but not on initialization
/obj/machinery/proc/construction()
return
+246 -156
View File
@@ -1,4 +1,28 @@
/obj/machinery/compressor
// TURBINE v2 AKA rev4407 Engine reborn!
// How to use it? - Mappers
//
// This is a very good power generating mechanism. All you need is a blast furnace with soaring flames and output.
// Not everything is included yet so the turbine can run out of fuel quiet quickly. The best thing about the turbine is that even
// though something is on fire that passes through it, it won't be on fire as it passes out of it. So the exhaust fumes can still
// containt unreacted fuel - plasma and oxygen that needs to be filtered out and re-routed back. This of course requires smart piping
// For a computer to work with the turbine the compressor requires a comp_id matching with the turbine computer's id. This will be
// subjected to a change in the near future mind you. Right now this method of generating power is a good backup but don't expect it
// become a main power source unless some work is done. Have fun. At 50k RPM it generates 60k power. So more than one turbine is needed!
//
// - Numbers
//
// Example setup S - sparker
// B - Blast doors into space for venting
// *BBB****BBB* C - Compressor
// S CT * T - Turbine
// * ^ * * V * D - Doors with firedoor
// **|***D**|** ^ - Fuel feed (Not vent, but a gas outlet)
// | | V - Suction vent (Like the ones in atmos
//
/obj/machinery/power/compressor
name = "compressor"
desc = "The compressor stage of a gas turbine generator."
icon = 'icons/obj/pipes.dmi'
@@ -13,6 +37,8 @@
var/rpmtarget = 0
var/capacity = 1e6
var/comp_id = 0
var/efficiency
/obj/machinery/power/turbine
name = "gas turbine generator"
@@ -21,57 +47,116 @@
icon_state = "turbine"
anchored = 1
density = 1
var/obj/machinery/compressor/compressor
var/opened = 0
var/obj/machinery/power/compressor/compressor
var/turf/simulated/outturf
var/lastgen
var/productivity = 1
/obj/machinery/computer/turbine_computer
name = "Gas turbine control computer"
name = "gas turbine control computer"
desc = "A computer to remotely control a gas turbine"
icon = 'icons/obj/computer.dmi'
icon_state = "airtunnel0e"
circuit = /obj/item/weapon/circuitboard/turbine_control
anchored = 1
density = 1
var/obj/machinery/compressor/compressor
var/list/obj/machinery/door/poddoor/doors
icon_screen = "turbinecomp"
icon_keyboard = "tech_key"
circuit = /obj/item/weapon/circuitboard/turbine_computer
var/obj/machinery/power/compressor/compressor
var/id = 0
var/door_status = 0
// the inlet stage of the gas turbine electricity generator
/obj/machinery/compressor/New()
/obj/machinery/power/compressor/New()
..()
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/power_compressor(null)
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
component_parts += new /obj/item/stack/cable_coil(null, 5)
RefreshParts()
// The inlet of the compressor is the direction it faces
gas_contained = new
inturf = get_step(src, dir)
spawn(5)
turbine = locate() in get_step(src, get_dir(inturf, src))
if(!turbine)
stat |= BROKEN
/obj/machinery/power/compressor/initialize()
..()
locate_machinery()
if(!turbine)
stat |= BROKEN
#define COMPFRICTION 5e5
#define COMPSTARTERLOAD 2800
/obj/machinery/compressor/process()
// Crucial to make things work!!!!
// OLD FIX - explanation given down below.
// /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)
E += M.rating
efficiency = E / 6
/obj/machinery/power/compressor/attackby(obj/item/I, mob/user, params)
if(default_deconstruction_screwdriver(user, initial(icon_state), initial(icon_state), I))
return
if(default_change_direction_wrench(user, I))
turbine = null
inturf = get_step(src, dir)
locate_machinery()
if(turbine)
user << "<span class='notice'>Turbine connected.</span>"
stat &= ~BROKEN
else
user << "<span class='alert'>Turbine not connected.</span>"
stat |= BROKEN
return
if(exchange_parts(user, I))
return
default_deconstruction_crowbar(I)
/obj/machinery/power/compressor/CanAtmosPass(turf/T)
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()
// It's a simplified version taking only 1/10 of the moles from the turf nearby. It should be later changed into a better version
var/transfer_moles = environment.total_moles()/10
//var/transfer_moles = rpm/10000*capacity
var/datum/gas_mixture/removed = inturf.remove_air(transfer_moles)
gas_contained.merge(removed)
rpm = max(0, rpm - (rpm*rpm)/COMPFRICTION)
// RPM function to include compression friction - be advised that too low/high of a compfriction value can make things screwy
rpm = max(0, rpm - (rpm*rpm)/(COMPFRICTION/efficiency))
if(starter && !(stat & NOPOWER))
@@ -83,7 +168,6 @@
rpmtarget = 0
if(rpm>50000)
overlays += image('icons/obj/pipes.dmi', "comp-o4", FLY_LAYER)
else if(rpm>10000)
@@ -94,35 +178,74 @@
overlays += image('icons/obj/pipes.dmi', "comp-o1", FLY_LAYER)
//TODO: DEFERRED
// These are crucial to working of a turbine - the stats modify the power output. TurbGenQ modifies how much raw energy can you get from
// rpms, TurbGenG modifies the shape of the curve - the lower the value the less straight the curve is.
#define TURBPRES 9000000
#define TURBGENQ 100000
#define TURBGENG 0.5
/obj/machinery/power/turbine/New()
..()
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/power_turbine(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
component_parts += new /obj/item/stack/cable_coil(src, 5)
RefreshParts()
// The outlet is pointed at the direction of the turbine component
outturf = get_step(src, dir)
spawn(5)
compressor = locate() in get_step(src, get_dir(outturf, src))
if(!compressor)
stat |= BROKEN
/obj/machinery/power/turbine/initialize()
..()
locate_machinery()
if(!compressor)
stat |= BROKEN
/obj/machinery/power/turbine/RefreshParts()
var/P = 0
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
P += C.rating
productivity = P / 6
#define TURBPRES 9000000
#define TURBGENQ 20000
#define TURBGENG 0.8
/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(turf/T)
return !density
/obj/machinery/power/turbine/process()
if(!compressor)
stat = BROKEN
if((stat & BROKEN) || panel_open)
return
if(!compressor.starter)
return
overlays.Cut()
if(stat & BROKEN)
return
if(!compressor)
stat |= BROKEN
return
lastgen = ((compressor.rpm / TURBGENQ)**TURBGENG) *TURBGENQ
// This is the power generation function. If anything is needed it's good to plot it in EXCEL before modifying
// the TURBGENQ and TURBGENG values
lastgen = ((compressor.rpm / TURBGENQ)**TURBGENG) * TURBGENQ * productivity
add_avail(lastgen)
// Weird function but it works. Should be something else...
var/newrpm = ((compressor.gas_contained.temperature) * compressor.gas_contained.total_moles())/4
newrpm = max(0, newrpm)
if(!compressor.starter || newrpm > 1000)
@@ -133,24 +256,48 @@
var/datum/gas_mixture/removed = compressor.gas_contained.remove(oamount)
outturf.assume_air(removed)
// If it works, put an overlay that it works!
if(lastgen > 100)
overlays += image('icons/obj/pipes.dmi', "turb-o", FLY_LAYER)
updateDialog()
for(var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
src.interact(M)
AutoUpdateAI(src)
/obj/machinery/power/turbine/attack_hand(mob/user)
if(..())
return
interact(user)
/obj/machinery/power/turbine/attackby(obj/item/I, mob/user, params)
if(default_deconstruction_screwdriver(user, initial(icon_state), initial(icon_state), I))
return
if(default_change_direction_wrench(user, I))
compressor = null
outturf = get_step(src, dir)
locate_machinery()
if(compressor)
user << "<span class='notice'>Compressor connected.</span>"
stat &= ~BROKEN
else
user << "<span class='alert'>Compressor not connected.</span>"
stat |= BROKEN
return
if(exchange_parts(user, I))
return
default_deconstruction_crowbar(I)
/obj/machinery/power/turbine/interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (NOPOWER|BROKEN)) && (!istype(user, /mob/living/silicon/ai)) )
user.machine = null
if ( !Adjacent(user) || (stat & (NOPOWER|BROKEN)) && (!istype(user, /mob/living/silicon)) )
user.unset_machine(src)
user << browse(null, "window=turbine")
return
user.machine = src
var/t = "<TT><B>Gas Turbine Generator</B><HR><PRE>"
t += "Generated power : [round(lastgen)] W<BR><BR>"
@@ -162,43 +309,26 @@
t += "</PRE><HR><A href='?src=\ref[src];close=1'>Close</A>"
t += "</TT>"
user << browse(t, "window=turbine")
onclose(user, "turbine")
var/datum/browser/popup = new(user, "turbine", name)
popup.set_content(t)
popup.open()
return
/obj/machinery/power/turbine/Topic(href, href_list)
..()
if(stat & BROKEN)
if(..())
return
if (usr.stat || usr.restrained() )
if( href_list["close"] )
usr << browse(null, "window=turbine")
usr.unset_machine(src)
return
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
if(!istype(usr, /mob/living/silicon/ai))
usr << "\red You don't have the dexterity to do this!"
return
if (( usr.machine==src && ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
if( href_list["close"] )
usr << browse(null, "window=turbine")
usr.machine = null
return
else if( href_list["str"] )
else if( href_list["str"] )
if(compressor)
compressor.starter = !compressor.starter
spawn(0)
for(var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
src.interact(M)
else
usr << browse(null, "window=turbine")
usr.machine = null
return
updateDialog()
@@ -207,107 +337,67 @@
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// COMPUTER NEEDS A SERIOUS REWRITE.
/obj/machinery/computer/turbine_computer/New()
/obj/machinery/computer/turbine_computer/initialize()
..()
spawn(5)
for(var/obj/machinery/compressor/C in machines)
if(id == C.comp_id)
compressor = C
doors = new /list()
for(var/obj/machinery/door/poddoor/P in machines)
if(P.id_tag == id)
doors += P
spawn(10)
locate_machinery()
/*
/obj/machinery/computer/turbine_computer/attackby(I as obj, user as mob, params)
if(istype(I, /obj/item/weapon/screwdriver))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 20, target = src))
if (src.stat & BROKEN)
user << "\blue The broken glass falls out."
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
PoolOrNew(/obj/item/weapon/shard, loc)
var/obj/item/weapon/circuitboard/turbine_control/M = new /obj/item/weapon/circuitboard/turbine_control( A )
for (var/obj/C in src)
C.loc = src.loc
M.id = src.id
A.circuit = M
A.state = 3
A.icon_state = "3"
A.anchored = 1
del(src)
else
user << "\blue You disconnect the monitor."
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
var/obj/item/weapon/circuitboard/turbine_control/M = new /obj/item/weapon/circuitboard/turbine_control( A )
for (var/obj/C in src)
C.loc = src.loc
M.id = src.id
A.circuit = M
A.state = 4
A.icon_state = "4"
A.anchored = 1
del(src)
else
src.attack_hand(user)
return
*/
/obj/machinery/computer/turbine_computer/locate_machinery()
compressor = locate(/obj/machinery/power/compressor) in range(5, src)
/obj/machinery/computer/turbine_computer/attack_hand(var/mob/user as mob)
user.machine = src
if(..())
return
interact(user)
/obj/machinery/computer/turbine_computer/interact(mob/user)
var/dat
if(src.compressor)
dat += {"<BR><B>Gas turbine remote control system</B><HR>
\nTurbine status: [ src.compressor.starter ? "<A href='?src=\ref[src];str=1'>Off</A> <B>On</B>" : "<B>Off</B> <A href='?src=\ref[src];str=1'>On</A>"]
\n<BR>
\nTurbine speed: [src.compressor.rpm]rpm<BR>
\nPower currently being generated: [src.compressor.turbine.lastgen]W<BR>
\nInternal gas temperature: [src.compressor.gas_contained.temperature]K<BR>
\nVent doors: [ src.door_status ? "<A href='?src=\ref[src];doors=1'>Closed</A> <B>Open</B>" : "<B>Closed</B> <A href='?src=\ref[src];doors=1'>Open</A>"]
\n</PRE><HR><A href='?src=\ref[src];view=1'>View</A>
\n</PRE><HR><A href='?src=\ref[src];close=1'>Close</A>
\n<BR>
\n"}
if(compressor && compressor.turbine)
dat += "<BR><B>Gas turbine remote control system</B><HR>"
if(compressor.stat || compressor.turbine.stat)
dat += "[compressor.stat ? "<B>Compressor is inoperable</B><BR>" : "<B>Turbine is inoperable</B>"]"
else
dat += {"Turbine status: [ src.compressor.starter ? "<A href='?src=\ref[src];str=1'>Off</A> <B>On</B>" : "<B>Off</B> <A href='?src=\ref[src];str=1'>On</A>"]
\n<BR>
\nTurbine speed: [src.compressor.rpm]rpm<BR>
\nPower currently being generated: [src.compressor.turbine.lastgen]W<BR>
\nInternal gas temperature: [src.compressor.gas_contained.temperature]K<BR>
\n</PRE><HR><A href='?src=\ref[src];close=1'>Close</A>
\n<BR>
\n"}
else
dat += "\red<B>No compatible attached compressor found."
dat += "<B>There is [!compressor ? "no compressor" : " compressor[!compressor.turbine ? " but no turbine" : ""]"].</B><BR>"
if(!compressor)
dat += "<A href='?src=\ref[src];search=1'>Search for compressor</A>"
user << browse(dat, "window=computer;size=400x500")
onclose(user, "computer")
var/datum/browser/popup = new(user, "turbinecomputer", name)
popup.set_content(dat)
popup.open()
return
/obj/machinery/computer/turbine_computer/Topic(href, href_list)
if(..())
return
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
if( href_list["view"] )
usr.client.eye = src.compressor
else if( href_list["str"] )
src.compressor.starter = !src.compressor.starter
else if (href_list["doors"])
for(var/obj/machinery/door/poddoor/D in src.doors)
if (door_status == 0)
spawn( 0 )
D.open()
door_status = 1
else
spawn( 0 )
D.close()
door_status = 0
else if( href_list["close"] )
usr << browse(null, "window=computer")
usr.machine = null
return
else if( href_list["str"] )
if(compressor && compressor.turbine)
compressor.starter = !compressor.starter
else if( href_list["close"] )
usr << browse(null, "window=turbinecomputer")
usr.unset_machine(src)
return
else if(href_list["search"])
locate_machinery()
src.add_fingerprint(usr)
src.updateUsrDialog()
return
/obj/machinery/computer/turbine_computer/process()
src.updateDialog()
return
return
@@ -32,6 +32,36 @@
build_path = /obj/item/weapon/circuitboard/emitter
category = list ("Engineering Machinery")
/datum/design/turbine_computer
name = "Computer Design (Power Turbine Console Board)"
desc = "The circuit board for a power turbine console."
id = "power_turbine_console"
req_tech = list("programming" = 4, "powerstorage" = 4, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
build_path = /obj/item/weapon/circuitboard/turbine_computer
category = list ("Engineering Machinery")
/datum/design/power_compressor
name = "Machine Design (Power Compressor Board)"
desc = "The circuit board for a power compressor."
id = "power_compressor"
req_tech = list("programming" = 4, "powerstorage" = 5, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
build_path = /obj/item/weapon/circuitboard/power_compressor
category = list ("Engineering Machinery")
/datum/design/power_turbine
name = "Machine Design (Power Turbine Board)"
desc = "The circuit board for a power turbine."
id = "power_turbine"
req_tech = list("programming" = 4, "powerstorage" = 4, "engineering" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
build_path = /obj/item/weapon/circuitboard/power_turbine
category = list ("Engineering Machinery")
/datum/design/telepad
name = "Machine Board (Telepad Board)"
desc = "Allows for the construction of circuit boards used to build a Telepad."