From 5ad39338f58d342cdf18d02024dd83d9bda39ea1 Mon Sep 17 00:00:00 2001 From: Xhuis Date: Sun, 23 Jul 2017 12:46:24 -0400 Subject: [PATCH] Stabbing yourself is now always accuate --- code/modules/mob/living/carbon/carbon_defense.dm | 6 +++++- code/modules/mob/living/carbon/human/human_defense.dm | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index cd9f2f5af4e..ae83337cde2 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -68,7 +68,11 @@ /mob/living/carbon/attacked_by(obj/item/I, mob/living/user) - var/obj/item/bodypart/affecting = get_bodypart(ran_zone(user.zone_selected)) + var/obj/item/bodypart/affecting + if(user == src) + affecting = get_bodypart(user.zone_selected) //we're self-mutilating! yay! + else + affecting = get_bodypart(ran_zone(user.zone_selected)) if(!affecting) //missing limb? we select the first bodypart (you can never have zero, because of chest) affecting = bodyparts[1] send_item_attack_message(I, user, affecting.name) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 618a2fe9a2a..a632ffd8745 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -156,8 +156,14 @@ if(!I || !user) return 0 - var/obj/item/bodypart/affecting = get_bodypart(ran_zone(user.zone_selected)) //what we're actually ending up trying to hit. + var/obj/item/bodypart/affecting + if(user == src) + to_chat(user, "stab!") + affecting = get_bodypart(user.zone_selected) //stabbing yourself always hits the right target + else + affecting = get_bodypart(ran_zone(user.zone_selected)) var/target_area = parse_zone(check_zone(user.zone_selected)) //our intended target + SSblackbox.add_details("item_used_for_combat","[I.type]|[I.force]") SSblackbox.add_details("zone_targeted","[target_area]")