mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-20 04:17:45 +01:00
Ports reagents id removal and typepath usage.
This commit is contained in:
+218
-218
@@ -1,218 +1,218 @@
|
||||
/* Pens!
|
||||
* Contains:
|
||||
* Pens
|
||||
* Sleepy Pens
|
||||
* Parapens
|
||||
* Edaggers
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Pens
|
||||
*/
|
||||
/obj/item/pen
|
||||
desc = "It's a black ink pen, modified for use with both paper and Nanotransen-brand Digital-Readpads™!"
|
||||
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 blue ink pen, modified for use with both paper and Nanotransen-brand Digital-Readpads™!"
|
||||
icon_state = "pen_blue"
|
||||
colour = "blue"
|
||||
|
||||
/obj/item/pen/red
|
||||
desc = "It's a red ink pen, modified for use with both paper and Nanotransen-brand Digital-Readpads™!"
|
||||
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. Modified to be compatible with Nanotransen-brand Digital-Readpads™"
|
||||
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
|
||||
var/on = FALSE
|
||||
|
||||
/obj/item/pen/edagger/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/butchering, 60, 100, 0, 'sound/weapons/blade1.ogg', TRUE)
|
||||
|
||||
/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>")
|
||||
var/datum/component/butchering/butchering = src.GetComponent(/datum/component/butchering)
|
||||
butchering.butchering_enabled = on
|
||||
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 black ink pen, modified for use with both paper and Nanotransen-brand Digital-Readpads™!"
|
||||
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 blue ink pen, modified for use with both paper and Nanotransen-brand Digital-Readpads™!"
|
||||
icon_state = "pen_blue"
|
||||
colour = "blue"
|
||||
|
||||
/obj/item/pen/red
|
||||
desc = "It's a red ink pen, modified for use with both paper and Nanotransen-brand Digital-Readpads™!"
|
||||
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. Modified to be compatible with Nanotransen-brand Digital-Readpads™"
|
||||
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
|
||||
var/on = FALSE
|
||||
|
||||
/obj/item/pen/edagger/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/butchering, 60, 100, 0, 'sound/weapons/blade1.ogg', TRUE)
|
||||
|
||||
/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>")
|
||||
var/datum/component/butchering/butchering = src.GetComponent(/datum/component/butchering)
|
||||
butchering.butchering_enabled = on
|
||||
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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user