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
+14 -2
View File
@@ -333,7 +333,13 @@
radiation += plasma_temperature/2
plasma_temperature = 0
SSradiation.radiate(src, radiation)
radiation_pulse(
src,
max_range = 7,
threshold = RAD_HEAVY_INSULATION,
chance = URANIUM_IRRADIATION_CHANCE,
strength = energy * 0.001 //Might need to be increased.
)
Radiate()
/obj/effect/fusion_em_field/proc/Radiate()
@@ -539,7 +545,13 @@
//Reaction radiation is fairly buggy and there's at least three procs dealing with radiation here, this is to ensure constant radiation output.
/obj/effect/fusion_em_field/proc/radiation_scale()
SSradiation.radiate(src, 2 + plasma_temperature / PLASMA_TEMP_RADIATION_DIVISIOR)
radiation_pulse(
src,
max_range = 5,
threshold = RAD_MEDIUM_INSULATION,
chance = (URANIUM_IRRADIATION_CHANCE + (plasma_temperature / PLASMA_TEMP_RADIATION_DIVISIOR)),
strength = energy * 0.01 //Might need to be increased.
)
//Somehow fixing the radiation issue managed to break this, but moving it to it's own proc seemed to have fixed it. I don't know.
/obj/effect/fusion_em_field/proc/temp_dump()
@@ -11,6 +11,34 @@
var/fuel_colour
var/radioactivity = 0
var/const/initial_amount = 3000000
var/last_event = 0
/// Mutex to prevent infinite recursion when propagating radiation pulses
var/active = null
/obj/item/fuel_assembly/process()
radiate()
/obj/item/fuel_assembly/proc/radiate()
SIGNAL_HANDLER
if(active)
return
if(world.time <= last_event + 1.5 SECONDS)
return
active = TRUE
radiation_pulse(
src,
max_range = (radioactivity * 0.5),
threshold = RAD_HEAVY_INSULATION,
chance = DEFAULT_RADIATION_CHANCE,
strength = radioactivity * 0.5
)
last_event = world.time
active = FALSE
/obj/item/fuel_assembly/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/fuel_assembly/Initialize(mapload, var/_material, var/_colour)
. = ..()
@@ -38,17 +66,6 @@
add_overlay(list(I, image(icon, "fuel_assembly_bracket")))
rod_quantities[fuel_type] = initial_amount
/obj/item/fuel_assembly/process()
if(!radioactivity)
return PROCESS_KILL
if(istype(loc, /turf))
SSradiation.radiate(src, max(1,CEILING(radioactivity/30, 1)))
/obj/item/fuel_assembly/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
// Mapper shorthand.
/obj/item/fuel_assembly/deuterium/Initialize(mapload)
. = ..(mapload, MAT_DEUTERIUM)
@@ -116,11 +116,13 @@ GLOBAL_LIST(fusion_reactions)
var/turf/origin = get_turf(holder)
holder.Rupture()
qdel(holder)
var/radiation_level = 200
// Copied from the SM for proof of concept. //Not any more --Cirra //Use the whole z proc --Leshana
SSradiation.z_radiate(locate(1, 1, holder.z), radiation_level, 1)
radiation_pulse(
holder,
max_range = 50,
threshold = RAD_HEAVY_INSULATION,
chance = URANIUM_IRRADIATION_CHANCE,
strength = 500
)
for(var/mob/living/mob in GLOB.living_mob_list)
var/turf/T = get_turf(mob)
@@ -135,8 +137,7 @@ GLOBAL_LIST(fusion_reactions)
spawn(5)
if(I && I.loc)
qdel(I)
sleep(5)
qdel(holder)
explosion(origin, 1, 2, 5)
return 1