Files
Aurora.3/code/modules/security levels/security levels.dm
T
BatrachophrenoandGitHub 088a71aacd Bugfixes (#21460)
Fixes https://github.com/Aurorastation/Aurora.3/issues/14594
Fixes https://github.com/Aurorastation/Aurora.3/issues/19524
Fixes https://github.com/Aurorastation/Aurora.3/issues/19525
Fixes https://github.com/Aurorastation/Aurora.3/issues/19554
Fixes https://github.com/Aurorastation/Aurora.3/issues/19565
Fixes https://github.com/Aurorastation/Aurora.3/issues/19669
Fixes https://github.com/Aurorastation/Aurora.3/issues/19739
Fixes https://github.com/Aurorastation/Aurora.3/issues/19751
Fixes https://github.com/Aurorastation/Aurora.3/issues/20323
Fixes https://github.com/Aurorastation/Aurora.3/issues/20530
Fixes https://github.com/Aurorastation/Aurora.3/issues/21008
Fixes https://github.com/Aurorastation/Aurora.3/issues/21370
Fixes https://github.com/Aurorastation/Aurora.3/issues/21375
Fixes https://github.com/Aurorastation/Aurora.3/issues/21438
Fixes https://github.com/Aurorastation/Aurora.3/issues/21456

changes:
- balance: "Budget insulated gloves no longer able to be manually
restocked in YouTool (random insulation coefficient reroll exploit)."
- bugfix: "Replaces missing req_access values from D3 Medical Equipment
Storage."
- bugfix: "Emitters can be rotated again (alt-click lock toggling
disabled)."
  - bugfix: "Lights no longer explode when toggled off and on."
  - bugfix: "Langchat images now pop up for untranslated speech."
  - bugfix: "Cyborgs can no longer flip Plasteel Barricades remotely."
- bugfix: "Fixes ghost vision inconsistently toggling when Following
mobs."
- bugfix: "Removes deprecated 'Gender and Pronouns' section from
Appearance Changer (has been replaced by 'Pronouns' section)."
- bugfix: "Offship locations will not print Mining Yield Declarations
saying they're from SCCV Horizon."
- bugfix: "Simple mobs which target their surroundings (destroying
tables windows etc) will not do so if inside a container."
- bugfix: "Newscaster Announcements channel now logs announcements made
by heads of staff."
- bugfix: "Held phoron- or chlorine-contaminated items will respect if
you're wearing a sealed suit or thick gloves (that is to say, if the
gloves provide fire protection)."
  - bugfix: "Fixes runtime in Electrical Storm event."
- bugfix: "Fixes some bounties returning 0 credit reward due to rounding
issues."
  - bugfix: "Removes old fusion debug vars, fixed outdated maths."
- bugfix: "Fixes Horizon kitchen alt fridge being swapped w/ empty
freezer."
- bugfix: "Fixes chameleon projector sometimes turning user invisible."
- bugfix: "You are again able to push an object currently being pulled."
- bugfix: "Command Support roles which start with flash-protective
sunglasses can now also choose them in their loadout."
  - code_imp: "Updates more code comments to DMDocs."
  - code_imp: "Corrects poison/venom for greimorian variable naming."
  - rscadd: "Adds missing fire alarm to Paramedic Quarters."
  - rscadd: "Holomap now respects and displays outer hull structure."

---------

Signed-off-by: Batrachophreno <Batrochophreno@gmail.com>
2025-10-30 18:14:42 +00:00

99 lines
3.3 KiB
Plaintext

GLOBAL_VAR_INIT(security_level, SEC_LEVEL_GREEN)
//0 = code green
//1 = code yellow
//2 = code blue
//3 = code red
//4 = code delta
//config.alert_desc_blue_downto
/var/datum/announcement/priority/security/security_announcement_sound = new(do_log = FALSE, do_newscast = TRUE, new_sound = sound('sound/misc/announcements/security_level.ogg'))
/var/datum/announcement/priority/security/security_announcement = new(do_log = FALSE, do_newscast = TRUE)
/proc/set_security_level(var/level)
switch(level)
if("green")
level = SEC_LEVEL_GREEN
if("blue")
level = SEC_LEVEL_BLUE
if("red")
level = SEC_LEVEL_RED
if("yellow")
level = SEC_LEVEL_YELLOW
if("delta")
level = SEC_LEVEL_DELTA
//Will not be announced if you try to set to the same level as it already is
if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != GLOB.security_level)
switch(level)
if(SEC_LEVEL_GREEN)
security_announcement.Announce("[GLOB.config.alert_desc_green]", "Attention! Security level lowered to green.")
GLOB.security_level = SEC_LEVEL_GREEN
SSnightlight.end_temp_disable()
if(SEC_LEVEL_BLUE)
if(GLOB.security_level < SEC_LEVEL_BLUE)
security_announcement_sound.Announce("[GLOB.config.alert_desc_blue_upto]", "Attention! Security level elevated to blue.")
else
security_announcement.Announce("[GLOB.config.alert_desc_blue_downto]", "Attention! Security level lowered to blue.")
GLOB.security_level = SEC_LEVEL_BLUE
SSnightlight.end_temp_disable()
if(SEC_LEVEL_YELLOW)
security_announcement_sound.Announce("[GLOB.config.alert_desc_yellow_to]", "Attention! Biohazard alert declared!")
GLOB.security_level = SEC_LEVEL_YELLOW
SSnightlight.end_temp_disable()
if(SEC_LEVEL_RED)
if(GLOB.security_level < SEC_LEVEL_RED)
security_announcement_sound.Announce("[GLOB.config.alert_desc_red_upto]", "Attention! Security level elevated to red!", new_sound = 'sound/effects/high_alert.ogg')
SSnightlight.temp_disable()
else
security_announcement.Announce("[GLOB.config.alert_desc_red_downto]", "Attention! Code red!")
GLOB.security_level = SEC_LEVEL_RED
post_display_status("alert", "redalert")
if(SEC_LEVEL_DELTA)
security_announcement_sound.Announce("[GLOB.config.alert_desc_delta]", "Attention! Delta security level reached!", new_sound = 'sound/effects/siren.ogg')
GLOB.security_level = SEC_LEVEL_DELTA
SSnightlight.temp_disable()
var/newlevel = get_security_level()
for(var/obj/machinery/power/apc/powercontrol in SSmachinery.processing)
if(isContactLevel(powercontrol.z))
powercontrol.manage_emergency(newlevel)
/proc/get_security_level()
switch(GLOB.security_level)
if(SEC_LEVEL_GREEN)
return "green"
if(SEC_LEVEL_BLUE)
return "blue"
if(SEC_LEVEL_YELLOW)
return "yellow"
if(SEC_LEVEL_RED)
return "red"
if(SEC_LEVEL_DELTA)
return "delta"
/proc/num2seclevel(var/num)
switch(num)
if(SEC_LEVEL_GREEN)
return "green"
if(SEC_LEVEL_BLUE)
return "blue"
if(SEC_LEVEL_YELLOW)
return "yellow"
if(SEC_LEVEL_RED)
return "red"
if(SEC_LEVEL_DELTA)
return "delta"
/proc/seclevel2num(var/seclevel)
switch( lowertext(seclevel) )
if("green")
return SEC_LEVEL_GREEN
if("blue")
return SEC_LEVEL_BLUE
if("yellow")
return SEC_LEVEL_BLUE
if("red")
return SEC_LEVEL_RED
if("delta")
return SEC_LEVEL_DELTA