Adjusts attack_joint() so that disarm attacking is actually useful

If disarm attacking deals half damage but is expected to deal half
the damage to the limb before dislocating it, it's not any more useful
than just breaking their limbs, other than the fact that you do less damage
This commit is contained in:
HarpyEagle
2016-05-26 13:51:21 -04:00
committed by Yoshax
parent 6ecf6bc154
commit b410d43eb5

View File

@@ -187,11 +187,13 @@ emp_act
// Handle striking to cripple. // Handle striking to cripple.
if(user.a_intent == I_DISARM) if(user.a_intent == I_DISARM)
effective_force /= 2 effective_force *= 0.66 //reduced effective force...
if(..(I, user, effective_force, blocked, hit_zone)) if(!..(I, user, effective_force, blocked, hit_zone))
attack_joint(affecting, I, blocked)
else
return 0 return 0
//set the dislocate mult less than the effective force mult so that
//dislocating limbs on disarm is a bit easier than breaking limbs on harm
attack_joint(affecting, I, effective_force, 0.5, blocked) //...but can dislocate joints
else if(!..()) else if(!..())
return 0 return 0
@@ -242,7 +244,7 @@ emp_act
return 1 return 1
/mob/living/carbon/human/proc/attack_joint(var/obj/item/organ/external/organ, var/obj/item/W, var/blocked) /mob/living/carbon/human/proc/attack_joint(var/obj/item/organ/external/organ, var/obj/item/W, var/effective_force, var/dislocate_mult, var/blocked)
if(!organ || (organ.dislocated == 2) || (organ.dislocated == -1) || blocked >= 100) if(!organ || (organ.dislocated == 2) || (organ.dislocated == -1) || blocked >= 100)
return 0 return 0
@@ -250,8 +252,8 @@ emp_act
return 0 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 //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 var/dislocate_chance = effective_force/(dislocate_mult * organ.min_broken_damage * config.organ_health_multiplier)*100
if(prob(dislocate_chance * (W.force * (100 - blocked)/100))) if(prob(dislocate_chance * (100 - blocked)/100))
visible_message("<span class='danger'>[src]'s [organ.joint] [pick("gives way","caves in","crumbles","collapses")]!</span>") visible_message("<span class='danger'>[src]'s [organ.joint] [pick("gives way","caves in","crumbles","collapses")]!</span>")
organ.dislocate(1) organ.dislocate(1)
return 1 return 1