From cfef9d1bf219561bf215b064812d09b4dde84c97 Mon Sep 17 00:00:00 2001 From: JimKil3 <47290811+JimKil3@users.noreply.github.com> Date: Sun, 29 Oct 2023 16:03:28 -0400 Subject: [PATCH] Tweaks *twirl (#22882) * twirling * redoes everything * damnit lewc * early return --- .../modules/mob/living/carbon/carbon_emote.dm | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon_emote.dm b/code/modules/mob/living/carbon/carbon_emote.dm index 7e67aad5c26..3fcba428c13 100644 --- a/code/modules/mob/living/carbon/carbon_emote.dm +++ b/code/modules/mob/living/carbon/carbon_emote.dm @@ -163,20 +163,28 @@ message = "twirls something around in their hand." hands_use_check = TRUE -/datum/emote/living/carbon/twirl/can_run_emote(mob/living/user, status_check, intentional) - . = ..() - if(!.) - return - - if(user.l_hand || user.r_hand) - return TRUE - - to_chat(user, "You need something in your hand to use this emote!") - return FALSE - /datum/emote/living/carbon/twirl/run_emote(mob/user, params, type_override, intentional) - var/obj/item/thing = user.l_hand || user.r_hand - message = "twirls [thing] around in their hand!" + if(!(user.get_active_hand() || user.get_inactive_hand())) + to_chat(user, "You need something in your hand to use this emote!") + return TRUE + + var/obj/item/thing + + if(user.get_active_hand()) + thing = user.get_active_hand() + else + thing = user.get_inactive_hand() + + if(istype(thing, /obj/item/grab)) + var/obj/item/grab/grabbed = thing + message = "twirls [grabbed.affecting.name] around!" + grabbed.affecting.emote("spin") + else if(!(thing.flags & ABSTRACT)) + message = "twirls [thing] around in their hand!" + else + to_chat(user, "You cannot twirl [thing]!") + return TRUE + . = ..() message = initial(message)