Merge pull request #8689 from PsiOmegaDelta/SecLevels

Allows admins to more easily set security levels.
This commit is contained in:
Chinsky
2015-04-02 23:43:26 +03:00
4 changed files with 22 additions and 10 deletions
+7 -7
View File
@@ -15,17 +15,17 @@
log = do_log
newscast = do_newscast
/datum/announcement/priority/New(var/do_log = 1, var/new_sound = sound('sound/misc/notice2.ogg'), var/do_newscast = 0)
/datum/announcement/priority/New(var/do_log = 1, var/new_sound = 'sound/misc/notice2.ogg', var/do_newscast = 0)
..(do_log, new_sound, do_newscast)
title = "Priority Announcement"
announcement_type = "Priority Announcement"
/datum/announcement/priority/command/New(var/do_log = 1, var/new_sound = sound('sound/misc/notice2.ogg'), var/do_newscast = 0)
/datum/announcement/priority/command/New(var/do_log = 1, var/new_sound = 'sound/misc/notice2.ogg', var/do_newscast = 0)
..(do_log, new_sound, do_newscast)
title = "[command_name()] Update"
announcement_type = "[command_name()] Update"
/datum/announcement/priority/security/New(var/do_log = 1, var/new_sound = sound('sound/misc/notice2.ogg'), var/do_newscast = 0)
/datum/announcement/priority/security/New(var/do_log = 1, var/new_sound = 'sound/misc/notice2.ogg', var/do_newscast = 0)
..(do_log, new_sound, do_newscast)
title = "Security Announcement"
announcement_type = "Security Announcement"
@@ -33,8 +33,8 @@
/datum/announcement/proc/Announce(var/message as text, var/new_title = "", var/new_sound = null, var/do_newscast = newscast)
if(!message)
return
var/tmp/message_title = new_title ? new_title : title
var/tmp/message_sound = new_sound ? sound(new_sound) : sound
var/message_title = new_title ? new_title : title
var/message_sound = new_sound ? new_sound : sound
message = sanitize(message, extra = 0)
message_title = sanitizeSafe(message_title)
@@ -102,8 +102,8 @@ datum/announcement/proc/Sound(var/message_sound)
PlaySound(message_sound)
datum/announcement/priority/Sound(var/message_sound)
if(sound)
world << sound
if(message_sound)
world << message_sound
datum/announcement/priority/command/Sound(var/message_sound)
PlaySound(message_sound)
+13 -1
View File
@@ -84,7 +84,8 @@ var/list/admin_verbs_admin = list(
/client/proc/empty_ai_core_toggle_latejoin,
/client/proc/aooc,
/client/proc/change_human_appearance_admin, /* Allows an admin to change the basic appearance of human-based mobs */
/client/proc/change_human_appearance_self /* Allows the human-based mob itself change its basic appearance */
/client/proc/change_human_appearance_self, /* Allows the human-based mob itself change its basic appearance */
/client/proc/change_security_level
)
var/list/admin_verbs_ban = list(
/client/proc/unban_panel,
@@ -762,6 +763,17 @@ var/list/admin_verbs_mentor = list(
H.change_appearance(APPEARANCE_ALL, H.loc, check_species_whitelist = 1)
feedback_add_details("admin_verb","CMAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/change_security_level()
set name = "Set security level"
set desc = "Sets the station security level"
set category = "Admin"
if(!check_rights(R_ADMIN)) return
var sec_level = input(usr, "It's currently code [get_security_level()].", "Select Security Level") as null|anything in (list("green","blue","red","delta")-get_security_level())
if(alert("Switch from code [get_security_level()] to code [sec_level]?","Change security level?","Yes","No") == "Yes")
set_security_level(sec_level)
log_admin("[key_name(usr)] changed the security level to code [sec_level].")
//---- bs12 verbs ----
@@ -12,7 +12,7 @@
A << "<br>"
if(prob(30)) //most of the time, we don't want an announcement, so as to allow AIs to fake blackouts.
command_announcement.Announce(alert, new_sound = 'sound/misc/interference.ogg')
command_announcement.Announce(alert, new_sound = sound('sound/misc/interference.ogg', volume=50))
/datum/event/communications_blackout/start()
@@ -57,7 +57,7 @@
FA.overlays += image('icons/obj/monitors.dmi', "overlay_red")
if(SEC_LEVEL_DELTA)
security_announcement_up.Announce("[config.alert_desc_delta]", "Attention! Delta security level reached!")
security_announcement_up.Announce("[config.alert_desc_delta]", "Attention! Delta security level reached!", new_sound = 'sound/effects/siren.ogg')
security_level = SEC_LEVEL_DELTA
for(var/obj/machinery/firealarm/FA in machines)
if(FA.z in config.contact_levels)