diff --git a/code/WorkInProgress/periodic_news.dm b/code/WorkInProgress/periodic_news.dm
index f4dd9f322e..22335e4a67 100644
--- a/code/WorkInProgress/periodic_news.dm
+++ b/code/WorkInProgress/periodic_news.dm
@@ -129,14 +129,6 @@ proc/check_for_newscaster_updates(type)
announce_newscaster_news(news)
proc/announce_newscaster_news(datum/news_announcement/news)
-
- var/datum/feed_message/newMsg = new /datum/feed_message
- newMsg.author = news.author
- newMsg.is_admin_message = !news.can_be_redacted
-
- newMsg.body = news.message
- newMsg.message_type = news.message_type
-
var/datum/feed_channel/sendto
for(var/datum/feed_channel/FC in news_network.network_channels)
if(FC.channel_name == news.channel_name)
@@ -151,6 +143,12 @@ proc/announce_newscaster_news(datum/news_announcement/news)
sendto.is_admin_channel = 1
news_network.network_channels += sendto
+ var/datum/feed_message/newMsg = new /datum/feed_message
+ newMsg.author = news.author ? news.author : sendto.author
+ newMsg.is_admin_message = !news.can_be_redacted
+ newMsg.body = news.message
+ newMsg.message_type = news.message_type
+
sendto.messages += newMsg
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index 5ed7a675d5..bc1afd8778 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -330,13 +330,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
//world << "[newname] is the AI!"
//world << sound('sound/AI/newAI.ogg')
// Set eyeobj name
- if(A.eyeobj)
- A.eyeobj.name = "[newname] (AI Eye)"
-
- // Set ai pda name
- if(A.aiPDA)
- A.aiPDA.owner = newname
- A.aiPDA.name = newname + " (" + A.aiPDA.ownjob + ")"
+ A.SetName(newname)
fully_replace_character_name(oldname,newname)
diff --git a/code/defines/procs/announce.dm b/code/defines/procs/announce.dm
index 14a96516ea..cc58307c9d 100644
--- a/code/defines/procs/announce.dm
+++ b/code/defines/procs/announce.dm
@@ -1,5 +1,6 @@
-// A default priority announcement which doesn't log
-var/global/datum/announcement/priority/priority_announcement = new(0)
+/var/datum/announcement/priority/priority_announcement = new(do_log = 0)
+/var/datum/announcement/priority/command/command_announcement = new(do_log = 0, do_newscast = 1)
+/var/datum/announcement/priority/security/security_announcement = new(do_log = 0, do_newscast = 1)
/datum/announcement
var/title = "Attention"
@@ -10,32 +11,74 @@ var/global/datum/announcement/priority/priority_announcement = new(0)
var/channel_name = "Public Station Announcements"
var/announcement_type = "Announcement"
-/datum/announcement/New(var/new_sound = null)
+/datum/announcement/New(var/do_log = 0, var/new_sound = null, var/do_newscast = 0)
sound = new_sound
+ log = do_log
+ newscast = do_newscast
-/datum/announcement/priority/New(var/do_log = 1, var/new_sound = sound('sound/items/AirHorn.ogg'))
+/datum/announcement/priority/New(var/do_log = 1, var/new_sound = sound('sound/items/AirHorn.ogg'), var/do_newscast = 0)
+ ..(do_log, new_sound, do_newscast)
title = "Priority Announcement"
announcement_type = "Priority Announcement"
- log = do_log
- sound = new_sound
-/datum/announcement/proc/Announce(message as text)
- if (!message)
+/datum/announcement/priority/command/New(var/do_log = 1, var/new_sound = sound('sound/items/AirHorn.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/items/AirHorn.ogg'), var/do_newscast = 0)
+ ..(do_log, new_sound, do_newscast)
+ title = "Security Announcement"
+ announcement_type = "Security Announcement"
+
+/datum/announcement/proc/Announce(var/message as text, var/new_title = "")
+ if(!message)
return
- Message(message)
- NewsCast(message)
- Sound()
- Log(message)
+ var/tmp/message_title = new_title ? new_title : title
-/datum/announcement/proc/Message(message as text)
+ message = html_encode(message)
+ message_title = html_encode(message_title)
+
+ Message(message, message_title)
+ NewsCast(message, message_title)
+ Sound()
+ Log(message, message_title)
+
+datum/announcement/proc/Message(message as text, message_title as text)
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player) && !isdeaf(M))
M << "
[title]
"
- M << "[html_encode(message)]"
+ M << "[message]"
if (announcer)
M << " -[html_encode(announcer)]"
-/datum/announcement/proc/NewsCast(message as text)
+datum/announcement/minor/Message(message as text, message_title as text)
+ world << "[message]"
+
+datum/announcement/priority/Message(message as text, message_title as text)
+ world << "[message_title]
"
+ world << "[message]"
+ if(announcer)
+ world << " -[html_encode(announcer)]"
+ world << "
"
+
+datum/announcement/priority/command/Message(message as text, message_title as text)
+ var/command
+ command += "[command_name()] Update
"
+ if (message_title)
+ command += "
[message_title]
"
+
+ command += "
[message]
"
+ command += "
"
+ for(var/mob/M in player_list)
+ if(!istype(M,/mob/new_player) && !isdeaf(M))
+ M << command
+
+datum/announcement/priority/security/Message(message as text, message_title as text)
+ world << "[message_title]"
+ world << "[message]"
+
+datum/announcement/proc/NewsCast(message as text, message_title as text)
if(!newscast)
return
@@ -47,29 +90,28 @@ var/global/datum/announcement/priority/priority_announcement = new(0)
news.can_be_redacted = 0
announce_newscaster_news(news)
-/datum/announcement/proc/Sound()
+datum/announcement/proc/PlaySound()
if(!sound)
return
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player) && !isdeaf(M))
M << sound
-/datum/announcement/proc/Log(message as text)
- if(log)
- log_say("[key_name(usr)] has made a(n) [announcement_type]: [title] - [message] - [announcer]")
- message_admins("[key_name_admin(usr)] has made a(n) [announcement_type].", 1)
+datum/announcement/proc/Sound()
+ PlaySound()
-/datum/announcement/priority/Message(message as text)
- world << "[title]
"
- world << "[html_encode(message)]"
- if(announcer)
- world << " -[html_encode(announcer)]"
- world << "
"
-
-/datum/announcement/priority/Sound()
+datum/announcement/priority/Sound()
if(sound)
world << sound
+datum/announcement/priority/command/Sound()
+ PlaySound()
+
+datum/announcement/proc/Log(message as text, message_title as text)
+ if(log)
+ log_say("[key_name(usr)] has made a(n) [announcement_type]: [message_title] - [message] - [announcer]")
+ message_admins("[key_name_admin(usr)] has made a(n) [announcement_type].", 1)
+
/proc/GetNameAndAssignmentFromId(var/obj/item/weapon/card/id/I)
- // Formant currently matches that of newscaster feeds.
- return I.assignment ? "[I.registered_name] ([I.assignment])" : I.registered_name
\ No newline at end of file
+ // Format currently matches that of newscaster feeds: Registered Name (Assigned Rank)
+ return I.assignment ? "[I.registered_name] ([I.assignment])" : I.registered_name
diff --git a/code/game/jobs/job/captain.dm b/code/game/jobs/job/captain.dm
index 3f141f2156..c75a2a759a 100644
--- a/code/game/jobs/job/captain.dm
+++ b/code/game/jobs/job/captain.dm
@@ -1,3 +1,5 @@
+var/datum/announcement/minor/captain_announcement = new(do_newscast = 1)
+
/datum/job/captain
title = "Captain"
flag = CAPTAIN
@@ -32,7 +34,7 @@
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/ids(H), slot_r_hand)
else
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/ids(H.back), slot_in_backpack)
- world << "[H.real_name] is the captain!"
+ captain_announcement.Announce("All hands, captain [H.real_name] on deck!")
H.implant_loyalty(src)
diff --git a/code/game/response_team.dm b/code/game/response_team.dm
index ce719f6c68..24fd31ed7d 100644
--- a/code/game/response_team.dm
+++ b/code/game/response_team.dm
@@ -133,11 +133,11 @@ proc/trigger_armed_response_team(var/force = 0)
// there's only a certain chance a team will be sent
if(!prob(send_team_chance))
- command_alert("It would appear that an emergency response team was requested for [station_name()]. Unfortunately, we were unable to send one at this time.", "Central Command")
+ command_announcement.Announce("It would appear that an emergency response team was requested for [station_name()]. Unfortunately, we were unable to send one at this time.", "Central Command")
can_call_ert = 0 // Only one call per round, ladies.
return
- command_alert("It would appear that an emergency response team was requested for [station_name()]. We will prepare and send one as soon as possible.", "Central Command")
+ command_announcement.Announce("It would appear that an emergency response team was requested for [station_name()]. We will prepare and send one as soon as possible.", "Central Command")
can_call_ert = 0 // Only one call per round, gentleman.
send_emergency_team = 1
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index ffde99ea19..356ac165fb 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -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
diff --git a/code/modules/security levels/security levels.dm b/code/modules/security levels/security levels.dm
index b0cc3d1c92..2037ef78e5 100644
--- a/code/modules/security levels/security levels.dm
+++ b/code/modules/security levels/security levels.dm
@@ -21,8 +21,7 @@
if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != security_level)
switch(level)
if(SEC_LEVEL_GREEN)
- world << "Attention! Security level lowered to green"
- world << "[config.alert_desc_green]"
+ 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 << "Attention! Security level elevated to blue"
- world << "[config.alert_desc_blue_upto]"
+ security_announcement.Announce("[config.alert_desc_blue_upto]", "Attention! Security level elevated to blue")
else
- world << "Attention! Security level lowered to blue"
- world << "[config.alert_desc_blue_downto]"
+ 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 << "Attention! Code red!"
- world << "[config.alert_desc_red_upto]"
+ security_announcement.Announce("[config.alert_desc_red_upto]", "Attention! Code red!")
else
- world << "Attention! Code red!"
- world << "[config.alert_desc_red_downto]"
+ 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 << "Attention! Delta security level reached!"
- world << "[config.alert_desc_delta]"
+ 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)