mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-31 00:49:06 +01:00
Removes Old Deprecated Stuff (#15241)
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
/obj/item/stack/cable_coil/heavyduty
|
||||
name = "heavy-duty power cable"
|
||||
desc = "A tough, heavy-duty coil of power cable."
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "wire"
|
||||
item_state = "wire"
|
||||
color = null
|
||||
|
||||
/obj/structure/cable/heavyduty
|
||||
icon = 'icons/obj/power_cond_heavy.dmi'
|
||||
name = "large power cable"
|
||||
desc = "This cable is tough. It cannot be cut with simple hand tools."
|
||||
layer = 2.39 //Just below pipes, which are at 2.4
|
||||
|
||||
/obj/structure/cable/heavyduty/attackby(obj/item/W, mob/user)
|
||||
|
||||
var/turf/T = src.loc
|
||||
if(!T.is_plating())
|
||||
return
|
||||
|
||||
if(W.iswirecutter())
|
||||
to_chat(usr, "<span class='notice'>These cables are too tough to be cut with those [W.name].</span>")
|
||||
return
|
||||
else if(W.iscoil())
|
||||
to_chat(usr, "<span class='notice'>You will need heavier cables to connect to these.</span>")
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/structure/cable/heavyduty/cableColor(var/colorC)
|
||||
return
|
||||
@@ -1,292 +0,0 @@
|
||||
#define LOGIC_HIGH 5
|
||||
|
||||
//Indicators only have one input and no outputs
|
||||
/obj/machinery/logic/indicator
|
||||
//Input is searched from the 'dir' direction
|
||||
var/obj/structure/cable/input
|
||||
|
||||
/obj/machinery/logic/indicator/process()
|
||||
if(input)
|
||||
return 1
|
||||
|
||||
|
||||
if(!input)
|
||||
var/turf/T = get_step(src, dir)
|
||||
if(T)
|
||||
var/inv_dir = turn(dir, 180)
|
||||
for(var/obj/structure/cable/C in T)
|
||||
if(C.d1 == inv_dir || C.d2 == inv_dir)
|
||||
input = C
|
||||
return 1
|
||||
|
||||
return 0 //If it gets to here, it means no suitable wire to link to was found.
|
||||
|
||||
/obj/machinery/logic/indicator/bulb
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
icon_state = "bulb0"
|
||||
|
||||
/obj/machinery/logic/indicator/bulb/process()
|
||||
if(!..()) //Parent proc checks if input1 exists.
|
||||
return
|
||||
|
||||
var/datum/powernet/pn_input = input.powernet
|
||||
if(!pn_input)
|
||||
return
|
||||
|
||||
if(pn_input.avail >= LOGIC_HIGH)
|
||||
icon_state = "bulb1"
|
||||
else
|
||||
icon_state = "bulb0"
|
||||
|
||||
|
||||
|
||||
|
||||
//Sensors only have one output and no inputs
|
||||
/obj/machinery/logic/sensor
|
||||
//Output is searched from the 'dir' direction
|
||||
var/obj/structure/cable/output
|
||||
|
||||
/obj/machinery/logic/sensor/process()
|
||||
if(output)
|
||||
return 1
|
||||
|
||||
if(!output)
|
||||
var/turf/T = get_step(src, dir)
|
||||
if(T)
|
||||
var/inv_dir = turn(dir, 180)
|
||||
for(var/obj/structure/cable/C in T)
|
||||
if(C.d1 == inv_dir || C.d2 == inv_dir)
|
||||
output = C
|
||||
return 1
|
||||
|
||||
return 0 //If it gets to here, it means no suitable wire to link to was found.
|
||||
|
||||
//Constant high generator. This will continue to send a signal of LOGIC_HIGH as long as it exists.
|
||||
/obj/machinery/logic/sensor/constant_high
|
||||
icon = 'icons/obj/atmospherics/outlet_injector.dmi'
|
||||
icon_state = "off"
|
||||
|
||||
/obj/machinery/logic/sensor/constant_high/process()
|
||||
if(!..()) //Parent proc checks if input1 exists.
|
||||
return
|
||||
|
||||
var/datum/powernet/pn_output = output.powernet
|
||||
if(!pn_output)
|
||||
return
|
||||
|
||||
pn_output.newavail = max(pn_output.avail, LOGIC_HIGH)
|
||||
|
||||
|
||||
|
||||
|
||||
//ONE INPUT logic elements have one input and one output
|
||||
/obj/machinery/logic/oneinput
|
||||
var/dir_input = 2
|
||||
var/dir_output = 1
|
||||
var/obj/structure/cable/input
|
||||
var/obj/structure/cable/output
|
||||
icon = 'icons/atmos/heat.dmi'
|
||||
icon_state = "intact"
|
||||
|
||||
/obj/machinery/logic/oneinput/process()
|
||||
if(input && output)
|
||||
return 1
|
||||
|
||||
if(!dir_input || !dir_output)
|
||||
return 0
|
||||
|
||||
if(!input)
|
||||
var/turf/T = get_step(src, dir_input)
|
||||
if(T)
|
||||
var/inv_dir = turn(dir_input, 180)
|
||||
for(var/obj/structure/cable/C in T)
|
||||
if(C.d1 == inv_dir || C.d2 == inv_dir)
|
||||
input = C
|
||||
|
||||
if(!output)
|
||||
var/turf/T = get_step(src, dir_output)
|
||||
if(T)
|
||||
var/inv_dir = turn(dir_output, 180)
|
||||
for(var/obj/structure/cable/C in T)
|
||||
if(C.d1 == inv_dir || C.d2 == inv_dir)
|
||||
output = C
|
||||
|
||||
return 0 //On the process() call, where everything is still being searched for, it returns 0. It will return 1 on the next process() call.
|
||||
|
||||
//NOT GATE
|
||||
/obj/machinery/logic/oneinput/not/process()
|
||||
if(!..()) //Parent proc checks if input1, input2 and output exist.
|
||||
return
|
||||
|
||||
var/datum/powernet/pn_input = input.powernet
|
||||
|
||||
if(!pn_input)
|
||||
return
|
||||
|
||||
var/datum/powernet/pn_output = output.powernet
|
||||
if(!pn_output)
|
||||
return
|
||||
|
||||
if( !(pn_input.avail >= LOGIC_HIGH))
|
||||
pn_output.newavail = max(pn_output.avail, LOGIC_HIGH) //Set the output avilable power to 5 or whatever it was before.
|
||||
else
|
||||
pn_output.draw_power(LOGIC_HIGH) //Otherwise increase the load to 5
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//TWO INPUT logic elements have two inputs and one output
|
||||
/obj/machinery/logic/twoinput
|
||||
var/dir_input1 = 2
|
||||
var/dir_input2 = 8
|
||||
var/dir_output = 1
|
||||
var/obj/structure/cable/input1
|
||||
var/obj/structure/cable/input2
|
||||
var/obj/structure/cable/output
|
||||
icon = 'icons/obj/atmospherics/mixer.dmi'
|
||||
icon_state = "intact_off"
|
||||
|
||||
/obj/machinery/logic/twoinput/process()
|
||||
if(input1 && input2 && output)
|
||||
return 1
|
||||
|
||||
if(!dir_input1 || !dir_input2 || !dir_output)
|
||||
return 0
|
||||
|
||||
if(!input1)
|
||||
var/turf/T = get_step(src, dir_input1)
|
||||
if(T)
|
||||
var/inv_dir = turn(dir_input1, 180)
|
||||
for(var/obj/structure/cable/C in T)
|
||||
if(C.d1 == inv_dir || C.d2 == inv_dir)
|
||||
input1 = C
|
||||
|
||||
if(!input2)
|
||||
var/turf/T = get_step(src, dir_input2)
|
||||
if(T)
|
||||
var/inv_dir = turn(dir_input2, 180)
|
||||
for(var/obj/structure/cable/C in T)
|
||||
if(C.d1 == inv_dir || C.d2 == inv_dir)
|
||||
input2 = C
|
||||
|
||||
if(!output)
|
||||
var/turf/T = get_step(src, dir_output)
|
||||
if(T)
|
||||
var/inv_dir = turn(dir_output, 180)
|
||||
for(var/obj/structure/cable/C in T)
|
||||
if(C.d1 == inv_dir || C.d2 == inv_dir)
|
||||
output = C
|
||||
|
||||
return 0 //On the process() call, where everything is still being searched for, it returns 0. It will return 1 on the next process() call.
|
||||
|
||||
//AND GATE
|
||||
/obj/machinery/logic/twoinput/and/process()
|
||||
if(!..()) //Parent proc checks if input1, input2 and output exist.
|
||||
return
|
||||
|
||||
var/datum/powernet/pn_input1 = input1.powernet
|
||||
var/datum/powernet/pn_input2 = input2.powernet
|
||||
|
||||
if(!pn_input1 || !pn_input2)
|
||||
return
|
||||
|
||||
var/datum/powernet/pn_output = output.powernet
|
||||
if(!pn_output)
|
||||
return
|
||||
|
||||
if( (pn_input1.avail >= LOGIC_HIGH) && (pn_input2.avail >= LOGIC_HIGH) )
|
||||
pn_output.newavail = max(pn_output.avail, LOGIC_HIGH) //Set the output avilable power to 5 or whatever it was before.
|
||||
else
|
||||
pn_output.draw_power(LOGIC_HIGH) //Otherwise increase the load to 5
|
||||
|
||||
//OR GATE
|
||||
/obj/machinery/logic/twoinput/or/process()
|
||||
if(!..()) //Parent proc checks if input1, input2 and output exist.
|
||||
return
|
||||
|
||||
var/datum/powernet/pn_input1 = input1.powernet
|
||||
var/datum/powernet/pn_input2 = input2.powernet
|
||||
|
||||
if(!pn_input1 || !pn_input2)
|
||||
return
|
||||
|
||||
var/datum/powernet/pn_output = output.powernet
|
||||
if(!pn_output)
|
||||
return
|
||||
|
||||
if( (pn_input1.avail >= LOGIC_HIGH) || (pn_input2.avail >= LOGIC_HIGH) )
|
||||
pn_output.newavail = max(pn_output.avail, LOGIC_HIGH) //Set the output avilable power to 5 or whatever it was before.
|
||||
else
|
||||
pn_output.draw_power(LOGIC_HIGH) //Otherwise increase the load to 5
|
||||
|
||||
//XOR GATE
|
||||
/obj/machinery/logic/twoinput/xor/process()
|
||||
if(!..()) //Parent proc checks if input1, input2 and output exist.
|
||||
return
|
||||
|
||||
var/datum/powernet/pn_input1 = input1.powernet
|
||||
var/datum/powernet/pn_input2 = input2.powernet
|
||||
|
||||
if(!pn_input1 || !pn_input2)
|
||||
return
|
||||
|
||||
var/datum/powernet/pn_output = output.powernet
|
||||
if(!pn_output)
|
||||
return
|
||||
|
||||
if( (pn_input1.avail >= LOGIC_HIGH) != (pn_input2.avail >= LOGIC_HIGH) )
|
||||
pn_output.newavail = max(pn_output.avail, LOGIC_HIGH) //Set the output avilable power to 5 or whatever it was before.
|
||||
else
|
||||
pn_output.draw_power(LOGIC_HIGH) //Otherwise increase the load to 5
|
||||
|
||||
//XNOR GATE (EQUIVALENCE)
|
||||
/obj/machinery/logic/twoinput/xnor/process()
|
||||
if(!..()) //Parent proc checks if input1, input2 and output exist.
|
||||
return
|
||||
|
||||
var/datum/powernet/pn_input1 = input1.powernet
|
||||
var/datum/powernet/pn_input2 = input2.powernet
|
||||
|
||||
if(!pn_input1 || !pn_input2)
|
||||
return
|
||||
|
||||
var/datum/powernet/pn_output = output.powernet
|
||||
if(!pn_output)
|
||||
return
|
||||
|
||||
if( (pn_input1.avail >= LOGIC_HIGH) == (pn_input2.avail >= LOGIC_HIGH) )
|
||||
pn_output.newavail = max(pn_output.avail, LOGIC_HIGH) //Set the output avilable power to 5 or whatever it was before.
|
||||
else
|
||||
pn_output.draw_power(LOGIC_HIGH) //Otherwise increase the load to 5
|
||||
|
||||
#define RELAY_POWER_TRANSFER 2000 //How much power a relay transfers through.
|
||||
|
||||
//RELAY - input1 governs the flow from input2 to output
|
||||
/obj/machinery/logic/twoinput/relay/process()
|
||||
if(!..()) //Parent proc checks if input1, input2 and output exist.
|
||||
return
|
||||
|
||||
var/datum/powernet/pn_input1 = input1.powernet
|
||||
|
||||
if(!pn_input1)
|
||||
return
|
||||
|
||||
if( pn_input1.avail >= LOGIC_HIGH )
|
||||
var/datum/powernet/pn_input2 = input2.powernet
|
||||
var/datum/powernet/pn_output = output.powernet
|
||||
|
||||
if(!pn_output)
|
||||
return
|
||||
|
||||
if(pn_input2.avail >= RELAY_POWER_TRANSFER)
|
||||
pn_input2.draw_power(RELAY_POWER_TRANSFER)
|
||||
pn_output.newavail += RELAY_POWER_TRANSFER
|
||||
|
||||
|
||||
#undef RELAY_POWER_TRANSFER
|
||||
#undef LOGIC_HIGH
|
||||
@@ -1,138 +0,0 @@
|
||||
/obj/machinery/power/generator_type2
|
||||
name = "thermoelectric generator"
|
||||
desc = "It's a high efficiency thermoelectric generator."
|
||||
icon_state = "teg"
|
||||
anchored = 1
|
||||
density = 1
|
||||
use_power = POWER_USE_OFF
|
||||
|
||||
var/obj/machinery/atmospherics/unary/generator_input/input1
|
||||
var/obj/machinery/atmospherics/unary/generator_input/input2
|
||||
|
||||
var/lastgen = 0
|
||||
var/lastgenlev = -1
|
||||
|
||||
|
||||
/obj/machinery/power/generator_type2/Initialize()
|
||||
. = ..()
|
||||
input1 = locate(/obj/machinery/atmospherics/unary/generator_input) in get_step(src,turn(dir, 90))
|
||||
input2 = locate(/obj/machinery/atmospherics/unary/generator_input) in get_step(src,turn(dir, -90))
|
||||
if(!input1 || !input2)
|
||||
stat |= BROKEN
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/power/generator_type2/update_icon()
|
||||
cut_overlays()
|
||||
if(!(stat & (NOPOWER|BROKEN)))
|
||||
if(lastgenlev != 0)
|
||||
add_overlay("teg-op[lastgenlev]")
|
||||
|
||||
#define GENRATE 800 // generator output coefficient from Q
|
||||
|
||||
|
||||
/obj/machinery/power/generator_type2/process()
|
||||
if(!input1 || !input2)
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/air1 = input1.return_exchange_air()
|
||||
var/datum/gas_mixture/air2 = input2.return_exchange_air()
|
||||
|
||||
|
||||
lastgen = 0
|
||||
|
||||
if(air1 && air2)
|
||||
var/datum/gas_mixture/hot_air = air1
|
||||
var/datum/gas_mixture/cold_air = air2
|
||||
if(hot_air.temperature < cold_air.temperature)
|
||||
hot_air = air2
|
||||
cold_air = air1
|
||||
|
||||
var/hot_air_heat_capacity = hot_air.heat_capacity()
|
||||
var/cold_air_heat_capacity = cold_air.heat_capacity()
|
||||
|
||||
var/delta_temperature = hot_air.temperature - cold_air.temperature
|
||||
|
||||
if(delta_temperature > 1 && cold_air_heat_capacity > 0.01 && hot_air_heat_capacity > 0.01)
|
||||
var/efficiency = (1 - cold_air.temperature/hot_air.temperature)*0.65 //65% of Carnot efficiency
|
||||
|
||||
var/energy_transfer = delta_temperature*hot_air_heat_capacity*cold_air_heat_capacity/(hot_air_heat_capacity+cold_air_heat_capacity)
|
||||
|
||||
var/heat = energy_transfer*(1-efficiency)
|
||||
lastgen = energy_transfer*efficiency
|
||||
|
||||
hot_air.temperature = hot_air.temperature - energy_transfer/hot_air_heat_capacity
|
||||
cold_air.temperature = cold_air.temperature + heat/cold_air_heat_capacity
|
||||
|
||||
if(input1.network)
|
||||
input1.network.update = 1
|
||||
|
||||
if(input2.network)
|
||||
input2.network.update = 1
|
||||
|
||||
add_avail(lastgen)
|
||||
// update icon overlays only if displayed level has changed
|
||||
|
||||
var/genlev = max(0, min( round(11*lastgen / 100000), 11))
|
||||
if(genlev != lastgenlev)
|
||||
lastgenlev = genlev
|
||||
update_icon()
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
|
||||
/obj/machinery/power/generator_type2/attack_ai(mob/user)
|
||||
if(!ai_can_interact(user))
|
||||
return
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
interact(user)
|
||||
|
||||
|
||||
/obj/machinery/power/generator_type2/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
interact(user)
|
||||
|
||||
|
||||
/obj/machinery/power/generator_type2/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) && (!istype(user, /mob/living/silicon/ai)))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=teg")
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
|
||||
var/t = "<PRE><B>Thermo-Electric Generator</B><HR>"
|
||||
|
||||
t += "Output : [round(lastgen)] W<BR><BR>"
|
||||
|
||||
t += "<B>Cold loop</B><BR>"
|
||||
t += "Temperature: [round(input1.air_contents.temperature, 0.1)] K<BR>"
|
||||
t += "Pressure: [round(input1.air_contents.return_pressure(), 0.1)] kPa<BR>"
|
||||
|
||||
t += "<B>Hot loop</B><BR>"
|
||||
t += "Temperature: [round(input2.air_contents.temperature, 0.1)] K<BR>"
|
||||
t += "Pressure: [round(input2.air_contents.return_pressure(), 0.1)] kPa<BR>"
|
||||
|
||||
t += "<BR><HR><A href='?src=\ref[src];close=1'>Close</A>"
|
||||
|
||||
t += "</PRE>"
|
||||
user << browse(t, "window=teg;size=460x300")
|
||||
onclose(user, "teg")
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/power/generator_type2/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=teg")
|
||||
usr.unset_machine()
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/power/generator_type2/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
@@ -1,154 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||
var/global/list/rad_collectors = list()
|
||||
|
||||
/obj/machinery/power/rad_collector
|
||||
name = "Radiation Collector Array"
|
||||
desc = "A device which uses Hawking Radiation and phoron to produce power."
|
||||
icon = 'icons/obj/singularity.dmi'
|
||||
icon_state = "ca"
|
||||
anchored = 0
|
||||
density = 1
|
||||
req_access = list(access_engine_equip)
|
||||
// use_power = POWER_USE_OFF
|
||||
var/obj/item/tank/phoron/P = null
|
||||
var/last_power = 0
|
||||
var/last_power_new = 0
|
||||
var/active = 0
|
||||
var/locked = 0
|
||||
var/drainratio = 1
|
||||
|
||||
/obj/machinery/power/rad_collector/Initialize()
|
||||
. = ..()
|
||||
rad_collectors += src
|
||||
|
||||
/obj/machinery/power/rad_collector/Destroy()
|
||||
rad_collectors -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/rad_collector/process()
|
||||
//so that we don't zero out the meter if the SM is processed first.
|
||||
last_power = last_power_new
|
||||
last_power_new = 0
|
||||
|
||||
|
||||
if(P)
|
||||
if(P.air_contents.gas[GAS_PHORON] == 0)
|
||||
investigate_log("<span class='warning'>out of fuel</span>.","singulo")
|
||||
eject()
|
||||
else
|
||||
P.air_contents.adjust_gas(GAS_PHORON, -0.001*drainratio)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/power/rad_collector/attack_hand(mob/user as mob)
|
||||
if(anchored)
|
||||
if(!src.locked)
|
||||
toggle_power()
|
||||
user.visible_message("[user.name] turns the [src.name] [active? "on":"off"].", \
|
||||
"You turn the [src.name] [active? "on":"off"].")
|
||||
investigate_log("turned [active?"<font color='green'>on</font>":"<span class='warning'>off</span>"] by [user.key]. [P?"Fuel: [round(P.air_contents.gas[GAS_PHORON]/0.29)]%":"<span class='warning'>It is empty</span>"].","singulo")
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The controls are locked!</span>")
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/power/rad_collector/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/tank/phoron))
|
||||
if(!src.anchored)
|
||||
to_chat(user, "<span class='warning'>The [src] needs to be secured to the floor first.</span>")
|
||||
return 1
|
||||
if(src.P)
|
||||
to_chat(user, "<span class='warning'>There's already a phoron tank loaded.</span>")
|
||||
return 1
|
||||
user.drop_from_inventory(W,src)
|
||||
src.P = W
|
||||
update_icon()
|
||||
return 1
|
||||
else if(W.iscrowbar())
|
||||
if(P && !src.locked)
|
||||
eject()
|
||||
return 1
|
||||
else if(W.iswrench())
|
||||
if(P)
|
||||
to_chat(user, "<span class='notice'>Remove the phoron tank first.</span>")
|
||||
return 1
|
||||
playsound(src.loc, W.usesound, 75, 1)
|
||||
src.anchored = !src.anchored
|
||||
user.visible_message("[user.name] [anchored? "secures":"unsecures"] the [src.name].", \
|
||||
"You [anchored? "secure":"undo"] the external bolts.", \
|
||||
"You hear a ratchet")
|
||||
if(anchored)
|
||||
connect_to_network()
|
||||
else
|
||||
disconnect_from_network()
|
||||
return 1
|
||||
else if(W.GetID())
|
||||
if (src.allowed(user))
|
||||
if(active)
|
||||
src.locked = !src.locked
|
||||
to_chat(user, "The controls are now [src.locked ? "locked." : "unlocked."]")
|
||||
else
|
||||
src.locked = 0 //just in case it somehow gets locked
|
||||
to_chat(user, "<span class='warning'>The controls can only be locked when the [src] is active.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Access denied!</span>")
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/rad_collector/examine(mob/user)
|
||||
if (..(user, 3))
|
||||
to_chat(user, "The meter indicates that \the [src] is collecting [last_power] W.")
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/rad_collector/ex_act(severity)
|
||||
switch(severity)
|
||||
if(2, 3)
|
||||
eject()
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/power/rad_collector/proc/eject()
|
||||
locked = 0
|
||||
var/obj/item/tank/phoron/Z = src.P
|
||||
if (!Z)
|
||||
return
|
||||
Z.forceMove(get_turf(src))
|
||||
Z.layer = initial(Z.layer)
|
||||
src.P = null
|
||||
if(active)
|
||||
toggle_power()
|
||||
else
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/power/rad_collector/proc/receive_pulse(var/pulse_strength)
|
||||
if(P && active)
|
||||
var/power_produced = 0
|
||||
power_produced = P.air_contents.gas[GAS_PHORON]*pulse_strength*20
|
||||
add_avail(power_produced)
|
||||
last_power_new = power_produced
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/power/rad_collector/update_icon()
|
||||
cut_overlays()
|
||||
if(P)
|
||||
add_overlay("ptank")
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(active)
|
||||
add_overlay("on")
|
||||
|
||||
|
||||
/obj/machinery/power/rad_collector/toggle_power()
|
||||
active = !active
|
||||
if(active)
|
||||
icon_state = "ca_on"
|
||||
flick("ca_active", src)
|
||||
else
|
||||
icon_state = "ca"
|
||||
flick("ca_deactive", src)
|
||||
update_icon()
|
||||
return
|
||||
@@ -1,10 +1,8 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||
|
||||
/obj/machinery/containment_field
|
||||
name = "Containment Field"
|
||||
name = "containment field"
|
||||
desc = "An energy field."
|
||||
icon = 'icons/obj/singularity.dmi'
|
||||
icon_state = "Contain_F"
|
||||
icon = 'icons/obj/machinery/field_generator.dmi'
|
||||
icon_state = "contain_f"
|
||||
anchored = 1
|
||||
density = 0
|
||||
unacidable = 1
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/obj/machinery/power/emitter
|
||||
name = "emitter"
|
||||
desc = "It is a heavy duty industrial laser."
|
||||
icon = 'icons/obj/singularity.dmi'
|
||||
icon = 'icons/obj/emitter.dmi'
|
||||
icon_state = "emitter"
|
||||
anchored = FALSE
|
||||
density = TRUE
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||
|
||||
|
||||
/*
|
||||
field_generator power level display
|
||||
The icon used for the field_generator need to have 'num_power_levels' number of icon states
|
||||
named 'Field_Gen +p[num]' where 'num' ranges from 1 to 'num_power_levels'
|
||||
named 'field_gen +p[num]' where 'num' ranges from 1 to 'num_power_levels'
|
||||
|
||||
The power level is displayed using overlays. The current displayed power level is stored in 'powerlevel'.
|
||||
The overlay in use and the powerlevel variable must be kept in sync. A powerlevel equal to 0 means that
|
||||
@@ -17,7 +14,7 @@ field_generator power level display
|
||||
name = "field generator"
|
||||
desc = "A large thermal battery that projects a high amount of energy when powered."
|
||||
icon = 'icons/obj/machinery/field_generator.dmi'
|
||||
icon_state = "Field_Gen"
|
||||
icon_state = "field_gen"
|
||||
anchored = 0
|
||||
density = 1
|
||||
use_power = POWER_USE_OFF
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
..()
|
||||
START_PROCESSING(SScalamity, src)
|
||||
SScalamity.singularities += src
|
||||
for(var/obj/machinery/power/singularity_beacon/singubeacon in SSmachinery.processing)
|
||||
for(var/obj/machinery/power/tesla_beacon/singubeacon in SSmachinery.processing)
|
||||
if(singubeacon.active)
|
||||
target = singubeacon
|
||||
break
|
||||
@@ -94,7 +94,6 @@
|
||||
|
||||
if (current_size >= STAGE_THREE)
|
||||
move()
|
||||
pulse()
|
||||
|
||||
if (prob(event_chance)) //Chance for it to run a special event TODO: Come up with one or two more that fit.
|
||||
event()
|
||||
@@ -480,11 +479,6 @@
|
||||
M.dust()
|
||||
return
|
||||
|
||||
/obj/singularity/proc/pulse()
|
||||
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
|
||||
if (get_dist(R, src) <= 15) //Better than using orange() every process.
|
||||
R.receive_pulse(energy)
|
||||
|
||||
/obj/singularity/proc/on_capture()
|
||||
chained = 1
|
||||
overlays = 0
|
||||
|
||||
@@ -314,8 +314,8 @@
|
||||
var/beam_range = zap_range + 2
|
||||
for(var/A in typecache_filter_multi_list_exclusion(oview(source, beam_range), things_to_shock, blacklisted_types))
|
||||
|
||||
if(istype(source, /obj/singularity/energy_ball) && istype(A, /obj/machinery/power/singularity_beacon/emergency))
|
||||
var/obj/machinery/power/singularity_beacon/emergency/E = A
|
||||
if(istype(source, /obj/singularity/energy_ball) && istype(A, /obj/machinery/power/tesla_beacon))
|
||||
var/obj/machinery/power/tesla_beacon/E = A
|
||||
var/obj/singularity/energy_ball/B = source
|
||||
if(!E.active)
|
||||
return
|
||||
|
||||
@@ -1,285 +0,0 @@
|
||||
/obj/machinery/compressor
|
||||
name = "compressor"
|
||||
desc = "The compressor stage of a gas turbine generator."
|
||||
icon = 'icons/obj/pipes.dmi'
|
||||
icon_state = "compressor"
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/obj/machinery/power/turbine/turbine
|
||||
var/datum/gas_mixture/gas_contained
|
||||
var/turf/simulated/inturf
|
||||
var/starter = 0
|
||||
var/rpm = 0
|
||||
var/rpmtarget = 0
|
||||
var/capacity = 1e6
|
||||
var/comp_id = 0
|
||||
|
||||
/obj/machinery/power/turbine
|
||||
name = "gas turbine generator"
|
||||
desc = "A gas turbine used for backup power generation."
|
||||
icon = 'icons/obj/pipes.dmi'
|
||||
icon_state = "turbine"
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/obj/machinery/compressor/compressor
|
||||
var/turf/simulated/outturf
|
||||
var/lastgen
|
||||
|
||||
/obj/machinery/computer/turbine_computer
|
||||
name = "Gas turbine control computer"
|
||||
desc = "A computer to remotely control a gas turbine"
|
||||
icon_screen = "enginecontrol"
|
||||
icon_keyboard = "cyan_key"
|
||||
light_color = LIGHT_COLOR_CYAN
|
||||
|
||||
circuit = /obj/item/circuitboard/turbine_control
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/obj/machinery/compressor/compressor
|
||||
var/list/obj/machinery/door/blast/doors
|
||||
var/id = 0
|
||||
var/door_status = 0
|
||||
|
||||
// the inlet stage of the gas turbine electricity generator
|
||||
|
||||
/obj/machinery/compressor/New()
|
||||
..()
|
||||
|
||||
gas_contained = new
|
||||
inturf = get_step(src, dir)
|
||||
|
||||
spawn(5)
|
||||
turbine = locate() in get_step(src, get_dir(inturf, src))
|
||||
if(!turbine)
|
||||
stat |= BROKEN
|
||||
else
|
||||
turbine.stat &= !BROKEN
|
||||
turbine.compressor = src
|
||||
|
||||
|
||||
#define COMPFRICTION 5e5
|
||||
#define COMPSTARTERLOAD 2800
|
||||
|
||||
/obj/machinery/compressor/process()
|
||||
if(!starter)
|
||||
return
|
||||
cut_overlays()
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
if(!turbine)
|
||||
stat |= BROKEN
|
||||
return
|
||||
rpm = 0.9* rpm + 0.1 * rpmtarget
|
||||
if(!inturf) return
|
||||
var/datum/gas_mixture/environment = inturf.return_air()
|
||||
if(!environment) return
|
||||
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)
|
||||
|
||||
|
||||
if(starter && !(stat & NOPOWER))
|
||||
use_power_oneoff(2800)
|
||||
if(rpm<1000)
|
||||
rpmtarget = 1000
|
||||
else
|
||||
if(rpm<1000)
|
||||
rpmtarget = 0
|
||||
|
||||
|
||||
|
||||
if(rpm>50000)
|
||||
add_overlay(image('icons/obj/pipes.dmi', "comp-o4", FLY_LAYER))
|
||||
else if(rpm>10000)
|
||||
add_overlay(image('icons/obj/pipes.dmi', "comp-o3", FLY_LAYER))
|
||||
else if(rpm>2000)
|
||||
add_overlay(image('icons/obj/pipes.dmi', "comp-o2", FLY_LAYER))
|
||||
else if(rpm>500)
|
||||
add_overlay(image('icons/obj/pipes.dmi', "comp-o1", FLY_LAYER))
|
||||
//TODO: DEFERRED
|
||||
|
||||
/obj/machinery/power/turbine/New()
|
||||
..()
|
||||
|
||||
outturf = get_step(src, dir)
|
||||
|
||||
spawn(5)
|
||||
|
||||
compressor = locate() in get_step(src, get_dir(outturf, src))
|
||||
if(!compressor)
|
||||
stat |= BROKEN
|
||||
else
|
||||
compressor.stat &= !BROKEN
|
||||
compressor.turbine = src
|
||||
|
||||
|
||||
#define TURBPRES 9000000
|
||||
#define TURBGENQ 20000
|
||||
#define TURBGENG 0.8
|
||||
|
||||
/obj/machinery/power/turbine/process()
|
||||
if(!compressor.starter)
|
||||
return
|
||||
cut_overlays()
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
if(!compressor)
|
||||
stat |= BROKEN
|
||||
return
|
||||
lastgen = ((compressor.rpm / TURBGENQ)**TURBGENG) *TURBGENQ
|
||||
|
||||
add_avail(lastgen)
|
||||
var/newrpm = ((compressor.gas_contained.temperature) * compressor.gas_contained.total_moles)/4
|
||||
newrpm = max(0, newrpm)
|
||||
|
||||
if(!compressor.starter || newrpm > 1000)
|
||||
compressor.rpmtarget = newrpm
|
||||
|
||||
if(compressor.gas_contained.total_moles>0)
|
||||
var/oamount = min(compressor.gas_contained.total_moles, (compressor.rpm+100)/35000*compressor.capacity)
|
||||
var/datum/gas_mixture/removed = compressor.gas_contained.remove(oamount)
|
||||
outturf.assume_air(removed)
|
||||
|
||||
if(lastgen > 100)
|
||||
add_overlay(image('icons/obj/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)
|
||||
|
||||
/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
|
||||
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>"
|
||||
|
||||
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 += "</PRE><HR><A href='?src=\ref[src];close=1'>Close</A>"
|
||||
|
||||
t += "</TT>"
|
||||
user << browse(t, "window=turbine")
|
||||
onclose(user, "turbine")
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/power/turbine/Topic(href, href_list)
|
||||
..()
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
if (usr.stat || usr.restrained() )
|
||||
return
|
||||
if (usr.IsAdvancedToolUser())
|
||||
if(!istype(usr, /mob/living/silicon/ai))
|
||||
to_chat(usr, "<span class='warning'>You don't have the dexterity to do this!</span>")
|
||||
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")
|
||||
usr.machine = null
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer/turbine_computer/New()
|
||||
..()
|
||||
spawn(5)
|
||||
for(var/obj/machinery/compressor/C in SSmachinery.machinery)
|
||||
if(id == C.comp_id)
|
||||
compressor = C
|
||||
doors = new /list()
|
||||
for(var/obj/machinery/door/blast/P in SSmachinery.machinery)
|
||||
if(P.id == id)
|
||||
doors += P
|
||||
|
||||
/obj/machinery/computer/turbine_computer/attack_hand(var/mob/user as mob)
|
||||
user.machine = src
|
||||
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"}
|
||||
else
|
||||
dat += "<span class='danger'>No compatible attached compressor found.</span>"
|
||||
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer/turbine_computer/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
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/blast/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
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/turbine_computer/process()
|
||||
src.updateDialog()
|
||||
return
|
||||
Reference in New Issue
Block a user