Makes stun batons respect shields upon hit

This commit is contained in:
Xhuis
2015-12-19 22:05:35 -05:00
parent f38403f115
commit 4136e49b2b

View File

@@ -123,8 +123,9 @@
if(baton_stun(L, user))
user.do_attack_animation(L)
return
L.visible_message("<span class='warning'>[user] has prodded [L] with [src]. Luckily it was off.</span>", \
"<span class='warning'>[user] has prodded you with [src]. Luckily it was off</span>")
else
L.visible_message("<span class='warning'>[user] has prodded [L] with [src]. Luckily it was off.</span>", \
"<span class='warning'>[user] has prodded you with [src]. Luckily it was off</span>")
else
if(status)
baton_stun(L, user)
@@ -132,6 +133,11 @@
/obj/item/weapon/melee/baton/proc/baton_stun(mob/living/L, mob/user)
if(ishuman(L))
var/mob/living/carbon/human/H = L
if(H.check_shields(0, "[user]'s [name]", src, MELEE_ATTACK)) //No message; check_shields() handles that
playsound(L, 'sound/weapons/Genhit.ogg', 50, 1)
return 0
if(isrobot(loc))
var/mob/living/silicon/robot/R = loc
if(!R || !R.cell || !R.cell.use(hitcost))