Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Delta code #12622

Merged
merged 19 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions code/game/gamemodes/modes_gameplays/nuclear/nuclearbomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ var/global/bomb_set
var/nuketype = ""
var/cur_code
var/datum/announcement/station/nuke/announce_nuke = new
var/global/nuclear_siren_cooldown = 0
BasiaBelov marked this conversation as resolved.
Show resolved Hide resolved
COOLDOWN_DECLARE(cd_activate)
BasiaBelov marked this conversation as resolved.
Show resolved Hide resolved

/obj/machinery/nuclearbomb/atom_init()
. = ..()
Expand All @@ -50,8 +52,14 @@ 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 && world.time >= 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)
nuclear_siren_cooldown = world.time + 8 SECONDS
if(timeleft <= 0)
explode()
nuclear_siren_cooldown = max(nuclear_siren_cooldown - 2, 0)

/obj/machinery/nuclearbomb/attackby(obj/item/weapon/O, mob/user)
if(isscrewing(O))
Expand Down Expand Up @@ -260,17 +268,22 @@ var/global/bomb_set
update_icon()

/obj/machinery/nuclearbomb/proc/bomb_set(mob/user)
if(!authorized || safety)
var/seconds = max(round(COOLDOWN_TIMELEFT(src, cd_activate) * 0.1, 1), 0)
var/seconds_word = pluralize_russian(seconds, "секунду", "секунды", "секунд")
if(!COOLDOWN_FINISHED(src, cd_activate) || !authorized || safety)
to_chat(user, "<span class = 'red'>Не так быстро! Эта кнопка сработает снова через [seconds] [seconds_word]!</span>")
BasiaBelov marked this conversation as resolved.
Show resolved Hide resolved
return
BasiaBelov marked this conversation as resolved.
Show resolved Hide resolved
if(timing)
timing = FALSE
set_security_level("red")
else
var/area/nuclearbombloc = get_area(loc)
announce_nuke.play(nuclearbombloc)
set_security_level("delta")
notify_ghosts("[src] has been activated!", source = src, action = NOTIFY_ORBIT, header = "Nuclear bomb")
timing = TRUE
sleep(90)
BasiaBelov marked this conversation as resolved.
Show resolved Hide resolved
set_security_level("delta")
COOLDOWN_START(src, cd_activate, 60 SECONDS)
update_icon()

/obj/machinery/nuclearbomb/proc/deploy(mob/user)
Expand Down Expand Up @@ -354,7 +367,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)
Expand Down Expand Up @@ -497,6 +513,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)
Chip11-n marked this conversation as resolved.
Show resolved Hide resolved
update_icon()
addtimer(CALLBACK(src, PROC_REF(fail)), 13 SECONDS) //Good taste, right?

Expand Down
7 changes: 7 additions & 0 deletions code/modules/lighting/lamps/light_modes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 9 additions & 1 deletion code/modules/security_levels/security_levels.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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))
Expand All @@ -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
Expand All @@ -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)
BasiaBelov marked this conversation as resolved.
Show resolved Hide resolved
// 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
Expand Down
Binary file added sound/effects/siren-single.ogg
Binary file not shown.
Binary file added sound/machines/Alarm_reverb.ogg
Binary file not shown.
Loading