From 4b055218bea11b2a3f54ce982e65bf4bc3164e81 Mon Sep 17 00:00:00 2001 From: ven1883 <129563993+ven1883@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:25:58 -0500 Subject: [PATCH] inherent armor you can do the thing --- code/modules/mob/living/carbon/human/human_defense.dm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index a51504d92cd9..f7b0eba1fc65 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -25,10 +25,15 @@ return 0 var/protection = 100 var/list/covering_clothing = list(head, wear_mask, wear_suit, w_uniform, back, gloves, shoes, belt, s_store, glasses, ears, wear_id, wear_neck) //Everything but pockets. Pockets are l_store and r_store. (if pockets were allowed, putting something armored, gloves or hats for example, would double up on the armor) + var/inherent_armor_rating = src.armor?.get_rating(damage_type) //monkestation edit, exists for debugger for(var/obj/item/clothing/clothing_item in covering_clothing) if(clothing_item.body_parts_covered & def_zone.body_part) protection *= (100 - min(clothing_item.get_armor_rating(damage_type), 100)) * 0.01 - protection *= (100 - min(physiology.armor.get_rating(damage_type), 100)) * 0.01 + //monkestation edit start + protection *= (100 - min(physiology.armor.get_rating(damage_type), 100)) / 100 + protection *= isnull(inherent_armor_rating) ? 1 : (100 - inherent_armor_rating) / 100 + //end monkeststation edit: now checks src.armor so you can give characters inherent armor without targeting physiology or generating clothing + //you can use this with "target.set_armor" and it will work on live creatures return 100 - protection ///Get all the clothing on a specific body part