From 36d2df1221363b3cb312e54e8857a7c7891a3c90 Mon Sep 17 00:00:00 2001 From: dj-34 Date: Wed, 4 Oct 2023 21:37:19 +0500 Subject: [PATCH] Feat: Securtity additional accesses on red code (#288) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавляет доступы СБ в красный код Closes https://github.com/ss220club/Paradise-SS220/issues/285 Ориг PR: https://github.com/ss220-space/Paradise/pull/1207 - - В игре :cl: add: СБ добавлены доп. доступы в красный код /:cl: --- modular_ss220/modular_ss220.dme | 1 + .../code/security_redalert_accesses.dm | 16 ++++++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/modular_ss220/modular_ss220.dme b/modular_ss220/modular_ss220.dme index 6fe023631266..c5483e85e638 100644 --- a/modular_ss220/modular_ss220.dme +++ b/modular_ss220/modular_ss220.dme @@ -51,6 +51,7 @@ #include "pixel_shift/_pixel_shift.dme" #include "radio_sound/radio_sound.dme" #include "screentip_change/_screentip_change.dme" +#include "security_redalert_accesses/_security_redalert_accesses.dme" #include "smart_equip_targeted/_smart_equip_targeted.dme" #include "text_to_speech/_tts.dme" #include "title_screen/_title_screen.dme" diff --git a/modular_ss220/security_redalert_accesses/code/security_redalert_accesses.dm b/modular_ss220/security_redalert_accesses/code/security_redalert_accesses.dm index 05c6dfbff55b..d6262a84bcb7 100644 --- a/modular_ss220/security_redalert_accesses/code/security_redalert_accesses.dm +++ b/modular_ss220/security_redalert_accesses/code/security_redalert_accesses.dm @@ -1,15 +1,12 @@ -GLOBAL_LIST_EMPTY(id_cards) - /obj/item/card/id var/list/red_alert_given_access // Accesses that were given on red alert /obj/item/card/id/Initialize() . = ..() red_alert_given_access = list() - GLOB.id_cards += src + RegisterSignal(SSsecurity_level, COMSIG_SECURITY_LEVEL_CHANGED, PROC_REF(on_security_level_update)) /obj/item/card/id/Destroy() - GLOB.id_cards -= src return ..() /obj/item/card/id/proc/on_red_alert() @@ -26,9 +23,8 @@ GLOBAL_LIST_EMPTY(id_cards) access -= red_alert_given_access red_alert_given_access.Cut() -/proc/update_ids() - for(var/obj/item/card/id/card as anything in GLOB.id_cards) - if(GLOB.security_level > SEC_LEVEL_BLUE) - INVOKE_ASYNC(card, TYPE_PROC_REF(/obj/item/card/id, on_red_alert)) - else - INVOKE_ASYNC(card, TYPE_PROC_REF(/obj/item/card/id, after_red_alert)) +/obj/item/card/id/proc/on_security_level_update() + if(SSsecurity_level.current_security_level.number_level > SEC_LEVEL_BLUE) + on_red_alert() + else + after_red_alert()