Armor that is defined to cover the hands/arms/legs/feet now actually protects those bodyparts from toolboxing.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1418 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
n3ophyt3
2011-04-08 18:03:44 +00:00
parent f07e2c0207
commit 63f86a27d0
2 changed files with 23 additions and 58 deletions

View File

@@ -201,7 +201,7 @@
if (M.mutations & 2)
f_dam = 0
if (def_zone == "head")
if (b_dam && (istype(H.head, /obj/item/clothing/head/helmet/) && H.head.body_parts_covered & HEAD) && prob(80 - src.force))
if (b_dam && H.isarmored(affecting) && prob(80 - src.force))
if (prob(20))
affecting.take_damage(power, 0)
else
@@ -245,59 +245,15 @@
else if (user2.w_uniform)
user2.w_uniform.add_blood(H)
affecting.take_damage(b_dam, f_dam)
else if (def_zone == "chest")
if (b_dam && ((istype(H.wear_suit, /obj/item/clothing/suit/armor/)) && H.wear_suit.body_parts_covered & UPPER_TORSO) && prob(90 - src.force))
H.show_message("\red You have been protected from a hit to the chest.")
else if (def_zone == "chest" || def_zone == "groin")
if (b_dam && H.isarmored(affecting) && prob(90 - src.force))
H.show_message("\red You have been protected from a hit to the [affecting.name].")
return
if (b_dam && ((istype(H.r_hand, /obj/item/weapon/shield/riot))) && prob(90 - src.force))
H.show_message("\red You have been protected from a hit to the chest.")
H.show_message("\red You have been protected from a hit to the [affecting.name].")
return
if (b_dam && ((istype(H.l_hand, /obj/item/weapon/shield/riot))) && prob(90 - src.force))
H.show_message("\red You have been protected from a hit to the chest.")
return
if ((b_dam && prob(src.force + affecting.brute_dam + affecting.burn_dam)))
if (prob(50))
if (H.weakened < 5)
H.weakened = 5
for(var/mob/O in viewers(H, null))
O.show_message(text("\red <B>[] has been knocked down!</B>", H), 1, "\red You hear someone fall.", 2)
else
if (H.stunned < 2)
H.stunned = 2
for(var/mob/O in viewers(H, null))
O.show_message(text("\red <B>[] has been stunned!</B>", H), 1)
if(H.stat != 2) H.stat = 1
if (b_dam && prob(25 + (b_dam * 2)))
src.add_blood(H)
if (prob(33))
var/turf/location = H.loc
if (istype(location, /turf/simulated))
location.add_blood(H)
if (H.wear_suit)
H.wear_suit.add_blood(H)
if (H.w_uniform)
H.w_uniform.add_blood(H)
if (istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/user2 = user
if (user2.gloves)
user2.gloves.add_blood(H)
else
user2.add_blood(H)
if (prob(15))
if (user2.wear_suit)
user2.wear_suit.add_blood(H)
else if (user2.w_uniform)
user2.w_uniform.add_blood(H)
affecting.take_damage(b_dam, f_dam)
else if (def_zone == "groin")
if (b_dam && (istype(H.wear_suit, /obj/item/clothing/suit/armor/) && H.wear_suit.body_parts_covered & LOWER_TORSO) && prob(90 - src.force))
H.show_message("\red You have been protected from a hit to the groin (phew).")
return
if (b_dam && ((istype(H.r_hand, /obj/item/weapon/shield/riot))) && prob(90 - src.force))
H.show_message("\red You have been protected from a hit to the groin (phew).")
return
if (b_dam && ((istype(H.l_hand, /obj/item/weapon/shield/riot))) && prob(90 - src.force))
H.show_message("\red You have been protected from a hit to the groin (phew).")
H.show_message("\red You have been protected from a hit to the [affecting.name].")
return
if ((b_dam && prob(src.force + affecting.brute_dam + affecting.burn_dam)))
if (prob(50))
@@ -334,6 +290,9 @@
user2.w_uniform.add_blood(H)
affecting.take_damage(b_dam, f_dam)
else
if (b_dam && H.isarmored(affecting) && prob(80 - src.force))
H.show_message("\red You have been protected from a hit to the [affecting.name].")
return
if (b_dam && prob(25 + (b_dam * 2)))
src.add_blood(H)
if (prob(33))

View File

@@ -218,14 +218,7 @@
if (safe)
return safe.bullet_act(flag, A)
var/armored = 0
if(affecting.name == "head")
if(src.head && istype(src.head,/obj/item/clothing/head/helmet))
armored = 1
else
if(src.wear_suit)
if(affecting.body_part & src.wear_suit.body_parts_covered)
armored = 1
var/armored = src.isarmored(affecting)
if (flag == PROJECTILE_BULLET)
var/d = 51
@@ -2767,3 +2760,16 @@ It can still be worn/put on as normal.
/mob/living/carbon/human/heal_organ_damage(var/brute, var/burn)
..()
src.UpdateDamageIcon()
/mob/living/carbon/human/proc/isarmored(var/datum/organ/external/def_zone)
if(def_zone.name == "head")
if(src.head && istype(src.head,/obj/item/clothing/head/helmet))
if(def_zone.body_part & src.head.body_parts_covered)
return 1
//If targetting the head and there's a helmet there, armored.
else
if(src.wear_suit && istype(src.wear_suit, /obj/item/clothing/suit/armor))
if(def_zone.body_part & src.wear_suit.body_parts_covered)
return 1
//If wearing armor that covers the targetted bodypart, armored.
return 0