diff --git a/aurorastation.dme b/aurorastation.dme index a850533adfd..91446866250 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -558,7 +558,6 @@ #include "code\game\machinery\computer\buildandrepair.dm" #include "code\game\machinery\computer\camera.dm" #include "code\game\machinery\computer\cloning.dm" -#include "code\game\machinery\computer\communications.dm" #include "code\game\machinery\computer\computer.dm" #include "code\game\machinery\computer\crew.dm" #include "code\game\machinery\computer\guestpass.dm" diff --git a/code/datums/api.dm b/code/datums/api.dm index 5b43b723903..6fad9965e00 100644 --- a/code/datums/api.dm +++ b/code/datums/api.dm @@ -879,17 +879,6 @@ proc/api_update_command_database() if(!reportannounce) reportannounce = 1 - //Send the message to the communications consoles - for (var/obj/machinery/computer/communications/C in SSmachinery.processing_machines) - if(! (C.stat & (BROKEN|NOPOWER) ) ) - var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( C.loc ) - P.name = "[command_name()] Update" - P.info = reportbody - P.update_space(P.info) - P.update_icon() - C.messagetitle.Add("[command_name()] Update") - C.messagetext.Add(P.info) - //Set the report footer for CCIA Announcements if (reporttype == "ccia") if (reportsender) @@ -897,6 +886,9 @@ proc/api_update_command_database() else reportbody += "

- CCIAAMS, [commstation_name()]" + //Send the message to the communications consoles + post_comm_message(reporttitle, reportbody) + if(reportannounce == 1) command_announcement.Announce(reportbody, reporttitle, new_sound = 'sound/AI/commandreport.ogg', do_newscast = 1, msg_sanitized = 1); if(reportannounce == 0) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm deleted file mode 100644 index 06a6347e3d2..00000000000 --- a/code/game/machinery/computer/communications.dm +++ /dev/null @@ -1,554 +0,0 @@ -//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 - -// The communications computer -/obj/machinery/computer/communications - name = "command and communications console" - desc = "Used to command and control the station. Can relay long-range communications." - - icon_screen = "comm" - light_color = "#0099ff" - req_access = list(access_heads) - circuit = /obj/item/weapon/circuitboard/communications - var/prints_intercept = 1 - var/authenticated = 0 - var/list/messagetitle = list() - var/list/messagetext = list() - var/currmsg = 0 - var/aicurrmsg = 0 - var/state = STATE_DEFAULT - var/aistate = STATE_DEFAULT - var/message_cooldown = 0 - var/centcomm_message_cooldown = 0 - var/tmp_alertlevel = 0 - var/const/STATE_DEFAULT = 1 - var/const/STATE_CALLSHUTTLE = 2 - var/const/STATE_CANCELSHUTTLE = 3 - var/const/STATE_MESSAGELIST = 4 - var/const/STATE_VIEWMESSAGE = 5 - var/const/STATE_DELMESSAGE = 6 - var/const/STATE_STATUSDISPLAY = 7 - var/const/STATE_ALERT_LEVEL = 8 - var/const/STATE_CONFIRM_LEVEL = 9 - var/const/STATE_CREWTRANSFER = 10 - - var/status_display_freq = "1435" - var/stat_msg1 - var/stat_msg2 - - var/datum/announcement/priority/crew_announcement - -/obj/machinery/computer/communications/Initialize() - . = ..() - crew_announcement = new - crew_announcement.newscast = 1 - -/obj/machinery/computer/communications/machinery_process() - if(operable()) - if(state != STATE_STATUSDISPLAY) - src.updateDialog() - - -/obj/machinery/computer/communications/Topic(href, href_list) - if(..()) - return 1 - - usr.set_machine(src) - - if(!href_list["operation"]) - return - switch(href_list["operation"]) - // main interface - if("main") - src.state = STATE_DEFAULT - if("login") - var/mob/M = usr - var/obj/item/weapon/card/id/I = M.get_active_hand() - if (istype(I, /obj/item/device/pda)) - var/obj/item/device/pda/pda = I - I = pda.id - if (I && istype(I)) - if(src.check_access(I)) - authenticated = 1 - //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 - var/obj/item/weapon/card/id/I = M.get_active_hand() - if (istype(I, /obj/item/device/pda)) - var/obj/item/device/pda/pda = I - I = pda.id - if (I && istype(I)) - if(access_heads in I.access) //Let heads change the alert level. - var/old_level = security_level - if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN - if(tmp_alertlevel < SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN - if(tmp_alertlevel > SEC_LEVEL_BLUE) tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this - set_security_level(tmp_alertlevel) - if(security_level != old_level) - //Only notify the admins if an actual change happened - log_game("[key_name(usr)] has changed the security level to [get_security_level()].",ckey=key_name(usr)) - message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].") - switch(security_level) - if(SEC_LEVEL_GREEN) - feedback_inc("alert_comms_green",1) - if(SEC_LEVEL_BLUE) - feedback_inc("alert_comms_blue",1) - tmp_alertlevel = 0 - else: - usr << "You are not authorized to do this." - tmp_alertlevel = 0 - state = STATE_DEFAULT - else - usr << "You need to swipe your ID." - - if("announce") - if(src.authenticated==1) - if(message_cooldown) - usr << "Please allow at least one minute to pass between announcements" - return - var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement") - if(!input || !(usr in view(1,src))) - return - crew_announcement.Announce(input) - message_cooldown = 1 - spawn(600)//One minute cooldown - message_cooldown = 0 - - if("callshuttle") - src.state = STATE_DEFAULT - if(src.authenticated) - src.state = STATE_CALLSHUTTLE - if("callshuttle2") - if(src.authenticated) - call_shuttle_proc(usr) - if(emergency_shuttle.online()) - post_status("shuttle") - src.state = STATE_DEFAULT - if("cancelshuttle") - src.state = STATE_DEFAULT - if(src.authenticated) - src.state = STATE_CANCELSHUTTLE - if("cancelshuttle2") - if(src.authenticated) - cancel_call_proc(usr) - src.state = STATE_DEFAULT - if("messagelist") - src.currmsg = 0 - src.state = STATE_MESSAGELIST - if("viewmessage") - src.state = STATE_VIEWMESSAGE - if (!src.currmsg) - if(href_list["message-num"]) - src.currmsg = text2num(href_list["message-num"]) - else - src.state = STATE_MESSAGELIST - if("delmessage") - src.state = (src.currmsg) ? STATE_DELMESSAGE : STATE_MESSAGELIST - if("delmessage2") - if(src.authenticated) - if(src.currmsg) - var/title = src.messagetitle[src.currmsg] - var/text = src.messagetext[src.currmsg] - src.messagetitle.Remove(title) - src.messagetext.Remove(text) - if(src.currmsg == src.aicurrmsg) - src.aicurrmsg = 0 - src.currmsg = 0 - src.state = STATE_MESSAGELIST - else - src.state = STATE_VIEWMESSAGE - if("status") - src.state = STATE_STATUSDISPLAY - - // Status display stuff - if("setstat") - switch(href_list["statdisp"]) - if("message") - post_status("message", stat_msg1, stat_msg2) - if("alert") - post_status("alert", href_list["alert"]) - else - post_status(href_list["statdisp"]) - - if("setmsg1") - stat_msg1 = reject_bad_text(sanitize(input("Line 1", "Enter Message Text", stat_msg1) as text|null, 40), 40) - src.updateDialog() - if("setmsg2") - stat_msg2 = reject_bad_text(sanitize(input("Line 2", "Enter Message Text", stat_msg2) as text|null, 40), 40) - src.updateDialog() - - // OMG CENTCOMM LETTERHEAD - if("MessageCentcomm") - if(src.authenticated==1) - if(centcomm_message_cooldown) - usr << "Arrays recycling. Please stand by." - return - if(!is_relay_online())//Contact Centcom has a check, Syndie doesn't to allow for Traitor funs. - usr <<"No Emergency Bluespace Relay detected. Unable to transmit message." - return - var/input = sanitize(input("Please choose a message to transmit to [boss_short] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "")) - if(!input || !(usr in view(1,src))) - return - Centcomm_announce(input, usr) - usr << "Message transmitted." - log_say("[key_name(usr)] has made an IA [boss_short] announcement: [input]",ckey=key_name(usr)) - centcomm_message_cooldown = 1 - spawn(300)//30 second cooldown - centcomm_message_cooldown = 0 - - - // OMG SYNDICATE ...LETTERHEAD - if("MessageSyndicate") - if((src.authenticated==1) && (src.emagged)) - if(centcomm_message_cooldown) - usr << "Arrays recycling. Please stand by." - return - var/input = sanitize(input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "")) - if(!input || !(usr in view(1,src))) - return - Syndicate_announce(input, usr) - usr << "Message transmitted." - log_say("[key_name(usr)] has made an illegal announcement: [input]",ckey=key_name(usr)) - centcomm_message_cooldown = 1 - spawn(300)//10 minute cooldown - centcomm_message_cooldown = 0 - - if("RestoreBackup") - usr << "Backup routing data restored!" - src.emagged = 0 - src.updateDialog() - - - - // AI interface - if("ai-main") - src.aicurrmsg = 0 - src.aistate = STATE_DEFAULT - if("ai-callshuttle") - src.aistate = STATE_CALLSHUTTLE - if("ai-callshuttle2") - call_shuttle_proc(usr) - src.aistate = STATE_DEFAULT - if("ai-messagelist") - src.aicurrmsg = 0 - src.aistate = STATE_MESSAGELIST - if("ai-viewmessage") - src.aistate = STATE_VIEWMESSAGE - if (!src.aicurrmsg) - if(href_list["message-num"]) - src.aicurrmsg = text2num(href_list["message-num"]) - else - src.aistate = STATE_MESSAGELIST - if("ai-delmessage") - src.aistate = (src.aicurrmsg) ? STATE_DELMESSAGE : STATE_MESSAGELIST - if("ai-delmessage2") - if(src.aicurrmsg) - var/title = src.messagetitle[src.aicurrmsg] - var/text = src.messagetext[src.aicurrmsg] - src.messagetitle.Remove(title) - src.messagetext.Remove(text) - if(src.currmsg == src.aicurrmsg) - src.currmsg = 0 - src.aicurrmsg = 0 - src.aistate = STATE_MESSAGELIST - if("ai-status") - src.aistate = STATE_STATUSDISPLAY - - if("securitylevel") - src.tmp_alertlevel = text2num( href_list["newalertlevel"] ) - if(!tmp_alertlevel) tmp_alertlevel = 0 - state = STATE_CONFIRM_LEVEL - - if("changeseclevel") - state = STATE_ALERT_LEVEL - - - - src.updateUsrDialog() - -/obj/machinery/computer/communications/emag_act(var/remaining_charges, var/mob/user) - if(!emagged) - src.emagged = 1 - user << "You scramble the communication routing circuits!" - return 1 - -/obj/machinery/computer/communications/attack_ai(var/mob/user as mob) - return src.attack_hand(user) - -/obj/machinery/computer/communications/attack_hand(var/mob/user as mob) - if(..()) - return - - user.set_machine(src) - var/dat = "Communications Console" - if (emergency_shuttle.has_eta()) - var/timeleft = emergency_shuttle.estimate_arrival_time() - dat += "Emergency shuttle\n
\nETA: [timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]
" - - if (istype(user, /mob/living/silicon)) - var/dat2 = src.interact_ai(user) // give the AI a different interact proc to limit its access - if(dat2) - dat += dat2 - user << browse(dat, "window=communications;size=400x500") - onclose(user, "communications") - return - - switch(src.state) - if(STATE_DEFAULT) - if (src.authenticated) - dat += "
\[ Log Out \]" - if (src.authenticated==1) - dat += "
\[ Make An Announcement \]" - if(src.emagged == 0) - dat += "
\[ Send an emergency message to [boss_short] \]" - else - dat += "
\[ Send an emergency message to \[UNKNOWN\] \]" - dat += "
\[ Restore Backup Routing Data \]" - - dat += "
\[ Change alert level \]" - if(emergency_shuttle.location()) - if (emergency_shuttle.online()) - dat += "
\[ Cancel Shuttle Call \]" - else - dat += "
\[ Call Emergency Shuttle \]" - - dat += "
\[ Set Status Display \]" - else - dat += "
\[ Log In \]" - dat += "
\[ Message List \]" - if(STATE_CALLSHUTTLE) - dat += "Are you sure you want to call the shuttle? \[ OK | Cancel \]" - if(STATE_CANCELSHUTTLE) - dat += "Are you sure you want to cancel the shuttle? \[ OK | Cancel \]" - if(STATE_MESSAGELIST) - dat += "Messages:" - for(var/i = 1; i<=src.messagetitle.len; i++) - dat += "
[src.messagetitle[i]]" - if(STATE_VIEWMESSAGE) - if (src.currmsg) - dat += "[src.messagetitle[src.currmsg]]

[src.messagetext[src.currmsg]]" - if (src.authenticated) - dat += "

\[ Delete \]" - else - src.state = STATE_MESSAGELIST - src.attack_hand(user) - return - if(STATE_DELMESSAGE) - if (src.currmsg) - dat += "Are you sure you want to delete this message? \[ OK | Cancel \]" - else - src.state = STATE_MESSAGELIST - src.attack_hand(user) - return - if(STATE_STATUSDISPLAY) - dat += "Set Status Displays
" - dat += "\[ Clear \]
" - dat += "\[ Station Time \]
" - dat += "\[ Shuttle ETA \]
" - dat += "\[ Message \]" - dat += "
" - dat += "\[ Alert: None |" - dat += " Red Alert |" - dat += " Lockdown |" - dat += " Biohazard \]

" - if(STATE_ALERT_LEVEL) - dat += "Current alert level: [get_security_level()]
" - if(security_level == SEC_LEVEL_DELTA) - dat += "The self-destruct mechanism is active. Find a way to deactivate the mechanism to lower the alert level or evacuate." - else - dat += "Blue
" - dat += "Green" - if(STATE_CONFIRM_LEVEL) - dat += "Current alert level: [get_security_level()]
" - dat += "Confirm the change to: [num2seclevel(tmp_alertlevel)]
" - dat += "Swipe ID to confirm change.
" - - dat += "
\[ [(src.state != STATE_DEFAULT) ? "Main Menu | " : ""]Close \]" - user << browse(dat, "window=communications;size=400x500") - onclose(user, "communications") - - - - -/obj/machinery/computer/communications/proc/interact_ai(var/mob/living/silicon/ai/user as mob) - var/dat = "" - switch(src.aistate) - if(STATE_DEFAULT) - if(emergency_shuttle.location() && !emergency_shuttle.online()) - dat += "
\[ Call Emergency Shuttle \]" - dat += "
\[ Message List \]" - dat += "
\[ Set Status Display \]" - if(STATE_CALLSHUTTLE) - dat += "Are you sure you want to call the shuttle? \[ OK | Cancel \]" - if(STATE_MESSAGELIST) - dat += "Messages:" - for(var/i = 1; i<=src.messagetitle.len; i++) - dat += "
[src.messagetitle[i]]" - if(STATE_VIEWMESSAGE) - if (src.aicurrmsg) - dat += "[src.messagetitle[src.aicurrmsg]]

[src.messagetext[src.aicurrmsg]]" - dat += "

\[ Delete \]" - else - src.aistate = STATE_MESSAGELIST - src.attack_hand(user) - return null - if(STATE_DELMESSAGE) - if(src.aicurrmsg) - dat += "Are you sure you want to delete this message? \[ OK | Cancel \]" - else - src.aistate = STATE_MESSAGELIST - src.attack_hand(user) - return - - if(STATE_STATUSDISPLAY) - dat += "Set Status Displays
" - dat += "\[ Clear \]
" - dat += "\[ Station Time \]
" - dat += "\[ Shuttle ETA \]
" - dat += "\[ Message \]" - dat += "
" - dat += "\[ Alert: None |" - dat += " Red Alert |" - dat += " Lockdown |" - dat += " Biohazard \]

" - - - dat += "
\[ [(src.aistate != STATE_DEFAULT) ? "Main Menu | " : ""]Close \]" - return dat - -/*/proc/enable_prison_shuttle(var/mob/user) - for(var/obj/machinery/computer/prison_shuttle/PS in world) - PS.allowedtocall = !(PS.allowedtocall)*/ - -/proc/call_shuttle_proc(var/mob/user) - if ((!(ROUND_IS_STARTED) || !emergency_shuttle.location())) - return - - if(!universe.OnShuttleCall(usr)) - user << "Cannot establish a bluespace connection." - return - - if(deathsquad.deployed) - user << "[boss_short] will not allow the shuttle to be called. Consider all contracts terminated." - return - - if(emergency_shuttle.deny_shuttle) - user << "The emergency shuttle may not be sent at this time. Please try again later." - return - - if(world.time < 6000) // Ten minute grace period to let the game get going without lolmetagaming. -- TLE - user << "The emergency shuttle is refueling. Please wait another [round((6000-world.time)/600)] minute\s before trying again." - return - - if(emergency_shuttle.going_to_centcom()) - user << "The emergency shuttle may not be called while returning to [boss_short]." - return - - if(emergency_shuttle.online()) - user << "The emergency shuttle is already on its way." - return - - if(SSticker.mode.name == "blob") - user << "Under directive 7-10, [station_name()] is quarantined until further notice." - return - - emergency_shuttle.call_evac() - log_game("[key_name(user)] has called the shuttle.",ckey=key_name(user)) - message_admins("[key_name_admin(user)] has called the shuttle.", 1) - - - return - -/proc/init_shift_change(var/mob/user, var/force = 0) - if ((!(ROUND_IS_STARTED) || !emergency_shuttle.location())) - return - - if(emergency_shuttle.going_to_centcom()) - user << "The shuttle may not be called while returning to [boss_short]." - return - - if(emergency_shuttle.online()) - user << "The shuttle is already on its way." - return - - // if force is 0, some things may stop the shuttle call - if(!force) - if(emergency_shuttle.deny_shuttle) - user << "[boss_short] does not currently have a shuttle available in your sector. Please try again later." - return - - if(deathsquad.deployed == 1) - user << "[boss_short] will not allow the shuttle to be called. Consider all contracts terminated." - return - - if(world.time < 54000) // 30 minute grace period to let the game get going - user << "The shuttle is refueling. Please wait another [round((54000-world.time)/60)] minutes before trying again." - return - - if(SSticker.mode.auto_recall_shuttle) - //New version pretends to call the shuttle but cause the shuttle to return after a random duration. - emergency_shuttle.auto_recall = 1 - - if(SSticker.mode.name == "blob" || SSticker.mode.name == "epidemic") - user << "Under directive 7-10, [station_name()] is quarantined until further notice." - return - - emergency_shuttle.call_transfer() - - //delay events in case of an autotransfer - if (!user) - SSevents.delay_events(EVENT_LEVEL_MODERATE, 9000) //15 minutes - SSevents.delay_events(EVENT_LEVEL_MAJOR, 9000) - - log_game("[user? key_name(user) : "Autotransfer"] has called the shuttle.") - message_admins("[user? key_name_admin(user) : "Autotransfer"] has called the shuttle.", 1) - - return - -/proc/cancel_call_proc(var/mob/user) - if (!(ROUND_IS_STARTED) || !emergency_shuttle.can_recall()) - return - if((SSticker.mode.name == "blob")||(SSticker.mode.name == "Meteor")) - return - - if(!emergency_shuttle.going_to_centcom()) //check that shuttle isn't already heading to centcomm - emergency_shuttle.recall() - log_game("[key_name(user)] has recalled the shuttle.",key_name(user)) - message_admins("[key_name_admin(user)] has recalled the shuttle.", 1) - return - - -/proc/is_relay_online() - for(var/obj/machinery/bluespacerelay/M in SSmachinery.all_machines) - if(M.stat == 0) - return 1 - return 0 - -/obj/machinery/computer/communications/proc/post_status(var/command, var/data1, var/data2) - - var/datum/radio_frequency/frequency = SSradio.return_frequency(1435) - - if(!frequency) return - - var/datum/signal/status_signal = new - status_signal.source = src - status_signal.transmission_method = 1 - status_signal.data["command"] = command - - switch(command) - if("message") - status_signal.data["msg1"] = data1 - status_signal.data["msg2"] = data2 - log_admin("STATUS: [src.fingerprintslast] set status screen message with [src]: [data1] [data2]") - //message_admins("STATUS: [user] set status screen with [PDA]. Message: [data1] [data2]") - if("alert") - status_signal.data["picture_state"] = data1 - - frequency.post_signal(src, status_signal) diff --git a/code/game/objects/items/weapons/circuitboards/computer/computer.dm b/code/game/objects/items/weapons/circuitboards/computer/computer.dm index 6b123490756..7b683234302 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/computer.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/computer.dm @@ -31,11 +31,6 @@ build_path = /obj/machinery/computer/scan_consolenew origin_tech = list(TECH_DATA = 2, TECH_BIO = 2) -/obj/item/weapon/circuitboard/communications - name = T_BOARD("command and communications console") - build_path = /obj/machinery/computer/communications - origin_tech = list(TECH_DATA = 2, TECH_MAGNET = 2) - /obj/item/weapon/circuitboard/teleporter name = T_BOARD("teleporter control console") build_path = /obj/machinery/computer/teleporter diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 793a8d43474..a9a147108e0 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -391,11 +391,8 @@ var/list/ai_verbs_default = list( if(confirm == "Yes") call_shuttle_proc(src) - // hack to display shuttle timer if(emergency_shuttle.online()) - var/obj/machinery/computer/communications/C = locate() in SSmachinery.processing_machines - if(C) - C.post_status("shuttle") + post_display_status("shuttle") /mob/living/silicon/ai/proc/ai_recall_shuttle() set category = "AI Commands" diff --git a/code/modules/modular_computers/computers/modular_computer/core.dm b/code/modules/modular_computers/computers/modular_computer/core.dm index 65e78770b0e..5d7c4684f38 100644 --- a/code/modules/modular_computers/computers/modular_computer/core.dm +++ b/code/modules/modular_computers/computers/modular_computer/core.dm @@ -31,7 +31,7 @@ else idle_threads.Remove(P) - + working = hard_drive && processor_unit && damage < broken_damage && (apc_power(0) || battery_power(0)) check_update_ui_need() /obj/item/modular_computer/proc/get_preset_programs(var/app_preset_name) @@ -52,6 +52,7 @@ /obj/item/modular_computer/Initialize() . = ..() + listener = new("modular_computers", src) START_PROCESSING(SSprocessing, src) install_default_hardware() if(hard_drive) @@ -64,6 +65,7 @@ uninstall_component(null, CH) qdel(CH) STOP_PROCESSING(SSprocessing, src) + QDEL_NULL(listener) return ..() /obj/item/modular_computer/emag_act(var/remaining_charges, var/mob/user) @@ -80,14 +82,13 @@ cut_overlays() if(!enabled) - var/probably_working = hard_drive && processor_unit && damage < broken_damage && (apc_power(0) || battery_power(0)) - if(icon_state_screensaver && probably_working) + if(icon_state_screensaver && working) if (is_holographic) holographic_overlay(src, src.icon, icon_state_screensaver) else add_overlay(icon_state_screensaver) - if (screensaver_light_range && probably_working) + if (screensaver_light_range && working) set_light(screensaver_light_range, 1, screensaver_light_color ? screensaver_light_color : "#FFFFFF") else set_light(0) diff --git a/code/modules/modular_computers/computers/modular_computer/variables.dm b/code/modules/modular_computers/computers/modular_computer/variables.dm index 40f8c386d84..f4aac51ae6d 100644 --- a/code/modules/modular_computers/computers/modular_computer/variables.dm +++ b/code/modules/modular_computers/computers/modular_computer/variables.dm @@ -6,6 +6,7 @@ var/enabled = 0 // Whether the computer is turned on. var/screen_on = 1 // Whether the computer is active/opened/it's screen is on. + var/working = 1 // Whether the computer is working. var/datum/computer_file/program/active_program = null // A currently active program running on the computer. var/hardware_flag = 0 // A flag that describes this device type var/last_power_usage = 0 // Last tick power usage of this computer @@ -55,3 +56,5 @@ var/obj/item/weapon/computer_hardware/hard_drive/portable/portable_drive // Portable data storage var/obj/item/weapon/computer_hardware/ai_slot/ai_slot // AI slot, an intellicard housing that allows modifications of AIs. var/obj/item/weapon/computer_hardware/tesla_link/tesla_link // Tesla Link, Allows remote charging from nearest APC. + + var/listener/listener //Listener needed for things \ No newline at end of file diff --git a/code/modules/modular_computers/computers/subtypes/preset_console.dm b/code/modules/modular_computers/computers/subtypes/preset_console.dm index 36bf54a6d17..a92d03a57b4 100644 --- a/code/modules/modular_computers/computers/subtypes/preset_console.dm +++ b/code/modules/modular_computers/computers/subtypes/preset_console.dm @@ -47,6 +47,8 @@ /obj/item/modular_computer/console/preset/command/install_default_hardware() ..() nano_printer = new/obj/item/weapon/computer_hardware/nano_printer(src) + nano_printer.max_paper = 25 + nano_printer.stored_paper = 20 card_slot = new/obj/item/weapon/computer_hardware/card_slot(src) // Security @@ -69,6 +71,8 @@ ..() ai_slot = new/obj/item/weapon/computer_hardware/ai_slot(src) nano_printer = new/obj/item/weapon/computer_hardware/nano_printer(src) + nano_printer.max_paper = 25 + nano_printer.stored_paper = 20 card_slot = new/obj/item/weapon/computer_hardware/card_slot(src) /obj/item/modular_computer/console/preset/ert/ diff --git a/code/modules/modular_computers/file_system/programs/app_presets.dm b/code/modules/modular_computers/file_system/programs/app_presets.dm index 9347e80c0eb..402eef3a32f 100644 --- a/code/modules/modular_computers/file_system/programs/app_presets.dm +++ b/code/modules/modular_computers/file_system/programs/app_presets.dm @@ -74,7 +74,7 @@ new/datum/computer_file/program/filemanager(), new/datum/computer_file/program/chatclient(), new/datum/computer_file/program/card_mod(), - new/datum/computer_file/program/comm() + new/datum/computer_file/program/comm(1) ) return _prg_list @@ -159,7 +159,7 @@ new/datum/computer_file/program/filemanager(), new/datum/computer_file/program/ntnetdownload(), new/datum/computer_file/program/camera_monitor/hacked(), - new/datum/computer_file/program/comm(), + new/datum/computer_file/program/comm(1), new/datum/computer_file/program/suit_sensors(), new/datum/computer_file/program/alarm_monitor(), new/datum/computer_file/program/lighting_control(), diff --git a/code/modules/modular_computers/file_system/programs/command/comm.dm b/code/modules/modular_computers/file_system/programs/command/comm.dm index 068aabcdd40..3671e1d200f 100644 --- a/code/modules/modular_computers/file_system/programs/command/comm.dm +++ b/code/modules/modular_computers/file_system/programs/command/comm.dm @@ -16,8 +16,13 @@ usage_flags = PROGRAM_CONSOLE network_destination = "station long-range communication array" var/datum/comm_message_listener/message_core = new + var/intercept = 0 color = LIGHT_COLOR_BLUE +/datum/computer_file/program/comm/New(intercept_printing = 0) + . = ..() + intercept = intercept_printing + /datum/computer_file/program/comm/clone() var/datum/computer_file/program/comm/temp = ..() temp.message_core.messages = null @@ -47,6 +52,8 @@ data["emagged"] = program.computer_emagged data["net_comms"] = !!program.get_signal(NTNET_COMMUNICATION) //Double !! is needed to get 1 or 0 answer data["net_syscont"] = !!program.get_signal(NTNET_SYSTEMCONTROL) + var/datum/computer_file/program/comm/P = program + data["message_printing_intercepts"] = P.intercept if(program.computer) data["have_printer"] = !!program.computer.nano_printer else @@ -56,6 +63,7 @@ data["net_comms"] = 1 data["net_syscont"] = 1 data["have_printer"] = 0 + data["message_printing_intercepts"] = 0 data["message_line1"] = msg_line1 data["message_line2"] = msg_line2 @@ -193,11 +201,11 @@ if(can_still_topic()) msg_line2 = linput if("message") - post_status("message", msg_line1, msg_line2) + post_display_status("message", msg_line1, msg_line2) if("alert") - post_status("alert", href_list["alert"]) + post_display_status("alert", href_list["alert"]) else - post_status(href_list["target"]) + post_display_status(href_list["target"]) if("setalert") if(is_autenthicated(user) && !issilicon(usr) && ntn_cont && ntn_comm) @@ -238,31 +246,14 @@ usr << "Hardware error: Printer was unable to print the file. It may be out of paper." else program.computer.visible_message("\The [program.computer] prints out paper.") + if("toggleintercept") + if(is_autenthicated(user) && ntn_comm) + if(program && program.computer && program.computer.nano_printer) + var/datum/computer_file/program/comm/P = program + P.intercept = !P.intercept SSnanoui.update_uis(src) -/datum/nano_module/program/comm/proc/post_status(var/command, var/data1, var/data2) - - var/datum/radio_frequency/frequency = SSradio.return_frequency(1435) - - if(!frequency) return - - - var/datum/signal/status_signal = new - status_signal.source = src - status_signal.transmission_method = 1 - status_signal.data["command"] = command - - switch(command) - if("message") - status_signal.data["msg1"] = data1 - status_signal.data["msg2"] = data2 - log_admin("STATUS: [key_name(usr)] set status screen message with [src]: [data1] [data2]",ckey=key_name(usr)) - if("alert") - status_signal.data["picture_state"] = data1 - - frequency.post_signal(src, status_signal) - #undef STATE_DEFAULT #undef STATE_MESSAGELIST #undef STATE_VIEWMESSAGE @@ -289,15 +280,12 @@ var/last_message_id = 0 for (var/datum/comm_message_listener/l in comm_message_listeners) l.Add(message) - //Old console support - for (var/obj/machinery/computer/communications/comm in SSmachinery.processing_machines) - if (!(comm.stat & (BROKEN | NOPOWER)) && comm.prints_intercept) - var/obj/item/weapon/paper/intercept = new /obj/item/weapon/paper( comm.loc ) - intercept.name = message_title - intercept.info = message_text + for (var/obj/item/modular_computer/computer in get_listeners_by_type("modular_computers", /obj/item/modular_computer)) + if(computer && computer.working && !!computer.nano_printer) + var/datum/computer_file/program/comm/C = locate(/datum/computer_file/program/comm) in computer.hard_drive.stored_files + if(C && C.intercept) + computer.nano_printer.print_text(message_text, message_title) - comm.messagetitle.Add(message_title) - comm.messagetext.Add(message_text) /datum/comm_message_listener var/list/messages @@ -312,3 +300,131 @@ var/last_message_id = 0 /datum/comm_message_listener/proc/Remove(var/list/message) messages -= list(message) +/* +Command action procs +*/ +/proc/post_display_status(var/command, var/data1, var/data2) + + var/datum/radio_frequency/frequency = SSradio.return_frequency(1435) + + if(!frequency) return + + + var/datum/signal/status_signal = new + status_signal.source = src + status_signal.transmission_method = 1 + status_signal.data["command"] = command + + switch(command) + if("message") + status_signal.data["msg1"] = data1 + status_signal.data["msg2"] = data2 + log_admin("STATUS: [key_name(usr)] set status screen message with [src]: [data1] [data2]") + if("alert") + status_signal.data["picture_state"] = data1 + + frequency.post_signal(src, status_signal) + +/proc/cancel_call_proc(var/mob/user) + if (!(ROUND_IS_STARTED) || !emergency_shuttle.can_recall()) + return + if((SSticker.mode.name == "blob")||(SSticker.mode.name == "Meteor")) + return + + if(!emergency_shuttle.going_to_centcom()) //check that shuttle isn't already heading to centcomm + emergency_shuttle.recall() + log_game("[key_name(user)] has recalled the shuttle.",key_name(user)) + message_admins("[key_name_admin(user)] has recalled the shuttle.", 1) + return + + +/proc/is_relay_online() + for(var/obj/machinery/bluespacerelay/M in SSmachinery.all_machines) + if(M.stat == 0) + return 1 + return 0 + +/proc/call_shuttle_proc(var/mob/user) + if ((!(ROUND_IS_STARTED) || !emergency_shuttle.location())) + return + + if(!universe.OnShuttleCall(usr)) + user << "Cannot establish a bluespace connection." + return + + if(deathsquad.deployed) + user << "[boss_short] will not allow the shuttle to be called. Consider all contracts terminated." + return + + if(emergency_shuttle.deny_shuttle) + user << "The emergency shuttle may not be sent at this time. Please try again later." + return + + if(world.time < 6000) // Ten minute grace period to let the game get going without lolmetagaming. -- TLE + user << "The emergency shuttle is refueling. Please wait another [round((6000-world.time)/600)] minute\s before trying again." + return + + if(emergency_shuttle.going_to_centcom()) + user << "The emergency shuttle may not be called while returning to [boss_short]." + return + + if(emergency_shuttle.online()) + user << "The emergency shuttle is already on its way." + return + + if(SSticker.mode.name == "blob") + user << "Under directive 7-10, [station_name()] is quarantined until further notice." + return + + emergency_shuttle.call_evac() + log_game("[key_name(user)] has called the shuttle.",ckey=key_name(user)) + message_admins("[key_name_admin(user)] has called the shuttle.", 1) + + + return + +/proc/init_shift_change(var/mob/user, var/force = 0) + if ((!(ROUND_IS_STARTED) || !emergency_shuttle.location())) + return + + if(emergency_shuttle.going_to_centcom()) + user << "The shuttle may not be called while returning to [boss_short]." + return + + if(emergency_shuttle.online()) + user << "The shuttle is already on its way." + return + + // if force is 0, some things may stop the shuttle call + if(!force) + if(emergency_shuttle.deny_shuttle) + user << "[boss_short] does not currently have a shuttle available in your sector. Please try again later." + return + + if(deathsquad.deployed == 1) + user << "[boss_short] will not allow the shuttle to be called. Consider all contracts terminated." + return + + if(world.time < 54000) // 30 minute grace period to let the game get going + user << "The shuttle is refueling. Please wait another [round((54000-world.time)/60)] minutes before trying again." + return + + if(SSticker.mode.auto_recall_shuttle) + //New version pretends to call the shuttle but cause the shuttle to return after a random duration. + emergency_shuttle.auto_recall = 1 + + if(SSticker.mode.name == "blob" || SSticker.mode.name == "epidemic") + user << "Under directive 7-10, [station_name()] is quarantined until further notice." + return + + emergency_shuttle.call_transfer() + + //delay events in case of an autotransfer + if (!user) + SSevents.delay_events(EVENT_LEVEL_MODERATE, 10200) //17 minutes + SSevents.delay_events(EVENT_LEVEL_MAJOR, 10200) + + log_game("[user? key_name(user) : "Autotransfer"] has called the shuttle.") + message_admins("[user? key_name_admin(user) : "Autotransfer"] has called the shuttle.", 1) + + return \ No newline at end of file diff --git a/code/modules/research/designs/circuit_designs.dm b/code/modules/research/designs/circuit_designs.dm index 22a1fdcc9ed..f0936409d54 100644 --- a/code/modules/research/designs/circuit_designs.dm +++ b/code/modules/research/designs/circuit_designs.dm @@ -342,12 +342,6 @@ build_path = /obj/item/weapon/circuitboard/biogenerator sort_string = "KBAAA" -/datum/design/circuit/comconsole - name = "communications console" - id = "comconsole" - build_path = /obj/item/weapon/circuitboard/communications - sort_string = "LAAAA" - /datum/design/circuit/emp_data name = "employment records console" id = "emp_data" diff --git a/code/modules/security levels/security levels.dm b/code/modules/security levels/security levels.dm index 1d41a2185f2..cfe45283c09 100644 --- a/code/modules/security levels/security levels.dm +++ b/code/modules/security levels/security levels.dm @@ -40,10 +40,7 @@ else security_announcement_down.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 - var/obj/machinery/computer/communications/CC = locate(/obj/machinery/computer/communications,world) - if(CC) - CC.post_status("alert", "redalert")*/ + post_display_status("alert", "redalert") if(SEC_LEVEL_DELTA) security_announcement_up.Announce("[config.alert_desc_delta]", "Attention! Delta security level reached!", new_sound = 'sound/effects/siren.ogg') security_level = SEC_LEVEL_DELTA diff --git a/html/changelogs/Karolis2011-PR-3479.yml b/html/changelogs/Karolis2011-PR-3479.yml new file mode 100644 index 00000000000..1d9a7efc015 --- /dev/null +++ b/html/changelogs/Karolis2011-PR-3479.yml @@ -0,0 +1,4 @@ +author: Karolis2011 +delete-after: True +changes: + - rscadd: "Replaced command and communications console with modular console" \ No newline at end of file diff --git a/maps/aurora/aurora-1_centcomm.dmm b/maps/aurora/aurora-1_centcomm.dmm index 8c876dafaf1..a54017bde9b 100644 --- a/maps/aurora/aurora-1_centcomm.dmm +++ b/maps/aurora/aurora-1_centcomm.dmm @@ -6790,7 +6790,7 @@ }, /area/shuttle/administration/centcom) "qe" = ( -/obj/machinery/computer/communications, +/obj/item/modular_computer/console/preset/command, /turf/simulated/shuttle/floor{ icon_state = "floor6" }, @@ -10460,7 +10460,7 @@ }, /area/centcom/control) "xQ" = ( -/obj/machinery/computer/communications, +/obj/item/modular_computer/console/preset/command, /turf/unsimulated/floor{ icon_state = "floor" }, @@ -11747,7 +11747,7 @@ }, /area/shuttle/specops/centcom) "At" = ( -/obj/machinery/computer/communications, +/obj/item/modular_computer/console/preset/command, /obj/item/device/radio/intercom{ broadcasting = 0; dir = 1; @@ -11831,7 +11831,7 @@ }, /area/shuttle/escape/centcom) "AD" = ( -/obj/machinery/computer/communications, +/obj/item/modular_computer/console/preset/command, /turf/simulated/shuttle/floor{ icon_state = "floor3" }, diff --git a/maps/aurora/aurora-3_sublevel.dmm b/maps/aurora/aurora-3_sublevel.dmm index 2b5d7916765..bd81104ba07 100644 --- a/maps/aurora/aurora-3_sublevel.dmm +++ b/maps/aurora/aurora-3_sublevel.dmm @@ -9872,7 +9872,7 @@ /turf/simulated/floor/tiled/dark, /area/bridge/aibunker) "sd" = ( -/obj/machinery/computer/communications, +/obj/item/modular_computer/console/preset/command, /turf/simulated/floor/tiled/dark, /area/bridge/aibunker) "se" = ( diff --git a/maps/aurora/aurora-4_mainlevel.dmm b/maps/aurora/aurora-4_mainlevel.dmm index 71b3b1ab32f..289e7f820cb 100644 --- a/maps/aurora/aurora-4_mainlevel.dmm +++ b/maps/aurora/aurora-4_mainlevel.dmm @@ -10921,7 +10921,7 @@ "auQ" = ( /obj/machinery/atmospherics/pipe/simple/hidden/supply, /obj/structure/disposalpipe/segment, -/obj/machinery/computer/communications, +/obj/item/modular_computer/console/preset/command, /obj/effect/floor_decal/corner/paleblue{ icon_state = "corner_white"; dir = 5 @@ -23056,7 +23056,7 @@ /turf/simulated/floor/wood, /area/bridge/meeting_room) "aOx" = ( -/obj/machinery/computer/communications, +/obj/item/modular_computer/console/preset/command, /turf/simulated/floor/carpet, /area/crew_quarters/captain) "aOy" = ( @@ -27164,7 +27164,7 @@ /turf/simulated/floor/carpet, /area/bridge/meeting_room) "aVu" = ( -/obj/machinery/computer/communications, +/obj/item/modular_computer/console/preset/command, /obj/item/weapon/card/id/captains_spare, /obj/machinery/atmospherics/pipe/simple/hidden/supply{ dir = 10 diff --git a/nano/templates/communication.tmpl b/nano/templates/communication.tmpl index cd943d2122a..e03ee9b52af 100644 --- a/nano/templates/communication.tmpl +++ b/nano/templates/communication.tmpl @@ -21,6 +21,8 @@ {{empty}}
There are no messages.
{{/for}} +
{{if data.have_printer}}{{:helper.link( !data.message_printing_intercepts ? 'Enable report printing' : 'Disable report printing', null, {'action' : 'toggleintercept'})}}{{/if}}
+
{{:helper.link('Back', null, {'action' : 'sw_menu', 'target' : 1})}}
{{else data.state === 3}}
Title: {{:data.message_current.title}}