Radiation Rework (#28320)

* initial changes

* Rad wave is working. now to implement the rest

* Makes the waves square

* Makes wave square

* multiplies the strength in all instances of radiation_pulse by 4 because each pulse makes one wave instead of 4 now

* Undef thing and apply suggestion

* Make radiation_pulse() not radiate the radiation source and implements contamination

* Adds contamination to uranium walls and meteors

* Fixes stuff

* Handle some contamination on attack still need to take care of meteors

* Fixed the meteor stuff

* Introduce emission types

* moves contaminate_touch to an atom proc and renames it to contaminate_atom

* deduplicates some contamination code

* Move inherent radioactivity to a component and signals from the atom vars and behaviour

* fix some things with the new component

* Update inherent_radioactivity.dm

* implement contaminating things that hit things that are inherently radioactive

* window things

* adds emission type to the rad_act call

* Changes radiation insulation values on a bunch of stuff

* fixes radioactive component radiating the wrong type

* more adjustments

* refactros rad_act

* adjustments to collector power production

* Adds plastitaniumglass windows and makes further adjustments

* Adds sprites to the shards and plastitanium directional window

* Update misc_cleanables.dm

* removes alpha rad insulation from floor turfs

* Fixes a bug with the starting tile of radiation waves

* More adjustments

* Adjusting singularity rad production

* reduces window half life a bit to make power smoother and buffs full window rad conversion

* Strengthens gamma and beta radiation effect on mobs.

* Makes radsuit block radiation completely

* Fixes Geiger Counters

* Fixes contamination not irradiating the contaminated thing

* Fixes inherent radioactivity not processing. Also makes it stop processing when a nuke core is contained

* Fixes ghost contamination

* Adds info to the collector

* Handles alpha radiation better on humans and changes some instances of rad_act to base_rad_act

* oops

* adjustments and fixes to alpha rad handling on mobs

* Make collector info more compact

* Core no longer radiates and contaminates from within the nuke until the plates are removed

* Contamination no longer counts as being inside a mob(it is supposed to be surface level)

* Adds inherent radioactivity to a bunch of uranium things. makes it all process.

* Nerf full windows

* Adjustments to collector and fulltile window radiation absorption

* Reduces passive contamination, especially while on the floor

* Adds different rad types to the geiger counter and fixes a runtime

* Makes full tile windows strong again and disallows building them on top of collectors

* adds emissive blockers to the rad blacklist and gives windows and collectors priority when irradiating for increased consistency

* Gives each contamination type it's own color.

* Gives each contamination type it's own color.  And makes the rad hud display them separately

* Changes how much the radiation wave affects the source tile, adds decay for performance reasons and adjusts collector parameters as well as SM and singulo rad production

* improves performance at very high rad amounts

* Fixes supermatter sliver box not containing radiation

* Restores supermatter sliver to old behaviour(not inherently radioactive)

* Slight nerf to fulltile windows and removes an unnecessary multiplication from rad wave processing

* Removes redundant line from window rad act

* Fixes radiation waves ignoring walls

* fixes it better

* more adjustments to collector stats

* Adjustment to collector gamma absorption

* increases grille beta blocking

* Review changes
This commit is contained in:
Migratingcocofruit
2025-03-02 20:34:45 +00:00
committed by GitHub
parent e29a599118
commit ebf7fdbfd2
66 changed files with 945 additions and 384 deletions
@@ -15,14 +15,23 @@
slot_flags = ITEM_SLOT_BELT
flags = NOBLUDGEON
materials = list(MAT_METAL = 210, MAT_GLASS = 150)
rad_insulation_alpha = RAD_ONE_PERCENT
rad_insulation_beta = RAD_ONE_PERCENT
rad_insulation_gamma = RAD_ONE_PERCENT
var/grace = RAD_GEIGER_GRACE_PERIOD
var/datum/looping_sound/geiger/soundloop
var/scanning = FALSE
var/radiation_count = 0
var/current_tick_amount = 0
var/last_tick_amount = 0
var/radiation_count_alpha = 0
var/radiation_count_beta = 0
var/radiation_count_gamma = 0
var/current_tick_amount_alpha = 0
var/current_tick_amount_beta = 0
var/current_tick_amount_gamma = 0
var/last_tick_amount_alpha = 0
var/last_tick_amount_beta = 0
var/last_tick_amount_gamma = 0
var/fail_to_receive = 0
var/current_warning = 1
@@ -40,19 +49,33 @@
/obj/item/geiger_counter/process()
if(scanning)
radiation_count -= radiation_count / RAD_GEIGER_MEASURE_SMOOTHING
radiation_count += current_tick_amount / RAD_GEIGER_MEASURE_SMOOTHING
radiation_count_alpha -= radiation_count_alpha / RAD_GEIGER_MEASURE_SMOOTHING
radiation_count_alpha += current_tick_amount_alpha / RAD_GEIGER_MEASURE_SMOOTHING
radiation_count_beta -= radiation_count_beta / RAD_GEIGER_MEASURE_SMOOTHING
radiation_count_beta += current_tick_amount_beta / RAD_GEIGER_MEASURE_SMOOTHING
radiation_count_gamma -= radiation_count_gamma / RAD_GEIGER_MEASURE_SMOOTHING
radiation_count_gamma += current_tick_amount_gamma / RAD_GEIGER_MEASURE_SMOOTHING
if(current_tick_amount)
if(current_tick_amount_alpha)
grace = RAD_GEIGER_GRACE_PERIOD
last_tick_amount = current_tick_amount
last_tick_amount_alpha = current_tick_amount_alpha
if(current_tick_amount_beta)
grace = RAD_GEIGER_GRACE_PERIOD
last_tick_amount_beta = current_tick_amount_beta
if(current_tick_amount_gamma)
grace = RAD_GEIGER_GRACE_PERIOD
last_tick_amount_gamma = current_tick_amount_gamma
else if(!emagged)
grace--
if(grace <= 0)
radiation_count = 0
radiation_count_alpha = 0
radiation_count_beta = 0
radiation_count_gamma = 0
current_tick_amount = 0
current_tick_amount_alpha = 0
current_tick_amount_beta = 0
current_tick_amount_gamma = 0
update_icon(UPDATE_ICON_STATE)
update_sound()
@@ -65,6 +88,7 @@
if(emagged)
. += "<span class='warning'>The display seems to be incomprehensible.</span>"
return
var/radiation_count = max(radiation_count_alpha, radiation_count_beta, radiation_count_gamma)
switch(radiation_count)
if(-INFINITY to RAD_LEVEL_NORMAL)
. += "<span class='notice'>Ambient radiation level count reports that all is well.</span>"
@@ -79,7 +103,9 @@
if(RAD_LEVEL_CRITICAL + 1 to INFINITY)
. += "<span class='boldannounceic'>Ambient radiation levels above critical level!</span>"
. += "<span class='notice'>The last radiation amount detected was [last_tick_amount]</span>"
. += "<span class='notice'>The alpha radiation amount detected was [last_tick_amount_alpha]</span>"
. += "<span class='notice'>The beta radiation amount detected was [last_tick_amount_beta]</span>"
. += "<span class='notice'>The gamma radiation amount detected was [last_tick_amount_gamma]</span>"
/obj/item/geiger_counter/update_icon_state()
if(!scanning)
@@ -87,6 +113,7 @@
else if(emagged)
icon_state = "geiger_on_emag"
else
var/radiation_count = max(radiation_count_alpha + radiation_count_beta + radiation_count_gamma)
switch(radiation_count)
if(-INFINITY to RAD_LEVEL_NORMAL)
icon_state = "geiger_on_1"
@@ -103,17 +130,24 @@
/obj/item/geiger_counter/proc/update_sound()
var/datum/looping_sound/geiger/loop = soundloop
var/radiation_count = max(radiation_count_alpha, radiation_count_beta, radiation_count_gamma)
if(!scanning || !radiation_count)
loop.stop()
return
loop.last_radiation = radiation_count
loop.start()
/obj/item/geiger_counter/rad_act(amount)
. = ..()
/obj/item/geiger_counter/rad_act(atom/source, amount, emission_type)
amount *= 100
if(amount <= RAD_BACKGROUND_RADIATION || !scanning)
return
current_tick_amount += amount
switch(emission_type)
if(ALPHA_RAD)
current_tick_amount_alpha += amount
if(BETA_RAD)
current_tick_amount_beta += amount
if(GAMMA_RAD)
current_tick_amount_gamma += amount
update_icon(UPDATE_ICON_STATE)
/obj/item/geiger_counter/attack_self__legacy__attackchain(mob/user)
@@ -129,8 +163,12 @@
addtimer(CALLBACK(src, PROC_REF(scan), target, user), 20, TIMER_UNIQUE) // Let's not have spamming GetAllContents
else
user.visible_message("<span class='notice'>[user] scans [target] with [src].</span>", "<span class='danger'>You project [src]'s stored radiation into [target]!</span>")
target.rad_act(radiation_count)
radiation_count = 0
target.base_rad_act(src, radiation_count_alpha, ALPHA_RAD)
target.base_rad_act(src, radiation_count_beta, BETA_RAD)
target.base_rad_act(src, radiation_count_gamma, GAMMA_RAD)
radiation_count_alpha = 0
radiation_count_beta = 0
radiation_count_gamma = 0
return TRUE
/obj/item/geiger_counter/proc/scan(atom/A, mob/user)
@@ -158,7 +196,9 @@
return FALSE
user.visible_message("<span class='notice'>[user] refastens [src]'s maintenance panel!</span>", "<span class='notice'>You reset [src] to its factory settings!</span>")
emagged = FALSE
radiation_count = 0
radiation_count_alpha = 0
radiation_count_beta = 0
radiation_count_gamma = 0
update_icon(UPDATE_ICON_STATE)
return TRUE
else
@@ -170,7 +210,9 @@
if(!scanning)
to_chat(user, "<span class='warning'>[src] must be on to reset its radiation level!</span>")
return
radiation_count = 0
radiation_count_alpha = 0
radiation_count_beta = 0
radiation_count_gamma = 0
to_chat(user, "<span class='notice'>You flush [src]'s radiation counts, resetting it to normal.</span>")
update_icon(UPDATE_ICON_STATE)
@@ -198,8 +240,8 @@
RegisterSignal(user, COMSIG_ATOM_RAD_ACT, PROC_REF(redirect_rad_act))
listeningTo = user
/obj/item/geiger_counter/cyborg/proc/redirect_rad_act(datum/source, amount)
rad_act(amount)
/obj/item/geiger_counter/cyborg/proc/redirect_rad_act(datum/source, amount, emission_type)
base_rad_act(source, amount, emission_type)
/obj/item/geiger_counter/cyborg/dropped()
. = ..()