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
<details>
<summary>Screenshots/Videos</summary>
  

![image](https://github.com/user-attachments/assets/e747f78d-020d-40fa-a39e-671d0abeeccb)

</details>

## Changelog

🆑 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
/🆑
This commit is contained in:
LT3
2024-10-06 22:44:52 +00:00
committed by GitHub
parent be24b7039f
commit 21668da48b
4 changed files with 49 additions and 0 deletions
+1
View File
@@ -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)
@@ -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))
@@ -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()
+2
View File
@@ -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"