Radiation Refactor (#19270)

* Part 1

* WIP

* The rest of these

* More stuff

* Whoops, did that wrong

* typo

* gweeen

* This all works

* SHOWER

* Rads

* awa

* rad

* Update life.dm

* edits

* Makes lvl 3 rads give you a warning.

You should already know by this point, but this makes it EXTRA clear you're getting fucked

* Update vorestation.dme

* aaa

* propagate

* gwah

* more fixes

* AAA

* Update radiation.dm

* Update radiation.dm

* mobs rads

* rads

* fix this

* Update _reagents.dm

* these

* Get rid of these

* rad

* Update config.txt

* fixed

* Update radiation_effects.dm
This commit is contained in:
Cameron Lennox
2026-03-22 12:29:09 -04:00
committed by GitHub
parent d91baf9c9f
commit cbc4151bfb
113 changed files with 2044 additions and 551 deletions
+10 -2
View File
@@ -18,6 +18,7 @@
var/upgrading = FALSE
var/applies_material_colour = 1
var/wall_type = /turf/simulated/wall
rad_insulation = RAD_VERY_LIGHT_INSULATION
/obj/structure/girder/Initialize(mapload, var/material_key)
. = ..()
@@ -42,9 +43,16 @@
/obj/structure/girder/proc/radiate()
var/total_radiation = girder_material.radioactivity + (reinf_material ? reinf_material.radioactivity / 2 : 0)
if(!total_radiation)
return
return FALSE
SSradiation.radiate(src, total_radiation)
radiation_pulse(
src,
max_range = 5,
threshold = RAD_MEDIUM_INSULATION,
chance = URANIUM_IRRADIATION_CHANCE,
minimum_exposure_time = URANIUM_RADIATION_MINIMUM_EXPOSURE_TIME,
strength = total_radiation
)
return total_radiation
+2
View File
@@ -59,6 +59,7 @@
density = FALSE
layer = ABOVE_TURF_LAYER
can_atmos_pass = ATMOS_PASS_NO
rad_insulation = RAD_LIGHT_INSULATION
alpha = 150
/obj/structure/holosign/barrier/combifan/Destroy()
@@ -75,6 +76,7 @@
icon_state = "holo_medical"
alpha = 125
var/buzzed = 0
rad_insulation = RAD_NO_INSULATION
/obj/structure/holosign/barrier/medical/CanPass(atom/movable/mover, border_dir)
. = ..()
+44 -1
View File
@@ -23,6 +23,7 @@
var/can_pick = TRUE //can it be picked/bypassed?
var/lock_difficulty = 1 //multiplier to picking/bypassing time
var/keysound = 'sound/items/toolbelt_equip.ogg'
rad_insulation = RAD_MEDIUM_INSULATION
/obj/structure/simple_door/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
TemperatureAct(exposed_temperature)
@@ -240,19 +241,57 @@
/obj/structure/simple_door/process()
if(!material.radioactivity)
return
SSradiation.radiate(src, round(material.radioactivity/3))
radiation_pulse(
src,
max_range = 5,
threshold = RAD_MEDIUM_INSULATION,
chance = round((material.radioactivity * 0.33), 0.1),
minimum_exposure_time = URANIUM_RADIATION_MINIMUM_EXPOSURE_TIME,
strength = material.radioactivity
)
/obj/structure/simple_door/iron/Initialize(mapload,var/material_name)
. = ..(mapload, material_name || MAT_IRON)
/obj/structure/simple_door/silver
rad_insulation = RAD_HEAVY_INSULATION
/obj/structure/simple_door/silver/Initialize(mapload,var/material_name)
. = ..(mapload, material_name || MAT_SILVER)
/obj/structure/simple_door/gold
rad_insulation = RAD_HEAVY_INSULATION
/obj/structure/simple_door/gold/Initialize(mapload,var/material_name)
. = ..(mapload, material_name || MAT_GOLD)
/obj/structure/simple_door/uranium
rad_insulation = RAD_NO_INSULATION
var/last_event = 0
/// Mutex to prevent infinite recursion when propagating radiation pulses
var/active = null
/obj/structure/simple_door/uranium/Initialize(mapload,var/material_name)
. = ..(mapload, material_name || MAT_URANIUM)
START_PROCESSING(SSobj, src)
/obj/structure/simple_door/uranium/proc/radiate()
SIGNAL_HANDLER
if(active)
return
if(world.time <= last_event + 1.5 SECONDS)
return
active = TRUE
radiation_pulse(
src,
max_range = 3,
threshold = RAD_LIGHT_INSULATION,
chance = URANIUM_IRRADIATION_CHANCE,
minimum_exposure_time = URANIUM_RADIATION_MINIMUM_EXPOSURE_TIME,
strength = 5
)
last_event = world.time
active = FALSE
/obj/structure/simple_door/sandstone/Initialize(mapload,var/material_name)
. = ..(mapload, material_name || MAT_SANDSTONE)
@@ -260,9 +299,13 @@
/obj/structure/simple_door/phoron/Initialize(mapload,var/material_name)
. = ..(mapload, material_name || MAT_PHORON)
/obj/structure/simple_door/diamond
rad_insulation = RAD_EXTREME_INSULATION
/obj/structure/simple_door/diamond/Initialize(mapload,var/material_name)
. = ..(mapload, material_name || MAT_DIAMOND)
//I was going to give wooden doors RAD_VERY_LIGHT_INSULATION but they need a proper parent instead of this garbage.
/obj/structure/simple_door/wood/Initialize(mapload,var/material_name)
. = ..(mapload, material_name || MAT_WOOD)
knock_sound = 'sound/machines/door/knock_wood.wav'
+1 -2
View File
@@ -261,10 +261,8 @@
//Yes, showers are super powerful as far as washing goes.
/obj/machinery/shower/proc/wash_atom(atom/A)
/* //TG cleans rads and only does CLEAN_WASH, not sure if that's wanted here.
A.wash(CLEAN_RAD | CLEAN_TYPE_WEAK) // Clean radiation non-instantly
A.wash(CLEAN_WASH)
*/
A.wash(CLEAN_SCRUB)
reagents.splash(A, reaction_volume / 20, 1, TRUE, min_spill = 0, max_spill = 0) //Reaction volume needs to be divided by 20 due to a larger internal volume
@@ -274,6 +272,7 @@
check_heat(L)
L.extinguish_mob()
L.adjust_fire_stacks(-20) //Douse ourselves with water to avoid fire more easily
L.radiation = CLAMP(L.radiation - 5, 0, RADIATION_CAP)
if(!iscarbon(A))
return
+5
View File
@@ -23,6 +23,7 @@
var/glasstype = null // Set this in subtypes. Null is assumed strange or otherwise impossible to dismantle, such as for shuttle glass.
var/silicate = 0 // number of units of silicate
var/fulltile = FALSE // Set to true on full-tile variants.
rad_insulation = RAD_VERY_LIGHT_INSULATION //Windows can have multiple placed on one tile, meaning you have to account for the potential that someone could just build a bunch of windows on one tile to prevent rads entirely.
/obj/structure/window/examine(mob/user)
. = ..()
@@ -514,6 +515,7 @@
maxhealth = 80
fulltile = TRUE
flags = NONE
rad_insulation = RAD_LIGHT_INSULATION
/obj/structure/window/phoronreinforced
name = "reinforced borosilicate window"
@@ -527,12 +529,14 @@
damage_per_fire_tick = 1.0 // This should last for 80 fire ticks if the window is not damaged at all. The idea is that borosilicate windows have something like ablative layer that protects them for a while.
maxhealth = 80.0
force_threshold = 10
rad_insulation = RAD_LIGHT_INSULATION
/obj/structure/window/phoronreinforced/full
icon_state = "phoronrwindow-full"
maxhealth = 160
fulltile = TRUE
flags = NONE
rad_insulation = RAD_MEDIUM_INSULATION
/obj/structure/window/reinforced
name = "reinforced window"
@@ -578,6 +582,7 @@
basestate = "w"
dir = 5
force_threshold = 7
rad_insulation = RAD_MEDIUM_INSULATION
/obj/structure/window/reinforced/polarized
name = "electrochromic window"
@@ -11,6 +11,7 @@
damage_per_fire_tick = 1.0
maxhealth = 100.0
force_threshold = 10
rad_insulation = RAD_EXTREME_INSULATION
/obj/structure/window/titanium/full
icon_state = "window-full"
@@ -30,6 +31,7 @@
damage_per_fire_tick = 1.0
maxhealth = 120.0
force_threshold = 10
rad_insulation = RAD_EXTREME_INSULATION
/obj/structure/window/plastitanium/full
icon_state = "window-full"