- Added the ability to communications computers to switch between the blue and green security levels. I wanna make a super special way to get to the red level, which involves the turning of multiple keys (id cards) in multiple areas :)

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2615 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
baloh.matevz
2011-12-04 20:32:30 +00:00
parent 430cca3300
commit 962919f6e0
3 changed files with 105 additions and 20 deletions

View File

@@ -7,52 +7,59 @@
/proc/set_security_level(var/level)
switch(level)
if("green")
level = 0
level = SEC_LEVEL_GREEN
if("blue")
level = 1
level = SEC_LEVEL_BLUE
if("red")
level = 2
level = SEC_LEVEL_RED
if("delta")
level = 3
level = SEC_LEVEL_DELTA
if(level >= 0 && level <= 3)
//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 != security_level)
switch(level)
if(0)
if(SEC_LEVEL_GREEN)
world << "<font size=4 color='red'>Attention! security level lowered to green</font>"
world << "<font color='red'>All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced.</font>"
security_level = 0
security_level = SEC_LEVEL_GREEN
for(var/obj/machinery/firealarm/FA in world)
if(FA.z == 1)
FA.overlays = list()
FA.overlays += image('monitors.dmi', "overlay_green")
if(1)
if(security_level < 1)
if(SEC_LEVEL_BLUE)
if(security_level < SEC_LEVEL_BLUE)
world << "<font size=4 color='red'>Attention! security level elevated to blue</font>"
world << "<font color='red'>The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible, random searches are permitted.</font>"
else
world << "<font size=4 color='red'>Attention! security level lowered to blue</font>"
world << "<font color='red'>The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed.</font>"
security_level = 1
security_level = SEC_LEVEL_BLUE
for(var/obj/machinery/firealarm/FA in world)
if(FA.z == 1)
FA.overlays = list()
FA.overlays += image('monitors.dmi', "overlay_blue")
if(2)
if(security_level < 2)
if(SEC_LEVEL_RED)
if(security_level < SEC_LEVEL_RED)
world << "<font size=4 color='red'>Attention! Code red!</font>"
world << "<font color='red'>There is an immediate serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.</font>"
else
world << "<font size=4 color='red'>Attention! Code red!</font>"
world << "<font color='red'>The self-destruct mechanism has been deactivated, there is still however an immediate serious threat to the station. Security may have weapons unholstered at all times, random searches are allowed and advised.</font>"
security_level = 2
security_level = SEC_LEVEL_RED
/* - At the time of commit, setting status displays didn't work properly
var/obj/machinery/computer/communications/CC = locate(/obj/machinery/computer/communications,world)
if(CC)
CC.post_status("alert", "redalert")*/
for(var/obj/machinery/firealarm/FA in world)
if(FA.z == 1)
FA.overlays = list()
FA.overlays += image('monitors.dmi', "overlay_red")
if(3)
if(SEC_LEVEL_DELTA)
world << "<font size=4 color='red'>Attention! Delta security level reached!</font>"
world << "<font color='red'>The ship's self-destruct mechanism has been engaged. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill.</font>"
security_level = 3
security_level = SEC_LEVEL_DELTA
for(var/obj/machinery/firealarm/FA in world)
if(FA.z == 1)
FA.overlays = list()
@@ -62,15 +69,37 @@
/proc/get_security_level()
switch(security_level)
if(0)
if(SEC_LEVEL_GREEN)
return "green"
if(1)
if(SEC_LEVEL_BLUE)
return "blue"
if(2)
if(SEC_LEVEL_RED)
return "red"
if(3)
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_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("red")
return SEC_LEVEL_RED
if("delta")
return SEC_LEVEL_DELTA
/*DEBUG
/mob/verb/set_thing0()