diff --git a/code/datums/weather/weather.dm b/code/datums/weather/weather.dm index aa3a2cdbed9..02dbccfb1db 100644 --- a/code/datums/weather/weather.dm +++ b/code/datums/weather/weather.dm @@ -28,6 +28,7 @@ var/area_type = /area/space //Types of area to affect var/list/impacted_areas = list() //Areas to be affected by the weather, calculated when the weather begins + var/list/protected_areas = list()//Areas that are protected and excluded from the affected areas. var/target_z = ZLEVEL_STATION //The z-level to affect var/overlay_layer = AREA_LAYER //Since it's above everything else, this is the layer used by default. TURF_LAYER is below mobs and walls if you need to use that. @@ -50,7 +51,12 @@ if(stage == STARTUP_STAGE) return stage = STARTUP_STAGE + var/list/affectareas = list() for(var/V in get_areas(area_type)) + affectareas += V + for(var/V in protected_areas) + affectareas -= get_areas(V) + for(var/V in affectareas) var/area/A = V if(A.z == target_z) impacted_areas |= A @@ -97,7 +103,7 @@ /datum/weather/proc/end() if(stage == END_STAGE) - return + return 1 stage = END_STAGE update_areas() diff --git a/code/datums/weather/weather_types.dm b/code/datums/weather/weather_types.dm index ebecbca4003..2e438f43c4a 100644 --- a/code/datums/weather/weather_types.dm +++ b/code/datums/weather/weather_types.dm @@ -113,3 +113,50 @@ aesthetic = TRUE probability = 10 + +/datum/weather/rad_storm + name = "radiation storm" + desc = "A cloud of intense radiation passes through the area dealing rad damage to those who are unprotected." + + //telegraph_message = "An eerie moan rises on the wind. Sheets of burning ash blacken the horizon. Seek shelter." + telegraph_duration = 300 + telegraph_sound = 'sound/lavaland/ash_storm_windup.ogg' + telegraph_overlay = "light_ash" + + //weather_message = "Smoldering clouds of scorching ash billow down around you! Get inside!" + weather_duration_lower = 600 + weather_duration_upper = 1500 + weather_sound = 'sound/lavaland/ash_storm_start.ogg' + weather_overlay = "ash_storm" + + //end_message = "The shrieking wind whips away the last of the ash falls to its usual murmur. It should be safe to go outside now." + end_duration = 300 + end_sound = 'sound/lavaland/ash_storm_end.ogg' + end_overlay = "light_ash" + + area_type = /area + protected_areas = list(/area/maintenance, /area/turret_protected/ai_upload, /area/turret_protected/ai_upload_foyer, /area/turret_protected/ai) + target_z = ZLEVEL_STATION + + immunity_type = "rad" + +/datum/weather/rad_storm/impact(mob/living/L) + if(ishuman(L)) + var/mob/living/carbon/human/H = L + if(H.dna && H.dna.species) + if(!(RADIMMUNE in H.dna.species.specflags)) + if(prob(25)) + if(prob(25)) + randmuti(H) + if(prob(90)) + randmutb(H) + else + randmutg(H) + H.domutcheck() + L.rad_act(15,1) + +/datum/weather/rad_storm/end() + if(..()) + return + priority_announce("The radiation threat has passed. Please return to your workplaces. Maintenance access restrictions will be restored shortly.", "Anomaly Alert") + addtimer(GLOBAL_PROC, "revoke_maint_all_access", 300, TRUE) \ No newline at end of file diff --git a/code/game/objects/radiation.dm b/code/game/objects/radiation.dm index 53a0e1e6443..87fec24f831 100644 --- a/code/game/objects/radiation.dm +++ b/code/game/objects/radiation.dm @@ -29,9 +29,10 @@ /atom/proc/rad_act(var/severity) return 1 -/mob/living/rad_act(amount) +/mob/living/rad_act(amount, silent = 0) if(amount) - var/blocked = run_armor_check(null, "rad", "Your clothes feel warm.", "Your clothes feel warm.") + var/message = silent ? null : "Your clothes feel warm." + var/blocked = run_armor_check(null, "rad", message, message) apply_effect(amount, IRRADIATE, blocked) for(var/obj/I in src) //Radiation is also applied to items held by the mob I.rad_act(amount) diff --git a/code/modules/events/radiation_storm.dm b/code/modules/events/radiation_storm.dm index be99cd87469..4c2e954a47c 100644 --- a/code/modules/events/radiation_storm.dm +++ b/code/modules/events/radiation_storm.dm @@ -4,56 +4,17 @@ max_occurrences = 1 /datum/round_event/radiation_storm - var/list/protected_areas = list(/area/maintenance, /area/turret_protected/ai_upload, /area/turret_protected/ai_upload_foyer, /area/turret_protected/ai) /datum/round_event/radiation_storm/setup() - startWhen = rand(10, 20) - endWhen = startWhen + 5 + startWhen = 3 + endWhen = startWhen + 1 announceWhen = 1 /datum/round_event/radiation_storm/announce() - priority_announce("High levels of radiation detected near the station. Maintenance is best shielded from radiation.", "Anomaly Alert", 'sound/AI/radiation.ogg') + priority_announce("High levels of radiation detected near the station. Maintenance is best shielded from radiation. Maintenance access restrictions will be temporarily lifted.", "Anomaly Alert", 'sound/AI/radiation.ogg') + make_maint_all_access() //sound not longer matches the text, but an audible warning is probably good - /datum/round_event/radiation_storm/start() - for(var/mob/living/carbon/C in living_mob_list) - var/turf/T = get_turf(C) - if(!T) - continue - if(T.z != 1) - continue - - var/skip = 0 - for(var/a in protected_areas) - if(istype(T.loc, a)) - skip = 1 - continue - - if(skip) - continue - - if(locate(/obj/machinery/power/apc) in T) //damn you maint APCs!! - continue - - if(istype(C, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = C - if(prob(5)) - H.rad_act(rand(100, 160)) - else - H.rad_act(rand(15, 75)) - if(prob(25)) - if(prob(75)) - randmutb(H) - else - randmutg(H) - H.domutcheck() - - else if(istype(C, /mob/living/carbon/monkey)) - var/mob/living/carbon/monkey/M = C - M.rad_act(rand(15, 75)) - - -/datum/round_event/radiation_storm/end() - priority_announce("The radiation threat has passed. Please return to your workplaces.", "Anomaly Alert") \ No newline at end of file + SSweather.run_weather("radiation storm",1) \ No newline at end of file