mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-22 23:32:33 +00:00
Adds the id of the object that could not be loaded to the error log. Updates the invoice for cargo shipments.
49 lines
1.4 KiB
Plaintext
49 lines
1.4 KiB
Plaintext
/obj/item/computer_hardware/nano_printer
|
|
name = "nano printer"
|
|
desc = "Small integrated printer with paper recycling module."
|
|
power_usage = 50
|
|
origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 2)
|
|
critical = 0
|
|
icon_state = "printer"
|
|
hardware_size = 1
|
|
var/stored_paper = 5
|
|
var/max_paper = 10
|
|
|
|
/obj/item/computer_hardware/nano_printer/diagnostics(var/mob/user)
|
|
..()
|
|
to_chat(user, "Paper buffer level: [stored_paper]/[max_paper]")
|
|
|
|
/obj/item/computer_hardware/nano_printer/proc/print_text(var/text_to_print, var/paper_title = null, var/paper_color = null)
|
|
if(!stored_paper)
|
|
return 0
|
|
if(!enabled)
|
|
return 0
|
|
if(!check_functionality())
|
|
return 0
|
|
|
|
// Damaged printer causes the resulting paper to be somewhat harder to read.
|
|
if(damage > damage_malfunction)
|
|
text_to_print = stars(text_to_print, 100-malfunction_probability)
|
|
var/obj/item/paper/P = new /obj/item/paper(get_turf(holder2),text_to_print, paper_title)
|
|
if (paper_color)
|
|
P.color = paper_color
|
|
|
|
stored_paper--
|
|
return P
|
|
|
|
/obj/item/computer_hardware/nano_printer/attackby(obj/item/W as obj, mob/user as mob)
|
|
if(istype(W, /obj/item/paper))
|
|
if(stored_paper >= max_paper)
|
|
to_chat(user, "You try to add \the [W] into [src], but it's paper bin is full")
|
|
return
|
|
|
|
to_chat(user, "You insert \the [W] into [src].")
|
|
qdel(W)
|
|
stored_paper++
|
|
|
|
/obj/item/computer_hardware/nano_printer/Destroy()
|
|
if(holder2 && (holder2.nano_printer == src))
|
|
holder2.nano_printer = null
|
|
holder2 = null
|
|
return ..()
|