-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
This commit is contained in:
giacomand@gmail.com
2012-11-30 20:18:29 +00:00
parent cd2fcfc920
commit 9e8ee77049
5 changed files with 24 additions and 27 deletions

View File

@@ -313,4 +313,11 @@ proc/listclearnulls(list/list)
if(index == i) if(index == i)
return key return key
i++ i++
return null 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

View File

@@ -12,4 +12,5 @@
desc = "A close-fitting sterile mask that can be connected to an air supply." desc = "A close-fitting sterile mask that can be connected to an air supply."
name = "medical mask" name = "medical mask"
icon_state = "medical" icon_state = "medical"
item_state = "medical" item_state = "medical"
permeability_coefficient = 0.01

View File

@@ -24,7 +24,7 @@
w_class = 1 w_class = 1
flags = FPRINT|TABLEPASS|MASKCOVERSMOUTH flags = FPRINT|TABLEPASS|MASKCOVERSMOUTH
gas_transfer_coefficient = 0.90 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) armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 25, rad = 0)
/obj/item/clothing/mask/fakemoustache /obj/item/clothing/mask/fakemoustache

View File

@@ -65,7 +65,7 @@
/obj/item/clothing/shoes/white /obj/item/clothing/shoes/white
name = "white shoes" name = "white shoes"
icon_state = "white" icon_state = "white"
permeability_coefficient = 0.25 permeability_coefficient = 0.01
color = "white" color = "white"
/obj/item/clothing/shoes/rainbow /obj/item/clothing/shoes/rainbow

View File

@@ -22,10 +22,7 @@ Put (mob/proc)s here that are in dire need of a code cleanup.
if(A.GetDiseaseID() in resistances) if(A.GetDiseaseID() in resistances)
//world << "It resisted us!" //world << "It resisted us!"
return return
var/count = 0 if(count_by_type(viruses, /datum/disease/advance) >= 3)
for(var/datum/disease/advance/AD in viruses)
count++
if(count >= 3)
return return
else else
@@ -118,41 +115,33 @@ Put (mob/proc)s here that are in dire need of a code cleanup.
if(1) if(1)
if(isobj(H.head) && !istype(H.head, /obj/item/weapon/paper)) if(isobj(H.head) && !istype(H.head, /obj/item/weapon/paper))
Cl = H.head Cl = H.head
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) passed = prob((Cl.permeability_coefficient*100) - 1)
// world << "Head pass [passed]"
if(passed && isobj(H.wear_mask)) if(passed && isobj(H.wear_mask))
Cl = H.wear_mask Cl = H.wear_mask
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) passed = prob((Cl.permeability_coefficient*100) - 1)
// world << "Mask pass [passed]"
if(2)//arms and legs included if(2)//arms and legs included
if(isobj(H.wear_suit)) if(isobj(H.wear_suit))
Cl = H.wear_suit Cl = H.wear_suit
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) passed = prob((Cl.permeability_coefficient*100) - 1)
// world << "Suit pass [passed]"
if(passed && isobj(slot_w_uniform)) if(passed && isobj(slot_w_uniform))
Cl = slot_w_uniform Cl = slot_w_uniform
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) passed = prob((Cl.permeability_coefficient*100) - 1)
// world << "Uniform pass [passed]"
if(3) if(3)
if(isobj(H.wear_suit) && H.wear_suit.body_parts_covered&HANDS) if(isobj(H.wear_suit) && H.wear_suit.body_parts_covered&HANDS)
Cl = H.wear_suit Cl = H.wear_suit
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) passed = prob((Cl.permeability_coefficient*100) - 1)
// world << "Suit pass [passed]"
if(passed && isobj(H.gloves)) if(passed && isobj(H.gloves))
Cl = H.gloves Cl = H.gloves
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) passed = prob((Cl.permeability_coefficient*100) - 1)
// world << "Gloves pass [passed]"
if(4) if(4)
if(isobj(H.wear_suit) && H.wear_suit.body_parts_covered&FEET) if(isobj(H.wear_suit) && H.wear_suit.body_parts_covered&FEET)
Cl = H.wear_suit Cl = H.wear_suit
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) passed = prob((Cl.permeability_coefficient*100) - 1)
// world << "Suit pass [passed]"
if(passed && isobj(H.shoes)) if(passed && isobj(H.shoes))
Cl = H.shoes Cl = H.shoes
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) passed = prob((Cl.permeability_coefficient*100) - 1)
// world << "Shoes pass [passed]"
else else
src << "Something strange's going on, something's wrong." 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(1)
if(M.wear_mask && isobj(M.wear_mask)) if(M.wear_mask && isobj(M.wear_mask))
Cl = 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]" //world << "Mask pass [passed]"
if(passed && spread_type == AIRBORNE && internals) if(!passed && spread_type == AIRBORNE && !internals)
passed = (prob(50*virus.permeability_mod)) passed = (prob((50*virus.permeability_mod) - 1))
if(passed) if(passed)
//world << "Infection in the mob [src]. YAY" //world << "Infection in the mob [src]. YAY"