Files
Paradise/code/datums/components/inherent_radioactivity.dm
Migratingcocofruit ebf7fdbfd2 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
2025-03-02 20:34:45 +00:00

73 lines
3.2 KiB
Plaintext

/datum/component/inherent_radioactivity
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
var/radioactivity_alpha
var/radioactivity_beta
var/radioactivity_gamma
/// Contamination cooldown in seconds
var/contaminate_cd
var/contained = FALSE
COOLDOWN_DECLARE(contaminate_cooldown)
/datum/component/inherent_radioactivity/Initialize(_radioactivity_alpha = 0, _radioactivity_beta = 0, _radioactivity_gamma = 0, _contaminate_cd = 1.5)
radioactivity_alpha = _radioactivity_alpha
radioactivity_beta = _radioactivity_beta
radioactivity_gamma = _radioactivity_gamma
contaminate_cd = _contaminate_cd
RegisterSignal(parent, list(COMSIG_MOVABLE_IMPACT, COMSIG_ATOM_HITBY), PROC_REF(impact_contaminate))
RegisterSignal(parent, COMSIG_ATOM_ATTACK_HAND, PROC_REF(try_contaminate_hand))
if(isitem(parent))
RegisterSignal(parent, list(COMSIG_ATTACK, COMSIG_ATTACK_OBJ), PROC_REF(impact_contaminate))
START_PROCESSING(SSradiation, src)
/datum/component/inherent_radioactivity/proc/impact_contaminate(atom/source, atom/target)
SIGNAL_HANDLER
if(contaminate_cd <= 0 || COOLDOWN_FINISHED(src, contaminate_cooldown))
if(radioactivity_alpha)
target.contaminate_atom(source, radioactivity_alpha, ALPHA_RAD)
if(radioactivity_beta)
target.contaminate_atom(source, radioactivity_beta, BETA_RAD)
if(radioactivity_gamma)
target.contaminate_atom(source, radioactivity_gamma, GAMMA_RAD)
if(contaminate_cd > 0)
COOLDOWN_START(src, contaminate_cooldown, contaminate_cd SECONDS)
/datum/component/inherent_radioactivity/proc/try_contaminate_hand(atom/source, atom/target)
SIGNAL_HANDLER
if(contaminate_cd <= 0 || COOLDOWN_FINISHED(src, contaminate_cooldown))
if(radioactivity_alpha)
target.contaminate_atom(source, radioactivity_alpha, ALPHA_RAD, HANDS)
if(radioactivity_beta)
target.contaminate_atom(source, radioactivity_beta, BETA_RAD, HANDS)
if(radioactivity_gamma)
target.contaminate_atom(source, radioactivity_gamma, GAMMA_RAD, HANDS)
if(contaminate_cd > 0)
COOLDOWN_START(src, contaminate_cooldown, contaminate_cd SECONDS)
/datum/component/inherent_radioactivity/InheritComponent(datum/component/C, i_am_original, _radioactivity_alpha = 0, _radioactivity_beta = 0, _radioactivity_gamma = 0, _contaminate_cd = 1.5)
if(!i_am_original)
return
if(C)
var/datum/component/inherent_radioactivity/other = C
radioactivity_alpha = other.radioactivity_alpha
radioactivity_beta = other.radioactivity_beta
radioactivity_gamma = other.radioactivity_gamma
contaminate_cd = other.contaminate_cd
else
radioactivity_alpha = _radioactivity_alpha
radioactivity_beta = _radioactivity_beta
radioactivity_gamma = _radioactivity_gamma
contaminate_cd = _contaminate_cd
/datum/component/inherent_radioactivity/process()
if(radioactivity_alpha > 0)
contaminate_adjacent(parent, radioactivity_alpha, ALPHA_RAD)
radiation_pulse(parent, 2 * radioactivity_alpha, ALPHA_RAD)
if(radioactivity_beta > 0)
contaminate_adjacent(parent, radioactivity_beta, BETA_RAD)
radiation_pulse(parent, 2 * radioactivity_beta, BETA_RAD)
if(radioactivity_gamma > 0)
contaminate_adjacent(parent, radioactivity_gamma, GAMMA_RAD)
radiation_pulse(parent, 2 * radioactivity_gamma, GAMMA_RAD)
SSradiation.update_rad_cache_inherent(src)