From 9e8ee77049119ada8a9e324d74463d132a515c8b Mon Sep 17 00:00:00 2001 From: "giacomand@gmail.com" Date: Fri, 30 Nov 2012 20:18:29 +0000 Subject: [PATCH] -Viruses will now not count towards the chance of infecting someone with virus protection. -Added some extra virus protection to objects. -This should all fix randomly being infected while wearing full virus protection gear. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5233 316c924e-a436-60f5-8080-3fe189b3f50e --- code/__HELPERS/lists.dm | 9 ++++- code/modules/clothing/masks/breath.dm | 3 +- code/modules/clothing/masks/miscellaneous.dm | 2 +- code/modules/clothing/shoes/colour.dm | 2 +- code/modules/mob/mob_cleanup.dm | 35 +++++++------------- 5 files changed, 24 insertions(+), 27 deletions(-) diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm index cfb6d9d2108..7076565f541 100644 --- a/code/__HELPERS/lists.dm +++ b/code/__HELPERS/lists.dm @@ -313,4 +313,11 @@ proc/listclearnulls(list/list) if(index == i) return key i++ - return null \ No newline at end of file + return null + +/proc/count_by_type(var/list/L, type) + var/i = 0 + for(var/T in L) + if(istype(T, type)) + i++ + return i \ No newline at end of file diff --git a/code/modules/clothing/masks/breath.dm b/code/modules/clothing/masks/breath.dm index 08e60eadafa..2279d06aeaf 100644 --- a/code/modules/clothing/masks/breath.dm +++ b/code/modules/clothing/masks/breath.dm @@ -12,4 +12,5 @@ desc = "A close-fitting sterile mask that can be connected to an air supply." name = "medical mask" icon_state = "medical" - item_state = "medical" \ No newline at end of file + item_state = "medical" + permeability_coefficient = 0.01 \ No newline at end of file diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index ad99984d7c1..d0d3ebe8e82 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -24,7 +24,7 @@ w_class = 1 flags = FPRINT|TABLEPASS|MASKCOVERSMOUTH gas_transfer_coefficient = 0.90 - permeability_coefficient = 0.05 + permeability_coefficient = 0.01 armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 25, rad = 0) /obj/item/clothing/mask/fakemoustache diff --git a/code/modules/clothing/shoes/colour.dm b/code/modules/clothing/shoes/colour.dm index e9930cda953..4edc78a46ec 100644 --- a/code/modules/clothing/shoes/colour.dm +++ b/code/modules/clothing/shoes/colour.dm @@ -65,7 +65,7 @@ /obj/item/clothing/shoes/white name = "white shoes" icon_state = "white" - permeability_coefficient = 0.25 + permeability_coefficient = 0.01 color = "white" /obj/item/clothing/shoes/rainbow diff --git a/code/modules/mob/mob_cleanup.dm b/code/modules/mob/mob_cleanup.dm index 6b032a9c077..ab11546364d 100644 --- a/code/modules/mob/mob_cleanup.dm +++ b/code/modules/mob/mob_cleanup.dm @@ -22,10 +22,7 @@ Put (mob/proc)s here that are in dire need of a code cleanup. if(A.GetDiseaseID() in resistances) //world << "It resisted us!" return - var/count = 0 - for(var/datum/disease/advance/AD in viruses) - count++ - if(count >= 3) + if(count_by_type(viruses, /datum/disease/advance) >= 3) return else @@ -118,41 +115,33 @@ Put (mob/proc)s here that are in dire need of a code cleanup. if(1) if(isobj(H.head) && !istype(H.head, /obj/item/weapon/paper)) Cl = H.head - passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) -// world << "Head pass [passed]" + passed = prob((Cl.permeability_coefficient*100) - 1) if(passed && isobj(H.wear_mask)) Cl = H.wear_mask - passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) -// world << "Mask pass [passed]" + passed = prob((Cl.permeability_coefficient*100) - 1) if(2)//arms and legs included if(isobj(H.wear_suit)) Cl = H.wear_suit - passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) -// world << "Suit pass [passed]" + passed = prob((Cl.permeability_coefficient*100) - 1) if(passed && isobj(slot_w_uniform)) Cl = slot_w_uniform - passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) -// world << "Uniform pass [passed]" + passed = prob((Cl.permeability_coefficient*100) - 1) if(3) if(isobj(H.wear_suit) && H.wear_suit.body_parts_covered&HANDS) Cl = H.wear_suit - passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) -// world << "Suit pass [passed]" + passed = prob((Cl.permeability_coefficient*100) - 1) if(passed && isobj(H.gloves)) Cl = H.gloves - passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) -// world << "Gloves pass [passed]" + passed = prob((Cl.permeability_coefficient*100) - 1) if(4) if(isobj(H.wear_suit) && H.wear_suit.body_parts_covered&FEET) Cl = H.wear_suit - passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) -// world << "Suit pass [passed]" + passed = prob((Cl.permeability_coefficient*100) - 1) if(passed && isobj(H.shoes)) Cl = H.shoes - passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) -// world << "Shoes pass [passed]" + passed = prob((Cl.permeability_coefficient*100) - 1) else src << "Something strange's going on, something's wrong." @@ -169,11 +158,11 @@ Put (mob/proc)s here that are in dire need of a code cleanup. if(1) if(M.wear_mask && isobj(M.wear_mask)) Cl = M.wear_mask - passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod) + passed = prob((Cl.permeability_coefficient*100) - 1) //world << "Mask pass [passed]" - if(passed && spread_type == AIRBORNE && internals) - passed = (prob(50*virus.permeability_mod)) + if(!passed && spread_type == AIRBORNE && !internals) + passed = (prob((50*virus.permeability_mod) - 1)) if(passed) //world << "Infection in the mob [src]. YAY"