This commit is contained in:
Ghommie
2020-01-12 19:18:03 +01:00
1472 changed files with 218564 additions and 214937 deletions
+126 -126
View File
@@ -1,126 +1,126 @@
/obj/item/clipboard
name = "clipboard"
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "clipboard"
item_state = "clipboard"
throwforce = 0
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 7
var/obj/item/pen/haspen //The stored pen.
var/obj/item/paper/toppaper //The topmost piece of paper.
slot_flags = ITEM_SLOT_BELT
resistance_flags = FLAMMABLE
/obj/item/clipboard/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins putting [user.p_their()] head into the clip of \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return BRUTELOSS//the clipboard's clip is very strong. industrial duty. can kill a man easily.
/obj/item/clipboard/Initialize()
update_icon()
. = ..()
/obj/item/clipboard/Destroy()
QDEL_NULL(haspen)
QDEL_NULL(toppaper) //let movable/Destroy handle the rest
return ..()
/obj/item/clipboard/update_icon()
cut_overlays()
if(toppaper)
add_overlay(toppaper.icon_state)
copy_overlays(toppaper)
if(haspen)
add_overlay("clipboard_pen")
add_overlay("clipboard_over")
/obj/item/clipboard/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/paper))
if(!user.transferItemToLoc(W, src))
return
toppaper = W
to_chat(user, "<span class='notice'>You clip the paper onto \the [src].</span>")
update_icon()
else if(toppaper)
toppaper.attackby(user.get_active_held_item(), user)
update_icon()
/obj/item/clipboard/attack_self(mob/user)
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. You can't organise contents directly in byond, so this is what we're stuck with. -Pete
if(toppaper)
var/obj/item/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(P in src)
if(P == toppaper)
continue
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)];top=[REF(P)]'>Move to top</A> - <A href='?src=[REF(src)];read=[REF(P)]'>[P.name]</A><BR>"
user << browse(dat, "window=clipboard")
onclose(user, "clipboard")
add_fingerprint(usr)
/obj/item/clipboard/Topic(href, href_list)
..()
if(usr.stat || usr.restrained())
return
if(usr.contents.Find(src))
if(href_list["pen"])
if(haspen)
haspen.forceMove(usr.loc)
usr.put_in_hands(haspen)
haspen = null
if(href_list["addpen"])
if(!haspen)
var/obj/item/held = usr.get_active_held_item()
if(istype(held, /obj/item/pen))
var/obj/item/pen/W = held
if(!usr.transferItemToLoc(W, src))
return
haspen = W
to_chat(usr, "<span class='notice'>You slot [W] into [src].</span>")
if(href_list["write"])
var/obj/item/P = locate(href_list["write"])
if(istype(P) && P.loc == src)
if(usr.get_active_held_item())
P.attackby(usr.get_active_held_item(), usr)
if(href_list["remove"])
var/obj/item/P = locate(href_list["remove"])
if(istype(P) && P.loc == src)
P.forceMove(usr.loc)
usr.put_in_hands(P)
if(P == toppaper)
toppaper = null
var/obj/item/paper/newtop = locate(/obj/item/paper) in src
if(newtop && (newtop != P))
toppaper = newtop
else
toppaper = null
if(href_list["read"])
var/obj/item/paper/P = locate(href_list["read"])
if(istype(P) && P.loc == src)
usr.examinate(P)
if(href_list["top"])
var/obj/item/P = locate(href_list["top"])
if(istype(P) && P.loc == src)
toppaper = P
to_chat(usr, "<span class='notice'>You move [P.name] to the top.</span>")
//Update everything
attack_self(usr)
update_icon()
/obj/item/clipboard
name = "clipboard"
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "clipboard"
item_state = "clipboard"
throwforce = 0
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 7
var/obj/item/pen/haspen //The stored pen.
var/obj/item/paper/toppaper //The topmost piece of paper.
slot_flags = ITEM_SLOT_BELT
resistance_flags = FLAMMABLE
/obj/item/clipboard/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins putting [user.p_their()] head into the clip of \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return BRUTELOSS//the clipboard's clip is very strong. industrial duty. can kill a man easily.
/obj/item/clipboard/Initialize()
update_icon()
. = ..()
/obj/item/clipboard/Destroy()
QDEL_NULL(haspen)
QDEL_NULL(toppaper) //let movable/Destroy handle the rest
return ..()
/obj/item/clipboard/update_icon()
cut_overlays()
if(toppaper)
add_overlay(toppaper.icon_state)
copy_overlays(toppaper)
if(haspen)
add_overlay("clipboard_pen")
add_overlay("clipboard_over")
/obj/item/clipboard/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/paper))
if(!user.transferItemToLoc(W, src))
return
toppaper = W
to_chat(user, "<span class='notice'>You clip the paper onto \the [src].</span>")
update_icon()
else if(toppaper)
toppaper.attackby(user.get_active_held_item(), user)
update_icon()
/obj/item/clipboard/attack_self(mob/user)
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. You can't organise contents directly in byond, so this is what we're stuck with. -Pete
if(toppaper)
var/obj/item/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(P in src)
if(P == toppaper)
continue
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)];top=[REF(P)]'>Move to top</A> - <A href='?src=[REF(src)];read=[REF(P)]'>[P.name]</A><BR>"
user << browse(dat, "window=clipboard")
onclose(user, "clipboard")
add_fingerprint(usr)
/obj/item/clipboard/Topic(href, href_list)
..()
if(usr.stat || usr.restrained())
return
if(usr.contents.Find(src))
if(href_list["pen"])
if(haspen)
haspen.forceMove(usr.loc)
usr.put_in_hands(haspen)
haspen = null
if(href_list["addpen"])
if(!haspen)
var/obj/item/held = usr.get_active_held_item()
if(istype(held, /obj/item/pen))
var/obj/item/pen/W = held
if(!usr.transferItemToLoc(W, src))
return
haspen = W
to_chat(usr, "<span class='notice'>You slot [W] into [src].</span>")
if(href_list["write"])
var/obj/item/P = locate(href_list["write"])
if(istype(P) && P.loc == src)
if(usr.get_active_held_item())
P.attackby(usr.get_active_held_item(), usr)
if(href_list["remove"])
var/obj/item/P = locate(href_list["remove"])
if(istype(P) && P.loc == src)
P.forceMove(usr.loc)
usr.put_in_hands(P)
if(P == toppaper)
toppaper = null
var/obj/item/paper/newtop = locate(/obj/item/paper) in src
if(newtop && (newtop != P))
toppaper = newtop
else
toppaper = null
if(href_list["read"])
var/obj/item/paper/P = locate(href_list["read"])
if(istype(P) && P.loc == src)
usr.examinate(P)
if(href_list["top"])
var/obj/item/P = locate(href_list["top"])
if(istype(P) && P.loc == src)
toppaper = P
to_chat(usr, "<span class='notice'>You move [P.name] to the top.</span>")
//Update everything
attack_self(usr)
update_icon()
+225 -225
View File
@@ -1,225 +1,225 @@
/* Filing cabinets!
* Contains:
* Filing Cabinets
* Security Record Cabinets
* Medical Record Cabinets
* Employment Contract Cabinets
*/
/*
* Filing Cabinets
*/
/obj/structure/filingcabinet
name = "filing cabinet"
desc = "A large cabinet with drawers."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "filingcabinet"
density = TRUE
anchored = TRUE
/obj/structure/filingcabinet/chestdrawer
name = "chest drawer"
icon_state = "chestdrawer"
/obj/structure/filingcabinet/chestdrawer/wheeled
name = "rolling chest drawer"
desc = "A small cabinet with drawers. This one has wheels!"
anchored = FALSE
/obj/structure/filingcabinet/filingcabinet //not changing the path to avoid unnecessary map issues, but please don't name stuff like this in the future -Pete
icon_state = "tallcabinet"
/obj/structure/filingcabinet/Initialize(mapload)
. = ..()
if(mapload)
for(var/obj/item/I in loc)
if(istype(I, /obj/item/paper) || istype(I, /obj/item/folder) || istype(I, /obj/item/photo))
I.forceMove(src)
/obj/structure/filingcabinet/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
new /obj/item/stack/sheet/metal(loc, 2)
for(var/obj/item/I in src)
I.forceMove(loc)
qdel(src)
/obj/structure/filingcabinet/attackby(obj/item/P, mob/user, params)
if(istype(P, /obj/item/paper) || istype(P, /obj/item/folder) || istype(P, /obj/item/photo) || istype(P, /obj/item/documents))
if(!user.transferItemToLoc(P, src))
return
to_chat(user, "<span class='notice'>You put [P] in [src].</span>")
icon_state = "[initial(icon_state)]-open"
sleep(5)
icon_state = initial(icon_state)
updateUsrDialog()
else if(istype(P, /obj/item/wrench))
to_chat(user, "<span class='notice'>You begin to [anchored ? "unwrench" : "wrench"] [src].</span>")
if(P.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You successfully [anchored ? "unwrench" : "wrench"] [src].</span>")
anchored = !anchored
else if(user.a_intent != INTENT_HARM)
to_chat(user, "<span class='warning'>You can't put [P] in [src]!</span>")
else
return ..()
/obj/structure/filingcabinet/ui_interact(mob/user)
. = ..()
if(isobserver(user))
return
if(contents.len <= 0)
to_chat(user, "<span class='notice'>[src] is empty.</span>")
return
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")
/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.forceMove(loc)
if(prob(25))
step_rand(I)
to_chat(user, "<span class='notice'>You pull \a [I] out of [src] at random.</span>")
return
to_chat(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/obj/item/P = locate(href_list["retrieve"])//contents[retrieveindex]
if(istype(P) && P.loc == src && 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 GLOB.data_core.general)
var/datum/data/record/S = find_record("name", G.fields["name"], GLOB.data_core.security)
if(!S)
continue
var/obj/item/paper/P = new /obj/item/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 GLOB.data_core.general)
var/datum/data/record/M = find_record("name", G.fields["name"], GLOB.data_core.medical)
if(!M)
continue
var/obj/item/paper/P = new /obj/item/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["blood_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.
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/structure/filingcabinet/medical/attack_hand()
populate()
. = ..()
/obj/structure/filingcabinet/medical/attack_tk()
populate()
..()
/*
* Employment contract Cabinets
*/
GLOBAL_LIST_EMPTY(employmentCabinets)
/obj/structure/filingcabinet/employment
var/cooldown = 0
icon_state = "employmentcabinet"
var/virgin = 1
/obj/structure/filingcabinet/employment/Initialize()
. = ..()
GLOB.employmentCabinets += src
/obj/structure/filingcabinet/employment/Destroy()
GLOB.employmentCabinets -= src
return ..()
/obj/structure/filingcabinet/employment/proc/fillCurrent()
//This proc fills the cabinet with the current crew.
for(var/record in GLOB.data_core.locked)
var/datum/data/record/G = record
if(!G)
continue
var/datum/mind/M = G.fields["mindref"]
if(M && ishuman(M.current))
addFile(M.current)
/obj/structure/filingcabinet/employment/proc/addFile(mob/living/carbon/human/employee)
new /obj/item/paper/contract/employment(src, employee)
/obj/structure/filingcabinet/employment/interact(mob/user)
if(!cooldown)
if(virgin)
fillCurrent()
virgin = 0
cooldown = 1
sleep(100) // prevents the devil from just instantly emptying the cabinet, ensuring an easy win.
cooldown = 0
else
to_chat(user, "<span class='warning'>[src] is jammed, give it a few seconds.</span>")
..()
/* Filing cabinets!
* Contains:
* Filing Cabinets
* Security Record Cabinets
* Medical Record Cabinets
* Employment Contract Cabinets
*/
/*
* Filing Cabinets
*/
/obj/structure/filingcabinet
name = "filing cabinet"
desc = "A large cabinet with drawers."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "filingcabinet"
density = TRUE
anchored = TRUE
/obj/structure/filingcabinet/chestdrawer
name = "chest drawer"
icon_state = "chestdrawer"
/obj/structure/filingcabinet/chestdrawer/wheeled
name = "rolling chest drawer"
desc = "A small cabinet with drawers. This one has wheels!"
anchored = FALSE
/obj/structure/filingcabinet/filingcabinet //not changing the path to avoid unnecessary map issues, but please don't name stuff like this in the future -Pete
icon_state = "tallcabinet"
/obj/structure/filingcabinet/Initialize(mapload)
. = ..()
if(mapload)
for(var/obj/item/I in loc)
if(istype(I, /obj/item/paper) || istype(I, /obj/item/folder) || istype(I, /obj/item/photo))
I.forceMove(src)
/obj/structure/filingcabinet/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
new /obj/item/stack/sheet/metal(loc, 2)
for(var/obj/item/I in src)
I.forceMove(loc)
qdel(src)
/obj/structure/filingcabinet/attackby(obj/item/P, mob/user, params)
if(istype(P, /obj/item/paper) || istype(P, /obj/item/folder) || istype(P, /obj/item/photo) || istype(P, /obj/item/documents))
if(!user.transferItemToLoc(P, src))
return
to_chat(user, "<span class='notice'>You put [P] in [src].</span>")
icon_state = "[initial(icon_state)]-open"
sleep(5)
icon_state = initial(icon_state)
updateUsrDialog()
else if(istype(P, /obj/item/wrench))
to_chat(user, "<span class='notice'>You begin to [anchored ? "unwrench" : "wrench"] [src].</span>")
if(P.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You successfully [anchored ? "unwrench" : "wrench"] [src].</span>")
anchored = !anchored
else if(user.a_intent != INTENT_HARM)
to_chat(user, "<span class='warning'>You can't put [P] in [src]!</span>")
else
return ..()
/obj/structure/filingcabinet/ui_interact(mob/user)
. = ..()
if(isobserver(user))
return
if(contents.len <= 0)
to_chat(user, "<span class='notice'>[src] is empty.</span>")
return
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")
/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.forceMove(loc)
if(prob(25))
step_rand(I)
to_chat(user, "<span class='notice'>You pull \a [I] out of [src] at random.</span>")
return
to_chat(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/obj/item/P = locate(href_list["retrieve"])//contents[retrieveindex]
if(istype(P) && P.loc == src && 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 GLOB.data_core.general)
var/datum/data/record/S = find_record("name", G.fields["name"], GLOB.data_core.security)
if(!S)
continue
var/obj/item/paper/P = new /obj/item/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 GLOB.data_core.general)
var/datum/data/record/M = find_record("name", G.fields["name"], GLOB.data_core.medical)
if(!M)
continue
var/obj/item/paper/P = new /obj/item/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["blood_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.
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/structure/filingcabinet/medical/attack_hand()
populate()
. = ..()
/obj/structure/filingcabinet/medical/attack_tk()
populate()
..()
/*
* Employment contract Cabinets
*/
GLOBAL_LIST_EMPTY(employmentCabinets)
/obj/structure/filingcabinet/employment
var/cooldown = 0
icon_state = "employmentcabinet"
var/virgin = 1
/obj/structure/filingcabinet/employment/Initialize()
. = ..()
GLOB.employmentCabinets += src
/obj/structure/filingcabinet/employment/Destroy()
GLOB.employmentCabinets -= src
return ..()
/obj/structure/filingcabinet/employment/proc/fillCurrent()
//This proc fills the cabinet with the current crew.
for(var/record in GLOB.data_core.locked)
var/datum/data/record/G = record
if(!G)
continue
var/datum/mind/M = G.fields["mindref"]
if(M && ishuman(M.current))
addFile(M.current)
/obj/structure/filingcabinet/employment/proc/addFile(mob/living/carbon/human/employee)
new /obj/item/paper/contract/employment(src, employee)
/obj/structure/filingcabinet/employment/interact(mob/user)
if(!cooldown)
if(virgin)
fillCurrent()
virgin = 0
cooldown = 1
sleep(100) // prevents the devil from just instantly emptying the cabinet, ensuring an easy win.
cooldown = 0
else
to_chat(user, "<span class='warning'>[src] is jammed, give it a few seconds.</span>")
..()
+117 -117
View File
@@ -1,117 +1,117 @@
/obj/item/folder
name = "folder"
desc = "A folder."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "folder"
w_class = WEIGHT_CLASS_SMALL
pressure_resistance = 2
resistance_flags = FLAMMABLE
/obj/item/folder/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] begins filing an imaginary death warrant! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return OXYLOSS
/obj/item/folder/blue
desc = "A blue folder."
icon_state = "folder_blue"
/obj/item/folder/red
desc = "A red folder."
icon_state = "folder_red"
/obj/item/folder/yellow
desc = "A yellow folder."
icon_state = "folder_yellow"
/obj/item/folder/white
desc = "A white folder."
icon_state = "folder_white"
/obj/item/folder/update_icon()
cut_overlays()
if(contents.len)
add_overlay("folder_paper")
/obj/item/folder/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/paper) || istype(W, /obj/item/photo) || istype(W, /obj/item/documents))
if(!user.transferItemToLoc(W, src))
return
to_chat(user, "<span class='notice'>You put [W] into [src].</span>")
update_icon()
else if(istype(W, /obj/item/pen))
if(!user.is_literate())
to_chat(user, "<span class='notice'>You scribble illegibly on the cover of [src]!</span>")
return
var/n_name = copytext(sanitize(input(user, "What would you like to label the folder?", "Folder Labelling", null) as text), 1, MAX_NAME_LEN)
if(user.canUseTopic(src, BE_CLOSE))
name = "folder[(n_name ? " - '[n_name]'" : null)]"
/obj/item/folder/attack_self(mob/user)
var/dat = "<title>[name]</title>"
for(var/obj/item/I in src)
dat += "<A href='?src=[REF(src)];remove=[REF(I)]'>Remove</A> - <A href='?src=[REF(src)];read=[REF(I)]'>[I.name]</A><BR>"
user << browse(dat, "window=folder")
onclose(user, "folder")
add_fingerprint(usr)
/obj/item/folder/Topic(href, href_list)
..()
if(usr.stat || usr.restrained())
return
if(usr.contents.Find(src))
if(href_list["remove"])
var/obj/item/I = locate(href_list["remove"])
if(istype(I) && I.loc == src)
I.forceMove(usr.loc)
usr.put_in_hands(I)
if(href_list["read"])
var/obj/item/I = locate(href_list["read"])
if(istype(I) && I.loc == src)
usr.examinate(I)
//Update everything
attack_self(usr)
update_icon()
/obj/item/folder/documents
name = "folder- 'TOP SECRET'"
desc = "A folder stamped \"Top Secret - Property of Nanotrasen Corporation. Unauthorized distribution is punishable by death.\""
/obj/item/folder/documents/Initialize()
. = ..()
new /obj/item/documents/nanotrasen(src)
update_icon()
/obj/item/folder/syndicate
icon_state = "folder_syndie"
name = "folder- 'TOP SECRET'"
desc = "A folder stamped \"Top Secret - Property of The Syndicate.\""
/obj/item/folder/syndicate/red
icon_state = "folder_sred"
/obj/item/folder/syndicate/red/Initialize()
. = ..()
new /obj/item/documents/syndicate/red(src)
update_icon()
/obj/item/folder/syndicate/blue
icon_state = "folder_sblue"
/obj/item/folder/syndicate/blue/Initialize()
. = ..()
new /obj/item/documents/syndicate/blue(src)
update_icon()
/obj/item/folder/syndicate/mining/Initialize()
. = ..()
new /obj/item/documents/syndicate/mining(src)
update_icon()
/obj/item/folder
name = "folder"
desc = "A folder."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "folder"
w_class = WEIGHT_CLASS_SMALL
pressure_resistance = 2
resistance_flags = FLAMMABLE
/obj/item/folder/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] begins filing an imaginary death warrant! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return OXYLOSS
/obj/item/folder/blue
desc = "A blue folder."
icon_state = "folder_blue"
/obj/item/folder/red
desc = "A red folder."
icon_state = "folder_red"
/obj/item/folder/yellow
desc = "A yellow folder."
icon_state = "folder_yellow"
/obj/item/folder/white
desc = "A white folder."
icon_state = "folder_white"
/obj/item/folder/update_icon()
cut_overlays()
if(contents.len)
add_overlay("folder_paper")
/obj/item/folder/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/paper) || istype(W, /obj/item/photo) || istype(W, /obj/item/documents))
if(!user.transferItemToLoc(W, src))
return
to_chat(user, "<span class='notice'>You put [W] into [src].</span>")
update_icon()
else if(istype(W, /obj/item/pen))
if(!user.is_literate())
to_chat(user, "<span class='notice'>You scribble illegibly on the cover of [src]!</span>")
return
var/n_name = copytext(sanitize(input(user, "What would you like to label the folder?", "Folder Labelling", null) as text), 1, MAX_NAME_LEN)
if(user.canUseTopic(src, BE_CLOSE))
name = "folder[(n_name ? " - '[n_name]'" : null)]"
/obj/item/folder/attack_self(mob/user)
var/dat = "<title>[name]</title>"
for(var/obj/item/I in src)
dat += "<A href='?src=[REF(src)];remove=[REF(I)]'>Remove</A> - <A href='?src=[REF(src)];read=[REF(I)]'>[I.name]</A><BR>"
user << browse(dat, "window=folder")
onclose(user, "folder")
add_fingerprint(usr)
/obj/item/folder/Topic(href, href_list)
..()
if(usr.stat || usr.restrained())
return
if(usr.contents.Find(src))
if(href_list["remove"])
var/obj/item/I = locate(href_list["remove"])
if(istype(I) && I.loc == src)
I.forceMove(usr.loc)
usr.put_in_hands(I)
if(href_list["read"])
var/obj/item/I = locate(href_list["read"])
if(istype(I) && I.loc == src)
usr.examinate(I)
//Update everything
attack_self(usr)
update_icon()
/obj/item/folder/documents
name = "folder- 'TOP SECRET'"
desc = "A folder stamped \"Top Secret - Property of Nanotrasen Corporation. Unauthorized distribution is punishable by death.\""
/obj/item/folder/documents/Initialize()
. = ..()
new /obj/item/documents/nanotrasen(src)
update_icon()
/obj/item/folder/syndicate
icon_state = "folder_syndie"
name = "folder- 'TOP SECRET'"
desc = "A folder stamped \"Top Secret - Property of The Syndicate.\""
/obj/item/folder/syndicate/red
icon_state = "folder_sred"
/obj/item/folder/syndicate/red/Initialize()
. = ..()
new /obj/item/documents/syndicate/red(src)
update_icon()
/obj/item/folder/syndicate/blue
icon_state = "folder_sblue"
/obj/item/folder/syndicate/blue/Initialize()
. = ..()
new /obj/item/documents/syndicate/blue(src)
update_icon()
/obj/item/folder/syndicate/mining/Initialize()
. = ..()
new /obj/item/documents/syndicate/mining(src)
update_icon()
+174 -174
View File
@@ -1,174 +1,174 @@
/obj/item/paper_bin
name = "paper bin"
desc = "Contains all the paper you'll never need."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "paper_bin1"
item_state = "sheet-metal"
lefthand_file = 'icons/mob/inhands/misc/sheets_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/sheets_righthand.dmi'
throwforce = 0
w_class = WEIGHT_CLASS_NORMAL
throw_speed = 3
throw_range = 7
pressure_resistance = 8
var/papertype = /obj/item/paper
var/total_paper = 30
var/list/papers = list()
var/obj/item/pen/bin_pen
/obj/item/paper_bin/Initialize(mapload)
. = ..()
interaction_flags_item &= ~INTERACT_ITEM_ATTACK_HAND_PICKUP
if(!mapload)
return
var/obj/item/pen/P = locate(/obj/item/pen) in src.loc
if(P && !bin_pen)
P.forceMove(src)
bin_pen = P
update_icon()
/obj/item/paper_bin/Destroy()
if(papers)
for(var/i in papers)
qdel(i)
papers = null
. = ..()
/obj/item/paper_bin/fire_act(exposed_temperature, exposed_volume)
if(total_paper)
total_paper = 0
update_icon()
..()
/obj/item/paper_bin/MouseDrop(atom/over_object)
var/mob/living/M = usr
if(!istype(M) || M.incapacitated() || !Adjacent(M))
return
if(over_object == M)
M.put_in_hands(src)
else if(istype(over_object, /obj/screen/inventory/hand))
var/obj/screen/inventory/hand/H = over_object
M.putItemFromInventoryInHandIfPossible(src, H.held_index)
else
. = ..()
add_fingerprint(M)
/obj/item/paper_bin/attack_paw(mob/user)
return attack_hand(user)
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/paper_bin/attack_hand(mob/user)
if(user.lying)
return
user.changeNext_move(CLICK_CD_MELEE)
if(bin_pen)
var/obj/item/pen/P = bin_pen
P.add_fingerprint(user)
P.forceMove(user.loc)
user.put_in_hands(P)
to_chat(user, "<span class='notice'>You take [P] out of \the [src].</span>")
bin_pen = null
update_icon()
else if(total_paper >= 1)
total_paper--
update_icon()
// If there's any custom paper on the stack, use that instead of creating a new paper.
var/obj/item/paper/P
if(papers.len > 0)
P = papers[papers.len]
papers.Remove(P)
else
P = new papertype(src)
if(SSevents.holidays && SSevents.holidays[APRIL_FOOLS])
if(prob(30))
P.info = "<font face=\"[CRAYON_FONT]\" color=\"red\"><b>HONK HONK HONK HONK HONK HONK HONK<br>HOOOOOOOOOOOOOOOOOOOOOONK<br>APRIL FOOLS</b></font>"
P.rigged = 1
P.updateinfolinks()
P.add_fingerprint(user)
P.forceMove(user.loc)
user.put_in_hands(P)
to_chat(user, "<span class='notice'>You take [P] out of \the [src].</span>")
else
to_chat(user, "<span class='warning'>[src] is empty!</span>")
add_fingerprint(user)
return ..()
/obj/item/paper_bin/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/paper))
var/obj/item/paper/P = I
if(!user.transferItemToLoc(P, src))
return
to_chat(user, "<span class='notice'>You put [P] in [src].</span>")
papers.Add(P)
total_paper++
update_icon()
else if(istype(I, /obj/item/pen) && !bin_pen)
var/obj/item/pen/P = I
if(!user.transferItemToLoc(P, src))
return
to_chat(user, "<span class='notice'>You put [P] in [src].</span>")
bin_pen = P
update_icon()
else
return ..()
/obj/item/paper_bin/examine(mob/user)
. = ..()
if(total_paper)
. += "It contains [total_paper > 1 ? "[total_paper] papers" : " one paper"]."
else
. += "It doesn't contain anything."
/obj/item/paper_bin/update_icon()
if(total_paper < 1)
icon_state = "paper_bin0"
else
icon_state = "[initial(icon_state)]"
cut_overlays()
if(bin_pen)
add_overlay(mutable_appearance(bin_pen.icon, bin_pen.icon_state))
/obj/item/paper_bin/construction
name = "construction paper bin"
desc = "Contains all the paper you'll never need, IN COLOR!"
icon_state = "paper_binc"
papertype = /obj/item/paper/construction
/obj/item/paper_bin/bundlenatural
name = "natural paper bundle"
desc = "A bundle of paper created using traditional methods."
icon_state = "paper_bundle"
papertype = /obj/item/paper/natural
resistance_flags = FLAMMABLE
/obj/item/paper_bin/bundlenatural/attack_hand(mob/user)
..()
if(total_paper < 1)
qdel(src)
/obj/item/paper_bin/bundlenatural/fire_act(exposed_temperature, exposed_volume)
qdel(src)
/obj/item/paper_bin/bundlenatural/attackby(obj/item/W, mob/user)
if(W.get_sharpness())
to_chat(user, "<span class='notice'>You snip \the [src], spilling paper everywhere.</span>")
var/turf/T = get_turf(src.loc)
while(total_paper > 0)
total_paper--
var/obj/item/paper/P
if(papers.len > 0)
P = papers[papers.len]
papers -= P
else
P = new papertype()
P.forceMove(T)
CHECK_TICK
qdel(src)
else
..()
/obj/item/paper_bin
name = "paper bin"
desc = "Contains all the paper you'll never need."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "paper_bin1"
item_state = "sheet-metal"
lefthand_file = 'icons/mob/inhands/misc/sheets_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/sheets_righthand.dmi'
throwforce = 0
w_class = WEIGHT_CLASS_NORMAL
throw_speed = 3
throw_range = 7
pressure_resistance = 8
var/papertype = /obj/item/paper
var/total_paper = 30
var/list/papers = list()
var/obj/item/pen/bin_pen
/obj/item/paper_bin/Initialize(mapload)
. = ..()
interaction_flags_item &= ~INTERACT_ITEM_ATTACK_HAND_PICKUP
if(!mapload)
return
var/obj/item/pen/P = locate(/obj/item/pen) in src.loc
if(P && !bin_pen)
P.forceMove(src)
bin_pen = P
update_icon()
/obj/item/paper_bin/Destroy()
if(papers)
for(var/i in papers)
qdel(i)
papers = null
. = ..()
/obj/item/paper_bin/fire_act(exposed_temperature, exposed_volume)
if(total_paper)
total_paper = 0
update_icon()
..()
/obj/item/paper_bin/MouseDrop(atom/over_object)
var/mob/living/M = usr
if(!istype(M) || M.incapacitated() || !Adjacent(M))
return
if(over_object == M)
M.put_in_hands(src)
else if(istype(over_object, /obj/screen/inventory/hand))
var/obj/screen/inventory/hand/H = over_object
M.putItemFromInventoryInHandIfPossible(src, H.held_index)
else
. = ..()
add_fingerprint(M)
/obj/item/paper_bin/attack_paw(mob/user)
return attack_hand(user)
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/paper_bin/attack_hand(mob/user)
if(user.lying)
return
user.changeNext_move(CLICK_CD_MELEE)
if(bin_pen)
var/obj/item/pen/P = bin_pen
P.add_fingerprint(user)
P.forceMove(user.loc)
user.put_in_hands(P)
to_chat(user, "<span class='notice'>You take [P] out of \the [src].</span>")
bin_pen = null
update_icon()
else if(total_paper >= 1)
total_paper--
update_icon()
// If there's any custom paper on the stack, use that instead of creating a new paper.
var/obj/item/paper/P
if(papers.len > 0)
P = papers[papers.len]
papers.Remove(P)
else
P = new papertype(src)
if(SSevents.holidays && SSevents.holidays[APRIL_FOOLS])
if(prob(30))
P.info = "<font face=\"[CRAYON_FONT]\" color=\"red\"><b>HONK HONK HONK HONK HONK HONK HONK<br>HOOOOOOOOOOOOOOOOOOOOOONK<br>APRIL FOOLS</b></font>"
P.rigged = 1
P.updateinfolinks()
P.add_fingerprint(user)
P.forceMove(user.loc)
user.put_in_hands(P)
to_chat(user, "<span class='notice'>You take [P] out of \the [src].</span>")
else
to_chat(user, "<span class='warning'>[src] is empty!</span>")
add_fingerprint(user)
return ..()
/obj/item/paper_bin/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/paper))
var/obj/item/paper/P = I
if(!user.transferItemToLoc(P, src))
return
to_chat(user, "<span class='notice'>You put [P] in [src].</span>")
papers.Add(P)
total_paper++
update_icon()
else if(istype(I, /obj/item/pen) && !bin_pen)
var/obj/item/pen/P = I
if(!user.transferItemToLoc(P, src))
return
to_chat(user, "<span class='notice'>You put [P] in [src].</span>")
bin_pen = P
update_icon()
else
return ..()
/obj/item/paper_bin/examine(mob/user)
. = ..()
if(total_paper)
. += "It contains [total_paper > 1 ? "[total_paper] papers" : " one paper"]."
else
. += "It doesn't contain anything."
/obj/item/paper_bin/update_icon()
if(total_paper < 1)
icon_state = "paper_bin0"
else
icon_state = "[initial(icon_state)]"
cut_overlays()
if(bin_pen)
add_overlay(mutable_appearance(bin_pen.icon, bin_pen.icon_state))
/obj/item/paper_bin/construction
name = "construction paper bin"
desc = "Contains all the paper you'll never need, IN COLOR!"
icon_state = "paper_binc"
papertype = /obj/item/paper/construction
/obj/item/paper_bin/bundlenatural
name = "natural paper bundle"
desc = "A bundle of paper created using traditional methods."
icon_state = "paper_bundle"
papertype = /obj/item/paper/natural
resistance_flags = FLAMMABLE
/obj/item/paper_bin/bundlenatural/attack_hand(mob/user)
..()
if(total_paper < 1)
qdel(src)
/obj/item/paper_bin/bundlenatural/fire_act(exposed_temperature, exposed_volume)
qdel(src)
/obj/item/paper_bin/bundlenatural/attackby(obj/item/W, mob/user)
if(W.get_sharpness())
to_chat(user, "<span class='notice'>You snip \the [src], spilling paper everywhere.</span>")
var/turf/T = get_turf(src.loc)
while(total_paper > 0)
total_paper--
var/obj/item/paper/P
if(papers.len > 0)
P = papers[papers.len]
papers -= P
else
P = new papertype()
P.forceMove(T)
CHECK_TICK
qdel(src)
else
..()
+220 -220
View File
@@ -1,220 +1,220 @@
/* Pens!
* Contains:
* Pens
* Sleepy Pens
* Parapens
* Edaggers
*/
/*
* Pens
*/
/obj/item/pen
desc = "It's a normal black ink pen."
name = "pen"
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "pen"
item_state = "pen"
slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_EARS
throwforce = 0
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL=10)
pressure_resistance = 2
grind_results = list("iron" = 2, "iodine" = 1)
var/colour = "black" //what colour the ink is!
var/degrees = 0
var/font = PEN_FONT
/obj/item/pen/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is scribbling numbers all over [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit sudoku...</span>")
return(BRUTELOSS)
/obj/item/pen/blue
desc = "It's a normal blue ink pen."
icon_state = "pen_blue"
colour = "blue"
/obj/item/pen/red
desc = "It's a normal red ink pen."
icon_state = "pen_red"
colour = "red"
/obj/item/pen/invisible
desc = "It's an invisible pen marker."
icon_state = "pen"
colour = "white"
/obj/item/pen/fourcolor
desc = "It's a fancy four-color ink pen, set to black."
name = "four-color pen"
colour = "black"
/obj/item/pen/fourcolor/attack_self(mob/living/carbon/user)
switch(colour)
if("black")
colour = "red"
if("red")
colour = "green"
if("green")
colour = "blue"
else
colour = "black"
to_chat(user, "<span class='notice'>\The [src] will now write in [colour].</span>")
desc = "It's a fancy four-color ink pen, set to [colour]."
/obj/item/pen/fountain
name = "fountain pen"
desc = "It's a common fountain pen, with a faux wood body."
icon_state = "pen-fountain"
font = FOUNTAIN_PEN_FONT
/obj/item/pen/fountain/captain
name = "captain's fountain pen"
desc = "It's an expensive Oak fountain pen. The nib is quite sharp."
icon_state = "pen-fountain-o"
force = 5
throwforce = 5
throw_speed = 4
colour = "crimson"
materials = list(MAT_GOLD = 750)
sharpness = IS_SHARP
resistance_flags = FIRE_PROOF
unique_reskin = list("Oak" = "pen-fountain-o",
"Gold" = "pen-fountain-g",
"Rosewood" = "pen-fountain-r",
"Black and Silver" = "pen-fountain-b",
"Command Blue" = "pen-fountain-cb"
)
/obj/item/pen/fountain/captain/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 200, 115) //the pen is mightier than the sword
/obj/item/pen/fountain/captain/reskin_obj(mob/M)
..()
if(current_skin)
desc = "It's an expensive [current_skin] fountain pen. The nib is quite sharp."
/obj/item/pen/attack_self(mob/living/carbon/user)
var/deg = input(user, "What angle would you like to rotate the pen head to? (1-360)", "Rotate Pen Head") as null|num
if(deg && (deg > 0 && deg <= 360))
degrees = deg
to_chat(user, "<span class='notice'>You rotate the top of the pen to [degrees] degrees.</span>")
SEND_SIGNAL(src, COMSIG_PEN_ROTATED, deg, user)
/obj/item/pen/attack(mob/living/M, mob/user,stealth)
if(!istype(M))
return
if(!force)
if(M.can_inject(user, 1))
to_chat(user, "<span class='warning'>You stab [M] with the pen.</span>")
if(!stealth)
to_chat(M, "<span class='danger'>You feel a tiny prick!</span>")
. = 1
log_combat(user, M, "stabbed", src)
else
. = ..()
/obj/item/pen/afterattack(obj/O, mob/living/user, proximity)
. = ..()
//Changing Name/Description of items. Only works if they have the 'unique_rename' flag set
if(isobj(O) && proximity && (O.obj_flags & UNIQUE_RENAME))
var/penchoice = input(user, "What would you like to edit?", "Rename or change description?") as null|anything in list("Rename","Change description")
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
return
if(penchoice == "Rename")
var/input = stripped_input(user,"What do you want to name \the [O.name]?", ,"", MAX_NAME_LEN)
var/oldname = O.name
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
return
if(oldname == input)
to_chat(user, "You changed \the [O.name] to... well... \the [O.name].")
else
O.name = input
to_chat(user, "\The [oldname] has been successfully been renamed to \the [input].")
O.renamedByPlayer = TRUE
if(penchoice == "Change description")
var/input = stripped_input(user,"Describe \the [O.name] here", ,"", 100)
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
return
O.desc = input
to_chat(user, "You have successfully changed \the [O.name]'s description.")
/*
* Sleepypens
*/
/obj/item/pen/sleepy/attack(mob/living/M, mob/user)
if(!istype(M))
return
if(..())
if(reagents.total_volume)
if(M.reagents)
reagents.reaction(M, INJECT)
reagents.trans_to(M, reagents.total_volume)
/obj/item/pen/sleepy/Initialize()
. = ..()
create_reagents(45, OPENCONTAINER)
reagents.add_reagent("chloralhydrate", 20)
reagents.add_reagent("mutetoxin", 15)
reagents.add_reagent("tirizene", 10)
/*
* (Alan) Edaggers
*/
/obj/item/pen/edagger
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") //these wont show up if the pen is off
sharpness = IS_SHARP
var/on = FALSE
/obj/item/pen/edagger/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 60, 100, 0, 'sound/weapons/blade1.ogg')
/obj/item/pen/edagger/get_sharpness()
return on * sharpness
/obj/item/pen/edagger/attack_self(mob/living/user)
if(on)
on = FALSE
force = initial(force)
w_class = initial(w_class)
name = initial(name)
hitsound = initial(hitsound)
embedding = embedding.setRating(embed_chance = EMBED_CHANCE)
throwforce = initial(throwforce)
playsound(user, 'sound/weapons/saberoff.ogg', 5, 1)
to_chat(user, "<span class='warning'>[src] can now be concealed.</span>")
else
on = TRUE
force = 18
w_class = WEIGHT_CLASS_NORMAL
name = "energy dagger"
hitsound = 'sound/weapons/blade1.ogg'
embedding = embedding.setRating(embed_chance = 100) //rule of cool
throwforce = 35
playsound(user, 'sound/weapons/saberon.ogg', 5, 1)
to_chat(user, "<span class='warning'>[src] is now active.</span>")
update_icon()
/obj/item/pen/edagger/update_icon()
if(on)
icon_state = "edagger"
item_state = "edagger"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
else
icon_state = initial(icon_state) //looks like a normal pen when off.
item_state = initial(item_state)
lefthand_file = initial(lefthand_file)
righthand_file = initial(righthand_file)
/* Pens!
* Contains:
* Pens
* Sleepy Pens
* Parapens
* Edaggers
*/
/*
* Pens
*/
/obj/item/pen
desc = "It's a normal black ink pen."
name = "pen"
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "pen"
item_state = "pen"
slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_EARS
throwforce = 0
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL=10)
pressure_resistance = 2
grind_results = list(/datum/reagent/iron = 2, /datum/reagent/iodine = 1)
var/colour = "black" //what colour the ink is!
var/degrees = 0
var/font = PEN_FONT
/obj/item/pen/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is scribbling numbers all over [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit sudoku...</span>")
return(BRUTELOSS)
/obj/item/pen/blue
desc = "It's a normal blue ink pen."
icon_state = "pen_blue"
colour = "blue"
/obj/item/pen/red
desc = "It's a normal red ink pen."
icon_state = "pen_red"
colour = "red"
/obj/item/pen/invisible
desc = "It's an invisible pen marker."
icon_state = "pen"
colour = "white"
/obj/item/pen/fourcolor
desc = "It's a fancy four-color ink pen, set to black."
name = "four-color pen"
colour = "black"
/obj/item/pen/fourcolor/attack_self(mob/living/carbon/user)
switch(colour)
if("black")
colour = "red"
if("red")
colour = "green"
if("green")
colour = "blue"
else
colour = "black"
to_chat(user, "<span class='notice'>\The [src] will now write in [colour].</span>")
desc = "It's a fancy four-color ink pen, set to [colour]."
/obj/item/pen/fountain
name = "fountain pen"
desc = "It's a common fountain pen, with a faux wood body."
icon_state = "pen-fountain"
font = FOUNTAIN_PEN_FONT
/obj/item/pen/fountain/captain
name = "captain's fountain pen"
desc = "It's an expensive Oak fountain pen. The nib is quite sharp."
icon_state = "pen-fountain-o"
force = 5
throwforce = 5
throw_speed = 4
colour = "crimson"
materials = list(MAT_GOLD = 750)
sharpness = IS_SHARP
resistance_flags = FIRE_PROOF
unique_reskin = list("Oak" = "pen-fountain-o",
"Gold" = "pen-fountain-g",
"Rosewood" = "pen-fountain-r",
"Black and Silver" = "pen-fountain-b",
"Command Blue" = "pen-fountain-cb"
)
/obj/item/pen/fountain/captain/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 200, 115) //the pen is mightier than the sword
/obj/item/pen/fountain/captain/reskin_obj(mob/M)
..()
if(current_skin)
desc = "It's an expensive [current_skin] fountain pen. The nib is quite sharp."
/obj/item/pen/attack_self(mob/living/carbon/user)
var/deg = input(user, "What angle would you like to rotate the pen head to? (1-360)", "Rotate Pen Head") as null|num
if(deg && (deg > 0 && deg <= 360))
degrees = deg
to_chat(user, "<span class='notice'>You rotate the top of the pen to [degrees] degrees.</span>")
SEND_SIGNAL(src, COMSIG_PEN_ROTATED, deg, user)
/obj/item/pen/attack(mob/living/M, mob/user,stealth)
if(!istype(M))
return
if(!force)
if(M.can_inject(user, 1))
to_chat(user, "<span class='warning'>You stab [M] with the pen.</span>")
if(!stealth)
to_chat(M, "<span class='danger'>You feel a tiny prick!</span>")
. = 1
log_combat(user, M, "stabbed", src)
else
. = ..()
/obj/item/pen/afterattack(obj/O, mob/living/user, proximity)
. = ..()
//Changing Name/Description of items. Only works if they have the 'unique_rename' flag set
if(isobj(O) && proximity && (O.obj_flags & UNIQUE_RENAME))
var/penchoice = input(user, "What would you like to edit?", "Rename or change description?") as null|anything in list("Rename","Change description")
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
return
if(penchoice == "Rename")
var/input = stripped_input(user,"What do you want to name \the [O.name]?", ,"", MAX_NAME_LEN)
var/oldname = O.name
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
return
if(oldname == input)
to_chat(user, "You changed \the [O.name] to... well... \the [O.name].")
else
O.name = input
to_chat(user, "\The [oldname] has been successfully been renamed to \the [input].")
O.renamedByPlayer = TRUE
if(penchoice == "Change description")
var/input = stripped_input(user,"Describe \the [O.name] here", ,"", 100)
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
return
O.desc = input
to_chat(user, "You have successfully changed \the [O.name]'s description.")
/*
* Sleepypens
*/
/obj/item/pen/sleepy/attack(mob/living/M, mob/user)
if(!istype(M))
return
if(..())
if(reagents.total_volume)
if(M.reagents)
reagents.reaction(M, INJECT)
reagents.trans_to(M, reagents.total_volume)
/obj/item/pen/sleepy/Initialize()
. = ..()
create_reagents(45, OPENCONTAINER)
reagents.add_reagent(/datum/reagent/toxin/chloralhydrate, 20)
reagents.add_reagent(/datum/reagent/toxin/mutetoxin, 15)
reagents.add_reagent(/datum/reagent/toxin/staminatoxin, 10)
/*
* (Alan) Edaggers
*/
/obj/item/pen/edagger
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") //these wont show up if the pen is off
sharpness = IS_SHARP
var/on = FALSE
/obj/item/pen/edagger/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 60, 100, 0, 'sound/weapons/blade1.ogg')
/obj/item/pen/edagger/get_sharpness()
return on * sharpness
/obj/item/pen/edagger/attack_self(mob/living/user)
if(on)
on = FALSE
force = initial(force)
w_class = initial(w_class)
name = initial(name)
hitsound = initial(hitsound)
embedding = embedding.setRating(embed_chance = EMBED_CHANCE)
throwforce = initial(throwforce)
playsound(user, 'sound/weapons/saberoff.ogg', 5, 1)
to_chat(user, "<span class='warning'>[src] can now be concealed.</span>")
else
on = TRUE
force = 18
w_class = WEIGHT_CLASS_NORMAL
name = "energy dagger"
hitsound = 'sound/weapons/blade1.ogg'
embedding = embedding.setRating(embed_chance = 100) //rule of cool
throwforce = 35
playsound(user, 'sound/weapons/saberon.ogg', 5, 1)
to_chat(user, "<span class='warning'>[src] is now active.</span>")
update_icon()
/obj/item/pen/edagger/update_icon()
if(on)
icon_state = "edagger"
item_state = "edagger"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
else
icon_state = initial(icon_state) //looks like a normal pen when off.
item_state = initial(item_state)
lefthand_file = initial(lefthand_file)
righthand_file = initial(righthand_file)
+340 -340
View File
@@ -1,340 +1,340 @@
/* Photocopiers!
* Contains:
* Photocopier
* Toner Cartridge
*/
/*
* Photocopier
*/
/obj/machinery/photocopier
name = "photocopier"
desc = "Used to copy important documents and anatomy studies."
icon = 'icons/obj/library.dmi'
icon_state = "photocopier"
density = TRUE
use_power = IDLE_POWER_USE
idle_power_usage = 30
active_power_usage = 200
power_channel = EQUIP
max_integrity = 300
integrity_failure = 100
var/obj/item/paper/copy = null //what's in the copier!
var/obj/item/photo/photocopy = null
var/obj/item/documents/doccopy = null
var/copies = 1 //how many copies to print!
var/toner = 40 //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/greytoggle = "Greyscale"
var/mob/living/ass //i can't believe i didn't write a stupid-ass comment about this var when i first coded asscopy.
var/busy = FALSE
/obj/machinery/photocopier/ui_interact(mob/user)
. = ..()
var/dat = "Photocopier<BR><BR>"
if(copy || photocopy || doccopy || (ass && (ass.loc == src.loc)))
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>"
if(photocopy)
dat += "Printing in <a href='byond://?src=[REF(src)];colortoggle=1'>[greytoggle]</a><BR><BR>"
else if(toner)
dat += "Please insert paper to copy.<BR><BR>"
if(isAI(user))
dat += "<a href='byond://?src=[REF(src)];aipic=1'>Print photo from database</a><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")
/obj/machinery/photocopier/Topic(href, href_list)
if(..())
return
if(href_list["copy"])
if(copy)
for(var/i = 0, i < copies, i++)
if(toner > 0 && !busy && copy)
var/copy_as_paper = 1
if(istype(copy, /obj/item/paper/contract/employment))
var/obj/item/paper/contract/employment/E = copy
var/obj/item/paper/contract/employment/C = new /obj/item/paper/contract/employment (loc, E.target.current)
if(C)
copy_as_paper = 0
if(copy_as_paper)
var/obj/item/paper/c = new /obj/item/paper (loc)
if(length(copy.info) > 0) //Only print and add content if the copied doc has words on it
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 = copy.info
copied = replacetext(copied, "<font face=\"[PEN_FONT]\" color=", "<font face=\"[PEN_FONT]\" nocolor=") //state of the art techniques in action
copied = replacetext(copied, "<font face=\"[CRAYON_FONT]\" color=", "<font face=\"[CRAYON_FONT]\" 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
c.fields = copy.fields
c.update_icon()
c.updateinfolinks()
c.stamps = copy.stamps
if(copy.stamped)
c.stamped = copy.stamped.Copy()
c.copy_overlays(copy, TRUE)
toner--
busy = TRUE
sleep(15)
busy = FALSE
else
break
updateUsrDialog()
else if(photocopy)
for(var/i = 0, i < copies, i++)
if(toner >= 5 && !busy && photocopy) //Was set to = 0, but if there was say 3 toner left and this ran, you would get -2 which would be weird for ink
new /obj/item/photo (loc, photocopy.picture.Copy(greytoggle == "Greyscale"? TRUE : FALSE))
busy = TRUE
sleep(15)
busy = FALSE
else
break
else if(doccopy)
for(var/i = 0, i < copies, i++)
if(toner > 5 && !busy && doccopy)
new /obj/item/documents/photocopy(loc, doccopy)
toner-= 6 // the sprite shows 6 papers, yes I checked
busy = TRUE
sleep(15)
busy = FALSE
else
break
updateUsrDialog()
else if(ass) //ASS COPY. By Miauw
for(var/i = 0, i < copies, i++)
var/icon/temp_img
if(ishuman(ass) && (ass.get_item_by_slot(SLOT_W_UNIFORM) || ass.get_item_by_slot(SLOT_WEAR_SUIT)))
to_chat(usr, "<span class='notice'>You feel kind of silly, copying [ass == usr ? "your" : ass][ass == usr ? "" : "\'s"] ass with [ass == usr ? "your" : "[ass.p_their()]"] clothes on.</span>" )
break
else if(toner >= 5 && !busy && check_ass()) //You have to be sitting on the copier and either be a xeno or a human without clothes on.
if(isalienadult(ass) || istype(ass, /mob/living/simple_animal/hostile/alien)) //Xenos have their own asses, thanks to Pybro.
temp_img = icon('icons/ass/assalien.png')
else if(ishuman(ass)) //Suit checks are in check_ass
if(ass.gender == MALE)
temp_img = icon('icons/ass/assmale.png')
else if(ass.gender == FEMALE)
temp_img = icon('icons/ass/assfemale.png')
else //In case anyone ever makes the generic ass. For now I'll be using male asses.
temp_img = icon('icons/ass/assmale.png')
else if(isdrone(ass)) //Drones are hot
temp_img = icon('icons/ass/assdrone.png')
else
break
var/obj/item/photo/p = new /obj/item/photo (loc)
p.pixel_x = rand(-10, 10)
p.pixel_y = rand(-10, 10)
p.picture = new(null, "You see [ass]'s ass on the photo.", temp_img)
p.picture.psize_x = 128
p.picture.psize_y = 128
p.update_icon()
toner -= 5
busy = TRUE
sleep(15)
busy = FALSE
else
break
updateUsrDialog()
else if(href_list["remove"])
if(copy)
remove_photocopy(copy, usr)
copy = null
else if(photocopy)
remove_photocopy(photocopy, usr)
photocopy = null
else if(doccopy)
remove_photocopy(doccopy, usr)
doccopy = null
else if(check_ass())
to_chat(ass, "<span class='notice'>You feel a slight pressure on your ass.</span>")
updateUsrDialog()
else if(href_list["min"])
if(copies > 1)
copies--
updateUsrDialog()
else if(href_list["add"])
if(copies < maxcopies)
copies++
updateUsrDialog()
else if(href_list["aipic"])
if(!isAI(usr))
return
if(toner >= 5 && !busy)
var/mob/living/silicon/ai/tempAI = usr
if(tempAI.aicamera.stored.len == 0)
to_chat(usr, "<span class='boldannounce'>No images saved</span>")
return
var/datum/picture/selection = tempAI.aicamera.selectpicture(usr)
var/obj/item/photo/photo = new(loc, selection)
photo.pixel_x = rand(-10, 10)
photo.pixel_y = rand(-10, 10)
toner -= 5 //AI prints color pictures only, thus they can do it more efficiently
busy = TRUE
sleep(15)
busy = FALSE
updateUsrDialog()
else if(href_list["colortoggle"])
if(greytoggle == "Greyscale")
greytoggle = "Color"
else
greytoggle = "Greyscale"
updateUsrDialog()
/obj/machinery/photocopier/proc/do_insertion(obj/item/O, mob/user)
O.forceMove(src)
to_chat(user, "<span class ='notice'>You insert [O] into [src].</span>")
flick("photocopier1", src)
updateUsrDialog()
/obj/machinery/photocopier/proc/remove_photocopy(obj/item/O, mob/user)
if(!issilicon(user)) //surprised this check didn't exist before, putting stuff in AI's hand is bad
O.forceMove(user.loc)
user.put_in_hands(O)
else
O.forceMove(drop_location())
to_chat(user, "<span class='notice'>You take [O] out of [src].</span>")
/obj/machinery/photocopier/attackby(obj/item/O, mob/user, params)
if(default_unfasten_wrench(user, O))
return
else if(istype(O, /obj/item/paper))
if(copier_empty())
if(istype(O, /obj/item/paper/contract/infernal))
to_chat(user, "<span class='warning'>[src] smokes, smelling of brimstone!</span>")
resistance_flags |= FLAMMABLE
fire_act()
else
if(!user.temporarilyRemoveItemFromInventory(O))
return
copy = O
do_insertion(O, user)
else
to_chat(user, "<span class='warning'>There is already something in [src]!</span>")
else if(istype(O, /obj/item/photo))
if(copier_empty())
if(!user.temporarilyRemoveItemFromInventory(O))
return
photocopy = O
do_insertion(O, user)
else
to_chat(user, "<span class='warning'>There is already something in [src]!</span>")
else if(istype(O, /obj/item/documents))
if(copier_empty())
if(!user.temporarilyRemoveItemFromInventory(O))
return
doccopy = O
do_insertion(O, user)
else
to_chat(user, "<span class='warning'>There is already something in [src]!</span>")
else if(istype(O, /obj/item/toner))
if(toner <= 0)
if(!user.temporarilyRemoveItemFromInventory(O))
return
qdel(O)
toner = 40
to_chat(user, "<span class='notice'>You insert [O] into [src].</span>")
updateUsrDialog()
else
to_chat(user, "<span class='warning'>This cartridge is not yet ready for replacement! Use up the rest of the toner.</span>")
else if(istype(O, /obj/item/areaeditor/blueprints))
to_chat(user, "<span class='warning'>The Blueprint is too large to put into the copier. You need to find something else to record the document</span>")
else
return ..()
/obj/machinery/photocopier/obj_break(damage_flag)
if(!(flags_1 & NODECONSTRUCT_1))
if(toner > 0)
new /obj/effect/decal/cleanable/oil(get_turf(src))
toner = 0
/obj/machinery/photocopier/MouseDrop_T(mob/target, mob/user)
check_ass() //Just to make sure that you can re-drag somebody onto it after they moved off.
if (!istype(target) || target.anchored || target.buckled || !Adjacent(target) || !user.canUseTopic(src, BE_CLOSE) || target == ass || copier_blocked())
return
src.add_fingerprint(user)
if(target == user)
user.visible_message("[user] starts climbing onto the photocopier!", "<span class='notice'>You start climbing onto the photocopier...</span>")
else
user.visible_message("<span class='warning'>[user] starts putting [target] onto the photocopier!</span>", "<span class='notice'>You start putting [target] onto the photocopier...</span>")
if(do_after(user, 20, target = src))
if(!target || QDELETED(target) || QDELETED(src) || !Adjacent(target)) //check if the photocopier/target still exists.
return
if(target == user)
user.visible_message("[user] climbs onto the photocopier!", "<span class='notice'>You climb onto the photocopier.</span>")
else
user.visible_message("<span class='warning'>[user] puts [target] onto the photocopier!</span>", "<span class='notice'>You put [target] onto the photocopier.</span>")
target.forceMove(drop_location())
ass = target
if(photocopy)
photocopy.forceMove(drop_location())
visible_message("<span class='warning'>[photocopy] is shoved out of the way by [ass]!</span>")
photocopy = null
else if(copy)
copy.forceMove(drop_location())
visible_message("<span class='warning'>[copy] is shoved out of the way by [ass]!</span>")
copy = null
updateUsrDialog()
/obj/machinery/photocopier/proc/check_ass() //I'm not sure wether I made this proc because it's good form or because of the name.
if(!ass)
return 0
if(ass.loc != src.loc)
ass = null
updateUsrDialog()
return 0
else if(ishuman(ass))
if(!ass.get_item_by_slot(SLOT_W_UNIFORM) && !ass.get_item_by_slot(SLOT_WEAR_SUIT))
return 1
else
return 0
else
return 1
/obj/machinery/photocopier/proc/copier_blocked()
if(QDELETED(src))
return
if(loc.density)
return 1
for(var/atom/movable/AM in loc)
if(AM == src)
continue
if(AM.density)
return 1
return 0
/obj/machinery/photocopier/proc/copier_empty()
if(copy || photocopy || check_ass())
return 0
else
return 1
/*
* Toner cartridge
*/
/obj/item/toner
name = "toner cartridge"
icon = 'icons/obj/device.dmi'
icon_state = "tonercartridge"
grind_results = list("iodine" = 40, "iron" = 10)
var/charges = 5
var/max_charges = 5
/* Photocopiers!
* Contains:
* Photocopier
* Toner Cartridge
*/
/*
* Photocopier
*/
/obj/machinery/photocopier
name = "photocopier"
desc = "Used to copy important documents and anatomy studies."
icon = 'icons/obj/library.dmi'
icon_state = "photocopier"
density = TRUE
use_power = IDLE_POWER_USE
idle_power_usage = 30
active_power_usage = 200
power_channel = EQUIP
max_integrity = 300
integrity_failure = 100
var/obj/item/paper/copy = null //what's in the copier!
var/obj/item/photo/photocopy = null
var/obj/item/documents/doccopy = null
var/copies = 1 //how many copies to print!
var/toner = 40 //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/greytoggle = "Greyscale"
var/mob/living/ass //i can't believe i didn't write a stupid-ass comment about this var when i first coded asscopy.
var/busy = FALSE
/obj/machinery/photocopier/ui_interact(mob/user)
. = ..()
var/dat = "Photocopier<BR><BR>"
if(copy || photocopy || doccopy || (ass && (ass.loc == src.loc)))
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>"
if(photocopy)
dat += "Printing in <a href='byond://?src=[REF(src)];colortoggle=1'>[greytoggle]</a><BR><BR>"
else if(toner)
dat += "Please insert paper to copy.<BR><BR>"
if(isAI(user))
dat += "<a href='byond://?src=[REF(src)];aipic=1'>Print photo from database</a><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")
/obj/machinery/photocopier/Topic(href, href_list)
if(..())
return
if(href_list["copy"])
if(copy)
for(var/i = 0, i < copies, i++)
if(toner > 0 && !busy && copy)
var/copy_as_paper = 1
if(istype(copy, /obj/item/paper/contract/employment))
var/obj/item/paper/contract/employment/E = copy
var/obj/item/paper/contract/employment/C = new /obj/item/paper/contract/employment (loc, E.target.current)
if(C)
copy_as_paper = 0
if(copy_as_paper)
var/obj/item/paper/c = new /obj/item/paper (loc)
if(length(copy.info) > 0) //Only print and add content if the copied doc has words on it
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 = copy.info
copied = replacetext(copied, "<font face=\"[PEN_FONT]\" color=", "<font face=\"[PEN_FONT]\" nocolor=") //state of the art techniques in action
copied = replacetext(copied, "<font face=\"[CRAYON_FONT]\" color=", "<font face=\"[CRAYON_FONT]\" 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
c.fields = copy.fields
c.update_icon()
c.updateinfolinks()
c.stamps = copy.stamps
if(copy.stamped)
c.stamped = copy.stamped.Copy()
c.copy_overlays(copy, TRUE)
toner--
busy = TRUE
sleep(15)
busy = FALSE
else
break
updateUsrDialog()
else if(photocopy)
for(var/i = 0, i < copies, i++)
if(toner >= 5 && !busy && photocopy) //Was set to = 0, but if there was say 3 toner left and this ran, you would get -2 which would be weird for ink
new /obj/item/photo (loc, photocopy.picture.Copy(greytoggle == "Greyscale"? TRUE : FALSE))
busy = TRUE
sleep(15)
busy = FALSE
else
break
else if(doccopy)
for(var/i = 0, i < copies, i++)
if(toner > 5 && !busy && doccopy)
new /obj/item/documents/photocopy(loc, doccopy)
toner-= 6 // the sprite shows 6 papers, yes I checked
busy = TRUE
sleep(15)
busy = FALSE
else
break
updateUsrDialog()
else if(ass) //ASS COPY. By Miauw
for(var/i = 0, i < copies, i++)
var/icon/temp_img
if(ishuman(ass) && (ass.get_item_by_slot(SLOT_W_UNIFORM) || ass.get_item_by_slot(SLOT_WEAR_SUIT)))
to_chat(usr, "<span class='notice'>You feel kind of silly, copying [ass == usr ? "your" : ass][ass == usr ? "" : "\'s"] ass with [ass == usr ? "your" : "[ass.p_their()]"] clothes on.</span>" )
break
else if(toner >= 5 && !busy && check_ass()) //You have to be sitting on the copier and either be a xeno or a human without clothes on.
if(isalienadult(ass) || istype(ass, /mob/living/simple_animal/hostile/alien)) //Xenos have their own asses, thanks to Pybro.
temp_img = icon('icons/ass/assalien.png')
else if(ishuman(ass)) //Suit checks are in check_ass
if(ass.gender == MALE)
temp_img = icon('icons/ass/assmale.png')
else if(ass.gender == FEMALE)
temp_img = icon('icons/ass/assfemale.png')
else //In case anyone ever makes the generic ass. For now I'll be using male asses.
temp_img = icon('icons/ass/assmale.png')
else if(isdrone(ass)) //Drones are hot
temp_img = icon('icons/ass/assdrone.png')
else
break
var/obj/item/photo/p = new /obj/item/photo (loc)
p.pixel_x = rand(-10, 10)
p.pixel_y = rand(-10, 10)
p.picture = new(null, "You see [ass]'s ass on the photo.", temp_img)
p.picture.psize_x = 128
p.picture.psize_y = 128
p.update_icon()
toner -= 5
busy = TRUE
sleep(15)
busy = FALSE
else
break
updateUsrDialog()
else if(href_list["remove"])
if(copy)
remove_photocopy(copy, usr)
copy = null
else if(photocopy)
remove_photocopy(photocopy, usr)
photocopy = null
else if(doccopy)
remove_photocopy(doccopy, usr)
doccopy = null
else if(check_ass())
to_chat(ass, "<span class='notice'>You feel a slight pressure on your ass.</span>")
updateUsrDialog()
else if(href_list["min"])
if(copies > 1)
copies--
updateUsrDialog()
else if(href_list["add"])
if(copies < maxcopies)
copies++
updateUsrDialog()
else if(href_list["aipic"])
if(!isAI(usr))
return
if(toner >= 5 && !busy)
var/mob/living/silicon/ai/tempAI = usr
if(tempAI.aicamera.stored.len == 0)
to_chat(usr, "<span class='boldannounce'>No images saved</span>")
return
var/datum/picture/selection = tempAI.aicamera.selectpicture(usr)
var/obj/item/photo/photo = new(loc, selection)
photo.pixel_x = rand(-10, 10)
photo.pixel_y = rand(-10, 10)
toner -= 5 //AI prints color pictures only, thus they can do it more efficiently
busy = TRUE
sleep(15)
busy = FALSE
updateUsrDialog()
else if(href_list["colortoggle"])
if(greytoggle == "Greyscale")
greytoggle = "Color"
else
greytoggle = "Greyscale"
updateUsrDialog()
/obj/machinery/photocopier/proc/do_insertion(obj/item/O, mob/user)
O.forceMove(src)
to_chat(user, "<span class ='notice'>You insert [O] into [src].</span>")
flick("photocopier1", src)
updateUsrDialog()
/obj/machinery/photocopier/proc/remove_photocopy(obj/item/O, mob/user)
if(!issilicon(user)) //surprised this check didn't exist before, putting stuff in AI's hand is bad
O.forceMove(user.loc)
user.put_in_hands(O)
else
O.forceMove(drop_location())
to_chat(user, "<span class='notice'>You take [O] out of [src].</span>")
/obj/machinery/photocopier/attackby(obj/item/O, mob/user, params)
if(default_unfasten_wrench(user, O))
return
else if(istype(O, /obj/item/paper))
if(copier_empty())
if(istype(O, /obj/item/paper/contract/infernal))
to_chat(user, "<span class='warning'>[src] smokes, smelling of brimstone!</span>")
resistance_flags |= FLAMMABLE
fire_act()
else
if(!user.temporarilyRemoveItemFromInventory(O))
return
copy = O
do_insertion(O, user)
else
to_chat(user, "<span class='warning'>There is already something in [src]!</span>")
else if(istype(O, /obj/item/photo))
if(copier_empty())
if(!user.temporarilyRemoveItemFromInventory(O))
return
photocopy = O
do_insertion(O, user)
else
to_chat(user, "<span class='warning'>There is already something in [src]!</span>")
else if(istype(O, /obj/item/documents))
if(copier_empty())
if(!user.temporarilyRemoveItemFromInventory(O))
return
doccopy = O
do_insertion(O, user)
else
to_chat(user, "<span class='warning'>There is already something in [src]!</span>")
else if(istype(O, /obj/item/toner))
if(toner <= 0)
if(!user.temporarilyRemoveItemFromInventory(O))
return
qdel(O)
toner = 40
to_chat(user, "<span class='notice'>You insert [O] into [src].</span>")
updateUsrDialog()
else
to_chat(user, "<span class='warning'>This cartridge is not yet ready for replacement! Use up the rest of the toner.</span>")
else if(istype(O, /obj/item/areaeditor/blueprints))
to_chat(user, "<span class='warning'>The Blueprint is too large to put into the copier. You need to find something else to record the document</span>")
else
return ..()
/obj/machinery/photocopier/obj_break(damage_flag)
if(!(flags_1 & NODECONSTRUCT_1))
if(toner > 0)
new /obj/effect/decal/cleanable/oil(get_turf(src))
toner = 0
/obj/machinery/photocopier/MouseDrop_T(mob/target, mob/user)
check_ass() //Just to make sure that you can re-drag somebody onto it after they moved off.
if (!istype(target) || target.anchored || target.buckled || !Adjacent(target) || !user.canUseTopic(src, BE_CLOSE) || target == ass || copier_blocked())
return
src.add_fingerprint(user)
if(target == user)
user.visible_message("[user] starts climbing onto the photocopier!", "<span class='notice'>You start climbing onto the photocopier...</span>")
else
user.visible_message("<span class='warning'>[user] starts putting [target] onto the photocopier!</span>", "<span class='notice'>You start putting [target] onto the photocopier...</span>")
if(do_after(user, 20, target = src))
if(!target || QDELETED(target) || QDELETED(src) || !Adjacent(target)) //check if the photocopier/target still exists.
return
if(target == user)
user.visible_message("[user] climbs onto the photocopier!", "<span class='notice'>You climb onto the photocopier.</span>")
else
user.visible_message("<span class='warning'>[user] puts [target] onto the photocopier!</span>", "<span class='notice'>You put [target] onto the photocopier.</span>")
target.forceMove(drop_location())
ass = target
if(photocopy)
photocopy.forceMove(drop_location())
visible_message("<span class='warning'>[photocopy] is shoved out of the way by [ass]!</span>")
photocopy = null
else if(copy)
copy.forceMove(drop_location())
visible_message("<span class='warning'>[copy] is shoved out of the way by [ass]!</span>")
copy = null
updateUsrDialog()
/obj/machinery/photocopier/proc/check_ass() //I'm not sure wether I made this proc because it's good form or because of the name.
if(!ass)
return 0
if(ass.loc != src.loc)
ass = null
updateUsrDialog()
return 0
else if(ishuman(ass))
if(!ass.get_item_by_slot(SLOT_W_UNIFORM) && !ass.get_item_by_slot(SLOT_WEAR_SUIT))
return 1
else
return 0
else
return 1
/obj/machinery/photocopier/proc/copier_blocked()
if(QDELETED(src))
return
if(loc.density)
return 1
for(var/atom/movable/AM in loc)
if(AM == src)
continue
if(AM.density)
return 1
return 0
/obj/machinery/photocopier/proc/copier_empty()
if(copy || photocopy || check_ass())
return 0
else
return 1
/*
* Toner cartridge
*/
/obj/item/toner
name = "toner cartridge"
icon = 'icons/obj/device.dmi'
icon_state = "tonercartridge"
grind_results = list(/datum/reagent/iodine = 40, /datum/reagent/iron = 10)
var/charges = 5
var/max_charges = 5
+71 -71
View File
@@ -1,71 +1,71 @@
/obj/item/stamp
name = "\improper GRANTED rubber stamp"
desc = "A rubber stamp for stamping important documents."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "stamp-ok"
item_state = "stamp"
throwforce = 0
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL=60)
item_color = "cargo"
pressure_resistance = 2
attack_verb = list("stamped")
/obj/item/stamp/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] stamps 'VOID' on [user.p_their()] forehead, then promptly falls over, dead.</span>")
return (OXYLOSS)
/obj/item/stamp/qm
name = "quartermaster's rubber stamp"
icon_state = "stamp-qm"
item_color = "qm"
/obj/item/stamp/law
name = "law office's rubber stamp"
icon_state = "stamp-law"
item_color = "cargo"
/obj/item/stamp/captain
name = "captain's rubber stamp"
icon_state = "stamp-cap"
item_color = "captain"
/obj/item/stamp/hop
name = "head of personnel's rubber stamp"
icon_state = "stamp-hop"
item_color = "hop"
/obj/item/stamp/hos
name = "head of security's rubber stamp"
icon_state = "stamp-hos"
item_color = "hosred"
/obj/item/stamp/ce
name = "chief engineer's rubber stamp"
icon_state = "stamp-ce"
item_color = "chief"
/obj/item/stamp/rd
name = "research director's rubber stamp"
icon_state = "stamp-rd"
item_color = "director"
/obj/item/stamp/cmo
name = "chief medical officer's rubber stamp"
icon_state = "stamp-cmo"
item_color = "cmo"
/obj/item/stamp/denied
name = "\improper DENIED rubber stamp"
icon_state = "stamp-deny"
item_color = "redcoat"
/obj/item/stamp/clown
name = "clown's rubber stamp"
icon_state = "stamp-clown"
item_color = "clown"
/obj/item/stamp/attack_paw(mob/user)
return attack_hand(user)
/obj/item/stamp
name = "\improper GRANTED rubber stamp"
desc = "A rubber stamp for stamping important documents."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "stamp-ok"
item_state = "stamp"
throwforce = 0
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL=60)
item_color = "cargo"
pressure_resistance = 2
attack_verb = list("stamped")
/obj/item/stamp/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] stamps 'VOID' on [user.p_their()] forehead, then promptly falls over, dead.</span>")
return (OXYLOSS)
/obj/item/stamp/qm
name = "quartermaster's rubber stamp"
icon_state = "stamp-qm"
item_color = "qm"
/obj/item/stamp/law
name = "law office's rubber stamp"
icon_state = "stamp-law"
item_color = "cargo"
/obj/item/stamp/captain
name = "captain's rubber stamp"
icon_state = "stamp-cap"
item_color = "captain"
/obj/item/stamp/hop
name = "head of personnel's rubber stamp"
icon_state = "stamp-hop"
item_color = "hop"
/obj/item/stamp/hos
name = "head of security's rubber stamp"
icon_state = "stamp-hos"
item_color = "hosred"
/obj/item/stamp/ce
name = "chief engineer's rubber stamp"
icon_state = "stamp-ce"
item_color = "chief"
/obj/item/stamp/rd
name = "research director's rubber stamp"
icon_state = "stamp-rd"
item_color = "director"
/obj/item/stamp/cmo
name = "chief medical officer's rubber stamp"
icon_state = "stamp-cmo"
item_color = "cmo"
/obj/item/stamp/denied
name = "\improper DENIED rubber stamp"
icon_state = "stamp-deny"
item_color = "redcoat"
/obj/item/stamp/clown
name = "clown's rubber stamp"
icon_state = "stamp-clown"
item_color = "clown"
/obj/item/stamp/attack_paw(mob/user)
return attack_hand(user)