Initial Commit

This commit is contained in:
skull132
2014-03-11 09:03:52 +02:00
commit a8d9450c7e
3486 changed files with 415920 additions and 0 deletions
+148
View File
@@ -0,0 +1,148 @@
/obj/item/weapon/clipboard
name = "clipboard"
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "clipboard"
item_state = "clipboard"
throwforce = 0
w_class = 2.0
throw_speed = 3
throw_range = 10
var/obj/item/weapon/pen/haspen //The stored pen.
var/obj/item/weapon/toppaper //The topmost piece of paper.
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT
/obj/item/weapon/clipboard/New()
update_icon()
/obj/item/weapon/clipboard/MouseDrop(obj/over_object as obj) //Quick clipboard fix. -Agouri
if(ishuman(usr))
var/mob/M = usr
if(!(istype(over_object, /obj/screen) ))
return ..()
if(!M.restrained() && !M.stat)
switch(over_object.name)
if("r_hand")
M.u_equip(src)
M.put_in_r_hand(src)
if("l_hand")
M.u_equip(src)
M.put_in_l_hand(src)
add_fingerprint(usr)
return
/obj/item/weapon/clipboard/update_icon()
overlays.Cut()
if(toppaper)
overlays += toppaper.icon_state
overlays += toppaper.overlays
if(haspen)
overlays += "clipboard_pen"
overlays += "clipboard_over"
return
/obj/item/weapon/clipboard/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/weapon/photo))
user.drop_item()
W.loc = src
if(istype(W, /obj/item/weapon/paper))
toppaper = W
user << "<span class='notice'>You clip the [W] onto \the [src].</span>"
update_icon()
else if(toppaper)
toppaper.attackby(usr.get_active_hand(), usr)
update_icon()
return
/obj/item/weapon/clipboard/attack_self(mob/user as mob)
var/dat = "<title>Clipboard</title>"
if(haspen)
dat += "<A href='?src=\ref[src];pen=1'>Remove Pen</A><BR><HR>"
else
dat += "<A href='?src=\ref[src];addpen=1'>Add Pen</A><BR><HR>"
//The topmost paper. I don't think there's any way to organise contents in byond, so this is what we're stuck with. -Pete
if(toppaper)
var/obj/item/weapon/paper/P = toppaper
dat += "<A href='?src=\ref[src];write=\ref[P]'>Write</A> <A href='?src=\ref[src];remove=\ref[P]'>Remove</A> - <A href='?src=\ref[src];read=\ref[P]'>[P.name]</A><BR><HR>"
for(var/obj/item/weapon/paper/P in src)
if(P==toppaper)
continue
dat += "<A href='?src=\ref[src];remove=\ref[P]'>Remove</A> - <A href='?src=\ref[src];read=\ref[P]'>[P.name]</A><BR>"
for(var/obj/item/weapon/photo/Ph in src)
dat += "<A href='?src=\ref[src];remove=\ref[Ph]'>Remove</A> - <A href='?src=\ref[src];look=\ref[Ph]'>[Ph.name]</A><BR>"
user << browse(dat, "window=clipboard")
onclose(user, "clipboard")
add_fingerprint(usr)
return
/obj/item/weapon/clipboard/Topic(href, href_list)
..()
if((usr.stat || usr.restrained()))
return
if(usr.contents.Find(src))
if(href_list["pen"])
if(haspen)
haspen.loc = usr.loc
usr.put_in_hands(haspen)
haspen = null
if(href_list["addpen"])
if(!haspen)
if(istype(usr.get_active_hand(), /obj/item/weapon/pen))
var/obj/item/weapon/pen/W = usr.get_active_hand()
usr.drop_item()
W.loc = src
haspen = W
usr << "<span class='notice'>You slot the pen into \the [src].</span>"
if(href_list["write"])
var/obj/item/P = locate(href_list["write"])
if(P)
if(usr.get_active_hand())
P.attackby(usr.get_active_hand(), usr)
if(href_list["remove"])
var/obj/item/P = locate(href_list["remove"])
if(P)
P.loc = usr.loc
usr.put_in_hands(P)
if(P == toppaper)
toppaper = null
var/obj/item/weapon/paper/newtop = locate(/obj/item/weapon/paper) in src
if(newtop && (newtop != P))
toppaper = newtop
else
toppaper = null
if(href_list["read"])
var/obj/item/weapon/paper/P = locate(href_list["read"])
if(P)
if(!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/dead/observer) || istype(usr, /mob/living/silicon)))
usr << browse("<HTML><HEAD><TITLE>[P.name]</TITLE></HEAD><BODY>[stars(P.info)][P.stamps]</BODY></HTML>", "window=[P.name]")
onclose(usr, "[P.name]")
else
usr << browse("<HTML><HEAD><TITLE>[P.name]</TITLE></HEAD><BODY>[P.info][P.stamps]</BODY></HTML>", "window=[P.name]")
onclose(usr, "[P.name]")
if(href_list["look"])
var/obj/item/weapon/photo/P = locate(href_list["look"])
if(P)
P.show(usr)
if(href_list["top"])
var/obj/item/P = locate(href_list["top"])
if(P)
toppaper = P
usr << "<span class='notice'>You move [P.name] to the top.</span>"
//Update everything
attack_self(usr)
update_icon()
return
+171
View File
@@ -0,0 +1,171 @@
/* Filing cabinets!
* Contains:
* Filing Cabinets
* Security Record Cabinets
* Medical Record Cabinets
*/
/*
* Filing Cabinets
*/
/obj/structure/filingcabinet
name = "filing cabinet"
desc = "A large cabinet with drawers."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "filingcabinet"
density = 1
anchored = 1
/obj/structure/filingcabinet/chestdrawer
name = "chest drawer"
icon_state = "chestdrawer"
/obj/structure/filingcabinet/filingcabinet //not changing the path to avoid unecessary map issues, but please don't name stuff like this in the future -Pete
icon_state = "tallcabinet"
/obj/structure/filingcabinet/initialize()
for(var/obj/item/I in loc)
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) || istype(P, /obj/item/weapon/photo))
user << "<span class='notice'>You put [P] in [src].</span>"
user.drop_item()
P.loc = src
icon_state = "[initial(icon_state)]-open"
sleep(5)
icon_state = initial(icon_state)
updateUsrDialog()
else if(istype(P, /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
user << "<span class='notice'>You can't put [P] in [src]!</span>"
/obj/structure/filingcabinet/attack_hand(mob/user as mob)
if(contents.len <= 0)
user << "<span class='notice'>\The [src] is empty.</span>"
return
user.set_machine(src)
var/dat = "<center><table>"
var/i
for(i=contents.len, i>=1, i--)
var/obj/item/P = contents[i]
dat += "<tr><td><a href='?src=\ref[src];retrieve=\ref[P]'>[P.name]</a></td></tr>"
dat += "</table></center>"
user << browse("<html><head><title>[name]</title></head><body>[dat]</body></html>", "window=filingcabinet;size=350x300")
return
/obj/structure/filingcabinet/attack_tk(mob/user)
if(anchored)
attack_self_tk(user)
else
..()
/obj/structure/filingcabinet/attack_self_tk(mob/user)
if(contents.len)
if(prob(40 + contents.len * 5))
var/obj/item/I = pick(contents)
I.loc = loc
if(prob(25))
step_rand(I)
user << "<span class='notice'>You pull \a [I] out of [src] at random.</span>"
return
user << "<span class='notice'>You find nothing in [src].</span>"
/obj/structure/filingcabinet/Topic(href, href_list)
if(href_list["retrieve"])
usr << browse("", "window=filingcabinet") // Close the menu
//var/retrieveindex = text2num(href_list["retrieve"])
var/obj/item/P = locate(href_list["retrieve"])//contents[retrieveindex]
if(P && in_range(src, usr))
usr.put_in_hands(P)
updateUsrDialog()
icon_state = "[initial(icon_state)]-open"
sleep(5)
icon_state = initial(icon_state)
/*
* Security Record Cabinets
*/
/obj/structure/filingcabinet/security
var/virgin = 1
/obj/structure/filingcabinet/security/proc/populate()
if(virgin)
for(var/datum/data/record/G in data_core.general)
var/datum/data/record/S
for(var/datum/data/record/R in data_core.security)
if((R.fields["name"] == G.fields["name"] || R.fields["id"] == G.fields["id"]))
S = R
break
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src)
P.info = "<CENTER><B>Security Record</B></CENTER><BR>"
P.info += "Name: [G.fields["name"]] ID: [G.fields["id"]]<BR>\nSex: [G.fields["sex"]]<BR>\nAge: [G.fields["age"]]<BR>\nFingerprint: [G.fields["fingerprint"]]<BR>\nPhysical Status: [G.fields["p_stat"]]<BR>\nMental Status: [G.fields["m_stat"]]<BR>"
P.info += "<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: [S.fields["criminal"]]<BR>\n<BR>\nMinor Crimes: [S.fields["mi_crim"]]<BR>\nDetails: [S.fields["mi_crim_d"]]<BR>\n<BR>\nMajor Crimes: [S.fields["ma_crim"]]<BR>\nDetails: [S.fields["ma_crim_d"]]<BR>\n<BR>\nImportant Notes:<BR>\n\t[S.fields["notes"]]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>"
var/counter = 1
while(S.fields["com_[counter]"])
P.info += "[S.fields["com_[counter]"]]<BR>"
counter++
P.info += "</TT>"
P.name = "paper - '[G.fields["name"]]'"
virgin = 0 //tabbing here is correct- it's possible for people to try and use it
//before the records have been generated, so we do this inside the loop.
..()
/obj/structure/filingcabinet/security/attack_hand()
populate()
..()
/obj/structure/filingcabinet/security/attack_tk()
populate()
..()
/*
* Medical Record Cabinets
*/
/obj/structure/filingcabinet/medical
var/virgin = 1
/obj/structure/filingcabinet/medical/proc/populate()
if(virgin)
for(var/datum/data/record/G in data_core.general)
var/datum/data/record/M
for(var/datum/data/record/R in data_core.medical)
if((R.fields["name"] == G.fields["name"] || R.fields["id"] == G.fields["id"]))
M = R
break
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src)
P.info = "<CENTER><B>Medical Record</B></CENTER><BR>"
P.info += "Name: [G.fields["name"]] ID: [G.fields["id"]]<BR>\nSex: [G.fields["sex"]]<BR>\nAge: [G.fields["age"]]<BR>\nFingerprint: [G.fields["fingerprint"]]<BR>\nPhysical Status: [G.fields["p_stat"]]<BR>\nMental Status: [G.fields["m_stat"]]<BR>"
P.info += "<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: [M.fields["b_type"]]<BR>\nDNA: [M.fields["b_dna"]]<BR>\n<BR>\nMinor Disabilities: [M.fields["mi_dis"]]<BR>\nDetails: [M.fields["mi_dis_d"]]<BR>\n<BR>\nMajor Disabilities: [M.fields["ma_dis"]]<BR>\nDetails: [M.fields["ma_dis_d"]]<BR>\n<BR>\nAllergies: [M.fields["alg"]]<BR>\nDetails: [M.fields["alg_d"]]<BR>\n<BR>\nCurrent Diseases: [M.fields["cdi"]] (per disease info placed in log/comment section)<BR>\nDetails: [M.fields["cdi_d"]]<BR>\n<BR>\nImportant Notes:<BR>\n\t[M.fields["notes"]]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>"
var/counter = 1
while(M.fields["com_[counter]"])
P.info += "[M.fields["com_[counter]"]]<BR>"
counter++
P.info += "</TT>"
P.name = "paper - '[G.fields["name"]]'"
virgin = 0 //tabbing here is correct- it's possible for people to try and use it
//before the records have been generated, so we do this inside the loop.
..()
/obj/structure/filingcabinet/medical/attack_hand()
populate()
..()
/obj/structure/filingcabinet/medical/attack_tk()
populate()
..()
+85
View File
@@ -0,0 +1,85 @@
/obj/item/weapon/folder
name = "folder"
desc = "A folder."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "folder"
w_class = 2
pressure_resistance = 2
/obj/item/weapon/folder/blue
desc = "A blue folder."
icon_state = "folder_blue"
/obj/item/weapon/folder/red
desc = "A red folder."
icon_state = "folder_red"
/obj/item/weapon/folder/yellow
desc = "A yellow folder."
icon_state = "folder_yellow"
/obj/item/weapon/folder/white
desc = "A white folder."
icon_state = "folder_white"
/obj/item/weapon/folder/update_icon()
overlays.Cut()
if(contents.len)
overlays += "folder_paper"
return
/obj/item/weapon/folder/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/weapon/photo))
user.drop_item()
W.loc = src
user << "<span class='notice'>You put the [W] into \the [src].</span>"
update_icon()
else if(istype(W, /obj/item/weapon/pen))
var/n_name = copytext(sanitize(input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text), 1, MAX_NAME_LEN)
if((loc == usr && usr.stat == 0))
name = "folder[(n_name ? text("- '[n_name]'") : null)]"
return
/obj/item/weapon/folder/attack_self(mob/user as mob)
var/dat = "<title>[name]</title>"
for(var/obj/item/weapon/paper/P in src)
dat += "<A href='?src=\ref[src];remove=\ref[P]'>Remove</A> - <A href='?src=\ref[src];read=\ref[P]'>[P.name]</A><BR>"
for(var/obj/item/weapon/photo/Ph in src)
dat += "<A href='?src=\ref[src];remove=\ref[Ph]'>Remove</A> - <A href='?src=\ref[src];look=\ref[Ph]'>[Ph.name]</A><BR>"
user << browse(dat, "window=folder")
onclose(user, "folder")
add_fingerprint(usr)
return
/obj/item/weapon/folder/Topic(href, href_list)
..()
if((usr.stat || usr.restrained()))
return
if(usr.contents.Find(src))
if(href_list["remove"])
var/obj/item/P = locate(href_list["remove"])
if(P && P.loc == src)
P.loc = usr.loc
usr.put_in_hands(P)
if(href_list["read"])
var/obj/item/weapon/paper/P = locate(href_list["read"])
if(P)
if(!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/dead/observer) || istype(usr, /mob/living/silicon)))
usr << browse("<HTML><HEAD><TITLE>[P.name]</TITLE></HEAD><BODY>[stars(P.info)][P.stamps]</BODY></HTML>", "window=[P.name]")
onclose(usr, "[P.name]")
else
usr << browse("<HTML><HEAD><TITLE>[P.name]</TITLE></HEAD><BODY>[P.info][P.stamps]</BODY></HTML>", "window=[P.name]")
onclose(usr, "[P.name]")
if(href_list["look"])
var/obj/item/weapon/photo/P = locate(href_list["look"])
if(P)
P.show(usr)
//Update everything
attack_self(usr)
update_icon()
return
+53
View File
@@ -0,0 +1,53 @@
/obj/item/weapon/hand_labeler
name = "hand labeler"
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "labeler0"
item_state = "flight"
var/label = null
var/labels_left = 30
var/mode = 0 //off or on.
/obj/item/weapon/hand_labeler/afterattack(atom/A, mob/user as mob, proximity)
if(!proximity) return
if(!mode) //if it's off, give up.
return
if(A == loc) // if placing the labeller into something (e.g. backpack)
return // don't set a label
if(!labels_left)
user << "<span class='notice'>No labels left.</span>"
return
if(!label || !length(label))
user << "<span class='notice'>No text set.</span>"
return
if(length(A.name) + length(label) > 64)
user << "<span class='notice'>Label too big.</span>"
return
if(ishuman(A))
user << "<span class='notice'>You can't label humans.</span>"
return
if(issilicon(A))
user << "<span class='notice'>You can't label cyborgs.</span>"
return
if(istype(A, /obj/item/weapon/reagent_containers/glass))
user << "<span class='notice'>The label can't stick to the [A.name]. (Try using a pen)</span>"
return
user.visible_message("<span class='notice'>[user] labels [A] as [label].</span>", \
"<span class='notice'>You label [A] as [label].</span>")
A.name = "[A.name] ([label])"
/obj/item/weapon/hand_labeler/attack_self(mob/user as mob)
mode = !mode
icon_state = "labeler[mode]"
if(mode)
user << "<span class='notice'>You turn on \the [src].</span>"
//Now let them chose the text.
var/str = copytext(reject_bad_text(input(user,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str))
user << "<span class='notice'>Invalid text.</span>"
return
label = str
user << "<span class='notice'>You set the text to '[str]'.</span>"
else
user << "<span class='notice'>You turn off \the [src].</span>"
File diff suppressed because one or more lines are too long
+81
View File
@@ -0,0 +1,81 @@
/obj/item/weapon/paper_bin
name = "paper bin"
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "paper_bin1"
item_state = "sheet-metal"
throwforce = 1
w_class = 3
throw_speed = 3
throw_range = 7
pressure_resistance = 10
var/amount = 30 //How much paper is in the bin.
var/list/papers = new/list() //List of papers put in the bin for reference.
/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(!istype(usr, /mob/living/carbon/slime) && !istype(usr, /mob/living/simple_animal))
if( !usr.get_active_hand() ) //if active hand is empty
attack_hand(usr, 1, 1)
return
/obj/item/weapon/paper_bin/attack_paw(mob/user as mob)
return attack_hand(user)
/obj/item/weapon/paper_bin/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(Holiday == "April Fool's Day")
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
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
/obj/item/weapon/paper_bin/attackby(obj/item/weapon/paper/i as obj, mob/user as mob)
if(!istype(i))
return
user.drop_item()
i.loc = src
user << "<span class='notice'>You put [i] in [src].</span>"
papers.Add(i)
amount++
/obj/item/weapon/paper_bin/examine()
set src in oview(1)
if(amount)
usr << "<span class='notice'>There " + (amount > 1 ? "are [amount] papers" : "is one paper") + " in the bin.</span>"
else
usr << "<span class='notice'>There are no papers in the bin.</span>"
return
/obj/item/weapon/paper_bin/update_icon()
if(amount < 1)
icon_state = "paper_bin0"
else
icon_state = "paper_bin1"
+110
View File
@@ -0,0 +1,110 @@
/* Pens!
* Contains:
* Pens
* Sleepy Pens
* Parapens
*/
/*
* Pens
*/
/obj/item/weapon/pen
desc = "It's a normal black ink pen."
name = "pen"
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "pen"
item_state = "pen"
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT | SLOT_EARS
throwforce = 0
w_class = 1.0
throw_speed = 7
throw_range = 15
m_amt = 10
var/colour = "black" //what colour the ink is!
pressure_resistance = 2
/obj/item/weapon/pen/blue
desc = "It's a normal blue ink pen."
icon_state = "pen_blue"
colour = "blue"
/obj/item/weapon/pen/red
desc = "It's a normal red ink pen."
icon_state = "pen_red"
colour = "red"
/obj/item/weapon/pen/invisible
desc = "It's an invisble pen marker."
icon_state = "pen"
colour = "white"
/obj/item/weapon/pen/attack(mob/M as mob, mob/user as mob)
if(!ismob(M))
return
user << "<span class='warning'>You stab [M] with the pen.</span>"
// M << "\red You feel a tiny prick!" //That's a whole lot of meta!
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been stabbed with [name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [name] to stab [M.name] ([M.ckey])</font>")
msg_admin_attack("[user.name] ([user.ckey]) Used the [name] to stab [M.name] ([M.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
return
/*
* Sleepy Pens
*/
/obj/item/weapon/pen/sleepypen
desc = "It's a black ink pen with a sharp point and a carefully engraved \"Waffle Co.\""
flags = FPRINT | TABLEPASS | OPENCONTAINER
slot_flags = SLOT_BELT
origin_tech = "materials=2;syndicate=5"
/obj/item/weapon/pen/sleepypen/New()
var/datum/reagents/R = new/datum/reagents(30) //Used to be 300
reagents = R
R.my_atom = src
R.add_reagent("chloralhydrate", 22) //Used to be 100 sleep toxin//30 Chloral seems to be fatal, reducing it to 22./N
..()
return
/obj/item/weapon/pen/sleepypen/attack(mob/M as mob, mob/user as mob)
if(!(istype(M,/mob)))
return
..()
if(reagents.total_volume)
if(M.reagents) reagents.trans_to(M, 50) //used to be 150
return
/*
* Parapens
*/
/obj/item/weapon/pen/paralysis
flags = FPRINT | TABLEPASS | OPENCONTAINER
slot_flags = SLOT_BELT
origin_tech = "materials=2;syndicate=5"
/obj/item/weapon/pen/paralysis/attack(mob/M as mob, mob/user as mob)
if(!(istype(M,/mob)))
return
..()
if(reagents.total_volume)
if(M.reagents) reagents.trans_to(M, 50)
return
/obj/item/weapon/pen/paralysis/New()
var/datum/reagents/R = new/datum/reagents(50)
reagents = R
R.my_atom = src
R.add_reagent("zombiepowder", 10)
R.add_reagent("impedrezene", 25)
R.add_reagent("cryptobiolin", 15)
..()
return
+175
View File
@@ -0,0 +1,175 @@
/obj/machinery/photocopier
name = "photocopier"
icon = 'icons/obj/library.dmi'
icon_state = "bigscanner"
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/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!
attack_ai(mob/user as mob)
return attack_hand(user)
attack_paw(mob/user as mob)
return attack_hand(user)
attack_hand(mob/user as mob)
user.set_machine(src)
var/dat = "Photocopier<BR><BR>"
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>"
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
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 (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.updateinfolinks()
toner--
sleep(15)
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 (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!
sleep(15)
else
break
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(href_list["min"])
if(copies > 1)
copies--
updateUsrDialog()
else if(href_list["add"])
if(copies < maxcopies)
copies++
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(!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()
del(O)
toner = 30
user << "<span class='notice'>You insert the toner cartridge into \the [src].</span>"
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
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/blood/oil(get_turf(src))
toner = 0
else
if(prob(50))
if(toner > 0)
new /obj/effect/decal/cleanable/blood/oil(get_turf(src))
toner = 0
return
blob_act()
if(prob(50))
del(src)
else
if(toner > 0)
new /obj/effect/decal/cleanable/blood/oil(get_turf(src))
toner = 0
return
/obj/item/device/toner
name = "toner cartridge"
icon_state = "tonercartridge"
+262
View File
@@ -0,0 +1,262 @@
/* Photography!
* Contains:
* Camera
* Camera Film
* Photos
* Photo Albums
*/
/*******
* film *
*******/
/obj/item/device/camera_film
name = "film cartridge"
icon = 'icons/obj/items.dmi'
desc = "A camera film cartridge. Insert it into a camera to reload it."
icon_state = "film"
item_state = "electropack"
w_class = 1.0
/********
* photo *
********/
/obj/item/weapon/photo
name = "photo"
icon = 'icons/obj/items.dmi'
icon_state = "photo"
item_state = "paper"
w_class = 1.0
var/icon/img //Big photo image
var/scribble //Scribble on the back.
/obj/item/weapon/photo/attack_self(mob/user as mob)
examine()
/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))
var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text)
txt = copytext(txt, 1, 128)
if(loc == user && user.stat == 0)
scribble = txt
..()
/obj/item/weapon/photo/examine()
set src in oview(1)
if(in_range(usr, src))
show(usr)
usr << desc
else
usr << "<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]")
return
/obj/item/weapon/photo/verb/rename()
set name = "Rename photo"
set category = "Object"
set src in usr
var/n_name = copytext(sanitize(input(usr, "What would you like to label the photo?", "Photo Labelling", null) as text), 1, MAX_NAME_LEN)
//loc.loc check is for making possible renaming photos in clipboards
if(( (loc == usr || (loc.loc && loc.loc == usr)) && usr.stat == 0))
name = "photo[(n_name ? text("- '[n_name]'") : null)]"
add_fingerprint(usr)
return
/**************
* photo album *
**************/
/obj/item/weapon/storage/photo_album
name = "Photo album"
icon = 'icons/obj/items.dmi'
icon_state = "album"
item_state = "briefcase"
can_hold = list("/obj/item/weapon/photo",)
/obj/item/weapon/storage/photo_album/MouseDrop(obj/over_object as obj)
if((istype(usr, /mob/living/carbon/human) || (ticker && ticker.mode.name == "monkey")))
var/mob/M = usr
if(!( istype(over_object, /obj/screen) ))
return ..()
playsound(loc, "rustle", 50, 1, -5)
if((!( M.restrained() ) && !( M.stat ) && M.back == src))
switch(over_object.name)
if("r_hand")
M.u_equip(src)
M.put_in_r_hand(src)
if("l_hand")
M.u_equip(src)
M.put_in_l_hand(src)
add_fingerprint(usr)
return
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
if(usr.s_active)
usr.s_active.close(usr)
show_to(usr)
return
return
/*********
* camera *
*********/
/obj/item/device/camera
name = "camera"
icon = 'icons/obj/items.dmi'
desc = "A polaroid camera. 10 photos left."
icon_state = "camera"
item_state = "electropack"
w_class = 2.0
flags = FPRINT | CONDUCT | TABLEPASS
slot_flags = SLOT_BELT
m_amt = 2000
var/pictures_max = 10
var/pictures_left = 10
var/on = 1
var/icon_on = "camera"
var/icon_off = "camera_off"
/obj/item/device/camera/attack(mob/living/carbon/human/M as mob, mob/user as mob)
return
/obj/item/device/camera/attack_self(mob/user as mob)
on = !on
if(on)
src.icon_state = icon_on
else
src.icon_state = icon_off
user << "You switch the camera [on ? "on" : "off"]."
return
/obj/item/device/camera/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/device/camera_film))
if(pictures_left)
user << "<span class='notice'>[src] still has some film in it!</span>"
return
user << "<span class='notice'>You insert [I] into [src].</span>"
user.drop_item()
del(I)
pictures_left = pictures_max
return
..()
/obj/item/device/camera/proc/get_icon(turf/the_turf as turf)
//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)
var/atoms[] = list()
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]
if(A)
var/icon/img = getFlatIcon(A, A.dir)//build_composite_icon(A)
if(istype(img, /icon))
res.Blend(new/icon(img, "", A.dir), ICON_OVERLAY, 33 + A.pixel_x, 33 + A.pixel_y)
return res
/obj/item/device/camera/proc/get_mobs(turf/the_turf as turf)
var/mob_detail
for(var/mob/living/carbon/A in the_turf)
if(A.invisibility) continue
var/holding = null
if(A.l_hand || A.r_hand)
if(A.l_hand) holding = "They are holding \a [A.l_hand]"
if(A.r_hand)
if(holding)
holding += " and \a [A.r_hand]"
else
holding = "They are holding \a [A.r_hand]"
if(!mob_detail)
mob_detail = "You can see [A] on the photo[A:health < 75 ? " - [A] looks hurt":""].[holding ? " [holding]":"."]. "
else
mob_detail += "You can also see [A] on the photo[A:health < 75 ? " - [A] looks hurt":""].[holding ? " [holding]":"."]."
return mob_detail
/obj/item/device/camera/afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag)
if(!on || !pictures_left || ismob(target.loc)) return
var/x_c = target.x - 1
var/y_c = target.y + 1
var/z_c = target.z
var/icon/temp = icon('icons/effects/96x96.dmi',"")
var/icon/black = icon('icons/turf/space.dmi', "black")
var/mobs = ""
for(var/i = 1; i <= 3; i++)
for(var/j = 1; j <= 3; j++)
var/turf/T = locate(x_c, y_c, z_c)
var/mob/dummy = new(T) //Go go visibility check dummy
var/viewer = user
if(user.client) //To make shooting through security cameras possible
viewer = user.client.eye
if(dummy in viewers(world.view, viewer))
temp.Blend(get_icon(T), ICON_OVERLAY, 32 * (j-1-1), 32 - 32 * (i-1))
else
temp.Blend(black, ICON_OVERLAY, 32 * (j-1), 64 - 32 * (i-1))
mobs += get_mobs(T)
dummy.loc = null
dummy = null //Alas, nameless creature //garbage collect it instead
x_c++
y_c--
x_c = x_c - 3
var/obj/item/weapon/photo/P = new/obj/item/weapon/photo()
P.loc = user.loc
if(!user.get_inactive_hand())
user.put_in_inactive_hand(P)
var/icon/small_img = icon(temp)
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
P.img = temp
P.desc = mobs
P.pixel_x = rand(-10, 10)
P.pixel_y = rand(-10, 10)
playsound(loc, pick('sound/items/polaroid1.ogg', 'sound/items/polaroid2.ogg'), 75, 1, -3)
pictures_left--
desc = "A polaroid camera. It has [pictures_left] photos left."
user << "<span class='notice'>[pictures_left] photos left.</span>"
icon_state = icon_off
on = 0
spawn(64)
icon_state = icon_on
on = 1
+69
View File
@@ -0,0 +1,69 @@
/obj/item/weapon/stamp
name = "rubber stamp"
desc = "A rubber stamp for stamping important documents."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "stamp-qm"
item_state = "stamp"
flags = FPRINT | TABLEPASS
throwforce = 0
w_class = 1.0
throw_speed = 7
throw_range = 15
m_amt = 60
item_color = "cargo"
pressure_resistance = 2
attack_verb = list("stamped")
/obj/item/weapon/stamp/captain
name = "captain's rubber stamp"
icon_state = "stamp-cap"
item_color = "captain"
/obj/item/weapon/stamp/hop
name = "head of personnel's rubber stamp"
icon_state = "stamp-hop"
item_color = "hop"
/obj/item/weapon/stamp/hos
name = "head of security's rubber stamp"
icon_state = "stamp-hos"
item_color = "hosred"
/obj/item/weapon/stamp/ce
name = "chief engineer's rubber stamp"
icon_state = "stamp-ce"
item_color = "chief"
/obj/item/weapon/stamp/rd
name = "research director's rubber stamp"
icon_state = "stamp-rd"
item_color = "director"
/obj/item/weapon/stamp/cmo
name = "chief medical officer's rubber stamp"
icon_state = "stamp-cmo"
item_color = "cmo"
/obj/item/weapon/stamp/denied
name = "\improper DENIED rubber stamp"
icon_state = "stamp-deny"
item_color = "redcoat"
/obj/item/weapon/stamp/clown
name = "clown's rubber stamp"
icon_state = "stamp-clown"
item_color = "clown"
/obj/item/weapon/stamp/internalaffairs
name = "internal affairs rubber stamp"
icon_state = "stamp-intaff"
item_color = "intaff"
/obj/item/weapon/stamp/centcomm
name = "centcomm rubber stamp"
icon_state = "stamp-cent"
item_color = "centcomm"
/obj/item/weapon/stamp/attack_paw(mob/user as mob)
return attack_hand(user)