From f49e709394377054d7c32863c13a933babee517b Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 14 Jul 2014 23:59:10 -0400 Subject: [PATCH 1/3] Fixes organs not being removed due to damage Because the dismemberment check was being done before brute_dam was updated, the attack that actually brought brute_dam above the threshold would not be able to pass the check, regardless of how much damage was actually done. --- code/modules/organs/organ_external.dm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index b885d7610e..fcf458871a 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -90,13 +90,6 @@ brute *= brmod //~2/3 damage for ROBOLIMBS burn *= bumod //~2/3 damage for ROBOLIMBS - //If limb took enough damage, try to cut or tear it off - if(body_part != UPPER_TORSO && body_part != LOWER_TORSO) //as hilarious as it is, getting hit on the chest too much shouldn't effectively gib you. - if(config.limbs_can_break && brute_dam >= max_damage * config.organ_health_multiplier) - if( (edge && prob(5 * brute)) || (brute > 20 && prob(2 * brute)) ) - droplimb(1) - return - // High brute damage or sharp objects may damage internal organs if(internal_organs && ( (sharp && brute >= 5) || brute >= 10) && prob(5)) // Damage an internal organ @@ -161,6 +154,14 @@ // sync the organ's damage with its wounds src.update_damages() + + //If limb took enough damage, try to cut or tear it off + if(body_part != UPPER_TORSO && body_part != LOWER_TORSO) //as hilarious as it is, getting hit on the chest too much shouldn't effectively gib you. + if(config.limbs_can_break && brute_dam >= max_damage * config.organ_health_multiplier) + if( (edge && prob(5 * brute)) || (brute > 20 && prob(2 * brute)) ) + droplimb(1) + return + owner.updatehealth() var/result = update_icon() From 4448784402f8d48b218f714758deecf67fc77ee0 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Tue, 15 Jul 2014 00:07:34 -0400 Subject: [PATCH 2/3] Fixes suits being punctured by projectiles when... ...fully blocked by a shield. --- code/modules/mob/living/carbon/human/human_defense.dm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 1d57e629d0..1b3be43ddd 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -51,11 +51,6 @@ emp_act return -1 // complete projectile permutation - if(check_shields(P.damage, "the [P.name]")) - P.on_hit(src, 2, def_zone) - handle_suit_punctures(P.damage_type, P.damage) - return 2 - //BEGIN BOOK'S TASER NERF. if(istype(P, /obj/item/projectile/beam/stun)) var/datum/organ/external/select_area = get_organ(def_zone) // We're checking the outside, buddy! @@ -89,6 +84,10 @@ emp_act return //END TASER NERF + if(check_shields(P.damage, "the [P.name]")) + P.on_hit(src, 2, def_zone) + return 2 + var/datum/organ/external/organ = get_organ(check_zone(def_zone)) var/armor = getarmor_organ(organ, "bullet") From fd6181c54f7a6760d6ebc999ea0964d541c1cd57 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Tue, 15 Jul 2014 01:30:32 -0400 Subject: [PATCH 3/3] Fixes melee attacks using area effect armour values def_zone is normally not set when attacking with a melee weapon, and the melee armour check didn't use target_zone for some reason. --- code/modules/mob/living/carbon/human/human_defense.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 1b3be43ddd..06783d6d51 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -189,7 +189,8 @@ emp_act /mob/living/carbon/human/proc/attacked_by(var/obj/item/I, var/mob/living/user, var/def_zone) if(!I || !user) return 0 - var/target_zone = get_zone_with_miss_chance(user.zone_sel.selecting, src) + var/target_zone = def_zone? def_zone : get_zone_with_miss_chance(user.zone_sel.selecting, src) + if(user == src) // Attacking yourself can't miss target_zone = user.zone_sel.selecting if(!target_zone) @@ -228,7 +229,7 @@ emp_act var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].") var/weapon_sharp = is_sharp(I) var/weapon_edge = has_edge(I) - if ((weapon_sharp || weapon_edge) && prob(getarmor(def_zone, "melee"))) + if ((weapon_sharp || weapon_edge) && prob(getarmor(target_zone, "melee"))) weapon_sharp = 0 weapon_edge = 0