From 36e53d4b98a3f2dd1a30509ed6a85b6b7bb7ac0d Mon Sep 17 00:00:00 2001 From: HarpyEagle Date: Tue, 24 May 2016 11:47:11 -0400 Subject: [PATCH] Fixes disarm-attacking being very likely to break the limb before dislocating it. Also makes it possible to 'strike to cripple' with stunbatons --- code/game/objects/items/weapons/stunbaton.dm | 2 +- code/modules/mob/living/carbon/human/human_defense.dm | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index b7e55cddb8..5e01c43e55 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -122,7 +122,7 @@ var/mob/living/carbon/human/H = target affecting = H.get_organ(hit_zone) - if(user.a_intent == I_HURT) + if(user.a_intent == I_HURT || user.a_intent == I_DISARM) . = ..() //whacking someone causes a much poorer electrical contact than deliberately prodding them. agony *= 0.5 diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 614bbe1de8..810946f26f 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -245,7 +245,13 @@ emp_act /mob/living/carbon/human/proc/attack_joint(var/obj/item/organ/external/organ, var/obj/item/W, var/blocked) if(!organ || (organ.dislocated == 2) || (organ.dislocated == -1) || blocked >= 100) return 0 - if(prob(W.force * (100 - blocked)/100)) + + if(W.damtype != BRUTE) + return 0 + + //want the dislocation chance to be such that the limb is expected to dislocate after dealing a fraction of the damage needed to break the limb + var/dislocate_chance = (W.force/2)/(0.5 * organ.min_broken_damage * config.organ_health_multiplier)*100 + if(prob(dislocate_chance * (W.force * (100 - blocked)/100))) visible_message("[src]'s [organ.joint] [pick("gives way","caves in","crumbles","collapses")]!") organ.dislocate(1) return 1