Pen & Paperbin upgrade

Added [field] tags to writing, lets you start writing from that spot, useful for forms.
Made you able to put paper back in to paper bins.
Tweaked fonts for writing, default font is now Verdana, signature font is Times New Roman and crayon is Comic Sans.
Updated photocopier to match the changes.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3376 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
daniel.cf.hultgren@gmail.com
2012-03-30 17:09:37 +00:00
parent 63e708de2a
commit 2b4f25c11f
4 changed files with 424 additions and 297 deletions

View File

@@ -8,150 +8,253 @@
throw_speed = 3
throw_range = 15
layer = 4
var/info //What's actually written on the paper.
var/stamps //The (text for the) stamps on the paper.
var/list/stamped
var/see_face = 1
var/body_parts_covered = HEAD
var/protective_temperature = 0
/obj/item/weapon/paper/New()
var
info //What's actually written on the paper.
info_links //A different version of the paper which includes html links at fields and EOF
stamps //The (text for the) stamps on the paper.
fields //Amount of user created fields
list/stamped
see_face = 1
body_parts_covered = HEAD
protective_temperature = 0
rigged = 0
spam_flag = 0
..()
src.pixel_y = rand(-8, 8)
src.pixel_x = rand(-9, 9)
spawn(2)
const
deffont = "Verdana"
signfont = "Times New Roman"
crayonfont = "Comic Sans MS"
New()
..()
src.pixel_y = rand(-8, 8)
src.pixel_x = rand(-9, 9)
spawn(2)
if(src.info)
src.overlays += "paper_words"
updateinfolinks()
return
update_icon()
if(src.info)
src.overlays += "paper_words"
return
/obj/item/weapon/paper/update_icon()
if(src.info)
src.overlays += "paper_words"
return
/obj/item/weapon/paper/examine()
set src in oview(1)
// ..() //We don't want them to see the dumb "this is a paper" thing every time.
if(!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/dead/observer) || istype(usr, /mob/living/silicon)))
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[stars(info)][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
else
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
return
/obj/item/weapon/paper/verb/rename()
set name = "Rename paper"
set category = "Object"
set src in usr
if ((usr.mutations & CLUMSY) && prob(50))
usr << "\red You cut yourself on the paper."
return
var/n_name = input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text
n_name = copytext(n_name, 1, 32)
if ((loc == usr && usr.stat == 0))
name = "paper[(n_name ? text("- '[n_name]'") : null)]"
add_fingerprint(usr)
return
/obj/item/weapon/paper/attack_self(mob/living/user as mob)
examine()
return
set src in oview(1)
/obj/item/weapon/paper/attack_ai(var/mob/living/silicon/ai/user as mob)
var/dist
if (istype(user) && user.current) //is AI
dist = get_dist(src, user.current)
else //cyborg or AI not seeing through a camera
dist = get_dist(src, user)
if (dist < 2)
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
else
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[stars(info)][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
return
/obj/item/weapon/paper/attackby(obj/item/weapon/P as obj, mob/user as mob)
..()
var/clown = 0
if(user.mind && (user.mind.assigned_role == "Clown"))
clown = 1
if (istype(P, /obj/item/weapon/pen))
var/t = strip_html_simple(input(user, "What text do you wish to add?", "[name]", null),8192) as message
if ((!in_range(src, usr) && src.loc != user && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != user && user.equipped() != P))
return
t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
t = dd_replacetext(t, "\[center\]", "<center>")
t = dd_replacetext(t, "\[/center\]", "</center>")
t = dd_replacetext(t, "\[list\]", "<ul>")
t = dd_replacetext(t, "\[/list\]", "</ul>")
t = dd_replacetext(t, "\[*\]", "<li>")
t = dd_replacetext(t, "\[*\]", "<li>")
t = dd_replacetext(t, "\[br\]", "<BR>")
t = dd_replacetext(t, "\[hr\]", "<HR>")
t = dd_replacetext(t, "\[b\]", "<B>")
t = dd_replacetext(t, "\[/b\]", "</B>")
t = dd_replacetext(t, "\[i\]", "<I>")
t = dd_replacetext(t, "\[/i\]", "</I>")
t = dd_replacetext(t, "\[u\]", "<U>")
t = dd_replacetext(t, "\[/u\]", "</U>")
t = dd_replacetext(t, "\[small\]", "<font size = \"1\">")
t = dd_replacetext(t, "\[/small\]", "</font>")
t = dd_replacetext(t, "\[large\]", "<font size = \"4\">")
t = dd_replacetext(t, "\[/large\]", "</font>")
t = dd_replacetext(t, "\[sign\]", "<font face=vivaldi>[user.real_name]</font>")
var/obj/item/weapon/pen/i = P
t = "<font face=calligrapher color=[i.colour]>[t]</font>"
if(!overlays.Find("paper_words"))
overlays += "paper_words"
info += t
// ..() //We don't want them to see the dumb "this is a paper" thing every time.
if(!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/dead/observer) || istype(usr, /mob/living/silicon)))
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[stars(info)][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
else
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
return
if(istype(P, /obj/item/toy/crayon))
var/t = strip_html_simple(input(user, "What text do you wish to add?", "[name]", null),8192) as message
verb/rename()
set name = "Rename paper"
set category = "Object"
set src in usr
if ((!in_range(src, usr) && src.loc != user && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != user && user.equipped() != P))
if ((usr.mutations & CLUMSY) && prob(50))
usr << "\red You cut yourself on the paper."
return
t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
t = dd_replacetext(t, "\[center\]", "<center>")
t = dd_replacetext(t, "\[/center\]", "</center>")
t = dd_replacetext(t, "\[br\]", "<BR>")
t = dd_replacetext(t, "\[b\]", "")
t = dd_replacetext(t, "\[/b\]", "")
t = dd_replacetext(t, "\[i\]", "<I>")
t = dd_replacetext(t, "\[/i\]", "</I>")
t = dd_replacetext(t, "\[u\]", "<U>")
t = dd_replacetext(t, "\[/u\]", "</U>")
t = dd_replacetext(t, "\[large\]", "<font size = \"4\">")
t = dd_replacetext(t, "\[/large\]", "</font>")
t = dd_replacetext(t, "\[sign\]", "<I>[user.real_name]</I>")
var/obj/item/toy/crayon/i = P
t = "<font face=\"Comic Sans MS\" color=[i.colour]><B>[t]</B></font>"
if(!overlays.Find("paper_words"))
overlays += "paper_words"
info += t
var/n_name = input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text
n_name = copytext(n_name, 1, 32)
if ((loc == usr && usr.stat == 0))
name = "paper[(n_name ? text("- '[n_name]'") : null)]"
add_fingerprint(usr)
return
else
if(istype(P, /obj/item/weapon/stamp))
attack_self(mob/living/user as mob)
examine()
if(rigged && isAprilFools())
if(spam_flag == 0)
spam_flag = 1
playsound(src.loc, 'bikehorn.ogg', 50, 1)
spawn(20)
spam_flag = 0
return
attack_ai(var/mob/living/silicon/ai/user as mob)
var/dist
if (istype(user) && user.current) //is AI
dist = get_dist(src, user.current)
else //cyborg or AI not seeing through a camera
dist = get_dist(src, user)
if (dist < 2)
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
else
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[stars(info)][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
return
proc
addtofield(var/id, var/text, var/links = 0)
var/locid = 0
var/laststart = 1
var/textindex = 1
while(1) // I know this can cause infinite loops and fuck up the whole server, but the if(istart==0) should be safe as fuck
var/istart = 0
if(links)
istart = findtext(info_links, "<span class=\"paper_field\">", laststart)
else
istart = findtext(info, "<span class=\"paper_field\">", laststart)
if(istart==0)
return // No field found with matching id
laststart = istart+1
locid++
if(locid == id)
var/iend = 1
if(links)
iend = findtext(info_links, "</span>", istart)
else
iend = findtext(info, "</span>", istart)
//textindex = istart+26
textindex = iend
break
if(links)
var/before = copytext(info_links, 1, textindex)
var/after = copytext(info_links, textindex)
info_links = before + text + after
else
var/before = copytext(info, 1, textindex)
var/after = copytext(info, textindex)
info = before + text + after
updateinfolinks()
updateinfolinks()
info_links = info
var/i = 0
for(i=1,i<=fields,i++)
addtofield(i, "<font face=\"[deffont]\"><A href='?src=\ref[src];write=[i]'>write</A></font>", 1)
info_links = info_links + "<font face=\"[deffont]\"><A href='?src=\ref[src];write=end'>write</A></font>"
parsepencode(var/t, var/obj/item/weapon/pen/P, mob/user as mob, var/iscrayon = 0)
t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
t = dd_replacetext(t, "\[center\]", "<center>")
t = dd_replacetext(t, "\[/center\]", "</center>")
t = dd_replacetext(t, "\[br\]", "<BR>")
t = dd_replacetext(t, "\[b\]", "<B>")
t = dd_replacetext(t, "\[/b\]", "</B>")
t = dd_replacetext(t, "\[i\]", "<I>")
t = dd_replacetext(t, "\[/i\]", "</I>")
t = dd_replacetext(t, "\[u\]", "<U>")
t = dd_replacetext(t, "\[/u\]", "</U>")
t = dd_replacetext(t, "\[large\]", "<font size = \"4\">")
t = dd_replacetext(t, "\[/large\]", "</font>")
t = dd_replacetext(t, "\[sign\]", "<font face=\"[signfont]\"><i>[user.real_name]</i></font>")
t = dd_replacetext(t, "\[field\]", "<span class=\"paper_field\"></span>")
if(!iscrayon)
t = dd_replacetext(t, "\[*\]", "<li>")
t = dd_replacetext(t, "\[hr\]", "<HR>")
t = dd_replacetext(t, "\[small\]", "<font size = \"1\">")
t = dd_replacetext(t, "\[/small\]", "</font>")
t = dd_replacetext(t, "\[list\]", "<ul>")
t = dd_replacetext(t, "\[/list\]", "</ul>")
t = "<font face=\"[deffont]\" color=[P.colour]>[t]</font>"
else // If it is a crayon, and he still tries to use these, make them empty!
t = dd_replacetext(t, "\[*\]", "")
t = dd_replacetext(t, "\[hr\]", "")
t = dd_replacetext(t, "\[small\]", "")
t = dd_replacetext(t, "\[/small\]", "")
t = dd_replacetext(t, "\[list\]", "")
t = dd_replacetext(t, "\[/list\]", "")
t = "<font face=\"[crayonfont]\" color=[P.colour]><b>[t]</b></font>"
//Count the fields
var/laststart = 1
while(1)
var/i = findtext(t, "<span class=\"paper_field\">", laststart)
if(i==0)
break
laststart = i+1
fields++
return t
openhelp(mob/user as mob)
user << browse({"<HTML><HEAD><TITLE>Pen Help</TITLE></HEAD>
<BODY>
<b><center>Crayon&Pen commands</center></b><br>
<br>
\[br\] : Creates a linebreak.<br>
\[center\] - \[/center\] : Centers the text.<br>
\[b\] - \[/b\] : Makes the text <b>bold</b>.<br>
\[i\] - \[/i\] : Makes the text <i>italic</i>.<br>
\[u\] - \[/u\] : Makes the text <u>underlined</u>.<br>
\[large\] - \[/large\] : Increases the <font size = \"4\">size</font> of the text.<br>
\[sign\] : Inserts a signature of your name in a foolproof way.<br>
\[field\] : Inserts an invisible field which lets you start type from there. Useful for forms.<br>
<br>
<b><center>Pen exclusive commands</center></b><br>
\[small\] - \[/small\] : Decreases the <font size = \"1\">size</font> of the text.<br>
\[list\] - \[/list\] : A list.<br>
\[*\] : A dot used for lists.<br>
\[hr\] : Adds a horizontal rule.
</BODY></HTML>"}, "window=paper_help")
Topic(href, href_list)
..()
if ((usr.stat || usr.restrained()))
return
if(href_list["write"])
var/id = href_list["write"]
var/t = strip_html_simple(input(usr, "What text do you wish to add to " + (id=="end" ? "the end of the paper" : "field "+id) + "?", "[name]", null),8192) as text
var/obj/item/i = usr.equipped() // Check to see if he still got that darn pen, also check if he's using a crayon or pen.
var/iscrayon = 0
if(!istype(i, /obj/item/weapon/pen))
if(!istype(i, /obj/item/toy/crayon))
return
iscrayon = 1
if ((!in_range(src, usr) && src.loc != usr && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != usr && usr.equipped() != i)) // Some check to see if he's allowed to write
return
t = parsepencode(t, i, usr, iscrayon) // Encode everything from pencode to html
if(id!="end")
addtofield(text2num(id), t) // He wants to edit a field, let him.
else
info += t // Oh, he wants to edit to the end of the file, let him.
updateinfolinks()
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links][stamps]</BODY></HTML>", "window=[name]") // Update the window
if(!overlays.Find("paper_words"))
overlays += "paper_words"
attackby(obj/item/weapon/P as obj, mob/user as mob)
..()
var/clown = 0
if(user.mind && (user.mind.assigned_role == "Clown"))
clown = 1
if (istype(P, /obj/item/weapon/pen) || istype(P, /obj/item/toy/crayon))
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links][stamps]</BODY></HTML>", "window=[name]")
//openhelp(user)
return
else if(istype(P, /obj/item/weapon/stamp))
if ((!in_range(src, usr) && src.loc != user && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != user && user.equipped() != P))
return
if(stamps)
stamps += "<BR><i>This paper has been stamped with the [P.name].</i>"
else
stamps += "<HR><i>This paper has been stamped with the [P.name].</i>"
stamps += (stamps=="" ? "<HR>" : "<BR>") + "<i>This paper has been stamped with the [P.name].</i>"
switch(P.type)
if(/obj/item/weapon/stamp/captain)
overlays += "paper_stamped_cap"
@@ -180,5 +283,5 @@
stamped += P.type
user << "\blue You stamp the paper with your rubber stamp."
add_fingerprint(user)
return
add_fingerprint(user)
return

View File

@@ -7,59 +7,82 @@
w_class = 3
throw_speed = 3
throw_range = 7
var/amount = 30 //How much paper is in the bin.
var
amount = 30 //How much paper is in the bin.
list/papers = new/list() //List of papers put in the bin for reference.
sealed = 1 //If it's brandnew and unopened, it's sealed.
/obj/item/weapon/paper_bin/MouseDrop(mob/user as mob)
if ((user == usr && (!( usr.restrained() ) && (!( usr.stat ) && (usr.contents.Find(src) || in_range(src, usr))))))
if (usr.hand)
if (!( usr.l_hand ))
spawn( 0 )
src.attack_hand(usr, 1, 1)
return
else
if (!( usr.r_hand ))
spawn( 0 )
src.attack_hand(usr, 0, 1)
return
return
MouseDrop(mob/user as mob)
if ((user == usr && (!( usr.restrained() ) && (!( usr.stat ) && (usr.contents.Find(src) || in_range(src, usr))))))
if (usr.hand)
if (!( usr.l_hand ))
spawn( 0 )
src.attack_hand(usr, 1, 1)
return
else
if (!( usr.r_hand ))
spawn( 0 )
src.attack_hand(usr, 0, 1)
return
return
/obj/item/weapon/paper_bin/attack_paw(mob/user as mob)
return src.attack_hand(user)
attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/item/weapon/paper_bin/attack_hand(mob/user as mob)
if (amount >= 1)
amount--
update_icon()
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper
P.loc = user.loc
if(ishuman(user))
if(!user.get_active_hand())
user.put_in_hand(P)
attack_hand(mob/user as mob)
if (amount >= 1)
amount--
if(amount==0)
update_icon()
var/obj/item/weapon/paper/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
if(isAprilFools())
if(prob(30))
P.info = "<font face=\"[P.crayonfont]\" color=\"red\"><b>HONK HONK HONK HONK HONK HONK HONK<br>HOOOOOOOOOOOOOOOOOOOOOONK<br>APRIL FOOLS</b></font>"
P.rigged = 1
P.updateinfolinks()
P.loc = user.loc
if(ishuman(user))
if(!user.get_active_hand())
user.put_in_hand(P)
user << "You take a paper out of the bin."
else
P.loc = get_turf_loc(src)
user << "You take a paper out of the bin."
else
P.loc = get_turf_loc(src)
user << "You take a paper out of the bin."
else
user << "The paper bin is empty!"
user << "The paper bin is empty!"
add_fingerprint(user)
return
add_fingerprint(user)
return
/obj/item/weapon/paper_bin/examine()
set src in oview(1)
attackby(obj/item/weapon/paper/i as obj, mob/user as mob)
if(!istype(i))
return
if(amount)
if(amount > 1)
usr << "There are [amount] papers in the bin."
user.drop_item()
i.loc = src
usr << "You put the paper on the top of the paper bin."
papers.Add(i)
amount++
examine()
set src in oview(1)
if(amount)
usr << "There " + (amount > 1 ? "are [amount] papers" : "is one paper") + " in the bin."
else
usr << "There is one paper in the bin."
else
usr << "There are no papers in the bin."
return
usr << "There are no papers in the bin."
return
/obj/item/weapon/paper_bin/update_icon()
if(amount < 1)
icon_state = "paper_bin0"
else
icon_state = "paper_bin1"
update_icon()
if(amount < 1)
icon_state = "paper_bin0"
else
icon_state = "paper_bin1"

View File

@@ -8,128 +8,128 @@
idle_power_usage = 30
active_power_usage = 200
power_channel = EQUIP
var/obj/item/weapon/paper/copy = 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
obj/item/weapon/paper/copy = null //what's in the copier!
copies = 1 //how many copies to print!
toner = 30 //how much toner is left! woooooo~
maxcopies = 10 //how many copies can be copied at once- idea shamelessly stolen from bs12's copier!
/obj/machinery/photocopier/attack_ai(mob/user as mob)
return src.attack_hand(user)
attack_ai(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/photocopier/attack_paw(mob/user as mob)
return src.attack_hand(user)
attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/photocopier/attack_hand(mob/user as mob)
user.machine = src
attack_hand(mob/user as mob)
user.machine = src
var/dat = "Photocopier<BR><BR>"
if(copy)
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>"
dat += "Current toner level: [toner]"
if(!toner)
dat +="<BR>Please insert a new toner cartridge!"
user << browse(dat, "window=copier")
onclose(user, "copier")
return
obj/machinery/photocopier/Topic(href, href_list)
if(href_list["copy"])
var/dat = "Photocopier<BR><BR>"
if(copy)
for(var/i = 0, i < copies, i++)
if(toner > 0)
var/obj/item/weapon/paper/c = new /obj/item/weapon/paper (src.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 = dd_replacetext(copied, "<font face=calligrapher color=", "<font face=calligrapher nocolor=") //state of the art techniques in action
copied = dd_replacetext(copied, "<font face=\"Comic Sans MS\" color=", "<font face=\"Comic Sans MS\" 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
toner--
sleep(15)
else
break
updateUsrDialog()
if(href_list["remove"])
if(copy)
if(ishuman(usr))
if(!usr.get_active_hand())
copy.loc = usr.loc
usr.put_in_hand(copy)
usr << "You take the paper out of the photocopier."
copy = null
updateUsrDialog()
if(href_list["min"])
if(copies > 1)
copies--
updateUsrDialog()
if(href_list["add"])
if(copies < maxcopies)
copies++
updateUsrDialog()
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>"
dat += "Current toner level: [toner]"
if(!toner)
dat +="<BR>Please insert a new toner cartridge!"
user << browse(dat, "window=copier")
onclose(user, "copier")
return
obj/machinery/photocopier/attackby(obj/item/O as obj, mob/user as mob)
if(istype(O, /obj/item/weapon/paper))
if(!copy)
user.drop_item()
copy = O
O.loc = src
user << "You insert the paper into the photocopier."
flick("bigscanner1", src)
updateUsrDialog()
else
user << "There is already paper in the photocopier."
if(istype(O, /obj/item/device/toner))
if(toner == 0)
user.drop_item()
del(O)
toner = 30
user << "You insert the toner cartridge into the photocopier."
updateUsrDialog()
else
user << "This cartridge is not yet ready for replacement! Use up the rest of the toner."
Topic(href, href_list)
if(href_list["copy"])
if(copy)
for(var/i = 0, i < copies, i++)
if(toner > 0)
var/obj/item/weapon/paper/c = new /obj/item/weapon/paper (src.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 = dd_replacetext(copied, "<font face=\"[c.deffont]\" color=", "<font face=\"[c.deffont]\" nocolor=") //state of the art techniques in action
copied = dd_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--
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_hand(copy)
usr << "You take the paper out of the photocopier."
copy = null
updateUsrDialog()
else if(href_list["min"])
if(copies > 1)
copies--
updateUsrDialog()
else if(href_list["add"])
if(copies < maxcopies)
copies++
updateUsrDialog()
obj/machinery/photocopier/ex_act(severity)
switch(severity)
if(1.0)
del(src)
return
if(2.0)
if(prob(50))
del(src)
attackby(obj/item/O as obj, mob/user as mob)
if(istype(O, /obj/item/weapon/paper))
if(!copy)
user.drop_item()
copy = O
O.loc = src
user << "You insert the paper into the photocopier."
flick("bigscanner1", src)
updateUsrDialog()
else
if(toner > 0)
new /obj/effect/decal/cleanable/oil(get_turf(src))
toner = 0
return
user << "There is already paper in the photocopier."
else if(istype(O, /obj/item/device/toner))
if(toner == 0)
user.drop_item()
del(O)
toner = 30
user << "You insert the toner cartridge into the photocopier."
updateUsrDialog()
else
user << "This cartridge is not yet ready for replacement! Use up the rest of the toner."
return
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
blob_act()
if(prob(50))
del(src)
else
if(prob(50))
if(toner > 0)
new /obj/effect/decal/cleanable/oil(get_turf(src))
toner = 0
return
return
obj/machinery/photocopier/blob_act()
if(prob(50))
del(src)
return
else
if(toner > 0)
new /obj/effect/decal/cleanable/oil(get_turf(src))
toner = 0
if(toner > 0)
new /obj/effect/decal/cleanable/oil(get_turf(src))
toner = 0
return
obj/item/device/toner
/obj/item/device/toner
name = "toner cartridge"
icon_state = "tonercartridge"