From e4e5c1ae6267e8302dc8a298f7f7f3260ca5f2dd Mon Sep 17 00:00:00 2001 From: Firecage Date: Thu, 15 Jan 2015 02:45:51 +0200 Subject: [PATCH] This adds a delay to anchoring and unanchoring a hydroponics tray. --- code/modules/hydroponics/hydroponics.dm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 394c9036da6..f8fb805fb70 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -708,13 +708,21 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) return if(!anchored && !isinspace()) + user.visible_message("[user] begins to wrench [src] into place.", \ + "You begin to wrench [src] in place.") playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) - anchored = 1 - user << "You wrench [src] in place." + if (do_after(user, 20)) + anchored = 1 + user.visible_message("[user] wrenches [src] into place.", \ + "You wrench [src] in place.") else if(anchored) + user.visible_message("[user] begins to unwrench [src].", \ + "You begin to unwrench [src].") playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) - anchored = 0 - user << "You unwrench [src]." + if (do_after(user, 20)) + anchored = 0 + user.visible_message("[user] unwrenches [src].", \ + "You unwrench [src].") else if(istype(O, /obj/item/weapon/screwdriver) && unwrenchable) //THIS NEED TO BE DONE DIFFERENTLY, SOMEONE REFACTOR THE TRAY CODE ALREADY if(anchored)