mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-10 22:54:32 +01:00
Bug fixes, implements new copying/faxing system from Bay
This commit is contained in:
+77
-33
@@ -1600,45 +1600,89 @@
|
||||
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"])
|
||||
|
||||
usr << browse("<HTML><HEAD><TITLE>Centcomm Fax Message</TITLE></HEAD><BODY>[info]</BODY></HTML>", "window=Centcomm Fax Message")
|
||||
else if(href_list["AdminFaxView"])
|
||||
var/obj/item/fax = locate(href_list["AdminFaxView"])
|
||||
if (istype(fax, /obj/item/weapon/paper))
|
||||
var/obj/item/weapon/paper/P = fax
|
||||
P.show_content(usr)
|
||||
else if (istype(fax, /obj/item/weapon/photo))
|
||||
var/obj/item/weapon/photo/H = fax
|
||||
H.show(usr)
|
||||
else if (istype(fax, /obj/item/weapon/paper_bundle))
|
||||
//having multiple people turning pages on a paper_bundle can cause issues
|
||||
//open a browse window listing the contents instead
|
||||
var/data = ""
|
||||
var/obj/item/weapon/paper_bundle/B = fax
|
||||
|
||||
for (var/page = 1, page <= B.amount + 1, page++)
|
||||
var/obj/pageobj = B.contents[page]
|
||||
data += "<A href='?src=\ref[src];AdminFaxViewPage=[page];paper_bundle=\ref[B]'>Page [page] - [pageobj.name]</A><BR>"
|
||||
|
||||
world << data
|
||||
world << "Sent by: [usr]"
|
||||
|
||||
usr << browse(data, "window=[B.name]")
|
||||
else
|
||||
usr << "\red The faxed item is not viewable. This is probably a bug, and should be reported on the tracker: [fax.type]"
|
||||
|
||||
else if (href_list["AdminFaxViewPage"])
|
||||
var/page = text2num(href_list["AdminFaxViewPage"])
|
||||
var/obj/item/weapon/paper_bundle/bundle = locate(href_list["paper_bundle"])
|
||||
|
||||
if (!bundle) return
|
||||
|
||||
if (istype(bundle.contents[page], /obj/item/weapon/paper))
|
||||
var/obj/item/weapon/paper/P = bundle.contents[page]
|
||||
P.show_content(src.owner, 1)
|
||||
else if (istype(bundle.contents[page], /obj/item/weapon/photo))
|
||||
var/obj/item/weapon/photo/H = bundle.contents[page]
|
||||
H.show(src.owner)
|
||||
return
|
||||
|
||||
else if(href_list["CentcommFaxReply"])
|
||||
var/mob/living/carbon/human/H = locate(href_list["CentcommFaxReply"])
|
||||
var/mob/sender = locate(href_list["CentcommFaxReply"])
|
||||
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 <br> for line breaks.", "Outgoing message from Centcomm", "") as message|null
|
||||
if(!input) return
|
||||
var/input = input(src.owner, "Please enter a message to reply to [key_name(sender)] via secure connection. NOTE: BBCode does not work, but HTML tags do! Use <br> 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
|
||||
|
||||
// Create the reply message
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( null ) //hopefully the null loc won't cause trouble for us
|
||||
P.name = "[command_name()]- [customname]"
|
||||
P.info = input
|
||||
P.update_icon()
|
||||
P.stamps += "<HR><i>This paper has been stamped by the Central Command Quantum Relay.</i>"
|
||||
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
|
||||
P.x = rand(-2, 0)
|
||||
P.y = rand(-1, 2)
|
||||
P.offset_x += P.x
|
||||
P.offset_y += P.y
|
||||
stampoverlay.pixel_x = P.x
|
||||
stampoverlay.pixel_y = P.y
|
||||
|
||||
if(!P.ico)
|
||||
P.ico = new
|
||||
P.ico += "paper_stamp_cent"
|
||||
stampoverlay.icon_state = "paper_stamp_cent"
|
||||
|
||||
// Stamps
|
||||
if(!P.stamped)
|
||||
P.stamped = new
|
||||
P.stamped += /obj/item/weapon/stamp/centcom
|
||||
P.overlays += stampoverlay
|
||||
|
||||
for(var/obj/machinery/faxmachine/F in machines)
|
||||
if(! (F.stat & (BROKEN|NOPOWER) ) )
|
||||
// animate! it's alive!
|
||||
flick("faxreceive", F)
|
||||
|
||||
// give the sprite some time to flick
|
||||
spawn(20)
|
||||
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 += "<HR><i>This paper has been stamped by the Central Command Quantum Relay.</i>"
|
||||
|
||||
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)
|
||||
if(fax.recievefax(P))
|
||||
src.owner << "\blue Message reply to transmitted successfully."
|
||||
log_admin("[key_name(src.owner)] replied to a fax message from [key_name(sender)]: [input]")
|
||||
message_admins("[key_name_admin(src.owner)] replied to a fax message from [key_name_admin(sender)]", 1)
|
||||
else
|
||||
src.owner << "\red Message reply failed."
|
||||
|
||||
spawn(100)
|
||||
del(P)
|
||||
return
|
||||
|
||||
else if(href_list["jumpto"])
|
||||
if(!check_rights(R_ADMIN)) return
|
||||
|
||||
@@ -489,7 +489,7 @@
|
||||
return
|
||||
|
||||
//resisting grabs (as if it helps anyone...)
|
||||
if ((!( L.stat ) && L.canmove && !( L.restrained() )))
|
||||
if ((!( L.stat ) && !( L.restrained() )))
|
||||
var/resisting = 0
|
||||
for(var/obj/O in L.requests)
|
||||
L.requests.Remove(O)
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
var/list/obj/machinery/photocopier/faxmachine/allfaxes = list()
|
||||
var/list/admin_departments = list("Central Command")
|
||||
var/list/alldepartments = list()
|
||||
|
||||
var/list/adminfaxes = list() //cache for faxes that have been sent to admins
|
||||
|
||||
/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)
|
||||
|
||||
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) || ("[department]" in admin_departments)) )
|
||||
alldepartments |= department
|
||||
|
||||
/obj/machinery/photocopier/faxmachine/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
|
||||
var/dat = "Fax Machine<BR>"
|
||||
|
||||
var/scan_name
|
||||
if(scan)
|
||||
scan_name = scan.name
|
||||
else
|
||||
scan_name = "--------"
|
||||
|
||||
dat += "Confirm Identity: <a href='byond://?src=\ref[src];scan=1'>[scan_name]</a><br>"
|
||||
|
||||
if(authenticated)
|
||||
dat += "<a href='byond://?src=\ref[src];logout=1'>{Log Out}</a>"
|
||||
else
|
||||
dat += "<a href='byond://?src=\ref[src];auth=1'>{Log In}</a>"
|
||||
|
||||
dat += "<hr>"
|
||||
|
||||
if(authenticated)
|
||||
dat += "<b>Logged in to:</b> Central Command Quantum Entanglement Network<br><br>"
|
||||
|
||||
if(copyitem)
|
||||
dat += "<a href='byond://?src=\ref[src];remove=1'>Remove Item</a><br><br>"
|
||||
|
||||
if(sendcooldown)
|
||||
dat += "<b>Transmitter arrays realigning. Please stand by.</b><br>"
|
||||
|
||||
else
|
||||
|
||||
dat += "<a href='byond://?src=\ref[src];send=1'>Send</a><br>"
|
||||
dat += "<b>Currently sending:</b> [copyitem.name]<br>"
|
||||
dat += "<b>Sending to:</b> <a href='byond://?src=\ref[src];dept=1'>[destination]</a><br>"
|
||||
|
||||
else
|
||||
if(sendcooldown)
|
||||
dat += "Please insert paper to send via secure connection.<br><br>"
|
||||
dat += "<b>Transmitter arrays realigning. Please stand by.</b><br>"
|
||||
else
|
||||
dat += "Please insert paper to send via secure connection.<br><br>"
|
||||
|
||||
else
|
||||
dat += "Proper authentication is required to use this device.<br><br>"
|
||||
|
||||
if(copyitem)
|
||||
dat += "<a href ='byond://?src=\ref[src];remove=1'>Remove Item</a><br>"
|
||||
|
||||
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 in admin_departments)
|
||||
send_admin_fax(usr, destination)
|
||||
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 << "<span class='notice'>You take \the [copyitem] out of \the [src].</span>"
|
||||
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 + admin_departments)
|
||||
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/sendfax(var/destination)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
use_power(200)
|
||||
|
||||
var/success = 0
|
||||
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
|
||||
if( F.department == destination )
|
||||
success = F.recievefax(copyitem)
|
||||
|
||||
if (success)
|
||||
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
|
||||
|
||||
if(department == "Unknown")
|
||||
return 0 //You can't send faxes to "Unknown"
|
||||
|
||||
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
|
||||
|
||||
/obj/machinery/photocopier/faxmachine/proc/send_admin_fax(var/mob/sender, var/destination)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
use_power(200)
|
||||
|
||||
var/obj/item/rcvdcopy
|
||||
if (istype(copyitem, /obj/item/weapon/paper))
|
||||
rcvdcopy = copy(copyitem)
|
||||
else if (istype(copyitem, /obj/item/weapon/photo))
|
||||
rcvdcopy = photocopy(copyitem)
|
||||
else if (istype(copyitem, /obj/item/weapon/paper_bundle))
|
||||
rcvdcopy = bundlecopy(copyitem)
|
||||
else
|
||||
visible_message("[src] beeps, \"Error transmitting message.\"")
|
||||
return
|
||||
|
||||
rcvdcopy.loc = null //hopefully this shouldn't cause trouble
|
||||
adminfaxes += rcvdcopy
|
||||
|
||||
//message badmins that a fax has arrived
|
||||
switch(destination)
|
||||
if ("Central Command")
|
||||
message_admins(sender, "CENTCOMM FAX", rcvdcopy, "CentcommFaxReply", "#006100")
|
||||
|
||||
sendcooldown = 1800
|
||||
sleep(50)
|
||||
visible_message("[src] beeps, \"Message transmitted successfully.\"")
|
||||
|
||||
|
||||
/obj/machinery/photocopier/faxmachine/proc/message_admins(var/mob/sender, var/faxname, var/obj/item/sent, var/reply_type, font_colour="#006100")
|
||||
var/msg = "\blue <b><font color='[font_colour]'>[faxname]: </font>[key_name(sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[sender]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=\ref[sender]'>JMP</A>) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<a href='?_src_=holder;[reply_type]=\ref[sender];originfax=\ref[src]'>REPLY</a>)</b>: Receiving '[sent.name]' via secure connection ... <a href='?_src_=holder;AdminFaxView=\ref[sent]'>view message</a>"
|
||||
|
||||
for(var/client/C in admins)
|
||||
if(R_ADMIN & C.holder.rights)
|
||||
C << msg
|
||||
+194
-44
File diff suppressed because one or more lines are too long
@@ -21,6 +21,13 @@
|
||||
var/obj/item/weapon/paper/P
|
||||
if(istype(W, /obj/item/weapon/paper))
|
||||
P = W
|
||||
if (istype(P, /obj/item/weapon/paper/carbon))
|
||||
var/obj/item/weapon/paper/carbon/C = P
|
||||
if (!C.iscopy && !C.copied)
|
||||
user << "<span class='notice'>Take off the carbon copy first.</span>"
|
||||
add_fingerprint(user)
|
||||
return
|
||||
|
||||
amount++
|
||||
if(screen == 2)
|
||||
screen = 1
|
||||
@@ -37,70 +44,103 @@
|
||||
user << "<span class='notice'>You add [(W.name == "photo") ? "the photo" : W.name] to [(src.name == "paper bundle") ? "the paper bundle" : src.name].</span>"
|
||||
user.drop_from_inventory(W)
|
||||
W.loc = src
|
||||
if(istype(user,/mob/living/carbon/human))
|
||||
user:update_inv_l_hand()
|
||||
user:update_inv_r_hand()
|
||||
else if(istype(W, /obj/item/weapon/lighter))
|
||||
burnpaper(W, user)
|
||||
else if(istype(W, /obj/item/weapon/paper_bundle))
|
||||
user.drop_from_inventory(W)
|
||||
for(var/obj/O in W)
|
||||
O.loc = src
|
||||
O.add_fingerprint(usr)
|
||||
src.amount++
|
||||
if(screen == 2)
|
||||
screen = 1
|
||||
user << "<span class='notice'>You add \the [W.name] to [(src.name == "paper bundle") ? "the paper bundle" : src.name].</span>"
|
||||
del(W)
|
||||
else
|
||||
if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/toy/crayon))
|
||||
usr << browse("", "window=[name]") //Closes the dialog
|
||||
P = src[page]
|
||||
P.attackby(W, user)
|
||||
|
||||
|
||||
update_icon()
|
||||
attack_self(usr) //Update the browsed page.
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/paper_bundle/examine()
|
||||
set src in oview(1)
|
||||
/obj/item/weapon/paper_bundle/proc/burnpaper(obj/item/weapon/lighter/P, mob/user)
|
||||
var/class = "<span class='warning'>"
|
||||
|
||||
usr << desc
|
||||
if(in_range(usr, src))
|
||||
src.attack_self(usr)
|
||||
if(P.lit && !user.restrained())
|
||||
if(istype(P, /obj/item/weapon/lighter/zippo))
|
||||
class = "<span class='rose'>"
|
||||
|
||||
user.visible_message("[class][user] holds \the [P] up to \the [src], it looks like \he's trying to burn it!", \
|
||||
"[class]You hold \the [P] up to \the [src], burning it slowly.")
|
||||
|
||||
spawn(20)
|
||||
if(get_dist(src, user) < 2 && user.get_active_hand() == P && P.lit)
|
||||
user.visible_message("[class][user] burns right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap.", \
|
||||
"[class]You burn right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap.")
|
||||
|
||||
if(user.get_inactive_hand() == src)
|
||||
user.drop_from_inventory(src)
|
||||
|
||||
new /obj/effect/decal/cleanable/ash(src.loc)
|
||||
del(src)
|
||||
|
||||
else
|
||||
user << "\red You must hold \the [P] steady to burn \the [src]."
|
||||
|
||||
/obj/item/weapon/paper_bundle/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
src.show_content(user)
|
||||
else
|
||||
usr << "<span class='notice'>It is too far away.</span>"
|
||||
user << "<span class='notice'>It is too far away.</span>"
|
||||
return
|
||||
|
||||
/obj/item/weapon/paper_bundle/proc/show_content(mob/user as mob)
|
||||
var/dat
|
||||
var/obj/item/weapon/W = src[page]
|
||||
switch(screen)
|
||||
if(0)
|
||||
dat+= "<DIV STYLE='float:left; text-align:left; width:33.33333%'></DIV>"
|
||||
dat+= "<DIV STYLE='float:left; text-align:center; width:33.33333%'><A href='?src=\ref[src];remove=1'>Remove [(istype(W, /obj/item/weapon/paper)) ? "paper" : "photo"]</A></DIV>"
|
||||
dat+= "<DIV STYLE='float:left; text-align:right; width:33.33333%'><A href='?src=\ref[src];next_page=1'>Next Page</A></DIV><BR><HR>"
|
||||
if(1)
|
||||
dat+= "<DIV STYLE='float:left; text-align:left; width:33.33333%'><A href='?src=\ref[src];prev_page=1'>Previous Page</A></DIV>"
|
||||
dat+= "<DIV STYLE='float:left; text-align:center; width:33.33333%'><A href='?src=\ref[src];remove=1'>Remove [(istype(W, /obj/item/weapon/paper)) ? "paper" : "photo"]</A></DIV>"
|
||||
dat+= "<DIV STYLE='float:left; text-align:right; width:33.33333%'><A href='?src=\ref[src];next_page=1'>Next Page</A></DIV><BR><HR>"
|
||||
if(2)
|
||||
dat+= "<DIV STYLE='float:left; text-align:left; width:33.33333%'><A href='?src=\ref[src];prev_page=1'>Previous Page</A></DIV>"
|
||||
dat+= "<DIV STYLE='float:left; text-align:center; width:33.33333%'><A href='?src=\ref[src];remove=1'>Remove [(istype(W, /obj/item/weapon/paper)) ? "paper" : "photo"]</A></DIV><BR><HR>"
|
||||
dat+= "<DIV STYLE='float;left; text-align:right; with:33.33333%'></DIV>"
|
||||
if(istype(src[page], /obj/item/weapon/paper))
|
||||
var/obj/item/weapon/paper/P = W
|
||||
if(!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/dead/observer) || istype(usr, /mob/living/silicon)))
|
||||
dat+= "<HTML><HEAD><TITLE>[P.name]</TITLE></HEAD><BODY>[stars(P.info)][P.stamps]</BODY></HTML>"
|
||||
else
|
||||
dat+= "<HTML><HEAD><TITLE>[P.name]</TITLE></HEAD><BODY>[P.info][P.stamps]</BODY></HTML>"
|
||||
user << browse(dat, "window=[name]")
|
||||
else if(istype(src[page], /obj/item/weapon/photo))
|
||||
var/obj/item/weapon/photo/P = W
|
||||
user << browse_rsc(P.img, "tmp_photo.png")
|
||||
user << browse(dat + "<html><head><title>[P.name]</title></head>" \
|
||||
+ "<body style='overflow:hidden'>" \
|
||||
+ "<div> <img src='tmp_photo.png' width = '180'" \
|
||||
+ "[P.scribble ? "<div> Written on the back:<br><i>[P.scribble]</i>" : ]"\
|
||||
+ "</body></html>", "window=[name]")
|
||||
|
||||
/obj/item/weapon/paper_bundle/attack_self(mob/user as mob)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/human_user = user
|
||||
var/dat
|
||||
var/obj/item/weapon/W = src[page]
|
||||
switch(screen)
|
||||
if(0)
|
||||
dat+= "<DIV STYLE='float:left; text-align:left; width:33.33333%'></DIV>"
|
||||
dat+= "<DIV STYLE='float:left; text-align:center; width:33.33333%'><A href='?src=\ref[src];remove=1'>Remove [(istype(W, /obj/item/weapon/paper)) ? "paper" : "photo"]</A></DIV>"
|
||||
dat+= "<DIV STYLE='float:left; text-align:right; width:33.33333%'><A href='?src=\ref[src];next_page=1'>Next Page</A></DIV><BR><HR>"
|
||||
if(1)
|
||||
dat+= "<DIV STYLE='float:left; text-align:left; width:33.33333%'><A href='?src=\ref[src];prev_page=1'>Previous Page</A></DIV>"
|
||||
dat+= "<DIV STYLE='float:left; text-align:center; width:33.33333%'><A href='?src=\ref[src];remove=1'>Remove [(istype(W, /obj/item/weapon/paper)) ? "paper" : "photo"]</A></DIV>"
|
||||
dat+= "<DIV STYLE='float:left; text-align:right; width:33.33333%'><A href='?src=\ref[src];next_page=1'>Next Page</A></DIV><BR><HR>"
|
||||
if(2)
|
||||
dat+= "<DIV STYLE='float:left; text-align:left; width:33.33333%'><A href='?src=\ref[src];prev_page=1'>Previous Page</A></DIV>"
|
||||
dat+= "<DIV STYLE='float:left; text-align:center; width:33.33333%'><A href='?src=\ref[src];remove=1'>Remove [(istype(W, /obj/item/weapon/paper)) ? "paper" : "photo"]</A></DIV><BR><HR>"
|
||||
dat+= "<DIV STYLE='float;left; text-align:right; with:33.33333%'></DIV>"
|
||||
if(istype(src[page], /obj/item/weapon/paper))
|
||||
var/obj/item/weapon/paper/P = W
|
||||
dat+= "<HTML><HEAD><TITLE>[P.name]</TITLE></HEAD><BODY>[P.info][P.stamps]</BODY></HTML>"
|
||||
human_user << browse(dat, "window=[name]")
|
||||
P.add_fingerprint(usr)
|
||||
else if(istype(src[page], /obj/item/weapon/photo))
|
||||
var/obj/item/weapon/photo/P = W
|
||||
human_user << browse_rsc(P.img, "tmp_photo.png")
|
||||
human_user << browse(dat + "<html><head><title>[P.name]</title></head>" \
|
||||
+ "<body style='overflow:hidden'>" \
|
||||
+ "<div> <img src='tmp_photo.png' width = '180'" \
|
||||
+ "[P.scribble ? "<div> Written on the back:<br><i>[P.scribble]</i>" : ]"\
|
||||
+ "</body></html>", "window=[name]")
|
||||
P.add_fingerprint(usr)
|
||||
add_fingerprint(usr)
|
||||
update_icon()
|
||||
src.show_content(user)
|
||||
add_fingerprint(usr)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/paper_bundle/Topic(href, href_list)
|
||||
..()
|
||||
if((src in usr.contents) || (src.loc in usr.contents))
|
||||
if((src in usr.contents) || (istype(src.loc, /obj/item/weapon/folder) && (src.loc in usr.contents)))
|
||||
usr.set_machine(src)
|
||||
if(href_list["next_page"])
|
||||
if(page == amount)
|
||||
@@ -122,44 +162,18 @@
|
||||
playsound(src.loc, "pageturn", 50, 1)
|
||||
if(href_list["remove"])
|
||||
var/obj/item/weapon/W = src[page]
|
||||
W.loc = usr.loc
|
||||
if(istype(usr,/mob/living/carbon))
|
||||
//Place the item in the user's hand if possible
|
||||
if(!usr.r_hand)
|
||||
W.loc = usr
|
||||
usr.r_hand = W
|
||||
W.layer = 20
|
||||
else if(!usr.l_hand)
|
||||
W.loc = usr
|
||||
usr.l_hand = W
|
||||
W.layer = 20
|
||||
usr.put_in_hands(W)
|
||||
usr << "<span class='notice'>You remove the [W.name] from the bundle.</span>"
|
||||
|
||||
if(amount == 1)
|
||||
var/obj/item/weapon/paper/P = src[1]
|
||||
P.loc = usr.loc
|
||||
if (usr.r_hand == src)
|
||||
usr.drop_from_inventory(src)
|
||||
P.loc = usr
|
||||
usr.r_hand = P
|
||||
P.layer = 20
|
||||
else if (usr.l_hand == src)
|
||||
usr.drop_from_inventory(src)
|
||||
P.loc = usr
|
||||
usr.l_hand = P
|
||||
P.layer = 20
|
||||
if(istype(usr,/mob/living/carbon/human))
|
||||
usr:update_inv_l_hand()
|
||||
usr:update_inv_r_hand()
|
||||
usr.drop_from_inventory(src)
|
||||
usr.put_in_hands(P)
|
||||
del(src)
|
||||
else if(page == amount)
|
||||
screen = 2
|
||||
else if(page == amount+1)
|
||||
page--
|
||||
|
||||
if(istype(usr,/mob/living/carbon/human))
|
||||
usr:update_inv_l_hand()
|
||||
usr:update_inv_r_hand()
|
||||
amount--
|
||||
update_icon()
|
||||
else
|
||||
@@ -190,10 +204,9 @@
|
||||
usr << "<span class='notice'>You loosen the bundle.</span>"
|
||||
for(var/obj/O in src)
|
||||
O.loc = usr.loc
|
||||
O.layer = initial(O.layer)
|
||||
O.add_fingerprint(usr)
|
||||
usr.drop_from_inventory(src)
|
||||
if(istype(usr,/mob/living/carbon/human))
|
||||
usr:update_inv_l_hand()
|
||||
usr:update_inv_r_hand()
|
||||
del(src)
|
||||
return
|
||||
|
||||
@@ -217,7 +230,6 @@
|
||||
i++
|
||||
else if(istype(O, /obj/item/weapon/photo))
|
||||
var/obj/item/weapon/photo/Ph = O
|
||||
// img.icon_state = "photo"
|
||||
img = Ph.tiny
|
||||
photo = 1
|
||||
overlays += img
|
||||
|
||||
@@ -2,295 +2,240 @@
|
||||
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/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!
|
||||
var/mob/living/ass = null
|
||||
var/busy = 0
|
||||
|
||||
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_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
var/dat = "Photocopier<BR><BR>"
|
||||
if(copyitem)
|
||||
dat += "<a href='byond://?src=\ref[src];remove=1'>Remove Item</a><BR>"
|
||||
if(toner)
|
||||
dat += "<a href='byond://?src=\ref[src];copy=1'>Copy</a><BR>"
|
||||
dat += "Printing: [copies] copies."
|
||||
dat += "<a href='byond://?src=\ref[src];min=1'>-</a> "
|
||||
dat += "<a href='byond://?src=\ref[src];add=1'>+</a><BR><BR>"
|
||||
else if(toner)
|
||||
dat += "Please insert something to copy.<BR><BR>"
|
||||
if(istype(user,/mob/living/silicon))
|
||||
dat += "<a href='byond://?src=\ref[src];aipic=1'>Print photo from database</a><BR><BR>"
|
||||
dat += "Current toner level: [toner]"
|
||||
if(!toner)
|
||||
dat +="<BR>Please insert a new toner cartridge!"
|
||||
user << browse(dat, "window=copier")
|
||||
onclose(user, "copier")
|
||||
return
|
||||
|
||||
var/dat = "Photocopier<BR><BR>"
|
||||
if(copy || photocopy || (ass && (ass.loc == src.loc)))
|
||||
dat += "<a href='byond://?src=\ref[src];remove=1'>Remove Paper</a><BR>"
|
||||
if(toner)
|
||||
dat += "<a href='byond://?src=\ref[src];copy=1'>Copy</a><BR>"
|
||||
dat += "Printing: [copies] copies."
|
||||
dat += "<a href='byond://?src=\ref[src];min=1'>-</a> "
|
||||
dat += "<a href='byond://?src=\ref[src];add=1'>+</a><BR><BR>"
|
||||
else if(toner)
|
||||
dat += "Please insert paper to copy.<BR><BR>"
|
||||
if(istype(user,/mob/living/silicon))
|
||||
dat += "<a href='byond://?src=\ref[src];aipic=1'>Print photo from database</a><BR><BR>"
|
||||
dat += "Current toner level: [toner]"
|
||||
if(!toner)
|
||||
dat +="<BR>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 && !busy && copy)
|
||||
var/obj/item/weapon/paper/c = new /obj/item/weapon/paper (loc)
|
||||
if(toner > 10) //lots of toner, make it dark
|
||||
c.info = "<font color = #101010>"
|
||||
else //no toner? shitty copies for you!
|
||||
c.info = "<font color = #808080>"
|
||||
var/copied = copy.info
|
||||
copied = replacetext(copied, "<font face=\"[c.deffont]\" color=", "<font face=\"[c.deffont]\" nocolor=") //state of the art techniques in action
|
||||
copied = replacetext(copied, "<font face=\"[c.crayonfont]\" color=", "<font face=\"[c.crayonfont]\" nocolor=") //This basically just breaks the existing color tag, which we need to do because the innermost tag takes priority.
|
||||
c.info += copied
|
||||
c.info += "</font>"
|
||||
c.name = copy.name // -- Doohl
|
||||
c.fields = copy.fields
|
||||
c.updateinfolinks()
|
||||
toner--
|
||||
busy = 1
|
||||
sleep(15)
|
||||
busy = 0
|
||||
else
|
||||
break
|
||||
updateUsrDialog()
|
||||
else if(photocopy)
|
||||
for(var/i = 0, i < copies, i++)
|
||||
if(toner >= 5 && !busy && photocopy)
|
||||
var/obj/item/weapon/photo/p = new /obj/item/weapon/photo (loc)
|
||||
var/icon/I = icon(photocopy.icon, photocopy.icon_state)
|
||||
var/icon/img = icon(photocopy.img)
|
||||
if(toner > 10) //plenty of toner, go straight greyscale
|
||||
I.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0)) //I'm not sure how expensive this is, but given the many limitations of photocopying, it shouldn't be an issue.
|
||||
img.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
|
||||
else //not much toner left, lighten the photo
|
||||
I.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(100,100,100))
|
||||
img.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(100,100,100))
|
||||
p.icon = I
|
||||
p.img = img
|
||||
p.name = photocopy.name
|
||||
p.desc = photocopy.desc
|
||||
p.scribble = photocopy.scribble
|
||||
toner -= 5 //photos use a lot of ink!
|
||||
busy = 1
|
||||
sleep(15)
|
||||
busy = 0
|
||||
else
|
||||
break
|
||||
updateUsrDialog()
|
||||
else if(ass) //ASS COPY. By Miauw
|
||||
for(var/i = 0, i < copies, i++)
|
||||
var/icon/temp_img
|
||||
if(ishuman(ass) && (ass.get_item_by_slot(slot_w_uniform) || ass.get_item_by_slot(slot_wear_suit)))
|
||||
usr << "<span class='notice'>You feel kind of silly copying [ass == usr ? "your" : ass][ass == usr ? "" : "\'s"] ass with [ass == usr ? "your" : "their"] clothes on.</span>"
|
||||
else if(toner >= 5 && !busy && check_ass()) //You have to be sitting on the copier and either be a xeno or a human without clothes on.
|
||||
if(isalien(ass) || istype(ass,/mob/living/simple_animal/hostile/alien)) //Xenos have their own asses, thanks to Pybro.
|
||||
temp_img = icon('icons/ass/assalien.png')
|
||||
else if(ishuman(ass)) //Suit checks are in check_ass
|
||||
if(ass.gender == MALE)
|
||||
temp_img = icon('icons/ass/assmale.png')
|
||||
else if(ass.gender == FEMALE)
|
||||
temp_img = icon('icons/ass/assfemale.png')
|
||||
else //In case anyone ever makes the generic ass. For now I'll be using male asses.
|
||||
temp_img = icon('icons/ass/assmale.png')
|
||||
else
|
||||
break
|
||||
var/obj/item/weapon/photo/p = new /obj/item/weapon/photo (loc)
|
||||
p.desc = "You see [ass]'s ass on the photo."
|
||||
p.pixel_x = rand(-10, 10)
|
||||
p.pixel_y = rand(-10, 10)
|
||||
p.img = temp_img
|
||||
var/icon/small_img = icon(temp_img) //Icon() is needed or else temp_img will be rescaled too >.>
|
||||
var/icon/ic = icon('icons/obj/items.dmi',"photo")
|
||||
small_img.Scale(8, 8)
|
||||
ic.Blend(small_img,ICON_OVERLAY, 10, 13)
|
||||
p.icon = ic
|
||||
toner -= 5
|
||||
busy = 1
|
||||
sleep(15)
|
||||
busy = 0
|
||||
updateUsrDialog()
|
||||
else if(href_list["remove"])
|
||||
if(copy)
|
||||
copy.loc = usr.loc
|
||||
usr.put_in_hands(copy)
|
||||
usr << "<span class='notice'>You take the paper out of \the [src].</span>"
|
||||
copy = null
|
||||
updateUsrDialog()
|
||||
else if(photocopy)
|
||||
photocopy.loc = usr.loc
|
||||
usr.put_in_hands(photocopy)
|
||||
usr << "<span class='notice'>You take the photo out of \the [src].</span>"
|
||||
photocopy = null
|
||||
updateUsrDialog()
|
||||
else if(check_ass())
|
||||
ass << "<span class='notice'>You feel a slight pressure on your ass.</span>"
|
||||
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
|
||||
sleep(15)
|
||||
updateUsrDialog()
|
||||
|
||||
attackby(obj/item/O as obj, mob/user as mob)
|
||||
if(istype(O, /obj/item/weapon/paper))
|
||||
if(!copy && !photocopy)
|
||||
user.drop_item()
|
||||
copy = O
|
||||
O.loc = src
|
||||
user << "<span class='notice'>You insert the paper into \the [src].</span>"
|
||||
flick("bigscanner1", src)
|
||||
updateUsrDialog()
|
||||
else
|
||||
user << "<span class='notice'>There is already something in \the [src].</span>"
|
||||
else if(istype(O, /obj/item/weapon/photo))
|
||||
if(copier_empty())
|
||||
user.drop_item()
|
||||
photocopy = O
|
||||
O.loc = src
|
||||
user << "<span class='notice'>You insert the photo into \the [src].</span>"
|
||||
flick("bigscanner1", src)
|
||||
updateUsrDialog()
|
||||
else
|
||||
user << "<span class='notice'>There is already something in \the [src].</span>"
|
||||
else if(istype(O, /obj/item/device/toner))
|
||||
/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)
|
||||
user.drop_item()
|
||||
del(O)
|
||||
toner = 30
|
||||
user << "<span class='notice'>You insert the toner cartridge into \the [src].</span>"
|
||||
updateUsrDialog()
|
||||
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
|
||||
user << "<span class='notice'>This cartridge is not yet ready for replacement! Use up the rest of the toner.</span>"
|
||||
else if(istype(O, /obj/item/weapon/wrench))
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
anchored = !anchored
|
||||
user << "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>"
|
||||
else if(istype(O, /obj/item/weapon/grab)) //For ass-copying.
|
||||
var/obj/item/weapon/grab/G = O
|
||||
if(ismob(G.affecting) && G.affecting != ass)
|
||||
var/mob/GM = G.affecting
|
||||
visible_message("<span class='warning'>[usr] drags [GM.name] onto the photocopier!</span>")
|
||||
GM.loc = get_turf(src)
|
||||
ass = GM
|
||||
if(photocopy)
|
||||
photocopy.loc = src.loc
|
||||
photocopy = null
|
||||
else if(copy)
|
||||
copy.loc = src.loc
|
||||
copy = null
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
qdel(src)
|
||||
if(2.0)
|
||||
if(prob(50))
|
||||
del(src)
|
||||
else
|
||||
if(toner > 0)
|
||||
new /obj/effect/decal/cleanable/oil(get_turf(src))
|
||||
toner = 0
|
||||
else
|
||||
if(prob(50))
|
||||
if(toner > 0)
|
||||
new /obj/effect/decal/cleanable/oil(get_turf(src))
|
||||
toner = 0
|
||||
return
|
||||
|
||||
blob_act()
|
||||
if(prob(50))
|
||||
qdel(src)
|
||||
else
|
||||
if(toner > 0)
|
||||
new /obj/effect/decal/cleanable/oil(get_turf(src))
|
||||
toner = 0
|
||||
return
|
||||
|
||||
/obj/machinery/photocopier/MouseDrop_T(mob/target, mob/user)
|
||||
check_ass() //Just to make sure that you can re-drag somebody onto it after they moved off.
|
||||
if (!istype(target) || target.buckled || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || istype(user, /mob/living/silicon/ai) || target == ass)
|
||||
return
|
||||
src.add_fingerprint(user)
|
||||
if(target == user && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
|
||||
visible_message("<span class='warning'>[usr] jumps onto the photocopier!</span>")
|
||||
else if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
|
||||
if(target.anchored) return
|
||||
if(!ishuman(user) && !ismonkey(user)) return
|
||||
visible_message("<span class='warning'>[usr] drags [target.name] onto the photocopier!</span>")
|
||||
target.loc = get_turf(src)
|
||||
ass = target
|
||||
if(photocopy)
|
||||
photocopy.loc = src.loc
|
||||
visible_message("<span class='notice'>[photocopy] is shoved out of the way by [ass]!</span>")
|
||||
photocopy = null
|
||||
else if(copy)
|
||||
copy.loc = src.loc
|
||||
visible_message("<span class='notice'>[copy] is shoved out of the way by [ass]!</span>")
|
||||
copy = null
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/photocopier/proc/check_ass() //I'm not sure wether I made this proc because it's good form or because of the name.
|
||||
if(!ass)
|
||||
return 0
|
||||
if(ass.loc != src.loc)
|
||||
ass = null
|
||||
usr << "<span class='warning'>\The [copyitem] can't be copied by \the [src].</span>"
|
||||
break
|
||||
|
||||
use_power(active_power_usage)
|
||||
updateUsrDialog()
|
||||
return 0
|
||||
else if(istype(ass,/mob/living/carbon/human))
|
||||
if(!ass.get_item_by_slot(slot_w_uniform) && !ass.get_item_by_slot(slot_wear_suit))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
else if(href_list["remove"])
|
||||
if(copyitem)
|
||||
copyitem.loc = usr.loc
|
||||
usr.put_in_hands(copyitem)
|
||||
usr << "<span class='notice'>You take \the [copyitem] out of \the [src].</span>"
|
||||
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
|
||||
|
||||
/obj/machinery/photocopier/proc/copier_empty()
|
||||
if(copy || photocopy || check_ass())
|
||||
return 0
|
||||
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
|
||||
sleep(15)
|
||||
updateUsrDialog()
|
||||
|
||||
/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 << "<span class='notice'>You insert \the [O] into \the [src].</span>"
|
||||
flick(insert_anim, src)
|
||||
updateUsrDialog()
|
||||
else
|
||||
user << "<span class='notice'>There is already something in \the [src].</span>"
|
||||
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 << "<span class='notice'>You insert the toner cartridge into \the [src].</span>"
|
||||
var/obj/item/device/toner/T = O
|
||||
toner += T.toner_amount
|
||||
del(O)
|
||||
updateUsrDialog()
|
||||
else
|
||||
user << "<span class='notice'>This cartridge is not yet ready for replacement! Use up the rest of the toner.</span>"
|
||||
else if(istype(O, /obj/item/weapon/wrench))
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
anchored = !anchored
|
||||
user << "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>"
|
||||
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/oil(get_turf(src))
|
||||
toner = 0
|
||||
else
|
||||
if(prob(50))
|
||||
if(toner > 0)
|
||||
new /obj/effect/decal/cleanable/oil(get_turf(src))
|
||||
toner = 0
|
||||
return
|
||||
|
||||
/obj/machinery/photocopier/blob_act()
|
||||
if(prob(50))
|
||||
del(src)
|
||||
else
|
||||
return 1
|
||||
if(toner > 0)
|
||||
new /obj/effect/decal/cleanable/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)
|
||||
if(toner > 10) //lots of toner, make it dark
|
||||
c.info = "<font color = #101010>"
|
||||
else //no toner? shitty copies for you!
|
||||
c.info = "<font color = #808080>"
|
||||
var/copied = html_decode(copy.info)
|
||||
copied = replacetext(copied, "<font face=\"[c.deffont]\" color=", "<font face=\"[c.deffont]\" nocolor=") //state of the art techniques in action
|
||||
copied = replacetext(copied, "<font face=\"[c.crayonfont]\" color=", "<font face=\"[c.crayonfont]\" nocolor=") //This basically just breaks the existing color tag, which we need to do because the innermost tag takes priority.
|
||||
c.info += copied
|
||||
c.info += "</font>"
|
||||
c.name = copy.name // -- Doohl
|
||||
c.fields = copy.fields
|
||||
c.stamps = copy.stamps
|
||||
c.stamped = copy.stamped
|
||||
c.ico = copy.ico
|
||||
c.offset_x = copy.offset_x
|
||||
c.offset_y = copy.offset_y
|
||||
var/list/temp_overlays = copy.overlays //Iterates through stamps
|
||||
var/image/img //and puts a matching
|
||||
for (var/j = 1, j <= temp_overlays.len, j++) //gray overlay onto the copy
|
||||
if(copy.ico.len)
|
||||
if (findtext(copy.ico[j], "cap") || findtext(copy.ico[j], "cent"))
|
||||
img = image('icons/obj/bureaucracy.dmi', "paper_stamp-circle")
|
||||
else if (findtext(copy.ico[j], "deny"))
|
||||
img = image('icons/obj/bureaucracy.dmi', "paper_stamp-x")
|
||||
else
|
||||
img = image('icons/obj/bureaucracy.dmi', "paper_stamp-dots")
|
||||
img.pixel_x = copy.offset_x[j]
|
||||
img.pixel_y = copy.offset_y[j]
|
||||
c.overlays += img
|
||||
c.updateinfolinks()
|
||||
toner--
|
||||
if(toner == 0)
|
||||
visible_message("<span class='notice'>A red light on \the [src] flashes, indicating that it is out of toner.</span>")
|
||||
return c
|
||||
|
||||
|
||||
/obj/machinery/photocopier/proc/photocopy(var/obj/item/weapon/photo/photocopy)
|
||||
var/obj/item/weapon/photo/p = new /obj/item/weapon/photo (loc)
|
||||
p.name = photocopy.name
|
||||
p.icon = photocopy.icon
|
||||
p.tiny = photocopy.tiny
|
||||
p.img = photocopy.img
|
||||
p.desc = photocopy.desc
|
||||
p.pixel_x = photocopy.pixel_x
|
||||
p.pixel_y = photocopy.pixel_y
|
||||
if(photocopy.scribble)
|
||||
p.scribble = photocopy.scribble
|
||||
toner -= 5
|
||||
if(toner < 0)
|
||||
toner = 0
|
||||
visible_message("<span class='notice'>A red light on \the [src] flashes, indicating that it is out of toner.</span>")
|
||||
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("<span class='notice'>A red light on \the [src] flashes, indicating that it is out of toner.</span>")
|
||||
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
|
||||
|
||||
@@ -30,9 +30,10 @@
|
||||
var/icon/img //Big photo image
|
||||
var/scribble //Scribble on the back.
|
||||
var/icon/tiny
|
||||
var/photo_size = 3
|
||||
|
||||
/obj/item/weapon/photo/attack_self(mob/user as mob)
|
||||
examine()
|
||||
src.examine(user)
|
||||
|
||||
/obj/item/weapon/photo/attackby(obj/item/weapon/P as obj, mob/user as mob)
|
||||
if(istype(P, /obj/item/weapon/pen) || istype(P, /obj/item/toy/crayon))
|
||||
@@ -42,22 +43,21 @@
|
||||
scribble = txt
|
||||
..()
|
||||
|
||||
/obj/item/weapon/photo/examine()
|
||||
set src in oview(1)
|
||||
if(in_range(usr, src))
|
||||
show(usr)
|
||||
usr << desc
|
||||
/obj/item/weapon/photo/examine(mob/user)
|
||||
if(in_range(user, src))
|
||||
show(user)
|
||||
user << desc
|
||||
else
|
||||
usr << "<span class='notice'>It is too far away.</span>"
|
||||
user << "<span class='notice'>It is too far away.</span>"
|
||||
|
||||
/obj/item/weapon/photo/proc/show(mob/user as mob)
|
||||
user << browse_rsc(img, "tmp_photo.png")
|
||||
user << browse("<html><head><title>[name]</title></head>" \
|
||||
+ "<body style='overflow:hidden'>" \
|
||||
+ "<div> <img src='tmp_photo.png' width = '180'" \
|
||||
+ "[scribble ? "<div> Written on the back:<br><i>[scribble]</i>" : ]"\
|
||||
+ "</body></html>", "window=book;size=200x[scribble ? 400 : 200]")
|
||||
onclose(user, "[name]")
|
||||
+ "<body style='overflow:hidden;margin:0;text-align:center'>" \
|
||||
+ "<img src='tmp_photo.png' width='[64*photo_size]' style='-ms-interpolation-mode:nearest-neighbor' />" \
|
||||
+ "[scribble ? "<br>Written on the back:<br><i>[scribble]</i>" : ""]"\
|
||||
+ "</body></html>", "window=book;size=[64*photo_size]x[scribble ? 400 : 64*photo_size]")
|
||||
onclose(usr, "[name]")
|
||||
return
|
||||
|
||||
/obj/item/weapon/photo/verb/rename()
|
||||
@@ -119,13 +119,21 @@
|
||||
w_class = 2.0
|
||||
flags = FPRINT | CONDUCT | TABLEPASS
|
||||
slot_flags = SLOT_BELT
|
||||
// matter = list("metal" = 2000)
|
||||
var/list/matter = list("metal" = 2000)
|
||||
var/pictures_max = 10
|
||||
var/pictures_left = 10
|
||||
var/on = 1
|
||||
var/icon_on = "camera"
|
||||
var/icon_off = "camera_off"
|
||||
var/size = 3
|
||||
|
||||
/obj/item/device/camera/verb/change_size()
|
||||
set name = "Set Photo Focus"
|
||||
set category = "Object"
|
||||
var/nsize = input("Photo Size","Pick a size of resulting photo.") as null|anything in list(1,3,5,7)
|
||||
if(nsize)
|
||||
size = nsize
|
||||
usr << "<span class='notice'>Camera will now take [size]x[size] photos.</span>"
|
||||
|
||||
/obj/item/device/camera/attack(mob/living/carbon/human/M as mob, mob/user as mob)
|
||||
return
|
||||
@@ -152,41 +160,52 @@
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/device/camera/proc/get_icon(turf/the_turf as turf)
|
||||
/obj/item/device/camera/proc/get_icon(list/turfs, turf/center)
|
||||
|
||||
//Bigger icon base to capture those icons that were shifted to the next tile
|
||||
//i.e. pretty much all wall-mounted machinery
|
||||
var/icon/res = icon('icons/effects/96x96.dmi', "")
|
||||
|
||||
var/icon/turficon = build_composite_icon(the_turf)
|
||||
res.Blend(turficon, ICON_OVERLAY, 33, 33)
|
||||
res.Scale(size*32, size*32)
|
||||
// Initialize the photograph to black.
|
||||
res.Blend("#000", ICON_OVERLAY)
|
||||
|
||||
var/atoms[] = list()
|
||||
for(var/atom/A in the_turf)
|
||||
if(A.invisibility) continue
|
||||
atoms.Add(A)
|
||||
for(var/turf/the_turf in turfs)
|
||||
// Add outselves to the list of stuff to draw
|
||||
atoms.Add(the_turf);
|
||||
// As well as anything that isn't invisible.
|
||||
for(var/atom/A in the_turf)
|
||||
if(A.invisibility) continue
|
||||
atoms.Add(A)
|
||||
|
||||
//Sorting icons based on levels
|
||||
var/gap = atoms.len
|
||||
var/swapped = 1
|
||||
while (gap > 1 || swapped)
|
||||
swapped = 0
|
||||
if(gap > 1)
|
||||
gap = round(gap / 1.247330950103979)
|
||||
if(gap < 1)
|
||||
gap = 1
|
||||
for(var/i = 1; gap + i <= atoms.len; i++)
|
||||
var/atom/l = atoms[i] //Fucking hate
|
||||
var/atom/r = atoms[gap+i] //how lists work here
|
||||
if(l.layer > r.layer) //no "atoms[i].layer" for me
|
||||
atoms.Swap(i, gap + i)
|
||||
swapped = 1
|
||||
|
||||
for(var/i; i <= atoms.len; i++)
|
||||
var/atom/A = atoms[i]
|
||||
// Sort the atoms into their layers
|
||||
var/list/sorted = sort_atoms_by_layer(atoms)
|
||||
var/center_offset = (size-1)/2 * 32 + 1
|
||||
for(var/i; i <= sorted.len; i++)
|
||||
var/atom/A = sorted[i]
|
||||
if(A)
|
||||
var/icon/img = getFlatIcon(A, A.dir)//build_composite_icon(A)
|
||||
var/icon/img = getFlatIcon(A)//build_composite_icon(A)
|
||||
|
||||
// If what we got back is actually a picture, draw it.
|
||||
if(istype(img, /icon))
|
||||
res.Blend(new/icon(img, "", A.dir), ICON_OVERLAY, 33 + A.pixel_x, 33 + A.pixel_y)
|
||||
// Check if we're looking at a mob that's lying down
|
||||
if(istype(A, /mob/living) && A:lying)
|
||||
// If they are, apply that effect to their picture.
|
||||
img.BecomeLying()
|
||||
// Calculate where we are relative to the center of the photo
|
||||
var/xoff = (A.x - center.x) * 32 + center_offset
|
||||
var/yoff = (A.y - center.y) * 32 + center_offset
|
||||
if (istype(A,/atom/movable))
|
||||
xoff+=A:step_x
|
||||
yoff+=A:step_y
|
||||
res.Blend(img, blendMode2iconMode(A.blend_mode), A.pixel_x + xoff, A.pixel_y + yoff)
|
||||
|
||||
// Lastly, render any contained effects on top.
|
||||
for(var/turf/the_turf in turfs)
|
||||
// Calculate where we are relative to the center of the photo
|
||||
var/xoff = (the_turf.x - center.x) * 32 + center_offset
|
||||
var/yoff = (the_turf.y - center.y) * 32 + center_offset
|
||||
res.Blend(getFlatIcon(the_turf.loc), blendMode2iconMode(the_turf.blend_mode),xoff,yoff)
|
||||
return res
|
||||
|
||||
|
||||
@@ -236,31 +255,29 @@
|
||||
return can_see
|
||||
|
||||
/obj/item/device/camera/proc/captureimage(atom/target, mob/user, flag)
|
||||
var/x_c = target.x - 1
|
||||
var/y_c = target.y + 1
|
||||
var/x_c = target.x - (size-1)/2
|
||||
var/y_c = target.y + (size-1)/2
|
||||
var/z_c = target.z
|
||||
|
||||
var/icon/temp = icon('icons/effects/96x96.dmi',"")
|
||||
var/icon/black = icon('icons/turf/space.dmi', "black")
|
||||
var/list/turfs = list()
|
||||
var/mobs = ""
|
||||
for(var/i = 1; i <= 3; i++)
|
||||
for(var/j = 1; j <= 3; j++)
|
||||
for(var/i = 1; i <= size; i++)
|
||||
for(var/j = 1; j <= size; j++)
|
||||
var/turf/T = locate(x_c, y_c, z_c)
|
||||
if(can_capture_turf(T, user))
|
||||
temp.Blend(get_icon(T), ICON_OVERLAY, 32 * (j-1-1), 32 - 32 * (i-1))
|
||||
mobs += get_mobs(T, user)
|
||||
else
|
||||
temp.Blend(black, ICON_OVERLAY, 32 * (j-1), 64 - 32 * (i-1))
|
||||
turfs.Add(T)
|
||||
mobs += get_mobs(T)
|
||||
x_c++
|
||||
y_c--
|
||||
x_c = x_c - 3
|
||||
x_c = x_c - size
|
||||
|
||||
var/datum/picture/P = createpicture(user, temp, mobs, flag)
|
||||
var/datum/picture/P = createpicture(target, user, turfs, mobs, flag)
|
||||
printpicture(user, P)
|
||||
|
||||
/obj/item/device/camera/proc/createpicture(mob/user, icon/temp, mobs, flag)
|
||||
var/icon/small_img = icon(temp)
|
||||
var/icon/tiny_img = icon(temp)
|
||||
/obj/item/device/camera/proc/createpicture(atom/target, mob/user, list/turfs, mobs, flag)
|
||||
var/icon/photoimage = get_icon(turfs, target)
|
||||
|
||||
var/icon/small_img = icon(photoimage)
|
||||
var/icon/tiny_img = icon(photoimage)
|
||||
var/icon/ic = icon('icons/obj/items.dmi',"photo")
|
||||
var/icon/pc = icon('icons/obj/bureaucracy.dmi', "photo")
|
||||
small_img.Scale(8, 8)
|
||||
@@ -269,13 +286,14 @@
|
||||
pc.Blend(tiny_img,ICON_OVERLAY, 12, 19)
|
||||
|
||||
var/datum/picture/P = new()
|
||||
P.fields["author"] = user
|
||||
P.fields["name"] = "photo"
|
||||
P.fields["icon"] = ic
|
||||
P.fields["tiny"] = pc
|
||||
P.fields["img"] = temp
|
||||
P.fields["img"] = photoimage
|
||||
P.fields["desc"] = mobs
|
||||
P.fields["pixel_x"] = rand(-10, 10)
|
||||
P.fields["pixel_y"] = rand(-10, 10)
|
||||
P.fields["size"] = size
|
||||
|
||||
return P
|
||||
|
||||
@@ -287,12 +305,27 @@
|
||||
Photo.construct(P)
|
||||
|
||||
/obj/item/weapon/photo/proc/construct(var/datum/picture/P)
|
||||
name = P.fields["name"]
|
||||
icon = P.fields["icon"]
|
||||
tiny = P.fields["tiny"]
|
||||
img = P.fields["img"]
|
||||
desc = P.fields["desc"]
|
||||
pixel_x = P.fields["pixel_x"]
|
||||
pixel_y = P.fields["pixel_y"]
|
||||
photo_size = P.fields["size"]
|
||||
|
||||
/obj/item/weapon/photo/proc/copy()
|
||||
var/obj/item/weapon/photo/p = new/obj/item/weapon/photo()
|
||||
|
||||
p.icon = icon(icon, icon_state)
|
||||
p.img = icon(img)
|
||||
p.tiny = icon(tiny)
|
||||
p.name = name
|
||||
p.desc = desc
|
||||
p.scribble = scribble
|
||||
|
||||
return p
|
||||
|
||||
|
||||
/**************
|
||||
*video camera *
|
||||
@@ -345,4 +378,4 @@
|
||||
if(get_dist(src, M) <= canhear_range)
|
||||
talk_into(M, msg)
|
||||
for(var/mob/living/carbon/human/H in watcherslist)
|
||||
H.show_message(text("\blue (Newscaster) [] says, '[]'",M,msg), 1)
|
||||
H.show_message(text("\blue (Newscaster) [] says, '[]'",M,msg), 1)
|
||||
@@ -65,7 +65,7 @@
|
||||
_color = "clown"
|
||||
|
||||
/obj/item/weapon/stamp/centcom
|
||||
name = "Nanotrasen representative's rubber stamp"
|
||||
name = "NanoTrasen Representative's rubber stamp"
|
||||
icon_state = "stamp-cent"
|
||||
_color = "centcom"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user