mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-26 18:12:40 +00:00
Merge pull request #2479 from caelaislinn/bleeding-edge-freeze
RUST updates, other
This commit is contained in:
@@ -5,62 +5,113 @@
|
||||
name = "circulator/heat exchanger"
|
||||
desc = "A gas circulator pump and heat exchanger."
|
||||
icon = 'icons/obj/pipes.dmi'
|
||||
icon_state = "circ1-off"
|
||||
icon_state = "circ-off"
|
||||
anchored = 0
|
||||
|
||||
var/side = 1 // 1=left 2=right
|
||||
//var/side = 1 // 1=left 2=right
|
||||
var/status = 0
|
||||
|
||||
var/last_pressure_delta = 0
|
||||
|
||||
anchored = 1.0
|
||||
density = 1
|
||||
|
||||
proc/return_transfer_air()
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
var/input_starting_pressure = air1.return_pressure()
|
||||
/obj/machinery/atmospherics/binary/circulator/New()
|
||||
..()
|
||||
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
|
||||
|
||||
if(output_starting_pressure >= input_starting_pressure-10)
|
||||
//Need at least 10 KPa difference to overcome friction in the mechanism
|
||||
last_pressure_delta = 0
|
||||
return null
|
||||
/obj/machinery/atmospherics/binary/circulator/proc/return_transfer_air()
|
||||
if(!anchored)
|
||||
return null
|
||||
|
||||
//Calculate necessary moles to transfer using PV = nRT
|
||||
if(air1.temperature>0)
|
||||
var/pressure_delta = (input_starting_pressure - output_starting_pressure)/2
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
var/input_starting_pressure = air1.return_pressure()
|
||||
|
||||
var/transfer_moles = pressure_delta*air2.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
if(output_starting_pressure >= input_starting_pressure-10)
|
||||
//Need at least 10 KPa difference to overcome friction in the mechanism
|
||||
last_pressure_delta = 0
|
||||
return null
|
||||
|
||||
last_pressure_delta = pressure_delta
|
||||
//Calculate necessary moles to transfer using PV = nRT
|
||||
if(air1.temperature>0)
|
||||
var/pressure_delta = (input_starting_pressure - output_starting_pressure)/2
|
||||
|
||||
//world << "pressure_delta = [pressure_delta]; transfer_moles = [transfer_moles];"
|
||||
var/transfer_moles = pressure_delta*air2.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
//Actually transfer the gas
|
||||
var/datum/gas_mixture/removed = air1.remove(transfer_moles)
|
||||
last_pressure_delta = pressure_delta
|
||||
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
//world << "pressure_delta = [pressure_delta]; transfer_moles = [transfer_moles];"
|
||||
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
//Actually transfer the gas
|
||||
var/datum/gas_mixture/removed = air1.remove(transfer_moles)
|
||||
|
||||
return removed
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
|
||||
else
|
||||
last_pressure_delta = 0
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
|
||||
process()
|
||||
..()
|
||||
update_icon()
|
||||
return removed
|
||||
|
||||
else
|
||||
last_pressure_delta = 0
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/process()
|
||||
..()
|
||||
update_icon()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
icon_state = "circ[side]-p"
|
||||
else if(last_pressure_delta > 0)
|
||||
if(last_pressure_delta > ONE_ATMOSPHERE)
|
||||
icon_state = "circ[side]-run"
|
||||
else
|
||||
icon_state = "circ[side]-slow"
|
||||
else
|
||||
icon_state = "circ[side]-off"
|
||||
|
||||
return 1
|
||||
/obj/machinery/atmospherics/binary/circulator/update_icon()
|
||||
if(stat & (BROKEN|NOPOWER) || !anchored)
|
||||
icon_state = "circ-p"
|
||||
else if(last_pressure_delta > 0)
|
||||
if(last_pressure_delta > ONE_ATMOSPHERE)
|
||||
icon_state = "circ-run"
|
||||
else
|
||||
icon_state = "circ-slow"
|
||||
else
|
||||
icon_state = "circ-off"
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
anchored = !anchored
|
||||
user << "\blue You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor."
|
||||
|
||||
if(anchored)
|
||||
if(dir & (NORTH|SOUTH))
|
||||
initialize_directions = NORTH|SOUTH
|
||||
else if(dir & (EAST|WEST))
|
||||
initialize_directions = EAST|WEST
|
||||
|
||||
initialize()
|
||||
build_network()
|
||||
if (node1)
|
||||
node1.initialize()
|
||||
node1.build_network()
|
||||
if (node2)
|
||||
node2.initialize()
|
||||
node2.build_network()
|
||||
else
|
||||
if(node1)
|
||||
node1.disconnect(src)
|
||||
del(network1)
|
||||
if(node2)
|
||||
node2.disconnect(src)
|
||||
del(network2)
|
||||
|
||||
node1 = null
|
||||
node2 = null
|
||||
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/verb/rotate()
|
||||
set category = "Object"
|
||||
set name = "Rotate Circulator"
|
||||
set src in view(1)
|
||||
|
||||
if (usr.stat || usr.restrained() || anchored)
|
||||
return
|
||||
|
||||
src.dir = turn(src.dir, 90)
|
||||
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
//reactor areas
|
||||
|
||||
/area/engine
|
||||
icon_state = "engine"
|
||||
|
||||
fore
|
||||
name = "\improper Fore"
|
||||
|
||||
@@ -13,49 +15,63 @@
|
||||
|
||||
atmos_storage
|
||||
name = "\improper Atmos storage"
|
||||
icon_state = "engine_storage"
|
||||
|
||||
control
|
||||
name = "\improper Control"
|
||||
icon_state = "engine_control"
|
||||
|
||||
electrical_storage
|
||||
name = "\improper Electrical storage"
|
||||
|
||||
engine_monitoring
|
||||
name = "\improper Electrical storage"
|
||||
icon_state = "engine_monitoring"
|
||||
|
||||
reactor_core
|
||||
name = "\improper Reactor Core"
|
||||
icon_state = "engine_core"
|
||||
//icon_state = "engine_core"
|
||||
|
||||
reactor_gas
|
||||
name = "Reactor Gas Storage"
|
||||
icon_state = "engine_atmos"
|
||||
//icon_state = "engine_atmos"
|
||||
|
||||
aux_control
|
||||
name = "Reactor Auxiliary Control"
|
||||
icon_state = "engine_aux"
|
||||
//icon_state = "engine_aux"
|
||||
|
||||
turbine_control
|
||||
name = "Turbine Control"
|
||||
icon_state = "engine_turbine"
|
||||
//icon_state = "engine_turbine"
|
||||
|
||||
reactor_airlock
|
||||
name = "\improper Reactor Primary Entrance"
|
||||
icon_state = "engine_airlock"
|
||||
//icon_state = "engine_airlock"
|
||||
|
||||
reactor_fuel_storage
|
||||
name = "Reactor Fuel Storage"
|
||||
icon_state = "engine_fuel"
|
||||
//icon_state = "engine_fuel"
|
||||
|
||||
reactor_fuel_ports
|
||||
name = "\improper Reactor Fuel Ports"
|
||||
icon_state = "engine_port"
|
||||
//icon_state = "engine_port"
|
||||
|
||||
generators
|
||||
name = "\improper Generator Room"
|
||||
icon_state = "engine_generators"
|
||||
//icon_state = "engine_generators"
|
||||
|
||||
port_gyro_bay
|
||||
name = "\improper Port Gyrotron Bay"
|
||||
icon_state = "engine_starboardgyro"
|
||||
//icon_state = "engine_starboardgyro"
|
||||
|
||||
starboard_gyro_bay
|
||||
name = "\improper Starboard Gyrotron Bay"
|
||||
icon_state = "engine_portgyro"
|
||||
//icon_state = "engine_portgyro"
|
||||
|
||||
storage
|
||||
name = "\improper Engineering hallway"
|
||||
icon_state = "engine_storage"
|
||||
|
||||
hallway
|
||||
name = "\improper Engineering storage"
|
||||
icon_state = "engine_hallway"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
/obj/item/weapon/circuitboard/rust_core_control
|
||||
name = "Circuit board (RUST core controller)"
|
||||
build_path = "/obj/machinery/computer/rust_core_control"
|
||||
origin_tech = "programming=3;engineering=4"
|
||||
origin_tech = "programming=4;engineering=4"
|
||||
|
||||
datum/design/rust_core_control
|
||||
name = "Circuit Design (RUST core controller)"
|
||||
desc = "Allows for the construction of circuit boards used to build a core control console for the RUST fusion engine."
|
||||
id = "rust_core_control"
|
||||
req_tech = list("programming" = 3, "engineering" = 4)
|
||||
req_tech = list("programming" = 4, "engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/rust_core_control"
|
||||
@@ -22,13 +22,13 @@ datum/design/rust_core_control
|
||||
/obj/item/weapon/circuitboard/rust_fuel_control
|
||||
name = "Circuit board (RUST fuel controller)"
|
||||
build_path = "/obj/machinery/computer/rust_fuel_control"
|
||||
origin_tech = "programming=3;engineering=4"
|
||||
origin_tech = "programming=4;engineering=4"
|
||||
|
||||
datum/design/rust_fuel_control
|
||||
name = "Circuit Design (RUST fuel controller)"
|
||||
desc = "Allows for the construction of circuit boards used to build a fuel injector control console for the RUST fusion engine."
|
||||
id = "rust_fuel_control"
|
||||
req_tech = list("programming" = 3, "engineering" = 4)
|
||||
req_tech = list("programming" = 4, "engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/rust_fuel_control"
|
||||
@@ -56,13 +56,13 @@ datum/design/rust_fuel_port
|
||||
/obj/item/weapon/module/rust_fuel_compressor
|
||||
name = "Internal circuitry (RUST fuel compressor)"
|
||||
icon_state = "card_mod"
|
||||
origin_tech = "materials=7;plasmatech=4"
|
||||
origin_tech = "materials=6;plasmatech=4"
|
||||
|
||||
datum/design/rust_fuel_compressor
|
||||
name = "Circuit Design (RUST fuel compressor)"
|
||||
desc = "Allows for the construction of circuit boards used to build a fuel compressor of the RUST fusion engine."
|
||||
id = "rust_fuel_compressor"
|
||||
req_tech = list("materials" = 7, "plasmatech" = 4)
|
||||
req_tech = list("materials" = 6, "plasmatech" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$diamond" = 1000)
|
||||
build_path = "/obj/item/weapon/module/rust_fuel_compressor"
|
||||
@@ -74,7 +74,7 @@ datum/design/rust_fuel_compressor
|
||||
name = "Internal circuitry (RUST tokamak core)"
|
||||
build_path = "/obj/machinery/power/rust_core"
|
||||
board_type = "machine"
|
||||
origin_tech = "bluespace=3;plasmatech=4;magnets=5;materials=6;powerstorage=6"
|
||||
origin_tech = "bluespace=3;plasmatech=4;magnets=5;powerstorage=6"
|
||||
frame_desc = "Requires 2 Pico Manipulators, 1 Ultra Micro-Laser, 5 Pieces of Cable, 1 Subspace Crystal and 1 Console Screen."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
|
||||
@@ -87,7 +87,7 @@ datum/design/rust_core
|
||||
name = "Internal circuitry (RUST tokamak core)"
|
||||
desc = "The circuit board that for a RUST-pattern tokamak fusion core."
|
||||
id = "pacman"
|
||||
req_tech = list(bluespace = 3, plasmatech = 4, magnets = 5, materials = 6, powerstorage = 6)
|
||||
req_tech = list(bluespace = 3, plasmatech = 4, magnets = 5, powerstorage = 6)
|
||||
build_type = IMPRINTER
|
||||
reliability_base = 79
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$diamond" = 2000)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
|
||||
/obj/machinery/computer/rust_core_control
|
||||
name = "RUST Core Control"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "core"
|
||||
icon_state = "core_control"
|
||||
var/list/connected_devices = list()
|
||||
var/id_tag = "allan remember to update this before you leave"
|
||||
var/scan_range = 25
|
||||
|
||||
@@ -113,6 +113,8 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
|
||||
minor_radius = field_strength * 0.2125// max = 8.625
|
||||
volume_covered = PI * major_radius * minor_radius * 2.5 * 2.5 * 1000
|
||||
|
||||
processing_objects.Add(src)
|
||||
|
||||
/obj/effect/rust_em_field/process()
|
||||
//make sure the field generator is still intact
|
||||
if(!owned_core)
|
||||
@@ -228,9 +230,9 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
|
||||
frequency = new_frequency
|
||||
|
||||
/obj/effect/rust_em_field/proc/AddEnergy(var/a_energy, var/a_mega_energy, var/a_frequency)
|
||||
var/energy_loss_ratio = src.frequency / abs(a_frequency - src.frequency)
|
||||
if(a_frequency == src.frequency)
|
||||
energy_loss_ratio = 0
|
||||
var/energy_loss_ratio = 0
|
||||
if(a_frequency != src.frequency)
|
||||
energy_loss_ratio = 1 / abs(a_frequency - src.frequency)
|
||||
energy += a_energy - a_energy * energy_loss_ratio
|
||||
mega_energy += a_mega_energy - a_mega_energy * energy_loss_ratio
|
||||
|
||||
@@ -650,4 +652,5 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
|
||||
del (catcher)
|
||||
RadiateAll()
|
||||
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
@@ -64,7 +64,7 @@ max volume of plasma storeable by the field = the total volume of a number of ti
|
||||
directwired = 1
|
||||
|
||||
var/state = 0
|
||||
var/locked = 0
|
||||
var/locked = 1
|
||||
var/remote_access_enabled = 1
|
||||
|
||||
/obj/machinery/power/rust_core/process()
|
||||
@@ -180,7 +180,7 @@ max volume of plasma storeable by the field = the total volume of a number of ti
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
if(!powernet || locked)
|
||||
if(stat & NOPOWER || locked || state != 2)
|
||||
dat += "<i>The console is dark and nonresponsive.</i>"
|
||||
else
|
||||
dat += "<b>RUST Tokamak pattern Electromagnetic Field Generator</b><br>"
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
icon_state = "port2"
|
||||
density = 0
|
||||
var/obj/item/weapon/fuel_assembly/cur_assembly
|
||||
layer = 4
|
||||
var/busy = 0
|
||||
anchored = 1
|
||||
|
||||
@@ -22,26 +21,25 @@
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
icon_state = "port1"
|
||||
user << "\blue You insert [I] into [src]. Touch the panel again to insert [I] into the injector."
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER) || opened)
|
||||
return
|
||||
|
||||
if(!busy)
|
||||
busy = 1
|
||||
if(cur_assembly)
|
||||
spawn(30)
|
||||
if(!try_insert_assembly())
|
||||
spawn(30)
|
||||
eject_assembly()
|
||||
busy = 0
|
||||
else
|
||||
busy = 0
|
||||
if(cur_assembly)
|
||||
if(try_insert_assembly())
|
||||
user << "\blue \icon[src] [src] inserts it's fuel rod assembly into an injector."
|
||||
else
|
||||
spawn(30)
|
||||
try_draw_assembly()
|
||||
busy = 0
|
||||
if(eject_assembly())
|
||||
user << "\red \icon[src] [src] ejects it's fuel assembly. Check the fuel injector status."
|
||||
else if(try_draw_assembly())
|
||||
user << "\blue \icon[src] [src] draws a fuel rod assembly from an injector."
|
||||
else if(try_draw_assembly())
|
||||
user << "\blue \icon[src] [src] draws a fuel rod assembly from an injector."
|
||||
else
|
||||
user << "\red \icon[src] [src] was unable to draw a fuel rod assembly from an injector."
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/proc/try_insert_assembly()
|
||||
var/success = 0
|
||||
@@ -53,6 +51,8 @@
|
||||
break
|
||||
if(I.cur_assembly)
|
||||
break
|
||||
if(I.state != 2)
|
||||
break
|
||||
|
||||
I.cur_assembly = cur_assembly
|
||||
cur_assembly.loc = I
|
||||
@@ -60,21 +60,14 @@
|
||||
icon_state = "port0"
|
||||
success = 1
|
||||
|
||||
if(success)
|
||||
src.visible_message("\blue \icon[src] a green light flashes on [src] as it inserts it's fuel rod assembly into an injector.")
|
||||
else
|
||||
src.visible_message("\red \icon[src] a red light flashes on [src] as it attempts to insert it's fuel rod assembly into an injector.")
|
||||
return success
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/proc/eject_assembly()
|
||||
if(cur_assembly)
|
||||
var/turf/check_turf = get_step(get_turf(src), src.dir)
|
||||
cur_assembly.loc = check_turf
|
||||
cur_assembly.loc = get_step(get_turf(src), src.dir)
|
||||
cur_assembly = null
|
||||
icon_state = "port0"
|
||||
return 1
|
||||
else
|
||||
src.visible_message("\red \icon[src] a red light flashes on [src] as it attempts to eject it's fuel rod assembly.")
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/proc/try_draw_assembly()
|
||||
var/success = 0
|
||||
@@ -88,7 +81,7 @@
|
||||
break
|
||||
if(I.injecting)
|
||||
break
|
||||
if(I.stat != 2)
|
||||
if(I.state != 2)
|
||||
break
|
||||
|
||||
cur_assembly = I.cur_assembly
|
||||
@@ -97,10 +90,6 @@
|
||||
icon_state = "port1"
|
||||
success = 1
|
||||
|
||||
if(success)
|
||||
src.visible_message("\icon[src] a blue light flashes on [src] as it draws a fuel rod assembly from an injector.")
|
||||
else
|
||||
src.visible_message("\red \icon[src] a red light flashes on [src] as it attempts to draw a fuel rod assembly from an injector.")
|
||||
return success
|
||||
|
||||
/*
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
dir = ndir
|
||||
else
|
||||
has_electronics = 3
|
||||
opened = 1
|
||||
opened = 0
|
||||
icon_state = "port0"
|
||||
|
||||
//20% easier to read than apc code
|
||||
|
||||
@@ -2,26 +2,17 @@ var/const/max_assembly_amount = 300
|
||||
|
||||
/obj/machinery/rust_fuel_compressor
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "fuel_compressor0"
|
||||
icon_state = "fuel_compressor1"
|
||||
name = "Fuel Compressor"
|
||||
var/list/new_assembly_quantities
|
||||
var/list/new_assembly_quantities = list("Deuterium" = 200,"Tritium" = 100,"Helium-3" = 0,"Lithium-6" = 0,"Silver" = 0)
|
||||
var/compressed_matter = 0
|
||||
anchored = 1
|
||||
layer = 2.9
|
||||
|
||||
var/opened = 1 //0=closed, 1=opened
|
||||
var/locked = 0
|
||||
var/has_electronics = 0 // 0 - none, bit 1 - circuitboard, bit 2 - wires
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/New()
|
||||
new_assembly_quantities = new/list
|
||||
spawn(0)
|
||||
new_assembly_quantities["Deuterium"] = 200
|
||||
new_assembly_quantities["Tritium"] = 100
|
||||
//
|
||||
new_assembly_quantities["Helium-3"] = 0
|
||||
new_assembly_quantities["Lithium-6"] = 0
|
||||
new_assembly_quantities["Silver"] = 0
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
@@ -50,7 +41,7 @@ var/const/max_assembly_amount = 300
|
||||
if(locked)
|
||||
t += "Swipe your ID to unlock this console."
|
||||
else
|
||||
t += "Compressed matter in storage: [compressed_matter] <A href='?src=\ref[src];eject_matter=1'>\[Eject all\]</a>"
|
||||
t += "Compressed matter in storage: [compressed_matter] <A href='?src=\ref[src];eject_matter=1'>\[Eject all\]</a><br>"
|
||||
t += "<A href='?src=\ref[src];activate=1'><b>Activate Fuel Synthesis</b></A><BR> (fuel assemblies require no more than [max_assembly_amount] rods).<br>"
|
||||
t += "<hr>"
|
||||
t += "- New fuel assembly constituents:- <br>"
|
||||
@@ -72,10 +63,15 @@ var/const/max_assembly_amount = 300
|
||||
usr.machine = null
|
||||
|
||||
if( href_list["eject_matter"] )
|
||||
var/ejected = 0
|
||||
while(compressed_matter > 10)
|
||||
new /obj/item/weapon/rcd_ammo(src.loc)
|
||||
new /obj/item/weapon/rcd_ammo(get_step(get_turf(src), src.dir))
|
||||
compressed_matter -= 10
|
||||
src.visible_message("\blue \icon[src] [src] ejects some compressed matter units.")
|
||||
ejected = 1
|
||||
if(ejected)
|
||||
usr << "\blue \icon[src] [src] ejects some compressed matter units."
|
||||
else
|
||||
usr << "\red \icon[src] there are no more compressed matter units in [src]."
|
||||
|
||||
if( href_list["activate"] )
|
||||
//world << "\blue New fuel rod assembly"
|
||||
@@ -83,7 +79,8 @@ var/const/max_assembly_amount = 300
|
||||
var/fail = 0
|
||||
var/old_matter = compressed_matter
|
||||
for(var/reagent in new_assembly_quantities)
|
||||
var/req_matter = F.rod_quantities[reagent] / 10
|
||||
var/req_matter = new_assembly_quantities[reagent] / 30
|
||||
//world << "[reagent] matter: [req_matter]/[compressed_matter]"
|
||||
if(req_matter <= compressed_matter)
|
||||
F.rod_quantities[reagent] = new_assembly_quantities[reagent]
|
||||
compressed_matter -= req_matter
|
||||
@@ -94,10 +91,12 @@ var/const/max_assembly_amount = 300
|
||||
if(fail)
|
||||
del(F)
|
||||
compressed_matter = old_matter
|
||||
src.visible_message("\red \icon[src] [src] flashes red: \'Out of matter.\'")
|
||||
usr << "\red \icon[src] [src] flashes red: \'Out of matter.\'"
|
||||
else
|
||||
F.loc = src.loc
|
||||
F.loc = get_step(get_turf(src), src.dir)
|
||||
F.percent_depleted = 0
|
||||
if(compressed_matter < 0.034)
|
||||
compressed_matter = 0
|
||||
|
||||
if( href_list["change_reagent"] )
|
||||
var/cur_reagent = href_list["change_reagent"]
|
||||
|
||||
@@ -42,9 +42,9 @@
|
||||
dir = ndir
|
||||
else
|
||||
has_electronics = 3
|
||||
opened = 1
|
||||
opened = 0
|
||||
locked = 0
|
||||
icon_state = "port0"
|
||||
icon_state = "fuel_compressor1"
|
||||
|
||||
//20% easier to read than apc code
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? 32 : -32)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
/obj/machinery/computer/rust_fuel_control
|
||||
name = "Fuel Injection Control"
|
||||
name = "RUST Fuel Injection Control"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "fuel"
|
||||
var/list/connected_injectors = list()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "injector0"
|
||||
density = 1
|
||||
var/state = 0
|
||||
var/state = 2
|
||||
var/locked = 0
|
||||
var/obj/item/weapon/fuel_assembly/cur_assembly
|
||||
var/fuel_usage = 0.0001 //percentage of available fuel to use per cycle
|
||||
@@ -17,13 +17,14 @@
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 500
|
||||
directwired = 0
|
||||
var/remote_access_enabled = 1
|
||||
var/cached_power_avail = 0
|
||||
var/emergency_insert_ready = 0
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/process()
|
||||
if(injecting)
|
||||
if(stat & BROKEN || !powernet)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
StopInjecting()
|
||||
else
|
||||
Inject()
|
||||
@@ -74,7 +75,7 @@
|
||||
state = 2
|
||||
user << "You weld the [src] to the floor."
|
||||
connect_to_network()
|
||||
src.directwired = 1
|
||||
//src.directwired = 1
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
if(2)
|
||||
@@ -88,7 +89,7 @@
|
||||
state = 1
|
||||
user << "You cut the [src] free from the floor."
|
||||
disconnect_from_network()
|
||||
src.directwired = 0
|
||||
//src.directwired = 0
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
return
|
||||
@@ -140,7 +141,7 @@
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
if (!powernet || locked || state != 2)
|
||||
if (stat & NOPOWER || locked || state != 2)
|
||||
dat += "<i>The console is dark and nonresponsive.</i>"
|
||||
else
|
||||
dat += "<B>Reactor Core Fuel Injector</B><hr>"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 42 KiB |
@@ -2,14 +2,14 @@
|
||||
//gimmicky hack to collect particles and direct them into the field
|
||||
/obj/effect/rust_particle_catcher
|
||||
icon = 'effects.dmi'
|
||||
icon_state = "energynet"
|
||||
density = 0
|
||||
anchored = 1
|
||||
invisibility = 101
|
||||
layer = 4
|
||||
var/obj/effect/rust_em_field/parent
|
||||
var/mysize = 0
|
||||
|
||||
invisibility = 101
|
||||
|
||||
/*/obj/effect/rust_particle_catcher/New()
|
||||
for(var/obj/machinery/rust/em_field/field in range(6))
|
||||
parent = field
|
||||
|
||||
@@ -18,7 +18,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
var/access = null
|
||||
var/hidden = 0
|
||||
var/contraband = 0
|
||||
var/group
|
||||
var/group = "Operations"
|
||||
|
||||
/datum/supply_packs/New()
|
||||
manifest += "<ul>"
|
||||
@@ -258,6 +258,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
containertype = /obj/structure/largecrate/goat
|
||||
containername = "Goat Crate"
|
||||
access = access_hydroponics
|
||||
group = "Hydroponics"
|
||||
|
||||
/datum/supply_packs/chicken
|
||||
name = "Chicken Crate"
|
||||
@@ -265,6 +266,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
containertype = /obj/structure/largecrate/chick
|
||||
containername = "Chicken Crate"
|
||||
access = access_hydroponics
|
||||
group = "Hydroponics"
|
||||
|
||||
/datum/supply_packs/lisa
|
||||
name = "Corgi Crate"
|
||||
@@ -272,6 +274,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
cost = 50
|
||||
containertype = /obj/structure/largecrate/lisa
|
||||
containername = "Corgi Crate"
|
||||
group = "Hydroponics"
|
||||
|
||||
/datum/supply_packs/seeds
|
||||
name = "Seeds Crate"
|
||||
@@ -338,7 +341,6 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
containername = "Medical crate"
|
||||
group = "Medical / Science"
|
||||
|
||||
|
||||
/datum/supply_packs/virus
|
||||
name = "Virus crate"
|
||||
contains = list(/obj/item/weapon/reagent_containers/glass/bottle/flu_virion,
|
||||
@@ -821,14 +823,14 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
group = "Medical / Science"
|
||||
|
||||
/datum/supply_packs/randomised/pizza
|
||||
num_contained = 6
|
||||
num_contained = 5
|
||||
contains = list(/obj/item/pizzabox/margherita,
|
||||
/obj/item/pizzabox/mushroom,
|
||||
/obj/item/pizzabox/meat,
|
||||
/obj/item/pizzabox/vegetable)
|
||||
name = "Surprise pack of half a dozen pizzas"
|
||||
name = "Surprise pack of five dozen pizzas"
|
||||
cost = 15
|
||||
containertype = /obj/structure/closet/crate
|
||||
containertype = /obj/structure/closet/crate/freezer
|
||||
containername = "Pizza crate"
|
||||
group = "Hospitality"
|
||||
|
||||
@@ -854,7 +856,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
contains = list(/obj/machinery/power/rust_fuel_injector)
|
||||
name = "RUST fuel injector"
|
||||
cost = 50
|
||||
containertype = /obj/structure/largecrate
|
||||
containertype = /obj/structure/closet/crate/secure/large
|
||||
containername = "RUST injector crate"
|
||||
group = "Engineering"
|
||||
access = access_engine
|
||||
@@ -868,11 +870,20 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
group = "Engineering"
|
||||
access = access_engine
|
||||
|
||||
/datum/supply_packs/rust_assembly_port
|
||||
contains = list(/obj/item/weapon/module/rust_fuel_port)
|
||||
name = "RUST fuel assembly port circuitry"
|
||||
cost = 40
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "RUST fuel assembly port circuitry"
|
||||
group = "Engineering"
|
||||
access = access_engine
|
||||
|
||||
/datum/supply_packs/rust_core
|
||||
contains = list(/obj/machinery/power/rust_core)
|
||||
name = "RUST Tokamak Core"
|
||||
cost = 75
|
||||
containertype = /obj/structure/largecrate
|
||||
containertype = /obj/structure/closet/crate/secure/large
|
||||
containername = "RUST tokamak crate"
|
||||
group = "Engineering"
|
||||
access = access_engine
|
||||
@@ -902,3 +913,21 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
containertype = /obj/structure/closet/crate
|
||||
containername = "EFTPOS crate"
|
||||
group = "Operations"
|
||||
|
||||
/datum/supply_packs/teg
|
||||
contains = list(/obj/machinery/power/generator)
|
||||
name = "Mark I Thermoelectric Generator"
|
||||
cost = 75
|
||||
containertype = /obj/structure/closet/crate/secure/large
|
||||
containername = "Mk1 TEG crate"
|
||||
group = "Engineering"
|
||||
access = access_engine
|
||||
|
||||
/datum/supply_packs/circulator
|
||||
contains = list(/obj/machinery/atmospherics/binary/circulator)
|
||||
name = "Binary atmospheric circulator"
|
||||
cost = 60
|
||||
containertype = /obj/structure/closet/crate/secure/large
|
||||
containername = "Atmospheric circulator crate"
|
||||
group = "Engineering"
|
||||
access = access_engine
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
|
||||
/proc/power_failure()
|
||||
command_alert("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Critical Power Failure")
|
||||
for(var/mob/M in player_list)
|
||||
M << sound('sound/AI/poweroff.ogg')
|
||||
/proc/power_failure(var/announce = 1)
|
||||
if(announce)
|
||||
command_alert("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Critical Power Failure")
|
||||
for(var/mob/M in player_list)
|
||||
M << sound('sound/AI/poweroff.ogg')
|
||||
for(var/obj/machinery/power/smes/S in world)
|
||||
if(istype(get_area(S), /area/turret_protected) || S.z != 1)
|
||||
continue
|
||||
@@ -47,11 +48,12 @@
|
||||
|
||||
C.cell.charge = 0
|
||||
|
||||
/proc/power_restore()
|
||||
/proc/power_restore(var/announce = 1)
|
||||
|
||||
command_alert("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal")
|
||||
for(var/mob/M in player_list)
|
||||
M << sound('sound/AI/poweron.ogg')
|
||||
if(announce)
|
||||
command_alert("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal")
|
||||
for(var/mob/M in player_list)
|
||||
M << sound('sound/AI/poweron.ogg')
|
||||
for(var/obj/machinery/power/apc/C in world)
|
||||
if(C.cell && C.z == 1)
|
||||
C.cell.charge = C.cell.maxcharge
|
||||
@@ -70,11 +72,12 @@
|
||||
A.power_environ = 1
|
||||
A.power_change()
|
||||
|
||||
/proc/power_restore_quick()
|
||||
/proc/power_restore_quick(var/announce = 1)
|
||||
|
||||
command_alert("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal")
|
||||
for(var/mob/M in player_list)
|
||||
M << sound('sound/AI/poweron.ogg')
|
||||
if(announce)
|
||||
command_alert("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal")
|
||||
for(var/mob/M in player_list)
|
||||
M << sound('sound/AI/poweron.ogg')
|
||||
for(var/obj/machinery/power/smes/S in world)
|
||||
if(S.z != 1)
|
||||
continue
|
||||
|
||||
@@ -38,8 +38,8 @@ var/global/datum/controller/gameticker/ticker
|
||||
|
||||
/datum/controller/gameticker/proc/pregame()
|
||||
login_music = pick(\
|
||||
'sound/music/title1.ogg',\
|
||||
'sound/music/b12_combined_start.ogg')
|
||||
'sound/music/space.ogg',\
|
||||
'sound/music/traitor.ogg')
|
||||
do
|
||||
pregame_timeleft = 180
|
||||
world << "<B><FONT color='blue'>Welcome to the pre-game lobby!</FONT></B>"
|
||||
|
||||
@@ -165,6 +165,16 @@
|
||||
sparks = "largebinsparks"
|
||||
emag = "largebinemag"
|
||||
|
||||
/obj/structure/closet/crate/secure/large
|
||||
name = "large crate"
|
||||
desc = "A hefty metal crate with an electronic locking system."
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "largecrate"
|
||||
icon_opened = "largecrateopen"
|
||||
icon_closed = "largecrate"
|
||||
redlight = "largecrater"
|
||||
greenlight = "largecrateg"
|
||||
|
||||
/obj/structure/closet/crate/secure
|
||||
desc = "A secure crate."
|
||||
name = "Secure crate"
|
||||
@@ -178,6 +188,15 @@
|
||||
var/broken = 0
|
||||
var/locked = 1
|
||||
|
||||
/obj/structure/closet/crate/large
|
||||
name = "large crate"
|
||||
desc = "A hefty metal crate."
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "largecrate"
|
||||
icon_opened = "largecrateopen"
|
||||
icon_closed = "largecrate"
|
||||
density = 1
|
||||
|
||||
/obj/structure/closet/crate/hydroponics
|
||||
name = "Hydroponics crate"
|
||||
desc = "All you need to destroy those pesky weeds and pests."
|
||||
|
||||
@@ -98,6 +98,7 @@ var/list/mechtoys = list(
|
||||
var/reqtime = 0 //Cooldown for requisitions - Quarxink
|
||||
var/hacked = 0
|
||||
var/can_order_contraband = 0
|
||||
var/last_viewed_group = "categories"
|
||||
|
||||
/obj/machinery/computer/ordercomp
|
||||
name = "Supply ordering console"
|
||||
@@ -106,6 +107,7 @@ var/list/mechtoys = list(
|
||||
circuit = "/obj/item/weapon/circuitboard/ordercomp"
|
||||
var/temp = null
|
||||
var/reqtime = 0 //Cooldown for requisitions - Quarxink
|
||||
var/last_viewed_group = "categories"
|
||||
|
||||
/*
|
||||
/obj/effect/marker/supplymarker
|
||||
@@ -375,19 +377,20 @@ var/list/mechtoys = list(
|
||||
if(href_list["order"] == "categories")
|
||||
//all_supply_groups
|
||||
//Request what?
|
||||
last_viewed_group = "categories"
|
||||
temp = "<b>Supply points: [supply_shuttle.points]</b><BR>"
|
||||
temp += "<A href='?src=\ref[src];mainmenu=1'>Main Menu</A><HR><BR><BR>"
|
||||
temp += "<b>Select a category</b><BR><BR>"
|
||||
for(var/supply_group_name in all_supply_groups )
|
||||
temp += "<A href='?src=\ref[src];order=[supply_group_name]'>[supply_group_name]</A><BR>"
|
||||
else
|
||||
var/cur_supply_group = href_list["order"]
|
||||
last_viewed_group = href_list["order"]
|
||||
temp = "<b>Supply points: [supply_shuttle.points]</b><BR>"
|
||||
temp += "<A href='?src=\ref[src];order=categories'>Back to all categories</A><HR><BR><BR>"
|
||||
temp += "<b>Request from: [cur_supply_group]</b><BR><BR>"
|
||||
temp += "<b>Request from: [last_viewed_group]</b><BR><BR>"
|
||||
for(var/supply_name in supply_shuttle.supply_packs )
|
||||
var/datum/supply_packs/N = supply_shuttle.supply_packs[supply_name]
|
||||
if(N.hidden || N.contraband || N.group != cur_supply_group) continue //Have to send the type instead of a reference to
|
||||
if(N.hidden || N.contraband || N.group != last_viewed_group) continue //Have to send the type instead of a reference to
|
||||
temp += "<A href='?src=\ref[src];doorder=[supply_name]'>[supply_name]</A> Cost: [N.cost]<BR>" //the obj because it would get caught by the garbage
|
||||
|
||||
else if (href_list["doorder"])
|
||||
@@ -440,7 +443,7 @@ var/list/mechtoys = list(
|
||||
supply_shuttle.requestlist += O
|
||||
|
||||
temp = "Thanks for your request. The cargo team will process it as soon as possible.<BR>"
|
||||
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
temp += "<BR><A href='?src=\ref[src];order=[last_viewed_group]'>Back</A> <A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
|
||||
|
||||
else if (href_list["vieworders"])
|
||||
temp = "Current approved orders: <BR><BR>"
|
||||
@@ -558,19 +561,20 @@ var/list/mechtoys = list(
|
||||
if(href_list["order"] == "categories")
|
||||
//all_supply_groups
|
||||
//Request what?
|
||||
last_viewed_group = "categories"
|
||||
temp = "<b>Supply points: [supply_shuttle.points]</b><BR>"
|
||||
temp += "<A href='?src=\ref[src];mainmenu=1'>Main Menu</A><HR><BR><BR>"
|
||||
temp += "<b>Select a category</b><BR><BR>"
|
||||
for(var/supply_group_name in all_supply_groups )
|
||||
temp += "<A href='?src=\ref[src];order=[supply_group_name]'>[supply_group_name]</A><BR>"
|
||||
else
|
||||
var/cur_supply_group = href_list["order"]
|
||||
last_viewed_group = href_list["order"]
|
||||
temp = "<b>Supply points: [supply_shuttle.points]</b><BR>"
|
||||
temp += "<A href='?src=\ref[src];order=categories'>Back to all categories</A><HR><BR><BR>"
|
||||
temp += "<b>Request from: [cur_supply_group]</b><BR><BR>"
|
||||
temp += "<b>Request from: [last_viewed_group]</b><BR><BR>"
|
||||
for(var/supply_name in supply_shuttle.supply_packs )
|
||||
var/datum/supply_packs/N = supply_shuttle.supply_packs[supply_name]
|
||||
if(N.hidden || (N.contraband && !can_order_contraband) || N.group != cur_supply_group) continue //Have to send the type instead of a reference to
|
||||
if(N.hidden || (N.contraband && !can_order_contraband) || N.group != last_viewed_group) continue //Have to send the type instead of a reference to
|
||||
temp += "<A href='?src=\ref[src];doorder=[supply_name]'>[supply_name]</A> Cost: [N.cost]<BR>" //the obj because it would get caught by the garbage
|
||||
|
||||
/*temp = "Supply points: [supply_shuttle.points]<BR><HR><BR>Request what?<BR><BR>"
|
||||
@@ -632,7 +636,7 @@ var/list/mechtoys = list(
|
||||
supply_shuttle.requestlist += O
|
||||
|
||||
temp = "Order request placed.<BR>"
|
||||
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A> | <A href='?src=\ref[src];confirmorder=[O.ordernum]'>Authorize Order</A>"
|
||||
temp += "<BR><A href='?src=\ref[src];order=[last_viewed_group]'>Back</A> | <A href='?src=\ref[src];mainmenu=1'>Main Menu</A> | <A href='?src=\ref[src];confirmorder=[O.ordernum]'>Authorize Order</A>"
|
||||
|
||||
else if(href_list["confirmorder"])
|
||||
//Find the correct supply_order datum
|
||||
@@ -650,10 +654,10 @@ var/list/mechtoys = list(
|
||||
supply_shuttle.points -= P.cost
|
||||
supply_shuttle.shoppinglist += O
|
||||
temp = "Thanks for your order.<BR>"
|
||||
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
temp += "<BR><A href='?src=\ref[src];viewrequests=1'>Back</A> <A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
|
||||
else
|
||||
temp = "Not enough supply points.<BR>"
|
||||
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
temp += "<BR><A href='?src=\ref[src];viewrequests=1'>Back</A> <A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
|
||||
break
|
||||
|
||||
else if (href_list["vieworders"])
|
||||
@@ -692,7 +696,7 @@ var/list/mechtoys = list(
|
||||
supply_shuttle.requestlist.Cut(i,i+1)
|
||||
temp = "Request removed.<BR>"
|
||||
break
|
||||
temp += "<BR><A href='?src=\ref[src];viewrequests=1'>OK</A>"
|
||||
temp += "<BR><A href='?src=\ref[src];viewrequests=1'>Back</A> <A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
|
||||
|
||||
else if (href_list["clearreq"])
|
||||
supply_shuttle.requestlist.Cut()
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/datum/event/grid_check //NOTE: Times are measured in master controller ticks!
|
||||
startWhen = 5
|
||||
announceWhen = 5
|
||||
|
||||
/datum/event/grid_check/setup()
|
||||
endWhen = rand(90,600)
|
||||
endWhen = rand(30,120)
|
||||
|
||||
/datum/event/grid_check/start()
|
||||
power_failure(1)
|
||||
power_failure(0)
|
||||
|
||||
/datum/event/grid_check/announce()
|
||||
command_alert("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Automated Grid Check")
|
||||
@@ -13,7 +13,4 @@
|
||||
M << sound('sound/AI/poweroff.ogg')
|
||||
|
||||
/datum/event/grid_check/end()
|
||||
command_alert("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal")
|
||||
for(var/mob/M in player_list)
|
||||
M << sound('sound/AI/poweron.ogg')
|
||||
power_restore()
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
// dummy generator object for testing
|
||||
|
||||
/*/obj/machinery/power/generator/verb/set_amount(var/g as num)
|
||||
set src in view(1)
|
||||
|
||||
gen_amount = g
|
||||
|
||||
*/
|
||||
//updated by cael_aislinn on 5/3/2013 to be rotateable, moveable and generally more flexible
|
||||
/obj/machinery/power/generator
|
||||
name = "thermoelectric generator"
|
||||
desc = "It's a high efficiency thermoelectric generator."
|
||||
icon_state = "teg"
|
||||
anchored = 1
|
||||
density = 1
|
||||
use_power = 0
|
||||
anchored = 0
|
||||
idle_power_usage = 50
|
||||
active_power_usage = 1000
|
||||
|
||||
var/obj/machinery/atmospherics/binary/circulator/circ1
|
||||
var/obj/machinery/atmospherics/binary/circulator/circ2
|
||||
@@ -20,28 +16,39 @@
|
||||
var/lastgen = 0
|
||||
var/lastgenlev = -1
|
||||
|
||||
|
||||
/obj/machinery/power/generator/New()
|
||||
..()
|
||||
|
||||
spawn(5)
|
||||
circ1 = locate(/obj/machinery/atmospherics/binary/circulator) in get_step(src,WEST)
|
||||
circ2 = locate(/obj/machinery/atmospherics/binary/circulator) in get_step(src,EAST)
|
||||
spawn(1)
|
||||
reconnect()
|
||||
|
||||
if(circ1)
|
||||
circ1.side = 1
|
||||
circ1.update_icon()
|
||||
if(circ2)
|
||||
circ2.side = 2
|
||||
circ2.update_icon()
|
||||
//generators connect in dir and reverse_dir(dir) directions
|
||||
//mnemonic to determine circulator/generator directions: the cirulators orbit clockwise around the generator
|
||||
//so a circulator to the NORTH of the generator connects first to the EAST, then to the WEST
|
||||
//and a circulator to the WEST of the generator connects first to the NORTH, then to the SOUTH
|
||||
//note that the circulator's outlet dir is it's always facing dir, and it's inlet is always the reverse
|
||||
/obj/machinery/power/generator/proc/reconnect()
|
||||
circ1 = null
|
||||
circ2 = null
|
||||
if(src.loc && anchored)
|
||||
if(src.dir & (EAST|WEST))
|
||||
circ1 = locate(/obj/machinery/atmospherics/binary/circulator) in get_step(src,EAST)
|
||||
circ2 = locate(/obj/machinery/atmospherics/binary/circulator) in get_step(src,WEST)
|
||||
|
||||
if(!circ1 || !circ2)
|
||||
stat |= BROKEN
|
||||
if(circ1 && circ2)
|
||||
if(circ1.dir != SOUTH || circ2.dir != NORTH)
|
||||
circ1 = null
|
||||
circ2 = null
|
||||
|
||||
updateicon()
|
||||
else if(src.dir & (NORTH|SOUTH))
|
||||
circ1 = locate(/obj/machinery/atmospherics/binary/circulator) in get_step(src,NORTH)
|
||||
circ2 = locate(/obj/machinery/atmospherics/binary/circulator) in get_step(src,SOUTH)
|
||||
|
||||
if(circ1 && circ2 && (circ1.dir != EAST || circ2.dir != WEST))
|
||||
circ1 = null
|
||||
circ2 = null
|
||||
|
||||
/obj/machinery/power/generator/proc/updateicon()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
overlays.Cut()
|
||||
else
|
||||
@@ -56,57 +63,64 @@
|
||||
|
||||
//world << "Generator process ran"
|
||||
|
||||
if(!circ1 || !circ2)
|
||||
if(!circ1 || !circ2 || !anchored || stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
//world << "circ1 and circ2 pass"
|
||||
|
||||
var/datum/gas_mixture/cold_air = circ1.return_transfer_air()
|
||||
var/datum/gas_mixture/hot_air = circ2.return_transfer_air()
|
||||
var/datum/gas_mixture/air1 = circ1.return_transfer_air()
|
||||
var/datum/gas_mixture/air2 = circ2.return_transfer_air()
|
||||
|
||||
lastgen = 0
|
||||
|
||||
//world << "hot_air = [hot_air]; cold_air = [cold_air];"
|
||||
|
||||
if(cold_air && hot_air)
|
||||
if(air1 && air2)
|
||||
|
||||
//world << "hot_air = [hot_air] temperature = [hot_air.temperature]; cold_air = [cold_air] temperature = [hot_air.temperature];"
|
||||
//world << "hot_air = [hot_air] temperature = [air2.temperature]; cold_air = [cold_air] temperature = [air2.temperature];"
|
||||
|
||||
//world << "coldair and hotair pass"
|
||||
var/cold_air_heat_capacity = cold_air.heat_capacity()
|
||||
var/hot_air_heat_capacity = hot_air.heat_capacity()
|
||||
var/air1_heat_capacity = air1.heat_capacity()
|
||||
var/air2_heat_capacity = air2.heat_capacity()
|
||||
var/delta_temperature = abs(air2.temperature - air1.temperature)
|
||||
|
||||
var/delta_temperature = hot_air.temperature - cold_air.temperature
|
||||
//world << "delta_temperature = [delta_temperature]; air1_heat_capacity = [air1_heat_capacity]; air2_heat_capacity = [air2_heat_capacity]"
|
||||
|
||||
//world << "delta_temperature = [delta_temperature]; cold_air_heat_capacity = [cold_air_heat_capacity]; hot_air_heat_capacity = [hot_air_heat_capacity]"
|
||||
|
||||
if(delta_temperature > 0 && cold_air_heat_capacity > 0 && hot_air_heat_capacity > 0)
|
||||
if(delta_temperature > 0 && air1_heat_capacity > 0 && air2_heat_capacity > 0)
|
||||
use_power = 2
|
||||
var/efficiency = 0.65
|
||||
|
||||
var/energy_transfer = delta_temperature*hot_air_heat_capacity*cold_air_heat_capacity/(hot_air_heat_capacity+cold_air_heat_capacity)
|
||||
|
||||
var/energy_transfer = delta_temperature*air2_heat_capacity*air1_heat_capacity/(air2_heat_capacity+air1_heat_capacity)
|
||||
var/heat = energy_transfer*(1-efficiency)
|
||||
lastgen = energy_transfer*efficiency
|
||||
|
||||
//world << "lastgen = [lastgen]; heat = [heat]; delta_temperature = [delta_temperature]; hot_air_heat_capacity = [hot_air_heat_capacity]; cold_air_heat_capacity = [cold_air_heat_capacity];"
|
||||
//world << "lastgen = [lastgen]; heat = [heat]; delta_temperature = [delta_temperature]; air2_heat_capacity = [air2_heat_capacity]; air1_heat_capacity = [air1_heat_capacity];"
|
||||
|
||||
hot_air.temperature = hot_air.temperature - energy_transfer/hot_air_heat_capacity
|
||||
cold_air.temperature = cold_air.temperature + heat/cold_air_heat_capacity
|
||||
if(air2.temperature > air1.temperature)
|
||||
air2.temperature = air2.temperature - energy_transfer/air2_heat_capacity
|
||||
air1.temperature = air1.temperature + heat/air1_heat_capacity
|
||||
else
|
||||
air2.temperature = air2.temperature + heat/air2_heat_capacity
|
||||
air1.temperature = air1.temperature - energy_transfer/air1_heat_capacity
|
||||
|
||||
world << "POWER: [lastgen] W generated at [efficiency*100]% efficiency and sinks sizes [cold_air_heat_capacity], [hot_air_heat_capacity]"
|
||||
//world << "POWER: [lastgen] W generated at [efficiency*100]% efficiency and sinks sizes [air1_heat_capacity], [air2_heat_capacity]"
|
||||
|
||||
add_avail(lastgen)
|
||||
// update icon overlays only if displayed level has changed
|
||||
|
||||
if(hot_air)
|
||||
circ2.air2.merge(hot_air)
|
||||
if(air1)
|
||||
circ1.air2.merge(air1)
|
||||
|
||||
if(cold_air)
|
||||
circ1.air2.merge(cold_air)
|
||||
if(air2)
|
||||
circ2.air2.merge(air2)
|
||||
|
||||
// update icon overlays and power usage only if displayed level has changed
|
||||
var/genlev = max(0, min( round(11*lastgen / 100000), 11))
|
||||
if(genlev != lastgenlev)
|
||||
lastgenlev = genlev
|
||||
active_power_usage = lastgenlev * 1000
|
||||
if(lastgenlev > 0)
|
||||
use_power = 2
|
||||
else
|
||||
use_power = 1
|
||||
updateicon()
|
||||
|
||||
src.updateDialog()
|
||||
@@ -115,10 +129,18 @@
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/power/generator/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
anchored = !anchored
|
||||
user << "\blue You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor."
|
||||
use_power = anchored
|
||||
reconnect()
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/power/generator/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
if(stat & (BROKEN|NOPOWER) || !anchored) return
|
||||
interact(user)
|
||||
|
||||
|
||||
@@ -132,19 +154,28 @@
|
||||
|
||||
var/t = "<PRE><B>Thermo-Electric Generator</B><HR>"
|
||||
|
||||
t += "Output : [round(lastgen)] W<BR><BR>"
|
||||
if(circ1 && circ2)
|
||||
t += "Output : [round(lastgen)] W<BR><BR>"
|
||||
|
||||
t += "<B>Cold loop</B><BR>"
|
||||
t += "Temperature Inlet: [round(circ1.air1.temperature, 0.1)] K Outlet: [round(circ1.air2.temperature, 0.1)] K<BR>"
|
||||
t += "Pressure Inlet: [round(circ1.air1.return_pressure(), 0.1)] kPa Outlet: [round(circ1.air2.return_pressure(), 0.1)] kPa<BR>"
|
||||
t += "<B>Primary Circulator (top/right)</B><BR>"
|
||||
t += "Inlet Pressure: [round(circ1.air1.return_pressure(), 0.1)] kPa<BR>"
|
||||
t += "Inlet Temperature: [round(circ1.air1.temperature, 0.1)] K<BR>"
|
||||
t += "Outlet Pressure: [round(circ1.air2.return_pressure(), 0.1)] kPa<BR>"
|
||||
t += "Outlet Temperature: [round(circ1.air2.temperature, 0.1)] K<BR>"
|
||||
|
||||
t += "<B>Hot loop</B><BR>"
|
||||
t += "Temperature Inlet: [round(circ2.air1.temperature, 0.1)] K Outlet: [round(circ2.air2.temperature, 0.1)] K<BR>"
|
||||
t += "Pressure Inlet: [round(circ2.air1.return_pressure(), 0.1)] kPa Outlet: [round(circ2.air2.return_pressure(), 0.1)] kPa<BR>"
|
||||
t += "<B>Secondary Circulator (bottom/left)</B><BR>"
|
||||
t += "Inlet Pressure: [round(circ2.air1.return_pressure(), 0.1)] kPa<BR>"
|
||||
t += "Inlet Temperature: [round(circ2.air1.temperature, 0.1)] K<BR>"
|
||||
t += "Outlet Pressure: [round(circ2.air2.return_pressure(), 0.1)] kPa<BR>"
|
||||
t += "Outlet Temperature: [round(circ2.air2.temperature, 0.1)] K<BR>"
|
||||
else
|
||||
t += "Unable to connect to circulators.<br>"
|
||||
t += "Ensure both are in position and wrenched into place."
|
||||
|
||||
t += "<BR><HR><A href='?src=\ref[src];close=1'>Close</A>"
|
||||
t += "<BR>"
|
||||
t += "<HR>"
|
||||
t += "<A href='?src=\ref[src]'>Refresh</A> <A href='?src=\ref[src];close=1'>Close</A>"
|
||||
|
||||
t += "</PRE>"
|
||||
user << browse(t, "window=teg;size=460x300")
|
||||
onclose(user, "teg")
|
||||
return 1
|
||||
@@ -156,6 +187,7 @@
|
||||
usr << browse(null, "window=teg")
|
||||
usr.unset_machine()
|
||||
return 0
|
||||
updateDialog()
|
||||
return 1
|
||||
|
||||
|
||||
@@ -163,3 +195,13 @@
|
||||
..()
|
||||
updateicon()
|
||||
|
||||
|
||||
/obj/machinery/power/generator/verb/rotate()
|
||||
set category = "Object"
|
||||
set name = "Rotate Generator"
|
||||
set src in view(1)
|
||||
|
||||
if (usr.stat || usr.restrained() || anchored)
|
||||
return
|
||||
|
||||
src.dir = turn(src.dir, 90)
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
hot_air.temperature = hot_air.temperature - energy_transfer/hot_air_heat_capacity
|
||||
cold_air.temperature = cold_air.temperature + heat/cold_air_heat_capacity
|
||||
|
||||
world << "POWER: [lastgen] W generated at [efficiency*100]% efficiency and sinks sizes [cold_air_heat_capacity], [hot_air_heat_capacity]"
|
||||
//world << "POWER: [lastgen] W generated at [efficiency*100]% efficiency and sinks sizes [cold_air_heat_capacity], [hot_air_heat_capacity]"
|
||||
|
||||
if(input1.network)
|
||||
input1.network.update = 1
|
||||
|
||||
Reference in New Issue
Block a user