From a175e70865c72834e6ea39eef01aa34497c2ff71 Mon Sep 17 00:00:00 2001 From: Atermonera Date: Tue, 30 Jul 2019 16:18:51 -0800 Subject: [PATCH] Merge pull request #6354 from MagmaRam/eyestabs Adds proper miss chance for stabbing people in the eyes. --- code/game/objects/items.dm | 16 +++++++++------- code/modules/mob/mob_helpers.dm | 2 ++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 3ba9c1bac7..591da02757 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -492,13 +492,15 @@ var/list/global/slot_flags_enumeration = list( user << "You cannot locate any eyes on [M]!" return - if(U.get_accuracy_penalty(U)) //Should only trigger if they're not aiming well - var/hit_zone = get_zone_with_miss_chance(U.zone_sel.selecting, M, U.get_accuracy_penalty(U)) - if(!hit_zone) - U.do_attack_animation(M) - playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - visible_message("[U] attempts to stab [M] in the eyes, but misses!") - return + //this should absolutely trigger even if not aim-impaired in some way + var/hit_zone = get_zone_with_miss_chance(U.zone_sel.selecting, M, U.get_accuracy_penalty(U)) + if(!hit_zone) + U.do_attack_animation(M) + playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) + //visible_message("[U] attempts to stab [M] in the eyes, but misses!") + for(var/mob/V in viewers(M)) + V.show_message("[U] attempts to stab [M] in the eyes, but misses!") + return add_attack_logs(user,M,"Attack eyes with [name]") diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index af06226e15..a60586bbf2 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -147,6 +147,8 @@ proc/getsensorlevel(A) var/miss_chance = 10 if (zone in base_miss_chance) miss_chance = base_miss_chance[zone] + if (zone == "eyes" || zone == "mouth") + miss_chance = base_miss_chance["head"] miss_chance = max(miss_chance + miss_chance_mod, 0) if(prob(miss_chance)) if(prob(70))