From 6d2cd82a1434273c5d6dfcc87db9b975573fa373 Mon Sep 17 00:00:00 2001 From: Kilakk Date: Sun, 18 Aug 2013 14:39:08 -0400 Subject: [PATCH] Added a fax machine to send messages to centcom with. * Formatting can be seen by admins * HTML tags can be used in replies * Replies are sent directly to the fax machine and have a fancy stamp on them * Currently uses access_lawyer but this might change --- baystation12.dme | 1 + code/WorkInProgress/kilakk/fax.dm | 148 ++++++++++++++++++++++++++++++ code/modules/admin/topic.dm | 35 +++++++ 3 files changed, 184 insertions(+) create mode 100644 code/WorkInProgress/kilakk/fax.dm diff --git a/baystation12.dme b/baystation12.dme index 0365923da86..c071f2e309e 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1324,6 +1324,7 @@ #include "code\WorkInProgress\Cael_Aislinn\Supermatter\ZeroPointLaser.dm" #include "code\WorkInProgress\Chinsky\ashtray.dm" #include "code\WorkInProgress\Cib\MedicalSideEffects.dm" +#include "code\WorkInProgress\kilakk\fax.dm" #include "code\WorkInProgress\Mini\ATM.dm" #include "code\WorkInProgress\Mini\atmos_control.dm" #include "code\WorkInProgress\Ported\policetape.dm" diff --git a/code/WorkInProgress/kilakk/fax.dm b/code/WorkInProgress/kilakk/fax.dm new file mode 100644 index 00000000000..42f070ccf6b --- /dev/null +++ b/code/WorkInProgress/kilakk/fax.dm @@ -0,0 +1,148 @@ +/obj/machinery/faxmachine + name = "fax machine" + icon = 'icons/obj/library.dmi' + icon_state = "bigscanner" + req_access = list(access_lawyer) + anchored = 1 + density = 1 + use_power = 1 + idle_power_usage = 30 + active_power_usage = 200 + power_channel = EQUIP + var/obj/item/weapon/card/id/scan = null // identification + var/authenticated = 0 + var/obj/item/weapon/paper/tofax = null // what we're sending to central + var/sendcooldown = 0 // to avoid spamming fax messages + + attack_ai(mob/user as mob) + return attack_hand(user) + + attack_paw(mob/user as mob) + return attack_hand(user) + + attack_hand(mob/user as mob) + user.set_machine(src) + + var/dat = "Central Command Fax Machine
" + + var/scan_name + if(scan) + scan_name = scan.name + else + scan_name = "--------" + + dat += "Confirm Identity: [scan_name]
" + + if(authenticated) + dat += "{Log Out}" + else + dat += "{Log In}" + + dat += "
" + + if(authenticated) + dat += "Logged in to: Central Command Quantum Entanglement Network

" + + if(tofax) + dat += "Remove Paper

" + + if(sendcooldown) + dat += "Transmitter arrays realigning. Please stand by.
" + + else + dat += "Send
" + dat += "Currently sending: [tofax.name]" + + else + if(sendcooldown) + dat += "Please insert paper to send to Central Command via secure connection.

" + dat += "Transmitter arrays realigning. Please stand by.
" + else + dat += "Please insert paper to send to Central Command via secure connection.

" + + else + dat += "Proper authentication is required to use this device.

" + + if(tofax) + dat += "Remove Paper
" + + user << browse(dat, "window=copier") + onclose(user, "copier") + return + + Topic(href, href_list) + + if(href_list["send"]) + if(tofax) + Centcomm_fax(tofax.info, tofax.name, usr) + usr << "Message transmitted." + sendcooldown = 1 + spawn(3000) // three minute cooldown. might mess with this number a bit as time goes on + sendcooldown = 0 + + if(href_list["remove"]) + if(tofax) + tofax.loc = usr.loc + usr.put_in_hands(tofax) + usr << "You take the paper out of \the [src]." + tofax = null + + if(href_list["scan"]) + if (scan) + if(ishuman(usr)) + scan.loc = usr.loc + if(!usr.get_active_hand()) + usr.put_in_hands(scan) + scan = null + else + scan.loc = src.loc + scan = null + else + var/obj/item/I = usr.get_active_hand() + if (istype(I, /obj/item/weapon/card/id)) + usr.drop_item() + I.loc = src + scan = I + authenticated = 0 + + if(href_list["auth"]) + if ( (!( authenticated ) && (scan)) ) + if (check_access(scan)) + authenticated = 1 + + if(href_list["logout"]) + authenticated = 0 + + updateUsrDialog() + + attackby(obj/item/O as obj, mob/user as mob) + + if(istype(O, /obj/item/weapon/paper)) + if(!tofax) + user.drop_item() + tofax = O + O.loc = src + user << "You insert the paper into \the [src]." + flick("bigscanner1", src) + updateUsrDialog() + else + user << "There is already something in \the [src]." + + else if(istype(O, /obj/item/weapon/card/id)) + var/obj/item/weapon/card/id/idcard = O + + if(!scan) + usr.drop_item() + idcard.loc = src + scan = idcard + + else if(istype(O, /obj/item/weapon/wrench)) + playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) + anchored = !anchored + user << "You [anchored ? "wrench" : "unwrench"] \the [src]." + return + +/proc/Centcomm_fax(var/sent, var/sentname, var/mob/Sender) + + var/msg = "\blue CENTCOMM FAX: [key_name(Sender, 1)] (PP) (VV) (SM) (JMP) (CA) (RPLY): Receiving '[sentname]' via secure connection ... view message" + admins << msg diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 803f2b12545..e5a6574ccca 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1433,6 +1433,41 @@ log_admin("[src.owner] replied to [key_name(H)]'s Syndicate message with the message [input].") H << "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from your benefactor. Message as follows, agent. [input]. Message ends.\"" + else if(href_list["CentcommFaxView"]) + var/info = locate(href_list["CentcommFaxView"]) + + usr << browse("Centcomm Fax Message[info]", "window=Centcomm Fax Message") + + else if(href_list["CentcommFaxReply"]) + var/mob/living/carbon/human/H = locate(href_list["CentcommFaxReply"]) + + var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via secure connection. NOTE: BBCode does not work, but HTML tags do! Use
for line breaks.", "Outgoing message from Centcomm", "") as message|null + if(!input) return + + var/customname = input(src.owner, "Pick a title for the report", "Title") as text|null + + for(var/obj/machinery/faxmachine/F in world) + if(! (F.stat & (BROKEN|NOPOWER) ) ) + var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( F.loc ) + P.name = "[command_name()]- [customname]" + P.info = input + P.update_icon() + playsound(F.loc, "sound/items/polaroid1.ogg", 50, 1) + + // Stamps + var/image/stampoverlay = image('icons/obj/bureaucracy.dmi') + stampoverlay.icon_state = "paper_stamp-cent" + if(!P.stamped) + P.stamped = new + P.stamped += /obj/item/weapon/stamp + P.overlays += stampoverlay + P.stamps += "
This paper has been stamped by the Central Command Quantum Relay." + + src.owner << "Message reply to transmitted successfully." + log_admin("[key_name(src.owner)] replied to a fax message from [key_name(H)]: [input]") + message_admins("[key_name_admin(src.owner)] replied to a fax message from [key_name_admin(H)]", 1) + + else if(href_list["jumpto"]) if(!check_rights(R_ADMIN)) return