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
+18 -12
View File
@@ -14,33 +14,36 @@
var/active = 0
var/locked = 0
var/drainratio = 1
rad_insulation = RAD_EXTREME_INSULATION //It sucks up the radiation. If you're standing behind it, you're pretty safe.
/obj/machinery/power/rad_collector/Initialize(mapload)
. = ..()
GLOB.rad_collectors += src
AddElement(/datum/element/climbable)
RegisterSignal(src, COMSIG_IN_RANGE_OF_IRRADIATION, PROC_REF(process_rads))
/obj/machinery/power/rad_collector/Destroy()
GLOB.rad_collectors -= src
UnregisterSignal(src, COMSIG_IN_RANGE_OF_IRRADIATION)
return ..()
/obj/machinery/power/rad_collector/process()
/obj/machinery/power/rad_collector/proc/process_rads(datum/source, datum/radiation_pulse_information/pulse_information)
SIGNAL_HANDLER
//so that we don't zero out the meter if the SM is processed first.
last_power = last_power_new
last_power_new = 0
if(P && active)
var/rads = SSradiation.get_rads_at_turf(get_turf(src))
if(rads)
receive_pulse(rads * 5) //Maths is hard
if(pulse_information)
var/amount_of_rads = pulse_information.strength
receive_pulse((amount_of_rads))
if(P)
if(P.air_contents.gas[GAS_PHORON] == 0)
investigate_log(span_red("out of fuel") + ".","singulo")
eject()
else
P.air_contents.adjust_gas(GAS_PHORON, -0.001*drainratio)
if(P.air_contents.gas[GAS_PHORON] == 0)
investigate_log(span_red("out of fuel") + ".","singulo")
eject()
else
P.air_contents.adjust_gas(GAS_PHORON, -0.0001*drainratio)
return
@@ -126,12 +129,15 @@
else
update_icons()
// Continuing here, SM giving us ~170 rads per pulse, a phoron canister full of 30 mols, and * 20 we get:
// 102000W per collector...So 10 collectors will give us ~1MW.
/obj/machinery/power/rad_collector/proc/receive_pulse(var/pulse_strength)
if(P && active)
var/power_produced = 0
power_produced = P.air_contents.gas[GAS_PHORON]*pulse_strength*20
add_avail(power_produced)
last_power_new = power_produced
if(power_produced)
add_avail(power_produced)
last_power_new = power_produced
return
return
@@ -148,13 +148,27 @@
/obj/machinery/particle_smasher/process()
if(!src.anchored) // Rapidly loses focus.
if(energy)
SSradiation.radiate(src, round(((src.energy-150)/50)*5,1))
radiation_pulse(
src,
max_range = 7,
threshold = RAD_HEAVY_INSULATION,
chance = round(((src.energy-150)/50)*5,1),
minimum_exposure_time = URANIUM_RADIATION_MINIMUM_EXPOSURE_TIME,
strength = energy * 0.1 //60 rads at max energy.
)
energy = max(0, energy - 30)
update_icon()
return
if(energy)
SSradiation.radiate(src, round(((src.energy-150)/50)*5,1))
radiation_pulse(
src,
max_range = 7,
threshold = RAD_HEAVY_INSULATION,
chance = round(((src.energy-150)/50)*5,1),
minimum_exposure_time = URANIUM_RADIATION_MINIMUM_EXPOSURE_TIME,
strength = energy * 0.1 //60 rads at max energy.
)
energy = CLAMP(energy - 5, 0, max_energy)
return
@@ -184,7 +198,14 @@
if(successful_craft)
visible_message(span_warning("\The [src] fizzles."))
if(prob(33)) // Why are you blasting it after it's already done!
SSradiation.radiate(src, 10 + round(src.energy / 60, 1))
radiation_pulse(
src,
max_range = 7,
threshold = RAD_HEAVY_INSULATION,
chance = URANIUM_IRRADIATION_CHANCE + round(src.energy / 60, 1),
minimum_exposure_time = URANIUM_RADIATION_MINIMUM_EXPOSURE_TIME,
strength = energy * 0.1
)
energy = max(0, energy - 30)
update_icon()
return
+24 -4
View File
@@ -403,11 +403,16 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity)
/obj/singularity/proc/toxmob()
var/toxrange = 10
var/toxdamage = 4
var/radiation = 15
if (src.energy>200)
toxdamage = round(((src.energy-150)/50)*4,1)
radiation = round(((src.energy-150)/50)*5,1)
SSradiation.radiate(src, radiation) //Always radiate at max, so a decent dose of radiation is applied
radiation_pulse(
src,
max_range = 7,
threshold = RAD_EXTREME_INSULATION - 0.1,
chance = URANIUM_IRRADIATION_CHANCE + round(energy / 60, 1),
minimum_exposure_time = URANIUM_RADIATION_MINIMUM_EXPOSURE_TIME,
strength = 250
)
for(var/mob/living/M in view(toxrange, src.loc))
if(SEND_SIGNAL(M, COMSIG_CHECK_FOR_GODMODE) & COMSIG_GODMODE_CANCEL)
return 0 // Cancelled by a component
@@ -450,13 +455,28 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity)
to_chat(M, span_danger("You hear an unearthly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat."))
to_chat(M, span_danger("You don't even have a moment to react as you are reduced to ashes by the intense radiation."))
M.dust()
SSradiation.radiate(src, rand(energy))
radiation_pulse(
src,
max_range = 10,
threshold = RAD_EXTREME_INSULATION,
chance = URANIUM_IRRADIATION_CHANCE * 8,
strength = 1000
)
return
/obj/singularity/proc/pulse()
for(var/obj/machinery/power/rad_collector/R in GLOB.rad_collectors)
if (get_dist(R, src) <= 15) //Better than using orange() every process.
R.receive_pulse(energy)
//Yes, this means rad collectors can double dip on the singulo, but you could always use the safer SM or tesla, so it gets a small buff.
radiation_pulse(
src,
max_range = 15,
threshold = RAD_EXTREME_INSULATION,
chance = URANIUM_IRRADIATION_CHANCE * 8,
strength = energy * 0.25
)
/obj/singularity/proc/on_capture()
chained = 1