[MIRROR] SM, Tesla, and general engineering adjustments [MDB IGNORE] [IDB IGNORE] (#12603)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-03-26 23:08:54 -04:00
committed by GitHub
co-authored by Cameron Lennox
parent 743a16c74d
commit a62b9ed8fe
83 changed files with 992 additions and 309 deletions
+12 -5
View File
@@ -52,15 +52,16 @@
register_to_loc(source.loc)
/datum/component/geiger_sound/proc/register_to_loc(new_loc)
if (last_parent == new_loc)
if(last_parent == new_loc)
return
if (!isnull(last_parent))
if(!isnull(last_parent))
sound.stop(last_parent)
UnregisterSignal(last_parent, COMSIG_IN_RANGE_OF_IRRADIATION)
last_parent = new_loc
if (!isnull(new_loc))
if(!isnull(new_loc))
RegisterSignal(new_loc, COMSIG_IN_RANGE_OF_IRRADIATION, PROC_REF(on_pre_potential_irradiation))
/datum/looping_sound/geiger
@@ -80,11 +81,17 @@
last_radiation_pulse = null
return ..()
/datum/looping_sound/geiger/get_sound()
/datum/looping_sound/geiger/get_sound(starttime, _mid_sounds)
if (isnull(last_radiation_pulse))
return null
var/danger = get_perceived_radiation_danger(last_radiation_pulse, last_insulation_to_target)
if(danger >= PERCEIVED_RADIATION_DANGER_HIGH)
chance = 100
else
chance = danger * 15
volume = (danger * 5)
return ..(mid_sounds[get_perceived_radiation_danger(last_radiation_pulse, last_insulation_to_target)])
return ..(starttime, mid_sounds[danger])
/datum/looping_sound/geiger/stop(null_parent = FALSE)
. = ..()
@@ -171,9 +171,9 @@
/datum/component/radiation_effects/proc/process_component()
SIGNAL_HANDLER
var/mob/living/living_guy = parent
if((living_guy.radiation > RADIATION_CAP || living_guy.radiation < 0) || (living_guy.accumulated_rads > RADIATION_CAP || living_guy.accumulated_rads < 0))
living_guy.radiation = CLAMP(living_guy.radiation,0,RADIATION_CAP)
living_guy.accumulated_rads = CLAMP(living_guy.accumulated_rads,0,RADIATION_CAP)
if(living_guy.radiation > RADIATION_CAP || living_guy.radiation < 0 || living_guy.accumulated_rads > RADIATION_CAP || living_guy.accumulated_rads < 0)
living_guy.radiation = CLAMP(living_guy.radiation, 0, RADIATION_CAP)
living_guy.accumulated_rads = CLAMP(living_guy.accumulated_rads, 0, RADIATION_CAP)
if(QDELETED(parent))
return
@@ -231,6 +231,8 @@
living_guy.radiation -= rads_to_utilize
living_guy.accumulated_rads -= rads_to_utilize
living_guy.radiation = CLAMP(living_guy.radiation, 0, RADIATION_CAP)
living_guy.accumulated_rads = CLAMP(living_guy.accumulated_rads, 0, RADIATION_CAP)
return COMPONENT_BLOCK_LIVING_RADIATION
if(custom_damage)
@@ -243,6 +245,8 @@
living_guy.apply_damage(rads_to_utilize * damage_multiplier, damage_type)
living_guy.radiation = CLAMP(living_guy.radiation, 0, RADIATION_CAP)
living_guy.accumulated_rads = CLAMP(living_guy.accumulated_rads, 0, RADIATION_CAP)
return COMPONENT_BLOCK_LIVING_RADIATION
/datum/component/radiation_effects/proc/handle_irradiate_effect(var/mob/living/living_guy, var/effect, var/effecttype, var/blocked, var/check_protection, var/rad_protection)
@@ -266,6 +270,7 @@
//If we linger in one place for a prolonged period, the area around us will become irradiated and give us a small bit of radiation back. (only got ~1 rad per tick when we were offputting 60 rads for example)
//However, we'll lose our rads faster than we accumulate.
living_guy.radiation += max((radiation_to_apply * rad_protection), 0)
living_guy.radiation = CLAMP(living_guy.radiation, 0, RADIATION_CAP)
return COMPONENT_BLOCK_IRRADIATION
///TGUI below here