From a77b690b029023b3f08685c13bb9165a82d28b6d Mon Sep 17 00:00:00 2001 From: Markolie Date: Sun, 30 Oct 2016 16:41:17 +0100 Subject: [PATCH] Add cooldown to the plant analyzer print --- code/modules/hydroponics/trays/tray_tools.dm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/code/modules/hydroponics/trays/tray_tools.dm b/code/modules/hydroponics/trays/tray_tools.dm index 2f41c6cdb5c..4086403c6e0 100644 --- a/code/modules/hydroponics/trays/tray_tools.dm +++ b/code/modules/hydroponics/trays/tray_tools.dm @@ -13,19 +13,23 @@ origin_tech = "magnets=1;biotech=1" var/form_title var/last_data + var/print_cooldown = 0 + var/cooldown_length = 50 // Five seconds /obj/item/device/analyzer/plant_analyzer/proc/print_report_verb() set name = "Print Plant Report" set category = "Object" set src = usr - if(usr.stat || usr.restrained() || usr.lying) + if(usr.incapacitated()) return + print_report(usr) /obj/item/device/analyzer/plant_analyzer/Topic(href, href_list) if(..()) - return + return 1 + if(href_list["print"]) print_report(usr) @@ -33,6 +37,11 @@ if(!last_data) to_chat(user, "There is no scan data to print.") return + if(print_cooldown > world.time) + to_chat(user, "The printer is still cooling down.") + return + print_cooldown = world.time + cooldown_length + playsound(loc, "sound/goonstation/machines/printer_thermal.ogg", 50, 1) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(get_turf(src)) P.name = "paper - [form_title]"