mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-27 18:51:53 +00:00
Prison break refactor, Requests Console refactor
This commit is contained in:
@@ -31,13 +31,14 @@
|
||||
title = "Security Announcement"
|
||||
announcement_type = "Security Announcement"
|
||||
|
||||
/datum/announcement/proc/Announce(var/message as text, var/new_title = "", var/new_sound = null, var/do_newscast = newscast)
|
||||
/datum/announcement/proc/Announce(var/message as text, var/new_title = "", var/new_sound = null, var/do_newscast = newscast, var/msg_sanitized = 0)
|
||||
if(!message)
|
||||
return
|
||||
var/tmp/message_title = new_title ? new_title : title
|
||||
var/tmp/message_sound = new_sound ? sound(new_sound) : sound
|
||||
|
||||
message = trim_strip_html_properly(message)
|
||||
if(!msg_sanitized)
|
||||
message = trim_strip_html_properly(message)
|
||||
message_title = html_encode(message_title)
|
||||
|
||||
Message(message, message_title)
|
||||
|
||||
@@ -1497,6 +1497,14 @@ var/list/ghostteleportlocs = list()
|
||||
/area/security/brig
|
||||
name = "\improper Brig"
|
||||
icon_state = "brig"
|
||||
|
||||
/area/security/brig/prison_break()
|
||||
for(var/obj/structure/closet/secure_closet/brig/temp_closet in src)
|
||||
temp_closet.locked = 0
|
||||
temp_closet.icon_state = temp_closet.icon_closed
|
||||
for(var/obj/machinery/door_timer/temp_timer in src)
|
||||
temp_timer.releasetime = 1
|
||||
..()
|
||||
|
||||
/area/security/permabrig
|
||||
name = "\improper Prison Wing"
|
||||
@@ -1505,6 +1513,14 @@ var/list/ghostteleportlocs = list()
|
||||
/area/security/prison
|
||||
name = "\improper Prison Wing"
|
||||
icon_state = "sec_prison"
|
||||
|
||||
/area/security/prison/prison_break()
|
||||
for(var/obj/structure/closet/secure_closet/brig/temp_closet in src)
|
||||
temp_closet.locked = 0
|
||||
temp_closet.icon_state = temp_closet.icon_closed
|
||||
for(var/obj/machinery/door_timer/temp_timer in src)
|
||||
temp_timer.releasetime = 1
|
||||
..()
|
||||
|
||||
/area/security/prison/cell_block
|
||||
name = "\improper Prison Cell Block"
|
||||
|
||||
@@ -432,3 +432,11 @@
|
||||
if(T && gravity_generators["[T.z]"] && length(gravity_generators["[T.z]"]))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/area/proc/prison_break()
|
||||
for(var/obj/machinery/power/apc/temp_apc in src)
|
||||
temp_apc.overload_lighting(70)
|
||||
for(var/obj/machinery/door/airlock/temp_airlock in src)
|
||||
temp_airlock.prison_open()
|
||||
for(var/obj/machinery/door/window/temp_windoor in src)
|
||||
temp_windoor.open()
|
||||
@@ -972,14 +972,6 @@ About the new airlock wires panel:
|
||||
welded = 1
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/door/airlock/proc/prison_open()
|
||||
src.unlock()
|
||||
src.open()
|
||||
src.locked = 1
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/door/airlock/hatch/gamma/attackby(C as obj, mob/user as mob, params)
|
||||
//world << text("airlock attackby src [] obj [] mob []", src, C, user)
|
||||
if(!istype(usr, /mob/living/silicon))
|
||||
@@ -1055,3 +1047,10 @@ About the new airlock wires panel:
|
||||
// Keeping door lights on, runs on internal battery or something.
|
||||
electrified_until = 0
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/door/airlock/proc/prison_open()
|
||||
if(arePowerSystemsOn())
|
||||
src.unlock()
|
||||
src.open()
|
||||
src.lock()
|
||||
return
|
||||
@@ -298,7 +298,12 @@ Class Procs:
|
||||
add_fingerprint(usr)
|
||||
return 0
|
||||
|
||||
/obj/machinery/proc/operable(var/additional_flags = 0)
|
||||
return !inoperable(additional_flags)
|
||||
|
||||
/obj/machinery/proc/inoperable(var/additional_flags = 0)
|
||||
return (stat & (NOPOWER|BROKEN|additional_flags))
|
||||
|
||||
/obj/machinery/CanUseTopic(var/mob/user)
|
||||
if(!interact_offline && (stat & (NOPOWER|BROKEN)))
|
||||
return STATUS_CLOSE
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
/******************** Requests Console ********************/
|
||||
/** Originally written by errorage, updated by: Carn, needs more work though. I just added some security fixes */
|
||||
|
||||
//Request Console Department Types
|
||||
#define RC_ASSIST 1 //Request Assistance
|
||||
#define RC_SUPPLY 2 //Request Supplies
|
||||
#define RC_INFO 4 //Relay Info
|
||||
|
||||
//Request Console Screens
|
||||
#define RCS_MAINMENU 0 // Main menu
|
||||
#define RCS_RQASSIST 1 // Request supplies
|
||||
#define RCS_RQSUPPLY 2 // Request assistance
|
||||
#define RCS_SENDINFO 3 // Relay information
|
||||
#define RCS_SENTPASS 4 // Message sent successfully
|
||||
#define RCS_SENTFAIL 5 // Message sent unsuccessfully
|
||||
#define RCS_VIEWMSGS 6 // View messages
|
||||
#define RCS_MESSAUTH 7 // Authentication before sending
|
||||
#define RCS_ANNOUNCE 8 // Send announcement
|
||||
|
||||
var/req_console_assistance = list()
|
||||
var/req_console_supplies = list()
|
||||
var/req_console_information = list()
|
||||
@@ -8,38 +24,18 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
|
||||
/obj/machinery/requests_console
|
||||
name = "Requests Console"
|
||||
desc = "A console intended to send requests to diferent departments on the station."
|
||||
desc = "A console intended to send requests to different departments on the station."
|
||||
anchored = 1
|
||||
icon = 'icons/obj/terminals.dmi'
|
||||
icon_state = "req_comp0"
|
||||
var/department = "Unknown" //The list of all departments on the station (Determined from this variable on each unit) Set this to the same thing if you want several consoles in one department
|
||||
var/list/messages = list() //List of all messages
|
||||
var/departmentType = 0
|
||||
// 0 = none (not listed, can only repeplied to)
|
||||
// 1 = assistance
|
||||
// 2 = supplies
|
||||
// 3 = info
|
||||
// 4 = ass + sup //Erro goddamn you just HAD to shorten "assistance" down to "ass"
|
||||
// 5 = ass + info
|
||||
// 6 = sup + info
|
||||
// 7 = ass + sup + info
|
||||
var/list/message_log = list() //List of all messages
|
||||
var/departmentType = 0 //Bitflag. Zero is reply-only. Map currently uses raw numbers instead of defines.
|
||||
var/newmessagepriority = 0
|
||||
// 0 = no new message
|
||||
// 1 = normal priority
|
||||
// 2 = high priority
|
||||
// 3 = extreme priority - not implemented, will probably require some hacking... everything needs to have a hidden feature in this game.
|
||||
var/screen = 0
|
||||
// 0 = main menu,
|
||||
// 1 = req. assistance,
|
||||
// 2 = req. supplies
|
||||
// 3 = relay information
|
||||
// 4 = write msg - not used
|
||||
// 5 = choose priority - not used
|
||||
// 6 = sent successfully
|
||||
// 7 = sent unsuccessfully
|
||||
// 8 = view messages
|
||||
// 9 = authentication before sending
|
||||
// 10 = send announcement
|
||||
var/screen = RCS_MAINMENU
|
||||
var/silent = 0 // set to 1 for it not to beep all the time
|
||||
// var/hackState = 0
|
||||
// 0 = not hacked
|
||||
@@ -52,9 +48,9 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
var/msgVerified = "" //Will contain the name of the person who varified it
|
||||
var/msgStamped = "" //If a message is stamped, this will contain the stamp name
|
||||
var/message = "";
|
||||
var/dpt = ""; //the department which will be receiving the message
|
||||
var/recipient = ""; //the department which will be receiving the message
|
||||
var/priority = -1 ; //Priority of the message being sent
|
||||
luminosity = 0
|
||||
light_range = 0
|
||||
var/datum/announcement/announcement = new
|
||||
|
||||
/obj/machinery/requests_console/power_change()
|
||||
@@ -67,153 +63,73 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
icon_state = "req_comp_off"
|
||||
else
|
||||
if(icon_state == "req_comp_off")
|
||||
icon_state = "req_comp0"
|
||||
icon_state = "req_comp[newmessagepriority]"
|
||||
|
||||
/obj/machinery/requests_console/New()
|
||||
..()
|
||||
|
||||
|
||||
announcement.title = "[department] announcement"
|
||||
announcement.newscast = 1
|
||||
|
||||
|
||||
name = "[department] Requests Console"
|
||||
allConsoles += src
|
||||
//req_console_departments += department
|
||||
switch(departmentType)
|
||||
if(1)
|
||||
if(!("[department]" in req_console_assistance))
|
||||
req_console_assistance += department
|
||||
if(2)
|
||||
if(!("[department]" in req_console_supplies))
|
||||
req_console_supplies += department
|
||||
if(3)
|
||||
if(!("[department]" in req_console_information))
|
||||
req_console_information += department
|
||||
if(4)
|
||||
if(!("[department]" in req_console_assistance))
|
||||
req_console_assistance += department
|
||||
if(!("[department]" in req_console_supplies))
|
||||
req_console_supplies += department
|
||||
if(5)
|
||||
if(!("[department]" in req_console_assistance))
|
||||
req_console_assistance += department
|
||||
if(!("[department]" in req_console_information))
|
||||
req_console_information += department
|
||||
if(6)
|
||||
if(!("[department]" in req_console_supplies))
|
||||
req_console_supplies += department
|
||||
if(!("[department]" in req_console_information))
|
||||
req_console_information += department
|
||||
if(7)
|
||||
if(!("[department]" in req_console_assistance))
|
||||
req_console_assistance += department
|
||||
if(!("[department]" in req_console_supplies))
|
||||
req_console_supplies += department
|
||||
if(!("[department]" in req_console_information))
|
||||
req_console_information += department
|
||||
if (departmentType & RC_ASSIST)
|
||||
req_console_assistance |= department
|
||||
if (departmentType & RC_SUPPLY)
|
||||
req_console_supplies |= department
|
||||
if (departmentType & RC_INFO)
|
||||
req_console_information |= department
|
||||
|
||||
set_light(1)
|
||||
|
||||
/obj/machinery/requests_console/Destroy()
|
||||
allConsoles -= src
|
||||
var/lastDeptRC = 1
|
||||
for (var/obj/machinery/requests_console/Console in allConsoles)
|
||||
if (Console.department == department)
|
||||
lastDeptRC = 0
|
||||
break
|
||||
if(lastDeptRC)
|
||||
if (departmentType & RC_ASSIST)
|
||||
req_console_assistance -= department
|
||||
if (departmentType & RC_SUPPLY)
|
||||
req_console_supplies -= department
|
||||
if (departmentType & RC_INFO)
|
||||
req_console_information -= department
|
||||
..()
|
||||
|
||||
/obj/machinery/requests_console/attack_hand(user as mob)
|
||||
if(..(user))
|
||||
return
|
||||
var/dat
|
||||
dat = text("<HEAD><TITLE>Requests Console</TITLE></HEAD><H3>[department] Requests Console</H3>")
|
||||
if(!open)
|
||||
switch(screen)
|
||||
if(1) //req. assistance
|
||||
dat += text("Which department do you need assistance from?<BR><BR>")
|
||||
for(var/dpt in req_console_assistance)
|
||||
if (dpt != department)
|
||||
dat += text("[dpt] (<A href='?src=\ref[src];write=[ckey(dpt)]'>Message</A> or ")
|
||||
dat += text("<A href='?src=\ref[src];write=[ckey(dpt)];priority=2'>High Priority</A>")
|
||||
// if (hackState == 1)
|
||||
// dat += text(" or <A href='?src=\ref[src];write=[ckey(dpt)];priority=3'>EXTREME</A>)")
|
||||
dat += text(")<BR>")
|
||||
dat += text("<BR><A href='?src=\ref[src];setScreen=0'>Back</A><BR>")
|
||||
ui_interact(user)
|
||||
|
||||
if(2) //req. supplies
|
||||
dat += text("Which department do you need supplies from?<BR><BR>")
|
||||
for(var/dpt in req_console_supplies)
|
||||
if (dpt != department)
|
||||
dat += text("[dpt] (<A href='?src=\ref[src];write=[ckey(dpt)]'>Message</A> or ")
|
||||
dat += text("<A href='?src=\ref[src];write=[ckey(dpt)];priority=2'>High Priority</A>")
|
||||
// if (hackState == 1)
|
||||
// dat += text(" or <A href='?src=\ref[src];write=[ckey(dpt)];priority=3'>EXTREME</A>)")
|
||||
dat += text(")<BR>")
|
||||
dat += text("<BR><A href='?src=\ref[src];setScreen=0'>Back</A><BR>")
|
||||
/obj/machinery/requests_console/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
var/data[0]
|
||||
|
||||
if(3) //relay information
|
||||
dat += text("Which department would you like to send information to?<BR><BR>")
|
||||
for(var/dpt in req_console_information)
|
||||
if (dpt != department)
|
||||
dat += text("[dpt] (<A href='?src=\ref[src];write=[ckey(dpt)]'>Message</A> or ")
|
||||
dat += text("<A href='?src=\ref[src];write=[ckey(dpt)];priority=2'>High Priority</A>")
|
||||
// if (hackState == 1)
|
||||
// dat += text(" or <A href='?src=\ref[src];write=[ckey(dpt)];priority=3'>EXTREME</A>)")
|
||||
dat += text(")<BR>")
|
||||
dat += text("<BR><A href='?src=\ref[src];setScreen=0'>Back</A><BR>")
|
||||
data["department"] = department
|
||||
data["screen"] = screen
|
||||
data["message_log"] = message_log
|
||||
data["newmessagepriority"] = newmessagepriority
|
||||
data["silent"] = silent
|
||||
data["announcementConsole"] = announcementConsole
|
||||
|
||||
if(6) //sent successfully
|
||||
dat += text("<FONT COLOR='GREEN'>Message sent</FONT><BR><BR>")
|
||||
dat += text("<A href='?src=\ref[src];setScreen=0'>Continue</A><BR>")
|
||||
data["assist_dept"] = req_console_assistance
|
||||
data["supply_dept"] = req_console_supplies
|
||||
data["info_dept"] = req_console_information
|
||||
|
||||
if(7) //unsuccessful; not sent
|
||||
dat += text("<FONT COLOR='RED'>An error occurred. </FONT><BR><BR>")
|
||||
dat += text("<A href='?src=\ref[src];setScreen=0'>Continue</A><BR>")
|
||||
data["message"] = message
|
||||
data["recipient"] = recipient
|
||||
data["priortiy"] = priority
|
||||
data["msgStamped"] = msgStamped
|
||||
data["msgVerified"] = msgVerified
|
||||
data["announceAuth"] = announceAuth
|
||||
|
||||
if(8) //view messages
|
||||
for (var/obj/machinery/requests_console/Console in allConsoles)
|
||||
if (Console.department == department)
|
||||
Console.newmessagepriority = 0
|
||||
Console.icon_state = "req_comp0"
|
||||
Console.luminosity = 1
|
||||
newmessagepriority = 0
|
||||
icon_state = "req_comp0"
|
||||
for(var/msg in messages)
|
||||
dat += text("[msg]<BR>")
|
||||
dat += text("<A href='?src=\ref[src];setScreen=0'>Back to main menu</A><BR>")
|
||||
|
||||
if(9) //authentication before sending
|
||||
dat += text("<B>Message Authentication</B><BR><BR>")
|
||||
dat += text("<b>Message for [dpt]: </b>[message]<BR><BR>")
|
||||
dat += text("You may authenticate your message now by scanning your ID or your stamp<BR><BR>")
|
||||
dat += text("Validated by: [msgVerified]<br>");
|
||||
dat += text("Stamped by: [msgStamped]<br>");
|
||||
dat += text("<A href='?src=\ref[src];department=[dpt]'>Send</A><BR>");
|
||||
dat += text("<BR><A href='?src=\ref[src];setScreen=0'>Back</A><BR>")
|
||||
|
||||
if(10) //send announcement
|
||||
dat += text("<B>Station wide announcement</B><BR><BR>")
|
||||
if(announceAuth)
|
||||
dat += text("<b>Authentication accepted</b><BR><BR>")
|
||||
else
|
||||
dat += text("Swipe your card to authenticate yourself.<BR><BR>")
|
||||
dat += text("<b>Message: </b>[message] <A href='?src=\ref[src];writeAnnouncement=1'>Write</A><BR><BR>")
|
||||
if (announceAuth && message)
|
||||
dat += text("<A href='?src=\ref[src];sendAnnouncement=1'>Announce</A><BR>");
|
||||
dat += text("<BR><A href='?src=\ref[src];setScreen=0'>Back</A><BR>")
|
||||
|
||||
else //main menu
|
||||
screen = 0
|
||||
reset_announce()
|
||||
if (newmessagepriority == 1)
|
||||
dat += text("<FONT COLOR='RED'>There are new messages</FONT><BR>")
|
||||
if (newmessagepriority == 2)
|
||||
dat += text("<FONT COLOR='RED'><B>NEW PRIORITY MESSAGES</B></FONT><BR>")
|
||||
dat += text("<A href='?src=\ref[src];setScreen=8'>View Messages</A><BR><BR>")
|
||||
|
||||
dat += text("<A href='?src=\ref[src];setScreen=1'>Request Assistance</A><BR>")
|
||||
dat += text("<A href='?src=\ref[src];setScreen=2'>Request Supplies</A><BR>")
|
||||
dat += text("<A href='?src=\ref[src];setScreen=3'>Relay Anonymous Information</A><BR><BR>")
|
||||
if(announcementConsole)
|
||||
dat += text("<A href='?src=\ref[src];setScreen=10'>Send station-wide announcement</A><BR><BR>")
|
||||
if (silent)
|
||||
dat += text("Speaker <A href='?src=\ref[src];setSilent=0'>OFF</A>")
|
||||
else
|
||||
dat += text("Speaker <A href='?src=\ref[src];setSilent=1'>ON</A>")
|
||||
|
||||
user << browse("[dat]", "window=request_console")
|
||||
onclose(user, "req_console")
|
||||
return
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "request_console.tmpl", "[department] Request Console", 520, 410)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/requests_console/Topic(href, href_list)
|
||||
if(..()) return
|
||||
@@ -221,144 +137,68 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
add_fingerprint(usr)
|
||||
|
||||
if(reject_bad_text(href_list["write"]))
|
||||
dpt = ckey(href_list["write"]) //write contains the string of the receiving department's name
|
||||
recipient = href_list["write"] //write contains the string of the receiving department's name
|
||||
|
||||
var/new_message = copytext(reject_bad_text(input(usr, "Write your message:", "Awaiting Input", "")),1,MAX_MESSAGE_LEN)
|
||||
var/new_message = sanitize(input("Write your message:", "Awaiting Input", ""))
|
||||
if(new_message)
|
||||
message = new_message
|
||||
screen = 9
|
||||
screen = RCS_MESSAUTH
|
||||
switch(href_list["priority"])
|
||||
if("1") priority = 1
|
||||
if("2") priority = 2
|
||||
else priority = -1
|
||||
else priority = 0
|
||||
else
|
||||
dpt = "";
|
||||
msgVerified = ""
|
||||
msgStamped = ""
|
||||
screen = 0
|
||||
priority = -1
|
||||
reset_message(1)
|
||||
|
||||
if(href_list["writeAnnouncement"])
|
||||
var/new_message = copytext(reject_bad_text(input(usr, "Write your message:", "Awaiting Input", "")),1,MAX_MESSAGE_LEN)
|
||||
var/new_message = sanitize(input("Write your message:", "Awaiting Input", ""))
|
||||
if(new_message)
|
||||
message = new_message
|
||||
switch(href_list["priority"])
|
||||
if("2") priority = 2
|
||||
else priority = -1
|
||||
else
|
||||
reset_announce()
|
||||
screen = 0
|
||||
reset_message(1)
|
||||
|
||||
if(href_list["sendAnnouncement"])
|
||||
if(!announcementConsole) return
|
||||
announcement.Announce(message)
|
||||
reset_announce()
|
||||
screen = 0
|
||||
announcement.Announce(message, msg_sanitized = 1)
|
||||
reset_message(1)
|
||||
|
||||
if( href_list["department"] && message )
|
||||
var/log_msg = message
|
||||
var/sending = message
|
||||
sending += "<br>"
|
||||
if (msgVerified)
|
||||
sending += msgVerified
|
||||
sending += "<br>"
|
||||
if (msgStamped)
|
||||
sending += msgStamped
|
||||
sending += "<br>"
|
||||
screen = 7 //if it's successful, this will get overrwritten (7 = unsufccessfull, 6 = successfull)
|
||||
if (sending)
|
||||
var/pass = 0
|
||||
for (var/obj/machinery/message_server/MS in world)
|
||||
if(!MS.active) continue
|
||||
MS.send_rc_message(href_list["department"],department,log_msg,msgStamped,msgVerified,priority)
|
||||
pass = 1
|
||||
|
||||
if(pass)
|
||||
|
||||
for (var/obj/machinery/requests_console/Console in allConsoles)
|
||||
if (ckey(Console.department) == ckey(href_list["department"]))
|
||||
|
||||
switch(priority)
|
||||
if("2") //High priority
|
||||
if(Console.newmessagepriority < 2)
|
||||
Console.newmessagepriority = 2
|
||||
Console.icon_state = "req_comp2"
|
||||
if(!Console.silent)
|
||||
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(5, Console.loc))
|
||||
O.show_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [department]'"))
|
||||
Console.messages += "<B><FONT color='red'>High Priority message from <A href='?src=\ref[Console];write=[ckey(department)]'>[department]</A></FONT></B><BR>[sending]"
|
||||
|
||||
// if("3") //Not implemanted, but will be //Removed as it doesn't look like anybody intends on implimenting it ~Carn
|
||||
// if(Console.newmessagepriority < 3)
|
||||
// Console.newmessagepriority = 3
|
||||
// Console.icon_state = "req_comp3"
|
||||
// if(!Console.silent)
|
||||
// playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
// for (var/mob/O in hearers(7, Console.loc))
|
||||
// O.show_message(text("\icon[Console] *The Requests Console yells: 'EXTREME PRIORITY alert in [department]'"))
|
||||
// Console.messages += "<B><FONT color='red'>Extreme Priority message from [ckey(department)]</FONT></B><BR>[message]"
|
||||
|
||||
else // Normal priority
|
||||
if(Console.newmessagepriority < 1)
|
||||
Console.newmessagepriority = 1
|
||||
Console.icon_state = "req_comp1"
|
||||
if(!Console.silent)
|
||||
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(4, Console.loc))
|
||||
O.show_message(text("\icon[Console] *The Requests Console beeps: 'Message from [department]'"))
|
||||
Console.messages += "<B>Message from <A href='?src=\ref[Console];write=[ckey(department)]'>[department]</A></FONT></B><BR>[message]"
|
||||
|
||||
screen = 6
|
||||
Console.luminosity = 2
|
||||
messages += "<B>Message sent to [dpt]</B><BR>[message]"
|
||||
else
|
||||
for (var/mob/O in hearers(4, src.loc))
|
||||
O.show_message(text("\icon[src] *The Requests Console beeps: 'NOTICE: No server detected!'"))
|
||||
|
||||
var/pass = 0
|
||||
screen = RCS_SENTFAIL
|
||||
for (var/obj/machinery/message_server/MS in world)
|
||||
if(!MS.active) continue
|
||||
MS.send_rc_message(ckey(href_list["department"]),department,log_msg,msgStamped,msgVerified,priority)
|
||||
pass = 1
|
||||
if(pass)
|
||||
screen = RCS_SENTPASS
|
||||
message_log += "<B>Message sent to [recipient]</B><BR>[message]"
|
||||
else
|
||||
audible_message(text("\icon[src] *The Requests Console beeps: 'NOTICE: No server detected!'"),,4)
|
||||
|
||||
//Handle screen switching
|
||||
switch(text2num(href_list["setScreen"]))
|
||||
if(null) //skip
|
||||
if(1) //req. assistance
|
||||
screen = 1
|
||||
if(2) //req. supplies
|
||||
screen = 2
|
||||
if(3) //relay information
|
||||
screen = 3
|
||||
// if(4) //write message
|
||||
// screen = 4
|
||||
if(5) //choose priority
|
||||
screen = 5
|
||||
if(6) //sent successfully
|
||||
screen = 6
|
||||
if(7) //unsuccessfull; not sent
|
||||
screen = 7
|
||||
if(8) //view messages
|
||||
screen = 8
|
||||
if(9) //authentication
|
||||
screen = 9
|
||||
if(10) //send announcement
|
||||
if(!announcementConsole) return
|
||||
screen = 10
|
||||
else //main menu
|
||||
dpt = ""
|
||||
msgVerified = ""
|
||||
msgStamped = ""
|
||||
message = ""
|
||||
priority = -1
|
||||
screen = 0
|
||||
if(href_list["setScreen"])
|
||||
var/tempScreen = text2num(href_list["setScreen"])
|
||||
if(tempScreen == RCS_ANNOUNCE && !announcementConsole)
|
||||
return
|
||||
if(tempScreen == RCS_VIEWMSGS)
|
||||
for (var/obj/machinery/requests_console/Console in allConsoles)
|
||||
if (Console.department == department)
|
||||
Console.newmessagepriority = 0
|
||||
Console.icon_state = "req_comp0"
|
||||
Console.set_light(1)
|
||||
if(tempScreen == RCS_MAINMENU)
|
||||
reset_message()
|
||||
screen = tempScreen
|
||||
|
||||
//Handle silencing the console
|
||||
switch( href_list["setSilent"] )
|
||||
if(null) //skip
|
||||
if("1") silent = 1
|
||||
else silent = 0
|
||||
if(href_list["toggleSilent"])
|
||||
silent = !silent
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
//err... hacking code, which has no reason for existing... but anyway... it's supposed to unlock priority 3 messanging on that console (EXTREME priority...) the code for that actually exists.
|
||||
/obj/machinery/requests_console/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob, params)
|
||||
//err... hacking code, which has no reason for existing... but anyway... it was once supposed to unlock priority 3 messanging on that console (EXTREME priority...), but the code for that was removed.
|
||||
/obj/machinery/requests_console/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob)
|
||||
/*
|
||||
if (istype(O, /obj/item/weapon/crowbar))
|
||||
if(open)
|
||||
@@ -382,27 +222,35 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
user << "You can't do much with that."*/
|
||||
|
||||
if (istype(O, /obj/item/weapon/card/id))
|
||||
if(screen == 9)
|
||||
if(inoperable(MAINT)) return
|
||||
if(screen == RCS_MESSAUTH)
|
||||
var/obj/item/weapon/card/id/T = O
|
||||
msgVerified = text("<font color='green'><b>Verified by [T.registered_name] ([T.assignment])</b></font>")
|
||||
updateUsrDialog()
|
||||
if(screen == 10)
|
||||
if(screen == RCS_ANNOUNCE)
|
||||
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
|
||||
reset_announce()
|
||||
user << "\red You are not authorized to send announcements."
|
||||
reset_message()
|
||||
user << "<span class='warning'>You are not authorized to send announcements.</span>"
|
||||
updateUsrDialog()
|
||||
if (istype(O, /obj/item/weapon/stamp))
|
||||
if(screen == 9)
|
||||
if(inoperable(MAINT)) return
|
||||
if(screen == RCS_MESSAUTH)
|
||||
var/obj/item/weapon/stamp/T = O
|
||||
msgStamped = text("<font color='blue'><b>Stamped with the [T.name]</b></font>")
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/requests_console/proc/reset_announce()
|
||||
announceAuth = 0
|
||||
|
||||
/obj/machinery/requests_console/proc/reset_message(var/mainmenu = 0)
|
||||
message = ""
|
||||
recipient = ""
|
||||
priority = 0
|
||||
msgVerified = ""
|
||||
msgStamped = ""
|
||||
announceAuth = 0
|
||||
announcement.announcer = ""
|
||||
if(mainmenu)
|
||||
screen = RCS_MAINMENU
|
||||
|
||||
@@ -149,7 +149,9 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
|
||||
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Meaty Ores", /datum/event/dust/meaty, 0, list(ASSIGNMENT_ENGINEER = 30)),
|
||||
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Communication Blackout", /datum/event/communications_blackout, 500, list(ASSIGNMENT_AI = 150, ASSIGNMENT_SECURITY = 120)),
|
||||
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Prison Break", /datum/event/prison_break, 0, list(ASSIGNMENT_SECURITY = 100)),
|
||||
// new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grid Check", /datum/event/grid_check, 200, list(ASSIGNMENT_ENGINEER = 60)),
|
||||
//new /datum/event_meta(EVENT_LEVEL_MODERATE, "Virology Breach", /datum/event/prison_break/virology, 0, list(ASSIGNMENT_MEDICAL = 100)),
|
||||
//new /datum/event_meta(EVENT_LEVEL_MODERATE, "Xenobiology Breach", /datum/event/prison_break/xenobiology, 0, list(ASSIGNMENT_SCIENCE = 100)),
|
||||
//new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grid Check", /datum/event/grid_check, 200, list(ASSIGNMENT_ENGINEER = 60)),
|
||||
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Electrical Storm", /datum/event/electrical_storm, 250, list(ASSIGNMENT_ENGINEER = 20, ASSIGNMENT_JANITOR = 150)),
|
||||
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Radiation Storm", /datum/event/radiation_storm, 0, list(ASSIGNMENT_MEDICAL = 50), 1),
|
||||
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Viral Infection", /datum/event/viral_infection, 0, list(ASSIGNMENT_MEDICAL = 150)),
|
||||
@@ -177,6 +179,7 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
|
||||
available_events = list(
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Nothing", /datum/event/nothing, 1320),
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Carp Migration", /datum/event/carp_migration, 0, list(ASSIGNMENT_SECURITY = 3), 1),
|
||||
//new /datum/event_meta(EVENT_LEVEL_MAJOR, "Containment Breach", /datum/event/prison_break/station, 0, list(ASSIGNMENT_ANY = 5)),
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Viral Infection", /datum/event/viral_infection, 0, list(ASSIGNMENT_MEDICAL = 30), 1),
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Blob", /datum/event/blob, 0, list(ASSIGNMENT_ENGINEER = 30), 1),
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meteor Wave", /datum/event/meteor_wave, 0, list(ASSIGNMENT_ENGINEER = 3), 1),
|
||||
|
||||
@@ -19,30 +19,10 @@
|
||||
without intervention this attack will succeed in approximately 10 minutes. Required intervention: temporary suspension of affected accounts until the attack has ceased. \
|
||||
Notifications will be sent as updates occur.<br>"
|
||||
var/my_department = "[station_name()] firewall subroutines"
|
||||
var/sending = message + "<font color='blue'><b>Message dispatched by [my_department].</b></font>"
|
||||
|
||||
var/pass = 0
|
||||
for(var/obj/machinery/message_server/MS in world)
|
||||
if(!MS.active) continue
|
||||
// /obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1)
|
||||
MS.send_rc_message("Engineering/Security/Bridge", my_department, message, "", "", 2)
|
||||
pass = 1
|
||||
|
||||
if(pass)
|
||||
var/keyed_dpt1 = ckey("Engineering")
|
||||
var/keyed_dpt2 = ckey("Security")
|
||||
var/keyed_dpt3 = ckey("Bridge")
|
||||
for (var/obj/machinery/requests_console/Console in allConsoles)
|
||||
var/keyed_department = ckey(Console.department)
|
||||
if(keyed_department == keyed_dpt1 || keyed_department == keyed_dpt2 || keyed_department == keyed_dpt3)
|
||||
if(Console.newmessagepriority < 2)
|
||||
Console.newmessagepriority = 2
|
||||
Console.icon_state = "req_comp2"
|
||||
if(!Console.silent)
|
||||
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(5, Console.loc))
|
||||
O.show_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [my_department]'"))
|
||||
Console.messages += "<B><FONT color='red'>High Priority message from [my_department]</FONT></B><BR>[sending]"
|
||||
MS.send_rc_message("Head of Personnel's Desk", my_department, message, "", "", 2)
|
||||
|
||||
/datum/event/money_hacker/tick()
|
||||
if(world.time >= end_time)
|
||||
@@ -80,27 +60,7 @@
|
||||
message = "The attack has ceased, the affected accounts can now be brought online."
|
||||
|
||||
var/my_department = "[station_name()] firewall subroutines"
|
||||
var/sending = message + "<font color='blue'><b>Message dispatched by [my_department].</b></font>"
|
||||
|
||||
var/pass = 0
|
||||
for(var/obj/machinery/message_server/MS in world)
|
||||
if(!MS.active) continue
|
||||
// /obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1)
|
||||
MS.send_rc_message("Engineering/Security/Bridge", my_department, message, "", "", 2)
|
||||
pass = 1
|
||||
|
||||
if(pass)
|
||||
var/keyed_dpt1 = ckey("Engineering")
|
||||
var/keyed_dpt2 = ckey("Security")
|
||||
var/keyed_dpt3 = ckey("Bridge")
|
||||
for (var/obj/machinery/requests_console/Console in allConsoles)
|
||||
var/keyed_department = ckey(Console.department)
|
||||
if(keyed_department == keyed_dpt1 || keyed_department == keyed_dpt2 || keyed_department == keyed_dpt3)
|
||||
if(Console.newmessagepriority < 2)
|
||||
Console.newmessagepriority = 2
|
||||
Console.icon_state = "req_comp2"
|
||||
if(!Console.silent)
|
||||
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(5, Console.loc))
|
||||
O.show_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [my_department]'"))
|
||||
Console.messages += "<B><FONT color='red'>High Priority message from [my_department]</FONT></B><BR>[sending]"
|
||||
MS.send_rc_message("Head of Personnel's Desk", my_department, message, "", "", 2)
|
||||
|
||||
@@ -1,56 +1,71 @@
|
||||
/datum/event/prison_break
|
||||
announceWhen = 50
|
||||
startWhen = 5
|
||||
announceWhen = 75
|
||||
|
||||
var/releaseWhen = 60
|
||||
var/list/area/areas = list() //List of areas to affect. Filled by start()
|
||||
|
||||
var/eventDept = "Security" //Department name in announcement
|
||||
var/list/areaName = list("Brig") //Names of areas mentioned in AI and Engineering announcements
|
||||
var/list/areaType = list(/area/security/prison, /area/security/brig) //Area types to include.
|
||||
var/list/areaNotType = list() //Area types to specifically exclude.
|
||||
|
||||
/datum/event/prison_break/virology
|
||||
eventDept = "Medical"
|
||||
areaName = list("Virology")
|
||||
areaType = list(/area/medical/virology, /area/medical/virology/lab)
|
||||
|
||||
/datum/event/prison_break/xenobiology
|
||||
eventDept = "Science"
|
||||
areaName = list("Xenobiology")
|
||||
areaType = list(/area/toxins/xenobiology)
|
||||
areaNotType = list(/area/toxins/xenobiology/xenoflora, /area/toxins/xenobiology/xenoflora_storage)
|
||||
|
||||
/datum/event/prison_break/station
|
||||
eventDept = "Station"
|
||||
areaName = list("Brig","Virology","Xenobiology")
|
||||
areaType = list(/area/security/prison, /area/security/brig, /area/medical/virology, /area/medical/virology/lab, /area/toxins/xenobiology)
|
||||
areaNotType = list(/area/toxins/xenobiology/xenoflora, /area/toxins/xenobiology/xenoflora_storage)
|
||||
|
||||
var/releaseWhen = 25
|
||||
var/list/area/prisonAreas = list()
|
||||
var/list/potentialAreas = list("/area/security/prison","/area/security/brig","/area/security/processing","/area/security/permabrig","/area/security/lobby","/area/security/lobby")
|
||||
var/list/candidateAreas = list()
|
||||
|
||||
/datum/event/prison_break/setup()
|
||||
announceWhen = rand(50, 60)
|
||||
releaseWhen = rand(20, 30)
|
||||
announceWhen = rand(75, 105)
|
||||
releaseWhen = rand(60, 90)
|
||||
|
||||
src.startWhen = src.releaseWhen-1
|
||||
src.endWhen = src.releaseWhen+1
|
||||
|
||||
for(var/areaa in potentialAreas)
|
||||
var/path = text2path(areaa)
|
||||
candidateAreas += typesof(path)
|
||||
|
||||
for(var/area/A in world)
|
||||
if(is_type_in_list(A, candidateAreas))
|
||||
prisonAreas += A
|
||||
src.endWhen = src.releaseWhen+2
|
||||
|
||||
|
||||
/datum/event/prison_break/announce()
|
||||
if(prisonAreas && prisonAreas.len > 0)
|
||||
command_announcement.Announce("[pick("Gr3y.T1d3 virus","Malignant trojan")] detected in [station_name()] imprisonment subroutines. Recommend station AI involvement.", "Security Alert")
|
||||
else
|
||||
world.log << "ERROR: Could not initate grey-tide. Unable find prison or brig area."
|
||||
kill()
|
||||
if(areas && areas.len > 0)
|
||||
command_announcement.Announce("[pick("Gr3y.T1d3 virus","Malignant trojan")] detected in [station_name()] [(eventDept == "Security")? "imprisonment":"containment"] subroutines. Secure any compromised areas immediately. Station AI involvement is recommended.", "[eventDept] Alert")
|
||||
|
||||
|
||||
/datum/event/prison_break/start()
|
||||
if(prisonAreas && prisonAreas.len > 0)
|
||||
for(var/area/A in prisonAreas)
|
||||
for(var/obj/machinery/light/L in A)
|
||||
L.flicker(10)
|
||||
for(var/area/A in world)
|
||||
if(is_type_in_list(A,areaType) && !is_type_in_list(A,areaNotType))
|
||||
areas += A
|
||||
|
||||
if(areas && areas.len > 0)
|
||||
var/my_department = "[station_name()] firewall subroutines"
|
||||
var/rc_message = "An unknown malicious program has been detected in the [english_list(areaName)] lighting and airlock control systems at [worldtime2text()]. Systems will be fully compromised within approximately three minutes. Direct intervention is required immediately.<br>"
|
||||
for(var/obj/machinery/message_server/MS in world)
|
||||
MS.send_rc_message("Engineering", my_department, rc_message, "", "", 2)
|
||||
for(var/mob/living/silicon/ai/A in player_list)
|
||||
A << "<span class='danger'>Malicious program detected in the [english_list(areaName)] lighting and airlock control systems by [my_department].</span>"
|
||||
|
||||
else
|
||||
world.log << "ERROR: Could not initate grey-tide. Unable to find suitable containment area."
|
||||
kill()
|
||||
|
||||
|
||||
/datum/event/prison_break/tick()
|
||||
if(activeFor == releaseWhen)
|
||||
if(prisonAreas && prisonAreas.len > 0)
|
||||
for(var/area/A in prisonAreas)
|
||||
for(var/obj/machinery/power/apc/temp_apc in A)
|
||||
temp_apc.overload_lighting()
|
||||
if(areas && areas.len > 0)
|
||||
for(var/area/A in areas)
|
||||
for(var/obj/machinery/light/L in A)
|
||||
L.flicker(10)
|
||||
|
||||
for(var/obj/structure/closet/secure_closet/brig/temp_closet in A)
|
||||
temp_closet.locked = 0
|
||||
temp_closet.icon_state = temp_closet.icon_closed
|
||||
|
||||
for(var/obj/machinery/door/airlock/security/temp_airlock in A)
|
||||
temp_airlock.prison_open()
|
||||
|
||||
for(var/obj/machinery/door/airlock/glass_security/temp_glassairlock in A)
|
||||
temp_glassairlock.prison_open()
|
||||
|
||||
for(var/obj/machinery/door_timer/temp_timer in A)
|
||||
temp_timer.releasetime = 1
|
||||
/datum/event/prison_break/end()
|
||||
for(var/area/A in shuffle(areas))
|
||||
A.prison_break()
|
||||
|
||||
@@ -1308,15 +1308,16 @@ obj/machinery/power/apc/proc/autoset(var/val, var/on)
|
||||
|
||||
// overload all the lights in this APC area
|
||||
|
||||
/obj/machinery/power/apc/proc/overload_lighting()
|
||||
/obj/machinery/power/apc/proc/overload_lighting(var/chance = 100)
|
||||
if(/* !get_connection() || */ !operating || shorted)
|
||||
return
|
||||
if( cell && cell.charge>=20)
|
||||
cell.use(20);
|
||||
spawn(0)
|
||||
for(var/obj/machinery/light/L in area)
|
||||
L.on = 1
|
||||
L.broken()
|
||||
if(prob(chance))
|
||||
L.on = 1
|
||||
L.broken()
|
||||
sleep(1)
|
||||
|
||||
/obj/machinery/power/apc/Destroy()
|
||||
|
||||
@@ -84,6 +84,31 @@ var/global/list/obj/machinery/message_server/message_servers = list()
|
||||
|
||||
/obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1)
|
||||
rc_msgs += new/datum/data_rc_msg(recipient,sender,message,stamp,id_auth)
|
||||
var/authmsg = "[message]<br>"
|
||||
if (id_auth)
|
||||
authmsg += "[id_auth]<br>"
|
||||
if (stamp)
|
||||
authmsg += "[stamp]<br>"
|
||||
for (var/obj/machinery/requests_console/Console in allConsoles)
|
||||
if (ckey(Console.department) == ckey(recipient))
|
||||
if(Console.inoperable())
|
||||
Console.message_log += "<B>Message lost due to console failure.</B><BR>Please contact [station_name()] system adminsitrator or AI for technical assistance.<BR>"
|
||||
continue
|
||||
if(Console.newmessagepriority < priority)
|
||||
Console.newmessagepriority = priority
|
||||
Console.icon_state = "req_comp[priority]"
|
||||
switch(priority)
|
||||
if(2)
|
||||
if(!Console.silent)
|
||||
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
Console.audible_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [sender]'"),,5)
|
||||
Console.message_log += "<B><FONT color='red'>High Priority message from <A href='?src=\ref[Console];write=[sender]'>[sender]</A></FONT></B><BR>[authmsg]"
|
||||
else
|
||||
if(!Console.silent)
|
||||
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
Console.audible_message(text("\icon[Console] *The Requests Console beeps: 'Message from [sender]'"),,4)
|
||||
Console.message_log += "<B>Message from <A href='?src=\ref[Console];write=[sender]'>[sender]</A></B><BR>[authmsg]"
|
||||
Console.set_light(2)
|
||||
|
||||
/obj/machinery/message_server/attack_hand(user as mob)
|
||||
// user << "\blue There seem to be some parts missing from this server. They should arrive on the station in a few days, give or take a few CentCom delays."
|
||||
|
||||
Reference in New Issue
Block a user