From 37101b9b3940ab5cbba3dd72ecf50228e7ea2442 Mon Sep 17 00:00:00 2001 From: Anewbe Date: Tue, 28 Nov 2017 23:56:13 -0600 Subject: [PATCH] Contaminated items now respect gloves --- code/ZAS/Phoron.dm | 25 ++++++++++------- .../modules/clothing/spacesuits/spacesuits.dm | 2 ++ code/modules/clothing/suits/bio.dm | 6 +++- code/modules/clothing/suits/utility.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 28 +++++++++++++++---- 5 files changed, 45 insertions(+), 18 deletions(-) diff --git a/code/ZAS/Phoron.dm b/code/ZAS/Phoron.dm index acee6a8b65..fc0d5a1191 100644 --- a/code/ZAS/Phoron.dm +++ b/code/ZAS/Phoron.dm @@ -76,7 +76,8 @@ obj/var/phoronproof = 0 suit_contamination() if(!pl_head_protected()) - if(prob(1)) suit_contamination() //Phoron can sometimes get through such an open suit. + if(prob(1)) + suit_contamination() //Phoron can sometimes get through such an open suit. //Cannot wash backpacks currently. // if(istype(back,/obj/item/weapon/storage/backpack)) @@ -88,7 +89,8 @@ obj/var/phoronproof = 0 //Handles all the bad things phoron can do. //Contamination - if(vsc.plc.CLOTH_CONTAMINATION) contaminate() + if(vsc.plc.CLOTH_CONTAMINATION) + contaminate() //Anything else requires them to not be dead. if(stat >= 2) @@ -139,22 +141,22 @@ obj/var/phoronproof = 0 Blind(20) /mob/living/carbon/human/proc/pl_head_protected() - //Checks if the head is adequately sealed. + //Checks if the head is adequately sealed. //This is just odd. TODO: Make this respect the body_parts_covered stuff like thermal gear does. if(head) if(vsc.plc.PHORONGUARD_ONLY) - if(head.flags & PHORONGUARD) + if(head.flags & PHORONGUARD || head.phoronproof) return 1 else if(head.body_parts_covered & EYES) return 1 return 0 /mob/living/carbon/human/proc/pl_suit_protected() - //Checks if the suit is adequately sealed. + //Checks if the suit is adequately sealed. //This is just odd. TODO: Make this respect the body_parts_covered stuff like thermal gear does. var/coverage = 0 - for(var/obj/item/protection in list(wear_suit, gloves, shoes)) + for(var/obj/item/protection in list(wear_suit, gloves, shoes)) //This is why it's odd. If I'm in a full suit, but my shoes and gloves aren't phoron proof, damage. if(!protection) continue - if(vsc.plc.PHORONGUARD_ONLY && !(protection.flags & PHORONGUARD)) + if(vsc.plc.PHORONGUARD_ONLY && !(protection.flags & PHORONGUARD) && !protection.phoronproof) return 0 coverage |= protection.body_parts_covered @@ -165,9 +167,12 @@ obj/var/phoronproof = 0 /mob/living/carbon/human/proc/suit_contamination() //Runs over the things that can be contaminated and does so. - if(w_uniform) w_uniform.contaminate() - if(shoes) shoes.contaminate() - if(gloves) gloves.contaminate() + if(w_uniform) + w_uniform.contaminate() + if(shoes) + shoes.contaminate() + if(gloves) + gloves.contaminate() turf/Entered(obj/item/I) diff --git a/code/modules/clothing/spacesuits/spacesuits.dm b/code/modules/clothing/spacesuits/spacesuits.dm index 52f6a9103f..ccbbf56ab2 100644 --- a/code/modules/clothing/spacesuits/spacesuits.dm +++ b/code/modules/clothing/spacesuits/spacesuits.dm @@ -16,6 +16,7 @@ siemens_coefficient = 0.9 species_restricted = list("exclude","Diona") preserve_item = 1 + phoronproof = 1 var/obj/machinery/camera/camera var/list/camera_networks @@ -61,6 +62,7 @@ siemens_coefficient = 0.9 species_restricted = list("exclude","Diona") preserve_item = 1 + phoronproof = 1 var/list/supporting_limbs //If not-null, automatically splints breaks. Checked when removing the suit. diff --git a/code/modules/clothing/suits/bio.dm b/code/modules/clothing/suits/bio.dm index c6eb2ac459..32cb6551fe 100644 --- a/code/modules/clothing/suits/bio.dm +++ b/code/modules/clothing/suits/bio.dm @@ -8,6 +8,8 @@ flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|BLOCKHAIR body_parts_covered = HEAD|FACE|EYES siemens_coefficient = 0.9 + item_flags = THICKMATERIAL + phoronproof = 1 /obj/item/clothing/suit/bio_suit name = "bio suit" @@ -16,12 +18,14 @@ w_class = ITEMSIZE_LARGE//bulky item gas_transfer_coefficient = 0.01 permeability_coefficient = 0.01 - body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS + body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS|HANDS|FEET slowdown = 1.0 allowed = list(/obj/item/weapon/tank/emergency/oxygen,/obj/item/weapon/pen,/obj/item/device/flashlight/pen) armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 100, rad = 20) flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETAIL|HIDETIE|HIDEHOLSTER siemens_coefficient = 0.9 + item_flags = THICKMATERIAL + phoronproof = 1 //Standard biosuit, orange stripe /obj/item/clothing/head/bio_hood/general diff --git a/code/modules/clothing/suits/utility.dm b/code/modules/clothing/suits/utility.dm index 7e951f57e1..1965a5873a 100644 --- a/code/modules/clothing/suits/utility.dm +++ b/code/modules/clothing/suits/utility.dm @@ -95,4 +95,4 @@ slowdown = 1.5 armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 60, rad = 100) flags_inv = HIDEJUMPSUIT|HIDETAIL|HIDETIE|HIDEHOLSTER - item_flags = THICKMATERIAL + item_flags = THICKMATERIAL \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 737a6ec7ed..562450d3a1 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -816,18 +816,34 @@ if(!isSynthetic()) - if(touching) touching.metabolize() - if(ingested) ingested.metabolize() - if(bloodstr) bloodstr.metabolize() + if(touching) + touching.metabolize() + if(ingested) + ingested.metabolize() + if(bloodstr) + bloodstr.metabolize() var/total_phoronloss = 0 for(var/obj/item/I in src) if(I.contaminated) if(src.species && src.species.get_bodytype() != "Vox") - total_phoronloss += vsc.plc.CONTAMINATION_LOSS - if(!(status_flags & GODMODE)) adjustToxLoss(total_phoronloss) + // This is hacky, I'm so sorry. + if(I != l_hand && I != r_hand) //If the item isn't in your hands, you're probably wearing it. Full damage for you. + total_phoronloss += vsc.plc.CONTAMINATION_LOSS + else if(I == l_hand) //If the item is in your hands, but you're wearing protection, you might be alright. + var/l_hand_blocked = 0 + l_hand_blocked = 1-(100-getarmor(BP_L_HAND, "bio"))/100 //This should get a number between 0 and 1 + total_phoronloss += vsc.plc.CONTAMINATION_LOSS * l_hand_blocked + else if(I == r_hand) //If the item is in your hands, but you're wearing protection, you might be alright. + var/r_hand_blocked = 0 + r_hand_blocked = 1-(100-getarmor(BP_R_HAND, "bio"))/100 //This should get a number between 0 and 1 + total_phoronloss += vsc.plc.CONTAMINATION_LOSS * r_hand_blocked + if(total_phoronloss) + if(!(status_flags & GODMODE)) + adjustToxLoss(total_phoronloss) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & GODMODE) + return 0 //godmode var/obj/item/organ/internal/diona/node/light_organ = locate() in internal_organs