Work on photocopiers, and other paperwork stuff.

You can now photocopy photos! Hurray, the entire crew can have pictures of Ian to keep in their wallets.
Filing cabinets now accept photos, and update properly.

Also committing a new (unused) vending machine sprite from old BS12 code.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4705 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
petethegoat@gmail.com
2012-09-16 20:10:28 +00:00
parent caa3f8055d
commit da9169d75d
5 changed files with 53 additions and 27 deletions

View File

@@ -21,18 +21,18 @@
/obj/structure/filingcabinet/initialize()
for(var/obj/item/I in loc)
if(istype(I, /obj/item/weapon/paper) || istype(I, /obj/item/weapon/folder))
if(istype(I, /obj/item/weapon/paper) || istype(I, /obj/item/weapon/folder) || istype(I, /obj/item/weapon/photo))
I.loc = src
/obj/structure/filingcabinet/attackby(obj/item/P as obj, mob/user as mob)
if(istype(P, /obj/item/weapon/paper) || istype(P, /obj/item/weapon/folder))
if(istype(P, /obj/item/weapon/paper) || istype(P, /obj/item/weapon/folder) || istype(P, /obj/item/weapon/photo))
user << "<span class='notice'>You put [P] in [src].</span>"
user.drop_item()
P.loc = src
spawn()
icon_state = icon_open
sleep(5)
icon_state = icon_closed
icon_state = icon_open
sleep(5)
icon_state = icon_closed
updateUsrDialog()
else if(istype(P, /obj/item/weapon/wrench))
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
anchored = !anchored
@@ -45,6 +45,7 @@
user << "<span class='notice'>\The [src] is empty.</span>"
return
user.machine = src
var/dat = "<center><table>"
var/i
for(i=contents.len, i>=1, i--)
@@ -61,12 +62,9 @@
//var/retrieveindex = text2num(href_list["retrieve"])
var/obj/item/P = locate(href_list["retrieve"])//contents[retrieveindex]
if(!isnull(P) && in_range(src,usr))
if(!usr.get_active_hand())
usr.put_in_hands(P)
else
P.loc = get_turf_loc(src)
if(P && in_range(src, usr))
usr.put_in_hands(P)
updateUsrDialog()
icon_state = icon_open
sleep(5)
icon_state = icon_closed

View File

@@ -63,11 +63,7 @@
var/obj/item/P = locate(href_list["remove"])
if(P)
P.loc = usr.loc
if(ishuman(usr))
if(!usr.get_active_hand())
usr.put_in_hands(P)
else
P.loc = get_turf(usr)
usr.put_in_hands(P)
if(href_list["read"])
var/obj/item/weapon/paper/P = locate(href_list["read"])

View File

@@ -11,6 +11,7 @@
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/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!
@@ -25,7 +26,7 @@
user.machine = src
var/dat = "Photocopier<BR><BR>"
if(copy)
if(copy || photocopy)
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>"
@@ -64,15 +65,36 @@
else
break
updateUsrDialog()
else if(photocopy)
for(var/i = 0, i < copies, i++)
if(toner > 0)
var/obj/item/weapon/photo/p = new /obj/item/weapon/photo (src.loc)
var/icon/I = icon(photocopy.icon, photocopy.icon_state)
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.
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))
p.icon = I
p.name = photocopy.name
p.desc = photocopy.desc
toner -= 5 //photos use a lot of ink!
sleep(15)
else
break
updateUsrDialog()
else if(href_list["remove"])
if(copy)
if(ishuman(usr))
if(!usr.get_active_hand())
copy.loc = usr.loc
usr.put_in_hands(copy)
usr << "<span class='notice'>You take the paper out of the photocopier.</span>"
copy = null
updateUsrDialog()
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(href_list["min"])
if(copies > 1)
copies--
@@ -84,7 +106,7 @@
attackby(obj/item/O as obj, mob/user as mob)
if(istype(O, /obj/item/weapon/paper))
if(!copy)
if(!copy && !photocopy)
user.drop_item()
copy = O
O.loc = src
@@ -92,7 +114,17 @@
flick("bigscanner1", src)
updateUsrDialog()
else
user << "<span class='notice'>There is already paper in \the [src].</span>"
user << "<span class='notice'>There is already something in \the [src].</span>"
else if(istype(O, /obj/item/weapon/photo))
if(!copy && !photocopy)
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))
if(toner == 0)
user.drop_item()