From 21668da48bc4cc653d88fa2d8ba64c281cf70e02 Mon Sep 17 00:00:00 2001 From: LT3 <83487515+lessthnthree@users.noreply.github.com> Date: Sun, 6 Oct 2024 15:44:52 -0700 Subject: [PATCH] Adds radiation storms and scrubber overflows to event Enhanced Roleplay Check (#2180) ## About The Pull Request Same as https://github.com/Skyrat-SS13/Skyrat-tg/pull/29682, but on a repo that is active. Adds the Enhanced Roleplay Check protection to the radiation storm and scrubber overflow events. In the case of radiation storms, the protection is only triggered if the dorm is occupied at the time of event init. (No cop-out running into a dorm after you hear the announcement! Find a real maintenance hallway, scrub.) Additionally, only plays the giant red warning text only if you are in an area that will be impacted by the radiation, so that people aren't second guessing if the area they are in is protected or not. ## Why It's Good For The Game Getting mutated and/or dying while in the middle of enhanced roleplay tends to interrupt the intended roleplay ## Proof Of Testing
Screenshots/Videos ![image](https://github.com/user-attachments/assets/e747f78d-020d-40fa-a39e-671d0abeeccb)
## Changelog :cl: LT3 code: Radiation storm warning only sent to players who are in an area without radiation protection balance: Occupied dorms are protected from radiation storms and scrubbers /:cl: --- code/datums/weather/weather.dm | 1 + .../code/modules/events/ev_roleplay_check.dm | 28 +++++++++++++++++++ .../code/modules/events/scrubber_overflow.dm | 18 ++++++++++++ tgstation.dme | 2 ++ 4 files changed, 49 insertions(+) create mode 100644 modular_zubbers/code/modules/events/ev_roleplay_check.dm create mode 100644 modular_zubbers/code/modules/events/scrubber_overflow.dm diff --git a/code/datums/weather/weather.dm b/code/datums/weather/weather.dm index 16ffb326f8a..1da16133d3c 100644 --- a/code/datums/weather/weather.dm +++ b/code/datums/weather/weather.dm @@ -106,6 +106,7 @@ affectareas += V for(var/V in protected_areas) affectareas -= get_areas(V) + affectareas = enhanced_roleplay_filter(affectareas) // BUBBER EDIT ADDITION - enhanced roleplay check - modular_zubbers/code/modules/events/ev_roleplay_check.dm for(var/V in affectareas) var/area/A = V if(protect_indoors && !A.outdoors) diff --git a/modular_zubbers/code/modules/events/ev_roleplay_check.dm b/modular_zubbers/code/modules/events/ev_roleplay_check.dm new file mode 100644 index 00000000000..f7ef1389d5f --- /dev/null +++ b/modular_zubbers/code/modules/events/ev_roleplay_check.dm @@ -0,0 +1,28 @@ +/// list of dorms areas for doing event checks +GLOBAL_LIST_EMPTY(dorms_areas) + +/area/station/commons/dorms/New() + . = ..() + GLOB.dorms_areas += src + +/datum/weather/proc/enhanced_roleplay_filter(list/affectareas) + return affectareas + +/datum/weather/rad_storm/enhanced_roleplay_filter(list/affectareas) + var/list/filtered_areas = affectareas + for(var/area/engaged_roleplay_area as anything in GLOB.dorms_areas) + for(var/mob/living/carbon/human/roleplayer in engaged_roleplay_area.contents) + if(engaged_role_play_check(player = roleplayer, station = FALSE, dorms = TRUE)) + LAZYREMOVE(filtered_areas, engaged_roleplay_area) + break + return filtered_areas + +/datum/weather/rad_storm/send_alert(alert_msg, alert_sfx) + for(var/area/impacted_area as anything in impacted_areas) + for(var/mob/living/player in impacted_area.contents) + if(!can_get_alert(player)) + continue + if(alert_msg) + to_chat(player, alert_msg) + if(alert_sfx) + SEND_SOUND(player, sound(alert_sfx)) diff --git a/modular_zubbers/code/modules/events/scrubber_overflow.dm b/modular_zubbers/code/modules/events/scrubber_overflow.dm new file mode 100644 index 00000000000..35fc9459ec4 --- /dev/null +++ b/modular_zubbers/code/modules/events/scrubber_overflow.dm @@ -0,0 +1,18 @@ +/datum/round_event/scrubber_overflow/setup() + for(var/obj/machinery/atmospherics/components/unary/vent_scrubber/temp_vent as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/atmospherics/components/unary/vent_scrubber)) + var/turf/scrubber_turf = get_turf(temp_vent) + var/area/scrubber_area = get_area(temp_vent) + if(!scrubber_turf) + continue + if(!is_station_level(scrubber_turf.z)) + continue + if(temp_vent.welded) + continue + if(is_type_in_list(scrubber_area, list(/area/station/engineering/supermatter/room, /area/station/engineering/supermatter, /area/station/commons/dorms, /area/station/security/prison/safe, /area/station/security/prison/toilet))) + continue + if(!prob(overflow_probability)) + continue + scrubbers += temp_vent + + if(!scrubbers.len) + return kill() diff --git a/tgstation.dme b/tgstation.dme index 92582d66b01..73c40ffb932 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -8942,6 +8942,8 @@ #include "modular_zubbers\code\modules\emotes\scream_datums.dm" #include "modular_zubbers\code\modules\emotes\species_screams.dm" #include "modular_zubbers\code\modules\emotes\synth_emotes.dm" +#include "modular_zubbers\code\modules\events\ev_roleplay_check.dm" +#include "modular_zubbers\code\modules\events\scrubber_overflow.dm" #include "modular_zubbers\code\modules\events\ghost_role\blob.dm" #include "modular_zubbers\code\modules\experisci\handheld_scanner.dm" #include "modular_zubbers\code\modules\experisci\experiment\handlers\experiment_handler.dm"