Buffs stun absorption to stop disarms. (#18126)

* Disarm is now stopped by stun absorption

* update comment
This commit is contained in:
datlo
2022-06-30 15:29:26 +02:00
committed by GitHub
parent 1805d5e7d5
commit 5e2f62800c
2 changed files with 10 additions and 1 deletions
@@ -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("<span class='warning'>[src] is not affected by [M]'s disarm attempt!</span>")
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)
@@ -513,6 +513,11 @@
if(target.check_block())
target.visible_message("<span class='warning'>[target] blocks [user]'s disarm attempt!</span>")
return FALSE
if(target.absorb_stun(0))
target.visible_message("<span class='warning'>[target] is not affected by [user]'s disarm attempt!</span>")
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