From 41e5e31d7add70f516997f65b6364987b5f60f6f Mon Sep 17 00:00:00 2001 From: Mikhail Dzianishchyts Date: Sat, 24 Aug 2024 16:59:43 +0300 Subject: [PATCH 01/11] Define code levels --- code/__DEFINES/misc_defines.dm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/code/__DEFINES/misc_defines.dm b/code/__DEFINES/misc_defines.dm index 491520bba20d..3397cd677170 100644 --- a/code/__DEFINES/misc_defines.dm +++ b/code/__DEFINES/misc_defines.dm @@ -2,12 +2,14 @@ #define CANDLE_LUM 3 //For how bright candles are //Security levels -#define SEC_LEVEL_GREEN 0 -#define SEC_LEVEL_BLUE 1 -#define SEC_LEVEL_RED 2 -#define SEC_LEVEL_GAMMA 3 -#define SEC_LEVEL_EPSILON 4 -#define SEC_LEVEL_DELTA 5 +#define SEC_LEVEL_GREEN 0 +#define SEC_LEVEL_BLUE 1 +#define SEC_LEVEL_VIOLET 2 +#define SEC_LEVEL_ORANGE 3 +#define SEC_LEVEL_RED 4 +#define SEC_LEVEL_GAMMA 5 +#define SEC_LEVEL_EPSILON 6 +#define SEC_LEVEL_DELTA 7 //Click cooldowns, in tenths of a second #define CLICK_CD_MELEE 8 From 58a588ceb906e6893fcd1305a57307b62e0dc8a5 Mon Sep 17 00:00:00 2001 From: Mikhail Dzianishchyts Date: Sat, 24 Aug 2024 21:00:55 +0300 Subject: [PATCH 02/11] Add security level datums --- .../aesthetics/firealarm/icons/firealarm.dmi | Bin 9028 -> 9534 bytes modular_ss220/modular_ss220.dme | 1 + .../security_levels/_security_levels.dm | 4 +++ .../security_levels/_security_levels.dme | 4 +++ .../security_levels/code/SSsecurity_level.dm | 13 ++++++++ .../code/security_level_datums.dm | 31 ++++++++++++++++++ 6 files changed, 53 insertions(+) create mode 100644 modular_ss220/security_levels/_security_levels.dm create mode 100644 modular_ss220/security_levels/_security_levels.dme create mode 100644 modular_ss220/security_levels/code/SSsecurity_level.dm create mode 100644 modular_ss220/security_levels/code/security_level_datums.dm diff --git a/modular_ss220/aesthetics/firealarm/icons/firealarm.dmi b/modular_ss220/aesthetics/firealarm/icons/firealarm.dmi index ae288310c2513232c8fa0b6dd6785a5ab67b9463..bd06202e2aeec85d176269e940491279128b4fbe 100644 GIT binary patch literal 9534 zcmcI~2{@GP-}a5l(qk)8_ANr8vL*(NHD#xSp=4jO??y$GJx?Kq$}(h^AxlQ~$i8JA z%FdX=3}(#Cd+T}L=l_3>?|uK@`@Qe`IgXq0JMR0suKRbNzw%=c6N%cs9FW$uAM(M zxG>b1w1#t4nZkd**I45Gxwm;^latVS3|uxEINz!9r1jOTBmf8kdQc6spe*bR%$>vX z)$UK^Lul054qg70nnrebN6<#ffwXLFfp0~|1!fOV;z8p$Y-R9s zO85<~W?!d>-eYXSYdP*CkcmfS=w;y5RkHW+vf|ZMykf}Z=@%@uG;&(x)C8jVodNtV zuez{sdD)ut-d;+mBKe^HRyEwm0Tx^*MICsE^||k(P_Y^d&c0RfruRB0COusyIz&{L zoOxZJ9Qtmz+yZVweU>*ueY!^8EryWK!(lWI2cwJqTF?a;skUazEi5B^+hm5^+s|s{ zva2D5W+!MD&NQVuk{gCI>Pf!&Z(jtU($E1U?WEX)ovp0c*n<*u1E*$<5gb8C5Qi@G z_KbsL?Njh5wyk&hz)-;M&jw-PtpP8As>w1&$elN}zZc>=U(Qn0*xC0tw&F(vdi(mv zZhA==uP0qFE`%q2_r4>v;d!|apX33!;M{NQsrs(7qB<%2gAmkEO+#-(5(dTJGP$I$ zHOgF8i#A-+Z=XD8)HbU-FyrV2&%q-qYU)gkEzH&-$bkqjP;%~+TdsOax2~*vUkcL2 z*DZb>V*?#1+!n!GhtOqB}a|HZ?5U6 zDrgRzIas2E=M&3I#?TGX#9BF8{mJSic2vdanxSi3wi6Q0ZA8gy3rzOF8p5wNP^?TNe|;1wBqF!=8?JLg1fx=#=1z7Qj zu1Tyog0MC230bW^d^&nuJ6pR~XeNC0z?Y_2>(wI{vUw;zZS|yKj*2h@9606&CY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pz6xoi1Q{%1h+fp`$uzm0iqYEadN46D(bOzNuXzzET%eHBh*EWm zUIiyw8BtU_ax+?EQ)}O|?95g?nfvUjH)Sr9FYCG3%rc3pzWf}R( z-R2V$G61_oow5dM)stkmH4-F6Iq_VqY+@;IowTd?AWBI%Uj8K{a2F|6@-nacvgKb$ z8d*xE_&%RJEv&WgO^}SA632}5|E-!42c8BI0F{k(8suMk35;(u1n zxe+`I==e1>tHM?Ye;@9{Re$uz#0cT1=d1P?CnLJ5)BT+etx8Zkg#yi zx3@{SfM_OpytP(N2&J@R$hbUac}0*rd&!_?o$x-r|)?s~84Vu7m<7H8MEb3%G!U*}V3DGpQLt04MMJMD(r;kAm+> O0CN*d Date: Sun, 25 Aug 2024 23:09:25 +0300 Subject: [PATCH 03/11] Add unit test for security levels --- code/__DEFINES/_ss220.dm | 9 +++++++++ code/__DEFINES/misc_defines.dm | 10 ++++------ modular_ss220/modular_ss220.dme | 5 +++++ modular_ss220/unit_tests/_unit_tests.dm | 4 ++++ modular_ss220/unit_tests/_unit_tests.dme | 3 +++ .../unit_tests/code/security_levels.dm | 19 +++++++++++++++++++ 6 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 modular_ss220/unit_tests/_unit_tests.dm create mode 100644 modular_ss220/unit_tests/_unit_tests.dme create mode 100644 modular_ss220/unit_tests/code/security_levels.dm diff --git a/code/__DEFINES/_ss220.dm b/code/__DEFINES/_ss220.dm index 0cf3257d7da9..157be2bea08b 100644 --- a/code/__DEFINES/_ss220.dm +++ b/code/__DEFINES/_ss220.dm @@ -1,5 +1,14 @@ #define MODPACK_CHAT_BADGES +#define SEC_LEVEL_GREEN 0 +#define SEC_LEVEL_BLUE 1 +#define SEC_LEVEL_VIOLET 2 +#define SEC_LEVEL_ORANGE 3 +#define SEC_LEVEL_RED 4 +#define SEC_LEVEL_GAMMA 5 +#define SEC_LEVEL_EPSILON 6 +#define SEC_LEVEL_DELTA 7 + // TODO: someday preferences will use TGUI and you will probably be able to move it to modular_ss220\_defines220\code\preferences_defines.dm /// Interacts with the toggles220 bitflag #define PREFTOGGLE_TOGGLE220 220 diff --git a/code/__DEFINES/misc_defines.dm b/code/__DEFINES/misc_defines.dm index 3397cd677170..2f95a33c6e64 100644 --- a/code/__DEFINES/misc_defines.dm +++ b/code/__DEFINES/misc_defines.dm @@ -4,12 +4,10 @@ //Security levels #define SEC_LEVEL_GREEN 0 #define SEC_LEVEL_BLUE 1 -#define SEC_LEVEL_VIOLET 2 -#define SEC_LEVEL_ORANGE 3 -#define SEC_LEVEL_RED 4 -#define SEC_LEVEL_GAMMA 5 -#define SEC_LEVEL_EPSILON 6 -#define SEC_LEVEL_DELTA 7 +#define SEC_LEVEL_RED 2 +#define SEC_LEVEL_GAMMA 3 +#define SEC_LEVEL_EPSILON 4 +#define SEC_LEVEL_DELTA 5 //Click cooldowns, in tenths of a second #define CLICK_CD_MELEE 8 diff --git a/modular_ss220/modular_ss220.dme b/modular_ss220/modular_ss220.dme index fbb18418eb6d..b706d43c3dfe 100644 --- a/modular_ss220/modular_ss220.dme +++ b/modular_ss220/modular_ss220.dme @@ -108,3 +108,8 @@ ---------------------------------------------------------------------*/ // #include "crit_rework/_crit_rework.dme" + +// --- TESTING --- // +#ifdef UNIT_TESTS +#include "unit_tests/_unit_tests.dme" +#endif diff --git a/modular_ss220/unit_tests/_unit_tests.dm b/modular_ss220/unit_tests/_unit_tests.dm new file mode 100644 index 000000000000..8f2f60e3a195 --- /dev/null +++ b/modular_ss220/unit_tests/_unit_tests.dm @@ -0,0 +1,4 @@ +/datum/modpack/unit_tests + name = "Тестирование" + desc = "Здесь тестируется все, что стоит протестировать" + author = "Maxiemar" diff --git a/modular_ss220/unit_tests/_unit_tests.dme b/modular_ss220/unit_tests/_unit_tests.dme new file mode 100644 index 000000000000..914dcab04345 --- /dev/null +++ b/modular_ss220/unit_tests/_unit_tests.dme @@ -0,0 +1,3 @@ +#include "_unit_tests.dm" + +#include "code/security_levels.dm" diff --git a/modular_ss220/unit_tests/code/security_levels.dm b/modular_ss220/unit_tests/code/security_levels.dm new file mode 100644 index 000000000000..fe23d671bcc2 --- /dev/null +++ b/modular_ss220/unit_tests/code/security_levels.dm @@ -0,0 +1,19 @@ +/datum/unit_test/security_levels + +/datum/unit_test/security_levels/Run() + security_levels_order() + +/datum/unit_test/security_levels/proc/security_levels_order() + var/list/expected = list( + new /datum/security_level/green, + new /datum/security_level/blue, + new /datum/security_level/violet, + new /datum/security_level/orange, + new /datum/security_level/red, + new /datum/security_level/gamma, + new /datum/security_level/epsilon, + new /datum/security_level/delta + ) + var/list/actual = SSsecurity_level.available_levels + if(!compare_list(expected, actual)) + Fail("Security levels order is invalid.\nExpected: [expected]\nActual: [actual]") From 472bbbadaf6fe654065c2f0093c6f182d862830e Mon Sep 17 00:00:00 2001 From: Mikhail Dzianishchyts Date: Sun, 25 Aug 2024 23:10:59 +0300 Subject: [PATCH 04/11] Revert "Define code levels" This reverts commit 41e5e31d7add70f516997f65b6364987b5f60f6f. --- code/__DEFINES/misc_defines.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/__DEFINES/misc_defines.dm b/code/__DEFINES/misc_defines.dm index 2f95a33c6e64..491520bba20d 100644 --- a/code/__DEFINES/misc_defines.dm +++ b/code/__DEFINES/misc_defines.dm @@ -2,12 +2,12 @@ #define CANDLE_LUM 3 //For how bright candles are //Security levels -#define SEC_LEVEL_GREEN 0 -#define SEC_LEVEL_BLUE 1 -#define SEC_LEVEL_RED 2 -#define SEC_LEVEL_GAMMA 3 +#define SEC_LEVEL_GREEN 0 +#define SEC_LEVEL_BLUE 1 +#define SEC_LEVEL_RED 2 +#define SEC_LEVEL_GAMMA 3 #define SEC_LEVEL_EPSILON 4 -#define SEC_LEVEL_DELTA 5 +#define SEC_LEVEL_DELTA 5 //Click cooldowns, in tenths of a second #define CLICK_CD_MELEE 8 From 438115204cadd29c25b6311da675a13d2b33c444 Mon Sep 17 00:00:00 2001 From: Mikhail Dzianishchyts Date: Sun, 25 Aug 2024 23:15:23 +0300 Subject: [PATCH 05/11] Fix linter --- code/__DEFINES/_ss220.dm | 25 +++++++++++++++++++++++++ paradise.dme | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/code/__DEFINES/_ss220.dm b/code/__DEFINES/_ss220.dm index 157be2bea08b..91b0dea342cc 100644 --- a/code/__DEFINES/_ss220.dm +++ b/code/__DEFINES/_ss220.dm @@ -1,5 +1,30 @@ #define MODPACK_CHAT_BADGES +#ifdef SEC_LEVEL_GREEN +#undef SEC_LEVEL_GREEN +#endif +#ifdef SEC_LEVEL_BLUE +#undef SEC_LEVEL_BLUE +#endif +#ifdef SEC_LEVEL_VIOLET +#undef SEC_LEVEL_VIOLET +#endif +#ifdef SEC_LEVEL_ORANGE +#undef SEC_LEVEL_ORANGE +#endif +#ifdef SEC_LEVEL_RED +#undef SEC_LEVEL_RED +#endif +#ifdef SEC_LEVEL_GAMMA +#undef SEC_LEVEL_GAMMA +#endif +#ifdef SEC_LEVEL_EPSILON +#undef SEC_LEVEL_EPSILON +#endif +#ifdef SEC_LEVEL_DELTA +#undef SEC_LEVEL_DELTA +#endif + #define SEC_LEVEL_GREEN 0 #define SEC_LEVEL_BLUE 1 #define SEC_LEVEL_VIOLET 2 diff --git a/paradise.dme b/paradise.dme index 1bc9cc1362c5..d2794186698f 100644 --- a/paradise.dme +++ b/paradise.dme @@ -24,7 +24,6 @@ #include "code\__DEFINES\_protection.dm" #include "code\__DEFINES\_readme.dm" #include "code\__DEFINES\_spacemandmm.dm" -#include "code\__DEFINES\_ss220.dm" #include "code\__DEFINES\_tgs_defines.dm" #include "code\__DEFINES\_tick.dm" #include "code\__DEFINES\_versions.dm" @@ -147,6 +146,7 @@ #include "code\__DEFINES\dcs\dcs_flags.dm" #include "code\__DEFINES\dcs\dcs_helpers.dm" #include "code\__DEFINES\dcs\signals.dm" +#include "code\__DEFINES\_ss220.dm" #include "code\__HELPERS\_logging.dm" #include "code\__HELPERS\_string_lists.dm" #include "code\__HELPERS\AnimationLibrary.dm" From 5e3a0ce5c1adcbb97b8dc67f581c51b7f211a757 Mon Sep 17 00:00:00 2001 From: Mikhail Dzianishchyts Date: Sun, 25 Aug 2024 23:32:47 +0300 Subject: [PATCH 06/11] Enhance test output --- modular_ss220/unit_tests/code/security_levels.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_ss220/unit_tests/code/security_levels.dm b/modular_ss220/unit_tests/code/security_levels.dm index fe23d671bcc2..c6041769e617 100644 --- a/modular_ss220/unit_tests/code/security_levels.dm +++ b/modular_ss220/unit_tests/code/security_levels.dm @@ -16,4 +16,4 @@ ) var/list/actual = SSsecurity_level.available_levels if(!compare_list(expected, actual)) - Fail("Security levels order is invalid.\nExpected: [expected]\nActual: [actual]") + Fail("Security levels order is invalid.\nExpected: [expected.Join(", ")]\nActual: [actual.Join(", ")]") From 8d7b6ea5df22434f52bada1dcd092be8a897fb05 Mon Sep 17 00:00:00 2001 From: Mikhail Dzianishchyts Date: Sun, 25 Aug 2024 23:39:50 +0300 Subject: [PATCH 07/11] Fix unit test --- modular_ss220/unit_tests/code/security_levels.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modular_ss220/unit_tests/code/security_levels.dm b/modular_ss220/unit_tests/code/security_levels.dm index c6041769e617..b150e633e8ec 100644 --- a/modular_ss220/unit_tests/code/security_levels.dm +++ b/modular_ss220/unit_tests/code/security_levels.dm @@ -4,7 +4,7 @@ security_levels_order() /datum/unit_test/security_levels/proc/security_levels_order() - var/list/expected = list( + var/expected = list( new /datum/security_level/green, new /datum/security_level/blue, new /datum/security_level/violet, @@ -13,7 +13,7 @@ new /datum/security_level/gamma, new /datum/security_level/epsilon, new /datum/security_level/delta - ) - var/list/actual = SSsecurity_level.available_levels - if(!compare_list(expected, actual)) - Fail("Security levels order is invalid.\nExpected: [expected.Join(", ")]\nActual: [actual.Join(", ")]") + ).Join(", ") + var/actual = SSsecurity_level.available_levels.Join(", ") + if(actual != expected) + Fail("Security levels order is invalid.\nExpected: [expected]\nActual: [actual]") From 560cf61e76a9cf739b38f454247184575771fc71 Mon Sep 17 00:00:00 2001 From: Mikhail Dzianishchyts Date: Sun, 1 Sep 2024 16:24:14 +0300 Subject: [PATCH 08/11] Move global access procs to the mapping subsystem --- .../subsystem/non_firing/SSmapping.dm | 39 +++++++++++++++ .../weather/weather_types/radiation_storm.dm | 4 +- .../security_levels/keycard_authentication.dm | 48 ++----------------- 3 files changed, 45 insertions(+), 46 deletions(-) diff --git a/code/controllers/subsystem/non_firing/SSmapping.dm b/code/controllers/subsystem/non_firing/SSmapping.dm index 1b07dae138de..b507612a0238 100644 --- a/code/controllers/subsystem/non_firing/SSmapping.dm +++ b/code/controllers/subsystem/non_firing/SSmapping.dm @@ -356,5 +356,44 @@ SUBSYSTEM_DEF(mapping) log_world("Ruin loader finished with [budget] left to spend.") +GLOBAL_VAR_INIT(maint_all_access, FALSE) +GLOBAL_VAR_INIT(station_all_access, FALSE) + +/datum/controller/subsystem/mapping/proc/make_maint_all_access() + for(var/area/station/maintenance/A in world) + for(var/obj/machinery/door/airlock/D in A) + D.emergency = TRUE + D.update_icon() + GLOB.minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been removed.") + GLOB.maint_all_access = TRUE + SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency maintenance access", "enabled")) + +/datum/controller/subsystem/mapping/proc/revoke_maint_all_access() + for(var/area/station/maintenance/A in world) + for(var/obj/machinery/door/airlock/D in A) + D.emergency = FALSE + D.update_icon() + GLOB.minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been re-added.") + GLOB.maint_all_access = FALSE + SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency maintenance access", "disabled")) + +/datum/controller/subsystem/mapping/proc/make_station_all_access() + for(var/obj/machinery/door/airlock/D in GLOB.airlocks) + if(is_station_level(D.z)) + D.emergency = TRUE + D.update_icon() + GLOB.minor_announcement.Announce("Access restrictions on all station airlocks have been removed due to an ongoing crisis. Trespassing laws still apply unless ordered otherwise by Command staff.") + GLOB.station_all_access = TRUE + SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency station access", "enabled")) + +/datum/controller/subsystem/mapping/proc/revoke_station_all_access() + for(var/obj/machinery/door/airlock/D in GLOB.airlocks) + if(is_station_level(D.z)) + D.emergency = FALSE + D.update_icon() + GLOB.minor_announcement.Announce("Access restrictions on all station airlocks have been re-added. Seek station AI or a colleague's assistance if you are stuck.") + GLOB.station_all_access = FALSE + SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency station access", "disabled")) + /datum/controller/subsystem/mapping/Recover() flags |= SS_NO_INIT diff --git a/code/datums/weather/weather_types/radiation_storm.dm b/code/datums/weather/weather_types/radiation_storm.dm index ccb43e11a816..a8521f993b7a 100644 --- a/code/datums/weather/weather_types/radiation_storm.dm +++ b/code/datums/weather/weather_types/radiation_storm.dm @@ -40,7 +40,7 @@ status_alarm(TRUE) pre_maint_all_access = GLOB.maint_all_access if(!GLOB.maint_all_access) - make_maint_all_access() + SSmapping.make_maint_all_access() /datum/weather/rad_storm/weather_act(mob/living/L) if(!prob(60)) @@ -74,7 +74,7 @@ status_alarm(FALSE) if(!pre_maint_all_access) GLOB.minor_announcement.Announce("The radiation threat has passed. Please return to your workplaces. Door access resetting momentarily.", "Anomaly Alert") - addtimer(CALLBACK(SSweather, GLOBAL_PROC_REF(revoke_maint_all_access)), 10 SECONDS) // Bit of time to get out / break into somewhere. + addtimer(CALLBACK(SSmapping, TYPE_PROC_REF(/datum/controller/subsystem/mapping, revoke_maint_all_access)), 10 SECONDS) // Bit of time to get out / break into somewhere. else GLOB.minor_announcement.Announce("The radiation threat has passed. Please return to your workplaces.", "Anomaly Alert") diff --git a/code/modules/security_levels/keycard_authentication.dm b/code/modules/security_levels/keycard_authentication.dm index 441b31198b22..9ae9a8a0da4b 100644 --- a/code/modules/security_levels/keycard_authentication.dm +++ b/code/modules/security_levels/keycard_authentication.dm @@ -177,13 +177,13 @@ if("Red Alert") INVOKE_ASYNC(SSsecurity_level, TYPE_PROC_REF(/datum/controller/subsystem/security_level, set_level), SEC_LEVEL_RED) if("Grant Emergency Maintenance Access") - make_maint_all_access() + SSmapping.make_maint_all_access() if("Revoke Emergency Maintenance Access") - revoke_maint_all_access() + SSmapping.revoke_maint_all_access() if("Activate Station-Wide Emergency Access") - make_station_all_access() + SSmapping.make_station_all_access() if("Deactivate Station-Wide Emergency Access") - revoke_station_all_access() + SSmapping.revoke_station_all_access() if("Emergency Response Team") if(is_ert_blocked()) atom_say("All Emergency Response Teams are dispatched and can not be called at this time.") @@ -215,43 +215,3 @@ /obj/machinery/keycard_auth/proc/is_ert_blocked() return SSticker.mode && SSticker.mode.ert_disabled - -GLOBAL_VAR_INIT(maint_all_access, 0) -GLOBAL_VAR_INIT(station_all_access, 0) - -// Why are these global procs? -/proc/make_maint_all_access() - for(var/area/station/maintenance/A in world) // Why are these global lists? AAAAAAAAAAAAAA - for(var/obj/machinery/door/airlock/D in A) - D.emergency = 1 - D.update_icon() - GLOB.minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been removed.") - GLOB.maint_all_access = 1 - SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency maintenance access", "enabled")) - -/proc/revoke_maint_all_access() - for(var/area/station/maintenance/A in world) - for(var/obj/machinery/door/airlock/D in A) - D.emergency = 0 - D.update_icon() - GLOB.minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been re-added.") - GLOB.maint_all_access = 0 - SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency maintenance access", "disabled")) - -/proc/make_station_all_access() - for(var/obj/machinery/door/airlock/D in GLOB.airlocks) - if(is_station_level(D.z)) - D.emergency = 1 - D.update_icon() - GLOB.minor_announcement.Announce("Access restrictions on all station airlocks have been removed due to an ongoing crisis. Trespassing laws still apply unless ordered otherwise by Command staff.") - GLOB.station_all_access = 1 - SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency station access", "enabled")) - -/proc/revoke_station_all_access() - for(var/obj/machinery/door/airlock/D in GLOB.airlocks) - if(is_station_level(D.z)) - D.emergency = 0 - D.update_icon() - GLOB.minor_announcement.Announce("Access restrictions on all station airlocks have been re-added. Seek station AI or a colleague's assistance if you are stuck.") - GLOB.station_all_access = 0 - SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency station access", "disabled")) From ce0e1bb23f9f17d994728c971afc346fd3812e42 Mon Sep 17 00:00:00 2001 From: Mikhail Dzianishchyts Date: Sun, 1 Sep 2024 16:37:38 +0300 Subject: [PATCH 09/11] Apply requested changes --- .../subsystem/non_firing/SSmapping.dm | 19 ++++++++++--------- .../weather/weather_types/radiation_storm.dm | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/code/controllers/subsystem/non_firing/SSmapping.dm b/code/controllers/subsystem/non_firing/SSmapping.dm index b507612a0238..ca5592181358 100644 --- a/code/controllers/subsystem/non_firing/SSmapping.dm +++ b/code/controllers/subsystem/non_firing/SSmapping.dm @@ -16,6 +16,10 @@ SUBSYSTEM_DEF(mapping) var/datum/lavaland_theme/lavaland_theme ///What primary cave theme we have picked for cave generation today. var/cave_theme + // Tells if all maintenance airlocks have emergency access enabled + var/maint_all_access = FALSE + // Tells if all station airlocks have emergency access enabled + var/station_all_access = FALSE /// A mapping of environment names to MILLA environment IDs. var/list/environments @@ -356,25 +360,22 @@ SUBSYSTEM_DEF(mapping) log_world("Ruin loader finished with [budget] left to spend.") -GLOBAL_VAR_INIT(maint_all_access, FALSE) -GLOBAL_VAR_INIT(station_all_access, FALSE) - /datum/controller/subsystem/mapping/proc/make_maint_all_access() - for(var/area/station/maintenance/A in world) + for(var/area/station/maintenance/A in existing_station_areas) for(var/obj/machinery/door/airlock/D in A) D.emergency = TRUE D.update_icon() GLOB.minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been removed.") - GLOB.maint_all_access = TRUE + maint_all_access = TRUE SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency maintenance access", "enabled")) /datum/controller/subsystem/mapping/proc/revoke_maint_all_access() - for(var/area/station/maintenance/A in world) + for(var/area/station/maintenance/A in existing_station_areas) for(var/obj/machinery/door/airlock/D in A) D.emergency = FALSE D.update_icon() GLOB.minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been re-added.") - GLOB.maint_all_access = FALSE + maint_all_access = FALSE SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency maintenance access", "disabled")) /datum/controller/subsystem/mapping/proc/make_station_all_access() @@ -383,7 +384,7 @@ GLOBAL_VAR_INIT(station_all_access, FALSE) D.emergency = TRUE D.update_icon() GLOB.minor_announcement.Announce("Access restrictions on all station airlocks have been removed due to an ongoing crisis. Trespassing laws still apply unless ordered otherwise by Command staff.") - GLOB.station_all_access = TRUE + station_all_access = TRUE SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency station access", "enabled")) /datum/controller/subsystem/mapping/proc/revoke_station_all_access() @@ -392,7 +393,7 @@ GLOBAL_VAR_INIT(station_all_access, FALSE) D.emergency = FALSE D.update_icon() GLOB.minor_announcement.Announce("Access restrictions on all station airlocks have been re-added. Seek station AI or a colleague's assistance if you are stuck.") - GLOB.station_all_access = FALSE + station_all_access = FALSE SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency station access", "disabled")) /datum/controller/subsystem/mapping/Recover() diff --git a/code/datums/weather/weather_types/radiation_storm.dm b/code/datums/weather/weather_types/radiation_storm.dm index a8521f993b7a..4cb7314c4ab4 100644 --- a/code/datums/weather/weather_types/radiation_storm.dm +++ b/code/datums/weather/weather_types/radiation_storm.dm @@ -38,8 +38,8 @@ /datum/weather/rad_storm/telegraph() ..() status_alarm(TRUE) - pre_maint_all_access = GLOB.maint_all_access - if(!GLOB.maint_all_access) + pre_maint_all_access = SSmapping.maint_all_access + if(!SSmapping.maint_all_access) SSmapping.make_maint_all_access() /datum/weather/rad_storm/weather_act(mob/living/L) From fc627a851568b58498235acffa88d0af66f5f4b1 Mon Sep 17 00:00:00 2001 From: Mikhail Dzianishchyts Date: Tue, 27 Aug 2024 14:27:59 +0300 Subject: [PATCH 10/11] Set emergency access for an airlock on alarm --- modular_ss220/_misc/_misc.dme | 1 + modular_ss220/_misc/code/area.dm | 8 +++ modular_ss220/objects/_objects.dme | 1 + modular_ss220/objects/code/airlock.dm | 88 +++++++++++++++++++++++++++ 4 files changed, 98 insertions(+) create mode 100644 modular_ss220/_misc/code/area.dm create mode 100644 modular_ss220/objects/code/airlock.dm diff --git a/modular_ss220/_misc/_misc.dme b/modular_ss220/_misc/_misc.dme index 6e7ae4f13e7f..0873e8fa8bf7 100644 --- a/modular_ss220/_misc/_misc.dme +++ b/modular_ss220/_misc/_misc.dme @@ -5,3 +5,4 @@ #include "code/icons.dm" #include "code/pronouns.dm" #include "code/ss220_general_config.dm" +#include "code/area.dm" diff --git a/modular_ss220/_misc/code/area.dm b/modular_ss220/_misc/code/area.dm new file mode 100644 index 000000000000..7d3c0b602f14 --- /dev/null +++ b/modular_ss220/_misc/code/area.dm @@ -0,0 +1,8 @@ +/area/proc/has_power_alarm() + return !poweralm + +/area/proc/has_atmos_alarm() + return atmosalm != ATMOS_ALARM_NONE + +/area/proc/has_fire_alarm() + return fire diff --git a/modular_ss220/objects/_objects.dme b/modular_ss220/objects/_objects.dme index df38bb801967..48e60b9985dd 100644 --- a/modular_ss220/objects/_objects.dme +++ b/modular_ss220/objects/_objects.dme @@ -47,3 +47,4 @@ #include "code/components.dm" #include "code/airlock_painter.dm" #include "code/animalhide.dm" +#include "code/airlock.dm" diff --git a/modular_ss220/objects/code/airlock.dm b/modular_ss220/objects/code/airlock.dm new file mode 100644 index 000000000000..2371fbf30543 --- /dev/null +++ b/modular_ss220/objects/code/airlock.dm @@ -0,0 +1,88 @@ +#define EMERGENCY_NONE 0 +#define EMERGENCY_STATION_WIDE (1<<0) +#define EMERGENCY_MAINTENANCE (1<<1) +#define EMERGENCY_MANUAL (1<<2) +#define EMERGENCY_ALARM (1<<3) + +/obj/machinery/door/airlock + var/is_alert_sensitive = TRUE + var/emergency_reason = EMERGENCY_NONE + +/obj/machinery/door/airlock/Initialize() + . = ..() + if(has_constant_processing()) + START_PROCESSING(SSmachines, src) + +/obj/machinery/door/airlock/process() + if(is_station_level(z)) + if(is_alert_sensitive) + var/area/this_area = get_area(src) + if(SSsecurity_level.get_current_level_as_number() == SEC_LEVEL_ORANGE \ + && (this_area.has_power_alarm() || this_area.has_atmos_alarm() || this_area.has_fire_alarm())) + emergency_reason |= EMERGENCY_ALARM + else + emergency_reason &= ~EMERGENCY_ALARM + var/old_emergency = emergency + emergency = emergency_reason != EMERGENCY_NONE + if(emergency != old_emergency) + update_icon() + . = ..() + return has_constant_processing() || . + +/obj/machinery/door/airlock/toggle_emergency_status(mob/user) + . = ..() + if(emergency) + emergency_reason |= EMERGENCY_MANUAL + else + emergency_reason = EMERGENCY_NONE + +/obj/machinery/door/airlock/proc/has_constant_processing() + return is_alert_sensitive && is_station_level(z) + +/obj/machinery/door/airlock/abductor + is_alert_sensitive = FALSE + +/obj/machinery/door/airlock/cult + is_alert_sensitive = FALSE + +/obj/machinery/door/airlock/external + is_alert_sensitive = FALSE + +/obj/machinery/door/airlock/external_no_weld + is_alert_sensitive = FALSE + +/obj/machinery/door/airlock/highsecurity + is_alert_sensitive = FALSE + +/obj/machinery/door/airlock/vault + is_alert_sensitive = FALSE + +/datum/controller/subsystem/mapping/make_maint_all_access() + for(var/area/station/maintenance/A in existing_station_areas) + for(var/obj/machinery/door/airlock/D in A) + D.emergency_reason |= EMERGENCY_MAINTENANCE + . = ..() + +/datum/controller/subsystem/mapping/revoke_maint_all_access() + for(var/area/station/maintenance/A in existing_station_areas) + for(var/obj/machinery/door/airlock/D in A) + D.emergency_reason &= ~EMERGENCY_MAINTENANCE + . = ..() + +/datum/controller/subsystem/mapping/make_station_all_access() + for(var/obj/machinery/door/airlock/D in GLOB.airlocks) + if(is_station_level(D.z)) + D.emergency_reason |= EMERGENCY_STATION_WIDE + . = ..() + +/datum/controller/subsystem/mapping/revoke_station_all_access() + for(var/obj/machinery/door/airlock/D in GLOB.airlocks) + if(is_station_level(D.z)) + D.emergency_reason &= ~EMERGENCY_STATION_WIDE + . = ..() + +#undef EMERGENCY_NONE +#undef EMERGENCY_STATION_WIDE +#undef EMERGENCY_MAINTENANCE +#undef EMERGENCY_MANUAL +#undef EMERGENCY_ALARM From e83a727172f7f8615455afd05717bf820e7dfe84 Mon Sep 17 00:00:00 2001 From: Mikhail Dzianishchyts Date: Sun, 1 Sep 2024 20:28:31 +0300 Subject: [PATCH 11/11] Disable emergency handling when disabling emergency access manually --- modular_ss220/objects/code/airlock.dm | 47 ++++++++++++------- .../code/security_level_datums.dm | 5 ++ 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/modular_ss220/objects/code/airlock.dm b/modular_ss220/objects/code/airlock.dm index 2371fbf30543..afbf3b702904 100644 --- a/modular_ss220/objects/code/airlock.dm +++ b/modular_ss220/objects/code/airlock.dm @@ -5,23 +5,26 @@ #define EMERGENCY_ALARM (1<<3) /obj/machinery/door/airlock - var/is_alert_sensitive = TRUE + var/alarm_sensitive = TRUE + var/emergency_handling = FALSE var/emergency_reason = EMERGENCY_NONE /obj/machinery/door/airlock/Initialize() . = ..() + if(is_station_level(z)) + emergency_handling = TRUE if(has_constant_processing()) START_PROCESSING(SSmachines, src) /obj/machinery/door/airlock/process() - if(is_station_level(z)) - if(is_alert_sensitive) + if(emergency_handling) + if(alarm_sensitive) var/area/this_area = get_area(src) if(SSsecurity_level.get_current_level_as_number() == SEC_LEVEL_ORANGE \ && (this_area.has_power_alarm() || this_area.has_atmos_alarm() || this_area.has_fire_alarm())) - emergency_reason |= EMERGENCY_ALARM + set_emergency_reason(EMERGENCY_ALARM) else - emergency_reason &= ~EMERGENCY_ALARM + reset_emergency_reason(EMERGENCY_ALARM) var/old_emergency = emergency emergency = emergency_reason != EMERGENCY_NONE if(emergency != old_emergency) @@ -32,53 +35,61 @@ /obj/machinery/door/airlock/toggle_emergency_status(mob/user) . = ..() if(emergency) - emergency_reason |= EMERGENCY_MANUAL + set_emergency_reason(EMERGENCY_MANUAL) else - emergency_reason = EMERGENCY_NONE + emergency_handling = FALSE + +/obj/machinery/door/airlock/proc/set_emergency_reason(reason) + emergency_handling = TRUE + emergency_reason |= reason + +/obj/machinery/door/airlock/proc/reset_emergency_reason(reason) + emergency_handling = TRUE + emergency_reason &= ~reason /obj/machinery/door/airlock/proc/has_constant_processing() - return is_alert_sensitive && is_station_level(z) + return alarm_sensitive && is_station_level(z) /obj/machinery/door/airlock/abductor - is_alert_sensitive = FALSE + alarm_sensitive = FALSE /obj/machinery/door/airlock/cult - is_alert_sensitive = FALSE + alarm_sensitive = FALSE /obj/machinery/door/airlock/external - is_alert_sensitive = FALSE + alarm_sensitive = FALSE /obj/machinery/door/airlock/external_no_weld - is_alert_sensitive = FALSE + alarm_sensitive = FALSE /obj/machinery/door/airlock/highsecurity - is_alert_sensitive = FALSE + alarm_sensitive = FALSE /obj/machinery/door/airlock/vault - is_alert_sensitive = FALSE + alarm_sensitive = FALSE /datum/controller/subsystem/mapping/make_maint_all_access() for(var/area/station/maintenance/A in existing_station_areas) for(var/obj/machinery/door/airlock/D in A) - D.emergency_reason |= EMERGENCY_MAINTENANCE + D.set_emergency_reason(EMERGENCY_MAINTENANCE) . = ..() /datum/controller/subsystem/mapping/revoke_maint_all_access() for(var/area/station/maintenance/A in existing_station_areas) for(var/obj/machinery/door/airlock/D in A) - D.emergency_reason &= ~EMERGENCY_MAINTENANCE + D.reset_emergency_reason(EMERGENCY_MAINTENANCE) . = ..() /datum/controller/subsystem/mapping/make_station_all_access() for(var/obj/machinery/door/airlock/D in GLOB.airlocks) if(is_station_level(D.z)) - D.emergency_reason |= EMERGENCY_STATION_WIDE + D.set_emergency_reason(EMERGENCY_STATION_WIDE) . = ..() /datum/controller/subsystem/mapping/revoke_station_all_access() for(var/obj/machinery/door/airlock/D in GLOB.airlocks) if(is_station_level(D.z)) - D.emergency_reason &= ~EMERGENCY_STATION_WIDE + D.reset_emergency_reason(EMERGENCY_STATION_WIDE) . = ..() #undef EMERGENCY_NONE diff --git a/modular_ss220/security_levels/code/security_level_datums.dm b/modular_ss220/security_levels/code/security_level_datums.dm index d8127548f4a4..59dcc27ad9fa 100644 --- a/modular_ss220/security_levels/code/security_level_datums.dm +++ b/modular_ss220/security_levels/code/security_level_datums.dm @@ -29,3 +29,8 @@ lowering_to_announcement_text = "В настоящее время действуют процедуры Оранжевого кода. Инженерный персонал должен получить распоряжения от руководителя отдела. Неинженерный персонал обязан покинуть аварийные помещения и выполнять все соответствующие инструкции инженерного персонала." elevating_to_announcement_title = "Внимание! Уровень угрозы повышен до ОРАНЖЕВОГО." elevating_to_announcement_text = "Произошла серьезная техническая авария. Инженерный персонал должен получить распоряжения от руководителя отдела. Неинженерный персонал обязан покинуть аварийные помещения и выполнять все соответствующие инструкции инженерного персонала." + +/datum/security_level/orange/pre_change() + for(var/obj/machinery/door/airlock/D in GLOB.airlocks) + if(is_station_level(D.z)) + D.emergency_handling = TRUE