[READY] AGCNR Attempt 4: Revengeance (#19968)

* WE'RE SO BACK (from #15753)

* reactor (mostly) works but the map breaks??

* makes pluonium instead of nitrium, also map works now

* i forgor

* update_icon()

* fuck it we ball

* background radiation

* Update engine_rbmk.dmm

* rename

* huge refactor, process_atmos() and more

* map fix

* map fix 2: for real this time

* map fix 3: the threequel

* cargo stuff

* exponential K, minor fixes

* simplify

* fixed meltdown overriding blowout

* how did i miss this

* more heat rebalancing

* icon fix

* not an rbmk!!!

* no sanity allowed on my yogstation

* longer time to fix

* adds a guide in the control room

* fixed the cameras, added a shovel

* okay

* okay

* doesn't need to exist and just causes problems apparently

* Update reactor.dm

* this too

* stuff

* fix

* good enough

* performance

* corium + more performance

* meta map fix

* uh oh

* syndicate preset

* rpd

* i forgor

* Update reactor.dm

* should fix fuel rod crates

* evil theos be like

* Update reactor.dm

* borgs can set up engine

* less tedious to fix

* fix the darn pipes
This commit is contained in:
SapphicOverload
2023-10-04 16:22:23 -04:00
committed by GitHub
parent 73a98ab605
commit 550acb1c70
51 changed files with 7018 additions and 36 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -47,6 +47,8 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define RAD_PROTECT_CONTENTS_1 (1 << 15)
/// should this object be allowed to be contaminated
#define RAD_NO_CONTAMINATE_1 (1 << 16)
/// Prevents most radiation on this turf from leaving it
#define RAD_CONTAIN_CONTENTS (1<<17)
//turf-only flags
#define NOJAUNT_1 (1<<0)
@@ -56,7 +58,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
/// Blocks lava rivers being generated on the turf
#define NO_LAVA_GEN_1 (1<<6)
/// Blocks ruins spawning on the turf
#define NO_RUINS_1 (1<<17)
#define NO_RUINS_1 (1<<18)
//AREA FLAGS
/// If blobs can spawn there and if it counts towards their score.

View File

@@ -21,6 +21,7 @@
#define INVESTIGATE_PRESENTS "presents"
#define INVESTIGATE_VIROLOGY "viro" // yogs - Adds Investigate Virology
#define INVESTIGATE_HYPERTORUS "hypertorus"
#define INVESTIGATE_REACTOR "reactor"
// Logging types for log_message()
#define LOG_ATTACK (1 << 0)

55
code/__DEFINES/reactor.dm Normal file
View File

@@ -0,0 +1,55 @@
// Index of each node in the list of nodes the reactor has
#define COOLANT_INPUT_GATE 1
#define MODERATOR_INPUT_GATE 2
#define COOLANT_OUTPUT_GATE 3
#define REACTOR_TEMPERATURE_MINIMUM 400 // Minimum temperature needed to run normally
#define REACTOR_TEMPERATURE_OPERATING 800 //Kelvin
#define REACTOR_TEMPERATURE_CRITICAL 1000 //At this point the entire station is alerted to a meltdown. This may need altering
#define REACTOR_TEMPERATURE_MELTDOWN 1200
#define REACTOR_HEAT_CAPACITY 6000 //How much thermal energy it takes to cool the reactor
#define REACTOR_ROD_HEAT_CAPACITY 400 //How much thermal energy it takes to cool each reactor rod
#define REACTOR_HEAT_EXPONENT 1.5 // The exponent used for the function for K heating
#define REACTOR_HEAT_FACTOR (20 / (REACTOR_HEAT_EXPONENT**2)) //How much heat from K
#define REACTOR_MODERATOR_DECAY_RATE 0.1 //Don't use up ALL of the moderator, engineers need it to last a full round
#define REACTOR_PRESSURE_OPERATING 6000 //Kilopascals
#define REACTOR_PRESSURE_CRITICAL 10000
#define REACTOR_MAX_CRITICALITY 5 //No more criticality than N for now.
#define REACTOR_MAX_FUEL_RODS 5 //Maximum number of fuel rods that can fit in the reactor
#define REACTOR_POWER_FLAVOURISER 1000 //To turn those KWs into something usable
#define REACTOR_PERMEABILITY_FACTOR 500 // How effective permeability-type moderators are
#define REACTOR_CONTROL_FACTOR 250 // How effective control-type moderators are
/// Moderator effects, must be added to the moderator input for them to do anything
// Fuel types: increases power, at the cost of making K harder to control
#define PLASMA_FUEL_POWER 1 // baseline fuel
#define TRITIUM_FUEL_POWER 10 // woah there
#define ANTINOBLIUM_FUEL_POWER 100 // oh god oh fuck
// Power types: makes the fuel have more of an effect
#define OXYGEN_POWER_MOD 1 // baseline power modifier gas, optimal plasma/O2 ratio is 50/50 if you can handle the K increase from the plasma
#define HYDROGEN_POWER_MOD 10 // far superior power moderator gas, if you can handle the rads
// Control types: increases the effectiveness of control rods, makes K easier to control
#define NITROGEN_CONTROL_MOD 1 // good at controlling the reaction, but deadly rads
#define CARBON_CONTROL_MOD 2 // even better control, but even worse rads
#define PLUOXIUM_CONTROL_MOD 3 // best control gas, no rads!
// Cooling types: increases the effectiveness of coolant, exchanges more heat per process
#define BZ_PERMEABILITY_MOD 1 // makes cooling more effective
#define WATER_PERMEABILITY_MOD 2 // even better than BZ
#define NOBLIUM_PERMEABILITY_MOD 10 // best gas for cooling
// Radiation types: increases radiation, lower is better
#define NITROGEN_RAD_MOD 0.04 // mmm radiation
#define CARBON_RAD_MOD 0.08 // even higher
#define HYDROGEN_RAD_MOD 0.12 // getting a bit spicy there
#define TRITIUM_RAD_MOD 0.2 // fuck that's a lot
#define ANTINOBLIUM_RAD_MOD 10 // AAAAAAAAAAAAAAAAAAAA

View File

@@ -12,6 +12,12 @@
#define CHANNEL_VOICE_ANNOUNCE 1015
#define CHANNEL_MEGAFAUNA 1014 // battle music
#define CHANNEL_CHARGED_SPELL 1013
#define CHANNEL_REACTOR_ALERT 1012
//THIS SHOULD ALWAYS BE THE LOWEST ONE!
//KEEP IT UPDATED
#define CHANNEL_HIGHEST_AVAILABLE 1011
///Default range of a sound.
#define SOUND_RANGE 17
@@ -24,11 +30,6 @@
///The default exponent of sound falloff
#define SOUND_FALLOFF_EXPONENT 6
//THIS SHOULD ALWAYS BE THE LOWEST ONE!
//KEEP IT UPDATED
#define CHANNEL_HIGHEST_AVAILABLE 1013
#define MAX_INSTRUMENT_CHANNELS (128 * 6)
#define SOUND_MINIMUM_PRESSURE 10

View File

@@ -28,8 +28,13 @@
/proc/radiation_pulse(atom/source, intensity, range_modifier, log=FALSE, can_contaminate=TRUE, collectable_radiation = TRUE)
if(!SSradiation.can_fire)
return
for(var/dir in GLOB.cardinals)
new /datum/radiation_wave(source, dir, intensity, range_modifier, can_contaminate, collectable_radiation)
if(source && (source.flags_1 & RAD_CONTAIN_CONTENTS))
return
if(source?.loc && (source.loc.flags_1 & RAD_CONTAIN_CONTENTS))
return
if(intensity >= RAD_BACKGROUND_RADIATION)
for(var/dir in GLOB.cardinals)
new /datum/radiation_wave(source, dir, intensity, range_modifier, can_contaminate, collectable_radiation)
var/list/things = get_rad_contents(source) //copypasta because I don't want to put special code in waves to handle their origin
for(var/k in 1 to things.len)

View File

@@ -4,6 +4,7 @@ GLOBAL_LIST_EMPTY(airlocks) //list of all airlocks
GLOBAL_LIST_EMPTY(mechas_list) //list of all mechs. Used by hostile mobs target tracking.
GLOBAL_LIST_EMPTY(shuttle_caller_list) //list of all communication consoles and AIs, for automatic shuttle calls when there are none.
GLOBAL_LIST_EMPTY(machines) //NOTE: this is a list of ALL machines now. The processing machines list is SSmachine.processing !
GLOBAL_LIST_EMPTY(lights) //list of all light bulbs
GLOBAL_LIST_EMPTY(navigation_computers) //list of all /obj/machinery/computer/camera_advanced/shuttle_docker
GLOBAL_LIST_EMPTY(syndicate_shuttle_boards) //important to keep track of for managing nukeops war declarations.
GLOBAL_LIST_EMPTY(navbeacons) //list of all bot nagivation beacons, used for patrolling.

View File

@@ -850,3 +850,18 @@
)
result = /obj/item/reagent_containers/food/snacks/bait/wild
category = CAT_BAIT
// It can't run without fuel rods (cargo only) so this shouldn't be a problem
/datum/crafting_recipe/reactor_frame
name = "Nuclear Reactor Frame"
reqs = list(
/obj/item/stack/sheet/plasteel = 20,
/obj/item/stack/sheet/metal = 50,
/obj/item/stack/cable_coil = 10,
/obj/item/pipe = 3,
/obj/item/electronics/advanced_airlock_controller = 1
)
tool_behaviors = list(TOOL_WELDER)
result = /obj/structure/reactor_frame
category = CAT_STRUCTURES
time = 10 SECONDS

View File

@@ -814,6 +814,10 @@
* Default behaviour is to send COMSIG_ATOM_RAD_ACT and return
*/
/atom/proc/rad_act(strength, collectable_radiation)
if(flags_1 & RAD_CONTAIN_CONTENTS)
return
if(loc && (loc.flags_1 & RAD_CONTAIN_CONTENTS))
return
SEND_SIGNAL(src, COMSIG_ATOM_RAD_ACT, strength, collectable_radiation)
/**

View File

@@ -98,6 +98,7 @@ Class Procs:
var/stat = 0
var/use_power = IDLE_POWER_USE
var/datum/powernet/powernet = null
//0 = dont run the auto
//1 = run auto, use idle
//2 = run auto, use active
@@ -161,6 +162,7 @@ Class Procs:
RegisterSignal(src, COMSIG_ENTER_AREA, PROC_REF(power_change))
/obj/machinery/Destroy()
disconnect_from_network()
GLOB.machines.Remove(src)
if(!speed_process)
STOP_PROCESSING(SSmachines, src)

View File

@@ -73,6 +73,7 @@
desc = "A crate with a lock on it, painted in the scheme of the station's engineers."
name = "secure engineering crate"
icon_state = "engi_secure_crate"
flags_1 = RAD_CONTAIN_CONTENTS // rad-insulated
/obj/structure/closet/crate/secure/science
name = "secure science crate"

View File

@@ -10,7 +10,7 @@
if(!holder)
return
var/list/investigates = list(INVESTIGATE_RESEARCH, INVESTIGATE_EXONET, INVESTIGATE_PORTAL, INVESTIGATE_SINGULO, INVESTIGATE_WIRES, INVESTIGATE_TELESCI, INVESTIGATE_GRAVITY, INVESTIGATE_RECORDS, INVESTIGATE_CARGO, INVESTIGATE_SUPERMATTER, INVESTIGATE_ATMOS, INVESTIGATE_EXPERIMENTOR, INVESTIGATE_BOTANY, INVESTIGATE_HALLUCINATIONS, INVESTIGATE_RADIATION, INVESTIGATE_NANITES, INVESTIGATE_PRESENTS, INVESTIGATE_VIROLOGY, INVESTIGATE_HYPERTORUS) //Yogs - investigate virology
var/list/investigates = list(INVESTIGATE_RESEARCH, INVESTIGATE_EXONET, INVESTIGATE_PORTAL, INVESTIGATE_SINGULO, INVESTIGATE_WIRES, INVESTIGATE_TELESCI, INVESTIGATE_GRAVITY, INVESTIGATE_RECORDS, INVESTIGATE_CARGO, INVESTIGATE_SUPERMATTER, INVESTIGATE_ATMOS, INVESTIGATE_EXPERIMENTOR, INVESTIGATE_BOTANY, INVESTIGATE_HALLUCINATIONS, INVESTIGATE_RADIATION, INVESTIGATE_NANITES, INVESTIGATE_PRESENTS, INVESTIGATE_VIROLOGY, INVESTIGATE_HYPERTORUS, INVESTIGATE_REACTOR) //Yogs - investigate virology
var/list/logs_present = list("notes, memos, watchlist")
var/list/logs_missing = list("---")

View File

@@ -8,6 +8,7 @@
var/list/datum/pipeline/parents
var/list/datum/gas_mixture/airs
var/startingvolume = 200
/obj/machinery/atmospherics/components/New()
parents = new(device_type)
@@ -16,7 +17,7 @@
..()
for(var/i in 1 to device_type)
var/datum/gas_mixture/A = new(200)
var/datum/gas_mixture/A = new(startingvolume)
airs[i] = A
// Iconnery

View File

@@ -1234,6 +1234,43 @@
crate_type = /obj/structure/closet/crate/secure/engineering
dangerous = TRUE
/datum/supply_pack/engine/fuel_rod_basic
name = "Uranium-235 Fuel Rods Crate"
desc = "Contains 5 Enriched Uranium Control Rods."
cost = 5000
contains = list(/obj/item/fuel_rod,
/obj/item/fuel_rod,
/obj/item/fuel_rod,
/obj/item/fuel_rod,
/obj/item/fuel_rod)
crate_name = "Uranium-235 Fuel Rods"
crate_type = /obj/structure/closet/crate/radiation
/datum/supply_pack/engine/fuel_rod_plutonium
name = "Plutonium-239 Fuel Rods Crate"
desc = "Contains 5 Plutonium-239 Control Rods."
cost = 15000
contains = list(/obj/item/fuel_rod/plutonium,
/obj/item/fuel_rod/plutonium,
/obj/item/fuel_rod/plutonium,
/obj/item/fuel_rod/plutonium,
/obj/item/fuel_rod/plutonium)
crate_name = "Plutonium-239 Fuel Rods"
crate_type = /obj/structure/closet/crate/radiation
/datum/supply_pack/engine/fuel_rod_bananium
name = "Bananium Fuel Rods Crate"
desc = "Contains 5 Bananium Control Rods."
cost = 15000
contraband = TRUE
contains = list(/obj/item/fuel_rod/material/bananium,
/obj/item/fuel_rod/material/bananium,
/obj/item/fuel_rod/material/bananium,
/obj/item/fuel_rod/material/bananium,
/obj/item/fuel_rod/material/bananium)
crate_name = "Bananium Fuel Rods"
crate_type = /obj/structure/closet/crate/radiation
//////////////////////////////////////////////////////////////////////////////
/////////////////////// Canisters & Materials ////////////////////////////////
//////////////////////////////////////////////////////////////////////////////

View File

@@ -43,6 +43,7 @@
starting_files |= list(
new /datum/computer_file/program/alarm_monitor,
new /datum/computer_file/program/supermatter_monitor,
new /datum/computer_file/program/nuclear_monitor,
new /datum/computer_file/program/power_monitor
)
. = ..()
@@ -82,7 +83,8 @@
starting_files |= list(
new /datum/computer_file/program/atmosscan,
new /datum/computer_file/program/alarm_monitor,
new /datum/computer_file/program/supermatter_monitor
new /datum/computer_file/program/supermatter_monitor,
new /datum/computer_file/program/nuclear_monitor
)
. = ..()

View File

@@ -70,7 +70,10 @@
starting_files = list( new /datum/computer_file/program/budgetorders,
new /datum/computer_file/program/card_mod,
new /datum/computer_file/program/alarm_monitor)
new /datum/computer_file/program/alarm_monitor,
new /datum/computer_file/program/supermatter_monitor,
new /datum/computer_file/program/nuclear_monitor,
new /datum/computer_file/program/energy_harvester_control)
finish_color = "orange"
/obj/item/modular_computer/tablet/phone/preset/advanced/command/rd

View File

@@ -30,6 +30,7 @@
desc = "A stationary computer. This one comes preloaded with engineering programs."
starting_files = list( new /datum/computer_file/program/power_monitor,
new /datum/computer_file/program/alarm_monitor,
new /datum/computer_file/program/nuclear_monitor,
new /datum/computer_file/program/supermatter_monitor)
initial_program = /datum/computer_file/program/power_monitor
@@ -145,6 +146,7 @@
new /datum/computer_file/program/card_mod,
new /datum/computer_file/program/power_monitor,
new /datum/computer_file/program/alarm_monitor,
new /datum/computer_file/program/nuclear_monitor,
new /datum/computer_file/program/supermatter_monitor,
new /datum/computer_file/program/energy_harvester_control)

View File

@@ -0,0 +1,129 @@
//I love nuclear energy!!!!!
/datum/computer_file/program/nuclear_monitor
filename = "agcnrmonitor"
filedesc = "Nuclear Reactor Monitoring"
category = PROGRAM_CATEGORY_ENGI
ui_header = "smmon_0.gif"
program_icon_state = "smmon_0"
extended_desc = "This program connects to specially calibrated sensors to provide information on the status of nuclear reactors."
requires_ntnet = TRUE
transfer_access = ACCESS_ENGINE
program_icon = "radiation" // duh
//network_destination = "reactor monitoring system" dont need anymore?
size = 2
tgui_id = "NtosReactorStats"
var/active = TRUE //Easy process throttle
var/next_stat_interval = 0
var/list/kpaData = list()
var/list/powerData = list()
var/list/tempCoreData = list()
var/list/tempInputData = list()
var/list/tempOutputData = list()
var/list/reactors
var/obj/machinery/atmospherics/components/trinary/nuclear_reactor/reactor //Our reactor.
/datum/computer_file/program/nuclear_monitor/process_tick()
..()
if(!reactor || !active)
return FALSE
var/stage = 0
switch(reactor.temperature)
if(REACTOR_TEMPERATURE_MINIMUM to REACTOR_TEMPERATURE_OPERATING)
stage = 1
if(REACTOR_TEMPERATURE_OPERATING to REACTOR_TEMPERATURE_CRITICAL)
stage = 2
if(REACTOR_TEMPERATURE_CRITICAL to REACTOR_TEMPERATURE_MELTDOWN)
stage = 4
if(REACTOR_TEMPERATURE_MELTDOWN to INFINITY)
stage = 5
if(reactor.vessel_integrity <= 100) //Bye bye! GET OUT!
stage = 6
ui_header = "smmon_[stage].gif"
program_icon_state = "smmon_[stage]"
if(istype(computer))
computer.update_appearance(UPDATE_ICON)
// Refreshes list of active reactors, stolen from SM monitor code
/datum/computer_file/program/nuclear_monitor/proc/refresh()
reactors = list()
var/turf/T = get_turf(ui_host())
if(!T)
return
for(var/obj/machinery/atmospherics/components/trinary/nuclear_reactor/N in GLOB.machines)
if(!isturf(N.loc) || !(is_station_level(N.z) || is_mining_level(N.z) || N.z == T.z))
continue
reactors.Add(N)
if(!(reactor in reactors))
reactor = null
/datum/computer_file/program/nuclear_monitor/run_program(mob/living/user)
. = ..(user)
//No reactor? Go find one then.
if(!(reactor in GLOB.machines))
reactor = null
refresh()
active = TRUE
/datum/computer_file/program/nuclear_monitor/kill_program(forced = FALSE)
active = FALSE
..()
/datum/computer_file/program/nuclear_monitor/ui_data()
var/list/data = get_header_data()
if(istype(reactor))
if(!get_turf(reactor))
reactor = null
refresh()
return
data["powerData"] = reactor.powerData
data["kpaData"] = reactor.kpaData
data["tempCoreData"] = reactor.tempCoreData
data["tempInputData"] = reactor.tempInputData
data["tempOutputData"] = reactor.tempOutputData
data["coreTemp"] = reactor.temperature
data["coolantInput"] = reactor.last_coolant_temperature
data["coolantOutput"] = reactor.last_output_temperature
data["power"] = reactor.last_power_produced
data["kpa"] = reactor.pressure
data["k"] = reactor.K
data["integrity"] = reactor.get_integrity()
data["selected"] = TRUE
else
var/list/reactor_data = list()
var/next_uid = 0
for(var/obj/machinery/atmospherics/components/trinary/nuclear_reactor/N as anything in reactors)
var/area/A = get_area(N)
next_uid++
if(A)
reactor_data.Add(list(list(
"area_name" = A.name,
"integrity" = N.get_integrity(),
"uid" = next_uid
)))
data["selected"] = FALSE
data["reactors"] = reactor_data
return data
/datum/computer_file/program/nuclear_monitor/ui_act(action, params)
if(..())
return TRUE
switch(action)
if("PRG_clear")
reactor = null
return TRUE
if("PRG_refresh")
refresh()
return TRUE
if("PRG_set")
var/new_id = text2num(params["target"])
if(new_id < 1 || new_id > reactors.len)
return TRUE
reactor = reactors[new_id]
powerData = list()
kpaData = list()
tempCoreData = list()
tempInputData = list()
tempOutputData = list()
return TRUE

View File

@@ -22,6 +22,7 @@ Place a pool filter somewhere in the pool if you want people to be able to modif
icon = 'icons/obj/pool.dmi'
icon_state = "pool"
sound = 'sound/effects/splash.ogg'
flags_1 = CAN_BE_DIRTY_1|RAD_CONTAIN_CONTENTS // contains most of the rads on the tile within that tile
var/id = null //Set me if you don't want the pool and the pump to be in the same area, or you have multiple pools per area.
var/obj/effect/water_overlay = null

View File

@@ -305,6 +305,7 @@
// create a new lighting fixture
/obj/machinery/light/Initialize(mapload)
. = ..()
GLOB.lights += src
RegisterSignal(src, COMSIG_COMPONENT_CLEAN_ACT, PROC_REF(clean_light))
if(!mapload) //sync up nightshift lighting for player made lights
@@ -332,6 +333,7 @@
update(0)
/obj/machinery/light/Destroy()
GLOB.lights.Remove(src)
var/area/A = get_area(src)
if(A)
on = FALSE && !forced_off

View File

@@ -11,15 +11,10 @@
icon = 'icons/obj/power.dmi'
anchored = TRUE
obj_flags = CAN_BE_HIT | ON_BLUEPRINTS
var/datum/powernet/powernet = null
use_power = NO_POWER_USE
idle_power_usage = 0
active_power_usage = 0
/obj/machinery/power/Destroy()
disconnect_from_network()
return ..()
///////////////////////////////
// General procedures
//////////////////////////////
@@ -29,46 +24,46 @@
// Machines should use add_load(), surplus(), avail()
// Non-machines should use add_delayedload(), delayed_surplus(), newavail()
/obj/machinery/power/proc/add_avail(amount)
/obj/machinery/proc/add_avail(amount)
if(powernet)
powernet.newavail += amount
return TRUE
else
return FALSE
/obj/machinery/power/proc/add_load(amount)
/obj/machinery/proc/add_load(amount)
if(powernet)
powernet.load += amount
/obj/machinery/power/proc/surplus()
/obj/machinery/proc/surplus()
if(powernet)
return clamp(powernet.avail-powernet.load, 0, powernet.avail)
else
return 0
/obj/machinery/power/proc/avail()
/obj/machinery/proc/avail()
if(powernet)
return powernet.avail
else
return 0
/obj/machinery/power/proc/add_delayedload(amount)
/obj/machinery/proc/add_delayedload(amount)
if(powernet)
powernet.delayedload += amount
/obj/machinery/power/proc/delayed_surplus()
/obj/machinery/proc/delayed_surplus()
if(powernet)
return clamp(powernet.newavail - powernet.delayedload, 0, powernet.newavail)
else
return 0
/obj/machinery/power/proc/newavail()
/obj/machinery/proc/newavail()
if(powernet)
return powernet.newavail
else
return 0
/obj/machinery/power/proc/disconnect_terminal() // machines without a terminal will just return, no harm no fowl.
/obj/machinery/proc/disconnect_terminal() // machines without a terminal will just return, no harm no fowl.
return
// returns true if the area has power on given channel (or doesn't require power).
@@ -128,7 +123,7 @@
update_appearance(UPDATE_ICON)
// connect the machine to a powernet if a node cable is present on the turf
/obj/machinery/power/proc/connect_to_network()
/obj/machinery/proc/connect_to_network()
var/turf/T = src.loc
if(!T || !istype(T))
return FALSE
@@ -141,7 +136,7 @@
return TRUE
// remove and disconnect the machine from its current powernet
/obj/machinery/power/proc/disconnect_from_network()
/obj/machinery/proc/disconnect_from_network()
if(!powernet)
return FALSE
powernet.remove_machine(src)
@@ -168,7 +163,7 @@
//returns all the cables WITHOUT a powernet in neighbors turfs,
//pointing towards the turf the machine is located at
/obj/machinery/power/proc/get_connections()
/obj/machinery/proc/get_connections()
. = list()
@@ -188,7 +183,7 @@
//returns all the cables in neighbors turfs,
//pointing towards the turf the machine is located at
/obj/machinery/power/proc/get_marked_connections()
/obj/machinery/proc/get_marked_connections()
. = list()
@@ -205,7 +200,7 @@
return .
//returns all the NODES (O-X) cables WITHOUT a powernet in the turf the machine is located at
/obj/machinery/power/proc/get_indirect_connections()
/obj/machinery/proc/get_indirect_connections()
. = list()
for(var/obj/structure/cable/C in loc)
if(C.powernet)

View File

@@ -0,0 +1,234 @@
/obj/item/fuel_rod
name = "uranium-235 fuel rod"
desc = "A titanium sheathed rod containing a measure of enriched uranium-dioxide powder inside, and a breeding blanket of uranium-238 around it, used to kick off a fission reaction and breed plutonium fuel respectivly."
icon = 'icons/obj/control_rod.dmi'
icon_state = "irradiated"
w_class = WEIGHT_CLASS_BULKY
var/depletion = 0 //Each fuel rod will deplete in around 30 minutes.
var/fuel_power = 0.10
var/rad_strength = 500
var/half_life = 2000 // how many depletion ticks are needed to half the fuel_power (1 tick = 1 second)
var/time_created = 0
var/process = FALSE
// The depletion where depletion_final() will be called (and does something)
var/depletion_threshold = 100
var/depleted_final = FALSE // depletion_final should run only once
var/depletion_conversion_type = /obj/item/fuel_rod/plutonium
/obj/item/fuel_rod/Initialize(mapload)
. = ..()
time_created = world.time
AddComponent(/datum/component/radioactive, rad_strength, src, half_life) // This should be temporary for it won't make rads go lower than 350
if(process)
START_PROCESSING(SSobj, src)
/obj/item/fuel_rod/Destroy()
if(process)
STOP_PROCESSING(SSobj, src)
var/obj/machinery/atmospherics/components/trinary/nuclear_reactor/N = loc
if(istype(N))
N.fuel_rods -= src
. = ..()
// Converts a fuel rod into a given type
/obj/item/fuel_rod/proc/depletion_final(result_rod)
if(!result_rod)
return FALSE
var/obj/machinery/atmospherics/components/trinary/nuclear_reactor/N = loc
// Right now there's no reason rods should deplete outside a reactor
if(istype(N))
var/obj/item/fuel_rod/R = new result_rod(loc)
if(istype(R, /obj/item/fuel_rod)) // if it's not even a fuel rod then what the fuck are we doing here
R.depletion = depletion
R.fuel_power = fuel_power // conservation of energy
N.fuel_rods += R
qdel(src)
return TRUE
else
stack_trace("Invalid fuel rod type: [R.type]")
return FALSE
/obj/item/fuel_rod/proc/deplete(amount=0.035)
depletion += amount
if(depletion >= depletion_threshold && !depleted_final) // set whether or not it's depleted
depleted_final = depletion_final(depletion_conversion_type)
/obj/item/fuel_rod/plutonium
fuel_power = 0.20
name = "plutonium-239 fuel rod"
desc = "A highly energetic titanium sheathed rod containing a sizeable measure of weapons grade plutonium, it's highly efficient as nuclear fuel, but will cause the reaction to get out of control if not properly utilised."
icon_state = "inferior"
rad_strength = 1500
process = TRUE // for half life code
depletion_threshold = 300
depletion_conversion_type = /obj/item/fuel_rod/depleted
/obj/item/fuel_rod/process(delta_time)
fuel_power *= 0.5**(delta_time / half_life) // halves the fuel power every half life (33 minutes)
/obj/item/fuel_rod/depleted
fuel_power = 0.05
name = "depleted fuel rod"
desc = "A highly radioactive fuel rod which has expended most of its useful energy."
icon_state = "normal"
rad_strength = 6000 // smelly
depletion_conversion_type = null // It means that it won't turn into anything
process = TRUE
// Master type for material optional (or requiring, wyci) and/or producing rods
/obj/item/fuel_rod/material
// Whether the rod has been harvested. Should be set in expend().
var/expended = FALSE
// The material that will be inserted and then multiplied (or not). Should be some sort of /obj/item/stack
var/material_type
// The name of material that'll be used for texts
var/material_name
var/material_name_singular
var/initial_amount = 0
// The maximum amount of material the rod can hold
var/max_initial_amount = 10
var/grown_amount = 0
// The multiplier for growth. 1 for the same 2 for double etc etc
var/multiplier = 2
// After this depletion, you won't be able to add new materials
var/material_input_deadline = 25
// Material fuel rods generally don't get converted into another fuel object
depletion_conversion_type = null
/obj/item/fuel_rod/material/Initialize(mapload)
. = ..()
var/obj/item/stack/S = new material_type()
material_name = S.name
material_name_singular = S.singular_name
qdel(S)
// Called when the rod is fully harvested
/obj/item/fuel_rod/material/proc/expend()
expended = TRUE
// Basic checks for material rods
/obj/item/fuel_rod/material/proc/check_material_input(mob/user)
if(depletion >= material_input_deadline)
to_chat(user, "<span class='warning'>The sample slots have sealed themselves shut, it's too late to add [material_name] now!</span>") // no cheesing in crystals at 100%
return FALSE
if(expended)
to_chat(user, "<span class='warning'>\The [src]'s material slots have already been used.</span>")
return FALSE
return TRUE
// The actual growth
/obj/item/fuel_rod/material/depletion_final(result_rod)
if(result_rod)
return ..() // So if you put anything into depletion_conversion_type then your fuel rod will be converted (or not) and *won't grow*
grown_amount = initial_amount * multiplier
return TRUE
/obj/item/fuel_rod/material/attackby(obj/item/W, mob/user, params)
var/obj/item/stack/sheet/M = W
if(!material_type && istype(M))
material_type = M.type
if(istype(M, material_type))
if(!check_material_input(user))
return
if(initial_amount < max_initial_amount)
var/adding = min((max_initial_amount - initial_amount), M.amount)
M.amount -= adding
initial_amount += adding
if (adding == 1)
to_chat(user, "<span class='notice'>You insert [adding] [material_name_singular] into \the [src].</span>")
else
to_chat(user, "<span class='notice'>You insert [adding] [material_name] into \the [src].</span>")
M.zero_amount()
else
to_chat(user, "<span class='warning'>\The [src]'s material slots are full!</span>")
return
else
return ..()
/obj/item/fuel_rod/material/attack_self(mob/user)
if(expended)
to_chat(user, "<span class='notice'>You have already removed [material_name] from \the [src].</span>")
return
if(depleted_final)
new material_type(user.loc, grown_amount)
if (grown_amount == 1)
to_chat(user, "<span class='notice'>You harvest [grown_amount] [material_name_singular] from \the [src].</span>") // Unlikely
else
to_chat(user, "<span class='notice'>You harvest [grown_amount] [material_name] from \the [src].</span>")
playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
grown_amount = 0
expend()
else if(depletion)
to_chat(user, "<span class='warning'>\The [src] has not fissiled enough to fully grow the sample. The progress bar shows it is [min(depletion/depletion_threshold*100,100)]% complete.</span>")
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 0)
else if(initial_amount)
new material_type(user.loc, initial_amount)
if (initial_amount == 1)
to_chat(user, "<span class='notice'>You remove [initial_amount] [material_name_singular] from \the [src].</span>")
else
to_chat(user, "<span class='notice'>You remove [initial_amount] [material_name] from \the [src].</span>")
playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
initial_amount = 0
/obj/item/fuel_rod/material/examine(mob/user)
. = ..()
if(material_type)
if(expended)
. += "<span class='warning'>The material slots have been slagged by the extreme heat, you can't grow [material_name] in this rod again...</span>"
return
else if(depleted_final)
. += "<span class='warning'>This fuel rod's [material_name] are now fully grown, and it currently bears [grown_amount] harvestable [material_name_singular]\s.</span>"
return
if(depletion)
. += "<span class='danger'>The sample is [min(depletion/depletion_threshold*100,100)]% fissiled.</span>"
. += "<span class='disarm'>[initial_amount]/[max_initial_amount] of the slots for [material_name] are full.</span>"
else
. += "<span class='disarm'>This rod is ready for material breeding</span>"
/obj/item/fuel_rod/material/telecrystal
name = "telecrystal fuel rod"
desc = "A disguised titanium sheathed rod containing several small slots infused with uranium dioxide. Permits the insertion of telecrystals to grow more. Fissiles much faster than its standard counterpart"
icon_state = "telecrystal"
fuel_power = 0.30 // twice as powerful as a normal rod, you're going to need some engineering autism if you plan to mass produce TC
depletion_threshold = 33 // otherwise it takes two hours
rad_strength = 1500
max_initial_amount = 8
multiplier = 3
material_type = /obj/item/stack/telecrystal
/obj/item/fuel_rod/material/telecrystal/depletion_final(result_rod)
if(..())
return TRUE
fuel_power = 0.60 // thrice as powerful as plutonium, you'll want to get this one out quick!
name = "exhausted telecrystal fuel rod"
desc = "A highly energetic, disguised titanium sheathed rod containing a number of slots filled with greatly expanded telecrystals which can be removed by hand. It's extremely efficient as nuclear fuel, but will cause the reaction to get out of control if not properly utilised."
icon_state = "telecrystal_used"
AddComponent(/datum/component/radioactive, 3000, src)
return FALSE
/obj/item/fuel_rod/material/bananium
name = "bananium fuel rod"
desc = "A hilarious heavy-duty fuel rod which fissiles a bit slower than its cowardly counterparts. However, its cutting-edge cosmic clown technology allows rooms for extraordinarily exhilarating extraterrestrial element called bananium to menacingly multiply."
icon_state = "bananium"
fuel_power = 0.15
depletion_threshold = 33
rad_strength = 350
max_initial_amount = 10
multiplier = 3
material_type = /obj/item/stack/sheet/mineral/bananium
/obj/item/fuel_rod/material/bananium/deplete(amount=0.035)
..()
if(initial_amount == max_initial_amount && prob(10))
playsound(src, pick('sound/items/bikehorn.ogg'), 50) // HONK
/obj/item/fuel_rod/material/bananium/depletion_final(result_rod)
if(..())
return TRUE
fuel_power = 0.3 // Be warned
name = "fully grown bananium fuel rod"
desc = "A hilarious heavy-duty fuel rod which fissiles a bit slower than it cowardly counterparts. Its greatly grimacing growth stage is now over, and bananium outgrowth hums as if it's blatantly honking bike horns."
icon_state = "bananium_used"
AddComponent(/datum/component/radioactive, 1250, src)
return FALSE

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,101 @@
// Reactor frame, used to build a finished reactor
/obj/structure/reactor_frame
name = "nuclear reactor frame"
desc = "The outer shell of a nuclear reactor core, made from plasteel due to its excellent strength and radiation shielding."
icon = 'icons/obj/machines/reactor.dmi'
icon_state = "reactor_frame_0"
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF // no
density = FALSE
anchored = TRUE
pixel_x = -32
pixel_y = -32
var/completion = 0
/obj/structure/reactor_frame/examine(mob/user)
. = ..()
if(!anchored)
. += span_notice("It can be secured with a wrench.")
return
switch(completion)
if(0)
. += span_notice("The frame can be reinforced with metal rods, or unsecured with a wrench.")
if(1)
. += span_notice("The metal rods can be welded into place.")
if(2)
. += span_notice("The control rods can be added using plasteel sheets.")
if(3)
. += span_notice("The coolant pipes can be wrenched into place.")
/obj/structure/reactor_frame/attackby(obj/item/I, mob/living/user, params)
var/obj/item/stack/S = I
if(istype(S, /obj/item/stack/rods))
if(!anchored)
user.balloon_alert(user, span_notice("anchor it first!"))
return
if(completion > 0)
user.balloon_alert(user, span_notice("already reinforced!"))
return
if(S.use_tool(src, user, 2 SECONDS, 20))
completion++
update_icon()
return
return
if(I.tool_behaviour == TOOL_WELDER)
if(completion < 1)
user.balloon_alert(user, span_notice("add rods first!"))
return
if(completion > 1)
user.balloon_alert(user, span_notice("already welded!"))
return
if(I.use_tool(src, user, 2 SECONDS, 1, 50))
completion++
update_icon()
return
return
if(istype(S, /obj/item/stack/sheet/plasteel))
if(completion < 2)
user.balloon_alert(user, span_notice("weld it first!"))
return
if(completion > 2)
user.balloon_alert(user, span_notice("already has control rods!"))
return
if(I.use_tool(src, user, 2 SECONDS, 10))
completion++
update_icon()
return
return
if(I.tool_behaviour == TOOL_WRENCH)
if(!completion)
I.use_tool(src, user, 0, volume=50)
I.play_tool_sound(src, 50)
setAnchored(!anchored)
user.balloon_alert(user, span_notice("[anchored ? "" : "un"]secured"))
return
if(I.use_tool(src, user, 2 SECONDS, volume=50))
new /obj/machinery/atmospherics/components/trinary/nuclear_reactor(get_turf(src))
qdel(src)
return
return
return ..()
/obj/structure/reactor_frame/update_icon(updates)
. = ..()
icon_state = "reactor_frame_[completion]"
/obj/structure/reactor_corium
name = "radioactive mass"
desc = "A large mass of molten reactor fuel, sometimes called corium. If you can see it, you're probably close enough to receive a lethal dose of radiation."
icon = 'icons/obj/machines/reactor.dmi'
icon_state = "reactor_corium"
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF // no
light_color = LIGHT_COLOR_RED
light_range = 10
light_on = TRUE
anchored = TRUE
density = FALSE
pixel_x = -32
pixel_y = -32
/obj/structure/reactor_corium/Initialize(mapload)
. = ..()
AddComponent(/datum/component/radioactive, 15000, src, 0)

View File

@@ -770,3 +770,11 @@
build_path = /obj/item/circuitboard/machine/plort
category = list("Research Machinery")
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
/datum/design/board/reactor_control
name = "Computer Design (Reactor Control)"
desc = "The circuit board for a reactor control console."
id = "reactor_control"
build_path = /obj/item/circuitboard/computer/reactor
category = list ("Engineering Machinery")
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING

View File

@@ -154,7 +154,7 @@
prereq_ids = list("base")
design_ids = list("solarcontrol", "recharger", "powermonitor", "rped", "pacman", "adv_capacitor", "adv_scanning", "emitter", "high_cell", "adv_matter_bin", "scanner_gate",
"atmosalerts", "atmos_control", "recycler", "autolathe", "high_micro_laser", "nano_mani", "mesons", "thermomachine", "rad_collector", "tesla_coil", "grounding_rod",
"cell_charger", "stack_console", "stack_machine", "conveyor_belt", "conveyor_switch",
"cell_charger", "stack_console", "stack_machine", "conveyor_belt", "conveyor_switch", "reactor_control",
"oxygen_tank", "plasma_tank", "emergency_oxygen", "emergency_oxygen_engi", "plasmaman_tank_belt", "electrolyzer", "floorigniter", "crystallizer", "suit_storage_unit", "atmos_thermal")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 7500)

View File

@@ -698,5 +698,5 @@ ECONOMY
## Uncomment to enable dynamic ruleset config file.
DYNAMIC_CONFIG_ENABLED
## Force Engine - 1 for SM, 2 for Sing/Tesla, 3 for any.
## Force Engine - 1 for SM, 2 for Sing/Tesla, 3 for any, 4 for AGCNR
ENGINE_TYPE 3

BIN
icons/obj/control_rod.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
icons/obj/inflatable.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,82 @@
import { useBackend } from '../backend';
import { NtosWindow } from '../layouts';
import { Button, ProgressBar, Section, Table } from '../components';
import { ReactorStatsSection } from './ReactorComputer';
export const NtosReactorStats = (props, context) => {
return (
<NtosWindow
resizable
width={440}
height={650}>
<NtosWindow.Content>
<NtosReactorMonitorContent />
</NtosWindow.Content>
</NtosWindow>
);
};
export const NtosReactorMonitorContent = (props, context) => {
const { act, data } = useBackend(context);
if(!data.selected) {
return (
<ReactorList />
);
}
return (
<Section
title="Reactor Monitor"
buttons={(
<Button
icon="arrow-left"
content="Back"
onClick={() => act('PRG_clear')} />
)}>
<ReactorStatsSection />
</Section>
);
};
const ReactorList = (props, context) => {
const { act, data } = useBackend(context);
const { reactors = [] } = data;
return (
<Section
title="Detected Reactors"
buttons={(
<Button
icon="sync"
content="Refresh"
onClick={() => act('PRG_refresh')} />
)}>
<Table>
{reactors.map(reactor => (
<Table.Row key={reactor.uid}>
<Table.Cell>
{reactor.uid + '. ' + reactor.area_name}
</Table.Cell>
<Table.Cell collapsing color="label">
Integrity:
</Table.Cell>
<Table.Cell collapsing width="120px">
<ProgressBar
value={reactor.integrity / 100}
ranges={{
good: [0.90, Infinity],
average: [0.5, 0.90],
bad: [-Infinity, 0.5],
}} />
</Table.Cell>
<Table.Cell collapsing>
<Button
content="Details"
onClick={() => act('PRG_set', {
target: reactor.uid,
})} />
</Table.Cell>
</Table.Row>
))}
</Table>
</Section>
);
};

View File

@@ -0,0 +1,250 @@
import { useBackend, useLocalState } from '../backend';
import { Window } from '../layouts';
import { Box, Button, Chart, Flex, ProgressBar, Section, Tabs, Slider } from '../components';
import { FlexItem } from '../components/Flex';
import { formatSiUnit } from '../format';
export const ReactorComputer = (props, context) => {
const [tabIndex, setTabIndex] = useLocalState(context, "tab-index", 1);
return (
<Window
resizable
width={360}
height={540}>
<Window.Content fitted>
<Tabs>
<Tabs.Tab
selected={tabIndex === 1}
onClick={() => setTabIndex(1)}>
Status
</Tabs.Tab>
<Tabs.Tab
selected={tabIndex === 2}
onClick={() => setTabIndex(2)}>
Control
</Tabs.Tab>
</Tabs>
{tabIndex === 1 && <ReactorStatsSection />}
{tabIndex === 2 && <ReactorControlRodControl />}
</Window.Content>
</Window>
);
};
export const ReactorStatsSection = (props, context) => {
const { act, data } = useBackend(context);
const powerData = data.powerData.map((value, i) => [i, value]);
const kpaData = data.kpaData.map((value, i) => [i, value]);
const tempCoreData = data.tempCoreData.map((value, i) => [i, value]);
const tempInputData = data.tempInputData.map((value, i) => [i, value]);
const tempOutputData = data.tempOutputData.map((value, i) => [i, value]);
return (
<Box height="100%">
<Section title="Legend:">
Integrity:
<ProgressBar
value={data.integrity / 100}
ranges={{
good: [0.90, Infinity],
average: [0.5, 0.90],
bad: [-Infinity, 0.5],
}}>
{data.integrity}%
</ProgressBar>
Reactor Power:
<ProgressBar
value={data.power}
minValue={0}
maxValue={10000000}
color="yellow">
{formatSiUnit(data.power, 0, "W")}
</ProgressBar>
Reactor Pressure:
<ProgressBar
value={data.kpa}
minValue={0}
maxValue={10000}
color="white" >
{formatSiUnit(data.kpa*1000, 1, "Pa")}
</ProgressBar>
Coolant temperature:
<ProgressBar
value={data.coolantInput}
minValue={0}
maxValue={1500}
color="blue">
{data.coolantInput} K
</ProgressBar>
Outlet temperature:
<ProgressBar
value={data.coolantOutput}
minValue={0}
maxValue={1500}
color="orange">
{data.coolantOutput} K
</ProgressBar>
Core temperature:
<ProgressBar
value={data.coreTemp}
minValue={0}
maxValue={1500}
color="bad">
{data.coreTemp} K
</ProgressBar>
Neutrons per generation (K):
<ProgressBar
value={data.k / 5}
ranges={{
good: [-Infinity, 0.4],
average: [0.4, 0.6],
bad: [0.6, Infinity],
}}>
{data.k}
</ProgressBar>
</Section>
<Section fill title="Reactor Statistics:" height="200px">
<Chart.Line
fillPositionedParent
data={powerData}
rangeX={[0, powerData.length - 1]}
rangeY={[0, Math.max(15000000, ...data.powerData)]}
strokeColor="rgba(255, 215,0, 1)"
fillColor="rgba(255, 215, 0, 0.1)" />
<Chart.Line
fillPositionedParent
data={kpaData}
rangeX={[0, kpaData.length - 1]}
rangeY={[0, Math.max(10000, ...data.kpaData)]}
strokeColor="rgba(255,250,250, 1)"
fillColor="rgba(255,250,250, 0.1)" />
<Chart.Line
fillPositionedParent
data={tempCoreData}
rangeX={[0, tempCoreData.length - 1]}
rangeY={[0, Math.max(1800, ...data.tempCoreData)]}
strokeColor="rgba(255, 0, 0 , 1)"
fillColor="rgba(255, 0, 0 , 0.1)" />
<Chart.Line
fillPositionedParent
data={tempInputData}
rangeX={[0, tempInputData.length - 1]}
rangeY={[0, Math.max(1800, ...data.tempInputData)]}
strokeColor="rgba(127, 179, 255 , 1)"
fillColor="rgba(127, 179, 255 , 0.1)" />
<Chart.Line
fillPositionedParent
data={tempOutputData}
rangeX={[0, tempOutputData.length - 1]}
rangeY={[0, Math.max(1800, ...data.tempOutputData)]}
strokeColor="rgba(255, 129, 25 , 1)"
fillColor="rgba(255, 129, 25 , 0.1)" />
</Section>
</Box>
);
};
export const ReactorControlRodControl = (props, context) => {
const { act, data } = useBackend(context);
const control_rods = data.control_rods;
const k = data.k;
const desiredK = data.desiredK;
const fuel_rods = data.rods.length;
const shutdown_temp = data.shutdownTemp;
return (
<Box height="100%">
<Section fill title="Power Management:" height="96px">
{'Reactor Power: '}
<Button
disabled={
(data.coreTemp > shutdown_temp && data.active) ||
(fuel_rods <= 0 && !data.active) ||
k > 0
}
icon={data.active ? 'power-off' : 'times'}
content={data.active ? 'On' : 'Off'}
selected={data.active}
onClick={() => act('power')}
/>
</Section>
<Section fill title="Control Rod Management:" height="100%">
Control Rod Insertion:
<ProgressBar
value={(control_rods / 100 * 100) * 0.01}
ranges={{
good: [0.7, Infinity],
average: [0.4, 0.7],
bad: [-Infinity, 0.4],
}} />
<br />
Neutrons per generation (K):
<br />
<ProgressBar
value={(k / 5 * 100) * 0.01}
ranges={{
good: [-Infinity, 0.4],
average: [0.4, 0.6],
bad: [0.6, Infinity],
}}>
{k}
</ProgressBar>
<br />
Target criticality:
<br />
<Slider
value={Math.round(desiredK*10)/10}
fillValue={Math.round(k*10)/10}
minValue={0}
maxValue={5}
step={0.1}
stepPixelSize={5}
onDrag={(e, value) => act('input', {
target: value,
})} />
</Section>
</Box>
);
};
export const ReactorFuelControl = (props, context) => {
const { act, data } = useBackend(context);
const shutdown_temp = data.shutdownTemp;
return (
<Section title="Fuel Rod Management" height="100%">
{data.rods.length > 0 ? (
<Box>
<Flex direction="column">
{Object.keys(data.rods).map(rod => (
<FlexItem key={rod}>
<Box inline mr={"3rem"} my={"0.5rem"}>
{data.rods[rod].rod_index}. {data.rods[rod].name}
</Box>
<Button
inline
icon={'times'}
content={'Eject'}
disabled={data.coreTemp > shutdown_temp}
onClick={() => act('eject', {
rod_index: data.rods[rod].rod_index,
})} />
<ProgressBar
value={100-data.rods[rod].depletion}
minValue={0}
maxValue={100}
ranges={{
good: [75, Infinity],
average: [40, 75],
bad: [-Infinity, 40],
}}
/>
</FlexItem>
))}
</Flex>
</Box>
) : (
<Box fontSize={3}>
No rods found.
</Box>
)}
</Section>
);
};

View File

@@ -102,6 +102,7 @@
#include "code\__DEFINES\radiation.dm"
#include "code\__DEFINES\radio.dm"
#include "code\__DEFINES\reactions.dm"
#include "code\__DEFINES\reactor.dm"
#include "code\__DEFINES\reagents.dm"
#include "code\__DEFINES\reagents_specific_heat.dm"
#include "code\__DEFINES\research.dm"
@@ -3013,6 +3014,7 @@
#include "code\modules\modular_computers\file_system\programs\engineering\atmosscan.dm"
#include "code\modules\modular_computers\file_system\programs\engineering\energyharvestercontrol.dm"
#include "code\modules\modular_computers\file_system\programs\engineering\powermonitor.dm"
#include "code\modules\modular_computers\file_system\programs\engineering\reactor_monitor.dm"
#include "code\modules\modular_computers\file_system\programs\engineering\sm_monitor.dm"
#include "code\modules\modular_computers\file_system\programs\medical\chem_scan.dm"
#include "code\modules\modular_computers\file_system\programs\medical\crew_monitor.dm"
@@ -3134,6 +3136,9 @@
#include "code\modules\power\terminal.dm"
#include "code\modules\power\tracker.dm"
#include "code\modules\power\turbine.dm"
#include "code\modules\power\reactor\fuel_rods.dm"
#include "code\modules\power\reactor\reactor.dm"
#include "code\modules\power\reactor\reactor_frame.dm"
#include "code\modules\power\singularity\collector.dm"
#include "code\modules\power\singularity\containment_field.dm"
#include "code\modules\power\singularity\emitter.dm"

View File

@@ -90,6 +90,11 @@
suffix = "engine_teg.dmm"
name = "Engine TEG"
/datum/map_template/ruin/station/box/engine/reactor
id = "engine_reactor"
suffix = "engine_reactor.dmm"
name = "Engine Nuclear Reactor"
/datum/map_template/ruin/station/box/testingsite/bunker
id = "testing_site_1"
suffix = "testingsite_range1.dmm"
@@ -287,7 +292,11 @@
id = "meta_teg"
suffix = "meta_teg.dmm"
name = "Meta TEG"
/datum/map_template/ruin/station/meta/reactor
id = "meta_reactor"
suffix = "meta_reactor.dmm"
name = "Meta Nuclear Reactor"
//GaxStation

View File

@@ -102,7 +102,7 @@ GLOBAL_LIST_EMPTY(chosen_station_templates)
return TRUE
/obj/effect/landmark/stationroom/box/engine
template_names = list("Engine SM" = 60, "Engine Singulo And Tesla" = 40)
template_names = list("Engine SM" = 50, "Engine Singulo And Tesla" = 30, "Engine Nuclear Reactor" = 20)
/obj/effect/landmark/stationroom/box/engine/choose()
. = ..()
@@ -114,6 +114,9 @@ GLOBAL_LIST_EMPTY(chosen_station_templates)
return "Engine Singulo And Tesla"
if(3)
return . //We let the normal choose() do the work if we want to have all of them in play
if(4)
return "Engine Nuclear Reactor"
/obj/effect/landmark/stationroom/box/testingsite
template_names = list("Bunker Bomb Range","Syndicate Bomb Range","Clown Bomb Range", "Clerk Bomb Range")
@@ -134,7 +137,7 @@ GLOBAL_LIST_EMPTY(chosen_station_templates)
template_names = list("Chapel 1", "Chapel 2")
/obj/effect/landmark/stationroom/meta/engine
template_names = list("Meta Singulo And Tesla" = 40, "Meta SM" = 60, "Meta TEG" = 0)
template_names = list("Meta SM" = 25, "Meta Nuclear Reactor" = 75) // tesla is loud as fuck and singulo doesn't make sense, so SM/reactor only
/obj/effect/landmark/stationroom/meta/engine/choose()
. = ..()
@@ -147,7 +150,7 @@ GLOBAL_LIST_EMPTY(chosen_station_templates)
if(3)
return . //We let the normal choose() do the work if we want to have all of them in play
if(4)
return "Meta TEG"
return "Meta Nuclear Reactor"
/obj/effect/landmark/stationroom/maint/