diff --git a/baystation12.dme b/baystation12.dme index bf43bcf22a9..f06661917a5 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -167,8 +167,8 @@ #include "code\datums\spells\wizard.dm" #include "code\defines\obj.dm" #include "code\defines\obj\weapon.dm" +#include "code\defines\procs\announce.dm" #include "code\defines\procs\AStar.dm" -#include "code\defines\procs\captain_announce.dm" #include "code\defines\procs\command_alert.dm" #include "code\defines\procs\dbcore.dm" #include "code\defines\procs\sd_Alert.dm" diff --git a/code/WorkInProgress/computer3/computers/communications.dm b/code/WorkInProgress/computer3/computers/communications.dm index 20c29aaec43..16123e42e70 100644 --- a/code/WorkInProgress/computer3/computers/communications.dm +++ b/code/WorkInProgress/computer3/computers/communications.dm @@ -43,6 +43,12 @@ var/stat_msg1 var/stat_msg2 + var/datum/announcement/priority/crew_announcement = new + + New() + ..() + crew_announcement.newscast = 1 + Reset() ..() authenticated = 0 @@ -68,11 +74,13 @@ authenticated = 1 if(access_captain in I.GetAccess()) authenticated = 2 + crew_announcement.announcer = GetNameAndAssignmentFromId(I) if(istype(I,/obj/item/weapon/card/emag)) authenticated = 2 computer.emagged = 1 if("logout" in href_list) authenticated = 0 + crew_announcement.announcer = "" if("swipeidseclevel" in href_list) var/mob/M = usr @@ -104,13 +112,13 @@ usr << "You need to swipe your ID." if("announce" in href_list) if(authenticated==2) - if(message_cooldown) return - var/input = stripped_input(usr, "Please choose a message to announce to the station crew.", "What?") + if(message_cooldown) + usr << "Please allow at least one minute to pass between announcements" + return + var/input = stripped_input(usr, "Please write a message to announce to the station crew.", "Priority Announcement") if(!input || !interactable()) return - captain_announce(input)//This should really tell who is, IE HoP, CE, HoS, RD, Captain - log_say("[key_name(usr)] has made a captain announcement: [input]") - message_admins("[key_name_admin(usr)] has made a captain announcement.", 1) + crew_announcement.Announce(input) message_cooldown = 1 spawn(600)//One minute cooldown message_cooldown = 0 diff --git a/code/WorkInProgress/periodic_news.dm b/code/WorkInProgress/periodic_news.dm index 90eb2e3742d..f4dd9f322e3 100644 --- a/code/WorkInProgress/periodic_news.dm +++ b/code/WorkInProgress/periodic_news.dm @@ -8,6 +8,7 @@ author = "NanoTrasen Editor" channel_name = "Nyx Daily" can_be_redacted = 0 + message_type = "Story" revolution_inciting_event @@ -134,6 +135,7 @@ proc/announce_newscaster_news(datum/news_announcement/news) 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) diff --git a/code/controllers/emergency_shuttle_controller.dm b/code/controllers/emergency_shuttle_controller.dm index 51a063057c0..aae9cd58296 100644 --- a/code/controllers/emergency_shuttle_controller.dm +++ b/code/controllers/emergency_shuttle_controller.dm @@ -7,17 +7,20 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle /datum/emergency_shuttle_controller var/datum/shuttle/ferry/emergency/shuttle var/list/escape_pods - + var/launch_time //the time at which the shuttle will be launched var/auto_recall = 0 //if set, the shuttle will be auto-recalled var/auto_recall_time //the time at which the shuttle will be auto-recalled var/evac = 0 //1 = emergency evacuation, 0 = crew transfer var/wait_for_launch = 0 //if the shuttle is waiting to launch var/autopilot = 1 //set to 0 to disable the shuttle automatically launching - + var/deny_shuttle = 0 //allows admins to prevent the shuttle from being called var/departed = 0 //if the shuttle has left the station at least once + var/datum/announcement/priority/emergency_shuttle_docked = new(0, new_sound = sound('sound/AI/shuttledock.ogg')) + var/datum/announcement/priority/emergency_shuttle_called = new(0, new_sound = sound('sound/AI/shuttlecalled.ogg')) + var/datum/announcement/priority/emergency_shuttle_recalled = new(0, new_sound = sound('sound/AI/shuttlerecalled.ogg')) /datum/emergency_shuttle_controller/proc/process() if (wait_for_launch) @@ -25,28 +28,28 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle recall() if (world.time >= launch_time) //time to launch the shuttle stop_launch_countdown() - + if (!shuttle.location) //leaving from the station //launch the pods! for (var/datum/shuttle/ferry/escape_pod/pod in escape_pods) if (!pod.arming_controller || pod.arming_controller.armed) pod.launch(src) - + if (autopilot) shuttle.launch(src) //called when the shuttle has arrived. + /datum/emergency_shuttle_controller/proc/shuttle_arrived() if (!shuttle.location) //at station if (autopilot) set_launch_countdown(SHUTTLE_LEAVETIME) //get ready to return - + if (evac) - captain_announce("The Emergency Shuttle has docked with the station. You have approximately [round(estimate_launch_time()/60,1)] minutes to board the Emergency Shuttle.") - world << sound('sound/AI/shuttledock.ogg') + emergency_shuttle_docked.Announce("The Emergency Shuttle has docked with the station. You have approximately [round(estimate_launch_time()/60,1)] minutes to board the Emergency Shuttle.") else - captain_announce("The scheduled Crew Transfer Shuttle has docked with the station. It will depart in approximately [round(emergency_shuttle.estimate_launch_time()/60,1)] minutes.") - + priority_announcement.Announce("The scheduled Crew Transfer Shuttle has docked with the station. It will depart in approximately [round(emergency_shuttle.estimate_launch_time()/60,1)] minutes.") + //arm the escape pods if (evac) for (var/datum/shuttle/ferry/escape_pod/pod in escape_pods) @@ -64,18 +67,17 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle //calls the shuttle for an emergency evacuation /datum/emergency_shuttle_controller/proc/call_evac() if(!can_call()) return - + //set the launch timer autopilot = 1 set_launch_countdown(get_shuttle_prep_time()) auto_recall_time = rand(world.time + 300, launch_time - 300) - + //reset the shuttle transit time if we need to shuttle.move_time = SHUTTLE_TRANSIT_DURATION - + evac = 1 - captain_announce("An emergency evacuation shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.") - world << sound('sound/AI/shuttlecalled.ogg') + emergency_shuttle_called.Announce("An emergency evacuation shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.") for(var/area/A in world) if(istype(A, /area/hallway)) A.readyalert() @@ -88,11 +90,11 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle autopilot = 1 set_launch_countdown(get_shuttle_prep_time()) auto_recall_time = rand(world.time + 300, launch_time - 300) - + //reset the shuttle transit time if we need to shuttle.move_time = SHUTTLE_TRANSIT_DURATION - - captain_announce("A crew transfer has been scheduled. The shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.") + + priority_announcement.Announce("A crew transfer has been scheduled. The shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.") //recalls the shuttle /datum/emergency_shuttle_controller/proc/recall() @@ -102,15 +104,14 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle shuttle.cancel_launch(src) if (evac) - captain_announce("The emergency shuttle has been recalled.") - world << sound('sound/AI/shuttlerecalled.ogg') - + emergency_shuttle_recalled.Announce("The emergency shuttle has been recalled.") + for(var/area/A in world) if(istype(A, /area/hallway)) A.readyreset() evac = 0 else - captain_announce("The scheduled crew transfer has been cancelled.") + priority_announcement.Announce("The scheduled crew transfer has been cancelled.") /datum/emergency_shuttle_controller/proc/can_call() if (deny_shuttle) @@ -203,14 +204,14 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle if (shuttle.has_arrive_time()) var/timeleft = emergency_shuttle.estimate_arrival_time() return "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]" - + if (waiting_to_leave()) if (shuttle.moving_status == SHUTTLE_WARMUP) return "Departing..." - + var/timeleft = emergency_shuttle.estimate_launch_time() return "ETD-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]" - + return "" /* Some slapped-together star effects for maximum spess immershuns. Basically consists of a diff --git a/code/defines/procs/announce.dm b/code/defines/procs/announce.dm new file mode 100644 index 00000000000..14a96516eab --- /dev/null +++ b/code/defines/procs/announce.dm @@ -0,0 +1,75 @@ +// A default priority announcement which doesn't log +var/global/datum/announcement/priority/priority_announcement = new(0) + +/datum/announcement + var/title = "Attention" + var/announcer = "" + var/log = 0 + var/sound + var/newscast = 0 + var/channel_name = "Public Station Announcements" + var/announcement_type = "Announcement" + +/datum/announcement/New(var/new_sound = null) + sound = new_sound + +/datum/announcement/priority/New(var/do_log = 1, var/new_sound = sound('sound/items/AirHorn.ogg')) + title = "Priority Announcement" + announcement_type = "Priority Announcement" + log = do_log + sound = new_sound + +/datum/announcement/proc/Announce(message as text) + if (!message) + return + Message(message) + NewsCast(message) + Sound() + Log(message) + +/datum/announcement/proc/Message(message as text) + for(var/mob/M in player_list) + if(!istype(M,/mob/new_player) && !isdeaf(M)) + M << "

[title]

" + M << "[html_encode(message)]" + if (announcer) + M << " -[html_encode(announcer)]" + +/datum/announcement/proc/NewsCast(message as text) + if(!newscast) + return + + var/datum/news_announcement/news = new + news.channel_name = channel_name + news.author = announcer + news.message = message + news.message_type = announcement_type + news.can_be_redacted = 0 + announce_newscaster_news(news) + +/datum/announcement/proc/Sound() + 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/priority/Message(message as text) + world << "

[title]

" + world << "[html_encode(message)]" + if(announcer) + world << " -[html_encode(announcer)]" + world << "
" + +/datum/announcement/priority/Sound() + if(sound) + world << sound + +/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 diff --git a/code/defines/procs/captain_announce.dm b/code/defines/procs/captain_announce.dm deleted file mode 100644 index 092d297a2de..00000000000 --- a/code/defines/procs/captain_announce.dm +++ /dev/null @@ -1,6 +0,0 @@ -/proc/captain_announce(message as text, title = "Priority Announcement", announcer = "") - world << "

[html_encode(title)]

" - world << "[html_encode(message)]" - if(announcer) - world << " -[html_encode(announcer)]" - world << "
" \ No newline at end of file diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 71d3c25a8ce..ad18204a2a5 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -33,7 +33,11 @@ var/stat_msg1 var/stat_msg2 + var/datum/announcement/priority/crew_announcement = new +/obj/machinery/computer/communications/New() + ..() + crew_announcement.newscast = 1 /obj/machinery/computer/communications/process() if(..()) @@ -64,10 +68,12 @@ if (I && istype(I)) if(src.check_access(I)) authenticated = 1 - if(20 in I.access) + if(access_captain in I.access) authenticated = 2 + crew_announcement.announcer = GetNameAndAssignmentFromId(I) if("logout") authenticated = 0 + crew_announcement.announcer = "" if("swipeidseclevel") var/mob/M = usr @@ -101,13 +107,13 @@ if("announce") if(src.authenticated==2) - if(message_cooldown) return - var/input = stripped_input(usr, "Please choose a message to announce to the station crew.", "What?") + if(message_cooldown) + usr << "Please allow at least one minute to pass between announcements" + return + var/input = stripped_input(usr, "Please write a message to announce to the station crew.", "Priority Announcement") if(!input || !(usr in view(1,src))) return - captain_announce(input)//This should really tell who is, IE HoP, CE, HoS, RD, Captain - log_say("[key_name(usr)] has made a captain announcement: [input]") - message_admins("[key_name_admin(usr)] has made a captain announcement.", 1) + crew_announcement.Announce(input) message_cooldown = 1 spawn(600)//One minute cooldown message_cooldown = 0 diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 114d24e57b6..18b8e961866 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -5,6 +5,7 @@ /datum/feed_message var/author ="" var/body ="" + var/message_type ="Story" //var/parent_channel var/backup_body ="" var/backup_author ="" @@ -218,7 +219,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="No feed messages found in channel...

" else for(var/datum/feed_message/MESSAGE in CHANNEL.messages) - dat+="-[MESSAGE.body]
\[Story by [MESSAGE.author]\]
"*/ + dat+="-[MESSAGE.body]
\[[MESSAGE.message_type] by [MESSAGE.author]\]
"*/ dat+="

Refresh" dat+="
Back" @@ -304,7 +305,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co if(MESSAGE.img) usr << browse_rsc(MESSAGE.img, "tmp_photo[i].png") dat+="

" - dat+="\[Story by [MESSAGE.author]\]
" + dat+="\[[MESSAGE.message_type] by [MESSAGE.author]\]
" dat+="

Refresh" dat+="
Back" if(10) @@ -339,7 +340,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="No feed messages found in channel...
" else for(var/datum/feed_message/MESSAGE in src.viewing_channel.messages) - dat+="-[MESSAGE.body]
\[Story by [MESSAGE.author]\]
" + dat+="-[MESSAGE.body]
\[[MESSAGE.message_type] by [MESSAGE.author]\]
" dat+="[(MESSAGE.body == "\[REDACTED\]") ? ("Undo story censorship") : ("Censor story")] - [(MESSAGE.author == "\[REDACTED\]") ? ("Undo Author Censorship") : ("Censor message Author")]
" dat+="
Back" if(13) @@ -353,7 +354,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co dat+="No feed messages found in channel...
" else for(var/datum/feed_message/MESSAGE in src.viewing_channel.messages) - dat+="-[MESSAGE.body]
\[Story by [MESSAGE.author]\]
" + dat+="-[MESSAGE.body]
\[[MESSAGE.message_type] by [MESSAGE.author]\]
" dat+="
Back" if(14) @@ -840,7 +841,7 @@ obj/item/weapon/newspaper/attack_self(mob/user as mob) if(MESSAGE.img) user << browse_rsc(MESSAGE.img, "tmp_photo[i].png") dat+="
" - dat+="\[Story by [MESSAGE.author]\]

" + dat+="\[[MESSAGE.message_type] by [MESSAGE.author]\]

" dat+="" if(scribble_page==curr_page) dat+="
There is a small scribble near the end of this page... It reads: \"[src.scribble]\"" diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 8364a5a666c..f9dd2216df8 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -55,6 +55,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() var/dpt = ""; //the department which will be receiving the message var/priority = -1 ; //Priority of the message being sent luminosity = 0 + var/datum/announcement/announcement = new /obj/machinery/requests_console/power_change() ..() @@ -70,6 +71,10 @@ var/list/obj/machinery/requests_console/allConsoles = list() /obj/machinery/requests_console/New() ..() + + announcement.title = "[department] announcement" + announcement.newscast = 1 + name = "[department] Requests Console" allConsoles += src //req_console_departments += department @@ -189,7 +194,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() else //main menu screen = 0 - announceAuth = 0 + reset_announce() if (newmessagepriority == 1) dat += text("There are new messages
") if (newmessagepriority == 2) @@ -240,17 +245,13 @@ var/list/obj/machinery/requests_console/allConsoles = list() if("2") priority = 2 else priority = -1 else - message = "" - announceAuth = 0 + reset_announce() screen = 0 if(href_list["sendAnnouncement"]) if(!announcementConsole) return - for(var/mob/M in player_list) - if(!istype(M,/mob/new_player)) - M << "[department] announcement: [message]" - announceAuth = 0 - message = "" + announcement.Announce(message) + reset_announce() screen = 0 if( href_list["department"] && message ) @@ -389,8 +390,9 @@ var/list/obj/machinery/requests_console/allConsoles = list() var/obj/item/weapon/card/id/ID = O if (access_RC_announce in ID.GetAccess()) announceAuth = 1 + announcement.announcer = ID.assignment ? "[ID.assignment] [ID.registered_name]" : ID.registered_name else - announceAuth = 0 + reset_announce() user << "\red You are not authorized to send announcements." updateUsrDialog() if (istype(O, /obj/item/weapon/stamp)) @@ -399,3 +401,8 @@ var/list/obj/machinery/requests_console/allConsoles = list() msgStamped = text("Stamped with the [T.name]") updateUsrDialog() return + +/obj/machinery/requests_console/proc/reset_announce() + announceAuth = 0 + message = "" + announcement.announcer = "" diff --git a/code/modules/economy/economy_misc.dm b/code/modules/economy/economy_misc.dm index 4c9cfeb5347..02d3a4e0e2b 100644 --- a/code/modules/economy/economy_misc.dm +++ b/code/modules/economy/economy_misc.dm @@ -78,6 +78,13 @@ var/global/economy_init = 0 return 2 var/datum/feed_channel/newChannel = new /datum/feed_channel + newChannel.channel_name = "Public Station Announcements" + newChannel.author = "Automated Announcement Listing" + newChannel.locked = 1 + newChannel.is_admin_channel = 1 + news_network.network_channels += newChannel + + newChannel = new /datum/feed_channel newChannel.channel_name = "Nyx Daily" newChannel.author = "CentComm Minister of Information" newChannel.locked = 1 diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 758883dfff7..ffde99ea19b 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -76,6 +76,7 @@ var/list/ai_verbs_default = list( var/camera_light_on = 0 //Defines if the AI toggled the light on the camera it's looking through. var/datum/trackable/track = null var/last_announcement = "" + var/datum/announcement/priority/announcement /mob/living/silicon/ai/proc/add_ai_verbs() src.verbs += ai_verbs_default @@ -167,6 +168,9 @@ 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 ..() @@ -321,7 +325,7 @@ var/list/ai_verbs_default = list( if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO)) return - captain_announce(input, "A.I. Announcement", src.name) + 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 diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 388f2bf7a4b..6b9f0f2d8f9 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -115,6 +115,12 @@ proc/isorgan(A) return 1 return 0 +proc/isdeaf(A) + if(istype(A, /mob)) + var/mob/M = A + return (M.sdisabilities & DEAF) || M.ear_deaf + return 0 + proc/hasorgans(A) return ishuman(A) @@ -317,11 +323,11 @@ It's fairly easy to fix if dealing with single letters but not so much with comp /proc/shake_camera(mob/M, duration, strength=1) - if(!M || !M.client || M.shakecamera) + if(!M || !M.client || M.shakecamera) return M.shakecamera = 1 spawn(1) - + var/atom/oldeye=M.client.eye var/aiEyeFlag = 0 if(istype(oldeye, /mob/aiEye)) diff --git a/code/modules/shuttles/shuttle_emergency.dm b/code/modules/shuttles/shuttle_emergency.dm index c7fff897e6d..30dbacecaa4 100644 --- a/code/modules/shuttles/shuttle_emergency.dm +++ b/code/modules/shuttles/shuttle_emergency.dm @@ -6,7 +6,7 @@ if (istype(in_use, /obj/machinery/computer/shuttle_control/emergency)) var/obj/machinery/computer/shuttle_control/emergency/C = in_use C.reset_authorization() - + emergency_shuttle.shuttle_arrived() /datum/shuttle/ferry/emergency/long_jump(var/area/departing, var/area/destination, var/area/interim, var/travel_time, var/direction) @@ -26,9 +26,9 @@ emergency_shuttle.departed = 1 if (emergency_shuttle.evac) - captain_announce("The Emergency Shuttle has left the station. Estimate [round(emergency_shuttle.estimate_arrival_time()/60,1)] minutes until the shuttle docks at Central Command.") + priority_announcement.Announce("The Emergency Shuttle has left the station. Estimate [round(emergency_shuttle.estimate_arrival_time()/60,1)] minutes until the shuttle docks at Central Command.") else - captain_announce("The Crew Transfer Shuttle has left the station. Estimate [round(emergency_shuttle.estimate_arrival_time()/60,1)] minutes until the shuttle docks at Central Command.") + priority_announcement.Announce("The Crew Transfer Shuttle has left the station. Estimate [round(emergency_shuttle.estimate_arrival_time()/60,1)] minutes until the shuttle docks at Central Command.") ..(origin, destination) @@ -42,7 +42,7 @@ /datum/shuttle/ferry/emergency/can_force(var/user) if (istype(user, /obj/machinery/computer/shuttle_control/emergency)) var/obj/machinery/computer/shuttle_control/emergency/C = user - + //initiating or cancelling a launch ALWAYS requires authorization, but if we are already set to launch anyways than forcing does not. //this is so that people can force launch if the docking controller cannot safely undock without needing X heads to swipe. if (process_state != WAIT_LAUNCH && !C.has_authorization()) @@ -226,7 +226,7 @@ if(href_list["removeid"]) var/dna_hash = href_list["removeid"] authorized -= dna_hash - + if(!emagged && href_list["scanid"]) //They selected an empty entry. Try to scan their id. if (ishuman(usr))