mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
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:
@@ -187,11 +187,13 @@ emp_act
|
||||
|
||||
// Handle striking to cripple.
|
||||
if(user.a_intent == I_DISARM)
|
||||
effective_force /= 2
|
||||
if(..(I, user, effective_force, blocked, hit_zone))
|
||||
attack_joint(affecting, I, blocked)
|
||||
else
|
||||
effective_force *= 0.66 //reduced effective force...
|
||||
if(!..(I, user, effective_force, blocked, hit_zone))
|
||||
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(!..())
|
||||
return 0
|
||||
|
||||
@@ -242,7 +244,7 @@ emp_act
|
||||
|
||||
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)
|
||||
return 0
|
||||
|
||||
@@ -250,8 +252,8 @@ emp_act
|
||||
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)))
|
||||
var/dislocate_chance = effective_force/(dislocate_mult * organ.min_broken_damage * config.organ_health_multiplier)*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>")
|
||||
organ.dislocate(1)
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user