Files
8095672062 RBMK Overhaul, Fixes, and Roundstart Engine Selection (#4797)
## TL;DR for engineers new/returning to the RB-MK

At T1, the RB-MK2 is cooled openly, like a supermatter. Generally
speaking, the hotter it runs, the more power is generated. The more
power it generates, the hotter it becomes. The gimmick here is that
you're meant to find a sweet spot temperature for your setup and go with
it to maximum power generation.

RB-MK2s melt down when too much power is generated. Melt downs are
(generally) prevented when the safety system is enabled. When safeties
trigger, the reactor does get damaged, which can easily be fixed with a
welder. Sometimes the rod might get stuck if the reactor is too damaged
when safeties are triggered.

If the RB-MK2 melts down, you should immediately decrease power
generation. You can do this by blasting the machine with super cold air
and disabling overclock settings. You can forcibly stop a meltdown by
disabling the RB-MK2 forcibly, but this will cause the machine to suffer
massive damage that may or may not explode violently in your face
depending on the damage of the machine and how far in the meltdown stage
it is.

You should not be turning off safeties or messing with the vent settings
or overclocking it unless you know what you're doing.

You should at most build an RBMK in a small 9x9 circle, with an empty
space for the sniffer. Building too many RB-MK2 units close together
will increase tritium consumption, which in turn increases power
generation and heat generation.

## TL;DR for admins

Expect engineers to immediately melt down the RB-MK2 when they get their
hands on it. Feel free to untm this PR or get a maintainer to un tm this
if this ruins too many rounds (either through bugs or just general
fuckery).

## About The Pull Request

### Major Changes

Nearly every aspect of the RB-MK2 was tweaked in terms of power
generation, heat generation, and tritium consumption. It should be
somewhat balanced now. It is now normal (and intentional) to run the
RB-MK2 hot instead of doing the coldest possible temperature.

Replaces the roundstart station supermatter with an engine selection
beacon. This beacon cannot be moved, and allows you to select the engine
to use for the shift. Currently supported engine types are RB-MK2 and
The Supermatter Crystal (large/standard).

Adds RB-MK2 upgrade disks that can be researched. This can be researched
after energy manipulation. Current upgrades are: Safety Improvements,
Overclock Upgrade, and Auto-Vent upgrade.

Adds RB-MK2 voidouts. RB-MK2 voidouts occur during meltdowns when there
is no tritium left to process. This is a bad thing and you shouldn't do
this. This also fixes the infinite meltdown state bug.

Adds Supermatter interaction with the RB-MK2. You can construct an
RB-MK2 next to a supermatter and fill the fuel canister with
hyper-nobellium (along with tritium for fuel) to directly energize the
supermatter to absurd levels. At least 30 moles of hyper-noblium is
required for this (does not get consumed).

Building too many RB-MK2 units close together will increase tritium
consumption, which in turn increases power generation and heat
generation.

Building too many RB-MK2 units (more than 12) may trigger very negative
events. (Subject to change).

### Minor Changes
RB-MK2 research was moved to the energy manipulation techweb instead of
it having its own node.

You can no longer overclock the RB-MK2 without the Overclock upgrade.

Tweaked the sensitivity/spamminess of the RB-MK2 sniffer.

Improved the sprites of the RB-MK2 sniffer.


## Why It's Good For The Game

RB-MK2 needed code improvements and this PR aims to do this. With bug
fixes added and new features added, this should be worthy of acting as
an alternative to the supermatter.

## Proof Of Testing

Tested engine deployment and cancelation.
Tested normal operations and meltdown operations/fixes/etc.

## Changelog

🆑 BurgerBB
add: Replaces the roundstart station supermatter with an engine
selection beacon. This beacon cannot be moved, and allows you to select
the engine to use for the shift. Currently supported engine types are
RB-MK2 and The Supermatter Crystal (large/standard).
add: Nearly every aspect of the RB-MK2 was tweaked in terms of power
generation, heat generation, and tritium consumption. It should be
somewhat balanced now.
/🆑

---------

Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
2025-12-28 11:49:17 -08:00

186 lines
5.6 KiB
Plaintext

#define CHOICE_SUPERMATTER "Supermatter Crystal"
#define CHOICE_RBMK "RB-MK2 Reactor"
/obj/machinery/power/supermatter_crystal/Initialize(mapload)
. = ..()
if(mapload && is_main_engine && isturf(src.loc))
new/obj/machinery/engine_choice(src.loc)
return INITIALIZE_HINT_QDEL
/obj/machinery/engine_choice
name = "engine choice beacon"
desc = "A clusterfuck of wiring and components that somehow allows you to select the desired engine you want for the shift. \
Selection is permanent and cannot be reversed after deployment. Can be destroyed with a mulitool, with a considerable delay."
icon = 'modular_zubbers/icons/obj/structures/engine_choice.dmi'
icon_state = "choice"
anchored = TRUE
density = FALSE
move_resist = INFINITY //some really fucking strong duct tape
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
layer = TABLE_LAYER
obj_flags = CAN_BE_HIT
pass_flags = LETPASSTHROW
use_power = NO_POWER_USE
idle_power_usage = 0
active_power_usage = 0
static_power_usage = 0
obj_flags = DANGEROUS_POSSESSION | IGNORE_DENSITY | NO_DEBRIS_AFTER_DECONSTRUCTION
var/obj/item/radio/radio
var/radio_key = /obj/item/encryptionkey/headset_eng
var/channel_to_use = RADIO_CHANNEL_ENGINEERING
var/deployment_time = 8 SECONDS
var/deployment_timer_id
/obj/machinery/engine_choice/Initialize(mapload)
. = ..()
radio = new(src)
radio.keyslot = new radio_key
radio.set_listening(FALSE)
radio.recalculateChannels()
/obj/machinery/engine_choice/Destroy()
. = ..()
QDEL_NULL(radio)
//Helper interaction for if we can interact with this (called before and after menu selection).
/obj/machinery/engine_choice/proc/can_use(mob/user)
if(QDELETED(src) || QDESTROYING(src))
return FALSE
return user.can_perform_action(src, FORBID_TELEKINESIS_REACH)
/obj/machinery/engine_choice/interact(mob/user)
display_options(user)
/obj/machinery/engine_choice/multitool_act(mob/living/user, obj/item/multitool/tool)
if(!can_use(user))
return TRUE
if(deployment_timer_id)
return TRUE
playsound(src, 'sound/machines/buzz/buzz-sigh.ogg', 50, FALSE)
radio.talk_into(
src,
"[user] is currently removing [src]. If this is not intentional, please contact security.",
RADIO_CHANNEL_ENGINEERING
)
if(!do_after(user, 15 SECONDS, target=src))
return TRUE
if(!can_use(user))
return TRUE
if(deployment_timer_id)
return TRUE
var/turf/center_turf = get_turf(src)
message_admins("[user] has deleted [src][ADMIN_VERBOSEJMP(center_turf)]")
log_game("[user] has deleted [src] [AREACOORD(center_turf)]")
user.investigate_log("deleted [src] [AREACOORD(center_turf)]", INVESTIGATE_ENGINE)
playsound(src, SFX_SPARKS, 50, FALSE)
qdel(src)
return TRUE
/obj/machinery/engine_choice/proc/display_options(mob/user)
if(!can_use(user))
return FALSE
var/turf/center_turf = get_turf(src)
if(deployment_timer_id) //Timer already exists to deploy.
playsound(src, 'sound/machines/terminal_alert_short.ogg', 50, FALSE)
radio.talk_into(
src,
"Deployment operation canceled by [user].",
RADIO_CHANNEL_ENGINEERING
)
deltimer(deployment_timer_id)
deployment_timer_id = null
message_admins("[user] has canceled the engine type to be used for the shift [ADMIN_VERBOSEJMP(center_turf)]")
log_game("[user] has canceled the engine type to be used for the shift [AREACOORD(center_turf)]")
user.investigate_log("canceled the engine type to be used for the shift [AREACOORD(center_turf)]", INVESTIGATE_ENGINE)
return FALSE
playsound(src, 'sound/machines/terminal/terminal_prompt_confirm.ogg', 50, FALSE)
radio.talk_into(
src,
"[user] is currently selecting the engine type to use for the shift.",
RADIO_CHANNEL_ENGINEERING
)
var/choice = tgui_input_list(user, "Which engine would you like to order?", "Select an engine!", list(CHOICE_SUPERMATTER,CHOICE_RBMK))
if(!choice || !can_use(user) || deployment_timer_id)
return FALSE
//Deployment time!
message_admins("[user] has selected engine type \"[choice]\" to be used for the shift [ADMIN_VERBOSEJMP(center_turf)]")
log_game("[user] has selected engine type \"[choice]\" to be used for the shift [AREACOORD(center_turf)]")
user.investigate_log("selected engine type \"[choice]\" to be used for the shift [AREACOORD(center_turf)]", INVESTIGATE_ENGINE)
radio.talk_into(
src,
"[user] has selected option \"[choice]\" to be used for the shift! Stay clear of the deployment zone! ETA: [deployment_time/10] seconds!",
RADIO_CHANNEL_ENGINEERING
)
playsound(src, SFX_SPARKS, 50, FALSE)
new /obj/effect/temp_visual/telegraphing/big(center_turf, deployment_time)
deployment_timer_id = addtimer(CALLBACK(src, PROC_REF(do_deploy), center_turf, choice), deployment_time, TIMER_UNIQUE | TIMER_OVERRIDE | TIMER_STOPPABLE | TIMER_DELETE_ME)
/obj/machinery/engine_choice/proc/do_deploy(turf/center_turf,choice)
qdel(src)
playsound(center_turf,'sound/effects/magic/summonitems_generic.ogg',50,FALSE)
switch(choice)
if(CHOICE_SUPERMATTER)
deploy_supermatter(center_turf)
if(CHOICE_RBMK)
deploy_rbmk(center_turf)
//RB-MK2
/obj/machinery/engine_choice/proc/deploy_rbmk(turf/center_turf)
var/obj/machinery/rbmk2_sniffer/spawned_sniffer = new(center_turf)
for(var/turf/side_turf in orange(1,center_turf))
var/obj/machinery/power/rbmk2/preloaded/spawned_rbmk = new(side_turf)
spawned_sniffer.link_reactor(null,spawned_rbmk)
new /obj/item/paper/guides/jobs/engi/rbmk2(center_turf)
new /obj/item/stack/cable_coil/thirty(center_turf)
new /obj/item/paper/crumpled/rbmk2(center_turf)
//Supermatter
/obj/machinery/engine_choice/proc/deploy_supermatter(turf/center_turf)
new /obj/machinery/power/supermatter_crystal/engine(center_turf)
#undef CHOICE_SUPERMATTER
#undef CHOICE_RBMK