mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-21 20:11:04 +01:00
Adds: - Dosimeter, keeps track of how many rads a person has absorbed as well as showing the dose after armour. - Adds a message to shelter in maint to the supermatter explosion. - Adds a flag that makes damage not apply to robotic limbs, useful for preventing radiation burns to metal parts. Should also be added to chemicals that deal brute damage, such as arithrazine and the the burns from chemical exposure to chlorine, but that's another PR. - Added radiation resistance values to makeshift armour. As it only covers the chest, this isn't very useful, but better than nothing. Balance: - Re-scaled radiation damage. - Radiation now maxes out at 1000, from the previous 100. - Radiation damage when at maximum rads is converted directly into burn damage. - Radiation sources decay slowly, so all the old numbers were maxing people's radiation values instantaneously. - Re-scaled organ damage from radiation. Previously you would take no organ damage till 75% rads, then lose your liver almost immediately. Now organ damage ramps up from 500-1000, with 750-1000 being about 1/3rd the organ damage of 75-100. - Added debilitating, but not lethal, effects to moderate and high radiation levels. Lots of pain events instead of straight damage. - Reduced speed and stamina for high radiation doses. - Hyronalin and Arithrazine both remove much more radiation. The intent: People should now be able to work in low radiation zones, without using the radiation suit for short periods of time. The geiger counter is no longer an 'if this is ticking you are at max rads' detector. With the engineering voidsuit, 75% rads, I could stand next to a charged supermatter ~50rads a second, for about 2 minutes before I hit lethal radiation levels. If people stay in a radiation zone, or are exposed to extreme radiation 100+ rads a second, radiation is much more lethal, but not by just killing your organs. Conventional medicine will help a lot. --------- Signed-off-by: FenodyreeAv <fenodyree.av@gmail.com> Co-authored-by: Batrachophreno <Batrochophreno@gmail.com>
101 lines
3.6 KiB
Plaintext
101 lines
3.6 KiB
Plaintext
// Describes a point source of radiation. Created either in response to a pulse of radiation, or over an irradiated atom.
|
|
// Sources will decay over time, unless something is renewing their power!
|
|
/datum/radiation_source
|
|
/// Location of the radiation source.
|
|
var/turf/source_turf
|
|
/// Strength of the radiation being emitted.
|
|
var/rad_power
|
|
/// True for automatic decay. False if owner promises to handle it (i.e. Supermatter, INDRA, etc.)
|
|
var/decay = TRUE
|
|
///Added to the base decay rate of a source, for sudden spikes of radiation that don't persist as long
|
|
var/accelerated_decay_rate
|
|
/// True for not affecting AREA_FLAG_RAD_SHIELDED areas.
|
|
var/respect_rad_shielding = FALSE
|
|
/// True for power falloff with distance.
|
|
var/flat = FALSE
|
|
/// Cached maximum range, used for quick checks against mobs.
|
|
var/range
|
|
|
|
/datum/radiation_source/New(source_turf, rad_power, decay = TRUE)
|
|
src.source_turf = source_turf
|
|
src.rad_power = rad_power
|
|
src.decay = decay
|
|
|
|
/datum/radiation_source/Destroy()
|
|
SSradiation.sources -= src
|
|
if(SSradiation.sources_assoc[src.source_turf] == src)
|
|
SSradiation.sources_assoc -= src.source_turf
|
|
src.source_turf = null
|
|
. = ..()
|
|
|
|
/**
|
|
* Initialization handling decaying sources. Decrease by RADIATION_DECAY_RATE per SSradiation.fire() in latter cases.
|
|
*/
|
|
/datum/radiation_source/proc/update_rad_power(new_power = null)
|
|
if(new_power == null || new_power == rad_power)
|
|
return // No change
|
|
else if(new_power <= RADIATION_LOWER_LIMIT)
|
|
qdel(src) // Decayed to nothing
|
|
else
|
|
rad_power = new_power
|
|
if(!flat)
|
|
// R = rad_power / dist**2 - Solve for dist
|
|
range = min(round(sqrt(rad_power / RADIATION_LOWER_LIMIT)), 31)
|
|
|
|
/turf/var/cached_rad_resistance = 0
|
|
|
|
/turf/proc/calc_rad_resistance()
|
|
cached_rad_resistance = 0
|
|
for(var/obj/O in src.contents)
|
|
if(!(O.rad_resistance_modifier <= 0) && O.density)
|
|
var/material/M = O.get_material()
|
|
if(!M) continue
|
|
cached_rad_resistance += (M.weight * O.rad_resistance_modifier) / RADIATION_MATERIAL_RESISTANCE_DIVISOR
|
|
// Looks like storing the contents length is meant to be a basic check if the cache is stale due to items enter/exiting. Better than nothing so I'm leaving it as is. ~Leshana
|
|
SSradiation.resistance_cache[src] = (length(contents) + 1)
|
|
|
|
/turf/simulated/wall/calc_rad_resistance()
|
|
SSradiation.resistance_cache[src] = (length(contents) + 1)
|
|
cached_rad_resistance = (density ? material.weight / RADIATION_MATERIAL_RESISTANCE_DIVISOR : 0)
|
|
|
|
/obj
|
|
/// Allow overriding rad resistance.
|
|
var/rad_resistance_modifier = 1
|
|
|
|
/**
|
|
* Retrieves the atom's current radiation level. By default, this will return `loc.get_rads()`.
|
|
*
|
|
* Returns integer.
|
|
*/
|
|
/atom/proc/get_rads()
|
|
if(loc)
|
|
return loc.get_rads()
|
|
return 0
|
|
|
|
/turf/get_rads()
|
|
return SSradiation.get_rads_at_turf(src)
|
|
|
|
/**
|
|
* Called when radiation affects the atom.
|
|
*
|
|
* * severity - The amount of radiation being applied. Also see RAD_LEVEL_*.
|
|
*
|
|
* Returns boolean
|
|
*/
|
|
/atom/proc/rad_act(severity)
|
|
return 1
|
|
|
|
/**
|
|
* Called when radiation affects a /mob/living.
|
|
*
|
|
* * severity - The amount of radiation being applied. Anything over RAD_LEVEL_VERY_LOW will deal [severity] dispersed damage and run rad_act to everything in it.
|
|
*
|
|
* Returns boolean
|
|
*/
|
|
/mob/living/rad_act(severity)
|
|
if(severity > RAD_LEVEL_VERY_LOW)
|
|
var/normal_armour_piercing = severity - (severity / 11) //As damage is split across all 11 limbs, this is subtracted from the armour value to replicate one big hit.
|
|
apply_damage(severity, DAMAGE_RADIATION, damage_flags = DAMAGE_FLAG_DISPERSED | DAMAGE_FLAG_IGNORE_PROSTHETICS, armor_pen = normal_armour_piercing) //Metal body parts do not contribute to radiation dose.
|
|
for(var/atom/I in src)
|
|
I.rad_act(severity)
|