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"