diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index f2aa472df21e..09263cb09e83 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -58,3 +58,5 @@ var/global/timezoneOffset = 0 // The difference betwen midnight (of the ho var/global/gametime_offset = 12 HOURS //Deciseconds to add to world.time for station time. var/global/playsound_frequency_admin = 0 // Admin var for shitspawn via Secrets panel + +var/global/nuclear_siren_cooldown = 0 diff --git a/code/datums/lighting/light_modes.dm b/code/datums/lighting/light_modes.dm index 0f90e31c147d..92d2ca5a13a3 100644 --- a/code/datums/lighting/light_modes.dm +++ b/code/datums/lighting/light_modes.dm @@ -206,5 +206,12 @@ var/global/list/datum/light_mode/light_modes_by_name // for admins, may differ i power = DEFAULT_POWER range = 6 +/datum/light_mode/code_delta + name = "Code Delta" + + color = "#ff0915" + power = DEFAULT_POWER + range = 6 + #undef DEFAULT_RANGE #undef DEFAULT_POWER diff --git a/code/game/gamemodes/modes_gameplays/nuclear/nuclearbomb.dm b/code/game/gamemodes/modes_gameplays/nuclear/nuclearbomb.dm index 57d8a1d48dfe..2a5fc43dc9c5 100644 --- a/code/game/gamemodes/modes_gameplays/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/modes_gameplays/nuclear/nuclearbomb.dm @@ -33,6 +33,7 @@ var/global/bomb_set var/nuketype = "" var/cur_code var/datum/announcement/station/nuke/announce_nuke = new + COOLDOWN_DECLARE(cd_activate) /obj/machinery/nuclearbomb/atom_init() . = ..() @@ -51,6 +52,11 @@ var/global/bomb_set bomb_set = TRUE //So long as there is one nuke timing, it means one nuke is armed. timeleft = max(timeleft - 2, 0) // 2 seconds per process() playsound(src, 'sound/items/timer.ogg', VOL_EFFECTS_MASTER, 30, FALSE) + if(timeleft <= 120 && COOLDOWN_FINISHED(global, nuclear_siren_cooldown)) + for(var/mob/M in player_list) + if(!isnewplayer(M)) + M.playsound_local(null, 'sound/effects/siren-single.ogg', VOL_EFFECTS_MASTER, 60, vary = FALSE, frequency = null, ignore_environment = FALSE) + COOLDOWN_START(global, nuclear_siren_cooldown, 8 SECONDS) if(timeleft <= 0) explode() @@ -261,7 +267,8 @@ var/global/bomb_set update_icon() /obj/machinery/nuclearbomb/proc/bomb_set(mob/user) - if(!authorized || safety) + if(!COOLDOWN_FINISHED(src, cd_activate) || !authorized || safety) + to_chat(user, "Не так быстро! Эта кнопка сработает снова через [round(COOLDOWN_TIMELEFT(src, cd_activate) * 0.1, 1)] [PLUR_SECONDS_LEFT(round(COOLDOWN_TIMELEFT(src, cd_activate) * 0.1, 1))]!") return if(timing) timing = FALSE @@ -269,9 +276,10 @@ var/global/bomb_set else var/area/nuclearbombloc = get_area(loc) announce_nuke.play(nuclearbombloc) - set_security_level("delta") notify_ghosts("[C_CASE(src, NOMINATIVE_CASE)] была активирована!", source = src, action = NOTIFY_ORBIT, header = "Nuclear bomb") timing = TRUE + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(set_security_level), "delta"), 9 SECONDS) + COOLDOWN_START(src, cd_activate, 60 SECONDS) update_icon() /obj/machinery/nuclearbomb/proc/deploy(mob/user) @@ -355,7 +363,10 @@ var/global/bomb_set detonated = TRUE safety = TRUE update_icon() - playsound(src, 'sound/machines/Alarm.ogg', VOL_EFFECTS_MASTER, null, FALSE, null, 5) + playsound(src, 'sound/machines/Alarm.ogg', VOL_EFFECTS_MASTER, null, FALSE, null, 10) + for(var/mob/M in player_list) + if(!isnewplayer(M)) + M.playsound_local(null, 'sound/machines/Alarm_reverb.ogg', VOL_EFFECTS_MASTER, vary = FALSE, frequency = null, ignore_environment = FALSE) if(SSticker) SSticker.explosion_in_progress = TRUE sleep(100) @@ -456,6 +467,9 @@ var/global/bomb_set return detonated = TRUE playsound(src, 'sound/machines/Alarm.ogg', VOL_EFFECTS_MASTER, null, FALSE, null, 30) + for(var/mob/M in player_list) + if(!isnewplayer(M)) + M.playsound_local(null, 'sound/machines/Alarm_reverb.ogg', VOL_EFFECTS_VOICE_ANNOUNCEMENT, vary = FALSE, frequency = null, ignore_environment = TRUE) update_icon() addtimer(CALLBACK(src, PROC_REF(fail)), 13 SECONDS) //Good taste, right? diff --git a/code/modules/security_levels/security_levels.dm b/code/modules/security_levels/security_levels.dm index 722631593484..a314bdb71199 100644 --- a/code/modules/security_levels/security_levels.dm +++ b/code/modules/security_levels/security_levels.dm @@ -17,6 +17,8 @@ var/datum/announcement/station/code/code_announce switch(level) if(SEC_LEVEL_GREEN) + if(security_level == SEC_LEVEL_DELTA) + SSsmartlight.reset_smartlight() security_level = SEC_LEVEL_GREEN code_announce = new /datum/announcement/station/code/downtogreen @@ -32,6 +34,8 @@ code_announce = new /datum/announcement/station/code/uptoblue else code_announce = new /datum/announcement/station/code/downtoblue + if(security_level == SEC_LEVEL_DELTA) + SSsmartlight.reset_smartlight() security_level = SEC_LEVEL_BLUE for(var/obj/machinery/firealarm/FA in firealarm_list) if(is_station_level(FA.z) || is_mining_level(FA.z)) @@ -45,6 +49,8 @@ code_announce = new /datum/announcement/station/code/uptored else code_announce = new /datum/announcement/station/code/downtored + if(security_level == SEC_LEVEL_DELTA) + SSsmartlight.reset_smartlight() security_level = SEC_LEVEL_RED var/obj/machinery/computer/communications/CC = locate() in communications_list @@ -67,7 +73,9 @@ FA.add_overlay(image('icons/obj/monitors.dmi', "overlay_delta")) if(!delta_timer_id) delta_alarm() - SSsmartlight.check_nightshift() // Night shift mode turns off if security level is raised to red or above + SSsmartlight.update_mode(light_modes_by_name["Code Delta"], TRUE) + // commented in favor of deltacode above, also because we don't use NS actively atm. Need to revisit this + //SSsmartlight.check_nightshift() // Night shift mode turns off if security level is raised to red or above code_announce.play() else return diff --git a/sound/effects/siren-single.ogg b/sound/effects/siren-single.ogg new file mode 100644 index 000000000000..eba00a3f8f0b Binary files /dev/null and b/sound/effects/siren-single.ogg differ diff --git a/sound/machines/Alarm_reverb.ogg b/sound/machines/Alarm_reverb.ogg new file mode 100644 index 000000000000..8a0cfec70a90 Binary files /dev/null and b/sound/machines/Alarm_reverb.ogg differ