From b3ccf9523deb180588ad3ed0de3bcdacfd02b377 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 15 Jun 2024 19:51:48 +0200 Subject: [PATCH] [MIRROR] Ian and Runtime can lick your wounds (#28187) * Ian and Runtime can lick your wounds * Update _wounds.dm --------- Co-authored-by: Jacquerel Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com> --- code/_globalvars/traits/admin_tooling.dm | 1 + .../datums/elements/attack_zone_randomiser.dm | 2 ++ code/datums/wounds/_wounds.dm | 4 ++-- code/datums/wounds/bones.dm | 6 ++++-- code/datums/wounds/cranial_fissure.dm | 7 +++++-- code/datums/wounds/slash.dm | 21 ++++++++++++------- .../basic/farm_animals/gorilla/gorilla.dm | 1 + .../mob/living/carbon/carbon_defense.dm | 7 +++++++ 8 files changed, 35 insertions(+), 14 deletions(-) diff --git a/code/_globalvars/traits/admin_tooling.dm b/code/_globalvars/traits/admin_tooling.dm index 1e13d192f94..b66f81d2564 100644 --- a/code/_globalvars/traits/admin_tooling.dm +++ b/code/_globalvars/traits/admin_tooling.dm @@ -233,6 +233,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( "TRAIT_USES_SKINTONES" = TRAIT_USES_SKINTONES, "TRAIT_VIRUSIMMUNE" = TRAIT_VIRUSIMMUNE, "TRAIT_VORACIOUS" = TRAIT_VORACIOUS, + "TRAIT_WOUND_LICKER" = TRAIT_WOUND_LICKER, "TRAIT_WEAK_SOUL" = TRAIT_WEAK_SOUL, "TRAIT_WEB_SURFER" = TRAIT_WEB_SURFER, "TRAIT_WEB_WEAVER" = TRAIT_WEB_WEAVER, diff --git a/code/datums/elements/attack_zone_randomiser.dm b/code/datums/elements/attack_zone_randomiser.dm index 35275e11a9b..1e364265bab 100644 --- a/code/datums/elements/attack_zone_randomiser.dm +++ b/code/datums/elements/attack_zone_randomiser.dm @@ -21,6 +21,8 @@ SIGNAL_HANDLER if (!iscarbon(target)) return + if (!isnull(source.mind) && !isnull(source.hud_used?.zone_select)) + return var/mob/living/living_target = target var/list/blacklist_zones = GLOB.all_body_zones - valid_attack_zones var/new_zone = living_target.get_random_valid_zone(blacklisted_parts = blacklist_zones, bypass_warning = TRUE) diff --git a/code/datums/wounds/_wounds.dm b/code/datums/wounds/_wounds.dm index cde13ea2d20..f713819c817 100644 --- a/code/datums/wounds/_wounds.dm +++ b/code/datums/wounds/_wounds.dm @@ -512,8 +512,8 @@ /datum/wound/proc/check_grab_treatments(obj/item/I, mob/user) return FALSE -/// Like try_treating() but for unhanded interactions from humans, used by joint dislocations for manual bodypart chiropractice for example. Ignores thick material checks since you can pop an arm into place through a thick suit unlike using sutures -/datum/wound/proc/try_handling(mob/living/carbon/human/user, modifiers) +/// Like try_treating() but for unhanded interactions, used by joint dislocations for manual bodypart chiropractice for example. Ignores thick material checks since you can pop an arm into place through a thick suit unlike using sutures +/datum/wound/proc/try_handling(mob/living/user) return FALSE /// Someone is using something that might be used for treating the wound on this limb diff --git a/code/datums/wounds/bones.dm b/code/datums/wounds/bones.dm index 9c3343b73ec..13877c8223b 100644 --- a/code/datums/wounds/bones.dm +++ b/code/datums/wounds/bones.dm @@ -232,8 +232,10 @@ victim.visible_message(span_danger("[victim]'s dislocated [limb.plaintext_zone] pops back into place!"), span_userdanger("Your dislocated [limb.plaintext_zone] pops back into place! Ow!")) remove_wound() -/datum/wound/blunt/bone/moderate/try_handling(mob/living/carbon/human/user) - if(user.pulling != victim || user.zone_selected != limb.body_zone) +/datum/wound/blunt/bone/moderate/try_handling(mob/living/user) + if(user.usable_hands <= 0 || user.pulling != victim) + return FALSE + if(!isnull(user.hud_used?.zone_select) && user.zone_selected != limb.body_zone) return FALSE if(user.grab_state == GRAB_PASSIVE) diff --git a/code/datums/wounds/cranial_fissure.dm b/code/datums/wounds/cranial_fissure.dm index f73f263ff50..9bd9969f428 100644 --- a/code/datums/wounds/cranial_fissure.dm +++ b/code/datums/wounds/cranial_fissure.dm @@ -74,8 +74,11 @@ span_userdanger("Your brain spills right out of your head!"), ) -/datum/wound/cranial_fissure/try_handling(mob/living/carbon/human/user) - if (user.zone_selected != BODY_ZONE_HEAD && user.zone_selected != BODY_ZONE_PRECISE_EYES) +/datum/wound/cranial_fissure/try_handling(mob/living/user) + if (user.usable_hands <= 0) + return FALSE + + if(!isnull(user.hud_used?.zone_select) && (user.zone_selected != BODY_ZONE_HEAD && user.zone_selected != BODY_ZONE_PRECISE_EYES)) return FALSE if (victim.body_position != LYING_DOWN) diff --git a/code/datums/wounds/slash.dm b/code/datums/wounds/slash.dm index 0e370c2ffca..e8f77e603be 100644 --- a/code/datums/wounds/slash.dm +++ b/code/datums/wounds/slash.dm @@ -188,18 +188,23 @@ else if(istype(I, /obj/item/stack/medical/suture)) return suture(I, user) -/datum/wound/slash/flesh/try_handling(mob/living/carbon/human/user) - if(user.pulling != victim || user.zone_selected != limb.body_zone || !HAS_TRAIT(user, TRAIT_WOUND_LICKER) || !victim.try_inject(user, injection_flags = INJECT_TRY_SHOW_ERROR_MESSAGE)) +/datum/wound/slash/flesh/try_handling(mob/living/user) + if(user.pulling != victim || !HAS_TRAIT(user, TRAIT_WOUND_LICKER) || !victim.try_inject(user, injection_flags = INJECT_TRY_SHOW_ERROR_MESSAGE)) return FALSE + if(!isnull(user.hud_used?.zone_select) && user.zone_selected != limb.body_zone) + return FALSE + if(DOING_INTERACTION_WITH_TARGET(user, victim)) to_chat(user, span_warning("You're already interacting with [victim]!")) return - if(user.is_mouth_covered()) - to_chat(user, span_warning("Your mouth is covered, you can't lick [victim]'s wounds!")) - return - if(!user.get_organ_slot(ORGAN_SLOT_TONGUE)) - to_chat(user, span_warning("You can't lick wounds without a tongue!")) // f in chat - return + if(iscarbon(user)) + var/mob/living/carbon/carbon_user = user + if(carbon_user.is_mouth_covered()) + to_chat(user, span_warning("Your mouth is covered, you can't lick [victim]'s wounds!")) + return + if(!carbon_user.get_organ_slot(ORGAN_SLOT_TONGUE)) + to_chat(user, span_warning("You can't lick wounds without a tongue!")) // f in chat + return lick_wounds(user) return TRUE diff --git a/code/modules/mob/living/basic/farm_animals/gorilla/gorilla.dm b/code/modules/mob/living/basic/farm_animals/gorilla/gorilla.dm index 423f3b8c397..b2aff7371a4 100644 --- a/code/modules/mob/living/basic/farm_animals/gorilla/gorilla.dm +++ b/code/modules/mob/living/basic/farm_animals/gorilla/gorilla.dm @@ -36,6 +36,7 @@ ai_controller = /datum/ai_controller/basic_controller/gorilla faction = list(FACTION_MONKEY, FACTION_JUNGLE) butcher_results = list(/obj/item/food/meat/slab/gorilla = 4, /obj/effect/gibspawner/generic/animal = 1) + max_grab = GRAB_KILL /// How likely our meaty fist is to stun someone var/paralyze_chance = 20 /// A counter for when we can scream again diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index eaf811fa4ae..2aae50d9d3f 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -175,6 +175,13 @@ return FALSE +/mob/living/carbon/attack_animal(mob/living/simple_animal/user, list/modifiers) + if (!user.combat_mode) + for (var/datum/wound/wounds as anything in all_wounds) + if (wounds.try_handling(user)) + return TRUE + + return ..() /mob/living/carbon/attack_paw(mob/living/carbon/human/user, list/modifiers)