diff --git a/baystation12.dme b/baystation12.dme index 62e10d2098..6448768527 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1120,6 +1120,7 @@ #include "code\modules\organs\wound.dm" #include "code\modules\paperwork\carbonpaper.dm" #include "code\modules\paperwork\clipboard.dm" +#include "code\modules\paperwork\faxmachine2.dm" #include "code\modules\paperwork\filingcabinet.dm" #include "code\modules\paperwork\folders.dm" #include "code\modules\paperwork\handlabeler.dm" @@ -1459,7 +1460,6 @@ #include "code\WorkInProgress\computer3\computers\robot.dm" #include "code\WorkInProgress\computer3\computers\security.dm" #include "code\WorkInProgress\computer3\computers\welcome.dm" -#include "code\WorkInProgress\kilakk\fax.dm" #include "code\WorkInProgress\Mini\atmos_control.dm" #include "code\WorkInProgress\Ported\policetape.dm" #include "code\WorkInProgress\SkyMarshal\officer_stuff.dm" diff --git a/code/WorkInProgress/kilakk/fax.dm b/code/WorkInProgress/kilakk/fax.dm index 2c34229620..d25347b71e 100644 --- a/code/WorkInProgress/kilakk/fax.dm +++ b/code/WorkInProgress/kilakk/fax.dm @@ -5,6 +5,7 @@ var/list/alldepartments = list("Central Command") name = "fax machine" icon = 'icons/obj/library.dmi' icon_state = "fax" + insert_anim = "faxsend" req_one_access = list(access_lawyer, access_heads, access_armory) //Warden needs to be able to Fax solgov too. anchored = 1 density = 1 @@ -17,6 +18,8 @@ var/list/alldepartments = list("Central Command") var/authenticated = 0 var/obj/item/weapon/paper/tofax = null // what we're sending + var/obj/item/weapon/paper_bundle/bundle = null // If we are sending a bundle, this will hold the bundle and tofax will reference the first page of the bundle + var/sendcooldown = 0 // to avoid spamming fax messages var/department = "Unknown" // our department @@ -163,7 +166,7 @@ var/list/alldepartments = list("Central Command") tofax = O O.loc = src user << "You insert the paper into \the [src]." - flick("faxsend", src) + flick(insert_anim, src) updateUsrDialog() else user << "There is already something in \the [src]." @@ -182,6 +185,9 @@ var/list/alldepartments = list("Central Command") user << "You [anchored ? "wrench" : "unwrench"] \the [src]." return +/obj/machinery/photocopier/faxmachine/insert(obj/item/O as obj, mob/user as mob) + ..() + /proc/Centcomm_fax(var/originfax, 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" diff --git a/code/game/gamemodes/mutiny/mutiny_fluff.dm b/code/game/gamemodes/mutiny/mutiny_fluff.dm index f8634e8e76..2e4ad147a8 100644 --- a/code/game/gamemodes/mutiny/mutiny_fluff.dm +++ b/code/game/gamemodes/mutiny/mutiny_fluff.dm @@ -5,7 +5,7 @@ mode = M proc/announce_directives() - for (var/obj/machinery/faxmachine/fax in world) + for (var/obj/machinery/photocopier/faxmachine/fax in world) if (fax.department == "Captain's Office") var/obj/item/weapon/paper/directive_x = new(fax.loc) directive_x.name = "emergency action message" diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index cfa61ba062..c8a2b86982 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1490,14 +1490,14 @@ else if(href_list["CentcommFaxReply"]) var/mob/living/carbon/human/H = locate(href_list["CentcommFaxReply"]) - var/obj/machinery/faxmachine/fax = locate(href_list["originfax"]) + var/obj/machinery/photocopier/faxmachine/fax = locate(href_list["originfax"]) 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 machines) + for(var/obj/machinery/photocopier/faxmachine/F in machines) if(F == fax) if(! (F.stat & (BROKEN|NOPOWER) ) ) @@ -1530,14 +1530,14 @@ else if(href_list["SolGovFaxReply"]) var/mob/living/carbon/human/H = locate(href_list["SolGovFaxReply"]) - var/obj/machinery/faxmachine/fax = locate(href_list["originfax"]) + var/obj/machinery/photocopier/faxmachine/fax = locate(href_list["originfax"]) 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 machines) + for(var/obj/machinery/photocopier/faxmachine/F in machines) if(F == fax) if(! (F.stat & (BROKEN|NOPOWER) ) ) diff --git a/code/modules/paperwork/faxmachine2.dm b/code/modules/paperwork/faxmachine2.dm new file mode 100644 index 0000000000..a94f0ea5e6 --- /dev/null +++ b/code/modules/paperwork/faxmachine2.dm @@ -0,0 +1,192 @@ +var/list/obj/machinery/photocopier/faxmachine/allfaxes = list() +var/list/alldepartments = list("Central Command", "Sol Government") + +/obj/machinery/photocopier/faxmachine + name = "fax machine" + icon = 'icons/obj/library.dmi' + icon_state = "fax" + insert_anim = "faxsend" + req_one_access = list(access_lawyer, access_heads, access_armory) //Warden needs to be able to Fax solgov too. + + use_power = 1 + idle_power_usage = 30 + active_power_usage = 200 + + var/obj/item/weapon/card/id/scan = null // identification + var/authenticated = 0 + var/sendcooldown = 0 // to avoid spamming fax messages + + var/department = "Unknown" // our department + + var/destination = "Central Command" // the department we're sending to + +/obj/machinery/photocopier/faxmachine/New() + ..() + allfaxes += src + + if( !("[department]" in alldepartments) ) + alldepartments |= department + +/obj/machinery/photocopier/faxmachine/attack_hand(mob/user as mob) + user.set_machine(src) + + var/dat = "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(copyitem) + dat += "Remove Item

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

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

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

" + + if(copyitem) + dat += "Remove Item
" + + user << browse(dat, "window=copier") + onclose(user, "copier") + return + +/obj/machinery/photocopier/faxmachine/Topic(href, href_list) + if(href_list["send"]) + if(copyitem) + + if(destination == "Central Command") + //Centcomm_fax(src, tofax.info, tofax.name, usr) + sendcooldown = 1800 + + else if(destination == "Sol Government") + //Solgov_fax(src, tofax.info, tofax.name, usr) + sendcooldown = 1800 + else + sendfax(destination) + + if (sendcooldown) + spawn(sendcooldown) // cooldown time + sendcooldown = 0 + + else if(href_list["remove"]) + if(copyitem) + copyitem.loc = usr.loc + usr.put_in_hands(copyitem) + usr << "You take \the [copyitem] out of \the [src]." + copyitem = null + updateUsrDialog() + + 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["dept"]) + var/lastdestination = destination + destination = input(usr, "Which department?", "Choose a department", "") as null|anything in alldepartments + if(!destination) destination = lastdestination + + if(href_list["auth"]) + if ( (!( authenticated ) && (scan)) ) + if (check_access(scan)) + authenticated = 1 + + if(href_list["logout"]) + authenticated = 0 + + updateUsrDialog() + +/obj/machinery/photocopier/faxmachine/proc/admin_fax() + //TODO + +/obj/machinery/photocopier/faxmachine/proc/sendfax(var/destination) + if(stat & (BROKEN|NOPOWER)) + return + + var/sent = 0 + + use_power(200) + for(var/obj/machinery/photocopier/faxmachine/F in allfaxes) + if( F.department == destination ) + sent = F.recievefax(copyitem) + + if (sent) + visible_message("[src] beeps, \"Message transmitted successfully.\"") + sendcooldown = 600 + else + visible_message("[src] beeps, \"Error transmitting message.\"") + +/obj/machinery/photocopier/faxmachine/proc/recievefax(var/obj/item/incoming) + if(stat & (BROKEN|NOPOWER)) + return 0 + + flick("faxreceive", src) + playsound(loc, "sound/items/polaroid1.ogg", 50, 1) + + // give the sprite some time to flick + sleep(20) + + if (istype(incoming, /obj/item/weapon/paper)) + copy(incoming) + else if (istype(incoming, /obj/item/weapon/photo)) + photocopy(incoming) + else if (istype(incoming, /obj/item/weapon/paper_bundle)) + bundlecopy(incoming) + else + return 0 + + use_power(active_power_usage) + return 1 + +/proc/Centcomm_fax(var/originfax, var/sent, var/sentname, var/mob/Sender) + + var/msg = "\blue CENTCOMM FAX: [key_name(Sender, 1)] (PP) (VV) (SM) (JMP) (CA) (REPLY): Receiving '[sentname]' via secure connection ... view message" + + admins << msg + +/proc/Solgov_fax(var/originfax, var/sent, var/sentname, var/mob/Sender) + var/msg = "\blue SOL GOVERNMENT FAX: [key_name(Sender, 1)] (PP) (VV) (SM) (JMP) (CA) (REPLY): Receiving '[sentname]' via secure connection ... view message" + + admins << msg \ No newline at end of file diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 6963fe2f75..8f40e0c051 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -2,211 +2,162 @@ name = "photocopier" icon = 'icons/obj/library.dmi' icon_state = "bigscanner" + var/insert_anim = "bigscanner1" anchored = 1 density = 1 use_power = 1 idle_power_usage = 30 active_power_usage = 200 power_channel = EQUIP - var/obj/item/weapon/paper/copy = null //what's in the copier! - var/obj/item/weapon/photo/photocopy = null - var/obj/item/weapon/paper_bundle/bundle = null + var/obj/item/copyitem = null //what's in the copier! var/copies = 1 //how many copies to print! var/toner = 30 //how much toner is left! woooooo~ var/maxcopies = 10 //how many copies can be copied at once- idea shamelessly stolen from bs12's copier! - attack_ai(mob/user as mob) - return attack_hand(user) +/obj/machinery/photocopier/attack_ai(mob/user as mob) + return attack_hand(user) - attack_paw(mob/user as mob) - return attack_hand(user) +/obj/machinery/photocopier/attack_paw(mob/user as mob) + return attack_hand(user) - attack_hand(mob/user as mob) - user.set_machine(src) +/obj/machinery/photocopier/attack_hand(mob/user as mob) + user.set_machine(src) - var/dat = "Photocopier

" - if(copy || photocopy || bundle) - dat += "Remove Paper
" - if(toner) - dat += "Copy
" - dat += "Printing: [copies] copies." - dat += "- " - dat += "+

" - else if(toner) - dat += "Please insert paper to copy.

" - if(istype(user,/mob/living/silicon)) - dat += "Print photo from database

" - dat += "Current toner level: [toner]" - if(!toner) - dat +="
Please insert a new toner cartridge!" - user << browse(dat, "window=copier") - onclose(user, "copier") - return + var/dat = "Photocopier

" + if(copyitem) + dat += "Remove Item
" + if(toner) + dat += "Copy
" + dat += "Printing: [copies] copies." + dat += "- " + dat += "+

" + else if(toner) + dat += "Please insert something to copy.

" + if(istype(user,/mob/living/silicon)) + dat += "Print photo from database

" + dat += "Current toner level: [toner]" + if(!toner) + dat +="
Please insert a new toner cartridge!" + user << browse(dat, "window=copier") + onclose(user, "copier") + return - Topic(href, href_list) - if(href_list["copy"]) - if(copy) - for(var/i = 0, i < copies, i++) - if(toner > 0) - copy(copy) - sleep(15) - else - break - updateUsrDialog() - else if(photocopy) - for(var/i = 0, i < copies, i++) - if(toner > 0) - photocopy(photocopy) - sleep(15) - else - break - updateUsrDialog() - else if(bundle) - for(var/i = 0, i < copies, i++) - if(toner <= 0) - break - var/obj/item/weapon/paper_bundle/p = new /obj/item/weapon/paper_bundle (src) - var/j = 0 - for(var/obj/item/weapon/W in bundle) - if(toner <= 0) - usr << "The photocopier couldn't finish the printjob." - break - else if(istype(W, /obj/item/weapon/paper)) - W = copy(W) - else if(istype(W, /obj/item/weapon/photo)) - W = photocopy(W) - W.loc = p - p.amount++ - j++ - p.amount-- - p.loc = src.loc - p.update_icon() - p.icon_state = "paper_words" - p.name = bundle.name - p.pixel_y = rand(-8, 8) - p.pixel_x = rand(-9, 9) - sleep(15*j) - updateUsrDialog() - else if(href_list["remove"]) - if(copy) - copy.loc = usr.loc - usr.put_in_hands(copy) - usr << "You take the paper out of \the [src]." - copy = null - updateUsrDialog() - else if(photocopy) - photocopy.loc = usr.loc - usr.put_in_hands(photocopy) - usr << "You take the photo out of \the [src]." - photocopy = null - updateUsrDialog() - else if(bundle) - bundle.loc = usr.loc - usr.put_in_hands(bundle) - usr << "You take the paper bundle out of \the [src]." - bundle = null - updateUsrDialog() - else if(href_list["min"]) - if(copies > 1) - copies-- - updateUsrDialog() - else if(href_list["add"]) - if(copies < maxcopies) - copies++ - updateUsrDialog() - else if(href_list["aipic"]) - if(!istype(usr,/mob/living/silicon)) return - if(toner >= 5) - var/mob/living/silicon/tempAI = usr - var/obj/item/device/camera/siliconcam/camera = tempAI.aiCamera - - if(!camera) - return - var/datum/picture/selection = camera.selectpicture() - if (!selection) - return - - var/obj/item/weapon/photo/p = new /obj/item/weapon/photo (src.loc) - p.construct(selection) - if (p.desc == "") - p.desc += "Copied by [tempAI.name]" - else - p.desc += " - Copied by [tempAI.name]" - toner -= 5 +/obj/machinery/photocopier/Topic(href, href_list) + if(href_list["copy"]) + if(stat & (BROKEN|NOPOWER)) + return + + for(var/i = 0, i < copies, i++) + if(toner <= 0) + break + + if (istype(copyitem, /obj/item/weapon/paper)) + copy(copyitem) sleep(15) + else if (istype(copyitem, /obj/item/weapon/photo)) + photocopy(copyitem) + sleep(15) + else if (istype(copyitem, /obj/item/weapon/paper_bundle)) + var/obj/item/weapon/paper_bundle/B = bundlecopy(copyitem) + sleep(15*B.amount) + else + usr << "\The [copyitem] can't be copied by \the [src]." + break + + use_power(active_power_usage) + updateUsrDialog() + else if(href_list["remove"]) + if(copyitem) + copyitem.loc = usr.loc + usr.put_in_hands(copyitem) + usr << "You take \the [copyitem] out of \the [src]." + copyitem = null updateUsrDialog() + else if(href_list["min"]) + if(copies > 1) + copies-- + updateUsrDialog() + else if(href_list["add"]) + if(copies < maxcopies) + copies++ + updateUsrDialog() + else if(href_list["aipic"]) + if(!istype(usr,/mob/living/silicon)) return + if(stat & (BROKEN|NOPOWER)) return + + if(toner >= 5) + var/mob/living/silicon/tempAI = usr + var/obj/item/device/camera/siliconcam/camera = tempAI.aiCamera - attackby(obj/item/O as obj, mob/user as mob) - if(istype(O, /obj/item/weapon/paper)) - if(!copy && !photocopy && !bundle) - user.drop_item() - copy = 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/photo)) - if(!copy && !photocopy && !bundle) - user.drop_item() - photocopy = O - O.loc = src - user << "You insert the photo into \the [src]." - flick("bigscanner1", src) - updateUsrDialog() - else - user << "There is already something in \the [src]." - else if(istype(O, /obj/item/weapon/paper_bundle)) - if(!copy && !photocopy && !bundle) - user.drop_item() - bundle = O - O.loc = src - user << "You insert the bundle into \the [src]." - flick("bigscanner1", src) - updateUsrDialog() - else if(istype(O, /obj/item/device/toner)) - if(toner == 0) - user.drop_item() - del(O) - toner = 30 - user << "You insert the toner cartridge into \the [src]." - updateUsrDialog() - else - user << "This cartridge is not yet ready for replacement! Use up the rest of the toner." - 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 + if(!camera) + return + var/datum/picture/selection = camera.selectpicture() + if (!selection) + return - ex_act(severity) - switch(severity) - if(1.0) - del(src) - if(2.0) - if(prob(50)) - del(src) - else - if(toner > 0) - new /obj/effect/decal/cleanable/blood/oil(get_turf(src)) - toner = 0 + var/obj/item/weapon/photo/p = new /obj/item/weapon/photo (src.loc) + p.construct(selection) + if (p.desc == "") + p.desc += "Copied by [tempAI.name]" else - if(prob(50)) - if(toner > 0) - new /obj/effect/decal/cleanable/blood/oil(get_turf(src)) - toner = 0 - return + p.desc += " - Copied by [tempAI.name]" + toner -= 5 + sleep(15) + updateUsrDialog() - blob_act() - if(prob(50)) - del(src) +/obj/machinery/photocopier/attackby(obj/item/O as obj, mob/user as mob) + if(istype(O, /obj/item/weapon/paper) || istype(O, /obj/item/weapon/photo) || istype(O, /obj/item/weapon/paper_bundle)) + if(!copyitem) + user.drop_item() + copyitem = O + O.loc = src + user << "You insert \the [O] into \the [src]." + flick(insert_anim, src) + updateUsrDialog() else - if(toner > 0) - new /obj/effect/decal/cleanable/blood/oil(get_turf(src)) - toner = 0 - return + user << "There is already something in \the [src]." + else if(istype(O, /obj/item/device/toner)) + if(toner <= 10) //allow replacing when low toner is affecting the print darkness + user.drop_item() + user << "You insert the toner cartridge into \the [src]." + var/obj/item/device/toner/T = O + toner += T.toner_amount + del(O) + updateUsrDialog() + else + user << "This cartridge is not yet ready for replacement! Use up the rest of the toner." + 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 +/obj/machinery/photocopier/ex_act(severity) + switch(severity) + if(1.0) + del(src) + if(2.0) + if(prob(50)) + del(src) + else + if(toner > 0) + new /obj/effect/decal/cleanable/blood/oil(get_turf(src)) + toner = 0 + else + if(prob(50)) + if(toner > 0) + new /obj/effect/decal/cleanable/blood/oil(get_turf(src)) + toner = 0 + return + +/obj/machinery/photocopier/blob_act() + if(prob(50)) + del(src) + else + if(toner > 0) + new /obj/effect/decal/cleanable/blood/oil(get_turf(src)) + toner = 0 + return /obj/machinery/photocopier/proc/copy(var/obj/item/weapon/paper/copy) var/obj/item/weapon/paper/c = new /obj/item/weapon/paper (loc) @@ -240,6 +191,8 @@ c.overlays += img c.updateinfolinks() toner-- + if(toner == 0) + visible_message("A red light on \the [src] flashes, indicating that it is out of toner.") return c @@ -265,9 +218,34 @@ toner -= 5 //photos use a lot of ink! if(toner < 0) toner = 0 + visible_message("A red light on \the [src] flashes, indicating that it is out of toner.") return p +//If need_toner is 0, the copies will still be lightened when low on toner, however it will not be prevented from printing. TODO: Implement print queues for fax machines and get rid of need_toner +/obj/machinery/photocopier/proc/bundlecopy(var/obj/item/weapon/paper_bundle/bundle, var/need_toner=1) + var/obj/item/weapon/paper_bundle/p = new /obj/item/weapon/paper_bundle (src) + for(var/obj/item/weapon/W in bundle) + if(toner <= 0 && need_toner) + toner = 0 + visible_message("A red light on \the [src] flashes, indicating that it is out of toner.") + break + + if(istype(W, /obj/item/weapon/paper)) + W = copy(W) + else if(istype(W, /obj/item/weapon/photo)) + W = photocopy(W) + W.loc = p + p.amount++ + //p.amount-- + p.loc = src.loc + p.update_icon() + p.icon_state = "paper_words" + p.name = bundle.name + p.pixel_y = rand(-8, 8) + p.pixel_x = rand(-9, 9) + return p /obj/item/device/toner name = "toner cartridge" icon_state = "tonercartridge" + var/toner_amount = 30