Progress on DMDocs. PRing progress so far so there's not one mega PR
later with 1500 affected files.

I want my goddamn highlight text on what all these goddamn procs goddamn
do goddamnit. >:(

No actual code change anywhere in this PR, only comments.

---------

Signed-off-by: Batrachophreno <Batrochophreno@gmail.com>
This commit is contained in:
Batrachophreno
2025-08-09 12:22:56 +00:00
committed by GitHub
parent a840bd1cb1
commit c2f054fd81
88 changed files with 1574 additions and 879 deletions
+27 -10
View File
@@ -1,12 +1,18 @@
// 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
var/turf/source_turf // Location of the radiation source.
var/rad_power // Strength of the radiation being emitted.
var/decay = TRUE // True for automatic decay. False if owner promises to handle it (i.e. supermatter)
var/respect_maint = FALSE // True for not affecting AREA_FLAG_RAD_SHIELDED areas.
var/flat = FALSE // True for power falloff with distance.
var/range // Cached maximum range, used for quick checks against mobs.
/// 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
/// 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
@@ -20,6 +26,9 @@
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
@@ -28,7 +37,8 @@
else
rad_power = new_power
if(!flat)
range = min(round(sqrt(rad_power / RADIATION_LOWER_LIMIT)), 31) // R = rad_power / dist**2 - Solve for dist
// R = rad_power / dist**2 - Solve for dist
range = min(round(sqrt(rad_power / RADIATION_LOWER_LIMIT)), 31)
/turf/var/cached_rad_resistance = 0
@@ -47,7 +57,8 @@
cached_rad_resistance = (density ? material.weight / RADIATION_MATERIAL_RESISTANCE_DIVISOR : 0)
/obj
var/rad_resistance_modifier = 1 // Allow overriding rad resistance
/// Allow overriding rad resistance.
var/rad_resistance_modifier = 1
/**
* Retrieves the atom's current radiation level. By default, this will return `loc.get_rads()`.
@@ -65,14 +76,20 @@
/**
* Called when radiation affects the atom.
*
* **Parameters**:
* - `severity` - The amount of radiation being applied. Also see `RAD_LEVEL_*`.
* * 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_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_LOW)
apply_damage(severity, DAMAGE_RADIATION, damage_flags = DAMAGE_FLAG_DISPERSED)