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

@@ -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