From f58eaf7350fbcd65beb402ccc5b7e98203d094bc Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Sun, 28 Apr 2024 09:20:53 +0300 Subject: [PATCH] Update click.dm --- code/_onclick/click.dm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 72e298d32729..9508bcd91a35 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -149,13 +149,26 @@ if(W.attack_speed && !src.contains(A)) //Not being worn or carried in the user's inventory somewhere, including internal storages. next_move += W.attack_speed - if(!A.attackby(W, src, mods) && A && !QDELETED(A)) + var/attackby_result = A.attackby(W, src, mods) + + if(!attackby_result && A && !QDELETED(A)) // in case the attackby slept if(!W) UnarmedAttack(A, 1, mods) return - W.afterattack(A, src, 1, mods) + W.afterattack(A, src, 1, mods) + + // Looks goofy when you swipe at the floor with a gun + if(istype(W, /obj/item/weapon/gun)) + return + + var/mob/living/self = src + self.animation_attack_on(A) + src.visible_message(SPAN_DANGER("[src] swipes at \the [A] with [W]!"), \ + SPAN_DANGER("You swipe at \the [A] with [W]!"), null, 5, CHAT_TYPE_WEAPON_USE) + + else if(!isitem(A) && !issurface(A)) next_move += 4