mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
- power monitor: a remote monitoring device to send network data to a console
- lowered the number of radsuits per crate down to 1 (they're never used on exodus anyway) - tweaked turbines Signed-off-by: caelaislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
+4
-1
@@ -165,6 +165,7 @@
|
||||
#define FILE_DIR "code/WorkInProgress/Apples"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/BirdMan"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Jumper"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Rust"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Supermatter"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Tajara"
|
||||
@@ -203,6 +204,7 @@
|
||||
#define FILE_DIR "icons/vending_icons"
|
||||
#define FILE_DIR "interface"
|
||||
#define FILE_DIR "maps"
|
||||
#define FILE_DIR "maps/backup"
|
||||
#define FILE_DIR "maps/RandomZLevels"
|
||||
#define FILE_DIR "sound"
|
||||
#define FILE_DIR "sound/AI"
|
||||
@@ -1146,6 +1148,7 @@
|
||||
#include "code\WorkInProgress\buildmode.dm"
|
||||
#include "code\WorkInProgress\explosion_particles.dm"
|
||||
#include "code\WorkInProgress\animusstation\atm.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\power_monitor.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\BirdMan\bird_transformation.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\BirdMan\birdman.dm"
|
||||
#include "code\WorkInProgress\Cael_Aislinn\Rust\core_field.dm"
|
||||
@@ -1204,5 +1207,5 @@
|
||||
#include "code\WorkInProgress\Wrongnumber\weldbackpack.dm"
|
||||
#include "interface\interface.dm"
|
||||
#include "interface\skin.dmf"
|
||||
#include "maps\tgstation.2.0.8.dmm"
|
||||
#include "maps\Antiqua.dmm"
|
||||
// END_INCLUDE
|
||||
|
||||
@@ -131,7 +131,7 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
|
||||
radiation = 0
|
||||
|
||||
//update values
|
||||
var/transfer_ratio = 50 / field_strength
|
||||
var/transfer_ratio = field_strength / 50
|
||||
major_radius = field_strength * 0.21875// max = 8.75
|
||||
minor_radius = field_strength * 0.2125// max = 8.625
|
||||
volume_covered = PI * major_radius * minor_radius * 2.5 * 2.5 * 2.5 * 7 * 7 * transfer_ratio
|
||||
@@ -159,10 +159,12 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
|
||||
var/datum/gas_mixture/plasma_captured = new /datum/gas_mixture()
|
||||
//
|
||||
plasma_captured.toxins = round(gas_covered.toxins * transfer_ratio)
|
||||
//world << "\blue[plasma_captured.toxins] moles of plasma captured"
|
||||
plasma_captured.temperature = gas_covered.temperature
|
||||
//plasma_captured.update_values()
|
||||
gas_covered.toxins -= plasma_captured.toxins
|
||||
plasma_captured.update_values()
|
||||
gas_covered.update_values()
|
||||
//gas_covered.update_values()
|
||||
//
|
||||
held_plasma.merge(plasma_captured)
|
||||
//
|
||||
environment.merge(gas_covered)
|
||||
@@ -187,7 +189,25 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
|
||||
//if there is too much plasma in the field, lose some
|
||||
/*if( held_plasma.toxins > (MOLES_CELLSTANDARD * 7) * (50 / field_strength) )
|
||||
LosePlasma()*/
|
||||
LosePlasma()
|
||||
if(held_plasma.toxins > 1)
|
||||
//lose a random amount of plasma back into the air, increased by the field strength (want to switch this over to frequency eventually)
|
||||
var/loss_ratio = rand() * (0.05 + (0.05 * 50 / field_strength))
|
||||
//world << "lost [loss_ratio*100]% of held plasma"
|
||||
//
|
||||
var/datum/gas_mixture/plasma_lost = new
|
||||
plasma_lost.temperature = held_plasma.temperature
|
||||
//
|
||||
plasma_lost.toxins = held_plasma.toxins * loss_ratio
|
||||
//plasma_lost.update_values()
|
||||
held_plasma.toxins -= held_plasma.toxins * loss_ratio
|
||||
//held_plasma.update_values()
|
||||
//
|
||||
environment.merge(plasma_lost)
|
||||
radiation += loss_ratio * mega_energy * 0.1
|
||||
mega_energy -= loss_ratio * mega_energy * 0.1
|
||||
else
|
||||
held_plasma.toxins = 0
|
||||
//held_plasma.update_values()
|
||||
|
||||
//handle some reactants formatting
|
||||
//helium-4 has no use at the moment, but a buttload of it is produced
|
||||
@@ -293,30 +313,6 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
|
||||
catcher.UpdateSize()
|
||||
return changed
|
||||
|
||||
proc/LosePlasma()
|
||||
if(held_plasma.toxins > 1)
|
||||
//lose a random amount of plasma back into the air, increased by the field strength (want to switch this over to frequency eventually)
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/loss_ratio = rand() * (0.05 + (0.05 * 50 / field_strength))
|
||||
//world << "lost [loss_ratio*100]% of held plasma"
|
||||
//
|
||||
var/datum/gas_mixture/plasma_lost = new
|
||||
plasma_lost.temperature = held_plasma.temperature
|
||||
//
|
||||
plasma_lost.toxins = held_plasma.toxins * loss_ratio
|
||||
plasma_lost.update_values()
|
||||
held_plasma.toxins -= held_plasma.toxins * loss_ratio
|
||||
held_plasma.update_values()
|
||||
//
|
||||
environment.merge(plasma_lost)
|
||||
radiation += loss_ratio * mega_energy * 0.1
|
||||
mega_energy -= loss_ratio * mega_energy * 0.1
|
||||
return 1
|
||||
else
|
||||
held_plasma.toxins = 0
|
||||
held_plasma.update_values()
|
||||
return 0
|
||||
|
||||
//the !!fun!! part
|
||||
//reactions have to be individually hardcoded, see AttemptReaction() below this
|
||||
proc/React()
|
||||
|
||||
@@ -104,11 +104,11 @@
|
||||
user.machine = null
|
||||
user << browse(null, "window=fuel_injector")
|
||||
return
|
||||
var/t = "<B>Reactor Core Fuel Injector</B><BR>"
|
||||
var/t = "<B>Reactor Core Fuel Injector</B><hr>"
|
||||
t += "<b>Stage:</b> <font color=blue>[stage]</font><br>"
|
||||
t += "<b>Status:</b> [injecting ? "<font color=green>Active</font> <a href='?src=\ref[src];end_injecting=1'>\[Disable\]</a>" : "<font color=blue>Standby</font> <a href='?src=\ref[src];begin_injecting=1'>\[Enable\]</a>"]<br>"
|
||||
t += "<b>Interval (sec):</b> <font color=blue>[rate/10]</font> <a href='?src=\ref[src];cyclerate=1'>\[Modify\]</a>"
|
||||
t += "<b>Fuel usage:</b> [fuel_usage*100]% <a href='?src=\ref[src];fuel_usage=1'>\[Modify\]</a>"
|
||||
t += "<b>Interval (sec):</b> <font color=blue>[rate/10]</font> <a href='?src=\ref[src];cyclerate=1'>\[Modify\]</a><br>"
|
||||
t += "<b>Fuel usage:</b> [fuel_usage*100]% <a href='?src=\ref[src];fuel_usage=1'>\[Modify\]</a><br>"
|
||||
/*
|
||||
var/t = "<B>Reactor Core Fuel Control</B><BR>"
|
||||
t += "Current fuel injection stage: [active_stage]<br>"
|
||||
@@ -146,6 +146,7 @@
|
||||
t += "</tr>"
|
||||
t += "</table>"
|
||||
*/
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=fuel_injector;size=500x800")
|
||||
user.machine = src
|
||||
@@ -178,26 +179,21 @@
|
||||
for(var/reagent in owned_assembly_port.cur_assembly.rod_quantities)
|
||||
//world << "checking [reagent]"
|
||||
if(owned_assembly_port.cur_assembly.rod_quantities[reagent] > 0)
|
||||
//world << " rods left: [owned_assembly_port.cur_assembly.rod_quantities[reagent]]]
|
||||
//world << " rods left: [owned_assembly_port.cur_assembly.rod_quantities[reagent]]"
|
||||
var/amount = owned_assembly_port.cur_assembly.rod_quantities[reagent] * fuel_usage
|
||||
var/numparticles = round(amount * 1000)
|
||||
if(numparticles < 1)
|
||||
numparticles = 1
|
||||
//world << " amount: [amount]"
|
||||
//world << " numparticles: [numparticles]"
|
||||
for(var/i=0, i<numparticles, i++)
|
||||
var/obj/effect/accelerated_particle/particle = new(src.loc, src.dir)
|
||||
particle.particle_type = reagent
|
||||
particle.energy = 0
|
||||
particle.icon_state = "particle_single"
|
||||
particle.pixel_x = rand(-10,10)
|
||||
particle.pixel_y = rand(-10,10)
|
||||
var/extra_particles = round(rand(0, numparticles - i - 1))
|
||||
//world << "[extra_particles + 1] [reagent] particles"
|
||||
particle.additional_particles = extra_particles
|
||||
particle.target = target_field
|
||||
i += extra_particles
|
||||
//world << "[reagent] particle injected"
|
||||
//
|
||||
var/obj/effect/accelerated_particle/particle = new/obj/effect/accelerated_particle(src.loc, src.dir)
|
||||
particle.particle_type = reagent
|
||||
particle.energy = 0
|
||||
particle.icon_state = "particle"
|
||||
particle.additional_particles = numparticles - 1
|
||||
particle.target = target_field
|
||||
//
|
||||
owned_assembly_port.cur_assembly.rod_quantities[reagent] -= amount
|
||||
amount_left += owned_assembly_port.cur_assembly.rod_quantities[reagent]
|
||||
owned_assembly_port.cur_assembly.amount_depleted = amount_left / 300
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
//links to a power monitor computer and transmits the amount of energy in the associated powercable network
|
||||
//uses the navbeacon sprite and transmits data via magic for now
|
||||
|
||||
/obj/machinery/powermonitor
|
||||
|
||||
icon = 'objects.dmi'
|
||||
icon_state = "navbeacon0-f"
|
||||
name = "power monitor"
|
||||
desc = "A monitoring device used to track power in a cable network."
|
||||
level = 1 // underfloor
|
||||
layer = 2.5
|
||||
anchored = 1
|
||||
|
||||
var/freq = 1427 // radio frequency
|
||||
var/powernet_tag = "" //the text tag associated with this power monitor's network
|
||||
var/open = 0 // true if cover is open
|
||||
var/locked = 1 // true if controls are locked
|
||||
var/list/codes // assoc. list of transponder codes
|
||||
var/codes_txt = "" // codes as set on map: "tag1;tag2" or "tag1=value;tag2=value"
|
||||
|
||||
req_access = list(access_engine)
|
||||
|
||||
New()
|
||||
..()
|
||||
var/turf/T = loc
|
||||
hide(T.intact)
|
||||
|
||||
set_codes()
|
||||
|
||||
spawn(5) // must wait for map loading to finish
|
||||
if(radio_controller)
|
||||
radio_controller.add_object(src, freq, RADIO_POWER)
|
||||
|
||||
// set the transponder codes assoc list from codes_txt
|
||||
proc/set_codes()
|
||||
if(!codes_txt)
|
||||
return
|
||||
|
||||
codes = new()
|
||||
|
||||
var/list/entries = dd_text2List(codes_txt, ";") // entries are separated by semicolons
|
||||
|
||||
for(var/e in entries)
|
||||
var/index = findtext(e, "=") // format is "key=value"
|
||||
if(index)
|
||||
var/key = copytext(e, 1, index)
|
||||
var/val = copytext(e, index+1)
|
||||
codes[key] = val
|
||||
else
|
||||
codes[e] = "1"
|
||||
|
||||
// called when turf state changes
|
||||
// hide the object if turf is intact
|
||||
hide(var/intact)
|
||||
invisibility = intact ? 101 : 0
|
||||
updateicon()
|
||||
|
||||
// update the icon_state
|
||||
proc/updateicon()
|
||||
var/state="navbeacon[open]"
|
||||
if(invisibility)
|
||||
icon_state = "[state]-f" // if invisible, set icon to faded version
|
||||
// in case revealed by T-scanner
|
||||
else
|
||||
icon_state = "[state]"
|
||||
|
||||
// look for a signal of the form "getpowerlevel"
|
||||
// where X is any
|
||||
// or the location
|
||||
// or one of the set transponder keys
|
||||
// if found, return a signal
|
||||
receive_signal(datum/signal/signal)
|
||||
|
||||
var/request = signal.data["getpowermonitor"]
|
||||
if(request && (request == "any" || request == powernet_tag) )
|
||||
spawn(1)
|
||||
post_signal()
|
||||
|
||||
// return a signal giving the power network energy level
|
||||
proc/post_signal()
|
||||
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(freq)
|
||||
|
||||
if(!frequency) return
|
||||
|
||||
var/datum/signal/signal = new()
|
||||
signal.source = src
|
||||
signal.transmission_method = 1
|
||||
signal.data["powerlevel"] = 1 //TODO
|
||||
|
||||
for(var/key in codes)
|
||||
signal.data[key] = codes[key]
|
||||
|
||||
frequency.post_signal(src, signal, filter = RADIO_POWER)
|
||||
|
||||
attackby(var/obj/item/I, var/mob/user)
|
||||
var/turf/T = loc
|
||||
if(T.intact)
|
||||
return // prevent intraction when T-scanner revealed
|
||||
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
open = !open
|
||||
|
||||
user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.")
|
||||
|
||||
updateicon()
|
||||
|
||||
else if (istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda))
|
||||
if(open)
|
||||
if (src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
updateDialog()
|
||||
else
|
||||
user << "You must open the cover first!"
|
||||
return
|
||||
|
||||
attack_ai(var/mob/user)
|
||||
interact(user, 1)
|
||||
|
||||
attack_paw()
|
||||
return
|
||||
|
||||
attack_hand(var/mob/user)
|
||||
interact(user, 0)
|
||||
|
||||
proc/interact(var/mob/user, var/ai = 0)
|
||||
var/turf/T = loc
|
||||
if(T.intact)
|
||||
return // prevent intraction when T-scanner revealed
|
||||
|
||||
if(!open && !ai) // can't alter controls if not open, unless you're an AI
|
||||
user << "The monitor's control cover is closed."
|
||||
return
|
||||
|
||||
var/dat = "<TT><B>Navigation Beacon</B><HR>"
|
||||
if(locked && !ai)
|
||||
dat += "<i>(swipe card to unlock controls)</i><BR>"
|
||||
else if(!ai)
|
||||
dat += "<i>(swipe card to lock controls)</i><BR>"
|
||||
|
||||
dat += "Frequency: "
|
||||
if(!locked)
|
||||
dat += "<A href='byond://?src=\ref[src];freq=-10'>-</A>"
|
||||
dat += "<A href='byond://?src=\ref[src];freq=-2'>-</A>"
|
||||
dat += "[format_frequency(freq)]"
|
||||
if(!locked)
|
||||
dat += "<A href='byond://?src=\ref[src];freq=2'>+</A>"
|
||||
dat += "<A href='byond://?src=\ref[src];freq=10'>+</A>"
|
||||
dat += "<hr>"
|
||||
|
||||
dat += "Power network tag: [powernet_tag ? powernet_tag : "(none)"]</A><BR>"
|
||||
dat += "Transponder Codes:<UL>"
|
||||
for(var/key in codes)
|
||||
dat += "<LI>[key] ... [codes[key]]"
|
||||
if(!locked)
|
||||
dat += " <small><A href='byond://?src=\ref[src];edit=1;code=[key]'>(edit)</A>"
|
||||
dat += " <A href='byond://?src=\ref[src];delete=1;code=[key]'>(delete)</A></small><BR>"
|
||||
if(!locked)
|
||||
dat += "<small><A href='byond://?src=\ref[src];add=1;'>(add new)</A></small><BR>"
|
||||
dat += "<UL></TT>"
|
||||
|
||||
user << browse(dat, "window=powermonitor")
|
||||
onclose(user, "powermonitor")
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if (usr.stat)
|
||||
return
|
||||
if ((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
|
||||
if(open && !locked)
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["freq"])
|
||||
freq = sanitize_frequency(freq + text2num(href_list["freq"]))
|
||||
updateDialog()
|
||||
|
||||
else if(href_list["modifytag"])
|
||||
var/newtag = input("Enter new power network tag", "Power Monitor", powernet_tag) as text|null
|
||||
if(newtag)
|
||||
powernet_tag = newtag
|
||||
updateDialog()
|
||||
|
||||
else if(href_list["edit"])
|
||||
var/codekey = href_list["code"]
|
||||
|
||||
var/newkey = input("Enter Transponder Code Key", "Power Monitor", codekey) as text|null
|
||||
if(!newkey)
|
||||
return
|
||||
|
||||
var/codeval = codes[codekey]
|
||||
var/newval = input("Enter Transponder Code Value", "Power Monitor", codeval) as text|null
|
||||
if(!newval)
|
||||
newval = codekey
|
||||
return
|
||||
|
||||
codes.Remove(codekey)
|
||||
codes[newkey] = newval
|
||||
|
||||
updateDialog()
|
||||
|
||||
else if(href_list["delete"])
|
||||
var/codekey = href_list["code"]
|
||||
codes.Remove(codekey)
|
||||
updateDialog()
|
||||
|
||||
else if(href_list["add"])
|
||||
|
||||
var/newkey = input("Enter New Transponder Code Key", "Power Monitor") as text|null
|
||||
if(!newkey)
|
||||
return
|
||||
|
||||
var/newval = input("Enter New Transponder Code Value", "Power Monitor") as text|null
|
||||
if(!newval)
|
||||
newval = "1"
|
||||
return
|
||||
|
||||
if(!codes)
|
||||
codes = new()
|
||||
|
||||
codes[newkey] = newval
|
||||
|
||||
updateDialog()
|
||||
@@ -132,6 +132,7 @@ var/const/RADIO_AIRLOCK = "6"
|
||||
var/const/RADIO_SECBOT = "7"
|
||||
var/const/RADIO_MULEBOT = "8"
|
||||
var/const/RADIO_MAGNETS = "9"
|
||||
var/const/RADIO_POWER = "10"
|
||||
|
||||
var/global/datum/controller/radio/radio_controller
|
||||
|
||||
|
||||
+110
-79
@@ -30,11 +30,15 @@
|
||||
if(..())
|
||||
return
|
||||
|
||||
if( href_list["view"] )
|
||||
usr.client.eye = src
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=turbinegen")
|
||||
usr.machine = null
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
else if( href_list["str"] )
|
||||
starter = !starter
|
||||
src.updateDialog()
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
#define COMPFRICTION 5e5
|
||||
#define COMPSTARTERLOAD 2800
|
||||
@@ -72,6 +76,31 @@
|
||||
overlays += image('pipes.dmi', "comp-o1", FLY_LAYER)
|
||||
//TODO: DEFERRED
|
||||
|
||||
attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_paw(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<TT><B>Gas turbine generator</B><HR>"
|
||||
if(turbine)
|
||||
dat += "Turbine status: [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>"]<BR>"
|
||||
dat += "Turbine speed: [rpm]rpm<BR>"
|
||||
dat += "Power currently being generated: [turbine.lastgen]W<BR>"
|
||||
dat += "Internal gas temperature: [gas_contained.temperature]K<BR>"
|
||||
else
|
||||
dat += "\red No turbine found.<br>"
|
||||
dat += "<HR>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> <A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
|
||||
user << browse(dat, "window=turbinegen;size=400x500")
|
||||
onclose(user, "turbinegen")
|
||||
|
||||
/obj/machinery/power/turbine
|
||||
name = "gas turbine generator"
|
||||
desc = "A gas turbine used for backup power generation."
|
||||
@@ -92,7 +121,6 @@
|
||||
if(!compressor)
|
||||
stat |= BROKEN
|
||||
|
||||
|
||||
#define TURBPRES 9000000
|
||||
#define TURBGENQ 20000
|
||||
#define TURBGENG 0.8
|
||||
@@ -123,65 +151,40 @@
|
||||
if(lastgen > 100)
|
||||
overlays += image('pipes.dmi', "turb-o", FLY_LAYER)
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.interact(M)
|
||||
AutoUpdateAI(src)
|
||||
attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_ai(mob/user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
interact(user)
|
||||
attack_paw(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
interact(user)
|
||||
|
||||
proc/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (NOPOWER|BROKEN)) && (!istype(user, /mob/living/silicon/ai)) )
|
||||
user.machine = null
|
||||
user << browse(null, "window=turbine")
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
var/t = "<TT><B>Gas Turbine Generator</B><HR>"
|
||||
t += "Generated power : [round(lastgen)] W<BR>"
|
||||
t += "Turbine: [round(compressor.rpm)] RPM<BR>"
|
||||
t += "Starter: [ 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>"]"
|
||||
t += "<HR>"
|
||||
t += "<A href='?src=\ref[src];refresh=1'>Refresh</A> <A href='?src=\ref[src];close=1'>Close</A>"
|
||||
var/dat = "<TT><B>Gas turbine generator</B><HR>"
|
||||
if(compressor)
|
||||
dat += "Turbine status: [compressor.starter ? "<A href='?src=\ref[compressor];str=1'>Off</A> <B>On</B>" : "<B>Off</B> <A href='?src=\ref[compressor];str=1'>On</A>"]<BR>"
|
||||
dat += "Turbine speed: [compressor.rpm]rpm<BR>"
|
||||
dat += "Power currently being generated: [lastgen]W<BR>"
|
||||
dat += "Internal gas temperature: [compressor.gas_contained.temperature]K<BR>"
|
||||
else
|
||||
dat += "\red No compressor found.<br>"
|
||||
dat += "<HR>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> <A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
|
||||
user << browse(t, "window=turbine")
|
||||
onclose(user, "turbine")
|
||||
return
|
||||
user << browse(dat, "window=turbinegen;size=400x500")
|
||||
onclose(user, "turbinegen")
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if(stat & BROKEN)
|
||||
if(..())
|
||||
return
|
||||
if (usr.stat || usr.restrained() )
|
||||
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"] )
|
||||
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")
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=turbinegen")
|
||||
usr.machine = null
|
||||
return
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -200,6 +203,7 @@
|
||||
New()
|
||||
..()
|
||||
compressors = new/list()
|
||||
doors = new/list()
|
||||
spawn(5)
|
||||
for(var/obj/machinery/compressor/C in world)
|
||||
if(src.vent_network == C.comp_id)
|
||||
@@ -208,6 +212,22 @@
|
||||
if(src.vent_network == D.networkTag)
|
||||
doors.Add(D)
|
||||
|
||||
process()
|
||||
..()
|
||||
src.updateDialog()
|
||||
|
||||
power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
else
|
||||
if( powered() )
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "c_unpowered"
|
||||
stat |= NOPOWER
|
||||
|
||||
/*
|
||||
/obj/machinery/computer/turbine_computer/attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
@@ -243,42 +263,48 @@
|
||||
return
|
||||
*/
|
||||
|
||||
attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_paw(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
interact()
|
||||
return
|
||||
|
||||
proc/interact()
|
||||
if ( (get_dist(src, usr) > 1 ) || (stat & (NOPOWER|BROKEN)) && (!istype(usr, /mob/living/silicon/ai)) )
|
||||
usr.machine = null
|
||||
usr << browse(null, "window=turbinecomp")
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<TT><B>Gas turbine remote control system</B><HR>"
|
||||
var/dat = "<TT><B>Gas turbine remote control system</B>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> <A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
dat += "<HR>"
|
||||
|
||||
if(src.doors.len)
|
||||
var/closed = 0
|
||||
for(var/obj/machinery/door/poddoor/D in src.doors)
|
||||
if(D.density)
|
||||
closed = 1
|
||||
dat += "Connected vent status: <font color=blue>[closed ? "<b>Closed</b> <a href='?src=\ref[src];opendoors=1'>\[Open\]</a>" : "<b>Open</b> <a href='?src=\ref[src];closedoors=1'>\[Close\]</a>"]</font>"
|
||||
dat += "Connected vent door status: <font color=blue>[closed ? "<b>Closed</b> <a href='?src=\ref[src];opendoors=1'>\[Open\]</a>" : "<a href='?src=\ref[src];closedoors=1'>\[Close\]</a> <b>Open</b>"]</font>"
|
||||
else
|
||||
dat += "<font color=red><b>No vents connected.</b></font>"
|
||||
dat += "<hr>"
|
||||
|
||||
if(src.compressors.len)
|
||||
for(var/obj/machinery/compressor/C in compressors)
|
||||
dat += "Turbine status: [C.starter ? "<A href='?src=\ref[C];str=1'>Off</A> <B>On</B>" : "<B>Off</B> <A href='?src=\ref[C];str=1'>On</A>"]<BR>"
|
||||
dat += "Turbine speed: [C.rpm]rpm<BR>"
|
||||
dat += "Power currently being generated: [C.turbine.lastgen]W<BR>"
|
||||
dat += "Internal gas temperature: [C.gas_contained.temperature]K<BR>"
|
||||
dat += "<A href='?src=\ref[src];view=1'>View</A><BR>"
|
||||
if(C.turbine)
|
||||
dat += "Turbine status: [C.starter ? "<A href='?src=\ref[src];str=1;comp=\ref[C]'>Off</A> <B>On</B>" : "<B>Off</B> <A href='?src=\ref[src];str=1;comp=\ref[C]'>On</A>"]<BR>"
|
||||
dat += "Turbine speed: [C.rpm]rpm<BR>"
|
||||
dat += "Power currently being generated: [C.turbine.lastgen]W<BR>"
|
||||
dat += "Internal gas temperature: [C.gas_contained.temperature]K<BR>"
|
||||
dat += "<A href='?src=\ref[src];view=1;comp=\ref[C]'>View</A><BR>"
|
||||
else
|
||||
dat += "\red Invalid turbine/compressor configuration.<br>"
|
||||
dat += "<HR>"
|
||||
else
|
||||
dat += "\red<B>No compatible attached compressors found."
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> <A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
|
||||
usr << browse(dat, "window=turbinecomp;size=400x500")
|
||||
onclose(usr, "turbinecomp")
|
||||
user << browse(dat, "window=turbinecomp;size=400x500")
|
||||
onclose(user, "turbinecomp")
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
@@ -288,19 +314,24 @@
|
||||
for(var/obj/machinery/door/poddoor/D in src.doors)
|
||||
spawn(0)
|
||||
D.open()
|
||||
if (href_list["closedoors"])
|
||||
src.updateDialog()
|
||||
else if (href_list["closedoors"])
|
||||
for(var/obj/machinery/door/poddoor/D in src.doors)
|
||||
spawn(0)
|
||||
D.close()
|
||||
src.updateDialog()
|
||||
|
||||
else if( href_list["view"] )
|
||||
var/obj/machinery/compressor/C = locate(href_list["comp"])
|
||||
if(C)
|
||||
usr.client.eye = C
|
||||
else if( href_list["str"] )
|
||||
var/obj/machinery/compressor/C = locate(href_list["comp"])
|
||||
if(C)
|
||||
C.starter = !C.starter
|
||||
|
||||
else if( href_list["close"] )
|
||||
usr << browse(null, "window=turbinecomp")
|
||||
usr.machine = null
|
||||
return
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
process()
|
||||
src.updateDialog()
|
||||
return
|
||||
Reference in New Issue
Block a user