TG update: ...

- added feedback logging for alert levels
 - alert level descriptions are now part of config.txt
 - alert levels default to the ones I had before, if the config file isn't configured.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2641 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
Albert Iordache
2011-12-24 00:47:40 +02:00
parent fd9c3ad6a8
commit b067fdc726
6 changed files with 5058 additions and 5018 deletions

View File

@@ -42,6 +42,14 @@
var/server
var/banappeals
//Alert level description
var/alert_desc_green = "All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced."
var/alert_desc_blue_upto = "The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible, random searches are permitted."
var/alert_desc_blue_downto = "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."
var/alert_desc_red_upto = "There is an immediate serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised."
var/alert_desc_red_downto = "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."
var/alert_desc_delta = "The station'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."
//game_options.txt configs
var/health_threshold_crit = 0
@@ -220,6 +228,24 @@
if("load_jobs_from_txt")
load_jobs_from_txt = 1
if("alert_red_upto")
config.alert_desc_red_upto = value
if("alert_red_downto")
config.alert_desc_red_downto = value
if("alert_blue_downto")
config.alert_desc_blue_downto = value
if("alert_blue_upto")
config.alert_desc_blue_upto = value
if("alert_green")
config.alert_desc_green = value
if("alert_delta")
config.alert_desc_delta = value
else
diary << "Unknown setting in configuration: '[name]'"

View File

@@ -79,6 +79,11 @@
//Only notify the admins if an actual change happened
log_game("[key_name(usr)] has changed the security level to [get_security_level()].")
message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].", 1)
switch(get_security_level())
if(SEC_LEVEL_GREEN)
feedback_inc("alert_comms_green",1)
if(SEC_LEVEL_GREEN)
feedback_inc("alert_comms_blue",1)
tmp_alertlevel = 0
else:
usr << "You are not authorized to do this."

View File

@@ -140,4 +140,5 @@
/obj/machinery/keycard_auth/proc/trigger_event()
switch(event)
if("Red alert")
set_security_level(SEC_LEVEL_RED)
set_security_level(SEC_LEVEL_RED)
feedback_inc("alert_keycard_auth_red",1)

View File

@@ -4,6 +4,8 @@
//2 = code red
//3 = code delta
//config.alert_desc_blue_downto
/proc/set_security_level(var/level)
switch(level)
if("green")
@@ -20,7 +22,7 @@
switch(level)
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>"
world << "<font color='red'>[config.alert_desc_green]</font>"
security_level = SEC_LEVEL_GREEN
for(var/obj/machinery/firealarm/FA in world)
if(FA.z == 1)
@@ -29,10 +31,10 @@
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>"
world << "<font color='red'>[config.alert_desc_blue_upto]</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>"
world << "<font color='red'>[config.alert_desc_blue_downto]</font>"
security_level = SEC_LEVEL_BLUE
for(var/obj/machinery/firealarm/FA in world)
if(FA.z == 1)
@@ -41,10 +43,10 @@
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>"
world << "<font color='red'>[config.alert_desc_red_upto]</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>"
world << "<font color='red'>[config.alert_desc_red_downto]</font>"
security_level = SEC_LEVEL_RED
/* - At the time of commit, setting status displays didn't work properly
@@ -58,7 +60,7 @@
FA.overlays += image('monitors.dmi', "overlay_red")
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>"
world << "<font color='red'>[config.alert_desc_delta]</font>"
security_level = SEC_LEVEL_DELTA
for(var/obj/machinery/firealarm/FA in world)
if(FA.z == 1)