Expands the use of the new announcement system.

Code Green/Blue/Red/Delta, ERT, and captain annoncements now use the new announcement system.
These announcements are stored as newscasts.
This commit is contained in:
PsiOmega
2014-08-21 11:17:18 +02:00
parent 68bf885e6b
commit f9df93fad0
7 changed files with 109 additions and 73 deletions
+19 -13
View File
@@ -86,6 +86,11 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/New(loc, var/datum/ai_laws/L, var/obj/item/device/mmi/B, var/safety = 0)
announcement = new()
announcement.title = "A.I. Announcement"
announcement.announcement_type = "A.I. Announcement"
announcement.newscast = 1
var/list/possibleNames = ai_names
var/pickedName = null
@@ -96,8 +101,8 @@ var/list/ai_verbs_default = list(
possibleNames -= pickedName
pickedName = null
real_name = pickedName
name = real_name
aiPDA = new/obj/item/device/pda/ai(src)
SetName(pickedName)
anchored = 1
canmove = 0
density = 1
@@ -113,11 +118,6 @@ var/list/ai_verbs_default = list(
else
laws = new base_law_type
aiPDA = new/obj/item/device/pda/ai(src)
aiPDA.owner = name
aiPDA.ownjob = "AI"
aiPDA.name = name + " (" + aiPDA.ownjob + ")"
aiMulti = new(src)
aiRadio = new(src)
aiRadio.myAi = src
@@ -168,10 +168,6 @@ var/list/ai_verbs_default = list(
hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
announcement = new()
announcement.announcer = name
announcement.title = "A.I. announcement"
ai_list += src
..()
return
@@ -180,6 +176,18 @@ var/list/ai_verbs_default = list(
ai_list -= src
..()
/mob/living/silicon/ai/proc/SetName(pickedName as text)
real_name = pickedName
name = pickedName
announcement.announcer = pickedName
if(eyeobj)
eyeobj.name = "[pickedName] (AI Eye)"
// Set ai pda name
if(aiPDA)
aiPDA.ownjob = "AI"
aiPDA.owner = pickedName
aiPDA.name = pickedName + " (" + aiPDA.ownjob + ")"
/*
The AI Power supply is a dummy object used for powering the AI since only machinery should be using power.
@@ -326,8 +334,6 @@ var/list/ai_verbs_default = list(
return
announcement.Announce(input)
log_say("[key_name(usr)] has made an AI announcement: [input]")
message_admins("[key_name_admin(usr)] has made an AI announcement.", 1)
message_cooldown = 1
spawn(600)//One minute cooldown
message_cooldown = 0
@@ -21,8 +21,7 @@
if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != security_level)
switch(level)
if(SEC_LEVEL_GREEN)
world << "<font size=4 color='red'>Attention! Security level lowered to green</font>"
world << "<font color='red'>[config.alert_desc_green]</font>"
security_announcement.Announce("[config.alert_desc_green]", "Attention! Security level lowered to green")
security_level = SEC_LEVEL_GREEN
for(var/obj/machinery/firealarm/FA in machines)
if(FA.z == 1 || FA.z == 5)
@@ -30,11 +29,9 @@
FA.overlays += image('icons/obj/monitors.dmi', "overlay_green")
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'>[config.alert_desc_blue_upto]</font>"
security_announcement.Announce("[config.alert_desc_blue_upto]", "Attention! Security level elevated to blue")
else
world << "<font size=4 color='red'>Attention! Security level lowered to blue</font>"
world << "<font color='red'>[config.alert_desc_blue_downto]</font>"
security_announcement.Announce("[config.alert_desc_blue_downto]", "Attention! Security level lowered to blue")
security_level = SEC_LEVEL_BLUE
for(var/obj/machinery/firealarm/FA in machines)
if(FA.z == 1 || FA.z == 5)
@@ -42,11 +39,9 @@
FA.overlays += image('icons/obj/monitors.dmi', "overlay_blue")
if(SEC_LEVEL_RED)
if(security_level < SEC_LEVEL_RED)
world << "<font size=4 color='red'>Attention! Code red!</font>"
world << "<font color='red'>[config.alert_desc_red_upto]</font>"
security_announcement.Announce("[config.alert_desc_red_upto]", "Attention! Code red!")
else
world << "<font size=4 color='red'>Attention! Code red!</font>"
world << "<font color='red'>[config.alert_desc_red_downto]</font>"
security_announcement.Announce("[config.alert_desc_red_downto]", "Attention! Code red!")
security_level = SEC_LEVEL_RED
/* - At the time of commit, setting status displays didn't work properly
@@ -60,8 +55,7 @@
FA.overlays += image('icons/obj/monitors.dmi', "overlay_red")
if(SEC_LEVEL_DELTA)
world << "<font size=4 color='red'>Attention! Delta security level reached!</font>"
world << "<font color='red'>[config.alert_desc_delta]</font>"
security_announcement.Announce("[config.alert_desc_delta]", "Attention! Delta security level reached!")
security_level = SEC_LEVEL_DELTA
for(var/obj/machinery/firealarm/FA in machines)
if(FA.z == 1 || FA.z == 5)