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 22:34:45 +02:00
committed by GitHub
parent e29a599118
commit ebf7fdbfd2
66 changed files with 945 additions and 384 deletions
@@ -1406,3 +1406,12 @@ so that different stomachs can handle things in different ways VB*/
M.update_revive()
add_attack_logs(M, M, "Revived with Lazarus Reagent")
SSblackbox.record_feedback("tally", "players_revived", 1, "lazarus_reagent")
/mob/living/carbon/is_inside_mob(atom/thing)
if(!(..()))
return FALSE
if(head && head.UID() == thing.UID())
return FALSE
if(wear_suit && wear_suit.UID() == thing.UID())
return FALSE
return TRUE
@@ -837,3 +837,47 @@ emp_act
/mob/living/carbon/human/canBeHandcuffed()
return has_left_hand() || has_right_hand()
/// Returns a list. The first element is whether we penetrated all clothing for the zone, the rest are the clothes that got contaminated
/mob/living/carbon/human/proc/rad_contaminate_zone(zone_flag, pocket = FALSE)
// This is for items inside of the mob
if(!zone_flag)
return list(TRUE)
var/list/garments = list()
var/list/contaminate = list()
var/passed = TRUE
// items in our pocket are treated uniquely as they are outside of the mob but also under most of its clothing
if(pocket)
garments = list(w_uniform)
else
// the suit is worn on top of all other stuff so it needs to be checked first
if(wear_suit)
garments = list(wear_suit)
for(var/obj/item/clothing/garment in contents)
if(garment.body_parts_covered & zone_flag)
garments |= garment
// If we have a suit push it to the start of the list
if(wear_suit)
garments -= wear_suit
garments = list(wear_suit) + garments
while(length(garments) && passed)
var/obj/item/clothing/garment = garments[1]
garments -= garment
passed = prob((garment.permeability_coefficient * 100) - 1) && !(garment.flags_2 & RAD_PROTECT_CONTENTS_2)
if(garment.flags_2 & RAD_NO_CONTAMINATE_2)
continue
contaminate += garment
return list(passed) + contaminate
/// Tries to contaminate a human
/mob/living/carbon/human/contaminate_atom(atom/source, intensity, emission_type, zone = null)
if(!zone)
zone = hit_zone_to_clothes_zone(ran_zone())
var/list/to_contaminate = rad_contaminate_zone(zone)
if(to_contaminate[1])
to_contaminate += src
to_contaminate -= to_contaminate[1]
for(var/atom/thing in to_contaminate)
thing.AddComponent(/datum/component/radioactive, intensity, source, emission_type)
@@ -1502,7 +1502,7 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
if(prob(current_size * 5) && hand.w_class >= ((11-current_size)/2) && drop_item_to_ground(hand))
step_towards(hand, src)
to_chat(src, "<span class='warning'>\The [S] pulls \the [hand] from your grip!</span>")
rad_act(current_size * 3)
base_rad_act(S, current_size * 3, GAMMA_RAD)
/mob/living/carbon/human/narsie_act()
if(iswizard(src) || IS_CULTIST(src)) // Wizards are immune to the magic. Cultists also don't get transformed.
@@ -2132,3 +2132,35 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
hallucination_to_make = string_path
new hallucination_to_make(get_turf(src), src)
/// Checks if an item is inside the body of the mob
/mob/living/carbon/human/is_inside_mob(atom/thing)
if(!(..()))
return FALSE
if(w_uniform && w_uniform.UID() == thing.UID())
return FALSE
if(shoes && shoes.UID() == thing.UID())
return FALSE
if(belt && belt.UID() == thing.UID())
return FALSE
if(gloves && gloves.UID() == thing.UID())
return FALSE
if(neck && neck.UID() == thing.UID())
return FALSE
if(glasses && glasses.UID() == thing.UID())
return FALSE
if(l_ear && l_ear.UID() == thing.UID())
return FALSE
if(r_ear && r_ear.UID() == thing.UID())
return FALSE
if(wear_id && wear_id.UID() == thing.UID())
return FALSE
if(wear_pda && wear_pda.UID() == thing.UID())
return FALSE
if(r_store && r_store.UID() == thing.UID())
return FALSE
if(l_store && l_store.UID() == thing.UID())
return FALSE
if(s_store && s_store.UID() == thing.UID())
return FALSE
return TRUE
@@ -342,9 +342,15 @@
prefix = "Uranium"
special_names = list("Oxide", "Rod", "Meltdown")
/datum/species/golem/uranium/handle_life(mob/living/carbon/human/H)
radiation_pulse(H, 20)
..()
/datum/species/golem/uranium/on_species_gain(mob/living/carbon/human/H)
. = ..()
var/datum/component/inherent_radioactivity/radioactivity = H.AddComponent(/datum/component/inherent_radioactivity, 40, 0, 0)
START_PROCESSING(SSradiation, radioactivity)
/datum/species/golem/uranium/on_species_loss(mob/living/carbon/human/H)
. = ..()
var/datum/component/inherent_radioactivity/rads = H.GetComponent(/datum/component/inherent_radioactivity)
rads.RemoveComponent()
//Ventcrawler
/datum/species/golem/plastic
+21 -4
View File
@@ -1040,9 +1040,13 @@
..()
update_z(new_turf?.z)
/mob/living/rad_act(amount)
. = ..()
/mob/living/rad_act(atom/source, amount, emission_type)
// Mobs block very little Beta and Gamma radiation, but we still want the rads to affect them.
if(emission_type > ALPHA_RAD)
amount /= (1 - RAD_MOB_INSULATION)
// Alpha sources outside the body don't do much
else if(!is_inside_mob(source))
amount /= 100
if(!amount || (amount < RAD_MOB_SKIN_PROTECTION) || HAS_TRAIT(src, TRAIT_RADIMMUNE))
return
@@ -1054,9 +1058,22 @@
if(amount > RAD_BURN_THRESHOLD)
apply_damage(RAD_BURN_CURVE(amount), BURN, null, blocked)
apply_effect((amount * RAD_MOB_COEFFICIENT) / max(1, (radiation ** 2) * RAD_OVERDOSE_REDUCTION), IRRADIATE, ARMOUR_VALUE_TO_PERCENTAGE(blocked))
/mob/living/proc/is_inside_mob(atom/thing)
if(!(thing in contents))
return FALSE
if(l_hand && l_hand.UID() == thing.UID())
return FALSE
if(r_hand && r_hand.UID() == thing.UID())
return FALSE
if(back && back.UID() == thing.UID())
return FALSE
if(wear_mask && wear_mask.UID() == thing.UID())
return FALSE
return TRUE
/mob/living/proc/fakefireextinguish()
return
+6 -5
View File
@@ -1417,14 +1417,15 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
*/
/mob/proc/show_rads(range)
for(var/turf/place in range(range, src))
var/rads = SSradiation.get_turf_radiation(place)
if(rads < RAD_BACKGROUND_RADIATION)
var/list/rads = SSradiation.get_turf_radiation(place)
if(!rads || (rads[1] + rads[2] + rads[3]) < RAD_BACKGROUND_RADIATION)
continue
var/strength = round(rads / 1000, 0.1)
var/alpha_strength = round(rads[1] / 1000, 0.1)
var/beta_strength = round(rads[2] / 1000, 0.1)
var/gamma_strength = round(rads[3] / 1000, 0.1)
var/image/pic = image(loc = place)
var/mutable_appearance/MA = new()
MA.maptext = MAPTEXT("[strength]k")
MA.maptext = MAPTEXT("Α [alpha_strength]k\nΒ [beta_strength]k\nΓ [gamma_strength]k")
MA.color = "#04e604"
MA.layer = RAD_TEXT_LAYER
MA.plane = GAME_PLANE
+24
View File
@@ -244,6 +244,30 @@
return zone
/// Convert the impact zone of a projectile to a clothing zone we can do a contamination check on
/proc/hit_zone_to_clothes_zone(zone)
switch(zone)
if("head")
return HEAD
if("chest")
return UPPER_TORSO
if("l_hand")
return HANDS
if("r_hand")
return HANDS
if("l_arm")
return ARMS
if("r_arm")
return ARMS
if("l_leg")
return LEGS
if("r_leg")
return LEGS
if("l_foot")
return FEET
if("r_foot")
return FEET
/proc/above_neck(zone)
var/list/zones = list("head", "mouth", "eyes")
if(zones.Find(zone))
+2
View File
@@ -9,6 +9,8 @@
throwforce = 10
var/datum/mind/mind
blocks_emissive = EMISSIVE_BLOCK_GENERIC
rad_insulation_beta = RAD_MOB_INSULATION
rad_insulation_gamma = RAD_MOB_INSULATION
/// Is this mob alive, unconscious or dead?
var/stat = CONSCIOUS // TODO: Move to /mob/living