diff --git a/baystation12.dme b/baystation12.dme index dde8ecee60a..0bd69dcf253 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -327,6 +327,7 @@ #include "code\game\machinery\computer\crew.dm" #include "code\game\machinery\computer\HolodeckControl.dm" #include "code\game\machinery\computer\hologram.dm" +#include "code\game\machinery\computer\honkputer.dm" #include "code\game\machinery\computer\law.dm" #include "code\game\machinery\computer\medical.dm" #include "code\game\machinery\computer\message.dm" diff --git a/code/game/machinery/computer/honkputer.dm b/code/game/machinery/computer/honkputer.dm new file mode 100644 index 00000000000..4cadd27bab1 --- /dev/null +++ b/code/game/machinery/computer/honkputer.dm @@ -0,0 +1,93 @@ +/obj/machinery/computer/HONKputer + name = "HONKputer Mark I" + desc = "A yellow computer used in case of critically low levels of HONK." + icon = 'icons/obj/machines/HONKputer.dmi' + icon_state = "honk" + req_access = list(access_clown) + circuit = "/obj/item/weapon/circuitboard/HONKputer" + var/authenticated = 0 + var/message_cooldown = 0 + var/state = STATE_DEFAULT + var/const/STATE_DEFAULT = 1 + +/obj/machinery/computer/communications/process() + if(..()) + if(state != STATE_STATUSDISPLAY) + src.updateDialog() + +/obj/machinery/computer/HONKputer/Topic(href, href_list) + if(..()) + return + if (src.z > 1) + usr << "\red Unable to establish a connection: \black You're too far away from the station!" + return + 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) || src.emagged==1) + authenticated = 1 + if("logout") + authenticated = 0 + + if("MessageHonkplanet") + if(src.authenticated==1) + if(message_cooldown) + usr << "Arrays recycling. Please stand by." + return + var/input = stripped_input(usr, "Please choose a message to transmit to your HONKbrothers on the homeworld. Transmission does not guarantee a response.", "To abort, send an empty message.", "") + if(!input || !(usr in view(1,src))) + return + HONK_announce(input, usr) + usr << "Message transmitted." + log_say("[key_name(usr)] has made a HONKplanet announcement: [input]") + message_cooldown = 1 + spawn(6000)//10 minute cooldown + message_cooldown = 0 + + src.updateUsrDialog() + +/obj/machinery/computer/HONKputer/attackby(var/obj/I as obj, var/mob/user as mob) + if(istype(I,/obj/item/weapon/card/emag/)) + src.emagged = 1 + user << "You scramble the login circuits, allowing anyone to use the console!" + ..() + + +/obj/machinery/computer/HONKputer/attack_hand(var/mob/user as mob) + if(..()) + return + if (src.z > 6) + user << "\red Unable to establish a connection: \black You're too far away from the station!" + return + + user.set_machine(src) + var/dat = "HONKputer Interface" + + if (istype(user, /mob/living/silicon)) + user << "This console is not networked to the rest of the grid." + return + + switch(src.state) + if(STATE_DEFAULT) + if (src.authenticated) + dat += "
\[ Log Out \]" + dat += "
\[ Send an emergency message to Honkplanet \]" + else + dat += "
\[ Log In \]" + + + dat += "
\[ [(src.state != STATE_DEFAULT) ? "Main Menu | " : ""]Close \]" + user << browse(dat, "window=honkputer;size=400x500") + onclose(user, "honkputer") diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 1da2c651b8f..2bdb67bbfcb 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1437,6 +1437,22 @@ 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["HONKReply"]) + var/mob/living/carbon/human/H = locate(href_list["HONKReply"]) + if(!istype(H)) + usr << "This can only be used on instances of type /mob/living/carbon/human" + return + if(!istype(H.ears, /obj/item/device/radio/headset)) + usr << "The person you are trying to contact is not wearing a headset" + return + + var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from HONKplanet", "") + if(!input) return + + src.owner << "You sent [input] to [H] via a secure channel." + log_admin("[src.owner] replied to [key_name(H)]'s HONKplanet 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 HONKbrothers. Message as follows, HONK. [input]. Message ends, HONK.\"" + else if(href_list["CentcommFaxView"]) var/info = locate(href_list["CentcommFaxView"]) diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index 906ec8a5ac4..1e14689d676 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -36,3 +36,8 @@ var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN) msg = "\blue SYNDICATE:[key_name(Sender, 1)] (PP) (VV) (SM) (JMP) (CA) (BSA) (RPLY): [msg]" admins << msg + +/proc/HONK_announce(var/text , var/mob/Sender) + var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN) + msg = "\blue HONK:[key_name(Sender, 1)] (PP) (VV) (SM) (JMP) (CA) (BSA) (RPLY): [msg]" + admins << msg \ No newline at end of file diff --git a/icons/obj/machines/HONKputer.dmi b/icons/obj/machines/HONKputer.dmi index 1603ba4e70c..e960a822ac0 100644 Binary files a/icons/obj/machines/HONKputer.dmi and b/icons/obj/machines/HONKputer.dmi differ