Updates Part Twelve

This commit is contained in:
Unknown
2019-04-14 14:38:30 -04:00
parent 042720823a
commit 7594c28f21
56 changed files with 1074 additions and 205 deletions

View File

@@ -32,12 +32,37 @@
/obj/item/weapon/computer_hardware/nano_printer/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/paper))
if(stored_paper >= max_paper)
to_chat(user, "You try to add \the [W] into [src], but it's paper bin is full")
to_chat(user, "You try to add \the [W] into \the [src], but its paper bin is full.")
return
to_chat(user, "You insert \the [W] into [src].")
qdel(W)
stored_paper++
else if(istype(W, /obj/item/weapon/paper_bundle))
var/obj/item/weapon/paper_bundle/B = W
var/num_of_pages_added = 0
if(stored_paper >= max_paper)
to_chat(user, "You try to add \the [W] into \the [src], but its paper bin is full.")
return
for(var/obj/item/weapon/bundleitem in B) //loop through items in bundle
if(istype(bundleitem, /obj/item/weapon/paper)) //if item is paper (and not photo), add into the bin
B.pages.Remove(bundleitem)
qdel(bundleitem)
num_of_pages_added++
stored_paper++
if(stored_paper >= max_paper) //check if the printer is full yet
to_chat(user, "The printer has been filled to full capacity.")
break
if(B.pages.len == 0) //if all its papers have been put into the printer, delete bundle
qdel(W)
else if(B.pages.len == 1) //if only one item left, extract item and delete the one-item bundle
user.drop_from_inventory(B)
user.put_in_hands(B[1])
qdel(B)
else //if at least two items remain, just update the bundle icon
B.update_icon()
to_chat(user, "You add [num_of_pages_added] papers from \the [W] into \the [src].")
return
/obj/item/weapon/computer_hardware/nano_printer/Destroy()
if(holder2 && (holder2.nano_printer == src))