Skip to content

Commit

Permalink
Ports the RBMK from NSV (for real this time) (#10364)
Browse files Browse the repository at this point in the history
* done?

* added crate

To do:
On initialization, make new ID for the RBMK and have computers auto-locate and set their own IDs to it
Create and make the crate use the RBMK machine board instead of the machine + add the ability to move the RBMK when inactive

* fixed tools.dmi

* Circuit board done!

now onto the rest of the TODO list...

* 2

-Added the ability for the RBMK to alert engineers of its meltdown status over comms. (TODO: Add in a cooldown period)
-Fixed some bugs revolving around the computers not linking with RBMK
-Fixed bug where RBMK would not connect to a pipe layer

* work

To do:

New sprites for the RBMK, include five fuel rod variations + show where pipes input and output
New SFX for the RBMK.
Get the three input pipes to be made automatically correctly.
Get the RBMK to be wrenchable and movable

* day 2

* progress?

* still not working...

* For dakae!

* to do: refactor

* refactor 1

* soon:tm:

* day 2 of new code

* DAY @*()#&@!#(*

* remove unnecessary sounds, fix runtime issue

* New alarm.ogg sfx

credit to: https://freesound.org/people/guitarguy1985/sounds/54048/

license: CC0 1.0 Deed

* turns out unnecessary sounds were infact necessary, as well as icon changes and stuff

* Final!

* fix a thing

* fix things + make co2 actually work

* fdsfds

* finish

* update to apperance, makes it actually deconstructable and not die by itself

* propane and propane accessories

* last minute changes

* aaaa

* fixed proper blowout and meltdown conditions

* added ghost statistics

* to do: figure out correct graph for damage model

* fixed console, damage handler changes

* added ambience audio while th ereactor is active, plus bugfixes

* aaaa

* finally fixed the damage handler model, also made the ambience not bass boosted

* made passively produced power a thing

* integrity viewing + tuned down power generation

* gah

* rah

* maybe?

* Update rbmk_core.dm

* no more arbitrary names

* womp womp

* Update rbmk_procs.dm

* Update code/modules/power/rbmk/rbmk_monitoring.dm

Co-authored-by: EvilDragonfiend <[email protected]>

* Update code/modules/power/rbmk/rbmk_monitoring.dm

Co-authored-by: EvilDragonfiend <[email protected]>

* Update code/modules/power/rbmk/rbmk_procs.dm

Co-authored-by: EvilDragonfiend <[email protected]>

* Update rbmk_monitoring.dm

---------

Co-authored-by: EvilDragonfiend <[email protected]>
  • Loading branch information
XeonMations and EvilDragonfiend authored Nov 23, 2024
1 parent c64393e commit 0926e7d
Show file tree
Hide file tree
Showing 32 changed files with 2,057 additions and 0 deletions.
8 changes: 8 additions & 0 deletions beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,7 @@
#include "code\game\objects\effects\decals\cleanable\food.dm"
#include "code\game\objects\effects\decals\cleanable\humans.dm"
#include "code\game\objects\effects\decals\cleanable\misc.dm"
#include "code\game\objects\effects\decals\cleanable\nuclear_waste.dm"
#include "code\game\objects\effects\decals\cleanable\robots.dm"
#include "code\game\objects\effects\decals\turfdecal\dirt.dm"
#include "code\game\objects\effects\decals\turfdecal\guideline.dm"
Expand Down Expand Up @@ -3516,6 +3517,13 @@
#include "code\modules\power\lighting\light_items.dm"
#include "code\modules\power\lighting\light_mapping_helpers.dm"
#include "code\modules\power\lighting\light_wallframes.dm"
#include "code\modules\power\rbmk\_rbmk_defines.dm"
#include "code\modules\power\rbmk\fuel_rods.dm"
#include "code\modules\power\rbmk\rbmk_core.dm"
#include "code\modules\power\rbmk\rbmk_main_processes.dm"
#include "code\modules\power\rbmk\rbmk_monitoring.dm"
#include "code\modules\power\rbmk\rbmk_parts.dm"
#include "code\modules\power\rbmk\rbmk_procs.dm"
#include "code\modules\power\singularity\anomaly.dm"
#include "code\modules\power\singularity\boh_tear.dm"
#include "code\modules\power\singularity\collector.dm"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#define WIRE_LAYER 2.4
#define WIRE_TERMINAL_LAYER 2.45
#define UNDER_CATWALK 2.454
#define NUCLEAR_REACTOR_LAYER 2.456 //Below atmospheric devices, above hidden pipes and catwalks.
#define CATWALK_LATTICE 2.455
#define GAS_SCRUBBER_LAYER 2.46
#define GAS_PIPE_VISIBLE_LAYER 2.47
Expand Down
5 changes: 5 additions & 0 deletions code/__DEFINES/machines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@
#define SUPERMATTER_EMERGENCY 5 // Integrity < 25%
#define SUPERMATTER_DELAMINATING 6 // Pretty obvious.

#define NUCLEAR_REACTOR_ERROR -1
#define NUCLEAR_REACTOR_INACTIVE 0
#define NUCLEAR_REACTOR_ACTIVE 1
#define NUCLEAR_EXPLODING 2

//Nuclear bomb stuff
#define NUKESTATE_INTACT 5
#define NUKESTATE_UNSCREWED 4
Expand Down
18 changes: 18 additions & 0 deletions code/datums/looping_sounds/machinery_sounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,21 @@
falloff_exponent = 5
falloff_distance = 3
volume = 150

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/datum/looping_sound/rbmk
mid_sounds = list('sound/effects/rbmk/alarm.ogg' = 1)
volume = 100
extra_range = 10
mid_length = 58
ignore_walls = TRUE

/datum/looping_sound/rbmk_ambience
mid_sounds = list('sound/effects/rbmk/ambience.ogg' = 1)
mid_length = 19
volume = 20
extra_range = 10
falloff_exponent = 10
falloff_distance = 5
vary = FALSE
46 changes: 46 additions & 0 deletions code/game/objects/effects/decals/cleanable/nuclear_waste.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/obj/effect/decal/cleanable/nuclear_waste
name = "plutonium sludge"
desc = "A writhing pool of heavily irradiated, spent reactor fuel. You probably shouldn't step through this..."
icon = 'icons/obj/machines/rbmkparts.dmi'
icon_state = "nuclearwaste"
alpha = 150
light_color = LIGHT_COLOR_CYAN
color = "#ff9eff"

/obj/effect/decal/cleanable/nuclear_waste/Initialize(mapload)
. = ..()
set_light(3)

var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
)
AddElement(/datum/element/connect_loc, loc_connections)

/obj/effect/decal/cleanable/nuclear_waste/ex_act(severity, target)
if(severity != EXPLODE_DEVASTATE)
return
qdel(src)

/obj/effect/decal/cleanable/nuclear_waste/on_entered(datum/source, atom/movable/entered_mob)
if(isliving(entered_mob))
var/mob/living/L = entered_mob
playsound(loc, 'sound/effects/gib_step.ogg', HAS_TRAIT(L, TRAIT_LIGHT_STEP) ? 20 : 50, 1)
radiation_pulse(src, 625, 5) //MORE RADS

/obj/effect/decal/cleanable/nuclear_waste/attackby(obj/item/tool, mob/user)
if(tool.tool_behaviour == TOOL_SHOVEL)
radiation_pulse(src, 500, 5) //MORE RADS //The careful clearing of sludge should not give off as much radiation as casually running through it.
to_chat(user, "<span class='notice'>You start to clear [src]...</span>")
if(tool.use_tool(src, user, 50, volume=100))
to_chat(user, "<span class='notice'>You clear [src]. </span>")
qdel(src)
return
. = ..()

/obj/effect/decal/cleanable/nuclear_waste/epicenter //The one that actually does the irradiating. This is to avoid every bit of sludge PROCESSING
name = "dense nuclear sludge"


/obj/effect/decal/cleanable/nuclear_waste/epicenter/Initialize(mapload)
. = ..()
AddComponent(/datum/component/radioactive, 1500, src, 0)
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@
icon_state = "engineering"
build_path = /obj/machinery/computer/turbine_computer

/obj/item/circuitboard/computer/control_rods
name = "rbmk reactor control rod console (Computer Board)"
icon_state = "engineering"
build_path = /obj/machinery/computer/reactor/control_rods

//Generic

Expand Down
47 changes: 47 additions & 0 deletions code/modules/cargo/packs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,17 @@
crate_name = "power cell crate"
crate_type = /obj/structure/closet/crate/engineering/electrical

/datum/supply_pack/engineering/sealant
name = "Engine Sealant Crate"
desc = "Nuclear reactor looking a bit cracked? Don't be afraid to slap on some NT brand sealant to patch those holes right up!"
cost = 1000
max_supply = 1
contains = list(/obj/item/sealant,
/obj/item/sealant,
/obj/item/sealant)
crate_name = "sealant crate"
crate_type = /obj/structure/closet/crate/engineering/

/datum/supply_pack/engineering/shuttle_engine
name = "Shuttle Engine Crate"
desc = "Through advanced bluespace-shenanigans, our engineers have managed to fit an entire shuttle engine into one tiny little crate. Requires CE access to open."
Expand All @@ -1125,6 +1136,20 @@
/obj/item/storage/toolbox/mechanical)
crate_name = "toolbox crate"

/datum/supply_pack/engineering/fuel_rods
name = "Uranium Fuel Rod Crate"
desc = "A five nuclear reactor grade fuel rod crate. Don't forget to wear radiation protection!"
cost = 3000
max_supply = 2
access_budget = ACCESS_ENGINE
contains = list(/obj/item/fuel_rod,
/obj/item/fuel_rod,
/obj/item/fuel_rod,
/obj/item/fuel_rod,
/obj/item/fuel_rod)
crate_name = "fuel rod crate"
crate_type = /obj/structure/closet/crate/secure/engineering

/datum/supply_pack/engineering/vending/engineering
name = "Engineering Vending Crate"
desc = "Sick of assistants breaking into engineering for tools? Contains one Engi-Vend refill and one YouTool refill."
Expand Down Expand Up @@ -1336,6 +1361,28 @@
/obj/machinery/power/rad_collector)
crate_name = "collector crate"

/datum/supply_pack/engine/nuclear_reactor
name = "RBMK Nuclear Reactor Engine Crate"
desc = "Contains the boards for an NT certified nuclear power engine! Don't forget to wear a radiation suit!"
cost = 7000
max_supply = 1
access = ACCESS_CE
access_budget = ACCESS_CE
contains = list(/obj/item/RBMK_box/core,
/obj/item/RBMK_box/body/coolant_input,
/obj/item/RBMK_box/body/moderator_input,
/obj/item/RBMK_box/body/waste_output,
/obj/item/RBMK_box/body,
/obj/item/RBMK_box/body,
/obj/item/RBMK_box/body,
/obj/item/RBMK_box/body,
/obj/item/RBMK_box/body,
/obj/item/circuitboard/computer/control_rods,
/obj/item/book/manual/wiki/rbmk)
crate_name = "nuclear engine crate"
crate_type = /obj/structure/closet/crate/secure/engineering
dangerous = TRUE

/datum/supply_pack/engine/sing_gen
name = "Singularity Generator Crate"
desc = "The key to unlocking the power of Lord Singuloth. Particle Accelerator not included."
Expand Down
38 changes: 38 additions & 0 deletions code/modules/power/rbmk/_rbmk_defines.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#define RBMK_TEMPERATURE_OPERATING 640 //Celsius
#define RBMK_TEMPERATURE_WARNING 800 //At this point the entire station is alerted to a meltdown.
#define RBMK_TEMPERATURE_CRITICAL 900 //Kablowey

#define RBMK_NO_COOLANT_TOLERANCE 5 //How many process()ing ticks the reactor can sustain without coolant before slowly taking damage

#define RBMK_PRESSURE_OPERATING 6500 //KPA
#define RBMK_PRESSURE_WARNING 8200 //KPA, At this point the entire station is alerted to a meltdown.
#define RBMK_PRESSURE_CRITICAL 10100 //KPA, Kaboom

#define RBMK_MAX_CRITICALITY 3 //No more criticality than N for now.

#define RBMK_POWER_FLAVOURISER 800 //To turn those KWs into something usable

#define WARNING_TIME_DELAY 60 //to prevent accent sounds from layering
#define REACTOR_COUNTDOWN_TIME 30 SECONDS

///High pressure damage
#define RBMK_PRESSURE_DAMAGE (1<<0)
///High temperature damage
#define RBMK_TEMPERATURE_DAMAGE (1<<1)

#define REACTOR_INACTIVE 0 // No or minimal energy
#define REACTOR_NOMINAL 1 // Normal operation
#define REACTOR_WARNING 2 // Integrity damaged
#define REACTOR_DANGER 3 // Integrity < 50%
#define REACTOR_EMERGENCY 4 // Integrity < 25%
#define REACTOR_MELTING 5 // Pretty obvious.

#define REACTOR_MELTING_PERCENT 5
#define REACTOR_EMERGENCY_PERCENT 25
#define REACTOR_DANGER_PERCENT 50
#define REACTOR_WARNING_PERCENT 100

#define REACTOR_NEW_SEALS 0.875
#define REACTOR_CRACKED_SEALS 0.5

#define SAFE_POWER_LEVEL 20
Loading

0 comments on commit 0926e7d

Please sign in to comment.