From d320615c8bd5e20b54f99c8b90faf86a5ac3ac99 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 28 Mar 2022 20:24:16 +0200 Subject: [PATCH] [MIRROR] Fixes offering things to yourself [MDB IGNORE] (#12295) * Fixes offering things to yourself * Fixes the conflicts related to carbon_defense.dm Co-authored-by: cacogen <25089914+cacogen@users.noreply.github.com> Co-authored-by: GoldenAlpharex --- .../mob/living/carbon/carbon_context.dm | 9 +++++++- .../mob/living/carbon/carbon_defense.dm | 2 +- code/modules/mob/living/carbon/inventory.dm | 21 ++++++++++++++----- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon_context.dm b/code/modules/mob/living/carbon/carbon_context.dm index dc3e8a3ef01..70f12e75ee5 100644 --- a/code/modules/mob/living/carbon/carbon_context.dm +++ b/code/modules/mob/living/carbon/carbon_context.dm @@ -22,7 +22,14 @@ context[SCREENTIP_CONTEXT_RMB] = "Shove" if (body_position == STANDING_UP) - context[SCREENTIP_CONTEXT_LMB] = "Comfort" + if(check_zone(user.zone_selected) == BODY_ZONE_HEAD && get_bodypart(BODY_ZONE_HEAD)) + context[SCREENTIP_CONTEXT_LMB] = "Headpat" + /* SKYRAT REMOVAL START - No taill pulling + else if(check_zone(user.zone_selected) == BODY_ZONE_PRECISE_GROIN && !isnull(getorgan(/obj/item/organ/tail))) + context[SCREENTIP_CONTEXT_LMB] = "Pull tail" + */ // SKYRAT REMOVAL END + else + context[SCREENTIP_CONTEXT_LMB] = "Hug" else if (health >= 0 && !HAS_TRAIT(src, TRAIT_FAKEDEATH)) context[SCREENTIP_CONTEXT_LMB] = "Shake" else diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index b6cdd428fd9..c4ee8c79cf2 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -482,7 +482,7 @@ "You boop [src] on the nose.") //SKYRAT EDIT ADDITION END - else if(check_zone(M.zone_selected) == BODY_ZONE_HEAD) //Headpats! + else if(check_zone(M.zone_selected) == BODY_ZONE_HEAD && get_bodypart(BODY_ZONE_HEAD)) //Headpats! //SKYRAT EDIT ADDITION if(HAS_TRAIT(src, TRAIT_OVERSIZED) && !HAS_TRAIT(M, TRAIT_OVERSIZED)) visible_message(span_warning("[M] tries to pat [src] on the head, but can't reach!")) diff --git a/code/modules/mob/living/carbon/inventory.dm b/code/modules/mob/living/carbon/inventory.dm index 9c1f5e296e4..5273d0dd930 100644 --- a/code/modules/mob/living/carbon/inventory.dm +++ b/code/modules/mob/living/carbon/inventory.dm @@ -164,7 +164,7 @@ */ /mob/living/carbon/proc/give(mob/living/carbon/offered) if(has_status_effect(/datum/status_effect/offering)) - to_chat(src, span_warning("You're already offering up something!")) + to_chat(src, span_warning("You're already offering something!")) return if(IS_DEAD_OR_INCAP(src)) @@ -173,20 +173,31 @@ var/obj/item/offered_item = get_active_held_item() if(!offered_item) - to_chat(src, span_warning("You're not holding anything to give!")) + to_chat(src, span_warning("You're not holding anything to offer!")) return if(offered) + if(offered == src) + if(!swap_hand(get_inactive_hand_index())) //have to swap hands first to take something + to_chat(src, span_warning("You try to take [offered_item] from yourself, but fail.")) + return + if(!put_in_active_hand(offered_item)) + to_chat(src, span_warning("You try to take [offered_item] from yourself, but fail.")) + return + else + to_chat(src, span_notice("You take [offered_item] from yourself.")) + return + if(IS_DEAD_OR_INCAP(offered)) - to_chat(src, span_warning("They're unable to take anything in their current state!")) + to_chat(src, span_warning("[offered.p_theyre(TRUE)] unable to take anything in [offered.p_their()] current state!")) return if(!CanReach(offered)) - to_chat(src, span_warning("You have to be adjacent to offer things!")) + to_chat(src, span_warning("You have to be beside [offered.p_them()]!")) return else if(!(locate(/mob/living/carbon) in orange(1, src))) - to_chat(src, span_warning("There's nobody adjacent to offer it to!")) + to_chat(src, span_warning("There's nobody beside you to take it!")) return if(offered_item.on_offered(src)) // see if the item interrupts with its own behavior