From 8a2e89039148d31a71fc72ca24400f6c5e7b9d8b Mon Sep 17 00:00:00 2001 From: skull132 Date: Sun, 21 Feb 2016 20:47:21 +0200 Subject: [PATCH] Resolves #152 While not exactly a bug, I think it would be logical that blastdoors and such block some level of radiation. As such, if you aren't in full view of the SM, the effective range of the radiation is taken down by 1/3rd. This will make the monitoring room safer. --- code/modules/supermatter/supermatter.dm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm index 1ee9f99c451..ba6c0fe1233 100644 --- a/code/modules/supermatter/supermatter.dm +++ b/code/modules/supermatter/supermatter.dm @@ -126,7 +126,7 @@ integrity = round(100 - integrity * 100) integrity = integrity < 0 ? 0 : integrity var/alert_msg = " Integrity at [integrity]%" - + if(damage > emergency_point) alert_msg = emergency_alert + alert_msg lastwarning = world.timeofday - WARNING_DELAY * 4 @@ -149,7 +149,7 @@ else if(safe_warned && public_alert) radio.autosay(alert_msg, "Supermatter Monitor") public_alert = 0 - + /obj/machinery/power/supermatter/process() @@ -243,9 +243,13 @@ //adjusted range so that a power of 170 (pretty high) results in 9 tiles, roughly the distance from the core to the engine monitoring room. //note that the rads given at the maximum range is a constant 0.2 - as power increases the maximum range merely increases. - for(var/mob/living/l in range(src, round(sqrt(power / 2)))) + //adjusted to pseudo take into account obstacles in the way (1/3rd of the range is dropped if no direct visibility between core and target is) + var/rad_range = round(sqrt(power / 2)) + for(var/mob/living/l in range(src, rad_range)) var/radius = max(get_dist(l, src), 1) var/rads = (power / 10) * ( 1 / (radius**2) ) + if (!(l in oview(rad_range, src)) && !(l in range(src, round(rad_range * 2/3)))) + continue l.apply_effect(rads, IRRADIATE) power -= (power/DECAY_FACTOR)**3 //energy losses due to radiation