From 5e2f62800c4bc16ec7726fc7ee230f5f06b4eb7d Mon Sep 17 00:00:00 2001 From: datlo Date: Thu, 30 Jun 2022 15:29:26 +0200 Subject: [PATCH] Buffs stun absorption to stop disarms. (#18126) * Disarm is now stopped by stun absorption * update comment --- code/modules/mob/living/carbon/human/human_defense.dm | 6 +++++- code/modules/mob/living/carbon/human/species/_species.dm | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 8712052229b..4faf5477a83 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -633,7 +633,11 @@ emp_act add_attack_logs(M, src, "Alien attacked") updatehealth("alien attack") - if(M.a_intent == INTENT_DISARM) //Always drop item in hand, if no item, get stun instead. + if(M.a_intent == INTENT_DISARM) //If not absorbed, always drop item in hand, if no item, get stun instead. + if(absorb_stun(0)) + visible_message("[src] is not affected by [M]'s disarm attempt!") + playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) + return FALSE var/obj/item/I = get_active_hand() if(I && unEquip(I)) playsound(loc, 'sound/weapons/slash.ogg', 25, TRUE, -1) diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index 4ad919aa469..8fe46194960 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -513,6 +513,11 @@ if(target.check_block()) target.visible_message("[target] blocks [user]'s disarm attempt!") return FALSE + if(target.absorb_stun(0)) + target.visible_message("[target] is not affected by [user]'s disarm attempt!") + user.do_attack_animation(target, ATTACK_EFFECT_DISARM) + playsound(target.loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) + return FALSE if(attacker_style && attacker_style.disarm_act(user, target) == TRUE) return TRUE else