Merge pull request #4706 from DJSnapshot/papers

Carbonless copy papers
This commit is contained in:
Ccomp5950
2014-04-07 02:12:10 -05:00
6 changed files with 86 additions and 9 deletions

View File

@@ -0,0 +1,50 @@
/obj/item/weapon/paper/carbon
name = "paper"
icon_state = "paper_stack"
item_state = "paper"
var copied = 0
var iscopy = 0
/obj/item/weapon/paper/carbon/update_icon()
if(iscopy)
if(info)
icon_state = "cpaper_words"
return
icon_state = "cpaper"
else if (copied)
if(info)
icon_state = "paper_words"
return
icon_state = "paper"
else
if(info)
icon_state = "paper_stack_words"
return
icon_state = "paper_stack"
/obj/item/weapon/paper/carbon/verb/removecopy()
set name = "Remove carbon-copy"
set category = "Object"
set src in usr
if (copied == 0)
var/obj/item/weapon/paper/carbon/c = src
var/copycontents = html_decode(c.info)
var/obj/item/weapon/paper/carbon/copy = new /obj/item/weapon/paper/carbon (usr.loc)
copycontents = replacetext(copycontents, "<font face=\"[c.deffont]\" color=", "<font face=\"[c.deffont]\" nocolor=") //state of the art techniques in action
copycontents = replacetext(copycontents, "<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.
copy.info += copycontents
copy.info += "</font>"
copy.name = "Copy - " + c.name
copy.fields = c.fields
copy.updateinfolinks()
usr << "<span class='notice'>You tear off the carbon-copy!</span>"
c.copied = 1
copy.iscopy = 1
copy.update_icon()
c.update_icon()
else
usr << "There are no more carbon copies attached to this paper!"

View File

@@ -86,3 +86,29 @@
icon_state = "paper_bin0"
else
icon_state = "paper_bin1"
/obj/item/weapon/paper_bin/carbon
name = "carbonless paper bin"
icon_state = "paper_bin2"
/obj/item/weapon/paper_bin/carbon/attack_hand(mob/user as mob)
if(amount >= 1)
amount--
if(amount==0)
update_icon()
var/obj/item/weapon/paper/carbon/P
if(papers.len > 0) //If there's any custom paper on the stack, use that instead of creating a new paper.
P = papers[papers.len]
papers.Remove(P)
else
P = new /obj/item/weapon/paper/carbon
P.loc = user.loc
user.put_in_hands(P)
user << "<span class='notice'>You take [P] out of the [src].</span>"
else
user << "<span class='notice'>[src] is empty!</span>"
add_fingerprint(user)
return

View File

@@ -66,7 +66,7 @@
else if(photocopy)
for(var/i = 0, i < copies, i++)
if(toner > 0)
var/obj/item/weapon/photo/p = new /obj/item/weapon/photo (loc)
var/obj/item/weapon/photo/p = new /obj/item/weapon/photo (src.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