From 9023e0ff67ae1b8bfbe7e0d1fe3c461b0f7b196b Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sun, 4 Jun 2017 11:05:12 -0500 Subject: [PATCH] refactor another spawn cooldown (#1392) --- code/game/objects/items/robot/robot_items.dm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index eafd5fdba4..9a4b3bdfec 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -111,7 +111,7 @@ "You bop [M] on the head!") playsound(loc, 'sound/weapons/tap.ogg', 50, 1, -1) if(2) - if(!scooldown) + if(scooldown < world.time) if(M.health >= 0) if(ishuman(M)||ismonkey(M)) M.electrocute_act(5, "[user]", safety = 1) @@ -128,11 +128,9 @@ "You shock [M] to no effect.") playsound(loc, 'sound/effects/sparks2.ogg', 50, 1, -1) user.cell.charge -= 500 - scooldown = TRUE - spawn(20) - scooldown = FALSE + scooldown = world.time + 20 if(3) - if(!ccooldown) + if(ccooldown < world.time) if(M.health >= 0) if(ishuman(M)) user.visible_message("[user] crushes [M] in their grip!", \ @@ -143,9 +141,7 @@ playsound(loc, 'sound/weapons/smash.ogg', 50, 1, -1) M.adjustBruteLoss(15) user.cell.charge -= 300 - ccooldown = TRUE - spawn(10) - ccooldown = FALSE + ccooldown = world.time + 10 /obj/item/borg/cyborghug/peacekeeper shockallowed = TRUE