From 1ee8d6c4d5541fdc5b03b739bfed5dabcf8c5cf0 Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Sat, 26 Sep 2020 23:37:48 +0200 Subject: [PATCH] Gives the gravitational catapult a 3 second cooldown per use --- code/game/mecha/equipment/tools/other_tools.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/game/mecha/equipment/tools/other_tools.dm b/code/game/mecha/equipment/tools/other_tools.dm index 61ba683ad18..8fdbf0880df 100644 --- a/code/game/mecha/equipment/tools/other_tools.dm +++ b/code/game/mecha/equipment/tools/other_tools.dm @@ -87,11 +87,15 @@ energy_drain = 100 range = MECHA_MELEE | MECHA_RANGED var/atom/movable/locked + var/cooldown_timer = 0 var/mode = 1 //1 - gravsling 2 - gravpush /obj/item/mecha_parts/mecha_equipment/gravcatapult/action(atom/movable/target) if(!action_checks(target)) return + if(cooldown_timer > world.time) + occupant_message("[src] is still recharging.") + return switch(mode) if(1) if(!locked) @@ -106,6 +110,7 @@ locked.throw_at(target, 14, 1.5) locked = null send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",get_equip_info()) + cooldown_timer = world.time + 3 SECONDS return 1 else locked = null @@ -125,6 +130,7 @@ step_away(A,target) sleep(2) var/turf/T = get_turf(target) + cooldown_timer = world.time + 3 SECONDS log_game("[key_name(chassis.occupant)] used a Gravitational Catapult in ([T.x],[T.y],[T.z])") return 1