diff --git a/baystation12.dme b/baystation12.dme index 5d6ca4934a5..abcfa9a55be 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1001,8 +1001,10 @@ #include "code\modules\security levels\security levels.dm" #include "code\WorkInProgress\AI_Visibility.dm" #include "code\WorkInProgress\buildmode.dm" +#include "code\WorkInProgress\copier.dm" #include "code\WorkInProgress\detective_work.dm" #include "code\WorkInProgress\explosion_particles.dm" +#include "code\WorkInProgress\filing.dm" #include "code\WorkInProgress\mapload\dmm_suite.dm" #include "code\WorkInProgress\mapload\reader.dm" #include "code\WorkInProgress\Mini\atmos_control.dm" diff --git a/code/WorkInProgress/copier.dm b/code/WorkInProgress/copier.dm new file mode 100644 index 00000000000..9f933b822dd --- /dev/null +++ b/code/WorkInProgress/copier.dm @@ -0,0 +1,156 @@ +// Contains: copy machine + +/obj/machinery/copier + name = "Copy Machine" + icon = 'bureaucracy.dmi' + icon_state = "copier" + density = 1 + anchored = 1 + var/num_copies = 1 // number of copies selected, will be maintained between jobs + var/copying = 0 // are we copying + var/job_num_copies = 0 // number of copies remaining + var/top_open = 1 // the top is open + var/obj/item/weapon/template // the paper OR photo being scanned + var/copy_wait = 0 // wait for current page to finish + var/max_copies = 10 // MAP EDITOR: can set the number of max copies, possibly to 5 or something for public, more for QM, robutist, etc. + +/obj/machinery/copier/New() + ..() + update() + +/obj/machinery/copier/attackby(obj/item/weapon/O as obj, mob/user as mob) + if(!top_open) + return + + if (istype(O, /obj/item/weapon/paper) || istype(O, /obj/item/weapon/photo)) + // put it inside + template = O + usr.drop_item() + O.loc = src + top_open = 0 + update() + updateDialog() + +/obj/machinery/copier/attack_paw(user as mob) + return src.attack_hand(user) + +/obj/machinery/copier/attack_ai(user as mob) + return src.attack_hand(user) + +/obj/machinery/copier/attack_hand(user as mob) + // da UI + var/dat + if(..()) + return + + if(src.stat) + user << "[name] does not seem to be responding to your button mashing." + return + + /* + if(top_open) + user << "[name] beeps, \"Please place a paper on top and close the lid.\"" + return + */ + + dat = "Copy MachineXeno Corp. Copying Machine
" + + if(copying) + dat += "[job_num_copies] copies remaining.

" + dat += "Cancel" + else + if(!top_open) + dat += "Open Top

" + + dat += "Number of Copies: " + + dat += "-" + dat += "-" + dat += " [num_copies] " + dat += "+" + dat += "+

" + + if(template) + dat += "Copy" + else + dat += "No paper to be copied.
" + dat += "Please place a paper or photograph on top and close the lid.
" + + dat += "
" + + user << browse(dat, "window=copy_machine") + onclose(user, "copy_machine") + +/obj/machinery/copier/proc/update() + if(top_open) + icon_state = "copier_o" + else if(copying) + icon_state = "copier_s" + else + icon_state = "copier" + +/obj/machinery/copier/Topic(href, href_list) + if(..()) + return + usr.machine = src + src.add_fingerprint(usr) + + if(href_list["num"]) + num_copies += text2num(href_list["num"]) + if(num_copies < 1) + num_copies = 1 + else if(num_copies > max_copies) + num_copies = max_copies + updateDialog() + if(href_list["open"]) + template.loc = src.loc + template = null + top_open = 1 + updateDialog() + update() + if(href_list["copy"]) + copying = 1 + job_num_copies = num_copies + update() + updateDialog() + if(href_list["cancel"]) + copying = 0 + job_num_copies = 0 + update() + updateDialog() + +/obj/machinery/copier/process() + if(src.stat) + usr << "[name] does not seem to be responding to your button mashing." + return + + if(copying && !copy_wait) + copy_wait = 1 + // make noise + playsound(src, 'polaroid1.ogg', 50, 1) + spawn(5) + if(!copying) + return // user cancelled + + if(istype(template, /obj/item/weapon/paper)) + // make duplicate paper + var/obj/item/weapon/paper/P = new(src.loc) + P.name = template.name + P.info = template:info + P.stamped = template:stamped + P.icon_state = template.icon_state + else if(istype(template, /obj/item/weapon/photo)) + // make duplicate photo + var/obj/item/weapon/photo/P = new(src.loc) + P.name = template.name + P.desc = template.desc + P.icon = template.icon + + // copy counting stuff + job_num_copies -= 1 + if(job_num_copies == 0) + usr << "[name] beeps happily." + copying = 0 + update() + updateDialog() + copy_wait = 0 \ No newline at end of file diff --git a/code/WorkInProgress/filing.dm b/code/WorkInProgress/filing.dm new file mode 100644 index 00000000000..5bbfdf29ff9 --- /dev/null +++ b/code/WorkInProgress/filing.dm @@ -0,0 +1,23 @@ +/obj/filingcabinet + name = "Filing Cabinet" + desc = "A large cabinet with drawers." + icon = 'computer.dmi' + icon_state = "messyfiles" + density = 1 + anchored = 1 + +/obj/filingcabinet/attackby(obj/item/weapon/paper/P,mob/M) + if(istype(P)) + M << "You put the [P] in the [src]." + M.drop_item() + P.loc = src + else + M << "You can't put a [P] in the [src]!" + +/obj/filingcabinet/attack_hand(mob/user) + if(src.contents.len <= 0) + user << "The [src] is empty." + return + var/obj/item/weapon/paper/P = input(user,"Choose a sheet to take out.","[src]", "Cancel") as null|obj in src.contents + if(in_range(src,user)) + P.loc = user.loc \ No newline at end of file diff --git a/icons/obj/bureaucracy.dmi b/icons/obj/bureaucracy.dmi new file mode 100644 index 00000000000..e2686681f3a Binary files /dev/null and b/icons/obj/bureaucracy.dmi differ