Refactors and tweaks krav maga disarms (#15722)

* refactors stinky krav disarms

* refactors the refactor of disarm messages

maybe it shouldn't say it disarmed when it didn't for NODROP, and it should definitely not duplicate DROPDEL items...

* do the same for CQC

* Apply suggestions from code review

Co-authored-by: dearmochi <1496804+dearmochi@users.noreply.github.com>

* Update code/modules/martial_arts/krav_maga.dm

* Update code/modules/martial_arts/cqc.dm

Co-authored-by: dearmochi <1496804+dearmochi@users.noreply.github.com>
This commit is contained in:
S34N
2021-07-29 07:57:29 -04:00
committed by GitHub
co-authored by dearmochi
parent 63573dd060
commit 755ddf169f
2 changed files with 7 additions and 14 deletions
+2 -2
View File
@@ -76,8 +76,8 @@
I = D.get_active_hand()
D.visible_message("<span class='warning'>[A] strikes [D]'s jaw with their hand!</span>", \
"<span class='userdanger'>[A] strikes your jaw, disorienting you!</span>")
playsound(get_turf(D), 'sound/weapons/cqchit1.ogg', 50, 1, -1)
if(I && D.drop_item())
playsound(get_turf(D), 'sound/weapons/cqchit1.ogg', 50, TRUE, -1)
if(D.unEquip(I) && !(QDELETED(I) || (I.flags & ABSTRACT)))
A.put_in_hands(I)
D.Jitter(2)
D.apply_damage(5, BRUTE)
+5 -12
View File
@@ -104,20 +104,13 @@
/datum/martial_art/krav_maga/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
MARTIAL_ARTS_ACT_CHECK
if(prob(60))
if(D.hand)
if(istype(D.l_hand, /obj/item))
var/obj/item/I = D.l_hand
if(D.drop_item())
A.put_in_hands(I)
else
if(istype(D.r_hand, /obj/item))
var/obj/item/I = D.r_hand
if(D.drop_item())
A.put_in_hands(I)
var/obj/item/I = D.get_active_hand()
if(prob(60) && D.unEquip(I))
if(!(QDELETED(I) || (I.flags & ABSTRACT)))
A.put_in_hands(I)
D.visible_message("<span class='danger'>[A] has disarmed [D]!</span>", \
"<span class='userdanger'>[A] has disarmed [D]!</span>")
playsound(D, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
playsound(D, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)
else
D.visible_message("<span class='danger'>[A] attempted to disarm [D]!</span>", \
"<span class='userdanger'>[A] attempted to disarm [D]!</span>")